SOFA API  7226d276
Open source framework for multi-physics simuation
sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes > Class Template Reference

#include <Strain.h>

Class to compute and manage strain measures in elasticity simulations. More...

Detailed Description

template<class DataTypes>
class sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >

Class to compute and manage strain measures in elasticity simulations.

This class handles the computation of strain measures (deformation gradient, right Cauchy-Green tensor, Green-Lagrange tensor, and strain invariants) using an optional pattern for lazy computation. It supports initialization from either the deformation gradient (F) or the right Cauchy-Green tensor (C).

Template Parameters
DataTypesThe data type of the simulation. Must provide:
  • spatial_dimensions: Spatial dimension of the problem (2 or 3)
  • Real_t: Scalar type for numerical operations
Note
The class follows the following invariant rules:
  • When initialized with F: Right Cauchy-Green tensor (C) is computed as C = F^T * F
  • When initialized with C: Deformation gradient (F) is not computed
  • All computed values are stored in std::optional to avoid unnecessary computations
  • Invariants are defined as: I1 = tr(C) I2 = (I1^2 - tr(C^2)) / 2 I3 = det(C) = (det(F))^2

Static Public Attributes

static constexpr sofa::Size spatial_dimensions = DataTypes::spatial_dimensions
 Spatial dimension of the problem (2 or 3) More...
 
static constexpr sofa::type::IdentityMatrix identity {}
 

Protected Attributes

std::optional< DeformationGradient > m_deformationGradient
 
std::optional< RightCauchyGreenTensor > m_rightCauchyGreenTensor
 
std::optional< Real > m_determinantF
 
std::optional< GreenLagrangeTensor > m_greenLagrangeTensor
 
std::optional< Real > m_invariant1
 
std::optional< Real > m_invariant2
 
std::optional< Real > m_invariant3
 

Public Member Functions

constexpr Strain (DeformationGradientTag, const DeformationGradient &F)
 Constructor initializing from deformation gradient. More...
 
constexpr Strain (RightCauchyGreenTensorTag, const RightCauchyGreenTensor &C)
 Constructor initializing from right Cauchy-Green tensor. More...
 
const DeformationGradient & deformationGradient () const
 
void setDeformationGradient (const DeformationGradient &F)
 
Real getDeterminantDeformationGradient ()
 
const RightCauchyGreenTensor & getRightCauchyGreenTensor ()
 
void setRightCauchyGreenTensor (const RightCauchyGreenTensor &C)
 
const GreenLagrangeTensor & getGreenLagrangeTensor ()
 
Real getInvariant1 ()
 
Real getInvariant2 ()
 
Real getInvariant3 ()
 
void reset ()
 Reset all computed values. More...
 

Protected Member Functions

void computeDeterminant ()
 
void computeRightCauchyGreenTensor ()
 
void computeGreenLagrangeTensor ()
 
void computeInvariant1 ()
 
void computeInvariant2 ()
 
void computeInvariant3 ()
 

Attribute details

◆ identity

template<class DataTypes >
constexpr sofa::type::IdentityMatrix sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::identity {}
staticconstexpr

◆ m_deformationGradient

template<class DataTypes >
std::optional<DeformationGradient> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_deformationGradient
protected

◆ m_determinantF

template<class DataTypes >
std::optional<Real> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_determinantF
protected

◆ m_greenLagrangeTensor

template<class DataTypes >
std::optional<GreenLagrangeTensor> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_greenLagrangeTensor
protected

◆ m_invariant1

template<class DataTypes >
std::optional<Real> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_invariant1
protected

◆ m_invariant2

template<class DataTypes >
std::optional<Real> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_invariant2
protected

◆ m_invariant3

template<class DataTypes >
std::optional<Real> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_invariant3
protected

◆ m_rightCauchyGreenTensor

template<class DataTypes >
std::optional<RightCauchyGreenTensor> sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::m_rightCauchyGreenTensor
protected

◆ spatial_dimensions

template<class DataTypes >
constexpr sofa::Size sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::spatial_dimensions = DataTypes::spatial_dimensions
staticconstexpr

Spatial dimension of the problem (2 or 3)

Constructor details

◆ Strain() [1/2]

template<class DataTypes >
constexpr sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::Strain ( DeformationGradientTag  ,
const DeformationGradient &  F 
)
inlineconstexpr

Constructor initializing from deformation gradient.

Parameters
tagTag for deformation gradient initialization
FDeformation gradient tensor (F)

◆ Strain() [2/2]

template<class DataTypes >
constexpr sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::Strain ( RightCauchyGreenTensorTag  ,
const RightCauchyGreenTensor &  C 
)
inlineconstexpr

Constructor initializing from right Cauchy-Green tensor.

Parameters
tagTag for right Cauchy-Green tensor initialization
CRight Cauchy-Green tensor (C)

Function details

◆ computeDeterminant()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeDeterminant ( )
inlineprotected

◆ computeGreenLagrangeTensor()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeGreenLagrangeTensor ( )
inlineprotected

◆ computeInvariant1()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeInvariant1 ( )
inlineprotected

◆ computeInvariant2()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeInvariant2 ( )
inlineprotected

◆ computeInvariant3()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeInvariant3 ( )
inlineprotected

◆ computeRightCauchyGreenTensor()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::computeRightCauchyGreenTensor ( )
inlineprotected

◆ deformationGradient()

template<class DataTypes >
const DeformationGradient& sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::deformationGradient ( ) const
inline

◆ getDeterminantDeformationGradient()

template<class DataTypes >
Real sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getDeterminantDeformationGradient ( )
inline

◆ getGreenLagrangeTensor()

template<class DataTypes >
const GreenLagrangeTensor& sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getGreenLagrangeTensor ( )
inline

◆ getInvariant1()

template<class DataTypes >
Real sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getInvariant1 ( )
inline

◆ getInvariant2()

template<class DataTypes >
Real sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getInvariant2 ( )
inline

◆ getInvariant3()

template<class DataTypes >
Real sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getInvariant3 ( )
inline

◆ getRightCauchyGreenTensor()

template<class DataTypes >
const RightCauchyGreenTensor& sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::getRightCauchyGreenTensor ( )
inline

◆ reset()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::reset ( )
inline

Reset all computed values.

Clears all optional values (deformation gradient, C, invariants, tensors)

◆ setDeformationGradient()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::setDeformationGradient ( const DeformationGradient &  F)
inline

◆ setRightCauchyGreenTensor()

template<class DataTypes >
void sofa::component::solidmechanics::fem::hyperelastic::Strain< DataTypes >::setRightCauchyGreenTensor ( const RightCauchyGreenTensor &  C)
inline