OGS
FixedTimeStepping.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <vector>
8
9#include "TimeStepAlgorithm.h"
10
11namespace NumLib
12{
13using RepeatDtPair = std::tuple<std::size_t, double>;
14
21{
22public:
36 FixedTimeStepping(double t0, double t_end, double dt);
37
42 FixedTimeStepping(double t0, double tn,
43 std::vector<RepeatDtPair> const& repeat_dt_pairs,
44 std::vector<double> const& fixed_times_for_output);
45
46 double next(double solution_error, int number_iterations,
47 NumLib::TimeStep& ts_previous,
48 NumLib::TimeStep& ts_current) override;
49
50 static bool areRepeatDtPairsValid(
51 std::vector<RepeatDtPair> const& repeat_dt_pairs);
52
53private:
55 std::vector<double> _dt_vector;
56};
57
58std::size_t findDeltatInterval(Time const& t_initial,
59 std::vector<double> const& delta_ts,
60 Time const& fixed_output_time);
61} // namespace NumLib
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)
double next(double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current) override
TimeStepAlgorithm(const double t0, const double t_end)
Time step object.
Definition TimeStep.h:24
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)