#include <CudaPenalityContactForceField.h>


Public Types | |
| typedef CudaVec3fTypes | DataTypes |
| 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, const Deriv &norm, Real dist, Real ks, Real mu_s=0.0f, Real mu_v=0.0f, int oldIndex=0) |
| void | setContacts (Real distance, Real ks, sofa::core::componentmodel::collision::GPUDetectionOutputVector *outputs, bool useDistance, defaulttype::Mat3x3f *normXForm=NULL) |
| 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 | draw () |
| Render internal data of this object, for debugging purposes. | |
Data Fields | |
| sofa::gpu::cuda::CudaVector < sofa::defaulttype::Vec4f > | contacts |
| sofa::gpu::cuda::CudaVector < float > | pen |
Definition at line 54 of file CudaPenalityContactForceField.h.
| typedef DataTypes::Coord sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< CudaVec3fTypes >.
Definition at line 63 of file CudaPenalityContactForceField.h.
| typedef CudaVec3fTypes sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::DataTypes |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< CudaVec3fTypes >.
Definition at line 57 of file CudaPenalityContactForceField.h.
| typedef DataTypes sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::DataTypes1 |
Definition at line 59 of file CudaPenalityContactForceField.h.
| typedef DataTypes sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::DataTypes2 |
Definition at line 60 of file CudaPenalityContactForceField.h.
| typedef DataTypes::Deriv sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< CudaVec3fTypes >.
Definition at line 64 of file CudaPenalityContactForceField.h.
| typedef core::componentmodel::behavior::PairInteractionForceField<DataTypes> sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Inherit |
Definition at line 58 of file CudaPenalityContactForceField.h.
| typedef core::componentmodel::behavior::MechanicalState<DataTypes> sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::MechanicalState |
Definition at line 66 of file CudaPenalityContactForceField.h.
| typedef Coord::value_type sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::Real |
Definition at line 65 of file CudaPenalityContactForceField.h.
| typedef DataTypes::VecCoord sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< CudaVec3fTypes >.
Definition at line 61 of file CudaPenalityContactForceField.h.
| typedef DataTypes::VecDeriv sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::PairInteractionForceField< CudaVec3fTypes >.
Definition at line 62 of file CudaPenalityContactForceField.h.
| sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::PenalityContactForceField | ( | MechanicalState * | object1, | |
| MechanicalState * | object2 | |||
| ) | [inline] |
Definition at line 90 of file CudaPenalityContactForceField.h.
| sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::PenalityContactForceField | ( | ) | [inline] |
Definition at line 95 of file CudaPenalityContactForceField.h.
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addContact | ( | int | m1, | |
| int | m2, | |||
| const Deriv & | norm, | |||
| Real | dist, | |||
| Real | ks, | |||
| Real | mu_s = 0.0f, |
|||
| Real | mu_v = 0.0f, |
|||
| int | oldIndex = 0 | |||
| ) |
Definition at line 74 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, and sofa::helper::rsqrt().
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addDForce | ( | VecDeriv & | df1, | |
| VecDeriv & | df2, | |||
| const VecDeriv & | dx1, | |||
| const VecDeriv & | dx2, | |||
| double | kFactor, | |||
| double | bFactor | |||
| ) | [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< CudaVec3fTypes >.
Definition at line 168 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, norm(), and sofa::gpu::cuda::PenalityContactForceFieldCuda3f_addDForce().
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::addForce | ( | VecDeriv & | f1, | |
| VecDeriv & | f2, | |||
| const VecCoord & | x1, | |||
| const VecCoord & | x2, | |||
| const VecDeriv & | v1, | |||
| const VecDeriv & | v2 | |||
| ) | [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< CudaVec3fTypes >.
Definition at line 137 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, force, norm(), and sofa::gpu::cuda::PenalityContactForceFieldCuda3f_addForce().
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::clear | ( | int | reserve = 0 |
) |
Definition at line 61 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts.
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::draw | ( | ) | [virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 204 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, 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, and norm().
| double sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::getPotentialEnergy | ( | const VecCoord & | x1, | |
| const VecCoord & | x2 | |||
| ) | [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< CudaVec3fTypes >.
Definition at line 197 of file CudaPenalityContactForceField.inl.
| void sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::setContacts | ( | Real | distance, | |
| Real | ks, | |||
| sofa::core::componentmodel::collision::GPUDetectionOutputVector * | outputs, | |||
| bool | useDistance, | |||
| defaulttype::Mat3x3f * | normXForm = NULL | |||
| ) |
Definition at line 104 of file CudaPenalityContactForceField.inl.
References sofa::component::forcefield::PenalityContactForceField< DataTypes >::contacts, sofa::core::componentmodel::collision::GPUDetectionOutput::distance, sofa::core::componentmodel::collision::GPUDetectionOutputVector::get(), sofa::defaulttype::Mat< L, C, real >::identity(), sofa::core::componentmodel::collision::GPUDetectionOutputVector::nbTests(), sofa::core::componentmodel::collision::GPUDetectionOutput::normal, sofa::gpu::cuda::PenalityContactForceFieldCuda3f_setContacts(), sofa::core::componentmodel::collision::GPUDetectionOutputVector::results, sofa::helper::rsqrt(), sofa::core::componentmodel::collision::GPUDetectionOutputVector::rtest(), sofa::core::componentmodel::collision::GPUDetectionOutputVector::size(), and sofa::core::componentmodel::collision::GPUDetectionOutputVector::tests.
| sofa::gpu::cuda::CudaVector<sofa::defaulttype::Vec4f> sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::contacts |
Definition at line 82 of file CudaPenalityContactForceField.h.
| sofa::gpu::cuda::CudaVector<float> sofa::component::forcefield::PenalityContactForceField< CudaVec3fTypes >::pen |
Definition at line 83 of file CudaPenalityContactForceField.h.
1.5.7.1