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

#include <ConicalForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  Contact

Public Types

typedef
core::componentmodel::behavior::ForceField
< DataTypes > 
Inherit
typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef Coord::value_type Real

Public Member Functions

 ConicalForceField ()
void setCone (const Coord &center, Coord height, Real angle)
void setStiffness (Real stiff)
void setDamping (Real damp)
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 updateStiffness (const VecCoord &x)
virtual bool isIn (Coord p)
void draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

Data< Coord > coneCenter
Data< Coord > coneHeight
Data< Real > coneAngle
Data< Real > stiffness
Data< Real > damping
Data< defaulttype::Vec3f > color
Data< bool > bDraw

Protected Attributes

Data< sofa::helper::vector
< Contact > > 
contacts
ConicalForceFieldInternalData
< DataTypes > 
data

Detailed Description

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

Definition at line 60 of file ConicalForceField.h.


Member Typedef Documentation

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

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

Definition at line 63 of file ConicalForceField.h.

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

Definition at line 68 of file ConicalForceField.h.

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

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


Constructor & Destructor Documentation

template<class DataTypes >
sofa::component::forcefield::ConicalForceField< DataTypes >::ConicalForceField (  )  [inline]

Definition at line 109 of file ConicalForceField.h.


Member Function Documentation

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

References sofa::component::forcefield::ConicalForceField< DataTypes >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::ConicalForceField< DataTypes >::Contact::index, sofa::component::forcefield::ConicalForceField< DataTypes >::Contact::normal, and sofa::component::forcefield::ConicalForceField< DataTypes >::stiffness.

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

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

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

template<class DataTypes >
bool sofa::component::forcefield::ConicalForceField< DataTypes >::isIn ( Coord  p  )  [inline, virtual]

template<class DataTypes >
void sofa::component::forcefield::ConicalForceField< DataTypes >::setCone ( const Coord &  center,
Coord  height,
Real  angle 
) [inline]

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

template<class DataTypes >
void sofa::component::forcefield::ConicalForceField< DataTypes >::setStiffness ( Real  stiff  )  [inline]

template<class DataTypes >
void sofa::component::forcefield::ConicalForceField< DataTypes >::updateStiffness ( const VecCoord &  x  )  [inline, virtual]

Definition at line 144 of file ConicalForceField.inl.


Field Documentation

Definition at line 96 of file ConicalForceField.h.


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

Generated on Sun Nov 23 04:18:41 2008 for Sofa by  doxygen 1.5.7.1