From 4cae5f5965e1907b6227a89450bdd0c41265971c Mon Sep 17 00:00:00 2001 From: Eliot Quon Date: Mon, 13 Nov 2023 11:27:16 -0700 Subject: [PATCH] Update grid_stretching_ratio check for realistic input --- Docs/sphinx_doc/Inputs.rst | 2 +- Source/DataStructs/DataStruct.H | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Docs/sphinx_doc/Inputs.rst b/Docs/sphinx_doc/Inputs.rst index faaf43adf..f84e5180a 100644 --- a/Docs/sphinx_doc/Inputs.rst +++ b/Docs/sphinx_doc/Inputs.rst @@ -183,7 +183,7 @@ List of Parameters | Parameter | Definition | Acceptable | Default | | | | Values | | +===============================+=================+=================+=============+ -| **erf.grid_stretching_ratio** | scaling factor | Real > 0 | 0 (no grid | +| **erf.grid_stretching_ratio** | scaling factor | Real > 1 | 0 (no grid | | | applied to | | stretching) | | | delta z at each | | | | | level | | | diff --git a/Source/DataStructs/DataStruct.H b/Source/DataStructs/DataStruct.H index abf87a276..80e684ef1 100644 --- a/Source/DataStructs/DataStruct.H +++ b/Source/DataStructs/DataStruct.H @@ -46,9 +46,11 @@ struct SolverChoice { pp.query("use_terrain", use_terrain); pp.query("grid_stretching_ratio", grid_stretching_ratio); - AMREX_ASSERT_WITH_MESSAGE((grid_stretching_ratio >= 0.), - "The grid stretching ratio must be greater than 0"); - if (grid_stretching_ratio > 0) { + if (grid_stretching_ratio != 0) { + AMREX_ASSERT_WITH_MESSAGE((grid_stretching_ratio >= 1.), + "The grid stretching ratio must be greater than 1"); + } + if (grid_stretching_ratio >= 1) { if (!use_terrain) { amrex::Print() << "Turning terrain on to enable grid stretching" << std::endl; use_terrain = true;