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>
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. | |
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
◆ IsValid()
|
inline |
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().
◆ RestoreReferences()
|
inlinevirtual |
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.
◆ Update()
|
inlinevirtual |
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.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono/physics/ChGenericConstraint.h
- /builds/uwsbel/chrono/src/chrono/physics/ChGenericConstraint.cpp