Commit 580fe6b1 authored by Lukas Riedel's avatar Lukas Riedel

Remove 'doStep' from CalculationController. Fix typo.

The decision whether or not to take a step is now handled by the
SimulationBase.
parent 7cf371c0
......@@ -133,13 +133,13 @@ void RichardsSimulation<Traits>::operator_setup()
template<typename Traits>
void RichardsSimulation<Traits>::step()
{
bool step_succed = false;
while(controller->doStep() & not step_succed)
bool step_succeed = false;
while(not step_succeed)
{
const RF t = controller->getTime();
const RF dt = controller->getDT();
bool exception = false;
const bool parmetis_warning = verbose > 0 && helper.rank() == 0 ?
const bool solver_warnings = verbose > 0 && helper.rank() == 0 ?
true : false;
try
......@@ -147,10 +147,10 @@ void RichardsSimulation<Traits>::step()
std::shared_ptr<U> unext = std::make_shared<U>(*u);
pdesolver->setMaxIterations(controller->getIterations());
if (not parmetis_warning)
if (not solver_warnings)
dwarn.push(false);
osm->apply(time_before, dt, *u, *unext);
if (not parmetis_warning)
if (not solver_warnings)
dwarn.pop();
u = unext;
......@@ -173,7 +173,7 @@ void RichardsSimulation<Traits>::step()
dt_before = dt;
// controller reacts to outcome of solution
step_succed = controller->validate(exception);
step_succeed = controller->validate(exception);
}
if (this->output_policy() == OutputPolicy::EndOfStep)
write_data();
......@@ -182,8 +182,8 @@ void RichardsSimulation<Traits>::step()
template<typename Traits>
void RichardsSimulation<Traits>::mark_grid()
{
adaptivity->mark_grid(*grid, gv, *gfs, *fparam,
*fboundary, time_before+dt_before, *u);
adaptivity->mark_grid(*grid, gv, *gfs, *fparam,
*fboundary, time_before+dt_before, *u);
}
template<typename Traits>
......
......@@ -90,12 +90,6 @@ public:
inline R getEndTime () const { return tEnd; }
/// Return maximum number of Newton iterations allowed for next calculation
inline int getIterations () const { return it; }
/// Return boolean whether new time step shall be computed
bool doStep () const {
if(time<tEnd-eps)
return true;
return false;
}
void set_time (const R _time)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment