Computer Assisted Medical Intervention Tool Kit  version 5.2
 
Loading...
Searching...
No Matches
MonitoringManager Class Referenceabstract

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.
 
MonitorgetMonitor (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 ()
 
PhysicalModelgetInitPml ()
 
PhysicalModelgetPml ()
 
PhysicalModeltakePml ()
 This is nearly the same as getPml(), but it also transfers ownership of the pointer.
 
LoadsgetLml ()
 
LoadstakeLml ()
 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 ()
 
SimulatorgetSimulator ()
 
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
 
Simulatorsimul
 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.
 

Detailed Description

Manager of the benchmark tests.

Do simulation loop and tests

Constructor & Destructor Documentation

◆ MonitoringManager()

MonitoringManager::MonitoringManager ( const char *  mml)

constructor

Parameters
mmlmml file name
simsimulator name (Sofa, Ansys...)

References computingTime, currentTime, dt, isLmlPresent(), isPmlPresent(), mmlIn, refresh, simul, simulatorName, step, stepComputingTime, and timeParameter2double().

◆ ~MonitoringManager()

MonitoringManager::~MonitoringManager ( )
virtual

destructor

References monitors, and times.

Member Function Documentation

◆ addMonitor()

void MonitoringManager::addMonitor ( Monitor monitor)

add a monitor to the list

References monitors.

◆ checkStop()

virtual bool MonitoringManager::checkStop ( )
pure virtual

◆ deleteMonitor()

void MonitoringManager::deleteMonitor ( const unsigned int  i)

delete a monitor and remove it from the list using its index

References monitors.

◆ doMove()

virtual void MonitoringManager::doMove ( )
pure virtual

Do one step of simulation and save monitors for this step.

Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.

Referenced by MonitoringGuiManager::doOneStep(), and simulate().

◆ end()

virtual void MonitoringManager::end ( )
pure virtual

◆ getComputingTime()

double MonitoringManager::getComputingTime ( )

◆ getCurrentStep()

double MonitoringManager::getCurrentStep ( )

◆ getCurrentTime()

◆ getDt()

double MonitoringManager::getDt ( )

◆ getInitPml()

◆ getLml()

Loads * MonitoringManager::getLml ( )

Referenced by takeLml(), and PrepWriter::write().

◆ getLmlFileName()

string MonitoringManager::getLmlFileName ( )

◆ getmmlFileFolder()

string MonitoringManager::getmmlFileFolder ( )

Referenced by Reference::Reference().

◆ getMmlFileName()

string MonitoringManager::getMmlFileName ( )

◆ getMonitor()

Monitor * MonitoringManager::getMonitor ( const unsigned int  i) const

◆ getOldPosition()

void MonitoringManager::getOldPosition ( double  pos[3],
unsigned int  index 
)

get atom position for precedent step

References a, PhysicalModel::getAtoms(), and StructuralComponent::getStructure().

◆ getPml()

◆ getPmlFileName()

std::string MonitoringManager::getPmlFileName ( )

◆ getRefresh()

double MonitoringManager::getRefresh ( )

◆ getSimulator()

Simulator * MonitoringManager::getSimulator ( )

◆ getStepComputingTime()

double MonitoringManager::getStepComputingTime ( )

◆ incStep()

void MonitoringManager::incStep ( )

increment step by one

References step.

Referenced by InteractiveMonitoringManager::doMove(), and NonInteractiveMonitoringManager::doMove().

◆ init()

virtual bool MonitoringManager::init ( )
pure virtual

Initialize manager.

Returns
false if initialisation faild

Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.

Referenced by MonitoringGuiManager::loadMmlInFile(), reload(), rewind(), and simulate().

◆ isLmlPresent()

bool MonitoringManager::isLmlPresent ( )

check if a lml is present

References mmlIn.

Referenced by SofaSimulator::init(), MonitoringManager(), and PrepWriter::write().

◆ isPmlPresent()

bool MonitoringManager::isPmlPresent ( )

check if a scn is present instead of pmlFileName

References mmlIn.

Referenced by MonitoringManager().

◆ numberOfMonitor()

unsigned int MonitoringManager::numberOfMonitor ( ) const

get the number of monitors stored in the list

References monitors.

Referenced by MonitoringDialog::updateMonitors().

◆ reload()

void MonitoringManager::reload ( bool  delPml = true)

reload simulation with current parameters

Parameters
delPmltrue 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().

◆ rewind()

void MonitoringManager::rewind ( )

Rewind simulation.

References computingTime, currentTime, init(), step, stepComputingTime, and times.

Referenced by MonitoringGuiManager::rewind().

◆ saveMmlIn()

void MonitoringManager::saveMmlIn ( const char *  fileName)

save current version of mml in

References mmlIn.

Referenced by MonitoringGuiManager::saveMmlInFile().

◆ saveMonitors()

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().

◆ setCurrentTime()

void MonitoringManager::setCurrentTime ( double  time)

mutators for simulation parameters

References currentTime.

◆ setDt()

void MonitoringManager::setDt ( double  dt)

change dt and save modification into mmlIn

References dt, and mmlIn.

Referenced by MonitoringGuiManager::updateDt().

◆ setLmlFileName()

void MonitoringManager::setLmlFileName ( const char *  file)

change lml file name and save modification into mmlIn

References mmlIn.

Referenced by MonitoringGuiManager::updateLml().

◆ setPmlFileName()

void MonitoringManager::setPmlFileName ( const char *  file)

change pml file name and save modification into mmlIn

References mmlIn.

Referenced by MonitoringGuiManager::updatePml().

◆ setRefresh()

void MonitoringManager::setRefresh ( double  refresh)

change refresh and save modification into mmlIn

References mmlIn, and refresh.

Referenced by MonitoringGuiManager::updateRefresh().

◆ simulate()

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().

◆ storeOldPositions()

void MonitoringManager::storeOldPositions ( )

store old positions before next step

References PhysicalModel::getPositionPointer().

Referenced by Simulator::updatePositions().

◆ takeLml()

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().

◆ takePml()

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().

◆ updateComputingTime()

void MonitoringManager::updateComputingTime ( )

add step computing time to total computing time

References computingTime, and stepComputingTime.

Referenced by InteractiveMonitoringManager::doMove().

◆ updateCurrentTime()

void MonitoringManager::updateCurrentTime ( )

add dt to current time

References currentTime, and dt.

Referenced by InteractiveMonitoringManager::doMove().

◆ writeCsv()

void MonitoringManager::writeCsv ( const char *  fileName)

Write all saved monitors'state into csv file.

References monitors, and times.

Referenced by MonitoringGuiManager::saveCsvFile().

◆ writeOutput()

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().

Member Data Documentation

◆ computingTime

double MonitoringManager::computingTime
protected

total computing time at current moment

Referenced by getComputingTime(), MonitoringManager(), reload(), rewind(), simulate(), and updateComputingTime().

◆ currentTime

double MonitoringManager::currentTime
protected

◆ dt

double MonitoringManager::dt
protected

◆ mmlIn

std::unique_ptr<mml::MonitoringIn> MonitoringManager::mmlIn
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().

◆ monitors

std::vector<Monitor*> MonitoringManager::monitors
protected

Vector that contains all monitors.

Referenced by addMonitor(), deleteMonitor(), getMonitor(), numberOfMonitor(), saveMonitors(), writeCsv(), and ~MonitoringManager().

◆ refresh

double MonitoringManager::refresh
protected

refreshing step

Referenced by getRefresh(), MonitoringManager(), and setRefresh().

◆ simul

Simulator* MonitoringManager::simul
protected

◆ simulatorName

std::string MonitoringManager::simulatorName
protected

name of the simulator

Referenced by MonitoringManager().

◆ step

◆ stepComputingTime

double MonitoringManager::stepComputingTime
protected

◆ times

std::vector<mml::TimeStep*> MonitoringManager::times
protected

Vector that contains information saved by saveMonitors method.

Referenced by reload(), rewind(), saveMonitors(), writeCsv(), writeOutput(), and ~MonitoringManager().


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