refactor(materials): Add @inline to FiniteStrainPlasticity trait functions

- Added @inline to is_finite_strain, has_state
- Trait functions called frequently during assembly
- Part of performance optimization
This commit is contained in:
Jukka Aho
2025-11-20 16:56:37 +02:00
parent b468fc885d
commit 43276cf449
+3 -3
View File
@@ -29,8 +29,8 @@ using LinearAlgebra
State variables for finite strain plasticity.
Fields:
- `F_p::Tensor{2,3,Float64}`: Plastic deformation gradient (intermediate config)
- `α_bar::SymmetricTensor{2,3,Float64}`: Backstress in intermediate config
- `F_p::Tensor{2,3,Float64,9}`: Plastic deformation gradient (intermediate config)
- `α_bar::SymmetricTensor{2,3,Float64,6}`: Backstress in intermediate config
- `κ::Float64`: Equivalent plastic strain (≥ 0)
Invariants:
@@ -44,7 +44,7 @@ struct FiniteStrainPlasticityState
function FiniteStrainPlasticityState(
F_p::Tensor{2,3,Float64,9}=one(Tensor{2,3,Float64}),
α_bar::SymmetricTensor{2,3,Float64,6}=zero(SymmetricTensor{2,3,Float64}),
α_bar::SymmetricTensor{2,3,Float64,6}=zero(SymmetricTensor{2,3,Float64,6}),
κ::Float64=0.0
)
κ < 0.0 && throw(ArgumentError("κ must be non-negative, got $κ"))