SOFA API  384d495c
Open source framework for multi-physics simuation
sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes > Class Template Reference

#include <HexahedronFEMForceField.h>

Inheritance diagram for sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >:

Detailed Description

template<class DataTypes>
class sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >

Compute Finite Element forces based on hexahedral elements.

Corotational hexahedron from @Article{NMPCPF05, author = "Nesme, Matthieu and Marchal, Maud and Promayon, Emmanuel and Chabanas, Matthieu and Payan, Yohan and Faure, Fran\c{c}ois", title = "Physically Realistic Interactive Simulation for Biological Soft Tissues", journal = "Recent Research Developments in Biomechanics", volume = "2", year = "2005", keywords = "surgical simulation physical animation truth cube", url = "http://www-evasion.imag.fr/Publications/2005/NMPCPF05" }

WARNING: indices ordering is different than in topology node

Y  7---------6
^ /         /|
|/    Z    / |
3----^----2  |
|   /     |  |
|  4------|--5
| /       | /
|/        |/
0---------1-->X

Public Attributes

int method
 
Data< std::string > f_method
 the computation method of the displacements More...
 
Data< Realf_poissonRatio
 
Data< Realf_youngModulus
 
Data< bool > f_updateStiffnessMatrix
 
Data< sofa::helper::OptionsGroup_gatherPt
 use in GPU version More...
 
Data< sofa::helper::OptionsGroup_gatherBsize
 use in GPU version More...
 
Data< bool > f_drawing
 draw the forcefield if true More...
 
Data< Realf_drawPercentageOffset
 size of the hexa More...
 
bool needUpdateTopology
 
SingleLink< HexahedronFEMForceField< DataTypes >, sofa::core::topology::BaseMeshTopology, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINKl_topology
 Link to be set to the topology container in the component graph. More...
 

Protected Attributes

VecMaterialStiffness _materialsStiffnesses
 the material stiffness matrices vector More...
 
Data< VecElementStiffness_elementStiffnesses
 Stiffness matrices per element (K_i) More...
 
CompressedMatrix _stiffnesses
 
SReal m_potentialEnergy
 
sofa::core::topology::BaseMeshTopologym_topology
 Pointer to the topology container. Will be set by link. More...
 
topology::container::grid::SparseGridTopology_sparseGrid
 
Data< VecCoord_initialPoints
 the intial positions of the points More...
 
type::Mat< 8, 3, int_coef
 coef of each vertices to compute the strain stress matrix More...
 
HexahedronFEMForceFieldInternalData< DataTypes > * data
 
type::vector< type::fixed_array< Coord, 8 > > _rotatedInitialElements
 The initials positions in its frame. More...
 
type::vector< Transformation_rotations
 
type::vector< Transformation_initialrotations
 
bool _alreadyInit
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE(HexahedronFEMForceField, DataTypes), SOFA_TEMPLATE(core::behavior::ForceField, DataTypes))
 
void setPoissonRatio (Real val)
 
void setYoungModulus (Real val)
 
void setMethod (int val)
 
void setUpdateStiffnessMatrix (bool val)
 
void init () override
 
void reinit () override
 
void addForce (const core::MechanicalParams *mparams, DataVecDeriv &f, const DataVecCoord &x, const DataVecDeriv &v) override
 
void addDForce (const core::MechanicalParams *mparams, DataVecDeriv &df, const DataVecDeriv &dx) override
 
SReal getPotentialEnergy (const core::MechanicalParams *, const DataVecCoord &) const override
 
SReal getPotentialEnergy (const core::MechanicalParams *) const override
 
const TransformationgetElementRotation (const sofa::Index elemidx)
 
void getNodeRotation (Transformation &R, sofa::Index nodeIdx)
 
void getRotations (linearalgebra::BaseMatrix *rotations, int offset=0) override
 
void addKToMatrix (const core::MechanicalParams *mparams, const sofa::core::behavior::MultiMatrixAccessor *matrix) override
 
void buildStiffnessMatrix (core::behavior::StiffnessMatrix *matrix) override
 
void buildDampingMatrix (core::behavior::DampingMatrix *) override
 
void computeBBox (const core::ExecParams *params, bool onlyVisible) override
 
void draw (const core::visual::VisualParams *vparams) override
 
void handleTopologyChange () override
 

Protected Member Functions

 HexahedronFEMForceField ()
 
const VecElementgetIndexedElements ()
 
virtual void computeElementStiffness (ElementStiffness &K, const MaterialStiffness &M, const type::fixed_array< Coord, 8 > &nodes, const sofa::Index elementIndice, double stiffnessFactor=1.0) const
 
void computeMaterialStiffness (sofa::Index i)
 
void initLarge (sofa::Index i, const Element &elem)
 
virtual void accumulateForceLarge (WDataRefVecDeriv &f, RDataRefVecCoord &p, sofa::Index i, const Element &elem)
 
void initPolar (sofa::Index i, const Element &elem)
 
void computeRotationPolar (Transformation &r, type::Vec< 8, Coord > &nodes)
 
virtual void accumulateForcePolar (WDataRefVecDeriv &f, RDataRefVecCoord &p, sofa::Index i, const Element &elem)
 
void initSmall (sofa::Index i, const Element &elem)
 
virtual void accumulateForceSmall (WDataRefVecDeriv &f, RDataRefVecCoord &p, sofa::Index i, const Element &elem)
 

Static Protected Member Functions

static Mat33 integrateStiffness (int signx0, int signy0, int signz0, int signx1, int signy1, int signz1, const Real u, const Real v, const Real w, const Mat33 &J_1)
 
static void computeForce (Displacement &F, const Displacement &Depl, const ElementStiffness &K)
 
static void computeRotationLarge (Transformation &r, Coord &edgex, Coord &edgey)
 

Friends

class HexahedronFEMForceFieldInternalData< DataTypes >
 

Attribute details

◆ _alreadyInit

template<class DataTypes >
bool sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::_alreadyInit
protected

◆ _coef

coef of each vertices to compute the strain stress matrix

◆ _elementStiffnesses

Stiffness matrices per element (K_i)

◆ _gatherBsize

◆ _gatherPt

◆ _initialPoints

template<class DataTypes >
Data< VecCoord > sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::_initialPoints
protected

the intial positions of the points

◆ _initialrotations

◆ _materialsStiffnesses

template<class DataTypes >
VecMaterialStiffness sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::_materialsStiffnesses
protected

the material stiffness matrices vector

◆ _rotatedInitialElements

template<class DataTypes >
type::vector<type::fixed_array<Coord,8> > sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::_rotatedInitialElements
protected

The initials positions in its frame.

◆ _rotations

◆ _sparseGrid

◆ _stiffnesses

◆ data

◆ f_drawing

draw the forcefield if true

◆ f_drawPercentageOffset

template<class DataTypes >
Data<Real> sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::f_drawPercentageOffset

size of the hexa

◆ f_method

template<class DataTypes >
Data<std::string> sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::f_method

the computation method of the displacements

◆ f_poissonRatio

◆ f_updateStiffnessMatrix

template<class DataTypes >
Data<bool> sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::f_updateStiffnessMatrix

◆ f_youngModulus

◆ l_topology

◆ m_potentialEnergy

template<class DataTypes >
SReal sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::m_potentialEnergy
protected

◆ m_topology

Pointer to the topology container. Will be set by link.

See also
l_topology

◆ method

◆ needUpdateTopology

template<class DataTypes >
bool sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::needUpdateTopology

Constructor details

◆ HexahedronFEMForceField()

Function details

◆ accumulateForceLarge()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::accumulateForceLarge ( WDataRefVecDeriv f,
RDataRefVecCoord p,
sofa::Index  i,
const Element elem 
)
protectedvirtual

◆ accumulateForcePolar()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::accumulateForcePolar ( WDataRefVecDeriv f,
RDataRefVecCoord p,
sofa::Index  i,
const Element elem 
)
protectedvirtual

◆ accumulateForceSmall()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::accumulateForceSmall ( WDataRefVecDeriv f,
RDataRefVecCoord p,
sofa::Index  i,
const Element elem 
)
protectedvirtual

◆ addDForce()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::addDForce ( const core::MechanicalParams mparams,
DataVecDeriv df,
const DataVecDeriv dx 
)
override

◆ addForce()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::addForce ( const core::MechanicalParams mparams,
DataVecDeriv f,
const DataVecCoord x,
const DataVecDeriv v 
)
override

◆ addKToMatrix()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::addKToMatrix ( const core::MechanicalParams mparams,
const sofa::core::behavior::MultiMatrixAccessor matrix 
)
override

◆ buildDampingMatrix()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::buildDampingMatrix ( core::behavior::DampingMatrix )
inlineoverride

◆ buildStiffnessMatrix()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::buildStiffnessMatrix ( core::behavior::StiffnessMatrix matrix)
override

◆ computeBBox()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeBBox ( const core::ExecParams params,
bool  onlyVisible 
)
override

◆ computeElementStiffness()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeElementStiffness ( ElementStiffness K,
const MaterialStiffness M,
const type::fixed_array< Coord, 8 > &  nodes,
const sofa::Index  elementIndice,
double  stiffnessFactor = 1.0 
) const
protectedvirtual

◆ computeForce()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeForce ( Displacement F,
const Displacement Depl,
const ElementStiffness K 
)
staticprotected

◆ computeMaterialStiffness()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeMaterialStiffness ( sofa::Index  i)
protected

◆ computeRotationLarge()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeRotationLarge ( Transformation r,
Coord edgex,
Coord edgey 
)
staticprotected

◆ computeRotationPolar()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::computeRotationPolar ( Transformation r,
type::Vec< 8, Coord > &  nodes 
)
protected

◆ draw()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::draw ( const core::visual::VisualParams vparams)
override

◆ getElementRotation()

template<class DataTypes >
const HexahedronFEMForceField< DataTypes >::Transformation & sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getElementRotation ( const sofa::Index  elemidx)

◆ getIndexedElements()

template<class DataTypes >
const VecElement* sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getIndexedElements ( )
inlineprotected

◆ getNodeRotation()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getNodeRotation ( Transformation R,
sofa::Index  nodeIdx 
)

◆ getPotentialEnergy() [1/2]

template<class DataTypes >
SReal sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getPotentialEnergy ( const core::MechanicalParams ) const
inlineoverride

◆ getPotentialEnergy() [2/2]

template<class DataTypes >
SReal sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getPotentialEnergy ( const core::MechanicalParams ,
const DataVecCoord  
) const
override

◆ getRotations()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::getRotations ( linearalgebra::BaseMatrix rotations,
int  offset = 0 
)
override

◆ handleTopologyChange()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::handleTopologyChange
inlineoverride

◆ init()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::init
override

◆ initLarge()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::initLarge ( sofa::Index  i,
const Element elem 
)
protected

◆ initPolar()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::initPolar ( sofa::Index  i,
const Element elem 
)
protected

◆ initSmall()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::initSmall ( sofa::Index  i,
const Element elem 
)
protected

◆ integrateStiffness()

template<class DataTypes >
HexahedronFEMForceField< DataTypes >::Mat33 sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::integrateStiffness ( int  signx0,
int  signy0,
int  signz0,
int  signx1,
int  signy1,
int  signz1,
const Real  u,
const Real  v,
const Real  w,
const Mat33 J_1 
)
staticprotected

◆ reinit()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::reinit
override

◆ setMethod()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::setMethod ( int  val)
inline

◆ setPoissonRatio()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::setPoissonRatio ( Real  val)
inline

◆ setUpdateStiffnessMatrix()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::setUpdateStiffnessMatrix ( bool  val)
inline

◆ setYoungModulus()

template<class DataTypes >
void sofa::component::solidmechanics::fem::elastic::HexahedronFEMForceField< DataTypes >::setYoungModulus ( Real  val)
inline

◆ SOFA_CLASS()

Enum details

◆ anonymous enum

template<class DataTypes >
anonymous enum
Enumerator
LARGE 

Symbol of mean large displacements tetrahedron solver (frame = edges mean on the 3 directions)

POLAR 

Symbol of polar displacements tetrahedron solver.

SMALL 

Related details

◆ HexahedronFEMForceFieldInternalData< DataTypes >

template<class DataTypes >
friend class HexahedronFEMForceFieldInternalData< DataTypes >
friend