sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 > Class Template Reference

#include <InteractionEllipsoidForceField.h>

Inheritance diagram for sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >:

Collaboration graph
[legend]

Data Structures

class  Contact
struct  TempVars

Public Types

enum  { N = Coord1::static_size }
typedef
core::componentmodel::behavior::MixedInteractionForceField
< DataTypes1, DataTypes2 > 
Inherit
typedef DataTypes1::VecCoord VecCoord1
typedef DataTypes1::VecDeriv VecDeriv1
typedef DataTypes1::Coord Coord1
typedef DataTypes1::Deriv Deriv1
typedef Coord1::value_type Real1
typedef DataTypes2::VecCoord VecCoord2
typedef DataTypes2::VecDeriv VecDeriv2
typedef DataTypes2::Coord Coord2
typedef DataTypes2::Deriv Deriv2
typedef Coord2::value_type Real2
typedef defaulttype::Mat< N, N,
Real1 > 
Mat

Public Member Functions

 InteractionEllipsoidForceField ()
void setStiffness (Real1 stiff)
void setDamping (Real1 damp)
virtual void addForce (VecDeriv1 &f1, VecDeriv2 &f2, const VecCoord1 &p1, const VecCoord2 &p2, const VecDeriv1 &v1, const VecDeriv2 &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 addForce2 (VecDeriv1 &f1, VecDeriv2 &f2, const VecCoord1 &p1, const VecCoord2 &p2, const VecDeriv1 &v1, const VecDeriv2 &v2)
virtual void addDForce (VecDeriv1 &df1, VecDeriv2 &df2, const VecDeriv1 &dx1, const VecDeriv2 &dx2)
 Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce().
virtual double getPotentialEnergy (const VecCoord1 &x1, const VecCoord2 &x2)
 Get the potential energy associated to this ForceField.
void reinit ()
 Update method called when variables used in precomputation are modified.
void draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

Data< Coord1 > center
Data< Coord1 > vradius
Data< Real1 > stiffness
Data< Real1 > damping
Data< defaulttype::Vec3f > color
Data< bool > bDraw
Data< int > object2_dof_index

Protected Member Functions

bool calcF (const Coord1 &p1, const Deriv1 &v1, Deriv1 &f1, Mat &dfdx)
void initCalcF ()

Protected Attributes

Data< sofa::helper::vector
< Contact > > 
contacts
InteractionEllipsoidForceFieldInternalData
< DataTypes1, DataTypes2 > 
data
struct
sofa::component::interactionforcefield::InteractionEllipsoidForceField::TempVars 
vars
bool _update_pos_relative
VecCoord1 X1
VecCoord2 X2
Quat _orientation

Detailed Description

template<class DataTypes1, class DataTypes2>
class sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >

Definition at line 53 of file InteractionEllipsoidForceField.h.


Member Typedef Documentation

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes1::Coord sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Coord1

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes2::Coord sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Coord2

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes1::Deriv sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Deriv1

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes2::Deriv sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Deriv2

Definition at line 56 of file InteractionEllipsoidForceField.h.

Definition at line 69 of file InteractionEllipsoidForceField.h.

template<class DataTypes1 , class DataTypes2 >
typedef Coord1::value_type sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Real1

Definition at line 61 of file InteractionEllipsoidForceField.h.

template<class DataTypes1 , class DataTypes2 >
typedef Coord2::value_type sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Real2

Definition at line 66 of file InteractionEllipsoidForceField.h.

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes1::VecCoord sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::VecCoord1

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes2::VecCoord sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::VecCoord2

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes1::VecDeriv sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::VecDeriv1

template<class DataTypes1 , class DataTypes2 >
typedef DataTypes2::VecDeriv sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::VecDeriv2


Member Enumeration Documentation

template<class DataTypes1 , class DataTypes2 >
anonymous enum

Enumerator:
N 

Definition at line 68 of file InteractionEllipsoidForceField.h.


Constructor & Destructor Documentation


Member Function Documentation

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::addDForce ( VecDeriv1 &  df1,
VecDeriv2 &  df2,
const VecDeriv1 &  dx1,
const VecDeriv2 &  dx2 
) [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 MixedInteractionForceField::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::MixedInteractionForceField< DataTypes1, DataTypes2 >.

Definition at line 257 of file InteractionEllipsoidForceField.inl.

References sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::_orientation, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::index, sofa::helper::Quater< Real >::inverseRotate(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::m, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::object2_dof_index, and sofa::helper::Quater< Real >::rotate().

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::addForce ( VecDeriv1 &  f1,
VecDeriv2 &  f2,
const VecCoord1 &  x1,
const VecCoord2 &  x2,
const VecDeriv1 &  v1,
const VecDeriv2 &  v2 
) [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::MixedInteractionForceField< DataTypes1, DataTypes2 >.

Definition at line 120 of file InteractionEllipsoidForceField.inl.

References sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::_orientation, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::_update_pos_relative, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::bras_levier, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::calcF(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::center, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::TempVars::center, sofa::defaulttype::Vec< N, real >::clear(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::index, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::initCalcF(), sofa::helper::Quater< Real >::inverseRotate(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::m, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::object2_dof_index, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::Contact::pos, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::TempVars::pos6D, sofa::helper::Quater< Real >::rotate(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::vars, sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::X1, and sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::X2.

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::addForce2 ( VecDeriv1 &  f1,
VecDeriv2 &  f2,
const VecCoord1 &  p1,
const VecCoord2 &  p2,
const VecDeriv1 &  v1,
const VecDeriv2 &  v2 
) [inline, virtual]

template<class DataTypes1 , class DataTypes2 >
bool sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::calcF ( const Coord1 &  p1,
const Deriv1 &  v1,
Deriv1 &  f1,
Mat &  dfdx 
) [inline, protected]

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::draw (  )  [inline, virtual]

template<class DataTypes1 , class DataTypes2 >
double sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::getPotentialEnergy ( const VecCoord1 &  x1,
const VecCoord2 &  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::MixedInteractionForceField< DataTypes1, DataTypes2 >.

Definition at line 282 of file InteractionEllipsoidForceField.inl.

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::initCalcF (  )  [inline, protected]

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::reinit (  )  [inline, virtual]

Update method called when variables used in precomputation are modified.

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

Definition at line 146 of file InteractionEllipsoidForceField.h.

References sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::_update_pos_relative.

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::setDamping ( Real1  damp  )  [inline]

template<class DataTypes1 , class DataTypes2 >
void sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::setStiffness ( Real1  stiff  )  [inline]


Field Documentation

Definition at line 97 of file InteractionEllipsoidForceField.h.

template<class DataTypes1 , class DataTypes2 >
VecCoord1 sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::X1 [protected]

template<class DataTypes1 , class DataTypes2 >
VecCoord2 sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::X2 [protected]


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

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