|
NEML2 2.1.0
|
Refer to Syntax Documentation for the list of available objects.
Equation systems define the algebraic systems that implicit solvers work on. They are created under the EquationSystems section in input files and are typically consumed by ImplicitUpdate or by nonlinear solvers directly. Equation systems are tightly coupled with solvers because the solver queries the system for the assembled operator and right-hand side.
All equation systems derive from EquationSystem, which is a manufacturable object with its options section set to EquationSystems. The base class provides the to interface for moving internal data to a different device or dtype.
LinearSystem defines the interface for a system of the form
\[ A u = b, \]
with the following roles:
The assembled objects are stored in SparseTensorList, which is a vector of tensors where missing entries represent zeros in a sparse representation. The order of entries is controlled by the ID-to-variable maps returned by umap, gmap, and bmap, with associated layouts (ulayout, glayout, blayout) and optional intermediate layouts.
LinearSystem tracks whether \(A\), \(B\), and \(b\) are up-to-date. By default, g_changed invalidates all cached assemblies, while u_changed is a no-op for linear systems. Derived classes can override these hooks and the assemble method to control caching and assembly behavior.
NonlinearSystem represents a nonlinear system
\[ r(u; g) = 0. \]
Its linearization is expressed as
\[ \frac{\partial r}{\partial u} \Delta u = -r, \]
so the assembled matrices are interpreted as \(A := \partial r / \partial u\) and \(b := -r\). The auxiliary matrix \(B := \partial r / \partial g\) is also available when requested. In a nonlinear system, u_changed invalidates \(A\), \(B\), and \(b\) because the linearization depends on the current unknowns.
ModelNonlinearSystem is the default implementation and is registered under the alias NonlinearSystem. It wraps a Model and uses the model's variables to define the system:
The state and residual sub-axes must be conformal so that the Jacobian \(A\) is square. This is the same requirement imposed by solvers (see Solver).
In an input file, a model-based nonlinear system looks like:
This system can then be referenced by ImplicitUpdate or passed directly to a nonlinear solver.