OGS
FixedTimeStepping.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <memory>
16#include <vector>
17
18#include "TimeStepAlgorithm.h"
19
20namespace NumLib
21{
22using RepeatDtPair = std::tuple<std::size_t, double>;
23
30{
31public:
45 FixedTimeStepping(double t0, double t_end, double dt);
46
51 FixedTimeStepping(double t0, double tn,
52 std::vector<RepeatDtPair> const& repeat_dt_pairs,
53 std::vector<double> const& fixed_times_for_output);
54
55 std::tuple<bool, double> next(double solution_error, int number_iterations,
56 NumLib::TimeStep& ts_previous,
57 NumLib::TimeStep& ts_current) override;
58
59 static bool areRepeatDtPairsValid(
60 std::vector<RepeatDtPair> const& repeat_dt_pairs);
61
62private:
64 std::vector<double> _dt_vector;
65};
66
67std::size_t findDeltatInterval(Time const& t_initial,
68 std::vector<double> const& delta_ts,
69 Time const& fixed_output_time);
70} // namespace NumLib
Fixed time stepping algorithm.
std::tuple< bool, double > next(double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current) override
static bool areRepeatDtPairsValid(std::vector< RepeatDtPair > const &repeat_dt_pairs)
std::vector< double > _dt_vector
a vector of time step sizes
FixedTimeStepping(double t0, double t_end, double dt)
Interface of time stepping algorithms.
Time step object.
Definition TimeStep.h:31
std::tuple< std::size_t, double > RepeatDtPair
std::size_t findDeltatInterval(Time const &t_initial, std::vector< double > const &delta_ts, Time const &fixed_output_time)