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

#include <TriangularBiquadraticSpringsForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  EdgeRestInformation
class  Mat3
class  TriangleRestInformation

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

Public Member Functions

 TriangularBiquadraticSpringsForceField ()
 second Lam� coefficient
virtual ~TriangularBiquadraticSpringsForceField ()
virtual double getPotentialEnergy (const VecCoord &x)
 Get the potential energy associated to this ForceField.
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
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 Real getLambda () const
virtual Real getMu () const
virtual void handleTopologyChange ()
 Handle topological Changes.
void setYoungModulus (const double modulus)
void setPoissonRatio (const double ratio)
void draw ()
 Render internal data of this object, for debugging purposes.
void updateLameCoefficients ()
 compute lambda and mu based on the Young modulus and Poisson ratio

Protected Member Functions

EdgeData< EdgeRestInformation > & getEdgeInfo ()

Static Protected Member Functions

static void TRBSEdgeCreationFunction (int edgeIndex, void *param, EdgeRestInformation &ei, const Edge &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)
static void TRBSTriangleCreationFunction (int, void *, TriangleRestInformation &, const Triangle &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)
static void TRBSTriangleDestroyFunction (int, void *, TriangleRestInformation &)

Protected Attributes

TriangleData
< TriangleRestInformation > 
triangleInfo
EdgeData< EdgeRestInformation > edgeInfo
sofa::core::componentmodel::topology::BaseMeshTopology * _topology
Data< VecCoord > _initialPoints
 the intial positions of the points
bool updateMatrix
Data< Real > f_poissonRatio
Data< Real > f_youngModulus
Data< Real > f_dampingRatio
Data< bool > f_useAngularSprings
Real lambda
Real mu
 first Lam� coefficient

Detailed Description

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

Definition at line 55 of file TriangularBiquadraticSpringsForceField.h.


Member Typedef Documentation

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

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

Definition at line 58 of file TriangularBiquadraticSpringsForceField.h.

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

Definition at line 63 of file TriangularBiquadraticSpringsForceField.h.

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

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


Constructor & Destructor Documentation

second Lam� coefficient

Definition at line 145 of file TriangularBiquadraticSpringsForceField.inl.

Definition at line 166 of file TriangularBiquadraticSpringsForceField.inl.


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< 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 286 of file TriangularBiquadraticSpringsForceField.inl.

References sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::_topology, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TriangleRestInformation::DfDx, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::f_useAngularSprings, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TriangleRestInformation::gamma, sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeTriangleShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TriangleRestInformation::stiffness, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::Mat3::transposeMultiply(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::triangleInfo, and sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::updateMatrix.

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< 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 226 of file TriangularBiquadraticSpringsForceField.inl.

References sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::_topology, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::EdgeRestInformation::currentSquareLength, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::EdgeRestInformation::deltaL2, dot(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::f_dampingRatio, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::f_useAngularSprings, force, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TriangleRestInformation::gamma, sofa::core::componentmodel::topology::BaseMeshTopology::getEdge(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeTriangleShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::EdgeRestInformation::restSquareLength, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::EdgeRestInformation::stiffness, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::triangleInfo, and sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::updateMatrix.

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

template<class DataTypes >
EdgeData<EdgeRestInformation>& sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::getEdgeInfo (  )  [inline, protected]

template<class DataTypes >
virtual Real sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::getLambda (  )  const [inline, virtual]

template<class DataTypes >
virtual Real sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::getMu ( void   )  const [inline, virtual]

template<class DataTypes >
double sofa::component::forcefield::TriangularBiquadraticSpringsForceField< 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 220 of file TriangularBiquadraticSpringsForceField.inl.

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

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

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

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

Definition at line 171 of file TriangularBiquadraticSpringsForceField.inl.

References sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::_initialPoints, sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::_topology, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdge(), sofa::core::objectmodel::BaseContext::getMeshTopology(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX0(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::init(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, sofa::component::topology::EdgeData< T, Alloc >::setCreateFunction(), sofa::component::topology::EdgeData< T, Alloc >::setCreateParameter(), sofa::component::topology::EdgeData< T, Alloc >::setDestroyParameter(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSEdgeCreationFunction(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSTriangleCreationFunction(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSTriangleDestroyFunction(), sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::triangleInfo, and sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::updateLameCoefficients().

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::setPoissonRatio ( const double  ratio  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::setYoungModulus ( const double  modulus  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSEdgeCreationFunction ( int  edgeIndex,
void *  param,
EdgeRestInformation &  ei,
const Edge &  ,
const sofa::helper::vector< unsigned int > &  ,
const sofa::helper::vector< double > &   
) [inline, static, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSTriangleCreationFunction ( int  triangleIndex,
void *  param,
TriangleRestInformation &  tinfo,
const Triangle &  ,
const sofa::helper::vector< unsigned int > &  ,
const sofa::helper::vector< double > &   
) [inline, static, protected]

template<class DataTypes >
static void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::TRBSTriangleDestroyFunction ( int  ,
void *  ,
TriangleRestInformation &   
) [static, protected]

template<class DataTypes >
void sofa::component::forcefield::TriangularBiquadraticSpringsForceField< DataTypes >::updateLameCoefficients (  )  [inline]


Field Documentation


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

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