SOFA API  9d9100aa
Open source framework for multi-physics simuation
sofa::core::ConstraintParams Class Reference

#include <ConstraintParams.h>

Inheritance diagram for sofa::core::ConstraintParams:

Detailed Description

Class gathering parameters use by constraint components methods, and transmitted by visitors read the velocity and position and where the

Protected Attributes

ConstMultiVecCoordId m_x
 Ids of position vector. More...
 
ConstMultiVecDerivId m_v
 Ids of velocity vector. More...
 
MultiMatrixDerivId m_j
 Ids of the constraint jacobian matrix. More...
 
MultiVecDerivId m_dx
 Ids of contraint correction vector. More...
 
MultiVecDerivId m_lambda
 Ids of constraint lambda vector. More...
 
ConstOrder m_constOrder
 Description of the order of the constraint. More...
 
double m_smoothFactor
 Smooth contribution factor (for smooth constraints resolution) More...
 

Public Member Functions

std::string getName () const
 
 ConstraintParams (const sofa::core::ExecParams &p=*sofa::core::ExecParams::defaultInstance())
 Constructor, initializing all VecIds to default values, implicit and energy flags to false. More...
 
ConstraintParamssetExecParams (const core::ExecParams *params)
 
Flags and parameters getters
ConstOrder constOrder () const
 
ConstraintParamssetOrder (ConstOrder o)
 
double smoothFactor () const
 Smooth contribution factor (for smooth constraints resolution) More...
 
Access to vectors from a given state container (i.e. State or MechanicalState)
template<class S >
const Data< typename S::VecCoord > * readX (const S *state) const
 Read access to the free (unconstrained) position vector. More...
 
template<class S >
const Data< typename S::VecDeriv > * readV (const S *state) const
 Read access to the free (unconstrained) velocity vector. More...
 
template<class S >
const Data< typename S::MatrixDeriv > * readJ (const S *state) const
 Read access to the constraint jacobian matrix. More...
 
template<class S >
const Data< typename S::VecDeriv > * readLambda (S *state) const
 Read access to the constraint force vector. More...
 
template<class S >
const Data< typename S::VecDeriv > * readDx (S *state) const
 Read access to the constraint corrective motion vector. More...
 
Access to vectors from a given SingleLink to a state container (i.e. State or MechanicalState)
template<class Owner , class S , unsigned int flags>
const Data< typename S::VecCoord > * readX (const SingleLink< Owner, S, flags > &state) const
 Read access to the free (unconstrained) position. More...
 
template<class Owner , class S , unsigned int flags>
const Data< typename S::VecDeriv > * readV (const SingleLink< Owner, S, flags > &state) const
 Read access to the free (unconstrained) velocity vector. More...
 
template<class Owner , class S , unsigned int flags>
const Data< typename S::MatrixDeriv > * readJ (const SingleLink< Owner, S, flags > &state) const
 Read access to the constraint jacobian matrix. More...
 
template<class Owner , class S , unsigned int flags>
const Data< typename S::VecDeriv > * readLambda (SingleLink< Owner, S, flags > &state) const
 Read access to the constraint force vector. More...
 
template<class Owner , class S , unsigned int flags>
const Data< typename S::VecDeriv > * readDx (SingleLink< Owner, S, flags > &state) const
 Read access to the constraint corrective motion vector. More...
 
Setup methods

Called by the OdeSolver from which the mechanical computations originate. They all return a reference to this MechanicalParam instance, to ease chaining multiple setup calls.

ConstraintParamssetSmoothFactor (double v)
 Set smooth contribution factor (for smooth constraints resolution) More...
 
const ConstMultiVecCoordIdx () const
 
ConstMultiVecCoordIdx ()
 
const ConstMultiVecDerivIdv () const
 
ConstMultiVecDerivIdv ()
 
const MultiMatrixDerivIdj () const
 
MultiMatrixDerivIdj ()
 
const MultiVecDerivIddx () const
 
MultiVecDerivIddx ()
 
const MultiVecDerivIdlambda () const
 
MultiVecDerivIdlambda ()
 
ConstraintParamssetX (ConstVecCoordId v)
 Set the IDs where to read the free position vector. More...
 
ConstraintParamssetX (ConstMultiVecCoordId v)
 
template<class StateSet >
ConstraintParamssetX (const StateSet &g, ConstVecCoordId v)
 
ConstraintParamssetV (ConstVecDerivId v)
 Set the IDs where to read the free velocity vector. More...
 
ConstraintParamssetV (ConstMultiVecDerivId v)
 
template<class StateSet >
ConstraintParamssetV (const StateSet &g, ConstVecDerivId v)
 
ConstraintParamssetJ (MatrixDerivId j)
 Set the IDs where to read the constraint jacobian matrix. More...
 
ConstraintParamssetJ (MultiMatrixDerivId j)
 
template<class StateSet >
ConstraintParamssetJ (const StateSet &g, MatrixDerivId j)
 
ConstraintParamssetDx (VecDerivId dx)
 Set the IDs where to write corrective displacement vector. More...
 
ConstraintParamssetDx (MultiVecDerivId dx)
 
template<class StateSet >
ConstraintParamssetDx (const StateSet &g, MultiVecDerivId dx)
 
ConstraintParamssetLambda (VecDerivId lambda)
 Set the IDs where to write the constraint force vector. More...
 
ConstraintParamssetLambda (MultiVecDerivId lambda)
 
template<class StateSet >
ConstraintParamssetLambda (const StateSet &g, MultiVecDerivId lambda)
 
- Public Member Functions inherited from sofa::core::ExecParams
bool checkValidStorage () const
 
ExecMode execMode () const
 Mode of execution requested. More...
 
int threadID () const
 Index of current thread (0 corresponding to the only thread in sequential mode, or first thread in parallel mode) More...
 
int nbThreads () const
 Number of threads currently known to Sofa. More...
 
 ExecParams ()
 
void update ()
 Make sure this instance is up-to-date relative to the current thread. More...
 
ExecParamssetExecMode (ExecMode v)
 Request a specific mode of execution. More...
 
ExecParamssetThreadID (int v)
 Specify the index of the current thread. More...
 
int aspectID () const
 
ExecParamssetAspectID (int)
 Specify the aspect index of the current thread. More...
 

Static Public Member Functions

static const ConstraintParamsdefaultInstance ()
 Get the default MechanicalParams, to be used to provide a default values for method parameters. More...
 
- Static Public Member Functions inherited from sofa::core::ExecParams
static ExecParamsdefaultInstance ()
 Get the default ExecParams, to be used to provide a default values for method parameters. More...
 
static int currentAspect ()
 
static int currentAspect (const core::ExecParams *)
 

Attribute details

ConstOrder sofa::core::ConstraintParams::m_constOrder
protected

Description of the order of the constraint.

MultiVecDerivId sofa::core::ConstraintParams::m_dx
protected

Ids of contraint correction vector.

MultiMatrixDerivId sofa::core::ConstraintParams::m_j
protected

Ids of the constraint jacobian matrix.

MultiVecDerivId sofa::core::ConstraintParams::m_lambda
protected

Ids of constraint lambda vector.

double sofa::core::ConstraintParams::m_smoothFactor
protected

Smooth contribution factor (for smooth constraints resolution)

ConstMultiVecDerivId sofa::core::ConstraintParams::m_v
protected

Ids of velocity vector.

ConstMultiVecCoordId sofa::core::ConstraintParams::m_x
protected

Ids of position vector.

Constructor details

sofa::core::ConstraintParams::ConstraintParams ( const sofa::core::ExecParams p = *sofa::core::ExecParams::defaultInstance())

Constructor, initializing all VecIds to default values, implicit and energy flags to false.

Function details

ConstOrder sofa::core::ConstraintParams::constOrder ( ) const
inline
const ConstraintParams * sofa::core::ConstraintParams::defaultInstance ( )
static

Get the default MechanicalParams, to be used to provide a default values for method parameters.

Get the default ConstraintParams, to be used to provide a default values for method parameters.

const MultiVecDerivId& sofa::core::ConstraintParams::dx ( ) const
inline
MultiVecDerivId& sofa::core::ConstraintParams::dx ( )
inline
std::string sofa::core::ConstraintParams::getName ( ) const
inline
const MultiMatrixDerivId& sofa::core::ConstraintParams::j ( ) const
inline
MultiMatrixDerivId& sofa::core::ConstraintParams::j ( )
inline
const MultiVecDerivId& sofa::core::ConstraintParams::lambda ( ) const
inline
MultiVecDerivId& sofa::core::ConstraintParams::lambda ( )
inline
template<class S >
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readDx ( S *  state) const
inline

Read access to the constraint corrective motion vector.

template<class Owner , class S , unsigned int flags>
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readDx ( SingleLink< Owner, S, flags > &  state) const
inline

Read access to the constraint corrective motion vector.

template<class S >
const Data<typename S::MatrixDeriv>* sofa::core::ConstraintParams::readJ ( const S *  state) const
inline

Read access to the constraint jacobian matrix.

template<class Owner , class S , unsigned int flags>
const Data<typename S::MatrixDeriv>* sofa::core::ConstraintParams::readJ ( const SingleLink< Owner, S, flags > &  state) const
inline

Read access to the constraint jacobian matrix.

template<class S >
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readLambda ( S *  state) const
inline

Read access to the constraint force vector.

template<class Owner , class S , unsigned int flags>
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readLambda ( SingleLink< Owner, S, flags > &  state) const
inline

Read access to the constraint force vector.

template<class S >
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readV ( const S *  state) const
inline

Read access to the free (unconstrained) velocity vector.

template<class Owner , class S , unsigned int flags>
const Data<typename S::VecDeriv>* sofa::core::ConstraintParams::readV ( const SingleLink< Owner, S, flags > &  state) const
inline

Read access to the free (unconstrained) velocity vector.

template<class S >
const Data<typename S::VecCoord>* sofa::core::ConstraintParams::readX ( const S *  state) const
inline

Read access to the free (unconstrained) position vector.

template<class Owner , class S , unsigned int flags>
const Data<typename S::VecCoord>* sofa::core::ConstraintParams::readX ( const SingleLink< Owner, S, flags > &  state) const
inline

Read access to the free (unconstrained) position.

ConstraintParams& sofa::core::ConstraintParams::setDx ( VecDerivId  dx)
inline

Set the IDs where to write corrective displacement vector.

ConstraintParams& sofa::core::ConstraintParams::setDx ( MultiVecDerivId  dx)
inline
template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setDx ( const StateSet &  g,
MultiVecDerivId  dx 
)
inline
ConstraintParams & sofa::core::ConstraintParams::setExecParams ( const core::ExecParams params)
ConstraintParams& sofa::core::ConstraintParams::setJ ( MatrixDerivId  j)
inline

Set the IDs where to read the constraint jacobian matrix.

ConstraintParams& sofa::core::ConstraintParams::setJ ( MultiMatrixDerivId  j)
inline
template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setJ ( const StateSet &  g,
MatrixDerivId  j 
)
inline
ConstraintParams& sofa::core::ConstraintParams::setLambda ( VecDerivId  lambda)
inline

Set the IDs where to write the constraint force vector.

ConstraintParams& sofa::core::ConstraintParams::setLambda ( MultiVecDerivId  lambda)
inline
template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setLambda ( const StateSet &  g,
MultiVecDerivId  lambda 
)
inline
ConstraintParams& sofa::core::ConstraintParams::setOrder ( ConstOrder  o)
inline
ConstraintParams& sofa::core::ConstraintParams::setSmoothFactor ( double  v)
inline

Set smooth contribution factor (for smooth constraints resolution)

ConstraintParams& sofa::core::ConstraintParams::setV ( ConstVecDerivId  v)
inline

Set the IDs where to read the free velocity vector.

ConstraintParams& sofa::core::ConstraintParams::setV ( ConstMultiVecDerivId  v)
inline
template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setV ( const StateSet &  g,
ConstVecDerivId  v 
)
inline
ConstraintParams& sofa::core::ConstraintParams::setX ( ConstVecCoordId  v)
inline

Set the IDs where to read the free position vector.

ConstraintParams& sofa::core::ConstraintParams::setX ( ConstMultiVecCoordId  v)
inline
template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setX ( const StateSet &  g,
ConstVecCoordId  v 
)
inline
double sofa::core::ConstraintParams::smoothFactor ( ) const
inline

Smooth contribution factor (for smooth constraints resolution)

const ConstMultiVecDerivId& sofa::core::ConstraintParams::v ( ) const
inline
ConstMultiVecDerivId& sofa::core::ConstraintParams::v ( )
inline
const ConstMultiVecCoordId& sofa::core::ConstraintParams::x ( ) const
inline
ConstMultiVecCoordId& sofa::core::ConstraintParams::x ( )
inline

Enum details

Description of the order of the constraint.

Enumerator
POS 
VEL 
ACC 
POS_AND_VEL