#include <FrameSpringForceField.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 > | VecN |
Public Member Functions | |
| FrameSpringForceField (MechanicalState *object1, MechanicalState *object2) | |
| FrameSpringForceField () | |
| 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 softKsr, 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 |
| FrameSpringForceFieldInternalData < DataTypes > | data |
Definition at line 56 of file FrameSpringForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::FrameSpringForceField< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 62 of file FrameSpringForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::FrameSpringForceField< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 63 of file FrameSpringForceField.h.
| typedef core::componentmodel::behavior::PairInteractionForceField<DataTypes> sofa::component::forcefield::FrameSpringForceField< DataTypes >::Inherit |
Definition at line 59 of file FrameSpringForceField.h.
| typedef defaulttype::Mat<N,N,Real> sofa::component::forcefield::FrameSpringForceField< DataTypes >::Mat |
Definition at line 67 of file FrameSpringForceField.h.
| typedef core::componentmodel::behavior::MechanicalState<DataTypes> sofa::component::forcefield::FrameSpringForceField< DataTypes >::MechanicalState |
Definition at line 65 of file FrameSpringForceField.h.
| typedef Coord::value_type sofa::component::forcefield::FrameSpringForceField< DataTypes >::Real |
Definition at line 64 of file FrameSpringForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::FrameSpringForceField< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 60 of file FrameSpringForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::FrameSpringForceField< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >.
Definition at line 61 of file FrameSpringForceField.h.
| typedef Vec<N,Real> sofa::component::forcefield::FrameSpringForceField< DataTypes >::VecN |
Definition at line 68 of file FrameSpringForceField.h.
| anonymous enum |
| sofa::component::forcefield::FrameSpringForceField< DataTypes >::FrameSpringForceField | ( | MechanicalState * | object1, | |
| MechanicalState * | object2 | |||
| ) | [inline] |
Definition at line 52 of file FrameSpringForceField.inl.
| sofa::component::forcefield::FrameSpringForceField< DataTypes >::FrameSpringForceField | ( | ) | [inline] |
Definition at line 61 of file FrameSpringForceField.inl.
| void sofa::component::forcefield::FrameSpringForceField< 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 154 of file FrameSpringForceField.inl.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpringDForce(), and sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< 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 137 of file FrameSpringForceField.inl.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpringForce(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::m_potentialEnergy, sofa::component::forcefield::FrameSpringForceField< DataTypes >::springRef, and sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpring | ( | int | m1, | |
| int | m2, | |||
| Real | softKst, | |||
| Real | softKsr, | |||
| Real | kd | |||
| ) | [inline] |
Definition at line 230 of file FrameSpringForceField.inl.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpring | ( | const Spring & | s | ) | [inline] |
Definition at line 222 of file FrameSpringForceField.inl.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< 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 112 of file FrameSpringForceField.inl.
References sofa::defaulttype::invertMatrix(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::m1, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::m2, sofa::component::forcefield::FrameSpringForceField< DataTypes >::springRef, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::stiffnessRot, and sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::stiffnessTrans.
Referenced by sofa::component::forcefield::FrameSpringForceField< DataTypes >::addDForce().
| void sofa::component::forcefield::FrameSpringForceField< 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 76 of file FrameSpringForceField.inl.
References cross(), sofa::defaulttype::invertMatrix(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::kd, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::m1, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::m2, sofa::component::forcefield::FrameSpringForceField< DataTypes >::springRef, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::stiffnessRot, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::stiffnessTrans, sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::vec1, and sofa::component::forcefield::FrameSpringForceField< DataTypes >::Spring::vec2.
Referenced by sofa::component::forcefield::FrameSpringForceField< DataTypes >::addForce().
| void sofa::component::forcefield::FrameSpringForceField< DataTypes >::clear | ( | int | reserve = 0 |
) | [inline] |
Definition at line 213 of file FrameSpringForceField.inl.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 169 of file FrameSpringForceField.inl.
References sofa::core::objectmodel::BaseObject::getContext(), 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, norm(), and sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| core::componentmodel::behavior::MechanicalState<DataTypes>* sofa::component::forcefield::FrameSpringForceField< DataTypes >::getObject1 | ( | ) | [inline] |
Definition at line 184 of file FrameSpringForceField.h.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate1.
| core::componentmodel::behavior::MechanicalState<DataTypes>* sofa::component::forcefield::FrameSpringForceField< DataTypes >::getObject2 | ( | ) | [inline] |
Definition at line 185 of file FrameSpringForceField.h.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::mstate2.
| virtual double sofa::component::forcefield::FrameSpringForceField< 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 193 of file FrameSpringForceField.h.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::m_potentialEnergy.
| sofa::helper::vector<Spring>* sofa::component::forcefield::FrameSpringForceField< DataTypes >::getSprings | ( | ) | [inline] |
Definition at line 195 of file FrameSpringForceField.h.
References sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs.
| void sofa::component::forcefield::FrameSpringForceField< DataTypes >::init | ( | void | ) | [inline, virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 70 of file FrameSpringForceField.inl.
References sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::init().
FrameSpringForceFieldInternalData<DataTypes> sofa::component::forcefield::FrameSpringForceField< DataTypes >::data [protected] |
Definition at line 170 of file FrameSpringForceField.h.
double sofa::component::forcefield::FrameSpringForceField< DataTypes >::m_potentialEnergy [protected] |
Definition at line 161 of file FrameSpringForceField.h.
Referenced by sofa::component::forcefield::FrameSpringForceField< DataTypes >::addForce(), and sofa::component::forcefield::FrameSpringForceField< DataTypes >::getPotentialEnergy().
Data<bool> sofa::component::forcefield::FrameSpringForceField< DataTypes >::showExtraTorsion [protected] |
Definition at line 168 of file FrameSpringForceField.h.
Data<bool> sofa::component::forcefield::FrameSpringForceField< DataTypes >::showLawfulTorsion [protected] |
bool to allow the display of the 2 parts of springs torsions
Definition at line 167 of file FrameSpringForceField.h.
VecCoord sofa::component::forcefield::FrameSpringForceField< DataTypes >::springRef [protected] |
the list of the local referentials of the springs
Definition at line 165 of file FrameSpringForceField.h.
Referenced by sofa::component::forcefield::FrameSpringForceField< DataTypes >::addForce(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpringDForce(), and sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpringForce().
Data<sofa::helper::vector<Spring> > sofa::component::forcefield::FrameSpringForceField< DataTypes >::springs [protected] |
the list of the springs
Definition at line 163 of file FrameSpringForceField.h.
Referenced by sofa::component::forcefield::FrameSpringForceField< DataTypes >::addDForce(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::addForce(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::addSpring(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::clear(), sofa::component::forcefield::FrameSpringForceField< DataTypes >::draw(), and sofa::component::forcefield::FrameSpringForceField< DataTypes >::getSprings().
1.5.7.1