Solution Types
Types for storing displacement and pressure solutions from forward and adjoint solves.
Displacement
Sentinel.Displacement Type
DisplacementFull FEM displacement (and pressure) solution for all excitation sets. Corresponds to the Fortran displacement type.
Fields
nd: number of displacement nodes (= mesh.nn)np: number of pressure points (ne for elemental, nn for poroelastic nodal)nppp: number of pressure values per point (usually 1)dof: total DOF = 3·nd + nppp·npnumdispsets: number of displacement sets (frequencies/excitations)disp: displacement array,(nd, numdispsets)ofNodeDisplacementpress: pressure array,(np, numdispsets)ofNodePressureflow: fluid-solid displacement for poroelastic,(nd, numdispsets)ofNodeDisplacementflowcalc: flag — has fluid flow been computedabserror: absolute displacement misfit ½‖u_calc − u_meas‖²relerror: relative displacement misfit ‖u_calc − u_meas‖ / ‖u_meas‖
Sentinel.NodeDisplacement Type
NodeDisplacementComplex displacement vector (u, v, w) at a single FEM node. Corresponds to the Fortran singledisplacement type.
Fields
u,v,w: complex displacement components [m]update: flag — has this node received a valuecount: number of times this node has been updated (for zone averaging)
Sentinel.NodePressure Type
NodePressureComplex pressure value at a single node or element, with optional multi-value support (e.g., multiple frequency components per point).
Corresponds to the Fortran singlepressure type.
Fields
value: complex pressure values, lengthnpppupdate,count: bookkeeping for zone averaging
Initialization and Operations
Sentinel.init_displacement! Function
init_displacement!(disp::Displacement, nd::Int, np::Int, nppp::Int, numdispsets::Int)Allocate and initialize displacement storage for the given DOF counts.
Arguments
nd: number of displacement nodesnp: number of pressure points (0 for compressible models)nppp: number of pressure values per point (0 if no pressure)numdispsets: number of excitation/frequency sets
Sentinel.clear! Method
clear!(disp::Displacement)Zero all displacement, pressure, and flow values without reallocating.
sourceSentinel.scatter_solution! Function
scatter_solution!(disp::Displacement, sol::Vector{ComplexF64}, dispset::Int)Copy the flat MUMPS solution vector sol into the Displacement struct for a given excitation set. Ports transfersolution from FEsolution.f90.
Layout of sol: [u_x(1), u_y(1), u_z(1), …, u_z(nn), p(1), …, p(np·nppp)]
Sentinel.gather_solution Function
gather_solution(disp::Displacement, dispset::Int) -> Vector{ComplexF64}Flatten the Displacement struct into a MUMPS-compatible solution vector for a given excitation set.
Sentinel.displacement_error! Function
displacement_error!(calc::Displacement, meas::Displacement)Compute displacement misfit between calculated and measured displacements. Updates calc.abserror and calc.relerror in-place.
Ports displacementerror from FEsolution.f90: abserror = ½ Σ |u_calc − u_meas|² relerror = √(Σ |u_calc − u_meas|² / Σ |u_meas|²)