Loading [MathJax]/jax/output/HTML-CSS/config.js
OGS
IterationNumberBasedTimeStepping.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <vector>
16
18#include "TimeStepAlgorithm.h"
19
20namespace NumLib
21{
68{
69public:
88 double const t_initial,
89 double const t_end,
90 double const min_dt,
91 double const max_dt,
92 double const initial_dt,
93 MultiplyerInterpolationType const multiplier_interpolation_type,
94 std::vector<int>&& iter_times_vector,
95 std::vector<double>&& multiplier_vector,
96 std::vector<double> const& fixed_times_for_output);
97
99
100 std::tuple<bool, double> next(double solution_error, int number_iterations,
101 NumLib::TimeStep& ts_previous,
102 NumLib::TimeStep& ts_current) override;
103
104 bool isSolutionErrorComputationNeeded() const override { return true; }
105
107 NumLib::TimeStep const& timestep_previous,
108 NumLib::TimeStep const& timestep_current) const override;
109
110private:
112 double getNextTimeStepSize(NumLib::TimeStep const& ts_previous,
113 NumLib::TimeStep const& ts_current) const;
114
116 double findMultiplier(int const number_iterations,
117 NumLib::TimeStep const& ts_current) const;
118
121 const std::vector<int> _iter_times_vector;
123 const std::vector<double> _multiplier_vector;
125 const double _min_dt;
127 const double _max_dt;
129 const double _initial_dt;
133 const int _max_iter;
135 int _iter_times = 0;
136
138 std::vector<double> const _fixed_times_for_output;
139};
140
141} // namespace NumLib
Iteration number based adaptive time stepping.
IterationNumberBasedTimeStepping(double const t_initial, double const t_end, double const min_dt, double const max_dt, double const initial_dt, MultiplyerInterpolationType const multiplier_interpolation_type, std::vector< int > &&iter_times_vector, std::vector< double > &&multiplier_vector, std::vector< double > const &fixed_times_for_output)
const MultiplyerInterpolationType _multiplier_interpolation_type
Interpolation type for the multiplier.
~IterationNumberBasedTimeStepping() override=default
std::tuple< bool, double > next(double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current) override
double getNextTimeStepSize(NumLib::TimeStep const &ts_previous, NumLib::TimeStep const &ts_current) const
Calculate the next time step size.
const double _max_dt
The maximum allowed time step size.
const std::vector< double > _multiplier_vector
This vector stores the multiplier coefficients.
double findMultiplier(int const number_iterations, NumLib::TimeStep const &ts_current) const
Find a multiplier for the given number of iterations.
bool canReduceTimestepSize(NumLib::TimeStep const &timestep_previous, NumLib::TimeStep const &timestep_current) const override
Query the timestepper if further time step size reduction is possible.
int _iter_times
The number of nonlinear iterations.
const double _min_dt
The minimum allowed time step size.
const int _max_iter
The maximum allowed iteration number to accept current time step.
Interface of time stepping algorithms.
Time step object.
Definition TimeStep.h:31