sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes > Class Template Reference

Compute Finite Element forces based on tetrahedral elements. More...

#include <TetrahedralCorotationalFEMForceField.h>

Inheritance diagram for sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >:

Collaboration graph
[legend]

Full system matrix assembly support

typedef std::pair< int, Real > Col_Value
typedef vector< Col_Value > CompressedValue
typedef vector< CompressedValue > CompressedMatrix
typedef unsigned int Index
CompressedMatrix _stiffnesses

Data Structures

class  TetrahedronInformation
 the information stored for each tetrahedron More...

Public Types

enum  { SMALL = 0, LARGE = 1, POLAR = 2 }
typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::VecReal VecReal
typedef VecCoord Vector
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef Coord::value_type Real

Public Member Functions

 TetrahedralCorotationalFEMForceField ()
void parse (core::objectmodel::BaseObjectDescription *arg)
 Parse the given description to assign values to this object's fields and potentially other parameters.
void setPoissonRatio (Real val)
void setYoungModulus (Real val)
void setMethod (int val)
void setUpdateStiffnessMatrix (bool val)
void setComputeGlobalMatrix (bool val)
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual void reinit ()
 Update method called when variables used in precomputation are modified.
virtual void addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v)
 Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField.
virtual void addDForce (VecDeriv &df, const VecDeriv &dx)
 Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().
virtual double getPotentialEnergy (const VecCoord &x)
 Get the potential energy associated to this ForceField.
virtual void addKToMatrix (sofa::defaulttype::BaseMatrix *, SReal, unsigned int &)
 Compute the system matrix corresponding to k K.
virtual void handleTopologyChange ()
 Handle topological Changes.
void draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

int method
Data< std::string > f_method
 the computation method of the displacements
Real _poissonRatio
DataPtr< Real > f_poissonRatio
Real _youngModulus
DataPtr< Real > f_youngModulus
VecReal _localStiffnessFactor
DataPtr< VecReal > f_localStiffnessFactor
bool _updateStiffnessMatrix
DataPtr< bool > f_updateStiffnessMatrix
bool _assembling
DataPtr< bool > f_assembling

Protected Types

Per element (tetrahedron) data
typedef VecNoInit< 12, Real > Displacement
 Displacement vector (deformation of the 4 corners of a tetrahedron.
typedef Mat< 6, 6, Real > MaterialStiffness
 Material stiffness matrix of a tetrahedron.
typedef Mat< 12, 6, Real > StrainDisplacement
 Strain-displacement matrix.
typedef MatNoInit< 3, 3, Real > Transformation
 Rigid transformation (rotation) matrix.
typedef Mat< 12, 12, Real > StiffnessMatrix
 Stiffness matrix ( = RJKJtRt with K the Material stiffness matrix, J the strain-displacement matrix, and R the transformation matrix if any ).

Protected Member Functions

void computeStrainDisplacement (StrainDisplacement &J, Coord a, Coord b, Coord c, Coord d)
Real peudo_determinant_for_coef (const Mat< 2, 3, Real > &M)
void computeStiffnessMatrix (StiffnessMatrix &S, StiffnessMatrix &SR, const MaterialStiffness &K, const StrainDisplacement &J, const Transformation &Rot)
void computeMaterialStiffness (int i, Index &a, Index &b, Index &c, Index &d)
void computeForce (Displacement &F, const Displacement &Depl, const MaterialStiffness &K, const StrainDisplacement &J)
void initSmall (int i, Index &a, Index &b, Index &c, Index &d)
void accumulateForceSmall (Vector &f, const Vector &p, Index elementIndex)
void applyStiffnessSmall (Vector &f, const Vector &x, int i=0, Index a=0, Index b=1, Index c=2, Index d=3)
void initLarge (int i, Index &a, Index &b, Index &c, Index &d)
void computeRotationLarge (Transformation &r, const Vector &p, const Index &a, const Index &b, const Index &c)
void accumulateForceLarge (Vector &f, const Vector &p, Index elementIndex)
void applyStiffnessLarge (Vector &f, const Vector &x, int i=0, Index a=0, Index b=1, Index c=2, Index d=3)
void initPolar (int i, Index &a, Index &b, Index &c, Index &d)
void accumulateForcePolar (Vector &f, const Vector &p, Index elementIndex)
void applyStiffnessPolar (Vector &f, const Vector &x, int i=0, Index a=0, Index b=1, Index c=2, Index d=3)

Static Protected Member Functions

static void CFTetrahedronCreationFunction (int, void *, TetrahedronInformation &, const Tetrahedron &, const helper::vector< unsigned int > &, const helper::vector< double > &)
 the callback function called when a tetrahedron is created

Protected Attributes

TetrahedronData
< TetrahedronInformation > 
tetrahedronInfo
 container that stotes all requires information for each tetrahedron
double m_potentialEnergy
sofa::core::componentmodel::topology::BaseMeshTopology * _topology

Detailed Description

template<class DataTypes>
class sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >

Compute Finite Element forces based on tetrahedral elements.

Definition at line 67 of file TetrahedralCorotationalFEMForceField.h.


Member Typedef Documentation

template<class DataTypes >
typedef std::pair<int,Real> sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::Col_Value [protected]

Definition at line 128 of file TetrahedralCorotationalFEMForceField.h.

Definition at line 130 of file TetrahedralCorotationalFEMForceField.h.

Definition at line 129 of file TetrahedralCorotationalFEMForceField.h.

template<class DataTypes >
typedef DataTypes::Coord sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::Coord

template<class DataTypes >
typedef DataTypes::Deriv sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::Deriv

Displacement vector (deformation of the 4 corners of a tetrahedron.

Definition at line 89 of file TetrahedralCorotationalFEMForceField.h.

template<class DataTypes >
typedef unsigned int sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::Index [protected]

Definition at line 131 of file TetrahedralCorotationalFEMForceField.h.

Material stiffness matrix of a tetrahedron.

Definition at line 92 of file TetrahedralCorotationalFEMForceField.h.

template<class DataTypes >
typedef Coord::value_type sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::Real

Definition at line 76 of file TetrahedralCorotationalFEMForceField.h.

template<class DataTypes >
typedef Mat<12, 12, Real> sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::StiffnessMatrix [protected]

Stiffness matrix ( = RJKJtRt with K the Material stiffness matrix, J the strain-displacement matrix, and R the transformation matrix if any ).

Definition at line 101 of file TetrahedralCorotationalFEMForceField.h.

Strain-displacement matrix.

Definition at line 95 of file TetrahedralCorotationalFEMForceField.h.

Rigid transformation (rotation) matrix.

Definition at line 98 of file TetrahedralCorotationalFEMForceField.h.

template<class DataTypes >
typedef DataTypes::VecCoord sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::VecCoord

template<class DataTypes >
typedef DataTypes::VecDeriv sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::VecDeriv

template<class DataTypes >
typedef DataTypes::VecReal sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::VecReal

Definition at line 72 of file TetrahedralCorotationalFEMForceField.h.

Definition at line 73 of file TetrahedralCorotationalFEMForceField.h.


Member Enumeration Documentation

template<class DataTypes >
anonymous enum

Enumerator:
SMALL  Symbol of small displacements tetrahedron solver.
LARGE  Symbol of large displacements tetrahedron solver.
POLAR  Symbol of polar displacements tetrahedron solver.

Definition at line 79 of file TetrahedralCorotationalFEMForceField.h.


Constructor & Destructor Documentation

Definition at line 154 of file TetrahedralCorotationalFEMForceField.h.


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::accumulateForceLarge ( Vector &  f,
const Vector &  p,
Index  elementIndex 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::accumulateForcePolar ( Vector &  f,
const Vector &  p,
Index  elementIndex 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::accumulateForceSmall ( Vector &  f,
const Vector &  p,
Index  elementIndex 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::addDForce ( VecDeriv &  df,
const VecDeriv &  dx 
) [inline, virtual]

Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().

The derivative should be directly derived from the computations done by addForce. Any forces neglected in addDForce will be integrated explicitly (i.e. using its value at the beginning of the timestep).

If the ForceField can be represented as a matrix, this method computes $ df += K dx $

This method must be implemented by the component, and is usually called by the generic ForceField::addDForce() method.

Deprecated:
to more efficiently accumulate contributions from all terms of the system equation, a new addDForce method allowing to pass two coefficients for the stiffness and damping terms should now be used.

Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.

Definition at line 193 of file TetrahedralCorotationalFEMForceField.inl.

References sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::_topology, sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessLarge(), sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessPolar(), sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessSmall(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTetras(), sofa::core::componentmodel::topology::BaseMeshTopology::getTetra(), sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::LARGE, sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::method, sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::POLAR, and sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::SMALL.

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::addForce ( VecDeriv &  f,
const VecCoord &  x,
const VecDeriv &  v 
) [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::addKToMatrix ( sofa::defaulttype::BaseMatrix *  matrix,
SReal  kFact,
unsigned int &  offset 
) [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessLarge ( Vector &  f,
const Vector &  x,
int  i = 0,
Index  a = 0,
Index  b = 1,
Index  c = 2,
Index  d = 3 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessPolar ( Vector &  f,
const Vector &  x,
int  i = 0,
Index  a = 0,
Index  b = 1,
Index  c = 2,
Index  d = 3 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::applyStiffnessSmall ( Vector &  f,
const Vector &  x,
int  i = 0,
Index  a = 0,
Index  b = 1,
Index  c = 2,
Index  d = 3 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::CFTetrahedronCreationFunction ( int  tetrahedronIndex,
void *  param,
TetrahedronInformation &  ,
const Tetrahedron &  ,
const helper::vector< unsigned int > &  ,
const helper::vector< double > &   
) [inline, static, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::computeForce ( Displacement &  F,
const Displacement &  Depl,
const MaterialStiffness &  K,
const StrainDisplacement &  J 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::computeMaterialStiffness ( int  i,
Index &  a,
Index &  b,
Index &  c,
Index &  d 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::computeRotationLarge ( Transformation &  r,
const Vector &  p,
const Index &  a,
const Index &  b,
const Index &  c 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::computeStiffnessMatrix ( StiffnessMatrix &  S,
StiffnessMatrix &  SR,
const MaterialStiffness &  K,
const StrainDisplacement &  J,
const Transformation &  Rot 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::computeStrainDisplacement ( StrainDisplacement &  J,
Coord  a,
Coord  b,
Coord  c,
Coord  d 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::draw (  )  [inline, virtual]

template<class DataTypes >
double sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::getPotentialEnergy ( const VecCoord &  x  )  [inline, virtual]

Get the potential energy associated to this ForceField.

Used to extimate the total energy of the system by some post-stabilization techniques.

This method must be implemented by the component, and is usually called by the generic ForceField::getPotentialEnergy() method.

Implements sofa::core::componentmodel::behavior::ForceField< DataTypes >.

Definition at line 243 of file TetrahedralCorotationalFEMForceField.inl.

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::handleTopologyChange (  )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::init ( void   )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::initLarge ( int  i,
Index &  a,
Index &  b,
Index &  c,
Index &  d 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::initPolar ( int  i,
Index &  a,
Index &  b,
Index &  c,
Index &  d 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::initSmall ( int  i,
Index &  a,
Index &  b,
Index &  c,
Index &  d 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::parse ( core::objectmodel::BaseObjectDescription *  arg  )  [inline, virtual]

Parse the given description to assign values to this object's fields and potentially other parameters.

Reimplemented from sofa::core::objectmodel::Base.

Definition at line 92 of file TetrahedralCorotationalFEMForceField.inl.

References sofa::core::objectmodel::BaseObjectDescription::getAttribute(), and sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setComputeGlobalMatrix().

template<class DataTypes >
TetrahedralCorotationalFEMForceField< DataTypes >::Real sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::peudo_determinant_for_coef ( const Mat< 2, 3, Real > &  M  )  [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::reinit (  )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setComputeGlobalMatrix ( bool  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setMethod ( int  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setPoissonRatio ( Real  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setUpdateStiffnessMatrix ( bool  val  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::setYoungModulus ( Real  val  )  [inline]


Field Documentation

the computation method of the displacements

Definition at line 142 of file TetrahedralCorotationalFEMForceField.h.

Referenced by sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::reinit().

Definition at line 136 of file TetrahedralCorotationalFEMForceField.h.


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:20:12 2008 for Sofa by  doxygen 1.5.7.1