#include <PlaneForceField.h>


Public Types | |
| typedef core::componentmodel::behavior::ForceField < DataTypes > | Inherit |
| typedef DataTypes::VecCoord | VecCoord |
| typedef DataTypes::VecDeriv | VecDeriv |
| typedef DataTypes::Coord | Coord |
| typedef DataTypes::Deriv | Deriv |
| typedef Coord::value_type | Real |
Public Member Functions | |
| PlaneForceField () | |
| void | setPlane (const Deriv &normal, Real d) |
| void | setMState (core::componentmodel::behavior::MechanicalState< DataTypes > *mstate) |
| void | setStiffness (Real stiff) |
| void | setDamping (Real damp) |
| void | rotate (Deriv axe, Real angle) |
| virtual void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v) |
| 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 &df, const VecDeriv &dx, 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 &x) |
| Get the potential energy associated to this ForceField. | |
| virtual void | updateStiffness (const VecCoord &x) |
| void | draw () |
| Render internal data of this object, for debugging purposes. | |
| void | drawPlane (float size=1000.0f) |
| bool | addBBox (double *minBBox, double *maxBBox) |
| template<> | |
| void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v) |
| Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField. | |
| template<> | |
| void | addDForce (VecDeriv &df, const VecDeriv &dx, double kFactor, double bFactor) |
| Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce(). | |
| template<> | |
| void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v) |
| Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField. | |
| template<> | |
| void | addDForce (VecDeriv &df, const VecDeriv &dx, double kFactor, double bFactor) |
| Compute the force derivative given a small displacement from the position and velocity used in the previous call to addForce(). | |
| template<> | |
| void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v) |
| Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField. | |
| template<> | |
| void | addDForce (VecDeriv &df, const VecCoord &dx, double kFactor, double) |
| template<> | |
| void | addForce (VecDeriv &f, const VecCoord &x, const VecDeriv &v) |
| Given the current position and velocity states, update the current force vector by computing and adding the forces associated with this ForceField. | |
| template<> | |
| void | addDForce (VecDeriv &df, const VecCoord &dx, double kFactor, double) |
Data Fields | |
| Data< Deriv > | planeNormal |
| Data< Real > | planeD |
| Data< Real > | stiffness |
| Data< Real > | damping |
| Data< defaulttype::Vec3f > | color |
| Data< bool > | bDraw |
Protected Attributes | |
| sofa::helper::vector< unsigned int > | contacts |
| PlaneForceFieldInternalData < DataTypes > | data |
Definition at line 49 of file PlaneForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::PlaneForceField< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 55 of file PlaneForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::PlaneForceField< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 56 of file PlaneForceField.h.
| typedef core::componentmodel::behavior::ForceField<DataTypes> sofa::component::forcefield::PlaneForceField< DataTypes >::Inherit |
Definition at line 52 of file PlaneForceField.h.
| typedef Coord::value_type sofa::component::forcefield::PlaneForceField< DataTypes >::Real |
Definition at line 57 of file PlaneForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::PlaneForceField< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 53 of file PlaneForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::PlaneForceField< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 54 of file PlaneForceField.h.
| sofa::component::forcefield::PlaneForceField< DataTypes >::PlaneForceField | ( | ) | [inline] |
Definition at line 73 of file PlaneForceField.h.
References sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal.
| bool sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox | ( | double * | minBBox, | |
| double * | maxBBox | |||
| ) | [inline] |
Definition at line 191 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::bDraw, sofa::defaulttype::Vec< N, real >::cross(), sofa::core::objectmodel::Data< T >::getValue(), sofa::defaulttype::Vec< N, real >::normalize(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, and sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addDForce | ( | VecDeriv & | df, | |
| const VecCoord & | dx, | |||
| double | kFactor, | |||
| double | ||||
| ) | [inline] |
Definition at line 101 of file CudaPlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::data, and sofa::gpu::cuda::PlaneForceFieldCuda3f1_addDForce().
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addDForce | ( | VecDeriv & | df, | |
| const VecCoord & | dx, | |||
| double | kFactor, | |||
| double | ||||
| ) | [inline] |
Definition at line 78 of file CudaPlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::data, and sofa::gpu::cuda::PlaneForceFieldCuda3f_addDForce().
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addDForce | ( | VecDeriv & | df, | |
| const VecDeriv & | dx, | |||
| 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 ForceField::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::ForceField< DataTypes >.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addDForce | ( | VecDeriv & | df, | |
| const VecDeriv & | dx, | |||
| 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 ForceField::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::ForceField< DataTypes >.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::addDForce | ( | VecDeriv & | df, | |
| const VecDeriv & | dx, | |||
| 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 ForceField::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::ForceField< DataTypes >.
Definition at line 74 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) | [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::ForceField< DataTypes >.
Definition at line 89 of file CudaPlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::damping, sofa::component::forcefield::PlaneForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::gpu::cuda::PlaneForceFieldCuda3f1_addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) | [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::ForceField< DataTypes >.
Definition at line 66 of file CudaPlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::damping, sofa::component::forcefield::PlaneForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::gpu::cuda::PlaneForceFieldCuda3f_addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3f1Types >::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) | [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::ForceField< DataTypes >.
| void sofa::component::forcefield::PlaneForceField< gpu::cuda::CudaVec3fTypes >::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) | [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::ForceField< DataTypes >.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::addForce | ( | VecDeriv & | f, | |
| const VecCoord & | x, | |||
| const VecDeriv & | v | |||
| ) | [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::ForceField< DataTypes >.
Definition at line 49 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::contacts, sofa::component::forcefield::PlaneForceField< DataTypes >::damping, force, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 124 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), and sofa::core::objectmodel::BaseObject::getContext().
| void sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane | ( | float | size = 1000.0f |
) | [inline] |
Definition at line 132 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::color, sofa::defaulttype::Vec< N, real >::cross(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getX(), sofa::helper::gl::glVertexT(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate, sofa::defaulttype::Vec< N, real >::normalize(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, and sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::draw().
| double sofa::component::forcefield::PlaneForceField< DataTypes >::getPotentialEnergy | ( | const VecCoord & | x | ) | [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::ForceField< DataTypes >.
Definition at line 102 of file PlaneForceField.inl.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::rotate | ( | Deriv | axe, | |
| Real | angle | |||
| ) | [inline] |
Definition at line 111 of file PlaneForceField.inl.
References sofa::defaulttype::Vec< N, real >::cross(), sofa::defaulttype::Vec< N, real >::normalize(), and sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::setDamping | ( | Real | damp | ) | [inline] |
Definition at line 100 of file PlaneForceField.h.
References sofa::component::forcefield::PlaneForceField< DataTypes >::damping, and sofa::core::objectmodel::Data< T >::setValue().
| void sofa::component::forcefield::PlaneForceField< DataTypes >::setMState | ( | core::componentmodel::behavior::MechanicalState< DataTypes > * | mstate | ) | [inline] |
Definition at line 93 of file PlaneForceField.h.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::setPlane | ( | const Deriv & | normal, | |
| Real | d | |||
| ) | [inline] |
Definition at line 86 of file PlaneForceField.h.
References sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal, and sofa::core::objectmodel::Data< T >::setValue().
| void sofa::component::forcefield::PlaneForceField< DataTypes >::setStiffness | ( | Real | stiff | ) | [inline] |
Definition at line 95 of file PlaneForceField.h.
References sofa::core::objectmodel::Data< T >::setValue(), and sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::PlaneForceField< DataTypes >::updateStiffness | ( | const VecCoord & | x | ) | [inline, virtual] |
Definition at line 87 of file PlaneForceField.inl.
References sofa::component::forcefield::PlaneForceField< DataTypes >::contacts, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::PlaneForceField< DataTypes >::planeD, and sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal.
| Data<bool> sofa::component::forcefield::PlaneForceField< DataTypes >::bDraw |
Definition at line 71 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox().
| Data<defaulttype::Vec3f> sofa::component::forcefield::PlaneForceField< DataTypes >::color |
Definition at line 70 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane().
sofa::helper::vector<unsigned int> sofa::component::forcefield::PlaneForceField< DataTypes >::contacts [protected] |
| Data<Real> sofa::component::forcefield::PlaneForceField< DataTypes >::damping |
Definition at line 69 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addForce(), and sofa::component::forcefield::PlaneForceField< DataTypes >::setDamping().
PlaneForceFieldInternalData<DataTypes> sofa::component::forcefield::PlaneForceField< DataTypes >::data [protected] |
Definition at line 62 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addDForce(), and sofa::component::forcefield::PlaneForceField< DataTypes >::addForce().
| Data<Real> sofa::component::forcefield::PlaneForceField< DataTypes >::planeD |
Definition at line 67 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox(), sofa::component::forcefield::PlaneForceField< DataTypes >::addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), sofa::component::forcefield::PlaneForceField< DataTypes >::setPlane(), and sofa::component::forcefield::PlaneForceField< DataTypes >::updateStiffness().
| Data<Deriv> sofa::component::forcefield::PlaneForceField< DataTypes >::planeNormal |
Definition at line 66 of file PlaneForceField.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox(), sofa::component::forcefield::PlaneForceField< DataTypes >::addDForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::addForce(), sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), sofa::component::forcefield::PlaneForceField< DataTypes >::PlaneForceField(), sofa::component::forcefield::PlaneForceField< DataTypes >::rotate(), sofa::component::forcefield::PlaneForceField< DataTypes >::setPlane(), and sofa::component::forcefield::PlaneForceField< DataTypes >::updateStiffness().
| Data<Real> sofa::component::forcefield::PlaneForceField< DataTypes >::stiffness |
1.5.7.1