OpenSim::Ligament Class Reference

A class implementing a ligament. More...

#include <Ligament.h>

Inheritance diagram for OpenSim::Ligament:
OpenSim::CustomForce OpenSim::Force OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

 Ligament ()
 Default constructor.
 Ligament (const Ligament &aLigament)
 Copy constructor.
virtual ~Ligament ()
 Destructor.
virtual Objectcopy () const
 Copy this ligament and return a pointer to the copy.
Ligamentoperator= (const Ligament &aLigament)
 Assignment operator.
void copyData (const Ligament &aLigament)
 Copy data members from one ligament to another.
virtual void initState (SimTK::State &s) const
 This is called after a SimTK System and State have been created for the Model.
void initStateCache (SimTK::State &s, SimTK::SubsystemIndex subsystemIndex, Model &model)
 allocate and initialize the SimTK state for this ligament.
GeometryPathgetGeometryPath () const
virtual double getLength (const SimTK::State &s) const
 Get the length of the ligament.
virtual double getRestingLength () const
virtual bool setRestingLength (double aRestingLength)
 Set the resting length.
virtual double getMaxIsometricForce () const
virtual bool setMaxIsometricForce (double aMaxIsometricForce)
 Set the maximum isometric force.
virtual FunctiongetForceLengthCurve () const
virtual bool setForceLengthCurve (Function *aForceLengthCurve)
 Set the force-length curve.
virtual void setup (Model &aModel)
 Perform some set up functions that happen after the ligament has been deserialized or copied.
virtual void computeForce (const SimTK::State &s) const
 Subclasses must implement this method to compute the forces that should be applied to bodies and generalized speeds.
virtual void preScale (const SimTK::State &s, const ScaleSet &aScaleSet)
 Perform computations that need to happen before the ligament is scaled.
virtual void scale (const SimTK::State &s, const ScaleSet &aScaleSet)
 Scale the ligament.
virtual void postScale (const SimTK::State &s, const ScaleSet &aScaleSet)
 Perform computations that need to happen after the ligament is scaled.
 OPENSIM_DECLARE_DERIVED (Ligament, CustomForce)

Protected Attributes

PropertyObj _pathProp
GeometryPath_path
PropertyDbl _restingLengthProp
 Resting length of the ligament fibers.
double & _restingLength
PropertyDbl _pcsaForceProp
 Force for un-normalizing force-length curve (proportional to PCSA).
double & _pcsaForce
PropertyObjPtr< Function_forceLengthCurveProp
 Force-length behavior of the ligament fibers.
Function *& _forceLengthCurve

Detailed Description

A class implementing a ligament.

The path of the ligament is stored in a GeometryPath object.

Version:
1.0

Constructor & Destructor Documentation

Ligament::Ligament (  ) 

Default constructor.

Ligament::Ligament ( const Ligament aLigament  ) 

Copy constructor.

Parameters:
aLigament Ligament to be copied.
Ligament::~Ligament (  )  [virtual]

Destructor.

Delete any variables allocated using the "new" operator. You will not necessarily have any of these.


Member Function Documentation

void Ligament::computeForce ( const SimTK::State &  state  )  const [virtual]

Subclasses must implement this method to compute the forces that should be applied to bodies and generalized speeds.

Implements OpenSim::CustomForce.

Object * Ligament::copy (  )  const [virtual]

Copy this ligament and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this ligament.

Reimplemented from OpenSim::Object.

void Ligament::copyData ( const Ligament aLigament  ) 

Copy data members from one ligament to another.

Parameters:
aLigament Ligament to be copied.
virtual Function* OpenSim::Ligament::getForceLengthCurve (  )  const [inline, virtual]
GeometryPath& OpenSim::Ligament::getGeometryPath (  )  const [inline]
double Ligament::getLength ( const SimTK::State &  s  )  const [virtual]

Get the length of the ligament.

This is a convenience function that passes the request on to the ligament path.

Returns:
Current length of the ligament path.
virtual double OpenSim::Ligament::getMaxIsometricForce (  )  const [inline, virtual]
virtual double OpenSim::Ligament::getRestingLength (  )  const [inline, virtual]
void Ligament::initState ( SimTK::State &  state  )  const [virtual]

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

It may be overridden to set initial values of state variables.

Parameters:
state the State to initialize

Reimplemented from OpenSim::ModelComponent.

void Ligament::initStateCache ( SimTK::State &  s,
SimTK::SubsystemIndex  subsystemIndex,
Model model 
)

allocate and initialize the SimTK state for this ligament.

OpenSim::Ligament::OPENSIM_DECLARE_DERIVED ( Ligament  ,
CustomForce   
)
Ligament & Ligament::operator= ( const Ligament aLigament  ) 

Assignment operator.

Returns:
Reference to this ligament.

Reimplemented from OpenSim::Object.

void Ligament::postScale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [virtual]

Perform computations that need to happen after the ligament is scaled.

For this object, that entails comparing the length before and after scaling, and scaling the resting length a proportional amount.

Parameters:
aScaleSet XYZ scale factors for the bodies.
void Ligament::preScale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [virtual]

Perform computations that need to happen before the ligament is scaled.

For this object, that entails calculating and storing the length in the current body position.

Parameters:
aScaleSet XYZ scale factors for the bodies.
void Ligament::scale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [virtual]

Scale the ligament.

Parameters:
aScaleSet XYZ scale factors for the bodies
Returns:
Whether or not the ligament was scaled successfully
bool Ligament::setForceLengthCurve ( Function aForceLengthCurve  )  [virtual]

Set the force-length curve.

Parameters:
aForceLengthCurve Pointer to a force-length curve (Function).
Returns:
Whether the force-length curve was successfully changed.
bool Ligament::setMaxIsometricForce ( double  aMaxIsometricForce  )  [virtual]

Set the maximum isometric force.

Parameters:
aMaxIsometricForce The maximum isometric force of the ligament.
Returns:
Whether the maximum isometric force was successfully changed.
bool Ligament::setRestingLength ( double  aRestingLength  )  [virtual]

Set the resting length.

Parameters:
aRestingLength The resting length of the ligament.
Returns:
Whether the resting length was successfully changed.
void Ligament::setup ( Model aModel  )  [virtual]

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

Parameters:
aModel model containing this ligament.

Reimplemented from OpenSim::Force.


Member Data Documentation

Force-length behavior of the ligament fibers.

double& OpenSim::Ligament::_pcsaForce [protected]

Force for un-normalizing force-length curve (proportional to PCSA).

double& OpenSim::Ligament::_restingLength [protected]

Resting length of the ligament fibers.


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

Generated on Wed Dec 16 15:03:46 2009 for OpenSim by  doxygen 1.6.1