Description

Mask structure for N scalar constraint equations between two bodies.

#include <ChLinkMask.h>

Inheritance diagram for chrono::ChLinkMask:

Public Member Functions

 ChLinkMask ()
 Build a link mask with a single constraint of class ChConstraintTwoBodies().
 
 ChLinkMask (int mnconstr)
 Build a link mask with a default array of mnconstr constraints of class ChConstraintTwoBodies(). More...
 
 ChLinkMask (const ChLinkMask &source)
 Copy constructor.
 
virtual ~ChLinkMask ()
 Destructor.
 
virtual ChLinkMaskClone () const
 "Virtual" copy constructor (covariant return type).
 
void SetTwoBodiesVariables (ChVariables *var1, ChVariables *var2)
 Set references to variables of two connected bodies to all constraints at once, therefore also sets all the constraints as active. More...
 
ChConstraintTwoBodiesConstr_N (int i)
 Obtain the reference to the i-th scalar constraint data in the collection link mask. More...
 
void ResetNconstr (int newnconstr)
 Utility: to change the size of the mask, reallocating constraints (all of type ChConstraintTwo). More...
 
void AddConstraint (ChConstraintTwoBodies *aconstr)
 Add a ChConstraintTwoBodies to mask (NOTE: later, the constraint will be automatically deleted when the mask will be deleted)
 
bool IsEqual (ChLinkMask &mask2)
 To compare two masks, return true if equal.
 
bool IsUnilateral (int i)
 Tells if i-th equation is a unilateral constraint.
 
int GetMaskDoc ()
 Count both bilaterals and unilaterals.
 
int GetMaskDoc_c ()
 Count only bilaterals.
 
int GetMaskDoc_d ()
 Count only unilaterals.
 
ChConstraintTwoBodiesGetActiveConstrByNum (int mnum)
 Get the i-th active scalar costraint (not active constr. won't be considered)
 
int SetActiveRedundantByArray (int *mvector, int mcount)
 Sets some active constraints as redundant.
 
int RestoreRedundant ()
 Set lock =ON for costraints which were disabled because redundant.
 
int SetAllDisabled (bool mdis)
 If SetAllDisabled(true), all the constraints are temporarily turned off (inactive) at once, because marked as 'disabled'. More...
 
int SetAllBroken (bool mdis)
 If SetAllBroken(true), all the constraints are temporarily turned off (broken) at once, because marked as 'broken'. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow deserialization of transient data from archives.
 

Public Attributes

int nconstr
 number of scalar eq.of constraint.
 

Protected Attributes

std::vector
< ChConstraintTwoBodies * > 
constraints
 array of pointers to 'n' scalar constraint states
 

Constructor & Destructor Documentation

chrono::ChLinkMask::ChLinkMask ( int  mnconstr)

Build a link mask with a default array of mnconstr constraints of class ChConstraintTwoBodies().

Member Function Documentation

ChConstraintTwoBodies& chrono::ChLinkMask::Constr_N ( int  i)

Obtain the reference to the i-th scalar constraint data in the collection link mask.

void chrono::ChLinkMask::ResetNconstr ( int  newnconstr)

Utility: to change the size of the mask, reallocating constraints (all of type ChConstraintTwo).

No action if newnconstr == nconstr

int chrono::ChLinkMask::SetAllBroken ( bool  mdis)

If SetAllBroken(true), all the constraints are temporarily turned off (broken) at once, because marked as 'broken'.

Return n.of changed.

int chrono::ChLinkMask::SetAllDisabled ( bool  mdis)

If SetAllDisabled(true), all the constraints are temporarily turned off (inactive) at once, because marked as 'disabled'.

Return n.of changed

void chrono::ChLinkMask::SetTwoBodiesVariables ( ChVariables var1,
ChVariables var2 
)

Set references to variables of two connected bodies to all constraints at once, therefore also sets all the constraints as active.