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

corotational triangle from {NPF05, author = "Nesme, Matthieu and Payan, Yohan and Faure, Fran\c{c}ois", title = "Efficient, Physically Plausible Finite Elements", booktitle = "Eurographics (short papers)", month = "august", year = "2005", editor = "J. Dingliana and F. Ganovelli", keywords = "animation, physical model, elasticity, finite elements", url = "http://www-evasion.imag.fr/Publications/2005/NPF05" } More...

#include <TriangularFEMForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  EdgeInformation
class  TriangleInformation
class  VertexInformation

Public Types

typedef
core::componentmodel::behavior::ForceField
< DataTypes > 
Inherited
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
typedef
sofa::core::componentmodel::topology::BaseMeshTopology::index_type 
Index
typedef
sofa::core::componentmodel::topology::BaseMeshTopology::Triangle 
Element
typedef
sofa::core::componentmodel::topology::BaseMeshTopology::SeqTriangles 
VecElement

Public Member Functions

 TriangularFEMForceField ()
virtual ~TriangularFEMForceField ()
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 handleTopologyChange ()
 Handle topological Changes.
void draw ()
 Render internal data of this object, for debugging purposes.
Real getPoisson ()
void setPoisson (Real val)
Real getYoung ()
void setYoung (Real val)
Real getDamping ()
void setDamping (Real val)
int getMethod ()
void setMethod (int val)
int getFracturedEdge ()

Data Fields

int method
Data< std::string > f_method
Data< Real > f_poisson
Data< Real > f_young
Data< Real > f_damping
Data< bool > f_fracturable
Data< bool > showStressValue
Data< bool > showStressVector

Static Public Attributes

static const int SMALL = 1
 Symbol of small displacements triangle solver.
static const int LARGE = 0
 Symbol of large displacements triangle solver.

Protected Types

typedef Vec< 6, Real > Displacement
 the displacement vector
typedef Mat< 3, 3, Real > MaterialStiffness
 the matrix of material stiffness
typedef sofa::helper::vector
< MaterialStiffness > 
VecMaterialStiffness
 a vector of material stiffness matrices
typedef Mat< 6, 3, Real > StrainDisplacement
 the strain-displacement matrix
typedef sofa::helper::vector
< StrainDisplacement > 
VecStrainDisplacement
 a vector of strain-displacement matrices
typedef Mat< 3, 3, Real > Transformation
 matrix for rigid transformations like rotations

Protected Member Functions

void computeEigenStrain (Coord &v, StrainDisplacement &J, Displacement &Depl, double &maxEigenValue)
virtual void applyStiffness (VecCoord &f, Real h, const VecCoord &x)
 f += Kx where K is the stiffness matrix and x a displacement
virtual void computeMaterialStiffness (int i, Index &a, Index &b, Index &c)
void computeStrainDisplacement (StrainDisplacement &J, Coord a, Coord b, Coord c)
void computeForce (Displacement &F, const Displacement &Depl, const MaterialStiffness &K, const StrainDisplacement &J)
void initSmall (void)
void accumulateForceSmall (VecCoord &f, const VecCoord &p, Index elementIndex, bool implicit=false)
void accumulateDampingSmall (VecCoord &f, Index elementIndex)
void applyStiffnessSmall (VecCoord &f, Real h, const VecCoord &x)
void initLarge (int i, Index &a, Index &b, Index &c)
void computeRotationLarge (Transformation &r, const VecCoord &p, const Index &a, const Index &b, const Index &c)
void accumulateForceLarge (VecCoord &f, const VecCoord &p, Index elementIndex, bool implicit=false)
void accumulateDampingLarge (VecCoord &f, Index elementIndex)
void applyStiffnessLarge (VecCoord &f, Real h, const VecCoord &x)

Static Protected Member Functions

static void TRQSTriangleCreationFunction (int, void *, TriangleInformation &, const Triangle &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)

Protected Attributes

TriangleData< TriangleInformation > triangleInfo
PointData< VertexInformation > vertexInfo
EdgeData< EdgeInformation > edgeInfo
sofa::core::componentmodel::topology::BaseMeshTopology * _topology
VecCoord * _initialPoints
bool updateMatrix
int lastFracturedEdgeIndex

Detailed Description

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

corotational triangle from {NPF05, author = "Nesme, Matthieu and Payan, Yohan and Faure, Fran\c{c}ois", title = "Efficient, Physically Plausible Finite Elements", booktitle = "Eurographics (short papers)", month = "august", year = "2005", editor = "J. Dingliana and F. Ganovelli", keywords = "animation, physical model, elasticity, finite elements", url = "http://www-evasion.imag.fr/Publications/2005/NPF05" }

Definition at line 71 of file TriangularFEMForceField.h.


Member Typedef Documentation

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

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

template<class DataTypes >
typedef Vec<6, Real> sofa::component::forcefield::TriangularFEMForceField< DataTypes >::Displacement [protected]

the displacement vector

Definition at line 94 of file TriangularFEMForceField.h.

template<class DataTypes >
typedef Mat<3, 3, Real> sofa::component::forcefield::TriangularFEMForceField< DataTypes >::MaterialStiffness [protected]

the matrix of material stiffness

Definition at line 95 of file TriangularFEMForceField.h.

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

template<class DataTypes >
typedef Mat<6, 3, Real> sofa::component::forcefield::TriangularFEMForceField< DataTypes >::StrainDisplacement [protected]

the strain-displacement matrix

Definition at line 97 of file TriangularFEMForceField.h.

template<class DataTypes >
typedef Mat<3, 3, Real > sofa::component::forcefield::TriangularFEMForceField< DataTypes >::Transformation [protected]

matrix for rigid transformations like rotations

Definition at line 99 of file TriangularFEMForceField.h.

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

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

a vector of material stiffness matrices

Definition at line 96 of file TriangularFEMForceField.h.

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

a vector of strain-displacement matrices

Definition at line 98 of file TriangularFEMForceField.h.


Constructor & Destructor Documentation

Definition at line 103 of file TriangularFEMForceField.cpp.

template<class DataTypes >
sofa::component::forcefield::TriangularFEMForceField< DataTypes >::~TriangularFEMForceField (  )  [inline, virtual]

Definition at line 127 of file TriangularFEMForceField.cpp.


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateDampingLarge ( VecCoord &  f,
Index  elementIndex 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateDampingSmall ( VecCoord &  f,
Index  elementIndex 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateForceLarge ( VecCoord &  f,
const VecCoord &  p,
Index  elementIndex,
bool  implicit = false 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateForceSmall ( VecCoord &  f,
const VecCoord &  p,
Index  elementIndex,
bool  implicit = false 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< 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 430 of file TriangularFEMForceField.cpp.

References sofa::component::forcefield::TriangularFEMForceField< DataTypes >::applyStiffnessLarge(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::applyStiffnessSmall(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::method, and sofa::component::forcefield::TriangularFEMForceField< DataTypes >::SMALL.

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

Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField.

If the ForceField can be represented as a matrix, this method computes $ f += B v + K x $

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

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

Definition at line 192 of file TriangularFEMForceField.cpp.

References sofa::component::forcefield::TriangularFEMForceField< DataTypes >::_topology, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateDampingLarge(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateDampingSmall(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateForceLarge(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::accumulateForceSmall(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::edgeInfo, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::f_damping, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::f_fracturable, sofa::core::componentmodel::topology::BaseMeshTopology::getEdge(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeVertexShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleEdgeShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleVertexShell(), sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::lastFracturedEdgeIndex, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::method, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::SMALL, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::triangleInfo, and sofa::component::forcefield::TriangularFEMForceField< DataTypes >::vertexInfo.

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::applyStiffness ( VecCoord &  f,
Real  h,
const VecCoord &  x 
) [inline, protected, virtual]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::applyStiffnessLarge ( VecCoord &  f,
Real  h,
const VecCoord &  x 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::applyStiffnessSmall ( VecCoord &  f,
Real  h,
const VecCoord &  x 
) [inline, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::computeEigenStrain ( Coord &  v,
StrainDisplacement &  J,
Displacement &  Depl,
double &  maxEigenValue 
) [inline, protected]

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

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

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

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

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

template<class DataTypes >
Real sofa::component::forcefield::TriangularFEMForceField< DataTypes >::getDamping (  )  [inline]

template<class DataTypes >
int sofa::component::forcefield::TriangularFEMForceField< DataTypes >::getFracturedEdge (  )  [inline, virtual]

template<class DataTypes >
int sofa::component::forcefield::TriangularFEMForceField< DataTypes >::getMethod (  )  [inline]

template<class DataTypes >
Real sofa::component::forcefield::TriangularFEMForceField< DataTypes >::getPoisson (  )  [inline]

template<class DataTypes >
double sofa::component::forcefield::TriangularFEMForceField< 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 446 of file TriangularFEMForceField.cpp.

template<class DataTypes >
Real sofa::component::forcefield::TriangularFEMForceField< DataTypes >::getYoung (  )  [inline]

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

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

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

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::initSmall ( void   )  [inline, protected]

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

Update method called when variables used in precomputation are modified.

Reimplemented from sofa::core::objectmodel::BaseObject.

Reimplemented in sofa::component::forcefield::TriangularAnisotropicFEMForceField< DataTypes >.

Definition at line 156 of file TriangularFEMForceField.cpp.

References sofa::component::forcefield::TriangularFEMForceField< DataTypes >::_initialPoints, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::_topology, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::edgeInfo, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::f_method, sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX0(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::LARGE, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::method, sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::SMALL, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::triangleInfo, sofa::component::forcefield::TriangularFEMForceField< DataTypes >::TRQSTriangleCreationFunction(), and sofa::component::forcefield::TriangularFEMForceField< DataTypes >::vertexInfo.

Referenced by sofa::component::forcefield::TriangularFEMForceField< DataTypes >::init(), and sofa::component::forcefield::TriangularAnisotropicFEMForceField< DataTypes >::reinit().

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

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

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

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

template<class DataTypes >
void sofa::component::forcefield::TriangularFEMForceField< DataTypes >::TRQSTriangleCreationFunction ( int  triangleIndex,
void *  param,
TriangleInformation &  ,
const Triangle &  t,
const sofa::helper::vector< unsigned int > &  ,
const sofa::helper::vector< double > &   
) [inline, static, protected]


Field Documentation

template<class DataTypes >
Data<std::string> sofa::component::forcefield::TriangularFEMForceField< DataTypes >::f_method

template<class DataTypes >
const int sofa::component::forcefield::TriangularFEMForceField< DataTypes >::LARGE = 0 [static]

template<class DataTypes >
const int sofa::component::forcefield::TriangularFEMForceField< DataTypes >::SMALL = 1 [static]

Definition at line 153 of file TriangularFEMForceField.h.


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

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