OpenSim::ForwardTool Class Reference

A concrete tool for perfroming forward dynamics simulations. More...

#include <ForwardTool.h>

Inheritance diagram for OpenSim::ForwardTool:
OpenSim::AbstractTool OpenSim::Object

List of all members.

Public Member Functions

virtual ~ForwardTool ()
 Destructor.
 ForwardTool ()
 Default constructor.
 ForwardTool (const std::string &aFileName, bool aUpdateFromXMLNode=true, bool aLoadModel=true) SWIG_DECLARE_EXCEPTION
 ForwardTool (const ForwardTool &aObject)
 Copy constructor.
virtual Objectcopy () const
 Virtual copy constructor.
ForwardTooloperator= (const ForwardTool &aForwardTool)
 Assignment operator.
virtual void updateFromXMLNode ()
 Override default implementation by object to intercept and fix the XML node underneath the tool to match current version.
void setManager (Manager &m)
 Set the current integration manager.
const ManagergetManager () const
 Get the current integration manager.
const std::string & getStatesFileName () const
void setStatesFileName (const std::string &aFileName)
bool getUseSpecifiedDt () const
void setUseSpecifiedDt (bool aUseSpecifiedDt)
void setPrintResultFiles (bool aToWrite)
virtual bool run () SWIG_DECLARE_EXCEPTION
 Run the investigation.
void printResults ()
void loadStatesStorage (std::string &statesFileName, Storage *&rYStore) const
const std::string & getParsingLog ()

Static Public Member Functions

static double Step (double t, double t0, double t1)
 A smooth step-down function using cubic polynomial.
static double SigmaUp (double tau, double to, double t)
 A smooth step-up function using exponentials.
static double SigmaDn (double tau, double to, double t)
 A smooth step-down function using exponentials.

Protected Member Functions

void setDesiredStatesForControllers (Storage &rYStore)
int determineInitialTimeFromStatesStorage (double &rTI)
void InitializeSpecifiedTimeStepping (Storage *aYStore, Manager &aManager)
 Setup time stepping so that the integrator follows a pre-specified series of time steps.

Protected Attributes

PropertyStr _statesFileNameProp
 Name of the states file.
std::string & _statesFileName
OpenSim::PropertyBool _useSpecifiedDtProp
 If true, the time steps from the states file are used during current integration.
bool & _useSpecifiedDt
Storage_yStore
 Storage for the input states.
bool _printResultFiles
 Flag indicating whether or not to write to the results (GUI will set this to false).
Manager_manager
 pointer to the simulation Manager
std::string _parsingLog

Detailed Description

A concrete tool for perfroming forward dynamics simulations.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

ForwardTool::~ForwardTool (  )  [virtual]

Destructor.

ForwardTool::ForwardTool (  ) 

Default constructor.

OpenSim::ForwardTool::ForwardTool ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true,
bool  aLoadModel = true 
)
ForwardTool::ForwardTool ( const ForwardTool aTool  ) 

Copy constructor.

Copy constructors for all Tools only copy the non-XML variable members of the object; that is, the object's DOMnode and XMLDocument are not copied but set to NULL. The reason for this is that for the object and all its derived classes to establish the correct connection to the XML document nodes, the the object would need to reconstruct based on the XML document not the values of the object's member variables.

There are three proper ways to generate an XML document for an Tool:

1) Construction based on XML file (

See also:
Tool(const char *aFileName)). In this case, the XML document is created by parsing the XML file.

2) Construction by Tool(const XMLDocument *aDocument). This constructor explictly requests construction based on an XML document. In this way the proper connection between an object's node and the corresponding node within the XML document is established. This constructor is a copy constructor of sorts because all essential Tool member variables should be held within the XML document. The advantage of this style of construction is that nodes within the XML document, such as comments that may not have any associated Tool member variable, are preserved.

3) A call to generateXMLDocument(). This method generates an XML document for the Tool from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).

Parameters:
aTool Object to be copied.
See also:
Tool(const XMLDocument *aDocument)
Tool(const char *aFileName)
generateXMLDocument()

Member Function Documentation

Object * ForwardTool::copy (  )  const [virtual]

Virtual copy constructor.

Reimplemented from OpenSim::Object.

int ForwardTool::determineInitialTimeFromStatesStorage ( double &  rTI  )  [protected]
const Manager & ForwardTool::getManager (  )  const

Get the current integration manager.

const std::string& OpenSim::ForwardTool::getParsingLog (  )  [inline]
const std::string& OpenSim::ForwardTool::getStatesFileName (  )  const [inline]
bool OpenSim::ForwardTool::getUseSpecifiedDt (  )  const [inline]
void ForwardTool::InitializeSpecifiedTimeStepping ( Storage aYStore,
Manager aManager 
) [protected]

Setup time stepping so that the integrator follows a pre-specified series of time steps.

void ForwardTool::loadStatesStorage ( std::string &  statesFileName,
Storage *&  rYStore 
) const
ForwardTool & ForwardTool::operator= ( const ForwardTool aTool  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::AbstractTool.

void ForwardTool::printResults (  ) 
bool ForwardTool::run (  )  [virtual]

Run the investigation.

Implements OpenSim::AbstractTool.

void OpenSim::ForwardTool::setDesiredStatesForControllers ( Storage rYStore  )  [protected]
void ForwardTool::setManager ( Manager m  ) 

Set the current integration manager.

Parameters:
m pointer to itegration manager
void OpenSim::ForwardTool::setPrintResultFiles ( bool  aToWrite  )  [inline]
void OpenSim::ForwardTool::setStatesFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::ForwardTool::setUseSpecifiedDt ( bool  aUseSpecifiedDt  )  [inline]
double ForwardTool::SigmaDn ( double  tau,
double  to,
double  t 
) [static]

A smooth step-down function using exponentials.

Parameters:
tau Rise and fall time constant.
to Location of the midpoint of the step.
t Independent variable
double ForwardTool::SigmaUp ( double  tau,
double  to,
double  t 
) [static]

A smooth step-up function using exponentials.

Parameters:
tau Rise and fall time constant.
to Location of the midpoint of the step.
t Independent variable
double ForwardTool::Step ( double  t,
double  t0,
double  t1 
) [static]

A smooth step-down function using cubic polynomial.

x=0 for t<t0, x=1 for t>t1, and x=smooth step in between t0 and t1.

Parameters:
t Parameter at which to evaluate step function
t0 Parameter value at which step starts (result=0 to the left)
t1 Parameter value at which step ends (result=1 to the right)
void ForwardTool::updateFromXMLNode (  )  [virtual]

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

Reimplemented from OpenSim::AbstractTool.


Member Data Documentation

pointer to the simulation Manager

std::string OpenSim::ForwardTool::_parsingLog [protected]

Flag indicating whether or not to write to the results (GUI will set this to false).

std::string& OpenSim::ForwardTool::_statesFileName [protected]

Name of the states file.

The states file must at a minimum contain the initial states for a simulation. If a complete set of states is available, the time stamps can be used to specify the integration steps and corrective springs, which allow perturbations, can be added to the simulation.

If true, the time steps from the states file are used during current integration.

Storage for the input states.


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

Generated on Sun Sep 25 00:20:06 2011 for OpenSim by  doxygen 1.6.1