#include <MixedInteractionForceField.h>


Public Types | |
| typedef TDataTypes1 | DataTypes1 |
| typedef DataTypes1::VecCoord | VecCoord1 |
| typedef DataTypes1::VecDeriv | VecDeriv1 |
| typedef DataTypes1::Coord | Coord1 |
| typedef DataTypes1::Deriv | Deriv1 |
| typedef TDataTypes2 | DataTypes2 |
| typedef DataTypes2::VecCoord | VecCoord2 |
| typedef DataTypes2::VecDeriv | VecDeriv2 |
| typedef DataTypes2::Coord | Coord2 |
| typedef DataTypes2::Deriv | Deriv2 |
Public Member Functions | |
| MixedInteractionForceField (MechanicalState< DataTypes1 > *mm1=NULL, MechanicalState< DataTypes2 > *mm2=NULL) | |
| virtual | ~MixedInteractionForceField () |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| MechanicalState< DataTypes1 > * | getMState1 () |
| Retrieve the associated MechanicalState. | |
| BaseMechanicalState * | getMechModel1 () |
| Get the first MechanicalState. | |
| MechanicalState< DataTypes2 > * | getMState2 () |
| Retrieve the associated MechanicalState. | |
| BaseMechanicalState * | getMechModel2 () |
| Get the first MechanicalState. | |
| virtual std::string | getTemplateName () const |
| Get the template type names (if any) used to instantiate this object. | |
Vector operations | |
| virtual void | addForce () |
| 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 (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 void | addDForceV (double kFactor, double bFactor) |
| Same as addDForce(), except the velocity vector should be used instead of dx. | |
| virtual double | getPotentialEnergy () |
| Get the potential energy associated to this ForceField. | |
| virtual void | addForce (VecDeriv1 &f1, VecDeriv2 &f2, const VecCoord1 &x1, const VecCoord2 &x2, const VecDeriv1 &v1, const VecDeriv2 &v2)=0 |
| 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 (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 void | addDForce (VecDeriv1 &df1, VecDeriv2 &df2, const VecDeriv1 &dx1, const VecDeriv2 &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 VecCoord1 &x1, const VecCoord2 &x2)=0 |
| Get the potential energy associated to this ForceField. | |
Static Public Member Functions | |
| template<class T > | |
| static bool | canCreate (T *&obj, objectmodel::BaseContext *context, objectmodel::BaseObjectDescription *arg) |
| Pre-construction check method called by ObjectFactory. | |
| template<class T > | |
| static void | create (T *&obj, core::objectmodel::BaseContext *context, core::objectmodel::BaseObjectDescription *arg) |
| Construction method called by ObjectFactory. | |
| static std::string | templateName (const MixedInteractionForceField< DataTypes1, DataTypes2 > *=NULL) |
Protected Attributes | |
| MechanicalState< DataTypes1 > * | mstate1 |
| MechanicalState< DataTypes2 > * | mstate2 |
This class define the abstract API common to interaction force fields between a pair of bodies using a given type of DOFs.
Definition at line 53 of file MixedInteractionForceField.h.
| typedef DataTypes1::Coord sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::Coord1 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 59 of file MixedInteractionForceField.h.
| typedef DataTypes2::Coord sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::Coord2 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 64 of file MixedInteractionForceField.h.
| typedef TDataTypes1 sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::DataTypes1 |
Definition at line 56 of file MixedInteractionForceField.h.
| typedef TDataTypes2 sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::DataTypes2 |
Definition at line 61 of file MixedInteractionForceField.h.
| typedef DataTypes1::Deriv sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::Deriv1 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 60 of file MixedInteractionForceField.h.
| typedef DataTypes2::Deriv sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::Deriv2 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 65 of file MixedInteractionForceField.h.
| typedef DataTypes1::VecCoord sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::VecCoord1 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 57 of file MixedInteractionForceField.h.
| typedef DataTypes2::VecCoord sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::VecCoord2 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 62 of file MixedInteractionForceField.h.
| typedef DataTypes1::VecDeriv sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::VecDeriv1 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 58 of file MixedInteractionForceField.h.
| typedef DataTypes2::VecDeriv sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::VecDeriv2 |
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 63 of file MixedInteractionForceField.h.
| sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::MixedInteractionForceField | ( | MechanicalState< DataTypes1 > * | mm1 = NULL, |
|
| MechanicalState< DataTypes2 > * | mm2 = NULL | |||
| ) | [inline] |
Definition at line 46 of file MixedInteractionForceField.inl.
| sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::~MixedInteractionForceField | ( | ) | [inline, virtual] |
Definition at line 52 of file MixedInteractionForceField.inl.
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::addDForce | ( | VecDeriv1 & | df1, | |
| VecDeriv2 & | df2, | |||
| const VecDeriv1 & | dx1, | |||
| const VecDeriv2 & | dx2, | |||
| 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 MixedInteractionForceField::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.
: Add a better way to get the current VecId of dx
: Add a better way to get the current VecId of dx
Definition at line 96 of file MixedInteractionForceField.inl.
References sofa::core::componentmodel::behavior::BaseMechanicalState::VecId::index.
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< 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.
Reimplemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
Definition at line 90 of file MixedInteractionForceField.inl.
References sofa::core::objectmodel::Base::getClassName().
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::addDForce | ( | 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 retrieves the force and dx vector from the two MechanicalState and call the internal addDForce(VecDeriv1&,VecDeriv2&,const VecDeriv1&,const VecDeriv2&,double,double) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 72 of file MixedInteractionForceField.inl.
References sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getDx(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getF(), sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate1, and sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate2.
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::addDForceV | ( | double | kFactor, | |
| double | bFactor | |||
| ) | [inline, virtual] |
Same as addDForce(), except the velocity vector should be used instead of dx.
If the ForceField can be represented as a matrix, this method computes $ df += kFactor K v + bFactor B v $
This method retrieves the force and velocity vector from the two MechanicalState and call the internal addDForce(VecDeriv1&,VecDeriv2&,const VecDeriv1&,const VecDeriv2&,double,double) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 81 of file MixedInteractionForceField.inl.
| virtual void sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::addForce | ( | VecDeriv1 & | f1, | |
| VecDeriv2 & | f2, | |||
| const VecCoord1 & | x1, | |||
| const VecCoord2 & | x2, | |||
| const VecDeriv1 & | v1, | |||
| const VecDeriv2 & | v2 | |||
| ) | [pure 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.
Implemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::addForce | ( | ) | [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 retrieves the force, x and v vector from the two MechanicalState and call the internal addForce(VecDeriv&,VecDeriv&,const VecCoord&,const VecCoord&,const VecDeriv&,const VecDeriv&) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 63 of file MixedInteractionForceField.inl.
| static bool sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::canCreate | ( | T *& | obj, | |
| objectmodel::BaseContext * | context, | |||
| objectmodel::BaseObjectDescription * | arg | |||
| ) | [inline, static] |
Pre-construction check method called by ObjectFactory.
Check that DataTypes matches the MechanicalState.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 191 of file MixedInteractionForceField.h.
Referenced by sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::canCreate().
| static void sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::create | ( | T *& | obj, | |
| core::objectmodel::BaseContext * | context, | |||
| core::objectmodel::BaseObjectDescription * | arg | |||
| ) | [inline, static] |
Construction method called by ObjectFactory.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 205 of file MixedInteractionForceField.h.
Referenced by sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::create().
| BaseMechanicalState* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getMechModel1 | ( | ) | [inline, virtual] |
Get the first MechanicalState.
Implements sofa::core::componentmodel::behavior::InteractionForceField.
Definition at line 75 of file MixedInteractionForceField.h.
| BaseMechanicalState* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getMechModel2 | ( | ) | [inline, virtual] |
Get the first MechanicalState.
Implements sofa::core::componentmodel::behavior::InteractionForceField.
Definition at line 78 of file MixedInteractionForceField.h.
| MechanicalState<DataTypes1>* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getMState1 | ( | ) | [inline] |
Retrieve the associated MechanicalState.
Definition at line 74 of file MixedInteractionForceField.h.
| MechanicalState<DataTypes2>* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getMState2 | ( | ) | [inline] |
Retrieve the associated MechanicalState.
Definition at line 77 of file MixedInteractionForceField.h.
| virtual double sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getPotentialEnergy | ( | const VecCoord1 & | x1, | |
| const VecCoord2 & | x2 | |||
| ) | [pure 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.
Implemented in sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >.
| double sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getPotentialEnergy | ( | ) | [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 retrieves the x vector from the MechanicalState and call the internal getPotentialEnergy(const VecCoord&,const VecCoord&) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 130 of file MixedInteractionForceField.inl.
References sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate1, and sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate2.
| virtual std::string sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getTemplateName | ( | ) | const [inline, virtual] |
Get the template type names (if any) used to instantiate this object.
Reimplemented from sofa::core::objectmodel::Base.
Definition at line 215 of file MixedInteractionForceField.h.
| void sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::init | ( | ) | [inline, virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 57 of file MixedInteractionForceField.inl.
| static std::string sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::templateName | ( | const MixedInteractionForceField< DataTypes1, DataTypes2 > * | = NULL |
) | [inline, static] |
Definition at line 220 of file MixedInteractionForceField.h.
Referenced by sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getTemplateName().
MechanicalState<DataTypes1>* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate1 [protected] |
Definition at line 226 of file MixedInteractionForceField.h.
Referenced by sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::addDForce(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getMechModel1(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getMState1(), and sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getPotentialEnergy().
MechanicalState<DataTypes2>* sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::mstate2 [protected] |
Definition at line 227 of file MixedInteractionForceField.h.
Referenced by sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::addDForce(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getMechModel2(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::getMState2(), and sofa::core::componentmodel::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >::getPotentialEnergy().
1.5.7.1