MPS-Basic
|
#include <simulation.hpp>
Public Member Functions | |
Simulation (std::filesystem::path &settingPath, std::filesystem::path &outputDirectory) | |
void | run () |
Public Attributes | |
MPS | mps |
Loader | loader |
Saver | saver |
std::chrono::system_clock::time_point | realStartTime |
std::chrono::system_clock::time_point | realEndTime |
double | startTime |
double | time |
double | endTime |
double | dt |
double | outputPeriod |
int | timeStep = 0 |
Private Member Functions | |
void | startSimulation () |
template<typename Rep , typename Period > | |
std::string | calHourMinuteSecond (std::chrono::duration< Rep, Period > d) |
void | endSimulation () |
void | timeStepReport (const std::chrono::system_clock::time_point &timeStepStartTime, const std::chrono::system_clock::time_point &timeStepEndTime) |
Report time step information to the console. | |
bool | saveCondition () |
std::string | getCurrentTimeString () |
Simulation class
This class is responsible for the simulation process. It loads the input, saves the results, and manages the time. It also contains the main loop of the simulation.
Definition at line 22 of file simulation.hpp.
Simulation::Simulation | ( | std::filesystem::path & | settingPath, |
std::filesystem::path & | outputDirectory ) |
Definition at line 17 of file simulation.cpp.
void Simulation::run | ( | ) |
Definition at line 29 of file simulation.cpp.
|
private |
Definition at line 50 of file simulation.cpp.
|
inlineprivate |
Definition at line 42 of file simulation.hpp.
|
private |
Definition at line 56 of file simulation.cpp.
|
private |
Report time step information to the console.
Definition at line 65 of file simulation.cpp.
|
private |
Definition at line 105 of file simulation.cpp.
|
private |
Definition at line 111 of file simulation.cpp.
MPS Simulation::mps |
Definition at line 26 of file simulation.hpp.
Loader Simulation::loader |
Definition at line 27 of file simulation.hpp.
Saver Simulation::saver |
Definition at line 28 of file simulation.hpp.
std::chrono::system_clock::time_point Simulation::realStartTime |
Definition at line 30 of file simulation.hpp.
std::chrono::system_clock::time_point Simulation::realEndTime |
Definition at line 30 of file simulation.hpp.
double Simulation::startTime |
Definition at line 31 of file simulation.hpp.
double Simulation::time |
Definition at line 31 of file simulation.hpp.
double Simulation::endTime |
Definition at line 31 of file simulation.hpp.
double Simulation::dt |
Definition at line 31 of file simulation.hpp.
double Simulation::outputPeriod |
Definition at line 32 of file simulation.hpp.
int Simulation::timeStep = 0 |
Definition at line 33 of file simulation.hpp.