Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reason
When using
patch_update_strategy=iterationwith dynamic mesh changes (e.g.,ElementSubdomainModifierchanging element subdomains),NearestNodeLocatorfails in parallelwith the error: "The nearest neighbor lies outside the ghosted set of elements."
This occurs because:
processor_id()of elements that aren't yet ghosted, causing false errorsThe issue is particularly problematic for problems with:
ElementSubdomainModifierDesign
Replace overly strict ghosting validation in
NearestNodeLocator::findNodes()andNearestNodeLocator::updatePatch()with a more appropriate check:Previous validation (too strict):
ghost) OR pending ghosting set (new_ghost)processor_id()of elements that may not be accessible yetNew validation (appropriate):
remote_elemornullptr)Additionally:
new_ghostset initialized from_new_ghosted_elemsnew_ghostfor proper tracking across iterationsImpact
API Changes: None - this is an internal fix to validation logic
Behavior Changes:
User Impact:
patch_update_strategy=iterationand dynamic boundaries (ElementSubdomainModifier, phase field, etc.) will no longer see spurious ghosting errors in parallelpatch_update_strategy=alwaysusers see no change (already worked)Testing: