OpenSim::Model Class Reference

A concrete class that specifies the interface to a musculoskeletal model. More...

#include <Model.h>

Inheritance diagram for OpenSim::Model:
OpenSim::ModelComponent OpenSim::Object

List of all members.

Classes

class  DefaultGeometry

Public Member Functions

 Model ()
 Default constructor.
 Model (const std::string &aFileName) SWIG_DECLARE_EXCEPTION
 Constructor from an XML file.
 Model (const Model &aModel)
 Copy constructor.
virtual ~Model ()
 Destructor.
virtual void updateFromXMLNode ()
 Override of the default implementation to account for versioning.
virtual Objectcopy () const
 Copy this Model and return a pointer to the copy.
void copyData (const Model &aModel)
 Copy the member variables of the model.
void setupProperties ()
 Connect properties to local pointers.
Modelclone ()
 Dynamic casting across JNI is messy.
virtual void setup () SWIG_DECLARE_EXCEPTION
 Perform some set up functions that happen after the object has been deserialized.
void cleanup ()
 Perform some clean up functions that are normally done from the destructor however this gives the GUI a way to proactively do the cleaning without waiting for garbage collection to do the actual cleanup.
SimTK::State & initSystem () SWIG_DECLARE_EXCEPTION
 This must be called after the Model is fully created but before starting a simulation.
virtual void setDefaultsFromState (const SimTK::State &state)
 Given a State, set all default values for this Model to match those found in the State.
void initStateWithoutRecreatingSystem (SimTK::State &state) const
 This is called after the Model is fully created but before starting a simulation.
void invalidateSystem ()
 Mark the computational system as invalid.
bool isValidSystem ()
 Check that the underlying computational system representing the model is valid.
void formStateStorage (const Storage &originalStorage, Storage &statesStorage)
 create a storage (statesStorage) that has same label order as model's states with values populated from originalStorage, 0.0 for those states unspecified in the originalStorage.
void formQStorage (const Storage &originalStorage, Storage &qStorage)
 Model::formStateStorage is intended to take any storage and populate qStorage.
void updateAssemblyConditions (SimTK::State &s)
 Update the AssemblySolver to the latest coordinate locking/constraints.
void assemble (SimTK::State &state, const Coordinate *coord=NULL, double weight=10)
 Find the kinematic state of the model that satisfies constraints and coordinate goals If assemble is being called due to a coordinate set value, provide the option to weight that coordinate value more heavily if specified.
void equilibrateMuscles (SimTK::State &state)
 Update the state of all Muscles so they are in equilibrium.
const
SimTK::SimbodyMatterSubsystem & 
getMatterSubsystem () const
SimTK::SimbodyMatterSubsystem & updMatterSubsystem ()
const SimTK::Force::Gravity & getGravityForce () const
SimTK::Force::Gravity & updGravityForce ()
const
SimTK::GeneralForceSubsystem & 
getForceSubsystem () const
SimTK::GeneralForceSubsystem & updForceSubsystem ()
const SimTK::DecorationSubsystem & getDecorationSubsystem () const
SimTK::DecorationSubsystem & updDecorationSubsystem ()
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.
virtual void addBody (Body *aBody)
 Add ModelComponents to the Model.
virtual void addConstraint (Constraint *aConstraint)
 Add a constraint to the Model.
virtual void addForce (Force *aForce)
 Add a force to the Model.
virtual void addContactGeometry (ContactGeometry *aContactGeometry)
 Add a contact geometry to the Model.
void addModelComponent (const ModelComponent *aComponent)
virtual const std::string & getInputFileName () const
 Get the XML file name used to construct the model.
virtual void setInputFileName (const std::string &fileName)
 Set the XML file name used to construct the model.
virtual const std::string & getCredits () const
 Get the credits (e.g., model author names) associated with the model.
virtual void setAuthors (const std::string &aCredits)
 Set the credits (e.g., model author names) associated with the model.
virtual const std::string & getPublications () const
 Get the publications associated with the model.
virtual void setPublications (const std::string &aPublications)
 Set the publications associated with the model.
virtual const UnitsgetLengthUnits () const
 Get the length units associated with the model.
virtual const UnitsgetForceUnits () const
 Get the force units associated with the model.
virtual const
SimTK::MultibodySystem & 
getMultibodySystem () const
virtual SimTK::MultibodySystem & updMultibodySystem () const
virtual SimTK::Vec3 getGravity () const
 Get the gravity vector in the gloabl frame.
virtual bool setGravity (const SimTK::Vec3 &aGrav)
 Set the gravity vector in the gloabl frame.
virtual int getNumStates (bool includeSimTKStates=false) const
 Get the number of states in the model.
virtual int getNumMarkers () const
 Get the number of markers in the model.
virtual int getNumContactGeometries () const
 Get the number of ContactGeometries in the model.
virtual int getNumBodies () const
 Get the total number of bodies in the model.
virtual int getNumJoints () const
 Get the total number of joints in the model.
virtual int getNumCoordinates () const
 Get the total number of coordinates in the model.
virtual int getNumSpeeds () const
 Get the total number of speeds in the model.
const Set< Actuator > & getActuators () const
 Get the subset of Forces in the model which are actuators.
Set< Actuator > & updActuators ()
const Set< Muscle > & getMuscles () const
 Get the subset of Forces in the model which are muscles.
Set< Muscle > & updMuscles ()
const ForceSetgetForceSet () const
ForceSetupdForceSet ()
virtual int getNumAnalyses () const
 Get the number of analyses in the model.
int getNumControls () const
 Get the number of controls for this the model.
SimTK::Vector & updDefaultControls () const
 Writable access to the default values for controls.
const SimTK::Vector & getDefaultControls () const
SimTK::Vector & updControls (const SimTK::State &s) const
 Update the controls for this the model at a given state.
const SimTK::Vector & getControls (const SimTK::State &s) const
 Const access to controls does not invalidate dynamics.
virtual void computeControls (const SimTK::State &s, SimTK::Vector &controls) const
 Compute the controls the model Calls down to the Controllers to make their contributions to the controls.
bool isControlled () const
 Get a flag indicating if the model needs controls to operate its actuators.
virtual void storeControls (const SimTK::State &s, int step)
virtual void printControlStorage (const std::string &fileName) const
virtual const ControllerSetgetControllerSet () const
virtual ControllerSetupdControllerSet ()
virtual bool getAllControllersEnabled () const
virtual void setAllControllersEnabled (bool enabled)
virtual void applyDefaultConfiguration (SimTK::State &s)
 Apply the default configuration to the model.
const SimbodyEnginegetSimbodyEngine () const
 Get the model's dynamics engine.
SimbodyEngineupdSimbodyEngine ()
virtual void getStateNames (Array< std::string > &rStateNames, bool includeInternalStates=false) const
 Get the names of the states.
virtual void getStateValues (const SimTK::State &s, Array< double > &rStateValues) const
 Get the values of state variables in the same ordering as getStateNames.
virtual void setStateValues (SimTK::State &s, double *aStateValues) const
 Set the values of state variables (passed in the same ordering as getStateNames).
int getNumMuscleStates () const
 Get the number of Muscle state variabls in the model.
virtual void setInitialTime (double ti)
virtual CoordinateSetupdCoordinateSet ()
virtual const CoordinateSetgetCoordinateSet () const
virtual BodySetupdBodySet ()
virtual const BodySetgetBodySet () const
virtual JointSetupdJointSet ()
 Get a flat list of Joints contained in the model.
virtual const JointSetgetJointSet ()
virtual AnalysisSetupdAnalysisSet ()
virtual const AnalysisSetgetAnalysisSet () const
virtual ContactGeometrySetupdContactGeometrySet ()
virtual const ContactGeometrySetgetContactGeometrySet () const
virtual BodygetGroundBody () const
 Get the body that is being used as ground.
virtual ConstraintSetupdConstraintSet ()
virtual const ConstraintSetgetConstraintSet () const
virtual MarkerSetupdMarkerSet ()
virtual const MarkerSetgetMarkerSet () const
virtual int replaceMarkerSet (const SimTK::State &s, MarkerSet &aMarkerSet)
 Replace all markers in the model with the ones in the passed-in marker set.
virtual void writeMarkerFile (const std::string &aFileName) const
virtual void updateMarkerSet (MarkerSet &aMarkerSet)
 Update all markers in the model with the ones in the passed-in marker set.
virtual int deleteUnusedMarkers (const Array< std::string > &aMarkerNames)
virtual void addAnalysis (Analysis *aAnalysis)
 Add an analysis to the model.
virtual void addController (Controller *aController)
 Add a controller to the Model.
virtual void removeAnalysis (Analysis *aAnalysis, bool deleteIt=true)
 Remove an analysis from the model.
virtual void removeController (Controller *aController)
 Remove a controller from the model.
virtual void computeEquilibriumForAuxiliaryStates (SimTK::State &s)
 Compute values for the auxiliary states (i.e., states other than the generalized coordinates and speeds) that are in quasi-static equilibrium.
virtual bool scale (SimTK::State &s, const ScaleSet &aScaleSet, double aFinalMass=-1.0, bool aPreserveMassDist=false)
 Scale the model.
void printBasicInfo (std::ostream &aOStream) const
 Print some basic information about the model.
void printDetailedInfo (const SimTK::State &s, std::ostream &aOStream) const
 Print detailed information about the model.
void disownAllComponents ()
 Model relinquishes ownership of all components such as: Bodies, Constraints, Forces, ConactGeometry and so on.
void overrideAllActuators (SimTK::State &s, bool flag)
 Convenice function to turn on/off overriding the force for all actuators.
const std::string & getValidationLog ()
 Get a log of errors/warnings ecountered when loading/constructing the model.
void clearValidationLog ()
const ObjectgetObjectByTypeAndName (const std::string &typeString, const std::string &nameString) SWIG_DECLARE_EXCEPTION
 Utility to get a reference to an Object based on its name and type throws an exception if the object was not found.

Protected Member Functions

Modeloperator= (const Model &Model)
 Assignment operator.
void setDefaultProperties ()
virtual void setup (Model &aModel)
virtual void createSystem (SimTK::MultibodySystem &system) const
 This is called when a SimTK System is being created for the Model.
virtual void createSystem ()
 Create the multibody system.
virtual void initState (SimTK::State &state) const
 This is called after a SimTK System and State have been created for the Model.
void createGroundBodyIfNecessary ()
 Create a ground body if necessary.

Friends

class ForceSet

Detailed Description

A concrete class that specifies the interface to a musculoskeletal model.

It provides methods create a new model and to add model components and to define their default behavior for simulation.

Authors:
Frank C. Anderson, Peter Loan, Ajay Seth
Version:
1.0

Constructor & Destructor Documentation

Model::Model (  ) 

Default constructor.

OpenSim::Model::Model ( const std::string &  aFileName  ) 

Constructor from an XML file.

Parameters:
aFileName XML file name.
Model::Model ( const Model aModel  ) 

Copy constructor.

Parameters:
aModel Model to be copied.
Model::~Model (  )  [virtual]

Destructor.


Member Function Documentation

void Model::addAnalysis ( Analysis aAnalysis  )  [virtual]

Add an analysis to the model.

Parameters:
aAnalysis pointer to the analysis to add
void Model::addBody ( OpenSim::Body aBody  )  [virtual]

Add ModelComponents to the Model.

Add a body to the Model.

Model takes ownership of the objects.

void Model::addConstraint ( OpenSim::Constraint aConstraint  )  [virtual]

Add a constraint to the Model.

void Model::addContactGeometry ( OpenSim::ContactGeometry aContactGeometry  )  [virtual]

Add a contact geometry to the Model.

void Model::addController ( Controller aController  )  [virtual]

Add a controller to the Model.

void Model::addForce ( OpenSim::Force aForce  )  [virtual]

Add a force to the Model.

void OpenSim::Model::addModelComponent ( const ModelComponent aComponent  )  [inline]
void Model::applyDefaultConfiguration ( SimTK::State &  s  )  [virtual]

Apply the default configuration to the model.

This means setting the generalized coordinates and spees to their default values.

void Model::assemble ( SimTK::State &  state,
const Coordinate coord = NULL,
double  weight = 10 
)

Find the kinematic state of the model that satisfies constraints and coordinate goals If assemble is being called due to a coordinate set value, provide the option to weight that coordinate value more heavily if specified.

void Model::cleanup (  ) 

Perform some clean up functions that are normally done from the destructor however this gives the GUI a way to proactively do the cleaning without waiting for garbage collection to do the actual cleanup.

void OpenSim::Model::clearValidationLog (  )  [inline]
Model* OpenSim::Model::clone (  )  [inline]

Dynamic casting across JNI is messy.

This method does the upCasting on C++ side

void Model::computeControls ( const SimTK::State &  s,
SimTK::Vector &  controls 
) const [virtual]

Compute the controls the model Calls down to the Controllers to make their contributions to the controls.

Compute the controls the model.

Parameters:
s system state
writable model controls
void Model::computeEquilibriumForAuxiliaryStates ( SimTK::State &  s  )  [virtual]

Compute values for the auxiliary states (i.e., states other than the generalized coordinates and speeds) that are in quasi-static equilibrium.

_____________________________________________________________________________ /** Compute values for the auxiliary states (i.e., states other than the generalized coordinates and speeds) that are in quasi-static equilibrium.

The auxiliary states usually belong to the actuators (e.g., muscle activation and muscle fiber length). The equilibrium computations are passed on to the owner of the the states.

This methods is useful for computing initial conditions for a simulation or for computing torque-angle curves, for example.

Parameters:
rY Array of states. The values sent in are used as the initial guess for equilibrium. The values returned are those that satisfy equilibrium.
Object * Model::copy (  )  const [virtual]

Copy this Model and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this Model.

Reimplemented from OpenSim::Object.

void Model::copyData ( const Model aModel  ) 

Copy the member variables of the model.

Parameters:
aModel model to be copied
void Model::createGroundBodyIfNecessary (  )  [protected]

Create a ground body if necessary.

void Model::createSystem (  )  [protected, virtual]

Create the multibody system.

virtual void OpenSim::Model::createSystem ( SimTK::MultibodySystem &  system  )  const [inline, protected, virtual]

This is called when a SimTK System is being created for the Model.

It must be implemented to add appropriate elements to the System corresponding to this object. Methods for adding modeling options, state variables and their derivatives, discrete variables, as well must be called with createSystem() only.

Parameters:
system the System being created

Reimplemented from OpenSim::ModelComponent.

virtual int OpenSim::Model::deleteUnusedMarkers ( const Array< std::string > &  aMarkerNames  )  [virtual]
void Model::disownAllComponents (  ) 

Model relinquishes ownership of all components such as: Bodies, Constraints, Forces, ConactGeometry and so on.

That means the freeing of the memory of these objects is up to the caller.

void Model::equilibrateMuscles ( SimTK::State &  state  ) 

Update the state of all Muscles so they are in equilibrium.

void Model::formQStorage ( const Storage originalStorage,
Storage qStorage 
)

Model::formStateStorage is intended to take any storage and populate qStorage.

stateStorage is supposed to be a Storage with labels identical to those obtained by calling Model::getStateNames(). Columns/entries found in the "originalStorage" are copied to the output qStorage. Entries not found are populated with 0s.

void Model::formStateStorage ( const Storage originalStorage,
Storage statesStorage 
)

create a storage (statesStorage) that has same label order as model's states with values populated from originalStorage, 0.0 for those states unspecified in the originalStorage.

Model::formStateStorage is intended to take any storage and populate stateStorage.

stateStorage is supposed to be a Storage with labels identical to those obtained by calling Model::getStateNames(). Columns/entries found in the "originalStorage" are copied to the output statesStorage. Entries not found are populated with 0s.

const Set< Actuator > & Model::getActuators (  )  const

Get the subset of Forces in the model which are actuators.

Returns:
The set of Actuators
bool Model::getAllControllersEnabled (  )  const [virtual]
virtual const AnalysisSet& OpenSim::Model::getAnalysisSet (  )  const [inline, virtual]
virtual const BodySet& OpenSim::Model::getBodySet (  )  const [inline, virtual]
virtual const ConstraintSet& OpenSim::Model::getConstraintSet (  )  const [inline, virtual]
virtual const ContactGeometrySet& OpenSim::Model::getContactGeometrySet (  )  const [inline, virtual]
const ControllerSet & Model::getControllerSet (  )  const [virtual]
const Vector & Model::getControls ( const SimTK::State &  s  )  const

Const access to controls does not invalidate dynamics.

virtual const CoordinateSet& OpenSim::Model::getCoordinateSet (  )  const [inline, virtual]
virtual const std::string& OpenSim::Model::getCredits (  )  const [inline, virtual]

Get the credits (e.g., model author names) associated with the model.

Returns:
Credits string.
const SimTK::DecorationSubsystem& OpenSim::Model::getDecorationSubsystem (  )  const [inline]
const SimTK::Vector& OpenSim::Model::getDefaultControls (  )  const [inline]
const ForceSet& OpenSim::Model::getForceSet (  )  const [inline]
const SimTK::GeneralForceSubsystem& OpenSim::Model::getForceSubsystem (  )  const [inline]
virtual const Units& OpenSim::Model::getForceUnits (  )  const [inline, virtual]

Get the force units associated with the model.

Returns:
Force units
SimTK::Vec3 Model::getGravity (  )  const [virtual]

Get the gravity vector in the gloabl frame.

Parameters:
rGrav The XYZ gravity vector in the global frame is returned here.
Returns:
the XYZ gravity vector in the global frame is returned here.
const SimTK::Force::Gravity& OpenSim::Model::getGravityForce (  )  const [inline]
OpenSim::Body & Model::getGroundBody (  )  const [virtual]

Get the body that is being used as ground.

Returns:
Pointer to the ground body.
virtual const std::string& OpenSim::Model::getInputFileName (  )  const [inline, virtual]

Get the XML file name used to construct the model.

Returns:
XML file name string.
const JointSet & Model::getJointSet (  )  [virtual]
virtual const Units& OpenSim::Model::getLengthUnits (  )  const [inline, virtual]

Get the length units associated with the model.

Returns:
Length units.
virtual const MarkerSet& OpenSim::Model::getMarkerSet (  )  const [inline, virtual]
const SimTK::SimbodyMatterSubsystem& OpenSim::Model::getMatterSubsystem (  )  const [inline]
virtual const SimTK::MultibodySystem& OpenSim::Model::getMultibodySystem (  )  const [inline, virtual]
const Set< Muscle > & Model::getMuscles (  )  const

Get the subset of Forces in the model which are muscles.

Returns:
The set of Muscles
int Model::getNumAnalyses (  )  const [virtual]

Get the number of analyses in the model.

Returns:
The number of analyses.
The number of analyses
int Model::getNumBodies (  )  const [virtual]

Get the total number of bodies in the model.

Returns:
Number of bodies.
int Model::getNumContactGeometries (  )  const [virtual]

Get the number of ContactGeometries in the model.

Get the number of ContactGeometry objects in the model.

Returns:
Number of ContactGeometries.
int Model::getNumControls (  )  const

Get the number of controls for this the model.

Only valid once underlying system for the model has been created. Throws an exception if called before Model::initSystem()

Returns:
number of controls corresponding to all the actuators in the model

Throws an exception if called before Model::initSystem()

int Model::getNumCoordinates (  )  const [virtual]

Get the total number of coordinates in the model.

Returns:
Number of coordinates.
int Model::getNumJoints (  )  const [virtual]

Get the total number of joints in the model.

Returns:
Number of joints.
int Model::getNumMarkers (  )  const [virtual]

Get the number of markers in the model.

Returns:
Number of markers.
int Model::getNumMuscleStates (  )  const

Get the number of Muscle state variabls in the model.

Returns:
Number of MuscleStates.
int Model::getNumSpeeds (  )  const [virtual]

Get the total number of speeds in the model.

Get the total number of coordinates = number of speeds in the model.

Returns:
Number of speeds.
Number of coordinates.
int Model::getNumStates ( bool  includeSimTKStates = false  )  const [virtual]

Get the number of states in the model.

Returns:
Number of states.
int Model::getNumStateVariables (  )  const [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.

const Object & Model::getObjectByTypeAndName ( const std::string &  typeString,
const std::string &  nameString 
)

Utility to get a reference to an Object based on its name and type throws an exception if the object was not found.

names are case sensitive

Parameters:
typeString the type of object being looked up (Body, Force, Constraint, Coordinate, Joint, Marker, Controller)
nameString the name of the object being looked up
Returns:
reference to the object if found or throws an exception.
virtual const std::string& OpenSim::Model::getPublications (  )  const [inline, virtual]

Get the publications associated with the model.

Returns:
Publications string.
const SimbodyEngine& OpenSim::Model::getSimbodyEngine (  )  const [inline]

Get the model's dynamics engine.

Returns:
Reference to the Simbody dynamics engine
virtual void OpenSim::Model::getStateNames ( Array< std::string > &  rStateNames,
bool  includeInternalStates = false 
) const [virtual]

Get the names of the states.

These are the continuous states introduced by OpenSim ModelComponents and exposed thru the ModelComponent API. Other internal SimTK states may exist, but we have no way to name them or access them otherwise..

Parameters:
rStateNames Array of state names..
void Model::getStateValues ( const SimTK::State &  s,
Array< double > &  rStateValues 
) const [virtual]

Get the values of state variables in the same ordering as getStateNames.

values are dug out from the passed in State object based on pre-stored Yindices

Parameters:
const SimTK::State& s state to be queried..
rStatValues Array of state values..
const std::string& OpenSim::Model::getValidationLog (  )  [inline]

Get a log of errors/warnings ecountered when loading/constructing the model.

void Model::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.

void OpenSim::Model::initStateWithoutRecreatingSystem ( SimTK::State &  state  )  const [inline]

This is called after the Model is fully created but before starting a simulation.

It ONLY initializes the computational system used to simulate the model and createSystem() has been called already. This method should only be used if if additional SimTK::System components are being added using the SimTK API and the programmer is certain that the model's system has been created.

SimTK::State & Model::initSystem (  ) 

This must be called after the Model is fully created but before starting a simulation.

It creates and initializes the computational system used to simulate the model.

void Model::invalidateSystem (  ) 

Mark the computational system as invalid.

This should be called whenever a property of the model is modified. Once this has been called, no calculations can be done until initSystem() is called again.

bool Model::isControlled (  )  const

Get a flag indicating if the model needs controls to operate its actuators.

bool Model::isValidSystem (  ) 

Check that the underlying computational system representing the model is valid.

That is, is the system ready for performing calculations.

Model & Model::operator= ( const Model aModel  )  [protected]

Assignment operator.

Register the types used by this class.

Returns:
Reference to this object.

void Model::registerTypes() { now handled by RegisterTypes_osimSimulation() } Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::ModelComponent.

void Model::overrideAllActuators ( SimTK::State &  s,
bool  flag 
)

Convenice function to turn on/off overriding the force for all actuators.

void Model::printBasicInfo ( std::ostream &  aOStream  )  const

Print some basic information about the model.

Parameters:
aOStream Output stream.
virtual void OpenSim::Model::printControlStorage ( const std::string &  fileName  )  const [virtual]
void Model::printDetailedInfo ( const SimTK::State &  s,
std::ostream &  aOStream 
) const

Print detailed information about the model.

Parameters:
aOStream Output stream.
void Model::removeAnalysis ( Analysis aAnalysis,
bool  deleteIt = true 
) [virtual]

Remove an analysis from the model.

Parameters:
aAnalysis Pointer to the analysis to remove.
aAnalysis Pointer to the analysis to remove. If deleteIt is true (default) the Analysis object itself is destroyed else only removed from te list which is the desired behavior when the Analysis is created from the GUI.
void Model::removeController ( Controller aController  )  [virtual]

Remove a controller from the model.

Parameters:
aController Pointer to the controller to remove.
int Model::replaceMarkerSet ( const SimTK::State &  s,
MarkerSet aMarkerSet 
) [virtual]

Replace all markers in the model with the ones in the passed-in marker set.

Parameters:
aMarkerSet The new marker set.
Returns:
Number of markers that were successfully added to the model.
bool Model::scale ( SimTK::State &  s,
const ScaleSet aScaleSet,
double  aFinalMass = -1.0,
bool  aPreserveMassDist = false 
) [virtual]

Scale the model.

Parameters:
aScaleSet the set of XYZ scale factors for the bodies
aFinalMass the mass that the scaled model should have
aPreserveMassDist whether or not the masses of the individual bodies should be scaled with the body scale factors.
Returns:
Whether or not scaling was successful.
void Model::setAllControllersEnabled ( bool  enabled  )  [virtual]
virtual void OpenSim::Model::setAuthors ( const std::string &  aCredits  )  [inline, virtual]

Set the credits (e.g., model author names) associated with the model.

Parameters:
aCredits The string of credits.
void Model::setDefaultProperties (  )  [protected]
void Model::setDefaultsFromState ( const SimTK::State &  state  )  [virtual]

Given a State, set all default values for this Model to match those found in the State.

Reimplemented from OpenSim::ModelComponent.

bool Model::setGravity ( const SimTK::Vec3 &  aGrav  )  [virtual]

Set the gravity vector in the gloabl frame.

Parameters:
aGrav The XYZ gravity vector
Returns:
Whether or not the gravity vector was successfully set.
Parameters:
aGrav the XYZ gravity vector
Returns:
Whether or not the gravity vector was successfully set.
void Model::setInitialTime ( double  ti  )  [virtual]
virtual void OpenSim::Model::setInputFileName ( const std::string &  fileName  )  [inline, virtual]

Set the XML file name used to construct the model.

Parameters:
fileName The XML file name.
virtual void OpenSim::Model::setPublications ( const std::string &  aPublications  )  [inline, virtual]

Set the publications associated with the model.

Parameters:
aPublications The string of publications.
void Model::setStateValues ( SimTK::State &  s,
double *  aStateValues 
) const [virtual]

Set the values of state variables (passed in the same ordering as getStateNames).

values are set on the passed in State object based on pre-stored Yindices

Parameters:
const SimTK::State& s state to be queried..
aStatValues Array of state values to be set on s..
virtual void OpenSim::Model::setup ( Model aModel  )  [inline, protected, virtual]
void Model::setup (  )  [virtual]

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

TODO: this method is not yet designed to be called after a model has been copied.

This method is not yet designed to be called after a model has been copied.

void Model::setupProperties ( void   ) 

Connect properties to local pointers.

Reimplemented from OpenSim::Object.

void Model::storeControls ( const SimTK::State &  s,
int  step 
) [virtual]
Set< Actuator > & Model::updActuators (  ) 
virtual AnalysisSet& OpenSim::Model::updAnalysisSet (  )  [inline, virtual]
void Model::updateAssemblyConditions ( SimTK::State &  s  ) 

Update the AssemblySolver to the latest coordinate locking/constraints.

void Model::updateFromXMLNode (  )  [virtual]

Override of the default implementation to account for versioning.

Override default implementation by object to intercept and fix the XML node underneath the model to match current version.

Reimplemented from OpenSim::Object.

void Model::updateMarkerSet ( MarkerSet aMarkerSet  )  [virtual]

Update all markers in the model with the ones in the passed-in marker set.

If the marker does not yet exist in the model, it is added.

Parameters:
aMarkerSet set of markers to be updated/added
virtual BodySet& OpenSim::Model::updBodySet (  )  [inline, virtual]
virtual ConstraintSet& OpenSim::Model::updConstraintSet (  )  [inline, virtual]
virtual ContactGeometrySet& OpenSim::Model::updContactGeometrySet (  )  [inline, virtual]
ControllerSet & Model::updControllerSet (  )  [virtual]
Vector & Model::updControls ( const SimTK::State &  s  )  const

Update the controls for this the model at a given state.

Only valid once underlying system for the model has been created. Throws an exception if called before Model::initSystem() This call invalidates the dynamics of the model.

Returns:
writable controls Vector

Throws an exception if called before Model::initSystem()

virtual CoordinateSet& OpenSim::Model::updCoordinateSet (  )  [inline, virtual]
SimTK::DecorationSubsystem& OpenSim::Model::updDecorationSubsystem (  )  [inline]
SimTK::Vector& OpenSim::Model::updDefaultControls (  )  const [inline]

Writable access to the default values for controls.

These values are used for control value during a simulation unless updated, for example, by a Controller

ForceSet& OpenSim::Model::updForceSet (  )  [inline]
SimTK::GeneralForceSubsystem& OpenSim::Model::updForceSubsystem (  )  [inline]
SimTK::Force::Gravity& OpenSim::Model::updGravityForce (  )  [inline]
JointSet & Model::updJointSet (  )  [virtual]

Get a flat list of Joints contained in the model.

virtual MarkerSet& OpenSim::Model::updMarkerSet (  )  [inline, virtual]
SimTK::SimbodyMatterSubsystem& OpenSim::Model::updMatterSubsystem (  )  [inline]
virtual SimTK::MultibodySystem& OpenSim::Model::updMultibodySystem (  )  const [inline, virtual]
Set< Muscle > & Model::updMuscles (  ) 
SimbodyEngine& OpenSim::Model::updSimbodyEngine (  )  [inline]
virtual void OpenSim::Model::writeMarkerFile ( const std::string &  aFileName  )  const [virtual]

Friends And Related Function Documentation

friend class ForceSet [friend]

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

Generated on Sun Sep 25 00:19:59 2011 for OpenSim by  doxygen 1.6.1