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
include
deal.II
algorithms
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
21
#include <
deal.II/base/smartpointer.h
>
22
#include <
deal.II/base/subscriptor.h
>
23
24
#include <
deal.II/lac/vector_memory.h
>
25
26
#include <cstdio>
27
28
DEAL_II_NAMESPACE_OPEN
29
30
// Forward declaration
31
#ifndef DOXYGEN
32
class
ParameterHandler
;
33
#endif
34
35
namespace
Algorithms
36
{
60
class
TimestepControl
:
public
Subscriptor
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
77
declare_parameters
(
ParameterHandler
¶m);
78
86
void
87
parse_parameters
(
const
ParameterHandler
¶m);
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
183
double
tolerance_val
;
184
188
double
start_step_val
;
189
193
double
max_step_val
;
194
198
double
min_step_val
;
199
204
double
current_step_val
;
205
210
double
step_val
;
211
215
double
now_val
;
216
221
double
print_step
;
222
226
double
next_print_val
;
227
};
228
229
230
inline
double
231
TimestepControl::start
()
const
232
{
233
return
start_val
;
234
}
235
236
237
inline
double
238
TimestepControl::final
()
const
239
{
240
return
final_val
;
241
}
242
243
244
inline
double
245
TimestepControl::step
()
const
246
{
247
return
current_step_val
;
248
}
249
250
251
inline
double
252
TimestepControl::tolerance
()
const
253
{
254
return
tolerance_val
;
255
}
256
257
258
inline
double
259
TimestepControl::now
()
const
260
{
261
return
now_val
;
262
}
263
264
265
inline
void
266
TimestepControl::start
(
double
t)
267
{
268
start_val
= t;
269
}
270
271
272
inline
void
273
TimestepControl::final
(
double
t)
274
{
275
final_val
= t;
276
}
277
278
279
inline
void
280
TimestepControl::tolerance
(
double
t)
281
{
282
tolerance_val
= t;
283
}
284
285
286
inline
void
287
TimestepControl::start_step
(
const
double
t)
288
{
289
start_step_val
= t;
290
}
291
292
293
inline
void
294
TimestepControl::max_step
(
double
t)
295
{
296
max_step_val
= t;
297
}
298
299
300
inline
void
301
TimestepControl::restart
()
302
{
303
now_val
=
start_val
;
304
step_val
=
start_step_val
;
305
current_step_val
=
step_val
;
306
if
(
print_step
> 0.)
307
next_print_val
=
now_val
+
print_step
;
308
else
309
next_print_val
=
now_val
- 1.;
310
}
311
312
}
// namespace Algorithms
313
314
DEAL_II_NAMESPACE_CLOSE
315
316
#endif
Algorithms::TimestepControl
Definition
timestep_control.h:61
Algorithms::TimestepControl::start
double start() const
Definition
timestep_control.h:231
Algorithms::TimestepControl::parse_parameters
void parse_parameters(const ParameterHandler ¶m)
Definition
timestep_control.cc:63
Algorithms::TimestepControl::final
double final() const
Definition
timestep_control.h:238
Algorithms::TimestepControl::current_step_val
double current_step_val
Definition
timestep_control.h:204
Algorithms::TimestepControl::final_val
double final_val
Definition
timestep_control.h:178
Algorithms::TimestepControl::tolerance
double tolerance() const
Definition
timestep_control.h:252
Algorithms::TimestepControl::step_val
double step_val
Definition
timestep_control.h:210
Algorithms::TimestepControl::now_val
double now_val
Definition
timestep_control.h:215
Algorithms::TimestepControl::TimestepControl
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.)
Definition
timestep_control.cc:24
Algorithms::TimestepControl::max_step_val
double max_step_val
Definition
timestep_control.h:193
Algorithms::TimestepControl::min_step_val
double min_step_val
Definition
timestep_control.h:198
Algorithms::TimestepControl::now
double now() const
Definition
timestep_control.h:259
Algorithms::TimestepControl::print
bool print()
Definition
timestep_control.cc:101
Algorithms::TimestepControl::start_step_val
double start_step_val
Definition
timestep_control.h:188
Algorithms::TimestepControl::advance
bool advance()
Definition
timestep_control.cc:76
Algorithms::TimestepControl::restart
void restart()
Definition
timestep_control.h:301
Algorithms::TimestepControl::start_step
void start_step(const double step)
Definition
timestep_control.h:287
Algorithms::TimestepControl::step
double step() const
Definition
timestep_control.h:245
Algorithms::TimestepControl::tolerance_val
double tolerance_val
Definition
timestep_control.h:183
Algorithms::TimestepControl::start_val
double start_val
Definition
timestep_control.h:173
Algorithms::TimestepControl::print_step
double print_step
Definition
timestep_control.h:221
Algorithms::TimestepControl::next_print_val
double next_print_val
Definition
timestep_control.h:226
Algorithms::TimestepControl::max_step
void max_step(double)
Definition
timestep_control.h:294
Algorithms::TimestepControl::declare_parameters
static void declare_parameters(ParameterHandler ¶m)
Definition
timestep_control.cc:50
ParameterHandler
Definition
parameter_handler.h:855
Subscriptor
Definition
subscriptor.h:60
config.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition
config.h:503
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition
config.h:504
vector_memory.h
Algorithms
Definition
newton.h:36
smartpointer.h
subscriptor.h
Generated by
1.11.0