SOFA API  74899712
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 =delete
 
ExecParamssetAspectID (int)=delete
 

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 ()=delete
 
static int currentAspect (const core::ExecParams *)=delete
 

Attribute details

◆ m_constOrder

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

Description of the order of the constraint.

◆ m_dx

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

Ids of contraint correction vector.

◆ m_j

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

Ids of the constraint jacobian matrix.

◆ m_lambda

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

Ids of constraint lambda vector.

◆ m_smoothFactor

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

Smooth contribution factor (for smooth constraints resolution)

◆ m_v

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

Ids of velocity vector.

◆ m_x

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

Ids of position vector.

Constructor details

◆ ConstraintParams()

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()

ConstOrder sofa::core::ConstraintParams::constOrder ( ) const
inline

◆ defaultInstance()

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.

◆ dx() [1/2]

MultiVecDerivId& sofa::core::ConstraintParams::dx ( )
inline

◆ dx() [2/2]

const MultiVecDerivId& sofa::core::ConstraintParams::dx ( ) const
inline

◆ getName()

std::string sofa::core::ConstraintParams::getName ( ) const
inline

◆ j() [1/2]

MultiMatrixDerivId& sofa::core::ConstraintParams::j ( )
inline

◆ j() [2/2]

const MultiMatrixDerivId& sofa::core::ConstraintParams::j ( ) const
inline

◆ lambda() [1/2]

MultiVecDerivId& sofa::core::ConstraintParams::lambda ( )
inline

◆ lambda() [2/2]

const MultiVecDerivId& sofa::core::ConstraintParams::lambda ( ) const
inline

◆ readDx() [1/2]

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

Read access to the constraint corrective motion vector.

◆ readDx() [2/2]

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.

◆ readJ() [1/2]

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

Read access to the constraint jacobian matrix.

◆ readJ() [2/2]

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.

◆ readLambda() [1/2]

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

Read access to the constraint force vector.

◆ readLambda() [2/2]

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.

◆ readV() [1/2]

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.

◆ readV() [2/2]

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.

◆ readX() [1/2]

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.

◆ readX() [2/2]

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.

◆ setDx() [1/3]

template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setDx ( const StateSet &  g,
MultiVecDerivId  dx 
)
inline

◆ setDx() [2/3]

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

◆ setDx() [3/3]

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

Set the IDs where to write corrective displacement vector.

◆ setExecParams()

ConstraintParams & sofa::core::ConstraintParams::setExecParams ( const core::ExecParams params)

◆ setJ() [1/3]

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

◆ setJ() [2/3]

ConstraintParams& sofa::core::ConstraintParams::setJ ( MatrixDerivId  j)
inline

Set the IDs where to read the constraint jacobian matrix.

◆ setJ() [3/3]

ConstraintParams& sofa::core::ConstraintParams::setJ ( MultiMatrixDerivId  j)
inline

◆ setLambda() [1/3]

template<class StateSet >
ConstraintParams& sofa::core::ConstraintParams::setLambda ( const StateSet &  g,
MultiVecDerivId  lambda 
)
inline

◆ setLambda() [2/3]

ConstraintParams& sofa::core::ConstraintParams::setLambda ( MultiVecDerivId  lambda)
inline

◆ setLambda() [3/3]

ConstraintParams& sofa::core::ConstraintParams::setLambda ( VecDerivId  lambda)
inline

Set the IDs where to write the constraint force vector.

◆ setOrder()

ConstraintParams& sofa::core::ConstraintParams::setOrder ( ConstOrder  o)
inline

◆ setSmoothFactor()

ConstraintParams& sofa::core::ConstraintParams::setSmoothFactor ( double  v)
inline

Set smooth contribution factor (for smooth constraints resolution)

◆ setV() [1/3]

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

◆ setV() [2/3]

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

◆ setV() [3/3]

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

Set the IDs where to read the free velocity vector.

◆ setX() [1/3]

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

◆ setX() [2/3]

ConstraintParams& sofa::core::ConstraintParams::setX ( ConstMultiVecCoordId  v)
inline

◆ setX() [3/3]

ConstraintParams& sofa::core::ConstraintParams::setX ( ConstVecCoordId  v)
inline

Set the IDs where to read the free position vector.

◆ smoothFactor()

double sofa::core::ConstraintParams::smoothFactor ( ) const
inline

Smooth contribution factor (for smooth constraints resolution)

◆ v() [1/2]

ConstMultiVecDerivId& sofa::core::ConstraintParams::v ( )
inline

◆ v() [2/2]

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

◆ x() [1/2]

ConstMultiVecCoordId& sofa::core::ConstraintParams::x ( )
inline

◆ x() [2/2]

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

Enum details

◆ ConstOrder

Description of the order of the constraint.

Enumerator
POS 
VEL 
ACC 
POS_AND_VEL