Manager of the benchmark tests. More...
#include <MonitoringManager.h>
Public Member Functions | |
void | addMonitor (Monitor *monitor) |
add a monitor to the list More... | |
virtual bool | checkStop ()=0 |
Check if simulation is finished. More... | |
void | deleteMonitor (const unsigned int i) |
delete a monitor and remove it from the list using its index More... | |
virtual void | doMove ()=0 |
Do one step of simulation and save monitors for this step. More... | |
virtual void | end ()=0 |
End manager. More... | |
Monitor * | getMonitor (const unsigned int i) const |
get a monitor by its index in the list More... | |
void | incStep () |
increment step by one More... | |
virtual bool | init ()=0 |
Initialize manager. More... | |
bool | isLmlPresent () |
check if a lml is present More... | |
bool | isPmlPresent () |
check if a scn is present instead of pmlFileName More... | |
MonitoringManager (const char *mml) | |
constructor More... | |
unsigned int | numberOfMonitor () const |
get the number of monitors stored in the list More... | |
void | reload (bool delPml=true) |
reload simulation with current parameters More... | |
void | rewind () |
Rewind simulation. More... | |
void | saveMmlIn (const char *fileName) |
save current version of mml in More... | |
void | saveMonitors () |
Save save monitors' state for the current time. More... | |
void | setCurrentTime (double time) |
mutators for simulation parameters More... | |
void | setDt (double dt) |
change dt and save modification into mmlIn More... | |
void | setLmlFileName (const char *file) |
change lml file name and save modification into mmlIn More... | |
void | setPmlFileName (const char *file) |
change pml file name and save modification into mmlIn More... | |
void | setRefresh (double refresh) |
change refresh and save modification into mmlIn More... | |
void | simulate () |
perform simulation loop, make tests and save monitors' data into output file More... | |
void | storeOldPositions () |
store old positions before next step More... | |
void | updateComputingTime () |
add step computing time to total computing time More... | |
void | updateCurrentTime () |
add dt to current time More... | |
void | writeCsv (const char *fileName) |
Write all saved monitors'state into csv file. More... | |
void | writeOutput (const char *fileName) |
Write all saved monitors' states into mmlOut file. More... | |
virtual | ~MonitoringManager () |
destructor More... | |
accessors for simulation parameters | |
double | getDt () |
double | getRefresh () |
double | getCurrentTime () |
double | getCurrentStep () |
double | getStepComputingTime () |
double | getComputingTime () |
PhysicalModel * | getInitPml () |
PhysicalModel * | getPml () |
PhysicalModel * | takePml () |
This is nearly the same as getPml(), but it also transfers ownership of the pointer. More... | |
Loads * | getLml () |
Loads * | takeLml () |
This is nearly the same as getLml(), but it also transfers ownership of the pointer. More... | |
std::string | getPmlFileName () |
std::string | getLmlFileName () |
std::string | getMmlFileName () |
std::string | getmmlFileFolder () |
Simulator * | getSimulator () |
void | getOldPosition (double pos[3], unsigned int index) |
get atom position for precedent step More... | |
Protected Attributes | |
double | computingTime |
total computing time at current moment More... | |
double | currentTime |
time at current moment More... | |
double | dt |
integration step More... | |
std::unique_ptr< mml::MonitoringIn > | mmlIn |
Object representing manager in the file generated by xsdcxx, can be used for serialization. More... | |
std::vector< Monitor * > | monitors |
Vector that contains all monitors. More... | |
double | refresh |
refreshing step More... | |
Simulator * | simul |
the simulator used for simualtion More... | |
std::string | simulatorName |
name of the simulator More... | |
int | step |
current step More... | |
double | stepComputingTime |
computing time of last step More... | |
std::vector< mml::TimeStep * > | times |
Vector that contains information saved by saveMonitors method. More... | |
Manager of the benchmark tests.
Do simulation loop and tests
MonitoringManager::MonitoringManager | ( | const char * | mml | ) |
constructor
mml | mml file name |
sim | simulator name (Sofa, Ansys...) |
References camitk::refresh(), and timeParameter2double().
|
virtual |
destructor
void MonitoringManager::addMonitor | ( | Monitor * | monitor | ) |
add a monitor to the list
|
pure virtual |
Check if simulation is finished.
Implemented in NonInteractiveMonitoringManager, and InteractiveMonitoringManager.
Referenced by MonitoringGuiManager::doOneStep(), and MonitoringGuiManager::simulateOneStep().
void MonitoringManager::deleteMonitor | ( | const unsigned int | i | ) |
delete a monitor and remove it from the list using its index
|
pure virtual |
Do one step of simulation and save monitors for this step.
Implemented in NonInteractiveMonitoringManager, and InteractiveMonitoringManager.
Referenced by MonitoringGuiManager::doOneStep().
|
pure virtual |
End manager.
Implemented in NonInteractiveMonitoringManager, and InteractiveMonitoringManager.
double MonitoringManager::getComputingTime | ( | ) |
Referenced by MonitorComputingTime::calculate(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getCurrentStep | ( | ) |
Referenced by AnsysSimulator::getPosition(), ArtisynthSimulator::getPosition(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getCurrentTime | ( | ) |
Referenced by MonitorDistanceX::calculate(), MonitorDistanceY::calculate(), MonitorDistanceZ::calculate(), MonitorGeometricDeviation::calculate(), MonitorPointSetDistance::calculate(), MonitorRen::calculate(), MonitoringGuiManager::doOneStep(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getDt | ( | ) |
Referenced by SoluWriter::SoluWriter(), and MonitoringDialog::updateSimulation().
PhysicalModel * MonitoringManager::getInitPml | ( | ) |
Referenced by MonitorDisplacement::calculate(), MonitorNormDisplacement::calculate(), MonitorRen::calculate(), and Monitor::Monitor().
Loads * MonitoringManager::getLml | ( | ) |
string MonitoringManager::getLmlFileName | ( | ) |
string MonitoringManager::getmmlFileFolder | ( | ) |
string MonitoringManager::getMmlFileName | ( | ) |
Monitor * MonitoringManager::getMonitor | ( | const unsigned int | i | ) | const |
get a monitor by its index in the list
Referenced by MMLDisplay::connectMonitor(), MMLDisplay::getDisplayedMonitor(), MonitoringDialog::updateMonitors(), and MMLDisplay::updateMonitorsTable().
void MonitoringManager::getOldPosition | ( | double | pos[3], |
unsigned int | index | ||
) |
get atom position for precedent step
References a.
PhysicalModel * MonitoringManager::getPml | ( | ) |
Referenced by MonitorDisplacement::calculate(), MonitorDistanceX::calculate(), MonitorDistanceY::calculate(), MonitorDistanceZ::calculate(), MonitorForce::calculate(), MonitorGeometricDeviation::calculate(), MonitorNormDisplacement::calculate(), MonitorPointFinalSetDistance::calculate(), MonitorPointSetDistance::calculate(), MonitorPointToTriangleMeshDistanceFinal::calculate(), MonitorPosition::calculate(), MonitorRen::calculate(), MonitorSurface::calculate(), MonitorVolume::calculate(), Position::Position(), Simulator::updatePositions(), ParametersWriter::write(), and PrepWriter::write().
std::string MonitoringManager::getPmlFileName | ( | ) |
Referenced by MMLComponent::connectPml(), MMLComponent::MMLComponent(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getRefresh | ( | ) |
References camitk::refresh().
Referenced by MonitoringGuiManager::doOneStep(), and MonitoringDialog::updateSimulation().
Simulator * MonitoringManager::getSimulator | ( | ) |
Referenced by MonitorForce::calculate(), and MonitoringDialog::updateSimulatorWidget().
double MonitoringManager::getStepComputingTime | ( | ) |
void MonitoringManager::incStep | ( | ) |
increment step by one
Referenced by InteractiveMonitoringManager::doMove(), and NonInteractiveMonitoringManager::doMove().
|
pure virtual |
Initialize manager.
Implemented in NonInteractiveMonitoringManager, and InteractiveMonitoringManager.
Referenced by MonitoringGuiManager::loadMmlInFile().
bool MonitoringManager::isLmlPresent | ( | ) |
check if a lml is present
Referenced by SofaSimulator::init(), and PrepWriter::write().
bool MonitoringManager::isPmlPresent | ( | ) |
check if a scn is present instead of pmlFileName
unsigned int MonitoringManager::numberOfMonitor | ( | ) | const |
get the number of monitors stored in the list
Referenced by MonitoringDialog::updateMonitors().
void MonitoringManager::reload | ( | bool | delPml = true | ) |
reload simulation with current parameters
delPml | true if pml object have to be deleted (perhaps used by others: physicalModel component...) |
Referenced by MonitoringGuiManager::reload().
void MonitoringManager::rewind | ( | ) |
Rewind simulation.
Referenced by MonitoringGuiManager::rewind().
void MonitoringManager::saveMmlIn | ( | const char * | fileName | ) |
save current version of mml in
Referenced by MonitoringGuiManager::saveMmlInFile().
void MonitoringManager::saveMonitors | ( | ) |
Save save monitors' state for the current time.
References timeParameter2double().
Referenced by InteractiveMonitoringManager::doMove(), and NonInteractiveMonitoringManager::doMove().
void MonitoringManager::setCurrentTime | ( | double | time | ) |
mutators for simulation parameters
void MonitoringManager::setDt | ( | double | dt | ) |
change dt and save modification into mmlIn
Referenced by MonitoringGuiManager::updateDt().
void MonitoringManager::setLmlFileName | ( | const char * | file | ) |
change lml file name and save modification into mmlIn
Referenced by MonitoringGuiManager::updateLml().
void MonitoringManager::setPmlFileName | ( | const char * | file | ) |
change pml file name and save modification into mmlIn
Referenced by MonitoringGuiManager::updatePml().
void MonitoringManager::setRefresh | ( | double | refresh | ) |
change refresh and save modification into mmlIn
References camitk::refresh().
Referenced by MonitoringGuiManager::updateRefresh().
void MonitoringManager::simulate | ( | ) |
perform simulation loop, make tests and save monitors' data into output file
void MonitoringManager::storeOldPositions | ( | ) |
store old positions before next step
Referenced by Simulator::updatePositions().
Loads * MonitoringManager::takeLml | ( | ) |
This is nearly the same as getLml(), but it also transfers ownership of the pointer.
After this method is called, this instance of MonitoringManager will not delete the pml. It is then the responsability of the caller (the instance which is taking ownership of the Loads). This is useful when transmitting to PMManagerDC's Loads manager for example.
PhysicalModel * MonitoringManager::takePml | ( | ) |
This is nearly the same as getPml(), but it also transfers ownership of the pointer.
After this method is called, this instance of MonitoringManager will not delete the pml. It is then the responsability of the caller (the instance which is taking ownership of the PhysicalModel). This is useful when transmitting to PMManagerDC Component for example.
Referenced by MMLComponent::connectPml(), and MMLComponent::MMLComponent().
void MonitoringManager::updateComputingTime | ( | ) |
add step computing time to total computing time
Referenced by InteractiveMonitoringManager::doMove().
void MonitoringManager::updateCurrentTime | ( | ) |
add dt to current time
Referenced by InteractiveMonitoringManager::doMove().
void MonitoringManager::writeCsv | ( | const char * | fileName | ) |
Write all saved monitors'state into csv file.
Referenced by MonitoringGuiManager::saveCsvFile().
void MonitoringManager::writeOutput | ( | const char * | fileName | ) |
Write all saved monitors' states into mmlOut file.
Referenced by MonitoringGuiManager::saveMmlOutFile().
|
protected |
total computing time at current moment
|
protected |
time at current moment
Referenced by NonInteractiveMonitoringManager::doMove().
|
protected |
integration step
Referenced by InteractiveMonitoringManager::doMove().
|
protected |
Object representing manager in the file generated by xsdcxx, can be used for serialization.
Referenced by InteractiveMonitoringManager::InteractiveMonitoringManager().
|
protected |
Vector that contains all monitors.
|
protected |
refreshing step
|
protected |
the simulator used for simualtion
Referenced by InteractiveMonitoringManager::init(), and NonInteractiveMonitoringManager::init().
|
protected |
name of the simulator
|
protected |
current step
Referenced by NonInteractiveMonitoringManager::checkStop(), and NonInteractiveMonitoringManager::doMove().
|
protected |
computing time of last step
Referenced by InteractiveMonitoringManager::doMove().
|
protected |
Vector that contains information saved by saveMonitors method.