This abstract class represents a force applied to bodies or generalized coordinates during a simulation. More...
#include <Force.h>
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. |
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().
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.
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.
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.
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] |
Subclasses may optionally override this method to perform setup.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::SpringGeneralizedForce, OpenSim::Thelen2003Muscle, OpenSim::TorqueActuator, OpenSim::Actuator, OpenSim::Ligament, and OpenSim::Muscle.