#include <SphereForceField.h>


Data Structures | |
| class | Contact |
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 | |
| SphereForceField () | |
| void | setSphere (const Coord ¢er, Real radius) |
| void | setStiffness (Real stiff) |
| void | setDamping (Real damp) |
| 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. | |
| 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< Coord > | sphereCenter |
| Data< Real > | sphereRadius |
| Data< Real > | stiffness |
| Data< Real > | damping |
| Data< defaulttype::Vec3f > | color |
| Data< bool > | bDraw |
Protected Attributes | |
| Data< sofa::helper::vector < Contact > > | contacts |
| SphereForceFieldInternalData < DataTypes > | data |
Definition at line 49 of file SphereForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::SphereForceField< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 55 of file SphereForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::SphereForceField< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 56 of file SphereForceField.h.
| typedef core::componentmodel::behavior::ForceField<DataTypes> sofa::component::forcefield::SphereForceField< DataTypes >::Inherit |
Definition at line 52 of file SphereForceField.h.
| typedef Coord::value_type sofa::component::forcefield::SphereForceField< DataTypes >::Real |
Definition at line 57 of file SphereForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::SphereForceField< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 53 of file SphereForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::SphereForceField< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
Definition at line 54 of file SphereForceField.h.
| sofa::component::forcefield::SphereForceField< DataTypes >::SphereForceField | ( | ) | [inline] |
Definition at line 96 of file SphereForceField.h.
| void sofa::component::forcefield::SphereForceField< gpu::cuda::CudaVec3f1Types >::addDForce | ( | VecDeriv & | df, | |
| const VecCoord & | dx, | |||
| double | kFactor, | |||
| double | ||||
| ) | [inline] |
Definition at line 98 of file CudaSphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::data, and sofa::gpu::cuda::SphereForceFieldCuda3f1_addDForce().
| void sofa::component::forcefield::SphereForceField< gpu::cuda::CudaVec3fTypes >::addDForce | ( | VecDeriv & | df, | |
| const VecCoord & | dx, | |||
| double | kFactor, | |||
| double | ||||
| ) | [inline] |
Definition at line 75 of file CudaSphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::data, and sofa::gpu::cuda::SphereForceFieldCuda3f_addDForce().
| void sofa::component::forcefield::SphereForceField< 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::SphereForceField< 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::SphereForceField< 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 93 of file SphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::contacts, sofa::component::forcefield::SphereForceField< DataTypes >::Contact::fact, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::Contact::index, sofa::component::forcefield::SphereForceField< DataTypes >::Contact::normal, and sofa::component::forcefield::SphereForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::SphereForceField< 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 86 of file CudaSphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::damping, sofa::component::forcefield::SphereForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter, sofa::gpu::cuda::SphereForceFieldCuda3f1_addForce(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius, and sofa::component::forcefield::SphereForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::SphereForceField< 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 63 of file CudaSphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::damping, sofa::component::forcefield::SphereForceField< DataTypes >::data, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter, sofa::gpu::cuda::SphereForceFieldCuda3f_addForce(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius, and sofa::component::forcefield::SphereForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::SphereForceField< 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::SphereForceField< 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::SphereForceField< 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 63 of file SphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::contacts, sofa::component::forcefield::SphereForceField< DataTypes >::damping, sofa::component::forcefield::SphereForceField< DataTypes >::Contact::fact, force, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::Contact::index, norm(), norm2(), sofa::component::forcefield::SphereForceField< DataTypes >::Contact::normal, sofa::helper::rsqrt(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter, sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius, and sofa::component::forcefield::SphereForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::SphereForceField< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 139 of file SphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::bDraw, sofa::component::forcefield::SphereForceField< DataTypes >::color, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter, and sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius.
| double sofa::component::forcefield::SphereForceField< 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 132 of file SphereForceField.inl.
| void sofa::component::forcefield::SphereForceField< DataTypes >::setDamping | ( | Real | damp | ) | [inline] |
Definition at line 118 of file SphereForceField.h.
References sofa::component::forcefield::SphereForceField< DataTypes >::damping, and sofa::core::objectmodel::Data< T >::setValue().
| void sofa::component::forcefield::SphereForceField< DataTypes >::setSphere | ( | const Coord & | center, | |
| Real | radius | |||
| ) | [inline] |
| void sofa::component::forcefield::SphereForceField< DataTypes >::setStiffness | ( | Real | stiff | ) | [inline] |
Definition at line 113 of file SphereForceField.h.
References sofa::core::objectmodel::Data< T >::setValue(), and sofa::component::forcefield::SphereForceField< DataTypes >::stiffness.
| void sofa::component::forcefield::SphereForceField< DataTypes >::updateStiffness | ( | const VecCoord & | x | ) | [inline, virtual] |
Definition at line 108 of file SphereForceField.inl.
References sofa::component::forcefield::SphereForceField< DataTypes >::contacts, sofa::component::forcefield::SphereForceField< DataTypes >::Contact::fact, sofa::core::objectmodel::Data< T >::getValue(), sofa::component::forcefield::SphereForceField< DataTypes >::Contact::index, norm(), norm2(), sofa::component::forcefield::SphereForceField< DataTypes >::Contact::normal, sofa::helper::rsqrt(), sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter, and sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius.
| Data<bool> sofa::component::forcefield::SphereForceField< DataTypes >::bDraw |
Definition at line 94 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::draw().
| Data<defaulttype::Vec3f> sofa::component::forcefield::SphereForceField< DataTypes >::color |
Definition at line 93 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::draw().
Data<sofa::helper::vector<Contact> > sofa::component::forcefield::SphereForceField< DataTypes >::contacts [protected] |
| Data<Real> sofa::component::forcefield::SphereForceField< DataTypes >::damping |
Definition at line 92 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::addForce(), and sofa::component::forcefield::SphereForceField< DataTypes >::setDamping().
SphereForceFieldInternalData<DataTypes> sofa::component::forcefield::SphereForceField< DataTypes >::data [protected] |
Definition at line 85 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::addDForce(), and sofa::component::forcefield::SphereForceField< DataTypes >::addForce().
| Data<Coord> sofa::component::forcefield::SphereForceField< DataTypes >::sphereCenter |
Definition at line 89 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::addForce(), sofa::component::forcefield::SphereForceField< DataTypes >::draw(), sofa::component::forcefield::SphereForceField< DataTypes >::setSphere(), and sofa::component::forcefield::SphereForceField< DataTypes >::updateStiffness().
| Data<Real> sofa::component::forcefield::SphereForceField< DataTypes >::sphereRadius |
Definition at line 90 of file SphereForceField.h.
Referenced by sofa::component::forcefield::SphereForceField< DataTypes >::addForce(), sofa::component::forcefield::SphereForceField< DataTypes >::draw(), sofa::component::forcefield::SphereForceField< DataTypes >::setSphere(), and sofa::component::forcefield::SphereForceField< DataTypes >::updateStiffness().
| Data<Real> sofa::component::forcefield::SphereForceField< DataTypes >::stiffness |
1.5.7.1