OpenSim::Manager Class Reference

A class that manages the execution of a simulation. More...

#include <Manager.h>

List of all members.

Public Member Functions

virtual ~Manager ()
 Destructor.
 Manager (Model &, SimTK::Integrator &)
 Construct a simulation manager.
 Manager ()
 A Constructor that does not take a model or controllerSet.
void setSessionName (const std::string &name)
void setModel (Model &aModel)
 Sets the model and initializes other entities that depend on it.
const std::string & getSessionName () const
 Get the session name of this Manager instance.
const std::string & toString () const
 Get name to be shown for this object in Simtk-model tree.
void setPerformAnalyses (bool performAnalyses)
void setWriteToStorage (bool writeToStorage)
SimTK::Integrator & getIntegrator () const
 Get the integrator.
void setInitialTime (double aTI)
 Set the initial time of the simulation.
double getInitialTime () const
 Get the initial time of the simulation.
void setFinalTime (double aTF)
 Set the final time of the simulation.
double getFinalTime () const
 Get the final time of the simulation.
void setFirstDT (double aDT)
 Set the first time step taken in an integration.
double getFirstDT () const
 Get the first time step taken in an integration.
void setUseSpecifiedDT (bool aTrueFalse)
 Set whether or not to take a specified sequence of deltas during an integration.
bool getUseSpecifiedDT () const
 Get whether or not to take a specified sequence of deltas during an integration.
void setUseConstantDT (bool aTrueFalse)
 Set whether or not to take a constant integration time step.
bool getUseConstantDT () const
 Get whether or not to use a constant integration time step.
const Array< double > & getDTArray ()
 Get the time deltas used in the last integration.
void setDTArray (int aN, const double aDT[], double aTI=0.0)
 Set the deltas held in the dt array.
double getDTArrayDT (int aStep)
 Get the delta used for a specified integration step.
void printDTArray (const char *aFileName=NULL)
 Print the dt array.
const Array< double > & getTimeArray ()
 Get the sequence of time steps taken in the last integration.
double getTimeArrayTime (int aStep)
 Get the time of a specified integration step.
int getTimeArrayStep (double aTime)
 Get the integration step (index) that occured prior to or at a specified time.
void printTimeArray (const char *aFileName=NULL)
 Print the time array.
void resetTimeAndDTArrays (double aTime)
 Reset the time and dt arrays so that all times after the specified time and the corresponding deltas are erased.
double getNextTimeArrayTime (double aTime)
 Get the next time in the time array.
void setSystem (SimTK::System *system)
bool integrate (SimTK::State &s, double dtFirst=1.0e-6)
 ____________________________________________________________________________
bool doIntegration (SimTK::State &s, int step, double dtFirst)
void initialize (SimTK::State &s, double dt)
 initialize storages and analyses
void finalize (const SimTK::State &s)
 finalize storages and analyses
double getFixedStepSize (int tArrayStep) const
 return the step size when the integrator is taking fixed step sizes
bool hasStateStorage () const
 Get whether there is a storage buffer for the integration states.
void setStateStorage (Storage &aStorage)
 Set the storage buffer for the integration states.
StoragegetStateStorage () const
 Get the storage buffer for the integration states.
void halt ()
 Halt an integration.
void clearHalt ()
 Clear the halt flag.
bool checkHalt ()
 Check for a halt request.

Detailed Description

A class that manages the execution of a simulation.


Constructor & Destructor Documentation

Manager::~Manager (  )  [virtual]

Destructor.

Manager::Manager ( Model model,
SimTK::Integrator &  integ 
)

Construct a simulation manager.

Parameters:
sys MultibodySustem for the simulation.
model pointer to model for the simulation.
Manager::Manager (  ) 

A Constructor that does not take a model or controllerSet.

Construct a simulation manager.


Member Function Documentation

bool Manager::checkHalt (  ) 

Check for a halt request.

The value of the halt flag is simply returned.

void Manager::clearHalt (  ) 

Clear the halt flag.

The value of the interrupt flag is set to false.

bool Manager::doIntegration ( SimTK::State &  s,
int  step,
double  dtFirst 
)
void Manager::finalize ( const SimTK::State &  s  ) 

finalize storages and analyses

Parameters:
s system state before integration
const OpenSim::Array< double > & Manager::getDTArray (  ) 

Get the time deltas used in the last integration.

Returns:
Constant reference to the dt array.
double Manager::getDTArrayDT ( int  aStep  ) 

Get the delta used for a specified integration step.

For step aStep, the delta returned is the delta used to go from step aStep to step aStep+1.

Parameters:
aStep Index of the desired step.
Returns:
Delta. SimTK::Nan is returned on error.
double Manager::getFinalTime (  )  const

Get the final time of the simulation.

Returns:
Final time.
double Manager::getFirstDT (  )  const

Get the first time step taken in an integration.

Returns:
First integration time step.
double Manager::getFixedStepSize ( int  tArrayStep  )  const

return the step size when the integrator is taking fixed step sizes

Parameters:
tArrayStep Step number
double Manager::getInitialTime (  )  const

Get the initial time of the simulation.

Returns:
Initial time.
SimTK::Integrator & Manager::getIntegrator (  )  const

Get the integrator.

double Manager::getNextTimeArrayTime ( double  aTime  ) 

Get the next time in the time array.

Parameters:
aTime Time of the integration step.
Returns:
next time
const string & Manager::getSessionName (  )  const

Get the session name of this Manager instance.

Storage & Manager::getStateStorage (  )  const

Get the storage buffer for the integration states.

const OpenSim::Array< double > & Manager::getTimeArray (  ) 

Get the sequence of time steps taken in the last integration.

int Manager::getTimeArrayStep ( double  aTime  ) 

Get the integration step (index) that occured prior to or at a specified time.

Parameters:
aTime Time of the integration step.
Returns:
Step that occured prior to or at aTime. 0 is returned if there is no such time stored.
double Manager::getTimeArrayTime ( int  aStep  ) 

Get the time of a specified integration step.

Parameters:
aStep Index of the desired step.
Returns:
Time of integration step aStep. SimTK::NaN is returned on error.
bool Manager::getUseConstantDT (  )  const

Get whether or not to use a constant integration time step.

The constant integration time step can be set using setDT().

Returns:
If true, constant time steps are used. If false, either specified or variable time steps are used.
See also:
setDT()
getUseSpecifiedDTs();
bool Manager::getUseSpecifiedDT (  )  const

Get whether or not to take a specified sequence of deltas during an integration.

The time deltas are obtained from what's stored in the dt vector (

See also:
setDTVector()). In order to execute an integration in this manner, the sum of the deltas must cover any requested integration interval. If not, an exception will be thrown at the beginning of an integration.
Returns:
If true, a specified time step will be used if possible. If false, a variable-step integration will be performed or a constant time step will be taken.
See also:
getUseConstantDT()
getDT()
getTimeVector()
void Manager::halt (  ) 

Halt an integration.

If an integration is pending or executing, the value of the interrupt flag is set to true.

bool Manager::hasStateStorage (  )  const

Get whether there is a storage buffer for the integration states.

void Manager::initialize ( SimTK::State &  s,
double  dt 
)

initialize storages and analyses

Parameters:
s system state before integration
bool Manager::integrate ( SimTK::State &  s,
double  dtFirst = 1.0e-6 
)

____________________________________________________________________________

Integrate the equations of motion for the specified model.

This method starts the integration at the initial default states of the model.

void Manager::printDTArray ( const char *  aFileName = NULL  ) 

Print the dt array.

void Manager::printTimeArray ( const char *  aFileName = NULL  ) 

Print the time array.

Parameters:
aFileName Name of the file to which to print. If the time array cannot be written to a file of the specified name, the time array is wirttent to standard out.
void Manager::resetTimeAndDTArrays ( double  aTime  ) 

Reset the time and dt arrays so that all times after the specified time and the corresponding deltas are erased.

Parameters:
aTime Time after which to erase the entries in the time and dt vectors.
void Manager::setDTArray ( int  aN,
const double  aDT[],
double  aTI = 0.0 
)

Set the deltas held in the dt array.

These deltas will be used if the integrator is set to take a specified set of deltas. In order to integrate using a specified set of deltas, the sum of deltas must cover the requested integration time interval, otherwise an exception will be thrown at the beginning of an integration.

Note that the time vector is reconstructed in order to check that the sum of the deltas covers a requested integration interval.

Parameters:
aN Number of deltas.
aDT Array of deltas.
aTI Initial time. If not specified, 0.0 is assumed.
See also:
getUseSpecifiedDT()
void Manager::setFinalTime ( double  aTF  ) 

Set the final time of the simulation.

Parameters:
aTF Final time.
void Manager::setFirstDT ( double  aDT  ) 

Set the first time step taken in an integration.

Parameters:
aDT First integration time step.
void Manager::setInitialTime ( double  aTI  ) 

Set the initial time of the simulation.

Parameters:
aTI Initial time.
void Manager::setModel ( Model aModel  ) 

Sets the model and initializes other entities that depend on it.

void OpenSim::Manager::setPerformAnalyses ( bool  performAnalyses  )  [inline]
void OpenSim::Manager::setSessionName ( const std::string &  name  ) 
void Manager::setStateStorage ( Storage aStorage  ) 

Set the storage buffer for the integration states.

void OpenSim::Manager::setSystem ( SimTK::System *  system  )  [inline]
void Manager::setUseConstantDT ( bool  aTrueFalse  ) 

Set whether or not to take a constant integration time step.

The size of the constant integration time step can be set using setDT().

Parameters:
aTrueFalse If true, constant time steps are used. When set to true, the flag used to indicate whether or not to take specified time steps is set to false. If set to false, a variable-step integration or a constant integration time step will be used.
See also:
setDT()
setUseSpecifiedDT()
getUseSpecifiedDT();
void Manager::setUseSpecifiedDT ( bool  aTrueFalse  ) 

Set whether or not to take a specified sequence of deltas during an integration.

The time deltas are obtained from what's stored in the vector dt vector (

See also:
setDTVector()). In order to execute an integration in this manner, the sum of the deltas must cover any requested integration interval. If not, an exception will be thrown at the beginning of an integration.
Parameters:
aTrueFalse If true, a specified dt's will be used. If set to false, a variable-step integration or a constant step integration will be used. When set to true, the flag used to indicate whether or not a constant time step is used is set to false.
See also:
setDTVector()
getUseConstantDT()
void OpenSim::Manager::setWriteToStorage ( bool  writeToStorage  )  [inline]
const std::string & Manager::toString (  )  const

Get name to be shown for this object in Simtk-model tree.


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

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