From ed39ea1ba18ed1ab4eade0affe2c9e91ae1f3ded Mon Sep 17 00:00:00 2001 From: Thomas Fetzer Date: Wed, 21 Dec 2016 15:41:13 +0100 Subject: [PATCH 1/2] [timemanager][...] Rename episode*Over() to episode*Finished() --- dumux/common/timemanager.hh | 24 +++++++++++++++---- .../2p2c/sequential/fvpressure.hh | 2 +- .../2p2c/sequential/fvpressuremultiphysics.hh | 4 ++-- .../sequential/impetproblem.hh | 4 ++-- .../sequential/onemodelproblem.hh | 4 ++-- .../generalproblem/generallensproblem.hh | 2 +- .../2cnistokes2p2cniproblem.hh | 4 ++-- .../2cnistokes2p2cni/2p2cnisubproblem.hh | 2 +- .../2cnizeroeq2p2cniproblem.hh | 4 ++-- .../2cnizeroeq2p2cni/2p2cnisubproblem.hh | 2 +- .../2cstokes2p2c/2cstokes2p2cproblem.hh | 4 ++-- .../2cstokes2p2c/2p2csubproblem.hh | 2 +- .../2czeroeq2p2c/2czeroeq2p2cproblem.hh | 4 ++-- .../2czeroeq2p2c/2p2csubproblem.hh | 2 +- .../1p/implicit/1pniconductionproblem.hh | 2 +- .../1p/implicit/1pniconvectionproblem.hh | 2 +- .../1p2c/implicit/1p2cniconductionproblem.hh | 2 +- .../1p2c/implicit/1p2cniconvectionproblem.hh | 2 +- .../2pncmin/implicit/dissolutionproblem.hh | 2 +- .../3p/implicit/3pniconductionproblem.hh | 2 +- .../3p/implicit/3pniconvectionproblem.hh | 2 +- .../3p3c/implicit/kuevetteproblem.hh | 2 +- .../implicit/3pwateroilsagdproblem.hh | 2 +- .../implicit/richardsniconductionproblem.hh | 2 +- .../implicit/richardsniconvectionproblem.hh | 2 +- 25 files changed, 51 insertions(+), 35 deletions(-) diff --git a/dumux/common/timemanager.hh b/dumux/common/timemanager.hh index eeb9a8cd6d..a4984fea6b 100644 --- a/dumux/common/timemanager.hh +++ b/dumux/common/timemanager.hh @@ -337,16 +337,32 @@ public: * \brief Returns true if the current episode is finished at the * current time. */ - bool episodeIsOver() const + bool episodeIsFinished() const { return time() >= episodeStartTime_ + episodeLength(); } /*! * \brief Returns true if the current episode will be finished * after the current time step. */ - bool episodeWillBeOver() const + bool episodeWillBeFinished() const { return time() + timeStepSize() >= episodeStartTime_ + episodeLength(); } + /*! + * \brief Returns true if the current episode is finished at the + * current time. + */ + DUNE_DEPRECATED_MSG("episodeIsOver() is deprecated and has been replaced by episodeIsFinished() instead.") + bool episodeIsOver() const + { return episodeIsFinished(); } + + /*! + * \brief Returns true if the current episode will be finished + * after the current time step. + */ + DUNE_DEPRECATED_MSG("episodeWillBeOver() is deprecated and has been replaced by episodeWillBeFinished() instead.") + bool episodeWillBeOver() const + { return episodeWillBeFinished(); } + /*! * \brief Aligns the time step size to the episode boundary if the @@ -358,7 +374,7 @@ public: // wants to give it some extra time, we will return // the time step size it suggested instead of trying // to align it to the end of the episode. - if (episodeIsOver()) + if (episodeIsFinished()) return 0.0; // make sure that we don't exceed the end of the @@ -419,7 +435,7 @@ public: problem_->serialize(); // notify the problem if an episode is finished - if (episodeIsOver()) { + if (episodeIsFinished()) { //define what to do at the end of an episode in the problem problem_->episodeEnd(); diff --git a/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh b/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh index 201edfd2d6..d5fc5c86e0 100644 --- a/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh +++ b/dumux/porousmediumflow/2p2c/sequential/fvpressure.hh @@ -286,7 +286,7 @@ void FVPressure2P2C::getStorage(Dune::FieldVector& storageEn // Abort error damping if there will be a possibly tiny timestep compared with last one // This might be the case if the episode or simulation comes to an end. - if( problem().timeManager().episodeWillBeOver() + if( problem().timeManager().episodeWillBeFinished() || problem().timeManager().willBeFinished()) { problem().variables().cellData(eIdxGlobalI).errorCorrection() = 0.; diff --git a/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh b/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh index 30f237550b..28959196e5 100644 --- a/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh +++ b/dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh @@ -453,7 +453,7 @@ void FVPressure2P2CMultiPhysics::get1pStorage(Dune::FieldVector::updateMaterialLaws(bool postTimeStep) timer_.stop(); - if(problem().timeManager().willBeFinished() or problem().timeManager().episodeWillBeOver()) + if(problem().timeManager().willBeFinished() or problem().timeManager().episodeWillBeFinished()) Dune::dinfo << "Subdomain routines took " << timer_.elapsed() << " seconds" << std::endl; return; diff --git a/dumux/porousmediumflow/sequential/impetproblem.hh b/dumux/porousmediumflow/sequential/impetproblem.hh index 0cd59f80f6..d881b904dd 100644 --- a/dumux/porousmediumflow/sequential/impetproblem.hh +++ b/dumux/porousmediumflow/sequential/impetproblem.hh @@ -500,13 +500,13 @@ public: { if (timeManager().timeStepIndex() % outputInterval_ == 0 || timeManager().willBeFinished() - || timeManager().episodeWillBeOver()) + || timeManager().episodeWillBeFinished()) { return true; } } else if (timeManager().willBeFinished() - || timeManager().episodeWillBeOver() || timeManager().timeStepIndex() == 0) + || timeManager().episodeWillBeFinished() || timeManager().timeStepIndex() == 0) { return true; } diff --git a/dumux/porousmediumflow/sequential/onemodelproblem.hh b/dumux/porousmediumflow/sequential/onemodelproblem.hh index 388accd448..e3e095cf5b 100644 --- a/dumux/porousmediumflow/sequential/onemodelproblem.hh +++ b/dumux/porousmediumflow/sequential/onemodelproblem.hh @@ -434,13 +434,13 @@ public: { if (timeManager().timeStepIndex() % outputInterval_ == 0 || timeManager().willBeFinished() - || timeManager().episodeWillBeOver()) + || timeManager().episodeWillBeFinished()) { return true; } } else if (timeManager().willBeFinished() - || timeManager().episodeWillBeOver() || timeManager().timeStepIndex() == 0) + || timeManager().episodeWillBeFinished() || timeManager().timeStepIndex() == 0) { return true; } diff --git a/test/common/generalproblem/generallensproblem.hh b/test/common/generalproblem/generallensproblem.hh index 0cdb37a23a..b4638d474b 100644 --- a/test/common/generalproblem/generallensproblem.hh +++ b/test/common/generalproblem/generallensproblem.hh @@ -222,7 +222,7 @@ public: { if (this->timeManager().time() < eps_ || this->timeManager().willBeFinished() || - this->timeManager().episodeWillBeOver()) + this->timeManager().episodeWillBeFinished()) { return true; } diff --git a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh index ad2860c047..c699dbe45e 100644 --- a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh @@ -222,7 +222,7 @@ public: bool shouldWriteRestartFile() const { return (this->timeManager().timeStepIndex() % freqRestart_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } @@ -237,7 +237,7 @@ public: bool shouldWriteOutput() const { return (this->timeManager().timeStepIndex() % freqOutput_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } diff --git a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh index 45d19fe9ea..c5031e06b7 100644 --- a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh @@ -360,7 +360,7 @@ public: if (this->gridView().comm().rank() == 0) { if (this->timeManager().timeStepIndex() % freqMassOutput_ == 0 - || this->timeManager().episodeWillBeOver()) + || this->timeManager().episodeWillBeFinished()) { PrimaryVariables storageChange(0.); storageChange = storageLastTimestep_ - storage; diff --git a/test/multidomain/2cnizeroeq2p2cni/2cnizeroeq2p2cniproblem.hh b/test/multidomain/2cnizeroeq2p2cni/2cnizeroeq2p2cniproblem.hh index afd1befda7..8bea652efb 100644 --- a/test/multidomain/2cnizeroeq2p2cni/2cnizeroeq2p2cniproblem.hh +++ b/test/multidomain/2cnizeroeq2p2cni/2cnizeroeq2p2cniproblem.hh @@ -187,7 +187,7 @@ public: { return (((this->timeManager().timeStepIndex() > 0) && (this->timeManager().timeStepIndex() % freqRestart_ == 0)) - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } @@ -195,7 +195,7 @@ public: bool shouldWriteOutput() const { return (this->timeManager().timeStepIndex() % freqOutput_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } diff --git a/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh index 0b3f9be23e..7344050374 100644 --- a/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh @@ -308,7 +308,7 @@ public: if (this->gridView().comm().rank() == 0) { if (this->timeManager().timeStepIndex() % freqMassOutput_ == 0 - || this->timeManager().episodeWillBeOver()) + || this->timeManager().episodeWillBeFinished()) { PrimaryVariables storageChange(0.); storageChange = storageLastTimestep_ - storage; diff --git a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh index 9894950786..4c6bfedab8 100644 --- a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh +++ b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh @@ -221,7 +221,7 @@ public: bool shouldWriteRestartFile() const { return (this->timeManager().timeStepIndex() % freqRestart_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } @@ -236,7 +236,7 @@ public: bool shouldWriteOutput() const { return (this->timeManager().timeStepIndex() % freqOutput_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } diff --git a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh index 2d2698bb98..f3ed79e0df 100644 --- a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh +++ b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh @@ -337,7 +337,7 @@ public: if (this->gridView().comm().rank() == 0) { if (this->timeManager().timeStepIndex() % freqMassOutput_ == 0 - || this->timeManager().episodeWillBeOver()) + || this->timeManager().episodeWillBeFinished()) { PrimaryVariables storageChange(0.); storageChange = storageLastTimestep_ - storage; diff --git a/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh b/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh index 2f1596456b..8a61b47949 100644 --- a/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh +++ b/test/multidomain/2czeroeq2p2c/2czeroeq2p2cproblem.hh @@ -189,7 +189,7 @@ public: return ( ((this->timeManager().timeStepIndex() > 0) && (this->timeManager().timeStepIndex() % freqRestart_ == 0)) // also write a restart file at the end of each episode - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } @@ -197,7 +197,7 @@ public: bool shouldWriteOutput() const { return (this->timeManager().timeStepIndex() % freqOutput_ == 0 - || this->timeManager().episodeWillBeOver() + || this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()); } diff --git a/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh b/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh index 4eb4ce1e94..3108784c97 100644 --- a/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh +++ b/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh @@ -303,7 +303,7 @@ public: if (this->gridView().comm().rank() == 0) { if (this->timeManager().timeStepIndex() % freqMassOutput_ == 0 - || this->timeManager().episodeWillBeOver()) + || this->timeManager().episodeWillBeFinished()) { PrimaryVariables storageChange(0.); storageChange = storageLastTimestep_ - storage; diff --git a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh index ae4a37cfe8..4323d27bff 100644 --- a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh +++ b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh @@ -153,7 +153,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh index 4d78eff5f8..64c5dbc3d0 100644 --- a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh +++ b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh @@ -161,7 +161,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh index 0ed78b339c..15b3840674 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2cniconductionproblem.hh @@ -167,7 +167,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh index 83b0dad6ea..0096099322 100644 --- a/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh +++ b/test/porousmediumflow/1p2c/implicit/1p2cniconvectionproblem.hh @@ -170,7 +170,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh index c6c2046e3a..2c85b91b31 100644 --- a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh +++ b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh @@ -188,7 +188,7 @@ public: bool shouldWriteOutput() const { return this->timeManager().timeStepIndex() % 1 == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh index ae8ea1c7d5..78f2abf5dd 100644 --- a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh +++ b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh @@ -157,7 +157,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh index 980403cbd8..192150f574 100644 --- a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh +++ b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh @@ -162,7 +162,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh index 6011dfe66e..cfacea7673 100644 --- a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh +++ b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh @@ -317,7 +317,7 @@ public: bool shouldWriteOutput() const { return this->timeManager().timeStepIndex() == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh index 2953d9eed8..383a15e820 100644 --- a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh +++ b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh @@ -208,7 +208,7 @@ public: if (timeStepIndex == 0 || timeStepIndex % 100 == 0 || //after every 1000000 secs - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished()) { std::cout<<" totalMassProducedOil_ : "<< totalMassProducedOil_ << " Time: " << time+dt << std::endl; diff --git a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh index 4d75c5aea5..c883661ab4 100644 --- a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh @@ -146,7 +146,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } diff --git a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh index 7079debfad..5ddb1784fd 100644 --- a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh @@ -155,7 +155,7 @@ public: return this->timeManager().timeStepIndex() == 0 || this->timeManager().timeStepIndex() % outputInterval_ == 0 || - this->timeManager().episodeWillBeOver() || + this->timeManager().episodeWillBeFinished() || this->timeManager().willBeFinished(); } -- GitLab From 5d7e40a05588658603fcd96a62f41b5c25c1b273 Mon Sep 17 00:00:00 2001 From: Thomas Fetzer Date: Tue, 27 Dec 2016 13:24:12 +0100 Subject: [PATCH 2/2] [common][io] Move serialize() of restart capability to be done before the time step is advanced Now willBeFinished, timeStepIdx, ... is the same for shouldWriteOutput() and shouldWriteRestart() --- CHANGELOG.md | 4 ++++ dumux/common/timemanager.hh | 12 ++++++------ dumux/io/adaptivegridrestart.hh | 6 +++--- dumux/io/restart.hh | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe531d40a5..9eb05d10f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ Differences Between DuMuX 2.10 and DuMuX 2.11 * IMPROVEMENTS and ENHANCEMENTS: * IMMEDIATE INTERFACE CHANGES not allowing/requiring a deprecation period: + - shouldWriteRestartFile() is now, as shouldWriteOutput() already was, + called before the time level is advanced. So it might be necessary to use + ...WillBeFinished instead of ...IsFinished for writing restart files at + the correct time. - In the ZeroEq models, the properties BBoxMinIsWall and BBoxMaxIsWall have been replaced by the functions bBoxMaxIsWall() and bBoxMaxIsWall() in the problem file. diff --git a/dumux/common/timemanager.hh b/dumux/common/timemanager.hh index a4984fea6b..690481a599 100644 --- a/dumux/common/timemanager.hh +++ b/dumux/common/timemanager.hh @@ -417,6 +417,10 @@ public: // prepare the model for the next time integration problem_->advanceTimeLevel(); + // write restart file if mandated by the problem + if (problem_->shouldWriteRestartFile()) + problem_->serialize(); + // advance the simulated time by the current time step size time_ += dt; ++timeStepIdx_; @@ -430,10 +434,6 @@ public: <<"\n"; } - // write restart file if mandated by the problem - if (problem_->shouldWriteRestartFile()) - problem_->serialize(); - // notify the problem if an episode is finished if (episodeIsFinished()) { //define what to do at the end of an episode in the problem @@ -485,8 +485,8 @@ public: res.serializeStream() << episodeIndex_ << " " << episodeStartTime_ << " " << episodeLength_ << " " - << time_ << " " - << timeStepIdx_ << " "; + << time_ + timeStepSize() << " " + << timeStepIdx_ + 1 << " "; res.serializeSectionEnd(); } diff --git a/dumux/io/adaptivegridrestart.hh b/dumux/io/adaptivegridrestart.hh index 468f318835..060fa0ede5 100644 --- a/dumux/io/adaptivegridrestart.hh +++ b/dumux/io/adaptivegridrestart.hh @@ -105,12 +105,11 @@ public: #if HAVE_DUNE_ALUGRID Dune::BackupRestoreFacility::backup(problem.grid(), gridName); #else - double time = problem.timeManager().time(); problem.grid().template writeGrid #if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2, 5) #endif // Dune < 3.0 - (gridName, time); + (gridName, problem.timeManager().time() + problem.timeManager().timeStepSize()); #endif } @@ -139,7 +138,8 @@ private: std::cerr << "Be sure to provide a parameter Problem.Name if you want to restart." << std::endl; oss << problem.name(); } - oss << "_time=" << problem.timeManager().time() << "_rank=" << rank << ".grs"; + oss << "_time=" << problem.timeManager().time() + problem.timeManager().timeStepSize() + << "_rank=" << rank << ".grs"; return oss.str(); } }; diff --git a/dumux/io/restart.hh b/dumux/io/restart.hh index cd1fc50fa0..10dab4014f 100644 --- a/dumux/io/restart.hh +++ b/dumux/io/restart.hh @@ -93,7 +93,7 @@ public: const std::string magicCookie = magicRestartCookie_(problem.gridView()); fileName_ = restartFileName_(problem.gridView(), problem.name(), - problem.timeManager().time()); + problem.timeManager().time()+problem.timeManager().timeStepSize()); // open output file and write magic cookie outStream_.open(fileName_.c_str()); -- GitLab