Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Resymmetrize logical coordinates #1098

Merged
merged 43 commits into from
Jun 10, 2024

Conversation

lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented Jun 6, 2024

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

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

@lroberts36 lroberts36 added the bug Something isn't working label Jun 6, 2024
@lroberts36 lroberts36 changed the base branch from develop to lroberts36/refactor-mesh-constructors June 6, 2024 23:24
@lroberts36 lroberts36 changed the title WIP: Bugfix: Resymmetrize logical coordinates Bugfix: Resymmetrize logical coordinates Jun 6, 2024
Copy link
Collaborator

@pdmullen pdmullen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round-off error strikes again! Happy to approve assuming that it fixes @pgrete's issue. Also, I'd like to understand why this only affects SMR? Shouldn't this have affected symmetry more generally?

@lroberts36
Copy link
Collaborator Author

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).

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I also like the new names better.

Copy link
Collaborator

@pgrete pgrete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and I can confirm that this results in the expected mesh again (though other issue still persist with restarts, but I'll track those down separately).

I suggest to wait clicking merge on this PR until #1055 is in develop, then change the target branch and pull the trigger here.
This way we get a clean history (which may at some point be useful for bisects)

src/mesh/mesh.cpp Show resolved Hide resolved
@lroberts36 lroberts36 changed the base branch from lroberts36/refactor-mesh-constructors to develop June 10, 2024 21:04
@lroberts36 lroberts36 changed the base branch from develop to lroberts36/refactor-mesh-constructors June 10, 2024 21:10
@lroberts36 lroberts36 changed the base branch from lroberts36/refactor-mesh-constructors to develop June 10, 2024 21:12
@lroberts36 lroberts36 enabled auto-merge June 10, 2024 21:13
@lroberts36 lroberts36 disabled auto-merge June 10, 2024 21:37
@lroberts36 lroberts36 enabled auto-merge June 10, 2024 21:37
@lroberts36 lroberts36 merged commit b28c738 into develop Jun 10, 2024
49 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants