8#include <spdlog/spdlog.h>
23 TC_Default(NEWT &newton_,
unsigned int alg_order_,
double t_,
double max_t_,
double dt_,
double min_dt_,
24 double max_dt_,
double output_dt_)
44 template <
typename F,
typename OF>
void advance(F &f, OF &of)
51 }
catch (
const std::exception &e) {
72 newton.set_ignore_nonconv(
false);
75 newton.set_ignore_nonconv(
true);
93 spdlog::get(
"log")->error(
"Timestepping got stuck at t = {}",
t);
99 std::ostringstream message;
100 message << std::setw(16) <<
"| step from t = " << std::setw(8) << std::setprecision(5) <<
last_t << std::setw(8)
122 throw std::runtime_error(
"Timestepping failed. Error: \n" + std::string(e.what()));
This is a default time controller implementation which should be used as a base class for any other t...
Definition default.hh:21
bool finished() const
Definition default.hh:36
unsigned int alg_order
Definition default.hh:126
double get_t() const
Definition default.hh:31
TC_Default(NEWT &newton_, unsigned int alg_order_, double t_, double max_t_, double dt_, double min_dt_, double max_dt_, double output_dt_)
Definition default.hh:23
double output_dt
Definition default.hh:127
bool fin
Definition default.hh:130
unsigned int stuck
Definition default.hh:128
double max_t
Definition default.hh:127
double last_t
Definition default.hh:127
double last_save
Definition default.hh:127
double get_dt() const
Definition default.hh:30
double min_dt
Definition default.hh:127
void print_step_info()
Definition default.hh:97
double sug_dt
Definition default.hh:127
double cur_dt
Definition default.hh:127
unsigned int get_stuck() const
Get how many times in succession the timestepper was at the same time step.
Definition default.hh:35
virtual void step_success()
The default implementation of step_success does nothing except incrementing time and trying to plan t...
Definition default.hh:109
NEWT & newton
Definition default.hh:125
double t
Definition default.hh:127
virtual void step_fail(const std::exception &e)
The default implementation of step_fail immediately aborts the program.
Definition default.hh:120
double max_dt
Definition default.hh:127
void advance(F &f, OF &of)
Method to perform a single time step.
Definition default.hh:44
Definition complex_math.hh:14
bool __forceinline__ __host__ __device__ is_close(T1 a, T2 b, T3 eps_)
Function to evaluate whether two floats are equal to numerical precision. Tests for both relative and...
Definition math.hh:160