A class implementing a ligament. More...
#include <Ligament.h>
Public Member Functions | |
Ligament () | |
Default constructor. | |
Ligament (const Ligament &aLigament) | |
Copy constructor. | |
virtual | ~Ligament () |
Destructor. | |
virtual Object * | copy () const |
Copy this ligament and return a pointer to the copy. | |
Ligament & | operator= (const Ligament &aLigament) |
Assignment operator. | |
void | copyData (const Ligament &aLigament) |
Copy data members from one ligament to another. | |
GeometryPath & | getGeometryPath () const |
virtual bool | hasGeometryPath () const |
return a flag indicating whether the Force is applied along a Path if you override this method to return true for a specific subclass, it must also implement the getGeometryPath() mathod | |
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 Function * | getForceLengthCurve () const |
virtual bool | setForceLengthCurve (Function *aForceLengthCurve) |
Set the force-length curve. | |
virtual double | computeMomentArm (SimTK::State &s, Coordinate &aCoord) const |
Compute the moment-arm of this muscle about a coordinate. | |
virtual void | computeForce (const SimTK::State &s, SimTK::Vector_< SimTK::SpatialVec > &bodyForces, SimTK::Vector &generalizedForces) 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. | |
virtual VisibleObject * | getDisplayer () const |
Get the visible object used to represent the Ligament. | |
virtual void | updateDisplayer (const SimTK::State &s) |
Update the visible object used to represent the Ligament. | |
OPENSIM_DECLARE_DERIVED (Ligament, Force) | |
Protected Member Functions | |
virtual void | setup (Model &aModel) |
Perform some set up functions that happen after the ligament has been deserialized or copied. | |
virtual void | createSystem (SimTK::MultibodySystem &system) const |
allocate and initialize the SimTK state for this ligament. | |
virtual void | initState (SimTK::State &s) const |
This is called after a SimTK System and State have been created for the Model. | |
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 |
A class implementing a ligament.
The path of the ligament is stored in a GeometryPath object.
Ligament::Ligament | ( | ) |
Default constructor.
Ligament::Ligament | ( | const Ligament & | aLigament | ) |
Copy constructor.
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.
void Ligament::computeForce | ( | const SimTK::State & | state, | |
SimTK::Vector_< SimTK::SpatialVec > & | bodyForces, | |||
SimTK::Vector & | generalizedForces | |||
) | const [virtual] |
Subclasses must implement this method to compute the forces that should be applied to bodies and generalized speeds.
This is invoked by ForceAdapter to perform the force computation.
Reimplemented from OpenSim::Force.
double Ligament::computeMomentArm | ( | SimTK::State & | s, | |
Coordinate & | aCoord | |||
) | const [virtual] |
Compute the moment-arm of this muscle about a coordinate.
Object * Ligament::copy | ( | ) | const [virtual] |
Copy this ligament and return a pointer to the copy.
The copy constructor for this class is used.
Implements OpenSim::Force.
void Ligament::copyData | ( | const Ligament & | aLigament | ) |
Copy data members from one ligament to another.
aLigament | Ligament to be copied. |
Reimplemented from OpenSim::Force.
void Ligament::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [protected, virtual] |
allocate and initialize the SimTK state for this ligament.
Reimplemented from OpenSim::Force.
VisibleObject * Ligament::getDisplayer | ( | ) | const [virtual] |
Get the visible object used to represent the Ligament.
Reimplemented from OpenSim::Object.
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.
virtual double OpenSim::Ligament::getMaxIsometricForce | ( | ) | const [inline, virtual] |
virtual double OpenSim::Ligament::getRestingLength | ( | ) | const [inline, virtual] |
virtual bool OpenSim::Ligament::hasGeometryPath | ( | ) | const [inline, virtual] |
return a flag indicating whether the Force is applied along a Path if you override this method to return true for a specific subclass, it must also implement the getGeometryPath() mathod
Reimplemented from OpenSim::Force.
void Ligament::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.
state | the State to initialize |
Reimplemented from OpenSim::Force.
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.
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.
aScaleSet | XYZ scale factors for the bodies. |
void Ligament::scale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [virtual] |
Scale the ligament.
aScaleSet | XYZ scale factors for the bodies |
bool Ligament::setForceLengthCurve | ( | Function * | aForceLengthCurve | ) | [virtual] |
bool Ligament::setMaxIsometricForce | ( | double | aMaxIsometricForce | ) | [virtual] |
Set the maximum isometric force.
aMaxIsometricForce | The maximum isometric force of the ligament. |
bool Ligament::setRestingLength | ( | double | aRestingLength | ) | [virtual] |
Set the resting length.
aRestingLength | The resting length of the ligament. |
void Ligament::setup | ( | Model & | aModel | ) | [protected, virtual] |
Perform some set up functions that happen after the ligament has been deserialized or copied.
aModel | model containing this ligament. |
Reimplemented from OpenSim::Force.
void Ligament::updateDisplayer | ( | const SimTK::State & | s | ) | [virtual] |
Update the visible object used to represent the Ligament.
Reimplemented from OpenSim::ModelComponent.
Function*& OpenSim::Ligament::_forceLengthCurve [protected] |
Force-length behavior of the ligament fibers.
GeometryPath& OpenSim::Ligament::_path [protected] |
PropertyObj OpenSim::Ligament::_pathProp [protected] |
double& OpenSim::Ligament::_pcsaForce [protected] |
PropertyDbl OpenSim::Ligament::_pcsaForceProp [protected] |
Force for un-normalizing force-length curve (proportional to PCSA).
double& OpenSim::Ligament::_restingLength [protected] |
PropertyDbl OpenSim::Ligament::_restingLengthProp [protected] |
Resting length of the ligament fibers.