20 IT::Record(
"TimeGrid",
"Equally spaced grid of time points.")
24 "The start time of the grid.")
26 "The step of the grid. If not specified, the grid consists of the single time given by the `begin` key.")
29 "The time greater or equal to the last time in the grid.")
43 double simulation_end_time = tg.
end_time();
50 if (!
it->opt_val(
"step", step) ) {
56 if ( t_begin > t_end) {
57 WarningOut().fmt(
"Ignoring output time grid. Time begin {} > time end {}. {}",
58 t_begin, t_end,
it->address_string());
61 if ( t_step < 2*numeric_limits<double>::epsilon()) {
62 WarningOut().fmt(
"Ignoring output time grid. Time step {} < two times machine epsilon {}. {}",
63 t_step, 2*numeric_limits<double>::epsilon(),
it->address_string());
67 this->
add(t_begin, t_step, t_end, mark_type);
80 auto mark =
TimeMark(time, output_mark_type);
82 times_.insert( mark_time );
90 ASSERT_GE( step, 2*numeric_limits<double>::epsilon());
96 if (n_steps_dbl > 1.0e+6) {
97 WarningOut().fmt(
"Output step: {} to small, fixing number of output steps to 1e6.", step);
99 step = (end - begin)/n_steps_dbl;
101 unsigned int n_steps = (
unsigned int)n_steps_dbl;
102 for(
unsigned int i = 0; i <= n_steps; i++) {
103 auto mark =
TimeMark(begin + i * step, output_mark_type);
double end_time() const
End time.
#define ASSERT_GE(a, b)
Definition of comparative assert macro (Greater or Equal)
TimeMark::Type type_output()
void read_from_input(Input::Array in_array, const TimeGovernor &tg)
#define ASSERT_LE(a, b)
Definition of comparative assert macro (Less or Equal)
bool contains(TimeMark mark) const
Basic time management functionality for unsteady (and steady) solvers (class Equation).
static TimeMarks & marks()
Basic time management class.
std::set< double > times_
static const Input::Type::Tuple & get_input_time_type(double lower_bound=-std::numeric_limits< double >::max(), double upper_bound=std::numeric_limits< double >::max())
static const double time_step_precision
TimeMark::Type equation_fixed_mark_type() const
double read_time(Input::Iterator< Input::Tuple > time_it, double default_time=std::numeric_limits< double >::quiet_NaN()) const
TimeMark add(const TimeMark &mark)
static const Input::Type::Array get_input_type()
double time() const
Getter for the time of the TimeMark.
#define WarningOut()
Macro defining 'warning' record of log.
Class used for marking specified times at which some events occur.
static const double inf_time
Infinity time used for steady case.
void add(double begin, TimeMark::Type mark_type)