SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::LinearElasticity_test< _DataTypes > Struct Template Reference
Inheritance diagram for sofa::LinearElasticity_test< _DataTypes >:

Detailed Description

template<typename _DataTypes>
struct sofa::LinearElasticity_test< _DataTypes >

Test force fields implementing linear elasticity on tetrahedral mesh. Implement traction applied on the top part of a cylinder and test that the deformation is simply related with the Young Modulus and Poisson Ratio of the isotropc linear elastic material

Public Attributes

simulation::Simulationsimulation
 Simulation. More...
 
CylinderTractionStruct< DataTypestractionStruct
 struct with the pointer of the main components More...
 
size_t vIndex
 index of the vertex used to compute the compute the deformation More...
 
- Public Attributes inherited from sofa::testing::BaseTest
sofa::testing::MessageAsTestFailure m_fatal
 
sofa::testing::MessageAsTestFailure m_error
 

Public Member Functions

void SetUp () override
 
ForceFieldSPtr addTetrahedralLinearElastic (simulation::Node::SPtr root, double youngModulus, double poissonRatio)
 
ForceFieldSPtr addTetrahedralCorotationalFEMLinearElastic (simulation::Node::SPtr root, double youngModulus, double poissonRatio)
 
bool testLinearElasticityInTraction (LinearElasticityFF createForceField)
 
void TearDown () override
 
- Public Member Functions inherited from sofa::testing::BaseSimulationTest
 BaseSimulationTest ()
 
bool importPlugin (const std::string &name)
 
- Public Member Functions inherited from sofa::testing::BaseTest
 BaseTest ()
 Initialize Sofa and the random number generator. More...
 
 ~BaseTest () override
 
virtual void onSetUp ()
 
virtual void onTearDown ()
 
- Public Member Functions inherited from sofa::testing::NumericTest< _DataTypes::Real >
 NumericTest ()
 
Real vectorMaxDiff (const Container1 &c1, const Container2 &c2)
 Return the maximum difference between two containers. Issues a failure if sizes are different. More...
 
Real vectorMaxAbs (const Container &c)
 Return the maximum absolute value of a container. More...
 

Additional Inherited Members

- Static Public Attributes inherited from sofa::testing::BaseTest
static int seed = (unsigned int)time(nullptr)
 Seed value. More...
 
- Static Public Member Functions inherited from sofa::testing::NumericTest< _DataTypes::Real >
static Real matrixMaxDiff (const Matrix1 &m1, const Matrix2 &m2)
 return the maximum difference between corresponding entries, or the infinity if the matrices have different sizes More...
 
static Real matrixMaxDiff (const sofa::type::Mat< M, N, Real > &m1, const Matrix2 &m2)
 Return the maximum difference between corresponding entries, or the infinity if the matrices have different sizes. More...
 
static Real epsilon ()
 the smallest real number More...
 
static Real infinity ()
 Infinity. More...
 
static bool isSmall (Real r, Real ratio=1.)
 true if the magnitude of r is less than ratio*epsilon More...
 
static Real vectorMaxDiff (const sofa::type::Vec< N, Real > &m1, const Vector2 &m2)
 return the maximum difference between corresponding entries, or the infinity if the vectors have different sizes More...
 
static Real vectorMaxDiff (const sofa::type::Vec< N, Real > &m1, const sofa::type::Vec< N, Real > &m2)
 return the maximum difference between corresponding entries More...
 
- Static Protected Member Functions inherited from sofa::testing::NumericTest< _DataTypes::Real >
static float norm (float a)
 
static double norm (double a)
 
static Real norm (T a)
 

Attribute details

◆ simulation

template<typename _DataTypes >
simulation::Simulation* sofa::LinearElasticity_test< _DataTypes >::simulation

Simulation.

◆ tractionStruct

template<typename _DataTypes >
CylinderTractionStruct<DataTypes> sofa::LinearElasticity_test< _DataTypes >::tractionStruct

struct with the pointer of the main components

◆ vIndex

template<typename _DataTypes >
size_t sofa::LinearElasticity_test< _DataTypes >::vIndex

index of the vertex used to compute the compute the deformation

Function details

◆ addTetrahedralCorotationalFEMLinearElastic()

template<typename _DataTypes >
ForceFieldSPtr sofa::LinearElasticity_test< _DataTypes >::addTetrahedralCorotationalFEMLinearElastic ( simulation::Node::SPtr  root,
double  youngModulus,
double  poissonRatio 
)
inline

◆ addTetrahedralLinearElastic()

template<typename _DataTypes >
ForceFieldSPtr sofa::LinearElasticity_test< _DataTypes >::addTetrahedralLinearElastic ( simulation::Node::SPtr  root,
double  youngModulus,
double  poissonRatio 
)
inline

◆ SetUp()

template<typename _DataTypes >
void sofa::LinearElasticity_test< _DataTypes >::SetUp ( )
inlineoverride

◆ TearDown()

template<typename _DataTypes >
void sofa::LinearElasticity_test< _DataTypes >::TearDown ( )
inlineoverride

◆ testLinearElasticityInTraction()

template<typename _DataTypes >
bool sofa::LinearElasticity_test< _DataTypes >::testLinearElasticityInTraction ( LinearElasticityFF  createForceField)
inline