Features
What Carina supports today. Items marked planned are design goals with no current implementation — they are called out explicitly so the input reference is not read as promising more than it delivers.
Execution
- Single source, three backends. CPU, NVIDIA (CUDA), and AMD (ROCm) from one code base via KernelAbstractions.jl.
- Vendor-free library. The GPU packages live in the launcher environment, not in Carina itself, so the library installs and runs without CUDA or ROCm present.
- CPU multithreading of element assembly and constitutive evaluation.
- Matrix-free explicit path. Central difference opts the assembler into matrix-free mode, skipping sparse preallocation entirely — on a 530k-DOF mesh that is several GB of allocation avoided.
Physics
- Finite-deformation solid mechanics, built on ReferenceFiniteElements.jl and FiniteElementContainers.jl.
- Material models from ConstitutiveModels.jl: neo-Hookean, linear elastic, Hencky, Saint Venant–Kirchhoff, Seth–Hill, small-strain J2 plasticity, and finite-deformation J2 plasticity.
- Planned: heat conduction, multiphysics coupling, contact, and multidomain Schwarz coupling. Note that
model.typeis currently parsed but not dispatched on — solid mechanics is the only physics. - Per-block materials. Each element block carries its own constitutive model and density, including different numbers of internal state variables (an elastic block beside a plastic one). Every block must be assigned explicitly — there is no default material. See Materials.
Time integration
| Scheme | Kind | Nonlinear solve |
|---|---|---|
| Quasi-static | Equilibrium, no inertia | Newton / NLCG / steepest descent |
| Newmark-β, HHT-α | Implicit dynamics | Newton / NLCG / steepest descent |
| Central difference | Explicit dynamics | none |
- Adaptive time stepping for the implicit schemes: shrink on solver failure, grow on success, within user bounds.
- CFL-based stable step estimation for explicit runs, computed from element characteristic length and the material wave speed, with optional periodic recomputation as the mesh deforms.
- Output-interval subcycling. The integrator takes as many internal steps as needed between output frames, landing exactly on output times.
Solvers
Nonlinear: Newton–Raphson with Armijo line search (on by default), nonlinear conjugate gradient, and preconditioned steepest descent. The latter two are matrix-free.
Linear: sparse direct (LU), conjugate gradient, and L-BFGS.
Preconditioners:
| CPU | GPU | |
|---|---|---|
| Jacobi | ✓ | ✓ |
| Chebyshev polynomial | ✓ | ✓ |
| Incomplete Cholesky (LDLᵀ) | ✓ | — |
| Smoothed-aggregation AMG | ✓ | ✓ |
The AMG preconditioner uses the six rigid-body modes as its near-nullspace, rebuilt from the current configuration at each hierarchy build, which keeps CG iteration counts nearly independent of the time step. Its hierarchy setup is lagged and reused. On GPU the hierarchy is built on the host and converted to device CSR, and the V(2,2)-cycle applies entirely on the device through KernelAbstractions kernels — the fine level is smoothed through the matrix-free stiffness action, so the fine matrix is never formed on the device. It is the fastest quasi-static option Carina has; see benchmark_report.md.
Composable termination criteria. Convergence and failure are expressed as a tree of status tests — residual, update, iteration count, divergence, stagnation, and finiteness — combined with any/all logic. See Solvers.
Dirichlet conditions by DOF elimination, never by penalty. The reduced system carries no artificial conditioning, which matters directly for Krylov convergence.
Boundary and initial conditions
- Dirichlet on side sets or node sets, per component, as a function of space and time.
- Neumann as surface tractions on side sets, or point loads on node sets.
- Body forces per element block.
- Initial conditions for displacement and velocity.
- Traveling-wave initial conditions, where you supply the displacement profile, a propagation axis, and a signed wave speed, and Carina derives the consistent velocity field
v₀ = −c·∂u₀/∂sby symbolic differentiation — no hand-written derivatives. - Expression language over
x,y,z,twith named bindings, compiled once to an allocation-free scalar function.
Input and output
- Exodus mesh input and result output, readable by ParaView.
- YAML-driven setup — no recompilation to change a problem.
- Selectable output fields: displacement (always), velocity, acceleration, per-quadrature-point stress, deformation gradient, and constitutive state.
- Nodal recovery of element quantities by lumped or consistent (full L2) projection.
- Input validation. Every section is key-checked, with a Levenshtein-based "did you mean" suggestion on unknown keys. Values drawn from a fixed set (solver, integrator, preconditioner, quadrature, recovery) are rejected rather than defaulted, and every element block, node set, and side set named in the input is verified against the mesh before it is used. See how input errors surface.
Scale
The explicit GPU path has been run to 7.8 M DOF (2.5 M elements) on a single 8 GB consumer GPU. Throughput is memory-bandwidth bound, and the GPU-to-CPU advantage widens with problem size before plateauing at roughly 3× on that hardware — approximately 80% of the memory-bandwidth ratio between the two devices.