Receiver_interp module (receiver_interp.h)
Functions
-
PetscErrorCode buildReceiverInterpolationMatrices(PetscInt nord, Vec receivers, const DM dm, const Grid *grid, ReceiverInterpolationMatrices *Q)
Builds the receiver-interpolation matrices QEx..QHz.
Assembles the Q operators on the same DM as the H(curl) solution vector. Building Q once with global column indexing makes the operator MPI-invariant. The routine opens no file; the caller supplies the receiver coordinates.
Builds the receiver-interpolation matrices QEx..QHz.
Q = {QEx, QEy, QEz, QHx, QHy, QHz} maps an H(curl) DOF vector to the electric/magnetic field components evaluated at the receiver positions. Used by both kernels (fm.csem in postprocessing.c, im.csem in inversion.c). The full contract - receiver-location semantics, sign convention, MPI-invariance argument, and the divide-by-(iωμ) factor for H - is documented in include/receiver_interp.h.
- Parameters:
nord – [in] Nédélec basis order (dispatched via fem->ops, 1..6).
receivers – [in] Serial Vec (PETSC_COMM_SELF) of 3·N_recv reals, laid out [x0 y0 z0 x1 y1 z1 …]; produced by loadCsemInputs from /receivers in the input bundle.
dm – [in] H(curl) DM the solution lives on.
grid – [in] Grid struct produced by setupCsemGrid.
Q – [out] Output struct; free with destroyReceiverInterpolationMatrices.
nord – [in] Nédélec basis order (dispatched via fem->ops, 1..6).
receivers – [in] Serial Vec of 3·N_recv reals (caller-owned).
dm – [in] H(curl) DM the solution lives on.
grid – [in] Grid struct produced by setupCsemGrid.
Q – [out] Output struct holding QEx..QHz.
- Returns:
PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code otherwise.
- Returns:
PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code otherwise.
-
PetscErrorCode destroyReceiverInterpolationMatrices(ReceiverInterpolationMatrices *Q)
Destroys the matrices held in a ReceiverInterpolationMatrices struct.
Destroys the matrices held in a ReceiverInterpolationMatrices struct.
Idempotent on individual fields (MatDestroy handles NULL). The Q struct itself is stack-owned by the caller and is not freed.
- Parameters:
Q – [inout] Struct whose QEx..QHz matrices are destroyed.
Q – [inout] Struct whose QEx..QHz matrices are destroyed.
- Returns:
PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code otherwise.
- Returns:
PetscErrorCode PETSC_SUCCESS on success, or a PETSc error code otherwise.
-
struct ReceiverInterpolationMatrices
- #include <receiver_interp.h>
Frequency-independent receiver-interpolation operators.
QEx..QHz are (numReceivers x numDof) MATAIJ sparse matrices mapping an H(curl) DOF vector x to field components at the receivers: Ex_recv = QEx * x; Hx_recv = (QHx * x) / constFactor (constFactor = iωμ).