commit bdbf529d6fd941c1cb24a030ded208bc43f73c9a
parent d8fbc4a5754fbdae871da60c87a734eb662b7d02
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date: Tue, 21 Feb 2017 17:45:11 +0100
Integrated serializer for restarts
To create restart snapshots use:
-ts_restart_step <step interval>
To restart from the last available snapshot:
-ts_restart
Note that currently data is _appended_ to the existing result file.
Diffstat:
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
@@ -3,3 +3,4 @@
*.swp
*.swo
bubbleDynamics
+/sandbox
diff --git a/src/bubbleDynamics.cpp b/src/bubbleDynamics.cpp
@@ -137,7 +137,16 @@ int main(int argc, const char** argv)
Real& tDump = stepperData.tDump;
if (stepperData.dtDump > 0.0) tDump = t + stepperData.dtDump;
- stepper->write(step, t, dt, U, &simConfig);
+
+ if (stepperData.bRestart)
+ {
+ deserialize<vec_t>(U, stepperData);
+ std::cout << "-->RESTARING: Time = " << std::scientific << stepperData.t;
+ std::cout << ";\tStep = " << std::fixed << stepperData.step << std::endl;
+ }
+ else
+ stepper->write(step, t, dt, U, &simConfig);
+
while (t < tFinal)
{
@@ -157,6 +166,9 @@ int main(int argc, const char** argv)
else
if (stepperData.bFixedStep && step % stepperData.writeGranularity == 0)
stepper->write(step, t, dt, U, &simConfig);
+
+ if (stepperData.restartstep > 0 && step % stepperData.restartstep == 0)
+ serialize<vec_t>(U, stepperData);
}
if (stepperData.dtDump > 0.0)