diff --git a/AMDiS/src/AdaptInfo.h b/AMDiS/src/AdaptInfo.h index b4878c78f27c3c297c3a0ec3aa74767e2a952430..e46d8e1cd94111b8b36de3480b5a6eaf816669ed 100644 --- a/AMDiS/src/AdaptInfo.h +++ b/AMDiS/src/AdaptInfo.h @@ -250,7 +250,8 @@ namespace AMDiS { { for (unsigned int i = 0; i < scalContents.size(); i++) std::cout << " Time error estimate = " << scalContents[i]->est_t_sum - << " Time error bound = " << scalContents[i]->timeErrLow << "\n"; + << " Time error low bound = " << scalContents[i]->timeErrLow + << " Time error high bound = " << scalContents[i]->timeTolerance << "\n"; } /// Returns \ref spaceIteration. diff --git a/AMDiS/src/AdaptInstationary.cc b/AMDiS/src/AdaptInstationary.cc index 6c68c2858f5f24615983c38e31c6cb541a4974c9..64fa550cdc5cbeb124e0fb0eec06ee1e9b43fb45 100644 --- a/AMDiS/src/AdaptInstationary.cc +++ b/AMDiS/src/AdaptInstationary.cc @@ -186,6 +186,10 @@ namespace AMDiS { !(adaptInfo->getTimestep() <= adaptInfo->getMinTimestep()) && adaptInfo->getTimestepIteration() <= adaptInfo->getMaxTimestepIteration()); adaptInfo->setLastProcessedTimestep(adaptInfo->getTimestep()); + + // After successful iteration/timestep the timestep will be changed according + // adaption rules for next timestep. + // First, check for increase of timestep if (!fixedTimestep_ && adaptInfo->timeErrorLow()) { adaptInfo->setTimestep(adaptInfo->getTimestep() * time_delta_2); if (dbgMode) { @@ -201,6 +205,12 @@ namespace AMDiS { adaptInfo->printTimeErrorLowInfo(); } } + // Second, check for decrease of timestep + if (!fixedTimestep_ && + !adaptInfo->timeToleranceReached() && + !(adaptInfo->getTimestep() <= adaptInfo->getMinTimestep())) { + adaptInfo->setTimestep(adaptInfo->getTimestep() * time_delta_1); + } } void AdaptInstationary::oneTimestep()