Skip to content

Probe - #3

Open
mohalinasre wants to merge 2 commits into
developfrom
Probe
Open

Probe#3
mohalinasre wants to merge 2 commits into
developfrom
Probe

Conversation

@mohalinasre

Copy link
Copy Markdown
Collaborator

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:

output_control:
            file_path: results.e
            output_frequency:
                option: time_interval
                time_interval: 0.05
            output_fields: [velocity, pressure, displacement_mesh]
            post_process:
            - name: pressure_probe
              location: [fluid]
              frequency: 1
              write_to_file: true
              type: probe
              options:
                  probe_location: [0.28, 0.024]
                  field: pressure

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.

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.
@mohalinasre

Copy link
Copy Markdown
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.

@mohalinasre mohalinasre reopened this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant