Manager of the benchmark tests. More...
#include <MonitoringManager.h>
Public Member Functions | |
void | addMonitor (Monitor *monitor) |
add a monitor to the list | |
virtual bool | checkStop ()=0 |
Check if simulation is finished. | |
void | deleteMonitor (const unsigned int i) |
delete a monitor and remove it from the list using its index | |
virtual void | doMove ()=0 |
Do one step of simulation and save monitors for this step. | |
virtual void | end ()=0 |
End manager. | |
Monitor * | getMonitor (const unsigned int i) const |
get a monitor by its index in the list | |
void | incStep () |
increment step by one | |
virtual bool | init ()=0 |
Initialize manager. | |
bool | isLmlPresent () |
check if a lml is present | |
bool | isPmlPresent () |
check if a scn is present instead of pmlFileName | |
MonitoringManager (const char *mml) | |
constructor | |
unsigned int | numberOfMonitor () const |
get the number of monitors stored in the list | |
void | reload (bool delPml=true) |
reload simulation with current parameters | |
void | rewind () |
Rewind simulation. | |
void | saveMmlIn (const char *fileName) |
save current version of mml in | |
void | saveMonitors () |
Save save monitors' state for the current time. | |
void | setCurrentTime (double time) |
mutators for simulation parameters | |
void | setDt (double dt) |
change dt and save modification into mmlIn | |
void | setLmlFileName (const char *file) |
change lml file name and save modification into mmlIn | |
void | setPmlFileName (const char *file) |
change pml file name and save modification into mmlIn | |
void | setRefresh (double refresh) |
change refresh and save modification into mmlIn | |
void | simulate () |
perform simulation loop, make tests and save monitors' data into output file | |
void | storeOldPositions () |
store old positions before next step | |
void | updateComputingTime () |
add step computing time to total computing time | |
void | updateCurrentTime () |
add dt to current time | |
void | writeCsv (const char *fileName) |
Write all saved monitors'state into csv file. | |
void | writeOutput (const char *fileName) |
Write all saved monitors' states into mmlOut file. | |
virtual | ~MonitoringManager () |
destructor | |
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. | |
Loads * | getLml () |
Loads * | takeLml () |
This is nearly the same as getLml(), but it also transfers ownership of the pointer. | |
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 | |
Protected Attributes | |
double | computingTime |
total computing time at current moment | |
double | currentTime |
time at current moment | |
double | dt |
integration step | |
std::unique_ptr< mml::MonitoringIn > | mmlIn |
Object representing manager in the file generated by xsdcxx, can be used for serialization. | |
std::vector< Monitor * > | monitors |
Vector that contains all monitors. | |
double | refresh |
refreshing step | |
Simulator * | simul |
the simulator used for simualtion | |
std::string | simulatorName |
name of the simulator | |
int | step |
current step | |
double | stepComputingTime |
computing time of last step | |
std::vector< mml::TimeStep * > | times |
Vector that contains information saved by saveMonitors method. | |
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 computingTime, currentTime, dt, isLmlPresent(), isPmlPresent(), mmlIn, refresh, simul, simulatorName, step, stepComputingTime, and timeParameter2double().
void MonitoringManager::addMonitor | ( | Monitor * | monitor | ) |
add a monitor to the list
References monitors.
|
pure virtual |
Check if simulation is finished.
Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.
Referenced by MonitoringGuiManager::doOneStep(), simulate(), and MonitoringGuiManager::simulateOneStep().
void MonitoringManager::deleteMonitor | ( | const unsigned int | i | ) |
delete a monitor and remove it from the list using its index
References monitors.
|
pure virtual |
Do one step of simulation and save monitors for this step.
Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.
Referenced by MonitoringGuiManager::doOneStep(), and simulate().
|
pure virtual |
End manager.
Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.
double MonitoringManager::getComputingTime | ( | ) |
References computingTime.
Referenced by MonitorComputingTime::calculate(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getCurrentStep | ( | ) |
References step.
Referenced by AnsysSimulator::getPosition(), ArtisynthSimulator::getPosition(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getCurrentTime | ( | ) |
References currentTime.
Referenced by MonitorDistanceX::calculate(), MonitorDistanceY::calculate(), MonitorDistanceZ::calculate(), MonitorGeometricDeviation::calculate(), MonitorPointSetDistance::calculate(), MonitorRen::calculate(), MonitoringGuiManager::doOneStep(), and MonitoringDialog::updateSimulation().
double MonitoringManager::getDt | ( | ) |
References dt.
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
References monitors.
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::getAtoms(), and StructuralComponent::getStructure().
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(), takePml(), Simulator::updatePositions(), ParametersWriter::write(), and PrepWriter::write().
std::string MonitoringManager::getPmlFileName | ( | ) |
Referenced by MMLComponent::connectPml(), MMLComponent::MMLComponent(), MonitoringDialog::updateSimulation(), and writeOutput().
double MonitoringManager::getRefresh | ( | ) |
References refresh.
Referenced by MonitoringGuiManager::doOneStep(), and MonitoringDialog::updateSimulation().
Simulator * MonitoringManager::getSimulator | ( | ) |
References simul.
Referenced by MonitorForce::calculate(), and MonitoringDialog::updateSimulatorWidget().
double MonitoringManager::getStepComputingTime | ( | ) |
References stepComputingTime.
Referenced by MonitoringDialog::updateSimulation().
void MonitoringManager::incStep | ( | ) |
increment step by one
References step.
Referenced by InteractiveMonitoringManager::doMove(), and NonInteractiveMonitoringManager::doMove().
|
pure virtual |
Initialize manager.
Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.
Referenced by MonitoringGuiManager::loadMmlInFile(), reload(), rewind(), and simulate().
bool MonitoringManager::isLmlPresent | ( | ) |
check if a lml is present
References mmlIn.
Referenced by SofaSimulator::init(), MonitoringManager(), and PrepWriter::write().
bool MonitoringManager::isPmlPresent | ( | ) |
check if a scn is present instead of pmlFileName
References mmlIn.
Referenced by MonitoringManager().
unsigned int MonitoringManager::numberOfMonitor | ( | ) | const |
get the number of monitors stored in the list
References monitors.
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...) |
References computingTime, currentTime, init(), step, stepComputingTime, and times.
Referenced by MonitoringGuiManager::reload().
void MonitoringManager::rewind | ( | ) |
Rewind simulation.
References computingTime, currentTime, init(), step, stepComputingTime, and times.
Referenced by MonitoringGuiManager::rewind().
void MonitoringManager::saveMmlIn | ( | const char * | fileName | ) |
save current version of mml in
References mmlIn.
Referenced by MonitoringGuiManager::saveMmlInFile().
void MonitoringManager::saveMonitors | ( | ) |
Save save monitors' state for the current time.
References currentTime, mmlIn, monitors, timeParameter2double(), and times.
Referenced by InteractiveMonitoringManager::doMove(), NonInteractiveMonitoringManager::doMove(), and simulate().
void MonitoringManager::setCurrentTime | ( | double | time | ) |
mutators for simulation parameters
References currentTime.
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
References mmlIn.
Referenced by MonitoringGuiManager::updateLml().
void MonitoringManager::setPmlFileName | ( | const char * | file | ) |
change pml file name and save modification into mmlIn
References mmlIn.
Referenced by MonitoringGuiManager::updatePml().
void MonitoringManager::setRefresh | ( | double | refresh | ) |
change refresh and save modification into mmlIn
References mmlIn, and refresh.
Referenced by MonitoringGuiManager::updateRefresh().
void MonitoringManager::simulate | ( | ) |
perform simulation loop, make tests and save monitors' data into output file
References checkStop(), computingTime, currentTime, doMove(), init(), saveMonitors(), step, and writeOutput().
void MonitoringManager::storeOldPositions | ( | ) |
store old positions before next step
References PhysicalModel::getPositionPointer().
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.
References getLml().
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.
References getPml().
Referenced by MMLComponent::connectPml(), and MMLComponent::MMLComponent().
void MonitoringManager::updateComputingTime | ( | ) |
add step computing time to total computing time
References computingTime, and stepComputingTime.
Referenced by InteractiveMonitoringManager::doMove().
void MonitoringManager::updateCurrentTime | ( | ) |
add dt to current time
References currentTime, and dt.
Referenced by InteractiveMonitoringManager::doMove().
void MonitoringManager::writeCsv | ( | const char * | fileName | ) |
Write all saved monitors'state into csv file.
References monitors, and times.
Referenced by MonitoringGuiManager::saveCsvFile().
void MonitoringManager::writeOutput | ( | const char * | fileName | ) |
Write all saved monitors' states into mmlOut file.
References getPmlFileName(), times, and PhysicalModel::xmlPrint().
Referenced by MonitoringGuiManager::saveMmlOutFile(), and simulate().
|
protected |
total computing time at current moment
Referenced by getComputingTime(), MonitoringManager(), reload(), rewind(), simulate(), and updateComputingTime().
|
protected |
time at current moment
Referenced by NonInteractiveMonitoringManager::doMove(), getCurrentTime(), MonitoringManager(), reload(), rewind(), saveMonitors(), setCurrentTime(), simulate(), and updateCurrentTime().
|
protected |
integration step
Referenced by InteractiveMonitoringManager::doMove(), getDt(), MonitoringManager(), setDt(), and updateCurrentTime().
|
protected |
Object representing manager in the file generated by xsdcxx, can be used for serialization.
Referenced by InteractiveMonitoringManager::InteractiveMonitoringManager(), isLmlPresent(), isPmlPresent(), MonitoringManager(), saveMmlIn(), saveMonitors(), setDt(), setLmlFileName(), setPmlFileName(), and setRefresh().
|
protected |
Vector that contains all monitors.
Referenced by addMonitor(), deleteMonitor(), getMonitor(), numberOfMonitor(), saveMonitors(), writeCsv(), and ~MonitoringManager().
|
protected |
refreshing step
Referenced by getRefresh(), MonitoringManager(), and setRefresh().
|
protected |
the simulator used for simualtion
Referenced by getSimulator(), InteractiveMonitoringManager::init(), NonInteractiveMonitoringManager::init(), and MonitoringManager().
|
protected |
name of the simulator
Referenced by MonitoringManager().
|
protected |
current step
Referenced by NonInteractiveMonitoringManager::checkStop(), NonInteractiveMonitoringManager::doMove(), getCurrentStep(), incStep(), MonitoringManager(), reload(), rewind(), and simulate().
|
protected |
computing time of last step
Referenced by InteractiveMonitoringManager::doMove(), getStepComputingTime(), MonitoringManager(), reload(), rewind(), and updateComputingTime().
|
protected |
Vector that contains information saved by saveMonitors method.
Referenced by reload(), rewind(), saveMonitors(), writeCsv(), writeOutput(), and ~MonitoringManager().