Constraint Class Reference

This is the base class for all Constraint classes, which is just a handle for the underlying hidden implementation. More...

#include <Constraint.h>

Inheritance diagram for Constraint:
PIMPLHandle< Constraint, ConstraintImpl, true > Ball ConstantAngle ConstantOrientation ConstantSpeed Custom NoSlip1D PointInPlane PointOnLine Rod Weld

List of all members.

Classes

class  Ball
 Three constraint equations. More...
class  ConstantAngle
 One constraint equation. More...
class  ConstantOrientation
 Three constraint equations. More...
class  ConstantSpeed
 One non-holonomic constraint equation. More...
class  CoordinateCoupler
 This is a subclass of Constraint::Custom which uses a Function object to define a holonomic (position) constraint. More...
class  Custom
 The handle class Constraint::Custom (dataless) and its companion class Constraint::Custom::Implementation can be used together to define new Constraint types with arbitrary properties. More...
class  NoSlip1D
 One non-holonomic constraint equation. More...
class  PointInPlane
 One constraint equation. More...
class  PointOnLine
 Two constraint equations. More...
class  PrescribedMotion
 This is a subclass of Constraint::Custom which uses a Function to prescribe the behavior of a single generalized coordinate as a function of time. More...
class  Rod
 One constraint equation. More...
class  SpeedCoupler
 This is a subclass of Constraint::Custom which uses a Function object to define a nonholonomic (velocity) constraint. More...
class  Weld
 Six constraint equations. More...

Public Types

typedef Rod ConstantDistance
typedef Ball CoincidentPoints
typedef Weld CoincidentFrames

Public Member Functions

 Constraint ()
 Constraint (ConstraintImpl *r)
void disable (State &) const
void enable (State &) const
bool isDisabled (const State &) const
bool isDisabledByDefault () const
void setDisabledByDefault (bool shouldBeDisabled)
 Normally Constraints are enabled when defined and can be disabled later.
 operator ConstraintIndex () const
ConstraintIndex getConstraintIndex () const
const SimbodyMatterSubsystemgetMatterSubsystem () const
SimbodyMatterSubsystemupdMatterSubsystem ()
bool isInSubsystem () const
bool isInSameSubsystem (const MobilizedBody &) const
int getNumConstrainedBodies () const
 Return the number of bodies *directly* restricted by this constraint.
const MobilizedBodygetMobilizedBodyFromConstrainedBody (ConstrainedBodyIndex) const
 Return a reference to the actual MobilizedBodies included in the count above.
const MobilizedBodygetAncestorMobilizedBody () const
 Return a reference to the actual MobilizedBody which is serving as the Ancestor body for the constrained bodies in this Constraint.
int getNumConstrainedMobilizers () const
 Return the number of mobilizers *directly* restricted by this constraint.
const MobilizedBodygetMobilizedBodyFromConstrainedMobilizer (ConstrainedMobilizerIndex) const
 Return a reference to the actual MobilizedBodies included in the count of constrained mobilizers above.
const SimbodyMatterSubtreegetSubtree () const
int getNumConstrainedQ (const State &, ConstrainedMobilizerIndex) const
 Return the number of constrainable generalized coordinates q associated with a particular constrained mobilizer.
int getNumConstrainedU (const State &, ConstrainedMobilizerIndex) const
 Return the number of constrainable mobilities u associated with a particular constrained mobilizer.
ConstrainedUIndex getConstrainedUIndex (const State &, ConstrainedMobilizerIndex, MobilizerUIndex which) const
 Return the index into the constrained mobilities u array corresponding to a particular mobility of the indicated ConstrainedMobilizer.
ConstrainedQIndex getConstrainedQIndex (const State &, ConstrainedMobilizerIndex, MobilizerQIndex which) const
 Return the index into the constrained coordinates q array corresponding to a particular coordinate of the indicated ConstrainedMobilizer.
int getNumConstrainedQ (const State &) const
 Return the sum of the number of coordinates q associated with each of the constrained mobilizers.
int getNumConstrainedU (const State &) const
 Return the sum of the number of mobilities u associated with each of the constrained mobilizers.
void getNumConstraintEquationsInUse (const State &, int &mp, int &mv, int &ma) const
 Find out how many holonomic (position), nonholonomic (velocity), and acceleration-only constraint equations are generated by this Constraint.
Vector getPositionErrorsAsVector (const State &) const
 Get a Vector containing the position errors.
Vector calcPositionErrorFromQ (const State &, const Vector &q) const
Matrix calcPositionConstraintMatrixP (const State &) const
Matrix calcPositionConstraintMatrixPt (const State &) const
Matrix calcPositionConstraintMatrixPNInv (const State &) const
void calcConstraintForcesFromMultipliers (const State &, const Vector &lambda, Vector_< SpatialVec > &bodyForcesInA, Vector &mobilityForces) const
Vector getVelocityErrorsAsVector (const State &) const
 Get a Vector containing the velocity errors.
Vector calcVelocityErrorFromU (const State &, const Vector &u) const
Matrix calcVelocityConstraintMatrixV (const State &) const
Matrix calcVelocityConstraintMatrixVt (const State &) const
Vector getAccelerationErrorsAsVector (const State &) const
 Get a Vector containing the acceleration errors.
Vector calcAccelerationErrorFromUDot (const State &, const Vector &udot) const
Vector getMultipliersAsVector (const State &) const
 Get a Vector containing the Lagrange multipliers.
Matrix calcAccelerationConstraintMatrixA (const State &) const
Matrix calcAccelerationConstraintMatrixAt (const State &) const

Detailed Description

This is the base class for all Constraint classes, which is just a handle for the underlying hidden implementation.

Each built-in Constraint type is a local subclass within Constraint, and is also derived from Constraint.


Member Typedef Documentation


Constructor & Destructor Documentation

Constraint (  )  [inline]
Constraint ( ConstraintImpl *  r  )  [inline, explicit]

Member Function Documentation

Matrix calcAccelerationConstraintMatrixA ( const State  )  const
Matrix calcAccelerationConstraintMatrixAt ( const State  )  const
Vector calcAccelerationErrorFromUDot ( const State ,
const Vector udot 
) const
void calcConstraintForcesFromMultipliers ( const State ,
const Vector lambda,
Vector_< SpatialVec > &  bodyForcesInA,
Vector mobilityForces 
) const
Matrix calcPositionConstraintMatrixP ( const State  )  const
Matrix calcPositionConstraintMatrixPNInv ( const State  )  const
Matrix calcPositionConstraintMatrixPt ( const State  )  const
Vector calcPositionErrorFromQ ( const State ,
const Vector q 
) const
Matrix calcVelocityConstraintMatrixV ( const State  )  const
Matrix calcVelocityConstraintMatrixVt ( const State  )  const
Vector calcVelocityErrorFromU ( const State ,
const Vector u 
) const
void disable ( State  )  const
void enable ( State  )  const
Vector getAccelerationErrorsAsVector ( const State  )  const

Get a Vector containing the acceleration errors.

Many subclasses provide their own methods for getting this information in a more specific form.

const MobilizedBody& getAncestorMobilizedBody (  )  const

Return a reference to the actual MobilizedBody which is serving as the Ancestor body for the constrained bodies in this Constraint.

This will fail if there are no constrained bodies (i.e., if getNumConstrainedBodies()==0).

ConstrainedQIndex getConstrainedQIndex ( const State ,
ConstrainedMobilizerIndex  ,
MobilizerQIndex  which 
) const

Return the index into the constrained coordinates q array corresponding to a particular coordinate of the indicated ConstrainedMobilizer.

Don't confuse this with the set of *participating* coordinates which also includes all coordinates on each branch between the ancestor and a constrained body. The *constrained* coordinates are just those belonging to the mobilizers which are directly constrained.

ConstrainedUIndex getConstrainedUIndex ( const State ,
ConstrainedMobilizerIndex  ,
MobilizerUIndex  which 
) const

Return the index into the constrained mobilities u array corresponding to a particular mobility of the indicated ConstrainedMobilizer.

Don't confuse this with the set of *participating* mobilities which also includes all mobilities on each branch between the ancestor and a constrained body. The *constrained* mobilities are just those belonging to the mobilizers which are directly constrained.

ConstraintIndex getConstraintIndex (  )  const
const SimbodyMatterSubsystem& getMatterSubsystem (  )  const
const MobilizedBody& getMobilizedBodyFromConstrainedBody ( ConstrainedBodyIndex   )  const

Return a reference to the actual MobilizedBodies included in the count above.

0 <= index < getNumConstrainedBodies().

const MobilizedBody& getMobilizedBodyFromConstrainedMobilizer ( ConstrainedMobilizerIndex   )  const

Return a reference to the actual MobilizedBodies included in the count of constrained mobilizers above.

0 <= index < getNumConstrainedMobilizers().

Vector getMultipliersAsVector ( const State  )  const

Get a Vector containing the Lagrange multipliers.

Many subclasses provide their own methods for getting this information in a more specific form.

int getNumConstrainedBodies (  )  const

Return the number of bodies *directly* restricted by this constraint.

Included are any bodies to which the Constraint may apply a body force (i.e., torque or point force). The Ancestor body is not included unless it was specified as a ConstrainedBody. This is the length of the bodyForces array for this Constraint.

int getNumConstrainedMobilizers (  )  const

Return the number of mobilizers *directly* restricted by this constraint.

Included are any mobilizers to which the Constraint may apply any mobility force. Like bodies, mobilizers are referenced using the MobilizedBody containing them.

int getNumConstrainedQ ( const State  )  const

Return the sum of the number of coordinates q associated with each of the constrained mobilizers.

int getNumConstrainedQ ( const State ,
ConstrainedMobilizerIndex   
) const

Return the number of constrainable generalized coordinates q associated with a particular constrained mobilizer.

This is just the number of generalized coordinates for that mobilizer.

int getNumConstrainedU ( const State  )  const

Return the sum of the number of mobilities u associated with each of the constrained mobilizers.

These are the only mobilities to which the constraint may directly apply a force, so this is the dimension of the mobilityForces array.

int getNumConstrainedU ( const State ,
ConstrainedMobilizerIndex   
) const

Return the number of constrainable mobilities u associated with a particular constrained mobilizer.

This is just the number of generalized speeds for that mobilizer.

void getNumConstraintEquationsInUse ( const State ,
int &  mp,
int &  mv,
int &  ma 
) const

Find out how many holonomic (position), nonholonomic (velocity), and acceleration-only constraint equations are generated by this Constraint.

Vector getPositionErrorsAsVector ( const State  )  const

Get a Vector containing the position errors.

Many subclasses provide their own methods for getting this information in a more specific form.

const SimbodyMatterSubtree& getSubtree (  )  const
Vector getVelocityErrorsAsVector ( const State  )  const

Get a Vector containing the velocity errors.

Many subclasses provide their own methods for getting this information in a more specific form.

bool isDisabled ( const State  )  const
bool isDisabledByDefault (  )  const
bool isInSameSubsystem ( const MobilizedBody  )  const
bool isInSubsystem (  )  const
operator ConstraintIndex (  )  const [inline]
void setDisabledByDefault ( bool  shouldBeDisabled  ) 

Normally Constraints are enabled when defined and can be disabled later.

If you want to define this constraint but have it be off by default, use this method.

SimbodyMatterSubsystem& updMatterSubsystem (  ) 

The documentation for this class was generated from the following file:

Generated on Wed Dec 30 11:05:13 2009 for SimTKcore by  doxygen 1.6.1