Reference documentation for deal.II version 9.6.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: 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// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15
16#ifndef dealii_time_step_control_h
17#define dealii_time_step_control_h
18
19#include <deal.II/base/config.h>
20
23
25
26#include <cstdio>
27
29
30// Forward declaration
31#ifndef DOXYGEN
33#endif
34
35namespace Algorithms
36{
61 {
62 public:
66 TimestepControl(double start = 0.,
67 double final = 1.,
68 double tolerance = 1.e-2,
69 double start_step = 1.e-2,
70 double print_step = -1.,
71 double max_step = 1.);
72
76 static void
78
86 void
88
92 double
93 start() const;
98 double
99 final() const;
103 double
104 tolerance() const;
108 double
109 step() const;
110
114 double
115 now() const;
116
121 bool
122 advance();
123
127 void
128 start(double);
132 void
133 final(double);
137 void
138 tolerance(double);
139
147 void
148 start_step(const double step);
149
153 void
154 max_step(double);
155
160 void
161 restart();
162
166 bool
167 print();
168
169 private:
173 double start_val;
174
178 double final_val;
179
184
189
194
199
205
210 double step_val;
211
215 double now_val;
216
222
227 };
228
229
230 inline double
232 {
233 return start_val;
234 }
235
236
237 inline double
239 {
240 return final_val;
241 }
242
243
244 inline double
246 {
247 return current_step_val;
248 }
249
250
251 inline double
253 {
254 return tolerance_val;
255 }
256
257
258 inline double
260 {
261 return now_val;
262 }
263
264
265 inline void
267 {
268 start_val = t;
269 }
270
271
272 inline void
274 {
275 final_val = t;
276 }
277
278
279 inline void
281 {
282 tolerance_val = t;
283 }
284
285
286 inline void
288 {
289 start_step_val = t;
290 }
291
292
293 inline void
295 {
296 max_step_val = t;
297 }
298
299
300 inline void
311
312} // namespace Algorithms
313
315
316#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:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504