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

#include <TriangleFEMForceField.h>

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

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

Collaboration graph
[legend]

Public Types

typedef
core::componentmodel::behavior::ForceField
< DataTypes > 
Inherited
typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
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

 TriangleFEMForceField ()
virtual ~TriangleFEMForceField ()
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.
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)

Data Fields

int method
Data< std::string > f_method
Data< Real > f_poisson
Data< Real > f_young
Data< Real > f_damping

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

virtual void applyStiffness (VecCoord &f, Real h, const VecCoord &x)
 f += Kx where K is the stiffness matrix and x a displacement
void computeStrainDisplacement (StrainDisplacement &J, Coord a, Coord b, Coord c)
void computeMaterialStiffnesses ()
void computeForce (Displacement &F, const Displacement &Depl, const MaterialStiffness &K, const StrainDisplacement &J)
void initSmall ()
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 ()
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)

Protected Attributes

VecMaterialStiffness _materialsStiffnesses
 the material stiffness matrices vector
VecStrainDisplacement _strainDisplacements
 the strain-displacement matrices vector
sofa::core::componentmodel::topology::BaseMeshTopology * _mesh
const VecElement * _indexedElements
Data< VecCoord > _initialPoints
 the intial positions of the points
sofa::helper::vector
< helper::fixed_array< Coord, 3 > > 
_rotatedInitialElements
 The initials positions in its frame.
sofa::helper::vector
< Transformation > 
_rotations

Detailed Description

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

Definition at line 65 of file TriangleFEMForceField.h.


Member Typedef Documentation

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

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

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

the displacement vector

Definition at line 85 of file TriangleFEMForceField.h.

Definition at line 76 of file TriangleFEMForceField.h.

Definition at line 75 of file TriangleFEMForceField.h.

Definition at line 68 of file TriangleFEMForceField.h.

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

the matrix of material stiffness

Definition at line 87 of file TriangleFEMForceField.h.

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

Definition at line 73 of file TriangleFEMForceField.h.

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

the strain-displacement matrix

Definition at line 91 of file TriangleFEMForceField.h.

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

matrix for rigid transformations like rotations

Definition at line 95 of file TriangleFEMForceField.h.

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

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

Definition at line 77 of file TriangleFEMForceField.h.

a vector of material stiffness matrices

Definition at line 88 of file TriangleFEMForceField.h.

a vector of strain-displacement matrices

Definition at line 92 of file TriangleFEMForceField.h.


Constructor & Destructor Documentation

Definition at line 59 of file TriangleFEMForceField.cpp.

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

Definition at line 71 of file TriangleFEMForceField.cpp.


Member Function Documentation

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

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

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

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

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

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

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

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

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

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

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

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

template<class DataTypes >
void sofa::component::forcefield::TriangleFEMForceField< 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::TriangleFEMForceField< DataTypes >::computeStrainDisplacement ( StrainDisplacement &  J,
Coord  a,
Coord  b,
Coord  c 
) [inline, protected]

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

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

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

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

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

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

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

Initialization method called at graph modification, during bottom-up traversal.

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

Definition at line 77 of file TriangleFEMForceField.cpp.

References sofa::component::forcefield::TriangleFEMForceField< DataTypes >::_indexedElements, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::_initialPoints, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::_mesh, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::_rotations, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::_strainDisplacements, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::computeMaterialStiffnesses(), sofa::component::forcefield::TriangleFEMForceField< DataTypes >::f_method, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getMeshTopology(), sofa::core::objectmodel::Base::getName(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuad(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::init(), sofa::component::forcefield::TriangleFEMForceField< DataTypes >::initLarge(), sofa::component::forcefield::TriangleFEMForceField< DataTypes >::initSmall(), sofa::component::forcefield::TriangleFEMForceField< DataTypes >::LARGE, sofa::component::forcefield::TriangleFEMForceField< DataTypes >::method, sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, and sofa::component::forcefield::TriangleFEMForceField< DataTypes >::SMALL.

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

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

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

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

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

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

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


Field Documentation

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

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

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


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

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