Summary
Add a helper (toolchain utility and/or smarter case-file parameterization) to make hyperbolic-tangent grid-stretching parameters easier to choose. Today users have to hand-tune the raw stretch parameters (a_x, x_a, x_b, loops_x, etc.) by trial and error, which is unintuitive and error-prone.
Motivation
This came out of the discussion on #1625, which fixed MPI-rank-dependent divergent grid stretching. Now that stretching is rank-invariant, it's a good time to make setup friendlier. As @danieljvickers suggested:
I think it may also be neat to add a grid-stretching helper to the toolchain or a smarter parameter grid stretching in the case files to make getting your parameters more obvious. Something to help people with parameter selection based on their desired domain size, uniform region, uniform spacing, etc.
Proposed idea
Let users specify what they actually care about, and derive the raw stretch parameters from it:
- desired total domain size
- extent of the uniform (unstretched) region
- target spacing in the uniform region
- (optionally) growth rate or max spacing at the domain edge
The helper would solve for the underlying stretch parameters and either emit them for the case file or expose a higher-level interface directly in the case file.
Notes / open questions
- Should this live in the Python toolchain as a helper users call when building a case, or as new case-file parameters resolved in pre-process?
- Worth a small validation/plotting utility so users can preview the resulting grid spacing before running.
Follow-up to #1625.
Summary
Add a helper (toolchain utility and/or smarter case-file parameterization) to make hyperbolic-tangent grid-stretching parameters easier to choose. Today users have to hand-tune the raw stretch parameters (
a_x,x_a,x_b,loops_x, etc.) by trial and error, which is unintuitive and error-prone.Motivation
This came out of the discussion on #1625, which fixed MPI-rank-dependent divergent grid stretching. Now that stretching is rank-invariant, it's a good time to make setup friendlier. As @danieljvickers suggested:
Proposed idea
Let users specify what they actually care about, and derive the raw stretch parameters from it:
The helper would solve for the underlying stretch parameters and either emit them for the case file or expose a higher-level interface directly in the case file.
Notes / open questions
Follow-up to #1625.