Skip to content

Commit

Permalink
Update grid_stretching_ratio check for realistic input
Browse files Browse the repository at this point in the history
  • Loading branch information
ewquon committed Nov 13, 2023
1 parent e79c8e1 commit 4cae5f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 | | |
Expand Down
8 changes: 5 additions & 3 deletions Source/DataStructs/DataStruct.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4cae5f5

Please sign in to comment.