-
Notifications
You must be signed in to change notification settings - Fork 34
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
Periodic mesh bugfix and test #884
Conversation
…iodic meshes and avoid a double-delete between the mfem mesh and sidre
Codecov Report
@@ Coverage Diff @@
## develop #884 +/- ##
===========================================
+ Coverage 94.70% 94.75% +0.05%
===========================================
Files 152 153 +1
Lines 10696 10763 +67
===========================================
+ Hits 10130 10199 +69
+ Misses 566 564 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
// indicates that the mesh is periodic and the new nodal grid function must also | ||
// be discontinuous. | ||
bool is_discontinuous = false; | ||
auto nodes = pmesh->GetNodes(); |
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.
Can't GetNodes()
return NULL
for other reasons (unrelated to periodicity of the mesh)?
I've asked mfem to clarify the preconditions of this function before, but it's still essentially undocumented.
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.
Yes. However, if it is a periodic mesh this will be non-null as it needs the discontinuous basis function. That is why I have the default of false on line 239.
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.
Ah, I misunderstood what this was doing
Some other thoughts:
To summarize, even the example meshes featured on mfem website will not enforce periodicity correctly in many use cases. I think it's worth managing expectations by warning the user (if we detect a periodic mesh) that things may not work, for reasons out of our control.
|
Good point. I'll add a "buyer beware" warning if a user supplies a periodic mesh. |
// Determine if the existing nodal grid function is discontinuous. This | ||
// indicates that the mesh is periodic and the new nodal grid function must also | ||
// be discontinuous. | ||
bool is_discontinuous = false; |
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.
Can these two duplicate sections be unified into a function w/o too much effort?
I double checked in my branch with a representative test and these changes seem to fix the issues I had. Thank you! |
This ensures that the mesh nodal grid function uses discontinuous basis functions when the supplied mesh is periodic. It also fixes a bug that the nodal grid function could be double deleted between the
mfem::Mesh
and theStateManager
.