Skip to content
Snippets Groups Projects
Commit ea8f2a81 authored by Backofen, Rainer's avatar Backofen, Rainer
Browse files

included new variable <lastProcessedTimestep> in AdaptInfo, in order to have...

included new variable <lastProcessedTimestep> in AdaptInfo, in order to have the timestep which lead to current time in user program
parent d1ff5073
No related branches found
No related tags found
No related merge requests found
...@@ -135,6 +135,7 @@ namespace AMDiS { ...@@ -135,6 +135,7 @@ namespace AMDiS {
startTime(0.0), startTime(0.0),
endTime(1.0), endTime(1.0),
timestep(0.0), timestep(0.0),
lastProcessedTimestep(0.0),
minTimestep(0.0), minTimestep(0.0),
maxTimestep(1.0), maxTimestep(1.0),
timestepNumber(0), timestepNumber(0),
...@@ -189,6 +190,7 @@ namespace AMDiS { ...@@ -189,6 +190,7 @@ namespace AMDiS {
solverResidual = 0.0; solverResidual = 0.0;
GET_PARAMETER(0, name + "->timestep", "%f", &timestep); GET_PARAMETER(0, name + "->timestep", "%f", &timestep);
lastProcessedTimestep=timestep;
} }
/// Returns whether space tolerance is reached. /// Returns whether space tolerance is reached.
...@@ -478,6 +480,19 @@ namespace AMDiS { ...@@ -478,6 +480,19 @@ namespace AMDiS {
return timestep; return timestep;
} }
/// Gets \ref timestep
inline double getTimestep()
{
return timestep;
}
inline void setLastProcessedTimestep(double t){
lastProcessedTimestep=t;
}
inline double getLastProcessedTimestep(){
return lastProcessedTimestep;
}
/** \brief /** \brief
* Returns true, if the end time is reached and no more timestep * Returns true, if the end time is reached and no more timestep
...@@ -491,11 +506,6 @@ namespace AMDiS { ...@@ -491,11 +506,6 @@ namespace AMDiS {
return !(time < endTime - DBL_TOL); return !(time < endTime - DBL_TOL);
} }
/// Gets \ref timestep
inline double getTimestep()
{
return timestep;
}
/// Sets \ref minTimestep /// Sets \ref minTimestep
inline void setMinTimestep(double t) inline void setMinTimestep(double t)
...@@ -705,9 +715,12 @@ namespace AMDiS { ...@@ -705,9 +715,12 @@ namespace AMDiS {
/// Final time /// Final time
double endTime; double endTime;
/// Current time step size ///Time step size to be used
double timestep; double timestep;
/// Last processed time step size of finished iteration
double lastProcessedTimestep;
/// Minimal step size /// Minimal step size
double minTimestep; double minTimestep;
......
...@@ -121,6 +121,7 @@ namespace AMDiS { ...@@ -121,6 +121,7 @@ namespace AMDiS {
problemIteration_->beginIteration(adaptInfo); problemIteration_->beginIteration(adaptInfo);
problemIteration_->oneIteration(adaptInfo, FULL_ITERATION); problemIteration_->oneIteration(adaptInfo, FULL_ITERATION);
problemIteration_->endIteration(adaptInfo); problemIteration_->endIteration(adaptInfo);
adaptInfo->setLastProcessedTimestep(adaptInfo->getTimestep());
} }
void AdaptInstationary::implicitTimeStrategy() void AdaptInstationary::implicitTimeStrategy()
...@@ -184,7 +185,7 @@ namespace AMDiS { ...@@ -184,7 +185,7 @@ namespace AMDiS {
} while(!adaptInfo->timeToleranceReached() && } while(!adaptInfo->timeToleranceReached() &&
!(adaptInfo->getTimestep() <= adaptInfo->getMinTimestep()) && !(adaptInfo->getTimestep() <= adaptInfo->getMinTimestep()) &&
adaptInfo->getTimestepIteration() <= adaptInfo->getMaxTimestepIteration()); adaptInfo->getTimestepIteration() <= adaptInfo->getMaxTimestepIteration());
adaptInfo->setLastProcessedTimestep(adaptInfo->getTimestep());
if (!fixedTimestep_ && adaptInfo->timeErrorLow()) { if (!fixedTimestep_ && adaptInfo->timeErrorLow()) {
adaptInfo->setTimestep(adaptInfo->getTimestep() * time_delta_2); adaptInfo->setTimestep(adaptInfo->getTimestep() * time_delta_2);
if (dbgMode) { if (dbgMode) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment