deal.II version 9.8.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
timestep_control.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2010 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13
14#ifndef dealii_time_step_control_h
15#define dealii_time_step_control_h
16
17#include <deal.II/base/config.h>
18
21
23
24#include <cstdio>
25
27
28// Forward declaration
29#ifndef DOXYGEN
31#endif
32
33namespace Algorithms
34{
58 class DEAL_II_DEPRECATED_EARLY TimestepControl : public EnableObserverPointer
59 {
60 public:
64 TimestepControl(double start = 0.,
65 double final = 1.,
66 double tolerance = 1.e-2,
67 double start_step = 1.e-2,
68 double print_step = -1.,
69 double max_step = 1.);
70
74 static void
76
84 void
86
90 double
91 start() const;
96 double
97 final() const;
101 double
102 tolerance() const;
106 double
107 step() const;
108
112 double
113 now() const;
114
119 bool
120 advance();
121
125 void
126 start(double);
130 void
131 final(double);
135 void
136 tolerance(double);
137
145 void
146 start_step(const double step);
147
151 void
152 max_step(double);
153
158 void
159 restart();
160
164 bool
165 print();
166
167 private:
171 double start_val;
172
176 double final_val;
177
182
187
192
197
203
208 double step_val;
209
213 double now_val;
214
220
225 };
226
227
228 inline double
230 {
231 return start_val;
232 }
233
234
235 inline double
237 {
238 return final_val;
239 }
240
241
242 inline double
244 {
245 return current_step_val;
246 }
247
248
249 inline double
251 {
252 return tolerance_val;
253 }
254
255
256 inline double
258 {
259 return now_val;
260 }
261
262
263 inline void
265 {
266 start_val = t;
267 }
268
269
270 inline void
272 {
273 final_val = t;
274 }
275
276
277 inline void
279 {
280 tolerance_val = t;
281 }
282
283
284 inline void
286 {
287 start_step_val = t;
288 }
289
290
291 inline void
293 {
294 max_step_val = t;
295 }
296
297
298 inline void
309
310} // namespace Algorithms
311
313
314#endif
void parse_parameters(const ParameterHandler &param)
TimestepControl(double start=0., double final=1., double tolerance=1.e-2, double start_step=1.e-2, double print_step=-1., double max_step=1.)
void start_step(const double step)
static void declare_parameters(ParameterHandler &param)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
void advance(std::tuple< I1, I2 > &t, const unsigned int n)