jaxmat.state module#
- class SmallStrainState[source]#
Bases:
AbstractStateState representation for small-strain behaviors.
This class stores the current strain \(\beps\) and stress \(\bsig\) tensors under the assumption of infinitesimal (small) deformations. It also supports internal state variables such as plastic strain, damage, or other material history quantities through the internal attribute.
- internal#
Nested state object representing internal variables (e.g., plastic strain, hardening variables, etc.). Defaults to None.
- Type:
AbstractState, optional
- strain#
Symmetric second-rank strain tensor \(\beps\) (small-strain assumption).
- Type:
SymmetricTensor2
- stress#
Symmetric second-rank Cauchy stress tensor \(\bsig\).
- Type:
SymmetricTensor2
Notes
- eps
SymmetricTensor2 Alias for strain, allows accessing via state.eps.
- sig
SymmetricTensor2 Alias for stress, allows accessing via state.sig.
-
internal:
AbstractState= None#
-
strain:
SymmetricTensor2#
-
stress:
SymmetricTensor2#
- property eps#
Alias for
strain.
- property sig#
Alias for
stress.
- PK1_to_PK2(F, PK1)[source]#
Convert the first Piola-Kirchhoff stress tensor (PK1) to the second Piola-Kirchhoff stress tensor (PK2). Enforce symmetry explicitly.
- PK1_to_Cauchy(F, PK1)[source]#
Convert the first Piola-Kirchhoff stress tensor (PK1) to the Cauchy stress tensor. Enforce symmetry explicitly.
- class FiniteStrainState[source]#
Bases:
AbstractStateState representation for finite-strain continuum mechanics.
This class encapsulates the deformation gradient \(\bF\) (
F) and first Piola-Kirchhoff stress \(\bP\) (PK1), along with optional internal variables. It provides convenience properties for converting between common stress measures: second Piola-Kirchhoff \(\bS\) (PK2) and Cauchy \(\bsig\) (sig) stresses.- internal#
Nested internal state representing material history or additional constitutive information. Defaults to None.
- Type:
AbstractState, optional
- F#
Deformation gradient \(\bF\). Initialized as the identity tensor.
- Type:
Tensor2
- PK1#
First Piola-Kirchhoff stress tensor \(\bP\).
- Type:
Tensor2
Notes
- PK2
SymmetricTensor2 Second Piola-Kirchhoff stress tensor \(\bS\), computed via
PK1_to_PK2().- sig
SymmetricTensor2 Cauchy stress tensor \(\bsig\), computed via
PK1_to_Cauchy().- Cauchy
SymmetricTensor2 Alias for
sig.
-
internal:
AbstractState= None#
- property PK2#
- property sig#
- property Cauchy#
- make_batched(module, Nbatch)[source]#
Broadcasts all leaf arrays of a single unbatched module into a batched version.
- Parameters:
module (eqx.module) – An instance of an equinox Module (e.g., State) with array leaves.
Nbatch (int) – The number of batch items to broadcast.
Returns – A new instance of the same class, with each array field having shape (Nbatch, …).
- Return type:
Module
- class Scalar[source]#
Bases:
objectInitializer of a scalar state variable (hashable, so it can key the state factory).
-
default:
float= 0.0#
-
default:
- class Vector[source]#
Bases:
objectInitializer of a vector state variable of dimension
dim.-
dim:
int= 3#
-
default:
float= 0.0#
-
dim:
- class Physics[source]#
Bases:
objectDeclaration of the variables exchanged by a (multiphysics) behavior.
Following the terminology:
gradientsare the driving inputs whose conjugates are computed by the behavior (strain \(\beps\), deformation gradient \(\bF\), pore pressure \(p\), temperature gradient…);fluxesare the computed outputs, the thermodynamic forces conjugate to the gradients (stress \(\bsig\), fluid content \(\zeta\), heat flux \(\boldsymbol{q}\)…);externalvariables are known inputs with no conjugate output (temperature \(T\)…).
Internal state variables are not declared here: they keep living in
state.internal.A
Physicsis immutable and hashable, and is built withmake_physics(). The corresponding state class, input and flux containers are generated on first use and cached, so equal declarations always give the same classes (stable pytree structures forjit,scanand serialization).-
name:
str#
-
gradients:
tuple#
-
fluxes:
tuple#
-
external:
tuple= ()#
-
aliases:
tuple= ()#
- property gradient_names#
- property flux_names#
- property external_names#
- property input_names#
gradients, then external variables.
- Type:
Names of the inputs of
constitutive_update
- property State#
The state class (an
AbstractState) storing all variables andinternal.
- property Inputs#
Named tuple of the inputs (gradients, then external variables).
- property Fluxes#
Named tuple of the fluxes.
- make_physics(name, *, gradients, fluxes, external=None, aliases=None)[source]#
Declare the variables of a behavior and get the matching state class for free.
Each variable is declared by name with an initializer: a tensor class (
SymmetricTensor2), a zero-argument factory (Tensor2.identity), a number (a scalar with that initial value) orVector. Gradients and fluxes are listed in matching (conjugate) order.POROELASTICITY = make_physics( "Poroelasticity", gradients={"strain": SymmetricTensor2, "p": 0.0}, fluxes={"stress": SymmetricTensor2, "zeta": 0.0}, aliases={"eps": "strain", "sig": "stress"}, ) state = POROELASTICITY.State() # fields: internal, strain, p, stress, zeta
- Return type:
- Parameters:
name (str)
gradients (dict[str, Any])
fluxes (dict[str, Any])
external (dict[str, Any] | None)
aliases (dict[str, str] | None)
- make_state(name, **variables)[source]#
Shortcut for
make_physics(name, **variables).State.- Return type:
type[AbstractState]- Parameters:
name (str)