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

Migration Guide

This guide helps users transition from the Fortran MRE-Zone solver to Sentinel.jl.

File Format Compatibility

Sentinel reads and writes the same file formats as Fortran MRE-Zone:

FormatExtensionReadWriteNotes
Node coordinates.nodread_nod_filewrite_nod_file3- or 4-column (with mtrltype)
Element connectivity.elmread_elm_filewrite_elm_fileHex27 or Tet4
Displacement.dspread_dsp_filewrite_dsp_fileComplex 3-component
Material properties.mtrread_mtr_filewrite_mtr_filePer-property files
Pressure.preread_pre_filewrite_pre_fileComplex nodal/elemental
Boundary nodes.bndread_bnd_filewrite_bnd_fileNode index list
Boundary conditions.bcsread_bcs_filewrite_bcs_filePer-DOF conditions
Basis indices.basisread_basis_filewrite_basis_fileNode subset for output
Mesh indices.meshindread_meshind_filewrite_meshind_fileStructured grid indexing

Runfile Support

Sentinel reads Fortran .dat runfiles directly:

julia
config = parse_runfile("my_problem.dat")
setup = setup_forward_problem(config, basedir)

The RunfileConfig struct stores all parsed data. Supported problem types:

  • problemtype=0: forward-only

  • forwardtype=0: standard forward solve

  • forwardtype=1: parameter test mode

Inverse problem runfiles (problemtype=1) will be supported in a future release.

Fortran to Julia Source Mapping

Fortran SourceJulia ModuleDescription
FEmaterial.f90types/materials.jl, properties.jlMaterial types and property storage
hex27.f90elements/*.jlElement integration kernels
tet4.f90elements/poroelastic.jlPoroelastic tet4 kernel
FEmesh.f90utils/material_mesh_interp.jlGP2MTR mapping, material mesh
fileio.f90io/file_io.jlFile I/O routines
FEforward.f90forward/assembly.jl, solver.jl, adjoint.jlAssembly, solve, adjoint
FEgradient.f90inverse/gradient.jlAdjoint gradient computation
FEgaussnewton.f90optimization/*.jlCG, GN, L-BFGS optimizers
FEregularize.f90regularization/*.jlAll 10 regularization methods
MRIhexmesh_v7p3.mpreprocessing/hex_mesh_generation.jlHex mesh from MRI
WashU_DTI_Process.mpreprocessing/dti_processing.jlDTI fiber processing

API Correspondence

Assembly and Solve

FortranJulia
buildhex27stiffnessassemble_stiffness!(K, dh, cv_disp, cv_press, model, props, ω)
applyBCapply_dirichlet!(K, f, bcs, dispset)
solvesystemforward_solve!(disp, K, f, model, dispset; solver=...)
adjointsystemadjoint_solve!(adjnt, K, calc, meas, bcs, dispset; solver=...)

Gradient and Optimization

FortranJulia
computegradientcompute_gradient!(grad, dh, cv_disp, calc, adjnt, model, material, gp2mtrs, meshes, ω)
computeobjectivecompute_objective(calc, meas)
conjugategradientconjugate_gradient!(material, ctx; max_iter, tol)
gaussnewtongauss_newton!(material, ctx; max_iter, tol)
quasinewtonquasi_newton!(material, ctx; max_iter, tol, memory)

Material Model Mapping

Fortran modelJulia TypeInteger
model=1IsotropicIncompressible()1
model=2Orthotropic()2
model=3IsotropicCompressible()3
model=4Poroelastic()4
model=5TransverseIsotropicV1()5
model=6TransverseIsotropicV2()6
model=7GeneralizedAnisotropic()7

Convert between representations: material_model(3) returns IsotropicCompressible(), model_index(IsotropicCompressible()) returns 3.

Key Design Differences

Multiple Dispatch vs if/elseif

Fortran dispatches on material%model integer flags:

fortran
if (model == 1) then
    call hex27_isotropic_incompressible(...)
elseif (model == 2) then
    call hex27_orthotropic(...)
end if

Julia uses type dispatch:

julia
element_stiffness!(Ke, cv, cp, ::IsotropicIncompressible, props, ω)
element_stiffness!(Ke, cv, cp, ::Orthotropic, props, ω)

Ferrite.jl Integration

Shape functions, quadrature, DOF management, and assembly use Ferrite.jl instead of custom Fortran routines. This means:

  • The grid type is Grid{3, Hexahedron, Float64} (8-corner-node cells)

  • Full 27-node connectivity is stored separately

  • DOF numbering is managed by Ferrite's DofHandler

Hex27 Node Ordering

Fortran and Ferrite use different local node orderings for hex27 elements. Permutation arrays FORTRAN_TO_FERRITE_HEX27 and FERRITE_TO_FORTRAN_HEX27 handle the conversion automatically during mesh I/O.

Complex Symmetric Matrices

Both Fortran and Julia produce complex symmetric stiffness matrices (K=KT). Test with norm(K - transpose(K)), not norm(K - K').

Solver Backends

FortranJulia
MUMPS (built-in)DirectSolver() (UMFPACK, default)
MUMPSSolver() (via MUMPS.jl extension)

The Julia DirectSolver uses SuiteSparse UMFPACK and is the default. For complex symmetric systems, MUMPS can exploit the symmetry for better performance on large problems.

What's New in Sentinel

  • VTK export: export_vtk produces files for ParaView visualization

  • Julia ecosystem: access to all Julia packages (plotting, AD, GPU)

  • Package extensions: MUMPS, CUDA, Metal, MPI as optional backends

  • Runfile round-trip: parse_runfile / write_runfile for Fortran interoperability

  • Performance: Julia is 1.3-2x faster than Fortran at typical problem sizes (6×6×6)

Not Yet Ported

The following Fortran features are planned for future milestones:

  • Zone-based domain decomposition (M6.1): overlapping zones for parallel assembly

  • MPI parallelism (M6.2): distributed assembly and solve

  • GPU acceleration (M6.3-6.4): CUDA and Metal backends

  • Inverse problem runfiles (problemtype=1): currently forward-only