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>
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 ChMatrix *  Get_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 () 
—TO IMPLEMENT– w.overloading This may be overloaded by child classes. More...  
virtual bool  Update () 
—TO IMPLEMENT– w.overloading This MUST be overloaded by child classes. More...  
Protected Attributes  
bool  valid 
bool  disabled 
int  Cn 
constraints equations in this constraint  
ChMatrix *  C 
residual matrix  
Member Function Documentation

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 
Tells if the constraint is currently active, in general, that is tells if it must be included into the system solver or not.

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

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

virtual 
—TO IMPLEMENT– w.overloading 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.

virtual 
—TO IMPLEMENT– w.overloading This MUST be overloaded by child classes.
It should 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.