parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
105 stars 33 forks source link

Bugfix: Resymmetrize logical coordinates #1098

Closed lroberts36 closed 3 weeks ago

lroberts36 commented 1 month ago

PR Summary

Originally, Athena++ transformed integer logical coordinates into floating point logical coordinates in the range [-0.5, 0.5]. In #911, I changed this to map to the range [0, 1]. As @pgrete has pointed out, the new range breaks floating point symmetry (see the comment at the end of this athena++ document at the very bottom). This in turn causes static mesh refinement to operate differently due to roundoff error and block coordinates to not be bitwise exact with the original coordinate positions for single tree forests. This PR switches back to symmetrized floating-point logical coordinates and back to the exact algorithm used for finding static refinement regions from before #911.

PR Checklist

lroberts36 commented 1 month ago

It also effects the coordinates of blocks at roundoff, but I don't think this is as big of an issue as the impact on SMR (where the refinement structure was different in some cases with the exact same input). That being said, it probably broke exact symmetry (if it ever existed in any downstream code).