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

#include <PlaneForceField.h>

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

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

Collaboration graph
[legend]

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

 PlaneForceField ()
void setPlane (const Deriv &normal, Real d)
void setMState (core::componentmodel::behavior::MechanicalState< DataTypes > *mstate)
void setStiffness (Real stiff)
void setDamping (Real damp)
void rotate (Deriv axe, Real angle)
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, 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 &x)
 Get the potential energy associated to this ForceField.
virtual void updateStiffness (const VecCoord &x)
void draw ()
 Render internal data of this object, for debugging purposes.
void drawPlane (float size=1000.0f)
bool addBBox (double *minBBox, double *maxBBox)
template<>
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.
template<>
void addDForce (VecDeriv &df, const VecDeriv &dx, double kFactor, double bFactor)
 Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().
template<>
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.
template<>
void addDForce (VecDeriv &df, const VecDeriv &dx, double kFactor, double bFactor)
 Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().
template<>
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.
template<>
void addDForce (VecDeriv &df, const VecCoord &dx, double kFactor, double)
template<>
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.
template<>
void addDForce (VecDeriv &df, const VecCoord &dx, double kFactor, double)

Data Fields

Data< Deriv > planeNormal
Data< Real > planeD
Data< Real > stiffness
Data< Real > damping
Data< defaulttype::Vec3f > color
Data< bool > bDraw

Protected Attributes

sofa::helper::vector< unsigned
int > 
contacts
PlaneForceFieldInternalData
< DataTypes > 
data

Detailed Description

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

Definition at line 49 of file PlaneForceField.h.


Member Typedef Documentation

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

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

Definition at line 52 of file PlaneForceField.h.

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

Definition at line 57 of file PlaneForceField.h.

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

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


Constructor & Destructor Documentation

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


Member Function Documentation

template<class DataTypes >
bool sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox ( double *  minBBox,
double *  maxBBox 
) [inline]

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addDForce ( VecDeriv &  df,
const VecCoord &  dx,
double  kFactor,
double   
) [inline]

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addDForce ( VecDeriv &  df,
const VecCoord &  dx,
double  kFactor,
double   
) [inline]

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addDForce ( VecDeriv &  df,
const VecDeriv &  dx,
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 ForceField::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::ForceField< DataTypes >.

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addDForce ( VecDeriv &  df,
const VecDeriv &  dx,
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 ForceField::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::ForceField< DataTypes >.

template<class DataTypes >
void sofa::component::forcefield::PlaneForceField< DataTypes >::addDForce ( VecDeriv &  df,
const VecDeriv &  dx,
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 ForceField::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::ForceField< DataTypes >.

Definition at line 74 of file PlaneForceField.inl.

References sofa::component::forcefield::PlaneForceField< DataTypes >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::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 89 of file CudaPlaneForceField.inl.

References sofa::component::forcefield::PlaneForceField< DataTypes >::damping, sofa::component::forcefield::PlaneForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::gpu::cuda::PlaneForceFieldCuda3f1_addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::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 66 of file CudaPlaneForceField.inl.

References sofa::component::forcefield::PlaneForceField< DataTypes >::damping, sofa::component::forcefield::PlaneForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::gpu::cuda::PlaneForceFieldCuda3f_addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::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 >.

template<>
void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::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 >.

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

References sofa::component::forcefield::PlaneForceField< DataTypes >::contacts, sofa::component::forcefield::PlaneForceField< DataTypes >::damping, force, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.

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

Render internal data of this object, for debugging purposes.

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

Definition at line 124 of file PlaneForceField.inl.

References sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), and sofa::core::objectmodel::BaseObject::getContext().

template<class DataTypes >
void sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane ( float  size = 1000.0f  )  [inline]

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

template<class DataTypes >
void sofa::component::forcefield::PlaneForceField< DataTypes >::rotate ( Deriv  axe,
Real  angle 
) [inline]

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

template<class DataTypes >
void sofa::component::forcefield::PlaneForceField< DataTypes >::setMState ( core::componentmodel::behavior::MechanicalState< DataTypes > *  mstate  )  [inline]

Definition at line 93 of file PlaneForceField.h.

template<class DataTypes >
void sofa::component::forcefield::PlaneForceField< DataTypes >::setPlane ( const Deriv &  normal,
Real  d 
) [inline]

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

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


Field Documentation

template<class DataTypes >
sofa::helper::vector<unsigned int> sofa::component::forcefield::PlaneForceField< DataTypes >::contacts [protected]


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

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