◆ FORGE Suite
GitHubMechanical Neuroimaging Lab · Univ. of Delaware
Skip to content

Solution Types ​

Types for storing displacement and pressure solutions from forward and adjoint solves.

Displacement ​

Sentinel.Displacement Type
julia
Displacement

Full 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·np

  • numdispsets: number of displacement sets (frequencies/excitations)

  • disp: displacement array, (nd, numdispsets) of NodeDisplacement

  • press: pressure array, (np, numdispsets) of NodePressure

  • flow: fluid-solid displacement for poroelastic, (nd, numdispsets) of NodeDisplacement

  • flowcalc: flag — has fluid flow been computed

  • abserror: absolute displacement misfit ½‖u_calc − u_meas‖²

  • relerror: relative displacement misfit ‖u_calc − u_meas‖ / ‖u_meas‖

source
Sentinel.NodeDisplacement Type
julia
NodeDisplacement

Complex 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 value

  • count: number of times this node has been updated (for zone averaging)

source
Sentinel.NodePressure Type
julia
NodePressure

Complex 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, length nppp

  • update, count: bookkeeping for zone averaging

source

Initialization and Operations ​

Sentinel.init_displacement! Function
julia
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 nodes

  • np: 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

source
Sentinel.clear! Method
julia
clear!(disp::Displacement)

Zero all displacement, pressure, and flow values without reallocating.

source
Sentinel.scatter_solution! Function
julia
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)]

source
Sentinel.gather_solution Function
julia
gather_solution(disp::Displacement, dispset::Int) -> Vector{ComplexF64}

Flatten the Displacement struct into a MUMPS-compatible solution vector for a given excitation set.

source
Sentinel.displacement_error! Function
julia
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|²)

source