Commit 28d01dd8 authored by Lukas Riedel's avatar Lukas Riedel

Reorder Simulation::run algorithm

First print solution, then adapt if the loop continues.
parent c013eeb5
......@@ -155,18 +155,23 @@ bool Simulation<Traits>::compute_time_step ()
template<typename Traits>
void Simulation<Traits>::run ()
{
const auto t_start = controller->getTime();
output->write_vtk_output(t_start);
output->write_vtk_output(controller->getTime());
while(controller->doStep()) {
const auto time = controller->getTime();
const auto dt = controller->getDT();
if(!compute_time_step()){
continue;
}
if(adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary, time+dt, *uold, *unew)){ // reset operators if grid changes
operator_setup();
}
output->write_vtk_output(controller->getTime());
if(controller->doStep()
&& adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary,
time+dt, // need "old" boundary condition
*uold, *unew))
{
operator_setup(); // reset operators if grid changes
}
}
}
......
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