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

#include <PenalityContactForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  Contact

Public Types

typedef
core::componentmodel::behavior::PairInteractionForceField
< DataTypes > 
Inherit
typedef DataTypes DataTypes1
typedef DataTypes DataTypes2
typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef Coord::value_type Real
typedef
core::componentmodel::behavior::MechanicalState
< DataTypes > 
MechanicalState

Public Member Functions

 PenalityContactForceField (MechanicalState *object1, MechanicalState *object2)
 PenalityContactForceField ()
void clear (int reserve=0)
void addContact (int m1, int m2, int index1, int index2, const Deriv &norm, Real dist, Real ks, Real mu_s=0.0f, Real mu_v=0.0f, int oldIndex=0)
virtual void addForce (VecDeriv &f1, VecDeriv &f2, const VecCoord &x1, const VecCoord &x2, const VecDeriv &v1, const VecDeriv &v2)
 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 &df1, VecDeriv &df2, const VecDeriv &dx1, const VecDeriv &dx2, double kFactor, double bFactor)
 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 &, const VecCoord &)
 Get the potential energy associated to this ForceField.
void grabPoint (const core::componentmodel::behavior::MechanicalState< defaulttype::Vec3Types > *tool, const helper::vector< unsigned int > &index, helper::vector< std::pair< core::objectmodel::BaseObject *, defaulttype::Vec3f > > &result, helper::vector< unsigned int > &triangle, helper::vector< unsigned int > &index_point)
void draw ()
 Render internal data of this object, for debugging purposes.

Protected Attributes

Data< sofa::helper::vector
< Contact > > 
contacts
sofa::helper::vector< Contact > prevContacts

Detailed Description

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

Definition at line 45 of file PenalityContactForceField.h.


Member Typedef Documentation

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

Definition at line 49 of file PenalityContactForceField.h.

Definition at line 50 of file PenalityContactForceField.h.

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

Definition at line 48 of file PenalityContactForceField.h.

Definition at line 56 of file PenalityContactForceField.h.

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

Definition at line 55 of file PenalityContactForceField.h.

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

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


Constructor & Destructor Documentation

Definition at line 98 of file PenalityContactForceField.h.

Definition at line 103 of file PenalityContactForceField.h.


Member Function Documentation

template<class DataTypes >
void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addContact ( int  m1,
int  m2,
int  index1,
int  index2,
const Deriv &  norm,
Real  dist,
Real  ks,
Real  mu_s = 0.0f,
Real  mu_v = 0.0f,
int  oldIndex = 0 
) [inline]

template<class DataTypes >
void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addDForce ( VecDeriv &  df1,
VecDeriv &  df2,
const VecDeriv &  dx1,
const VecDeriv &  dx2,
double  kFactor,
double  bFactor 
) [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 += kFactor K dx + bFactor B dx $

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

To support old components that implement the deprecated addForce method without scalar coefficients, it defaults to using a temporaty vector to compute $ K dx $ and then manually scaling all values by kFactor.

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

Definition at line 105 of file PenalityContactForceField.inl.

References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::ks, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m2, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::norm, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::pen.

template<class DataTypes >
void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addForce ( VecDeriv &  f1,
VecDeriv &  f2,
const VecCoord &  x1,
const VecCoord &  x2,
const VecDeriv &  v1,
const VecDeriv &  v2 
) [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::PenalityContactForceField< DataTypes >::clear ( int  reserve = 0  )  [inline]

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

template<class DataTypes >
double sofa::component::forcefield::PenalityContactForceField< DataTypes >::getPotentialEnergy ( const VecCoord &  x1,
const VecCoord &  x2 
) [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::PairInteractionForceField< DataTypes >.

Definition at line 126 of file PenalityContactForceField.inl.

template<class DataTypes >
void sofa::component::forcefield::PenalityContactForceField< DataTypes >::grabPoint ( const core::componentmodel::behavior::MechanicalState< defaulttype::Vec3Types > *  tool,
const helper::vector< unsigned int > &  index,
helper::vector< std::pair< core::objectmodel::BaseObject *, defaulttype::Vec3f > > &  result,
helper::vector< unsigned int > &  triangle,
helper::vector< unsigned int > &  index_point 
) [inline]


Field Documentation


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

Generated on Sun Nov 23 04:19:34 2008 for Sofa by  doxygen 1.5.7.1