Postprocessing
Visualization, convergence analysis, and property interpolation tools.
VTK Export
Export meshes and results to VTK format for visualization in ParaView.
Sentinel.export_vtk Function
export_vtk(filename::AbstractString, result::HexMeshResult;
write_disp::Bool=true, write_anatomical::Bool=true,
write_region::Bool=true)Export a HexMeshResult to VTK (.vtu) format with hex27 cells.
Arguments
filename: output path (without.vtuextension)result: hex mesh generation resultwrite_disp: include displacement point data (default: true)write_anatomical: include anatomical magnitude point data (default: true)write_region: include region assignment point data (default: true)
export_vtk(filename::AbstractString, grid, dh, disp::Displacement;
dispset::Int=1)Export a Ferrite grid with displacement solution to VTK.
Arguments
filename: output path (without.vtuextension)grid: Ferrite Griddh: DofHandlerdisp: solved displacementdispset: which displacement set to export (default: 1)
export_vtk(filename::AbstractString, material::Material, mesh::MaterialMesh;
prop_indices=1:material.numprop, val_idx::Int=1)Export material properties on a MaterialMesh to VTK (.vtu).
Nodal-basis properties are written as point data; elemental-basis properties are written as cell data.
Arguments
filename: output path (without.vtuextension)material: Material with property arraysmesh: MaterialMesh (structured hex8)prop_indices: which properties to export (default: all)val_idx: which value-per-point column (default: 1)
Sentinel.PropertyMapData Type
PropertyMapDataExtracted material property coordinates and values (no file I/O).
Fields
coords::Matrix{Float64}:(n, 3)point coordinatesvalues::Dict{String, Vector{Float64}}: named property arraysmesh_type::Symbol::hex8,:hex27, or:structured
Convergence Analysis
Sentinel.print_convergence_table Function
print_convergence_table(history::ConvergenceHistory; io::IO=stdout, header::Bool=true)Print a formatted convergence table showing per-iteration metrics.
Columns: Iteration | Objective | Disp Error | Mat Epsilon | Obj Ratio
The objective ratio is objective[i] / objective[i-1] (shown as --- for iteration 1).
Sentinel.convergence_statistics Function
convergence_statistics(history::ConvergenceHistory) -> NamedTupleCompute summary statistics from a convergence history.
Returns
Named tuple with fields:
iterations: total iterationsconverged: whether the optimizer convergedinitial_objective: first iteration objectivefinal_objective: last iteration objectiveobjective_reduction:final / initialinitial_disp_error: first iteration displacement errorfinal_disp_error: last iteration displacement errorfinal_mat_epsilon: last iteration material changemin_objective: minimum objective across all iterationsmin_objective_iter: iteration at which minimum occurredavg_obj_reduction_rate: geometric mean of per-iteration ratios
Sentinel.export_convergence_csv Function
export_convergence_csv(filename::AbstractString, history::ConvergenceHistory;
delimiter::Char=',')Export convergence history to a CSV file.
Columns: iteration, objective, disp_error, mat_epsilon
Property Interpolation
Interpolate reconstructed material properties from the material mesh to arbitrary points or structured grids.
Sentinel.PropertyGridResult Type
PropertyGridResultResult of interpolating material properties onto a structured grid.
Fields
data::Dict{String, Array{Float64, 3}}: property arrays keyed by name (e.g.,"prop1_real","prop1_imag")origin::SVector{3, Float64}: grid origin (meters)resolution::SVector{3, Float64}: voxel size (meters)dims::NTuple{3, Int}: grid dimensions(nx, ny, nz)
Sentinel.interpolate_properties Function
interpolate_properties(material::Material, mesh::MaterialMesh,
target_coords::AbstractMatrix{<:Real};
prop_indices=1:material.numprop, val_idx::Int=1)Interpolate material properties from a MaterialMesh to arbitrary target coordinates.
Arguments
material: Material with property arraysmesh: MaterialMesh defining the structured hex8 gridtarget_coords:(n, 3)matrix of target (x, y, z) coordinatesprop_indices: which properties to interpolate (default: all)val_idx: which value-per-point column to use (default: 1)
Returns
Dict{String, Vector{Float64}} with keys "prop{i}_real" and "prop{i}_imag" for each property index i.
Out-of-bounds points get NaN.
Sentinel.interpolate_to_grid Function
interpolate_to_grid(material::Material, mesh::MaterialMesh,
origin, resolution, dims::NTuple{3, Int};
prop_indices=1:material.numprop, val_idx::Int=1)Interpolate material properties onto a structured grid.
Arguments
material: Material with property arraysmesh: MaterialMesh defining the source hex8 gridorigin:(3,)grid origin[x0, y0, z0]resolution:(3,)voxel size[dx, dy, dz]dims:(nx, ny, nz)grid dimensionsprop_indices: which properties to interpolate (default: all)val_idx: which value-per-point column to use (default: 1)
Returns
PropertyGridResult with 3D arrays for each property.