chrono::ChGenericConstraint Class Reference

Description

Class for basic algebraic constraints (not to be confused with ChLink objects, which are complex kinematic constraints between rigid bodies in 3D, containing ChConstraint objects).

This is the base data for algebraic constraints. Child classes should implement at least Update(), RestoreReferences(), Get_Cn().

#include <ChGenericConstraint.h>

Inheritance diagram for chrono::ChGenericConstraint:

Public Member Functions

bool IsValid ()
 Tells if the constraint data is currently valid. More...
 
bool IsDisabled ()
 Tells if the constraint is currently turned on or off by the user.
 
void SetDisabled (bool mon)
 
bool IsActive () const
 Tells if the constraint is currently active, in general, that is tells if it must be included into the system solver or not. More...
 
const ChVectorDynamic & Get_C () const
 Returns the matrix of residuals (a column vector with Cn elements.
 
virtual int Get_Cn ()
 Returns the number of equations in this constraints (the size of the C residual vector)
 
void Reset_Cn (int mCn)
 Changes the number of equations in this constraints (reset the size of the C residual vector).
 
virtual bool RestoreReferences (ChFunction *mroot)
 This may be overloaded by child classes. More...
 
virtual bool Update ()
 Compute the residuals (vector 'C') of the constraint equations, where C=0 is for satisfied constraints. More...
 

Protected Attributes

bool valid
 
bool disabled
 
int Cn
 constraints equations in this constraint
 
ChVectorDynamic C
 residual matrix
 

Member Function Documentation

bool chrono::ChGenericConstraint::IsActive ( ) const

Tells if the constraint is currently active, in general, that is tells if it must be included into the system solver or not.

bool chrono::ChGenericConstraint::IsValid ( )

Tells if the constraint data is currently valid.

Instead of implementing it, child classes may simply set valid=false (or true) depending on the result of their implementations of RestoreReference().

virtual bool chrono::ChGenericConstraint::RestoreReferences ( ChFunction mroot)
virtual

This may be overloaded by child classes.

Argument should be the 'database' where the reference restoring takes place. Should return false if referencing was not possible. Should set valid=true/false depending on referencing success.

Reimplemented in chrono::ChGenericConstraint_Chf.

virtual bool chrono::ChGenericConstraint::Update ( )
virtual

Compute the residuals (vector 'C') of the constraint equations, where C=0 is for satisfied constraints.

Should return false if updating was not possible.

Reimplemented in chrono::ChGenericConstraint_Chf_VertDistance, chrono::ChGenericConstraint_Chf_HorDistance, chrono::ChGenericConstraint_Chf_Continuity, and chrono::ChGenericConstraint_Chf_ImposeVal.