diff --git a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp index 63ef785620750e543ce7246e945ac57edd38091f..71b17e2304683c26c90a4d62182d36465a622ab1 100644 --- a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp +++ b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp @@ -38,11 +38,13 @@ bool EvolutionaryPIDcontroller::next(const double solution_error) _ts_current = _ts_prev; _ts_current += h_new; - WARN("\tThis step is rejected due to the relative change from the\n" - "\tsolution of the previous time step to the current solution\n" - "\t exceeds the given tolerance of %g.\n" - "\tThis time step will be repeated with a new time step size of" - " %g or the simulation will be halted." , _tol, h_new); + WARN("This step is rejected due to the relative change from the" + " solution of the previous\n" + "\t time step to the current solution exceeds the given tolerance" + " of %g.\n" + "\t This time step will be repeated with a new time step size of" + " %g\n" + "\t or the simulation will be halted." , _tol, h_new); return false; } diff --git a/ProcessLib/UncoupledProcessesTimeLoop.cpp b/ProcessLib/UncoupledProcessesTimeLoop.cpp index 6ef15d676032a07c6e4d364ad07afb640d065f42..33f96af26a79c38e56e8edaeda22c1a9f5d36db2 100644 --- a/ProcessLib/UncoupledProcessesTimeLoop.cpp +++ b/ProcessLib/UncoupledProcessesTimeLoop.cpp @@ -602,6 +602,15 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( } } + if (all_process_steps_accepted) + { + _repeating_times_of_rejected_step = 0; + } + else + { + _repeating_times_of_rejected_step++; + } + bool is_initial_step = false; // Reset the time step with the minimum step size, dt // Update the solution of the previous time step in time_disc. @@ -626,7 +635,6 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( if (all_process_steps_accepted) { time_disc->pushState(t, x, mat_strg); - _repeating_times_of_rejected_step = 0; } else { @@ -635,7 +643,7 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( WARN( "Time step %d was rejected %d times " "and it will be repeated with a reduced step size.", - accepted_steps + 1, _repeating_times_of_rejected_step++); + accepted_steps + 1, _repeating_times_of_rejected_step); time_disc->popState(x); } } diff --git a/ProcessLib/UncoupledProcessesTimeLoop.h b/ProcessLib/UncoupledProcessesTimeLoop.h index fe62579f90c291e370c095b19973a1b10d6ce969..e6a445ba2bcf5d078973cd06168bdf73bed0dd12 100644 --- a/ProcessLib/UncoupledProcessesTimeLoop.h +++ b/ProcessLib/UncoupledProcessesTimeLoop.h @@ -67,7 +67,7 @@ private: std::vector<std::unique_ptr<SingleProcessData>> _per_process_data; bool _last_step_rejected = false; - bool _repeating_times_of_rejected_step = 0; + int _repeating_times_of_rejected_step = 0; const double _start_time; const double _end_time;