sofa::core::componentmodel::behavior::BaseMass Class Reference

Component responsible for mass-related computations (gravity, acceleration). More...

#include <BaseMass.h>

Inheritance diagram for sofa::core::componentmodel::behavior::BaseMass:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::componentmodel::behavior::BaseMass:

Collaboration graph
[legend]

Public Member Functions

virtual ~BaseMass ()
Vector operations
virtual void addMDx (double factor=1.0)=0
 f += factor M dx
virtual void accFromF ()=0
 dx = M^-1 f
virtual double getKineticEnergy ()=0
 vMv/2
virtual void addMToMatrix (defaulttype::BaseMatrix *matrix, double mFact, unsigned int &offset)=0
 Add Mass contribution to global Matrix assembling.
virtual void initGnuplot (const std::string path)=0
 initialization to export kinetic and potential energy to gnuplot files format
virtual void exportGnuplot (double time)=0
 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.
virtual double getElementMass (unsigned int index)=0
 return the mass relative to the DOF index

Data Fields

Data< bool > m_separateGravity
 Member specifying if the gravity is added separately to the DOFs velocities (in solve method), or if is added with the other forces(addForceMethod).

Detailed Description

Component responsible for mass-related computations (gravity, acceleration).

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 often also a ForceField, computing gravity-related forces.

Definition at line 55 of file BaseMass.h.


Constructor & Destructor Documentation

virtual sofa::core::componentmodel::behavior::BaseMass::~BaseMass (  )  [inline, virtual]

Definition at line 58 of file BaseMass.h.


Member Function Documentation

virtual void sofa::core::componentmodel::behavior::BaseMass::accFromF (  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::BaseMass::addGravityToV ( double  dt  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::BaseMass::addMDx ( double  factor = 1.0  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::BaseMass::addMToMatrix ( defaulttype::BaseMatrix *  matrix,
double  mFact,
unsigned int &  offset 
) [pure virtual]

Add Mass contribution to global Matrix assembling.

This method must be implemented by the component.

Parameters:
matrix matrix to add the result to
mFact coefficient for mass contributions (i.e. second-order derivatives term in the ODE)
offset current row/column offset

Implemented in sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::mass::MatrixMass< DataTypes, MassType >, and sofa::component::mass::UniformMass< DataTypes, MassType >.

Referenced by sofa::core::componentmodel::behavior::Mass< DataTypes >::addMBKToMatrix().

virtual void sofa::core::componentmodel::behavior::BaseMass::exportGnuplot ( double  time  )  [pure virtual]

export kinetic and potential energy state at "time" to a gnuplot file

Implemented in sofa::core::componentmodel::behavior::Mass< DataTypes >.

virtual double sofa::core::componentmodel::behavior::BaseMass::getElementMass ( unsigned int  index  )  [pure virtual]

virtual double sofa::core::componentmodel::behavior::BaseMass::getKineticEnergy (  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::BaseMass::initGnuplot ( const std::string  path  )  [pure virtual]

initialization to export kinetic and potential energy to gnuplot files format

Implemented in sofa::core::componentmodel::behavior::Mass< DataTypes >.


Field Documentation

Member specifying if the gravity is added separately to the DOFs velocities (in solve method), or if is added with the other forces(addForceMethod).

Definition at line 97 of file BaseMass.h.

Referenced by sofa::component::mass::MatrixMass< DataTypes, MassType >::addForce(), sofa::component::mass::DiagonalMass< DataTypes, MassType >::addForce(), sofa::simulation::MechanicalAddSeparateGravityVisitor::fwdMass(), and sofa::core::componentmodel::behavior::Mass< DataTypes >::Mass().


The documentation for this class was generated from the following file:

Generated on Sun Nov 23 04:22:10 2008 for Sofa by  doxygen 1.5.7.1