From 5aca31e75144469ab3cf53be00713b49e9fca801 Mon Sep 17 00:00:00 2001 From: James McClure Date: Thu, 22 Aug 2019 08:28:11 -0400 Subject: [PATCH] restart database --- analysis/runAnalysis.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/analysis/runAnalysis.cpp b/analysis/runAnalysis.cpp index b35bf760..9b1ddc92 100644 --- a/analysis/runAnalysis.cpp +++ b/analysis/runAnalysis.cpp @@ -890,12 +890,12 @@ void runAnalysis::run( std::shared_ptr input_db, TwoPhase& Averages, c /****************************************************************** * Run the analysis * ******************************************************************/ -void runAnalysis::basic( std::shared_ptr db, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den) +void runAnalysis::basic( std::shared_ptr input_db, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den) { int N = d_N[0]*d_N[1]*d_N[2]; // Check which analysis steps we need to perform - auto color_db = db->getDatabase( "Color" ); + auto color_db = input_db->getDatabase( "Color" ); int timestep = color_db->getWithDefault( "timestep", 0 ); auto type = computeAnalysisType( timestep ); @@ -969,6 +969,12 @@ void runAnalysis::basic( std::shared_ptr db, SubPhase &Averages, const FILE *Rst = fopen("Restart.txt","w"); fprintf(Rst,"%i\n",timestep+4); fclose(Rst); + + input_db->putScalar( "Restart", true ); + std::ofstream OutStream("Restart.db"); + input_db->print(OutStream, ""); + OutStream.close(); + } } // Write the restart file (using a seperate thread) auto work1 = new WriteRestartWorkItem(d_restartFile.c_str(),cDen,cfq,d_Np);