-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fixing divergence error with AMR (Issue #617) #625
base: master
Are you sure you want to change the base?
Conversation
Strore the AMR buffer sizes instead of calculating it at every step.
failure from the
|
another error:
|
@tomidakn can you check that my latest suggestion is what is intendend? I had to remind myself of the counter-intuitivie operator precedence rules in C re: bitwise operators and arithmetic operators. Interestingly, ChatGPT 4o-mini gets it wrong: |
It was my mistake and I have to thank the compiler.
I'm afraid I made the same mistake as Chat-GPT. |
Wow, I also didn't appreciate the pgen_compile test much and often blame that it is too picky. But, now I see why we have that! |
retest this on stellar |
see, I didnt just implement these strict tests just to be annoying! 😂 |
@@ -78,6 +78,26 @@ struct LogicalLocation { // aggregate and POD type | |||
//! prototype for overloading the comparison operator (defined in meshblock_tree.cpp) | |||
bool operator==(const LogicalLocation &l1, const LogicalLocation &l2); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you say a bit about why this moved from being a (mostly?) "multigrid-specific" feature?
I see that the LogicalLocationHash
and unordered_map
's are currently used in Multigrid and meshblock_tree.*
Can you say more about the maps / can the same maps be shared across these classes?
This is to fix the divergence error with AMR reported in #617.
When a MeshBlock contacting a finer MeshBlock is refined, the original code refined normal B-fields on the shared face by interpolating the coarser fields, but they do not exactly match the existing finer fields on the already refined neighbor MeshBlock. With this commit, the shared face fields are copied from the finer MeshBlock, hence enforcing the divergence B constraint.
Prerequisite checklist