#include <Mass.h>


Vector operations | |
| std::ofstream * | m_gnuplotFileEnergy |
| stream to export Kinematic, Potential and Mechanical Energy to gnuplot files | |
| virtual void | addMDx (double factor=1.0) |
| f += factor M dx | |
| virtual void | accFromF () |
| dx = M^-1 f | |
| virtual void | addMDx (VecDeriv &f, const VecDeriv &dx, double factor=1.0)=0 |
| f += factor M dx | |
| virtual void | accFromF (VecDeriv &a, const VecDeriv &f)=0 |
| dx = M^-1 f | |
| virtual void | addDForce (VecDeriv &, const VecDeriv &, double, double) |
| Mass forces (gravity) often have null derivative. | |
| virtual double | getKineticEnergy () |
| vMv/2 using dof->getV() | |
| virtual double | getKineticEnergy (const VecDeriv &v)=0 |
| vMv/2 | |
| virtual void | addMBKdx (double mFactor, double bFactor, double kFactor) |
| Accumulate the contribution of M, B, and/or K matrices multiplied by the dx vector with the given coefficients. | |
| virtual void | addMBKv (double mFactor, double bFactor, double kFactor) |
| Accumulate the contribution of M, B, and/or K matrices multiplied by the v vector with the given coefficients. | |
| virtual void | addMBKToMatrix (sofa::defaulttype::BaseMatrix *matrix, double mFact, double bFact, double kFact, unsigned int &offset) |
| Compute the system matrix corresponding to m M + b B + k K. | |
| virtual void | initGnuplot (const std::string path) |
| initialization to export kinetic and potential energy to gnuplot files format | |
| virtual void | exportGnuplot (double time) |
| export kinetic and potential energy state at "time" to a gnuplot file | |
| virtual void | addGravityToV (double dt)=0 |
| perform v += dt*g operation. Used if mass wants to added G separately from the other forces to v. | |
Public Types | |
| typedef DataTypes::VecCoord | VecCoord |
| typedef DataTypes::VecDeriv | VecDeriv |
| typedef DataTypes::Coord | Coord |
| typedef DataTypes::Deriv | Deriv |
Public Member Functions | |
| Mass (MechanicalState< DataTypes > *mm=NULL) | |
| virtual | ~Mass () |
Mass can be defined either as a scalar, vector, or a full mass-matrix. It is responsible for converting forces to accelerations (for explicit integrators), or displacements to forces (for implicit integrators).
It is also a ForceField, computing gravity-related forces.
Definition at line 56 of file Mass.h.
| typedef DataTypes::Coord sofa::core::componentmodel::behavior::Mass< DataTypes >::Coord |
| typedef DataTypes::Deriv sofa::core::componentmodel::behavior::Mass< DataTypes >::Deriv |
| typedef DataTypes::VecCoord sofa::core::componentmodel::behavior::Mass< DataTypes >::VecCoord |
| typedef DataTypes::VecDeriv sofa::core::componentmodel::behavior::Mass< DataTypes >::VecDeriv |
| sofa::core::componentmodel::behavior::Mass< DataTypes >::Mass | ( | MechanicalState< DataTypes > * | mm = NULL |
) | [inline] |
Definition at line 46 of file Mass.inl.
References sofa::core::objectmodel::Base::initData(), and sofa::core::componentmodel::behavior::BaseMass::m_separateGravity.
| sofa::core::componentmodel::behavior::Mass< DataTypes >::~Mass | ( | ) | [inline, virtual] |
| virtual void sofa::core::componentmodel::behavior::Mass< DataTypes >::accFromF | ( | VecDeriv & | a, | |
| const VecDeriv & | f | |||
| ) | [pure virtual] |
dx = M^-1 f
This method must be implemented by the component.
Implemented in sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::mass::MatrixMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, and sofa::component::mass::UniformMass< DataTypes, MassType >.
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::accFromF | ( | ) | [inline, virtual] |
dx = M^-1 f
This method retrieves the force and dx vector and call the internal accFromF(VecDeriv&,const VecDeriv&) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMass.
Definition at line 65 of file Mass.inl.
References sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getDx(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getF(), and sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate.
| virtual void sofa::core::componentmodel::behavior::Mass< DataTypes >::addDForce | ( | VecDeriv & | , | |
| const VecDeriv & | , | |||
| double | , | |||
| double | ||||
| ) | [inline, virtual] |
Mass forces (gravity) often have null derivative.
Reimplemented from sofa::core::componentmodel::behavior::ForceField< DataTypes >.
| virtual void sofa::core::componentmodel::behavior::Mass< DataTypes >::addGravityToV | ( | double | dt | ) | [pure virtual] |
perform v += dt*g operation. Used if mass wants to added G separately from the other forces to v.
Implements sofa::core::componentmodel::behavior::BaseMass.
Implemented in sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::mass::MatrixMass< DataTypes, MassType >, and sofa::component::mass::UniformMass< DataTypes, MassType >.
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKdx | ( | double | mFactor, | |
| double | bFactor, | |||
| double | kFactor | |||
| ) | [inline, virtual] |
Accumulate the contribution of M, B, and/or K matrices multiplied by the dx vector with the given coefficients.
This method computes $ df += mFactor M dx + bFactor B dx + kFactor K dx $ For masses, it calls both addMdx and addDForce (which is often empty).
| mFact | coefficient for mass contributions (i.e. second-order derivatives term in the ODE) | |
| bFact | coefficient for damping contributions (i.e. first derivatives term in the ODE) | |
| kFact | coefficient for stiffness contributions (i.e. DOFs term in the ODE) |
Reimplemented from sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 80 of file Mass.inl.
References sofa::core::componentmodel::behavior::Mass< DataTypes >::addMDx().
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKToMatrix | ( | sofa::defaulttype::BaseMatrix * | matrix, | |
| double | mFact, | |||
| double | bFact, | |||
| double | kFact, | |||
| unsigned int & | offset | |||
| ) | [inline, virtual] |
Compute the system matrix corresponding to m M + b B + k K.
| matrix | matrix to add the result to | |
| mFact | coefficient for mass contributions (i.e. second-order derivatives term in the ODE) | |
| bFact | coefficient for damping contributions (i.e. first derivatives term in the ODE) | |
| kFact | coefficient for stiffness contributions (i.e. DOFs term in the ODE) | |
| offset | current row/column offset |
Reimplemented from sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 99 of file Mass.inl.
References sofa::core::componentmodel::behavior::BaseMass::addMToMatrix().
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKv | ( | double | mFactor, | |
| double | bFactor, | |||
| double | kFactor | |||
| ) | [inline, virtual] |
Accumulate the contribution of M, B, and/or K matrices multiplied by the v vector with the given coefficients.
This method computes $ df += mFactor M v + bFactor B v + kFactor K v $ For masses, it calls both addMdx and addDForce (which is often empty).
| mFact | coefficient for mass contributions (i.e. second-order derivatives term in the ODE) | |
| bFact | coefficient for damping contributions (i.e. first derivatives term in the ODE) | |
| kFact | coefficient for stiffness contributions (i.e. DOFs term in the ODE) |
Reimplemented from sofa::core::componentmodel::behavior::BaseForceField.
Definition at line 88 of file Mass.inl.
References sofa::core::componentmodel::behavior::Mass< DataTypes >::addMDx(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getF(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getV(), and sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate.
| virtual void sofa::core::componentmodel::behavior::Mass< DataTypes >::addMDx | ( | VecDeriv & | f, | |
| const VecDeriv & | dx, | |||
| double | factor = 1.0 | |||
| ) | [pure virtual] |
f += factor M dx
This method must be implemented by the component.
Implemented in sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::mass::MatrixMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, sofa::component::mass::UniformMass< DataTypes, MassType >, and sofa::component::mass::UniformMass< DataTypes, MassType >.
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::addMDx | ( | double | factor = 1.0 |
) | [inline, virtual] |
f += factor M dx
This method retrieves the force and dx vector and call the internal addMDx(VecDeriv&,const VecDeriv&) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMass.
Definition at line 58 of file Mass.inl.
References sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getDx(), sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getF(), and sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate.
Referenced by sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKdx(), and sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKv().
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::exportGnuplot | ( | double | time | ) | [inline, virtual] |
export kinetic and potential energy state at "time" to a gnuplot file
Implements sofa::core::componentmodel::behavior::BaseMass.
Definition at line 118 of file Mass.inl.
References sofa::core::componentmodel::behavior::Mass< DataTypes >::getKineticEnergy(), sofa::core::componentmodel::behavior::ForceField< DataTypes >::getPotentialEnergy(), and sofa::core::componentmodel::behavior::Mass< DataTypes >::m_gnuplotFileEnergy.
| virtual double sofa::core::componentmodel::behavior::Mass< DataTypes >::getKineticEnergy | ( | const VecDeriv & | v | ) | [pure virtual] |
vMv/2
This method must be implemented by the component.
Implemented in sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::mass::MatrixMass< DataTypes, MassType >, and sofa::component::mass::UniformMass< DataTypes, MassType >.
| double sofa::core::componentmodel::behavior::Mass< DataTypes >::getKineticEnergy | ( | ) | [inline, virtual] |
vMv/2 using dof->getV()
This method retrieves the velocity vector and call the internal getKineticEnergy(const VecDeriv&) method implemented by the component.
Implements sofa::core::componentmodel::behavior::BaseMass.
Definition at line 72 of file Mass.inl.
References sofa::core::componentmodel::behavior::MechanicalState< TDataTypes >::getV(), and sofa::core::componentmodel::behavior::ForceField< DataTypes >::mstate.
Referenced by sofa::core::componentmodel::behavior::Mass< DataTypes >::exportGnuplot().
| void sofa::core::componentmodel::behavior::Mass< DataTypes >::initGnuplot | ( | const std::string | path | ) | [inline, virtual] |
initialization to export kinetic and potential energy to gnuplot files format
Implements sofa::core::componentmodel::behavior::BaseMass.
Definition at line 107 of file Mass.inl.
References sofa::core::objectmodel::Base::getName(), and sofa::core::componentmodel::behavior::Mass< DataTypes >::m_gnuplotFileEnergy.
std::ofstream* sofa::core::componentmodel::behavior::Mass< DataTypes >::m_gnuplotFileEnergy [protected] |
stream to export Kinematic, Potential and Mechanical Energy to gnuplot files
Definition at line 155 of file Mass.h.
Referenced by sofa::core::componentmodel::behavior::Mass< DataTypes >::exportGnuplot(), and sofa::core::componentmodel::behavior::Mass< DataTypes >::initGnuplot().
1.5.7.1