SOFA API  38ecbea1
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...
 
ConstraintOrder m_constOrder
 Description of the order of the constraint. More...
 
double m_smoothFactor
 Smooth contribution factor (for smooth constraints resolution) More...
 

Public Member Functions

 SOFA_ATTRIBUTE_DISABLED__CONSTORDER () static const expr auto POS
 
 SOFA_ATTRIBUTE_DISABLED__CONSTORDER () static const expr auto VEL
 
 SOFA_ATTRIBUTE_DISABLED__CONSTORDER () static const expr auto ACC
 
 SOFA_ATTRIBUTE_DISABLED__CONSTORDER () static const expr auto POS_AND_VEL
 
std::string_view 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
ConstraintOrder constOrder () const
 
ConstraintParamssetOrder (ConstraintOrder 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...
 
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
 Returns ids of the position vectors. More...
 
ConstMultiVecCoordIdx ()
 Returns ids of the position vectors. More...
 
const ConstMultiVecDerivIdv () const
 Returns ids of the velocity vectors. More...
 
ConstMultiVecDerivIdv ()
 Returns ids of the velocity vectors. More...
 
const MultiMatrixDerivIdj () const
 Returns ids of the constraint jacobian matrices. More...
 
MultiMatrixDerivIdj ()
 Returns ids of the constraint jacobian matrices. More...
 
const MultiVecDerivIddx () const
 Returns ids of the contraint correction vectors. More...
 
MultiVecDerivIddx ()
 Returns ids of the contraint correction vectors. More...
 
const MultiVecDerivIdlambda () const
 Returns ids of the constraint lambda vectors. More...
 
MultiVecDerivIdlambda ()
 Returns ids of the constraint lambda vectors. More...
 
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...
 

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...
 

Attribute details

◆ m_constOrder

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

ConstraintOrder 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

Returns ids of the contraint correction vectors.

◆ dx() [2/2]

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

Returns ids of the contraint correction vectors.

◆ getName()

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

◆ j() [1/2]

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

Returns ids of the constraint jacobian matrices.

◆ j() [2/2]

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

Returns ids of the constraint jacobian matrices.

◆ lambda() [1/2]

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

Returns ids of the constraint lambda vectors.

◆ lambda() [2/2]

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

Returns ids of the constraint lambda vectors.

◆ readDx()

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

Read access to the constraint corrective motion vector.

◆ readJ()

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

Read access to the constraint jacobian matrix.

◆ readLambda()

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

Read access to the constraint force vector.

◆ readV()

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.

◆ readX()

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.

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

◆ SOFA_ATTRIBUTE_DISABLED__CONSTORDER() [1/4]

sofa::core::ConstraintParams::SOFA_ATTRIBUTE_DISABLED__CONSTORDER ( ) const

◆ SOFA_ATTRIBUTE_DISABLED__CONSTORDER() [2/4]

sofa::core::ConstraintParams::SOFA_ATTRIBUTE_DISABLED__CONSTORDER ( ) const

◆ SOFA_ATTRIBUTE_DISABLED__CONSTORDER() [3/4]

sofa::core::ConstraintParams::SOFA_ATTRIBUTE_DISABLED__CONSTORDER ( ) const

◆ SOFA_ATTRIBUTE_DISABLED__CONSTORDER() [4/4]

sofa::core::ConstraintParams::SOFA_ATTRIBUTE_DISABLED__CONSTORDER ( ) const

◆ v() [1/2]

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

Returns ids of the velocity vectors.

◆ v() [2/2]

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

Returns ids of the velocity vectors.

◆ x() [1/2]

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

Returns ids of the position vectors.

◆ x() [2/2]

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

Returns ids of the position vectors.