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. The base implementation is basically useless unless it has some inherited implementation (see other classes below)

Child classes should implement at least Update() RestoreReferences() Get_Cn().

#include <ChGenericConstraint.h>

Inheritance diagram for chrono::ChGenericConstraint:
Collaboration diagram for chrono::ChGenericConstraint:

## Public Member Functions

virtual bool IsValid ()
Tells if the constraint data is currently valid. More...

virtual bool IsDisabled ()
Tells if the constraint is currently turned on or off by the user.

virtual void SetDisabled (bool mon)

virtual bool IsActive ()
Tells if the constraint is currently active, in general, that is tells if it must be included into the system solver or not. More...

virtual ChMatrixGet_C ()
Returns the matrix of residuals (a column vector with Cn elements) If constraint is not active, returns NULL because no equations can be used. More...

virtual int Get_Cn ()
—TO IMPLEMENT– w.overriding Returns the number of equations in this constraints (the size of the C residual vector)

virtual int Reset_Cn (int mCn)
Changes the number of equations in this constraints (reset the size of the C residual vector). More...

virtual bool RestoreReferences ()

virtual bool Update ()

## Protected Attributes

bool valid

bool disabled

int Cn
constraints equations in this constraint

ChMatrixC
residual matrix

## Member Function Documentation

 virtual ChMatrix* chrono::ChGenericConstraint::Get_C ( )
virtual

Returns the matrix of residuals (a column vector with Cn elements) If constraint is not active, returns NULL because no equations can be used.

 virtual bool chrono::ChGenericConstraint::IsActive ( )
virtual

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

 virtual bool chrono::ChGenericConstraint::IsValid ( )
virtual

Tells if the constraint data is currently valid.

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

 int chrono::ChGenericConstraint::Reset_Cn ( int mCn )
virtual

Changes the number of equations in this constraints (reset the size of the C residual vector).

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