A class that manages the execution of a simulation. More...
#include <Manager.h>
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. | |
Storage & | getStateStorage () 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. |
A class that manages the execution of a simulation.
Manager::~Manager | ( | ) | [virtual] |
Destructor.
Manager::Manager | ( | Model & | model, | |
SimTK::Integrator & | integ | |||
) |
Construct a simulation manager.
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.
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
s | system state before integration |
const OpenSim::Array< double > & Manager::getDTArray | ( | ) |
Get the time deltas used in the last integration.
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.
aStep | Index of the desired step. |
double Manager::getFinalTime | ( | ) | const |
Get the final time of the simulation.
double Manager::getFirstDT | ( | ) | const |
Get the first time step taken in an integration.
double Manager::getFixedStepSize | ( | int | tArrayStep | ) | const |
return the step size when the integrator is taking fixed step sizes
tArrayStep | Step number |
double Manager::getInitialTime | ( | ) | const |
Get the initial time of the simulation.
SimTK::Integrator & Manager::getIntegrator | ( | ) | const |
Get the integrator.
double Manager::getNextTimeArrayTime | ( | double | aTime | ) |
Get the next time in the time array.
aTime | Time of the integration step. |
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.
aTime | Time of the integration step. |
double Manager::getTimeArrayTime | ( | int | aStep | ) |
Get the time of a specified integration step.
aStep | Index of the desired step. |
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().
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 (
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
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.
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.
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.
aN | Number of deltas. | |
aDT | Array of deltas. | |
aTI | Initial time. If not specified, 0.0 is assumed. |
void Manager::setFinalTime | ( | double | aTF | ) |
Set the final time of the simulation.
aTF | Final time. |
void Manager::setFirstDT | ( | double | aDT | ) |
Set the first time step taken in an integration.
aDT | First integration time step. |
void Manager::setInitialTime | ( | double | aTI | ) |
Set the initial time of the simulation.
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().
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. |
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 (
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. |
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.