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 no constraints.
 
 ChLinkMask (int mnconstr)
 Build a link mask with a default array of mnconstr constraints of class ChConstraintTwoBodies().
 
 ChLinkMask (const ChLinkMask &source)
 Copy constructor.
 
virtual ~ChLinkMask ()
 Destructor.
 
ChLinkMaskoperator= (const ChLinkMask &other)
 Assignment operator.
 
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.
 
ChConstraintTwoBodiesConstr_N (int i)
 Obtain the reference to the i-th scalar constraint data in the collection link mask.
 
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.
 
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 constraint (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 constraints 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 de-serialization of transient data from archives.
 

Public Attributes

int nconstr
 number of scalar constraint equations.
 

Protected Attributes

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

Member Function Documentation

◆ ResetNconstr()

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

◆ SetAllBroken()

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.

◆ SetAllDisabled()

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


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/physics/ChLinkMask.h
  • /builds/uwsbel/chrono/src/chrono/physics/ChLinkMask.cpp