94 if (system(
"./FreeFallRestartUnitTest -tmax 0.4 -name FreeFallRestartUnitTest_NoRestart"))
100 if (system(
"./FreeFallRestartUnitTest -tmax 0.2 -name FreeFallRestartUnitTest_Restarted"))
103 if (system(
"./FreeFallRestartUnitTest -r FreeFallRestartUnitTest_Restarted -tmax 0.4"))
107 logger(
INFO,
"Case 3: restarted at t=0.2; using separate data files");
110 if (system(
"./FreeFallRestartUnitTest -tmax 0.2 -name FreeFallRestartUnitTest_SeparateFiles -fileTypeData 2"))
112 if (system(
"./FreeFallRestartUnitTest -r FreeFallRestartUnitTest_SeparateFiles -tmax 0.4 "))
125 logger(
INFO,
"Finished running, now comparing");
128 FreeFall FreeFallProblemReloadRestart;
129 FreeFall FreeFallProblemReloadSplitFiles;
131 FreeFallProblemReload.
readRestartFile(
"FreeFallRestartUnitTest_NoRestart.restart");
132 FreeFallProblemReloadRestart.
readRestartFile(
"FreeFallRestartUnitTest_Restarted.restart");
133 FreeFallProblemReloadSplitFiles.
readRestartFile(
"FreeFallRestartUnitTest_SeparateFiles.restart");
136 auto FreeFallProblemReloadSplitFilesIt = FreeFallProblemReloadSplitFiles.
particleHandler.
begin();
142 if (!(*FreeFallProblemReloadIt)->getPosition().isEqualTo((*FreeFallProblemReloadRestartIt)->getPosition(),1e-6))
144 logger(
FATAL,
"Particles is not in the same place after restart. Before it was % and now it is %.",(*FreeFallProblemReloadIt)->getPosition(),(*FreeFallProblemReloadRestartIt)->getPosition());
146 if (!(*FreeFallProblemReloadIt)->getPosition().isEqualTo((*FreeFallProblemReloadSplitFilesIt)->getPosition(), 1e-10))
148 logger(
FATAL,
"Particles velocities are not the same place. Before it was % and now it is %.",(*FreeFallProblemReloadIt)->getVelocity(),(*FreeFallProblemReloadRestartIt)->getVelocity());
150 ++FreeFallProblemReloadRestartIt;
151 ++FreeFallProblemReloadSplitFilesIt;
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
LL< Log::INFO > INFO
Info log level.
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
This code tests: 1) Restarting 2) Saving arcoss multiple files 3) and accepting command line argument...
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
int readRestartFile()
Reads all the particle data corresponding to the current saved time step. Which is what the restart f...
void runFreeFall(int argc, char *argv[])
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
LL< Log::FATAL > FATAL
Fatal log level.