#include <JointSpringForceField.h>


Data Structures | |
| class | Spring |
Public Types | |
| enum | { N = Coord::static_size } |
| typedef core::componentmodel::behavior::PairInteractionForceField < DataTypes > | Inherit |
| 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 |
| typedef defaulttype::Mat< N, N, Real > | Mat |
| typedef Vec< N, Real > | Vector |
Public Member Functions | |
| JointSpringForceField (MechanicalState *object1, MechanicalState *object2) | |
| JointSpringForceField () | |
| core::componentmodel::behavior::MechanicalState < DataTypes > * | getObject1 () |
| core::componentmodel::behavior::MechanicalState < DataTypes > * | getObject2 () |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| 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) |
| 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. | |
| sofa::helper::vector< Spring > * | getSprings () |
| void | draw () |
| Render internal data of this object, for debugging purposes. | |
| void | clear (int reserve=0) |
| void | addSpring (const Spring &s) |
| void | addSpring (int m1, int m2, Real softKst, Real hardKst, Real softKsr, Real hardKsr, Real blocKsr, Real axmin, Real axmax, Real aymin, Real aymax, Real azmin, Real azmax, Real kd) |
Protected Member Functions | |
| void | addSpringForce (double &potentialEnergy, VecDeriv &f1, const VecCoord &p1, const VecDeriv &v1, VecDeriv &f2, const VecCoord &p2, const VecDeriv &v2, int i, Spring &spring) |
| Accumulate the spring force and compute and store its stiffness. | |
| void | addSpringDForce (VecDeriv &df1, const VecDeriv &dx1, VecDeriv &df2, const VecDeriv &dx2, int i, Spring &spring) |
| Apply the stiffness, i.e. accumulate df given dx. | |
Protected Attributes | |
| double | m_potentialEnergy |
| Data< sofa::helper::vector < Spring > > | springs |
| the list of the springs | |
| VecCoord | springRef |
| the list of the local referentials of the springs | |
| Data< bool > | showLawfulTorsion |
| bool to allow the display of the 2 parts of springs torsions | |
| Data< bool > | showExtraTorsion |
| JointSpringForceFieldInternalData < DataTypes > | data |
Definition at line 57 of file JointSpringForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::JointSpringForceField< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 63 of file JointSpringForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::JointSpringForceField< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 64 of file JointSpringForceField.h.
| typedef core::componentmodel::behavior::PairInteractionForceField<DataTypes> sofa::component::forcefield::JointSpringForceField< DataTypes >::Inherit |
Definition at line 60 of file JointSpringForceField.h.
| typedef defaulttype::Mat<N,N,Real> sofa::component::forcefield::JointSpringForceField< DataTypes >::Mat |
Definition at line 68 of file JointSpringForceField.h.
| typedef core::componentmodel::behavior::MechanicalState<DataTypes> sofa::component::forcefield::JointSpringForceField< DataTypes >::MechanicalState |
Definition at line 66 of file JointSpringForceField.h.
| typedef Coord::value_type sofa::component::forcefield::JointSpringForceField< DataTypes >::Real |
Definition at line 65 of file JointSpringForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::JointSpringForceField< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 61 of file JointSpringForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::JointSpringForceField< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 62 of file JointSpringForceField.h.
| typedef Vec<N,Real> sofa::component::forcefield::JointSpringForceField< DataTypes >::Vector |
Definition at line 69 of file JointSpringForceField.h.
| anonymous enum |
| sofa::component::forcefield::JointSpringForceField< DataTypes >::JointSpringForceField | ( | MechanicalState * | object1, | |
| MechanicalState * | object2 | |||
| ) | [inline] |
Definition at line 51 of file JointSpringForceField.inl.
| sofa::component::forcefield::JointSpringForceField< DataTypes >::JointSpringForceField | ( | ) | [inline] |
Definition at line 60 of file JointSpringForceField.inl.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::addDForce | ( | VecDeriv & | df1, | |
| VecDeriv & | df2, | |||
| const VecDeriv & | dx1, | |||
| const VecDeriv & | 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 PairInteractionForceField::addDForce() method.
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 194 of file JointSpringForceField.inl.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringDForce(), and sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< 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 177 of file JointSpringForceField.inl.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringForce(), sofa::component::forcefield::JointSpringForceField< DataTypes >::m_potentialEnergy, sofa::component::forcefield::JointSpringForceField< DataTypes >::springRef, and sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpring | ( | int | m1, | |
| int | m2, | |||
| Real | softKst, | |||
| Real | hardKst, | |||
| Real | softKsr, | |||
| Real | hardKsr, | |||
| Real | blocKsr, | |||
| Real | axmin, | |||
| Real | axmax, | |||
| Real | aymin, | |||
| Real | aymax, | |||
| Real | azmin, | |||
| Real | azmax, | |||
| Real | kd | |||
| ) | [inline] |
Definition at line 320 of file JointSpringForceField.h.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::initRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::initTrans, and sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpring | ( | const Spring & | s | ) | [inline] |
Definition at line 313 of file JointSpringForceField.h.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringDForce | ( | VecDeriv & | df1, | |
| const VecDeriv & | dx1, | |||
| VecDeriv & | df2, | |||
| const VecDeriv & | dx2, | |||
| int | i, | |||
| Spring & | spring | |||
| ) | [inline, protected] |
Apply the stiffness, i.e. accumulate df given dx.
Definition at line 149 of file JointSpringForceField.inl.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::bloquage, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::freeMovements, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::hardStiffnessRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::hardStiffnessTrans, sofa::defaulttype::invertMatrix(), sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::m1, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::m2, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::softStiffnessRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::softStiffnessTrans, and sofa::component::forcefield::JointSpringForceField< DataTypes >::springRef.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::addDForce().
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringForce | ( | double & | potentialEnergy, | |
| VecDeriv & | f1, | |||
| const VecCoord & | p1, | |||
| const VecDeriv & | v1, | |||
| VecDeriv & | f2, | |||
| const VecCoord & | p2, | |||
| const VecDeriv & | v2, | |||
| int | i, | |||
| Spring & | spring | |||
| ) | [inline, protected] |
Accumulate the spring force and compute and store its stiffness.
Definition at line 75 of file JointSpringForceField.inl.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::blocStiffnessRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::bloquage, sofa::helper::Quater< Real >::createFromRotationVector(), sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::extraTorsion, force, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::freeMovements, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::hardStiffnessRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::hardStiffnessTrans, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::initRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::initTrans, sofa::helper::Quater< Real >::inverse(), sofa::defaulttype::invertMatrix(), sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::kd, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::lawfulTorsion, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::limitAngles, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::m1, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::m2, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::softStiffnessRot, sofa::component::forcefield::JointSpringForceField< DataTypes >::Spring::softStiffnessTrans, sofa::component::forcefield::JointSpringForceField< DataTypes >::springRef, sofa::helper::Quater< Real >::toEulerVector(), and sofa::helper::Quater< Real >::toMatrix().
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::addForce().
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::clear | ( | int | reserve = 0 |
) | [inline] |
Definition at line 305 of file JointSpringForceField.h.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 208 of file JointSpringForceField.inl.
References sofa::helper::gl::Axis::draw(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::helper::gl::glVertexT(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate1, sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate2, sofa::component::forcefield::JointSpringForceField< DataTypes >::showExtraTorsion, sofa::component::forcefield::JointSpringForceField< DataTypes >::showLawfulTorsion, and sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| core::componentmodel::behavior::MechanicalState<DataTypes>* sofa::component::forcefield::JointSpringForceField< DataTypes >::getObject1 | ( | ) | [inline] |
Definition at line 288 of file JointSpringForceField.h.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate1.
| core::componentmodel::behavior::MechanicalState<DataTypes>* sofa::component::forcefield::JointSpringForceField< DataTypes >::getObject2 | ( | ) | [inline] |
Definition at line 289 of file JointSpringForceField.h.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate2.
| virtual double sofa::component::forcefield::JointSpringForceField< 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 297 of file JointSpringForceField.h.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::m_potentialEnergy.
| sofa::helper::vector<Spring>* sofa::component::forcefield::JointSpringForceField< DataTypes >::getSprings | ( | ) | [inline] |
Definition at line 299 of file JointSpringForceField.h.
References sofa::component::forcefield::JointSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::JointSpringForceField< DataTypes >::init | ( | void | ) | [inline, virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 69 of file JointSpringForceField.inl.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::init().
JointSpringForceFieldInternalData<DataTypes> sofa::component::forcefield::JointSpringForceField< DataTypes >::data [protected] |
Definition at line 274 of file JointSpringForceField.h.
double sofa::component::forcefield::JointSpringForceField< DataTypes >::m_potentialEnergy [protected] |
Definition at line 265 of file JointSpringForceField.h.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::addForce(), and sofa::component::forcefield::JointSpringForceField< DataTypes >::getPotentialEnergy().
Data<bool> sofa::component::forcefield::JointSpringForceField< DataTypes >::showExtraTorsion [protected] |
Definition at line 272 of file JointSpringForceField.h.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::draw().
Data<bool> sofa::component::forcefield::JointSpringForceField< DataTypes >::showLawfulTorsion [protected] |
bool to allow the display of the 2 parts of springs torsions
Definition at line 271 of file JointSpringForceField.h.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::draw().
VecCoord sofa::component::forcefield::JointSpringForceField< DataTypes >::springRef [protected] |
the list of the local referentials of the springs
Definition at line 269 of file JointSpringForceField.h.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::addForce(), sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringDForce(), and sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpringForce().
Data<sofa::helper::vector<Spring> > sofa::component::forcefield::JointSpringForceField< DataTypes >::springs [protected] |
the list of the springs
Definition at line 267 of file JointSpringForceField.h.
Referenced by sofa::component::forcefield::JointSpringForceField< DataTypes >::addDForce(), sofa::component::forcefield::JointSpringForceField< DataTypes >::addForce(), sofa::component::forcefield::JointSpringForceField< DataTypes >::addSpring(), sofa::component::forcefield::JointSpringForceField< DataTypes >::clear(), sofa::component::forcefield::JointSpringForceField< DataTypes >::draw(), and sofa::component::forcefield::JointSpringForceField< DataTypes >::getSprings().
1.5.7.1