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

#include <CudaPenalityContactForceField.h>

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

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

Collaboration graph
[legend]

Public Types

typedef CudaVec3fTypes DataTypes
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, const Deriv &norm, Real dist, Real ks, Real mu_s=0.0f, Real mu_v=0.0f, int oldIndex=0)
void setContacts (Real distance, Real ks, sofa::core::componentmodel::collision::GPUDetectionOutputVector *outputs, bool useDistance, defaulttype::Mat3x3f *normXForm=NULL)
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 draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

sofa::gpu::cuda::CudaVector
< sofa::defaulttype::Vec4f > 
contacts
sofa::gpu::cuda::CudaVector
< float > 
pen

Detailed Description

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

Definition at line 54 of file CudaPenalityContactForceField.h.


Member Typedef Documentation

typedef DataTypes::Coord sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Coord

typedef CudaVec3fTypes sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::DataTypes

Definition at line 59 of file CudaPenalityContactForceField.h.

Definition at line 60 of file CudaPenalityContactForceField.h.

typedef DataTypes::Deriv sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Deriv

Definition at line 58 of file CudaPenalityContactForceField.h.

Definition at line 66 of file CudaPenalityContactForceField.h.

typedef Coord::value_type sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Real

Definition at line 65 of file CudaPenalityContactForceField.h.

typedef DataTypes::VecCoord sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::VecCoord

typedef DataTypes::VecDeriv sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::VecDeriv


Constructor & Destructor Documentation

Definition at line 90 of file CudaPenalityContactForceField.h.

Definition at line 95 of file CudaPenalityContactForceField.h.


Member Function Documentation

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addContact ( int  m1,
int  m2,
const Deriv &  norm,
Real  dist,
Real  ks,
Real  mu_s = 0.0f,
Real  mu_v = 0.0f,
int  oldIndex = 0 
)

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addDForce ( VecDeriv &  df1,
VecDeriv &  df2,
const VecDeriv &  dx1,
const VecDeriv &  dx2,
double  kFactor,
double  bFactor 
) [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< CudaVec3fTypes >.

Definition at line 168 of file CudaPenalityContactForceField.inl.

References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, norm(), and sofa::gpu::cuda::PenalityContactForceFieldCuda3f_addDForce().

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addForce ( VecDeriv &  f1,
VecDeriv &  f2,
const VecCoord &  x1,
const VecCoord &  x2,
const VecDeriv &  v1,
const VecDeriv &  v2 
) [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::PairInteractionForceField< CudaVec3fTypes >.

Definition at line 137 of file CudaPenalityContactForceField.inl.

References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, force, norm(), and sofa::gpu::cuda::PenalityContactForceFieldCuda3f_addForce().

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::clear ( int  reserve = 0  ) 

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::draw (  )  [virtual]

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

Definition at line 197 of file CudaPenalityContactForceField.inl.

void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::setContacts ( Real  distance,
Real  ks,
sofa::core::componentmodel::collision::GPUDetectionOutputVector *  outputs,
bool  useDistance,
defaulttype::Mat3x3f *  normXForm = NULL 
)


Field Documentation

Definition at line 82 of file CudaPenalityContactForceField.h.

Definition at line 83 of file CudaPenalityContactForceField.h.


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

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