Commit 5fddf899 authored by Santiago Ospina's avatar Santiago Ospina

Fixbug: adaptivity times staps now updated within the loop

Signed-off-by: default avatarSantiago Ospina <saospina@hugo.iwr.uni-heidelberg.de>
parent 0a0e833f
......@@ -163,24 +163,26 @@ bool RichardsSimulation<Traits>::compute_time_step ()
template<typename Traits>
void RichardsSimulation<Traits>::run ()
{
const auto time = controller->getTime();
const RF dt = controller->getDT();
{
if constexpr (Traits::write_output)
write_data(time);
write_data(controller->getTime());
while(controller->doStep()) {
if(!compute_time_step()){
const auto previous_time = controller->getTime();
const RF dt = controller->getDT();
if(!compute_time_step()) {
continue;
}
const auto next_time = controller->getTime();
if constexpr (Traits::write_output)
write_data(controller->getTime());
write_data(next_time);
if(controller->doStep()
&& adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary,
time+dt, *u))
&& adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary, previous_time, *u))
{
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