restart.cpp File Reference
#include <iostream>
#include "Mercury3D.h"

Classes

class  Mercury3DRestart
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
39 {
40  if (argc < 2)
41  {
42  logger(ERROR, "Please enter the name of the simulation you want to restart and, optionally, the name of the "
43  "simulation after restart");
44  }
45  else
46  {
47  logger(INFO, "restart data: %.restart", argv[1]);
48  }
49  Mercury3DRestart problem;
50  problem.setName(argv[1]);
51  problem.readRestartFile();
52  problem.setRestarted(false);
53  problem.time = problem.getTime();
54  problem.write(std::cout, false);
55  problem.solve(argc - 1, argv + 1);
56 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:3006
Definition: liveStatistics.cpp:32
double time
Definition: liveStatistics.cpp:36
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes all data into a restart file.
Definition: MercuryBase.cc:147

References ERROR, DPMBase::getTime(), INFO, logger, DPMBase::readRestartFile(), DPMBase::setName(), DPMBase::setRestarted(), DPMBase::solve(), Mercury3DRestart::time, and MercuryBase::write().