Fix floating-point asymmetry of AMR cell-centered prolong/restrict operators #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
While I wasn't planning on immediately fixing the AMR asymmetries that manifested even after merging #112, the issues turned out to be limited to two separate causes that were easy to address:
src/mesh/mesh_refinement.cpp
had an implicit directional bias due to left-to-right floating point associativity, much like PPM in Fix general asymmetry of x1f, dx1v Coordinates terms; ensure exact float64 symmetry of PPM stencils #98.I only fixed the simple second issue here. Also, I copied and enrolled the user
RefinementCondition()
from thepgen/kh.cpp
file topgen/rt.cpp
.Testing and validation
AMR tested with the Rayleigh-Taylor problem with 2 levels of refinement (and
mesh/derfef_count=5
) on a 500x1000 base mesh with 50x50 MeshBlocks. Output was loaded withathena_read.py
-- although it does not have bitwise correctness re: coordinate positions, it can compute the exact symmetry differences, which were exactly 0.0 for the PR version of the code:rt-ppm-nx1-amr-fixed-nompi.pdf
No MPI used;
icc
18 with-fp-model strict
enabled.To-do
RefinementCondition()
to some problem-specific threshold