OpenSim::Constraint Class Reference

A parent class for implementing a Simbody Constraint. More...

#include <Constraint.h>

Inheritance diagram for OpenSim::Constraint:
OpenSim::ModelComponent OpenSim::Object OpenSim::CoordinateCouplerConstraint OpenSim::PointConstraint OpenSim::PointOnLineConstraint OpenSim::UnilateralConstraint OpenSim::WeldConstraint OpenSim::RollingOnSurfaceConstraint

List of all members.

Public Member Functions

 Constraint ()
 Default constructor.
 Constraint (const Constraint &aConstraint)
 Copy constructor.
virtual ~Constraint ()
 Destructor.
virtual Objectcopy () const =0
 Construct and return a copy of this object.
Constraintoperator= (const Constraint &aConstraint)
 Assignment operator.
void copyData (const Constraint &aConstraint)
 Copy data members from one Constraint to another.
virtual void updateFromConstraint (SimTK::State &s, const Constraint &aConstraint)
 Update an existing Constraint with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.
virtual bool isDisabled (const SimTK::State &s) const
 Get whether or not this Constraint is disabled.
virtual bool setDisabled (SimTK::State &s, bool isDisabled)
 Set whether or not this Constraint is disabled.
virtual void calcConstraintForces (const SimTK::State &s, SimTK::Vector_< SimTK::SpatialVec > &bodyForcesInAncestor, SimTK::Vector &mobilityForces) const
 Ask the constraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities.
virtual Array< std::string > getRecordLabels () const
 Methods to query a Constraint forces (defaults to the Lagrange mulipliers) applied The names of the quantities (column labels) is returned by this first function getRecordLabels().
virtual Array< double > getRecordValues (const SimTK::State &state) const
 Given SimTK::State object extract all the values necessary to report constraint forces (multipliers) Subclasses can override to report force, application location frame, etc.
virtual void scale (const ScaleSet &aScaleSet)
virtual void setContactPointForInducedAccelerations (const SimTK::State &s, SimTK::Vec3 point)
 This method specifies the interface that a constraint must implement in order to be used by the Induced Accelerations Analysis.
 OPENSIM_DECLARE_DERIVED (Constraint, Object)

Protected Member Functions

virtual void setup (Model &aModel)
 Perform some set up functions that happen after the object has been deserialized or copied.
virtual void initState (SimTK::State &state) const
 This is called after a SimTK System and State have been created for the Model.
virtual void setDefaultsFromState (const SimTK::State &state)
 Set all default values for this object to match those in a specified State.
virtual int getNumStateVariables () const
 Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given.

Protected Attributes

PropertyBool _isDisabledProp
 Flag indicating whether the constraint is disabled or not.
SimTK::ConstraintIndex _index
 ID for the constraint in Simbody.

Friends

class SimbodyEngine

Detailed Description

A parent class for implementing a Simbody Constraint.

Specific constraints should be derived from this class.

Author:
Frank C. Anderson
Ajay Seth
Version:
1.0

Constructor & Destructor Documentation

Constraint::Constraint (  ) 

Default constructor.

Constraint::Constraint ( const Constraint aConstraint  ) 

Copy constructor.

Parameters:
aConstraint Constraint to be copied.
Constraint::~Constraint (  )  [virtual]

Destructor.


Member Function Documentation

void Constraint::calcConstraintForces ( const SimTK::State &  s,
SimTK::Vector_< SimTK::SpatialVec > &  bodyForcesInAncestor,
SimTK::Vector &  mobilityForces 
) const [virtual]

Ask the constraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities.

Parameters:
state State of model
bodyForcesInAncestor is a Vector of SpatialVecs contain constraint forces
mobilityForces is a Vector of forces that act along the constrained mobilitities associated with this constraint

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

virtual Object* OpenSim::Constraint::copy (  )  const [pure virtual]

Construct and return a copy of this object.

The object is allocated using the new operator, so the caller is responsible for deleting the returned object.

Returns:
Copy of this object.

Reimplemented from OpenSim::Object.

Implemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.

void Constraint::copyData ( const Constraint aConstraint  ) 
virtual int OpenSim::Constraint::getNumStateVariables (  )  const [inline, protected, virtual]

Gets the number of "Continuous" state variables maintained by the ModelComponent If the ModelComponent defines any that are of interest to the user, names should also be given.

Implements OpenSim::ModelComponent.

Array< std::string > Constraint::getRecordLabels (  )  const [virtual]

Methods to query a Constraint forces (defaults to the Lagrange mulipliers) applied The names of the quantities (column labels) is returned by this first function getRecordLabels().

Methods to query a Constraint forces for the value actually applied during simulation The names of the quantities (column labels) is returned by this first function getRecordLabels().

Array< double > Constraint::getRecordValues ( const SimTK::State &  state  )  const [virtual]

Given SimTK::State object extract all the values necessary to report constraint forces (multipliers) Subclasses can override to report force, application location frame, etc.

Given SimTK::State object extract all the values necessary to report constraint forces, application location frame, etc.

used in conjunction with getRecordLabels and should return same size Array

void Constraint::initState ( SimTK::State &  state  )  const [protected, virtual]

This is called after a SimTK System and State have been created for the Model.

It must be implementd to set initial values of state variables.

Parameters:
state the State to initialize

Reimplemented from OpenSim::ModelComponent.

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

bool Constraint::isDisabled ( const SimTK::State &  s  )  const [virtual]

Get whether or not this Constraint is disabled.

Simbody multibody system instance is realized every time the isDisabled changes, BUT multiple sets to the same value have no cost.

Parameters:
isDisabled If true the constraint is disabled; if false the constraint is enabled.

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

OpenSim::Constraint::OPENSIM_DECLARE_DERIVED ( Constraint  ,
Object   
)
Constraint & Constraint::operator= ( const Constraint aConstraint  ) 
virtual void OpenSim::Constraint::scale ( const ScaleSet aScaleSet  )  [inline, virtual]
virtual void OpenSim::Constraint::setContactPointForInducedAccelerations ( const SimTK::State &  s,
SimTK::Vec3  point 
) [inline, virtual]

This method specifies the interface that a constraint must implement in order to be used by the Induced Accelerations Analysis.

Reimplemented in OpenSim::PointConstraint, OpenSim::RollingOnSurfaceConstraint, and OpenSim::WeldConstraint.

void Constraint::setDefaultsFromState ( const SimTK::State &  state  )  [protected, virtual]

Set all default values for this object to match those in a specified State.

It must be implemented/overriden to set any default values defined by each subclass.

Parameters:
state the State from which to take values that should become the defaults for this object

Reimplemented from OpenSim::ModelComponent.

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

bool Constraint::setDisabled ( SimTK::State &  s,
bool  isDisabled 
) [virtual]

Set whether or not this Constraint is disabled.

Simbody multibody system instance is realized every time the isDisabled changes, BUT multiple sets to the same value have no cost.

Parameters:
isDisabled If true the constraint is disabled; if false the constraint is enabled.

Reimplemented in OpenSim::RollingOnSurfaceConstraint.

void Constraint::setup ( Model aModel  )  [protected, virtual]

Perform some set up functions that happen after the object has been deserialized or copied.

Parameters:
aModel OpenSim model containing this Constraint.

Reimplemented from OpenSim::ModelComponent.

Reimplemented in OpenSim::CoordinateCouplerConstraint, OpenSim::PointConstraint, OpenSim::PointOnLineConstraint, OpenSim::RollingOnSurfaceConstraint, OpenSim::UnilateralConstraint, and OpenSim::WeldConstraint.

void Constraint::updateFromConstraint ( SimTK::State &  s,
const Constraint aConstraint 
) [virtual]

Update an existing Constraint with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.

Parameters:
aConstraint Constraint to update from

Friends And Related Function Documentation

friend class SimbodyEngine [friend]

Member Data Documentation

SimTK::ConstraintIndex OpenSim::Constraint::_index [protected]

ID for the constraint in Simbody.

Flag indicating whether the constraint is disabled or not.

Disabled means that the constraint is not active in subsequent dynamics realizations.


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

Generated on Sun Sep 25 00:20:01 2011 for OpenSim by  doxygen 1.6.1