OpenSim::Force Class Reference

This abstract class represents a force applied to bodies or generalized coordinates during a simulation. More...

#include <Force.h>

Inheritance diagram for OpenSim::Force:
OpenSim::ModelComponent OpenSim::Object OpenSim::Actuator OpenSim::CustomForce OpenSim::ElasticFoundationForce OpenSim::HuntCrossleyForce OpenSim::CustomActuator OpenSim::Ligament OpenSim::LinearSpring OpenSim::PrescribedForce OpenSim::SpringGeneralizedForce OpenSim::TorsionalSpring OpenSim::CoordinateActuator OpenSim::LinearActuator OpenSim::Muscle OpenSim::PointActuator OpenSim::TorqueActuator OpenSim::PassiveJointTorque OpenSim::ContDerivMuscle OpenSim::Delp1990Muscle OpenSim::Schutte1993Muscle OpenSim::Thelen2003Muscle

List of all members.

Public Member Functions

virtual void setup (Model &model)
 Subclasses may optionally override this method to perform setup.
virtual void postInit (Model &model)
 Subclasses may optionally override this method to perform setup after initSystem() has been called.
virtual int getNumStateVariables () const
 Get the number of state variables allocated by this force.
virtual std::string getStateVariableName (int index) const
 Get the name of a state variable allocated by this force.
virtual double getStateVariable (const SimTK::State &state, int index) const
 Get the value of a state variable allocated by this force.
virtual void setStateVariable (SimTK::State &state, int index, double value) const
 Set the value of a state variable allocated by this force.
virtual OpenSim::Array
< std::string > 
getRecordLabels () const
 Methods to query a Force for the value actually applied during simulation The names of the quantities (column labels) is returned by this first function getRecordLabels().
virtual OpenSim::Array< double > getRecordValues (const SimTK::State &state) const
 Given SimTK::State object extract all the values necessary to report forces, application location frame, etc.

Detailed Description

This abstract class represents a force applied to bodies or generalized coordinates during a simulation.

Each subclass represents a different type of force. The actual force computation is done by a SimTK::Force, which is created by createSimTKForce().

Author:
Peter Eastman

Member Function Documentation

int OpenSim::Force::getNumStateVariables (  )  const [virtual]

Get the number of state variables allocated by this force.

The default implementation returns 0. Subclasses that allocate state variables must override it.

Reimplemented in OpenSim::Actuator.

virtual OpenSim::Array<std::string> OpenSim::Force::getRecordLabels (  )  const [inline, virtual]

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

Reimplemented in OpenSim::CoordinateActuator, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::TorqueActuator, OpenSim::Muscle, and OpenSim::PrescribedForce.

virtual OpenSim::Array<double> OpenSim::Force::getRecordValues ( const SimTK::State &  state  )  const [inline, virtual]

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

used in conjunction with getRecordLabels and should return same size Array

Reimplemented in OpenSim::CoordinateActuator, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::TorqueActuator, OpenSim::Muscle, and OpenSim::PrescribedForce.

double OpenSim::Force::getStateVariable ( const SimTK::State &  state,
int  index 
) const [virtual]

Get the value of a state variable allocated by this force.

The default implementation throws an exception, so subclasses that allocate state variables must override it.

Parameters:
state the State for which to get the value
index the index of the state variable (0 to getNumStateVariables()-1)

Reimplemented in OpenSim::Actuator.

std::string OpenSim::Force::getStateVariableName ( int  index  )  const [virtual]

Get the name of a state variable allocated by this force.

The default implementation throws an exception, so subclasses that allocate state variables must override it.

Parameters:
index the index of the state variable (0 to getNumStateVariables()-1)

Reimplemented in OpenSim::Actuator.

virtual void OpenSim::Force::postInit ( Model model  )  [inline, virtual]

Subclasses may optionally override this method to perform setup after initSystem() has been called.

Reimplemented in OpenSim::Muscle.

void OpenSim::Force::setStateVariable ( SimTK::State &  state,
int  index,
double  value 
) const [virtual]

Set the value of a state variable allocated by this force.

The default implementation throws an exception, so subclasses that allocate state variables must override it.

Parameters:
state the State for which to set the value
index the index of the state variable (0 to getNumStateVariables()-1)
value the value to set

Reimplemented in OpenSim::Actuator.

void OpenSim::Force::setup ( Model model  )  [virtual]

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

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