This applies a force and/or torque to a body which is fully specified as a function of time. More...
#include <PrescribedForce.h>
Public Member Functions | |
PrescribedForce (OpenSim::Body *body=0) | |
Construct a PrescribedForce. | |
PrescribedForce (const PrescribedForce &force) | |
Copy constructor. | |
PrescribedForce (DOMElement *aNode) | |
Constructor from XML file. | |
~PrescribedForce () | |
Destructor. | |
virtual Object * | copy () const |
Copy this force and return a pointer to the copy. | |
virtual void | updateFromXMLNode () |
Update this object based on its XML node. | |
void | setBodyName (const std::string &aBodyName) |
const std::string & | getBodyName () const |
void | setForceFunctions (Function *forceX, Function *forceY, Function *forceZ) |
Set the functions which specify the force to apply. | |
const FunctionSet & | getForceFunctions () const |
FunctionSet & | updForceFunctions () |
void | getForceFunctionNames (OpenSim::Array< std::string > &aFunctionNames) |
void | setForceFunctionNames (const OpenSim::Array< std::string > &aFunctionNames, const OpenSim::Storage &kineticsStore) |
void | clearForceFunctions () |
void | setPointFunctions (Function *pointX, Function *pointY, Function *pointZ) |
Set the functions which specify the point at which to apply the force. | |
const FunctionSet & | getPointFunctions () const |
FunctionSet & | updPointFunctions () |
void | getPointFunctionNames (OpenSim::Array< std::string > &aFunctionNames) |
void | setPointFunctionNames (const OpenSim::Array< std::string > &aFunctionNames, const OpenSim::Storage &kineticsStore) |
void | clearPointFunctions () |
void | setTorqueFunctions (Function *torqueX, Function *torqueY, Function *torqueZ) |
Set the functions which specify the torque to apply. | |
const FunctionSet & | getTorqueFunctions () const |
FunctionSet & | updTorqueFunctions () |
void | getTorqueFunctionNames (OpenSim::Array< std::string > &aFunctionNames) |
void | setTorqueFunctionNames (const OpenSim::Array< std::string > &aFunctionNames, const OpenSim::Storage &kineticsStore) |
void | clearTorqueFunctions () |
bool | getForceIsInGlobalFrame () const |
Get whether the force and torque are specified in inertial coordinates or in the body's local coordinates. | |
void | setForceIsInGlobalFrame (bool isGlobal) |
Set whether the force and torque are specified in inertial coordinates or in the body's local coordinates. | |
bool | getPointIsInGlobalFrame () const |
Get whether the point is specified in inertial coordinates or in the body's local coordinates. | |
void | setPointIsInGlobalFrame (bool isGlobal) |
Set whether the point is specified in inertial coordinates or in the body's local coordinates. | |
const OpenSim::Body & | getBody () const |
Get the body that the prescribed force is acting upon. | |
SimTK::Vec3 | getForceAtTime (double aTime) const |
Conevenince methods to access prescribed force functions. | |
SimTK::Vec3 | getPointAtTime (double aTime) const |
SimTK::Vec3 | getTorqueAtTime (double aTime) const |
virtual OpenSim::Array < std::string > | getRecordLabels () const |
Methods used for reporting. | |
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. | |
PrescribedForce & | operator= (const PrescribedForce &aJoint) |
Assignment operator. | |
OPENSIM_DECLARE_DERIVED (PrescribedForce, Force) | |
Protected Member Functions | |
virtual void | setup (Model &model) |
ModelComponent interface. | |
virtual void | computeForce (const SimTK::State &state, SimTK::Vector_< SimTK::SpatialVec > &bodyForces, SimTK::Vector &generalizedForces) const |
Compute the force. | |
Protected Attributes | |
PropertyStr | _bodyNameProp |
The body that the Prescribed force is applied to. | |
std::string & | _bodyName |
PropertyBool | _forceIsGlobalProp |
bool & | _forceIsGlobal |
PropertyBool | _pointIsGlobalProp |
bool & | _pointIsGlobal |
PropertyObj | _forceFunctionSetProp |
FunctionSet & | _forceFunctionSet |
PropertyObj | _pointFunctionSetProp |
FunctionSet & | _pointFunctionSet |
PropertyObj | _torqueFunctionSetProp |
FunctionSet & | _torqueFunctionSet |
This applies a force and/or torque to a body which is fully specified as a function of time.
It is defined by three sets of functions, all of which are optional:
PrescribedForce::PrescribedForce | ( | OpenSim::Body * | body = 0 |
) |
Construct a PrescribedForce.
Default constructor.
By default, the force, torque, and point functions are all unspecified, meaning that it applies no force or torque. To specify them, call setForceFunctions(), setTorqueFunctions(), and setPointFunctions().
body | the body to apply the force to |
PrescribedForce::PrescribedForce | ( | const PrescribedForce & | force | ) |
Copy constructor.
PrescribedForce::PrescribedForce | ( | DOMElement * | aNode | ) |
Constructor from XML file.
PrescribedForce::~PrescribedForce | ( | ) |
Destructor.
void OpenSim::PrescribedForce::clearForceFunctions | ( | ) | [inline] |
void OpenSim::PrescribedForce::clearPointFunctions | ( | ) | [inline] |
void OpenSim::PrescribedForce::clearTorqueFunctions | ( | ) | [inline] |
void PrescribedForce::computeForce | ( | const SimTK::State & | state, | |
SimTK::Vector_< SimTK::SpatialVec > & | bodyForces, | |||
SimTK::Vector & | generalizedForces | |||
) | const [protected, virtual] |
Compute the force.
Reimplemented from OpenSim::Force.
Object * PrescribedForce::copy | ( | ) | const [virtual] |
Copy this force and return a pointer to the copy.
The copy constructor for this class is used.
Implements OpenSim::Force.
const OpenSim::Body& OpenSim::PrescribedForce::getBody | ( | ) | const [inline] |
Get the body that the prescribed force is acting upon.
const std::string& OpenSim::PrescribedForce::getBodyName | ( | ) | const [inline] |
Vec3 PrescribedForce::getForceAtTime | ( | double | aTime | ) | const |
Conevenince methods to access prescribed force functions.
void OpenSim::PrescribedForce::getForceFunctionNames | ( | OpenSim::Array< std::string > & | aFunctionNames | ) | [inline] |
const FunctionSet& OpenSim::PrescribedForce::getForceFunctions | ( | ) | const [inline] |
bool PrescribedForce::getForceIsInGlobalFrame | ( | ) | const |
Get whether the force and torque are specified in inertial coordinates or in the body's local coordinates.
Vec3 PrescribedForce::getPointAtTime | ( | double | aTime | ) | const |
void OpenSim::PrescribedForce::getPointFunctionNames | ( | OpenSim::Array< std::string > & | aFunctionNames | ) | [inline] |
const FunctionSet& OpenSim::PrescribedForce::getPointFunctions | ( | ) | const [inline] |
bool PrescribedForce::getPointIsInGlobalFrame | ( | ) | const |
Get whether the point is specified in inertial coordinates or in the body's local coordinates.
OpenSim::Array< std::string > PrescribedForce::getRecordLabels | ( | ) | const [virtual] |
Methods used for reporting.
Reimplemented from OpenSim::Force.
OpenSim::Array< double > PrescribedForce::getRecordValues | ( | const SimTK::State & | state | ) | const [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 from OpenSim::Force.
Vec3 PrescribedForce::getTorqueAtTime | ( | double | aTime | ) | const |
void OpenSim::PrescribedForce::getTorqueFunctionNames | ( | OpenSim::Array< std::string > & | aFunctionNames | ) | [inline] |
const FunctionSet& OpenSim::PrescribedForce::getTorqueFunctions | ( | ) | const [inline] |
OpenSim::PrescribedForce::OPENSIM_DECLARE_DERIVED | ( | PrescribedForce | , | |
Force | ||||
) |
PrescribedForce & PrescribedForce::operator= | ( | const PrescribedForce & | aForce | ) |
void OpenSim::PrescribedForce::setBodyName | ( | const std::string & | aBodyName | ) | [inline] |
void PrescribedForce::setForceFunctionNames | ( | const OpenSim::Array< std::string > & | aFunctionNames, | |
const OpenSim::Storage & | kineticsStore | |||
) |
Set the functions which specify the force to apply.
By default the force is specified in inertial coordinates. This can be changed by calling setForceIsInGlobalFrame().
All of the Function objects should have been allocated on the heap with the "new" operator. This object takes over ownership of them, and will delete them when it is deleted itself.
forceX | a function of time which calculates the X component of the force to apply | |
forceY | a function of time which calculates the Y component of the force to apply | |
forceZ | a function of time which calculates the Z component of the force to apply |
void PrescribedForce::setForceIsInGlobalFrame | ( | bool | isGlobal | ) |
Set whether the force and torque are specified in inertial coordinates or in the body's local coordinates.
void PrescribedForce::setPointFunctionNames | ( | const OpenSim::Array< std::string > & | aFunctionNames, | |
const OpenSim::Storage & | kineticsStore | |||
) |
Set the functions which specify the point at which to apply the force.
By default the point is specified in the body's local coordinates. This can be changed by calling setPointIsInGlobalFrame().
All of the Function objects should have been allocated on the heap with the "new" operator. This object takes over ownership of them, and will delete them when it is deleted itself.
pointX | a function of time which calculates the X coordinate of the point at which to apply the force | |
pointY | a function of time which calculates the Y coordinate of the point at which to apply the force | |
pointZ | a function of time which calculates the Z coordinate of the point at which to apply the force |
void PrescribedForce::setPointIsInGlobalFrame | ( | bool | isGlobal | ) |
Set whether the point is specified in inertial coordinates or in the body's local coordinates.
void PrescribedForce::setTorqueFunctionNames | ( | const OpenSim::Array< std::string > & | aFunctionNames, | |
const OpenSim::Storage & | kineticsStore | |||
) |
void PrescribedForce::setTorqueFunctions | ( | Function * | torqueX, | |
Function * | torqueY, | |||
Function * | torqueZ | |||
) |
Set the functions which specify the torque to apply.
By default the torque is specified in inertial coordinates. This can be changed by calling setForceIsInGlobalFrame().
All of the Function objects should have been allocated on the heap with the "new" operator. This object takes over ownership of them, and will delete them when it is deleted itself.
torqueX | a function of time which calculates the X component of the torque to apply | |
torqueY | a function of time which calculates the Y component of the torque to apply | |
torqueZ | a function of time which calculates the Z component of the torque to apply |
void PrescribedForce::setup | ( | Model & | model | ) | [protected, virtual] |
ModelComponent interface.
Reimplemented from OpenSim::Force.
void PrescribedForce::updateFromXMLNode | ( | ) | [virtual] |
Update this object based on its XML node.
Reimplemented from OpenSim::Object.
FunctionSet& OpenSim::PrescribedForce::updForceFunctions | ( | ) | [inline] |
FunctionSet& OpenSim::PrescribedForce::updPointFunctions | ( | ) | [inline] |
FunctionSet& OpenSim::PrescribedForce::updTorqueFunctions | ( | ) | [inline] |
std::string& OpenSim::PrescribedForce::_bodyName [protected] |
PropertyStr OpenSim::PrescribedForce::_bodyNameProp [protected] |
The body that the Prescribed force is applied to.
FunctionSet& OpenSim::PrescribedForce::_forceFunctionSet [protected] |
bool& OpenSim::PrescribedForce::_forceIsGlobal [protected] |
FunctionSet& OpenSim::PrescribedForce::_pointFunctionSet [protected] |
bool& OpenSim::PrescribedForce::_pointIsGlobal [protected] |
FunctionSet& OpenSim::PrescribedForce::_torqueFunctionSet [protected] |