Probe - #3
Open
mohalinasre wants to merge 2 commits into
Open
Conversation
Locate the containing element lazily on first update (mesh is not populated at construction), cache isoparametric coordinates, and interpolate the requested nodal field to that point via element shape functions. Under connectivity-preserving mesh motion the cached (element, isoParCoords) pair is invariant, so a moving probe re-reads displaced nodal values without re-locating. Parallel-safe: the owning rank samples and the value is reduced to master, which writes the time history. Scalar and vector fields supported, with named output columns.
Locate the containing element lazily on first update (mesh is not populated at construction), cache isoparametric coordinates, and interpolate the requested nodal field to that point via element shape functions. Under connectivity-preserving mesh motion the cached (element, isoParCoords) pair is invariant, so a moving probe re-reads displaced nodal values without re-locating. Parallel: all ranks search locally, agree on the single owning rank by global argmin of the isInElement distance, and the owner's sampled value is reduced to master, which writes the time history. Scalar and vector fields supported, with named output columns. Serial-validated on rigid and flexible dam break; parallel-validated on rigid dam break.
Collaborator
Author
|
The PR has two commits, the first is the probe implementation, the second is a follow-up fix adding correct parallel ownership (single-rank sampling via global argmin) after I found it crashed in decomposed runs; they review as one combined diff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implemented the probe post-process type, which until now was scaffolded but stubbed (errorMsg("Probe is not implemented yet")). A probe samples a nodal field at a fixed point in space and writes a time history, independent of the results.e field dump, so a single location can be logged at every timestep without forcing full-field output at that cadence.
Under domain decomposition the probe point lives in exactly one element on one rank. All ranks search locally; the ranks then agree on the single owning rank by a global argmin (MPI_MINLOC) of the isInElement distance among ranks that actually contain the point. Only the owner samples, and its value is reduced to master, which writes the file. A point owned by no rank at all (outside the mesh) raises a collective error decided globally, so a non-owning rank is never mistaken for a fatal "not found."
Output columns are named by field: a scalar writes the field name (pressure); a spatial vector writes field_x, field_y, field_z; anything else falls back to numbered components.
How to use it (input.i):
The probe is declared as an entry in the post_process array under solver → output_control, alongside output_fields:
Validation
Serial-validated on the rigid dam break (pressure) and the flexible dam break (displacement, fixed and moving mesh), and parallel-validated on the rigid dam break.
Not tested in parallel on the flexible case: that case independently segfaults in parallel at the non-conformal interface transfer (XFER::LinInterp::fine_search), with or without the probe present. This is a pre-existing interface-transfer issue unrelated to this change.