#include <PenalityContactForceField.h>


Data Structures | |
| class | Contact |
Public Types | |
| 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, int index1, int index2, const Deriv &norm, Real dist, Real ks, Real mu_s=0.0f, Real mu_v=0.0f, int oldIndex=0) |
| 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 | grabPoint (const core::componentmodel::behavior::MechanicalState< defaulttype::Vec3Types > *tool, const helper::vector< unsigned int > &index, helper::vector< std::pair< core::objectmodel::BaseObject *, defaulttype::Vec3f > > &result, helper::vector< unsigned int > &triangle, helper::vector< unsigned int > &index_point) |
| void | draw () |
| Render internal data of this object, for debugging purposes. | |
Protected Attributes | |
| Data< sofa::helper::vector < Contact > > | contacts |
| sofa::helper::vector< Contact > | prevContacts |
Definition at line 45 of file PenalityContactForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::PenalityContactForceField< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 53 of file PenalityContactForceField.h.
| typedef DataTypes sofa::component::forcefield::PenalityContactForceField< DataTypes >::DataTypes1 |
Definition at line 49 of file PenalityContactForceField.h.
| typedef DataTypes sofa::component::forcefield::PenalityContactForceField< DataTypes >::DataTypes2 |
Definition at line 50 of file PenalityContactForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::PenalityContactForceField< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 54 of file PenalityContactForceField.h.
| typedef core::componentmodel::behavior::PairInteractionForceField<DataTypes> sofa::component::forcefield::PenalityContactForceField< DataTypes >::Inherit |
Definition at line 48 of file PenalityContactForceField.h.
| typedef core::componentmodel::behavior::MechanicalState<DataTypes> sofa::component::forcefield::PenalityContactForceField< DataTypes >::MechanicalState |
Definition at line 56 of file PenalityContactForceField.h.
| typedef Coord::value_type sofa::component::forcefield::PenalityContactForceField< DataTypes >::Real |
Definition at line 55 of file PenalityContactForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::PenalityContactForceField< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 51 of file PenalityContactForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::PenalityContactForceField< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 52 of file PenalityContactForceField.h.
| sofa::component::forcefield::PenalityContactForceField< DataTypes >::PenalityContactForceField | ( | MechanicalState * | object1, | |
| MechanicalState * | object2 | |||
| ) | [inline] |
Definition at line 98 of file PenalityContactForceField.h.
| sofa::component::forcefield::PenalityContactForceField< DataTypes >::PenalityContactForceField | ( | ) | [inline] |
Definition at line 103 of file PenalityContactForceField.h.
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addContact | ( | int | m1, | |
| int | m2, | |||
| int | index1, | |||
| int | index2, | |||
| const Deriv & | norm, | |||
| Real | dist, | |||
| Real | ks, | |||
| Real | mu_s = 0.0f, |
|||
| Real | mu_v = 0.0f, |
|||
| int | oldIndex = 0 | |||
| ) | [inline] |
Definition at line 57 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::age, sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::dist, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::index1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::index2, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::ks, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m2, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::mu_s, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::mu_v, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::norm, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::pen, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::prevContacts.
Referenced by sofa::component::collision::BarycentricPenalityContact< TCollisionModel1, TCollisionModel2, ResponseDataTypes >::setDetectionOutputs().
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addDForce | ( | VecDeriv & | df1, | |
| VecDeriv & | df2, | |||
| const VecDeriv & | dx1, | |||
| const VecDeriv & | 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 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< DataTypes >.
Definition at line 105 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::ks, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m2, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::norm, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::pen.
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::addForce | ( | VecDeriv & | f1, | |
| VecDeriv & | f2, | |||
| const VecCoord & | x1, | |||
| const VecCoord & | x2, | |||
| const VecDeriv & | v1, | |||
| const VecDeriv & | 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::PairInteractionForceField< DataTypes >.
Definition at line 84 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::dist, force, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::ks, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m2, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::norm, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::pen.
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::clear | ( | int | reserve = 0 |
) | [inline] |
Definition at line 47 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::prevContacts.
Referenced by sofa::component::collision::BarycentricPenalityContact< TCollisionModel1, TCollisionModel2, ResponseDataTypes >::setDetectionOutputs().
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 133 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::age, sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::dist, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::helper::gl::glVertexT(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m1, sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::m2, sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate1, sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate2, and sofa::component::forcefield::PenalityContactForceField< DataTypes >::Contact::norm.
| double sofa::component::forcefield::PenalityContactForceField< DataTypes >::getPotentialEnergy | ( | const VecCoord & | x1, | |
| const VecCoord & | 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::PairInteractionForceField< DataTypes >.
Definition at line 126 of file PenalityContactForceField.inl.
| void sofa::component::forcefield::PenalityContactForceField< DataTypes >::grabPoint | ( | const core::componentmodel::behavior::MechanicalState< defaulttype::Vec3Types > * | tool, | |
| const helper::vector< unsigned int > & | index, | |||
| helper::vector< std::pair< core::objectmodel::BaseObject *, defaulttype::Vec3f > > & | result, | |||
| helper::vector< unsigned int > & | triangle, | |||
| helper::vector< unsigned int > & | index_point | |||
| ) | [inline] |
Definition at line 180 of file PenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate1, and sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate2.
Data<sofa::helper::vector<Contact> > sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts [protected] |
Definition at line 91 of file PenalityContactForceField.h.
Referenced by sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addContact(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::addContact(), sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addDForce(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::addDForce(), sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addForce(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::addForce(), sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::clear(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::clear(), sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::draw(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::draw(), sofa::component::forcefield::PenalityContactForceField< DataTypes >::grabPoint(), and sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::setContacts().
sofa::helper::vector<Contact> sofa::component::forcefield::PenalityContactForceField< DataTypes >::prevContacts [protected] |
Definition at line 94 of file PenalityContactForceField.h.
Referenced by sofa::component::forcefield::PenalityContactForceField< DataTypes >::addContact(), and sofa::component::forcefield::PenalityContactForceField< DataTypes >::clear().
1.5.7.1