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

#include <EllipsoidForceField.h>

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

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

Collaboration graph
[legend]

Data Structures

class  Contact

Public Types

enum  { N = Coord::static_size }
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
typedef defaulttype::Mat< N, N,
Real > 
Mat

Public Member Functions

 EllipsoidForceField ()
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, 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.
void draw ()
 Render internal data of this object, for debugging purposes.
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< Coord > center
Data< Coord > vradius
Data< Real > stiffness
Data< Real > damping
Data< defaulttype::Vec3f > color
Data< bool > bDraw

Protected Attributes

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

Detailed Description

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

Definition at line 49 of file EllipsoidForceField.h.


Member Typedef Documentation

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

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

Definition at line 52 of file EllipsoidForceField.h.

Definition at line 59 of file EllipsoidForceField.h.

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

Definition at line 57 of file EllipsoidForceField.h.

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

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


Member Enumeration Documentation

template<class DataTypes >
anonymous enum

Enumerator:
N 

Definition at line 58 of file EllipsoidForceField.h.


Constructor & Destructor Documentation

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

Definition at line 97 of file EllipsoidForceField.h.


Member Function Documentation

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

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

template<>
void sofa::component::forcefield::EllipsoidForceField< 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::EllipsoidForceField< 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::EllipsoidForceField< 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 118 of file EllipsoidForceField.inl.

References sofa::component::forcefield::EllipsoidForceField< DataTypes >::contacts, sofa::component::forcefield::EllipsoidForceField< DataTypes >::Contact::index, and sofa::component::forcefield::EllipsoidForceField< DataTypes >::Contact::m.

template<>
void sofa::component::forcefield::EllipsoidForceField< gpu::cuda::CudaVec3f1Types >::addForce ( VecDeriv &  f,
const VecCoord &  x,
const VecDeriv &  v 
) [inline, virtual]

template<>
void sofa::component::forcefield::EllipsoidForceField< gpu::cuda::CudaVec3fTypes >::addForce ( VecDeriv &  f,
const VecCoord &  x,
const VecDeriv &  v 
) [inline, virtual]

template<>
void sofa::component::forcefield::EllipsoidForceField< 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::EllipsoidForceField< 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::EllipsoidForceField< DataTypes >::addForce ( VecDeriv &  f,
const VecCoord &  x,
const VecDeriv &  v 
) [inline, virtual]

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

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

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

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


Field Documentation


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

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