-
Notifications
You must be signed in to change notification settings - Fork 78
Make entity marking dune conformant #947
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
base: master
Are you sure you want to change the base?
Conversation
Ensures that the entity marking process conforms to dune interface by adding a boolean flag that defines whether to throw an exception when the marking is invalid or not. If false, the function returns gracefully as the dune-grid interface expects. If true, the function will throw a message with the reason of the failure.
|
jenkins build this please |
aritorto
left a comment
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.
Nice fix towards being able to run the DUNE Grid test! Only one question and minor suggestions
| // Mark all the elements of the current leaf grid view for refinement | ||
| mark(1, element); | ||
| assignRefinedLevel[element.index()] = preAdaptMaxLevel +1; | ||
| if (mark(1, element)) |
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.
Is there any reason why here we do not add the throwOnFailure flag with true? I would say we want to throw if the element is at the boundary of an LGR
| mark(1, element); | ||
| assignRefinedLevel[element.index()] = preAdaptMaxLevel +1; | ||
| if (mark(1, element)) | ||
| assignRefinedLevel[element.index()] = preAdaptMaxLevel +1; |
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.
Accidental white-space?
| auto assignAndDetect = [this, &assignRefinedLevel, &lgr_with_at_least_one_active_cell](const cpgrid::Entity<0>& element, int level) | ||
| { | ||
| mark(1, element); | ||
| mark(1, element, true); |
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 please add /* throwOnFailure = */ before true? So it's easier to read/understand
| } | ||
| if(belongsToLevel) { | ||
| this->mark(1, element); | ||
| this->mark(1, element, true); |
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.
Same here (the suggestion of /* throwOnFailure = */ true) and in the other files too, please
This PR ensures that the entity marking process conforms to dune interface by adding a boolean flag that defines whether to throw an exception when the marking is invalid or not.
If the flag is false, the function returns gracefully as the dune-grid interface expects. If true, the function will throw a message with the reason of the failure. The default flag (false) follows the dune interface.
In cases where the LGR is explicitly requested by the user, the flag is set to true to still provide useful diagnostics.