Loading [MathJax]/extensions/TeX/newcommand.js
deal.II version GIT relicensing-2684-gc61376a70f 2025-02-22 15:30:00+00:00
\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\}}
Toggle main menu visibility
Main Page
Tutorial
Code gallery
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
v
Enumerations
a
b
c
d
e
f
g
h
i
l
n
o
p
r
s
v
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
b
c
d
e
f
g
i
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Related Symbols
:
a
b
c
d
f
g
i
l
m
n
o
p
r
s
t
u
v
Related Pages
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
v
Variables
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
Typedefs
Enumerations
Enumerator
m
u
Macros
a
b
d
e
f
h
i
m
p
s
t
dealii.org
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
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/enable_observer_pointer.h
>
22
#include <
deal.II/base/observer_pointer.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
EnableObserverPointer
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
};
60
class
TimestepControl
:
public
EnableObserverPointer
{
…
};
228
229
230
inline
double
231
TimestepControl::start
()
const
232
{
233
return
start_val
;
234
}
231
TimestepControl::start
()
const
{
…
}
235
236
237
inline
double
238
TimestepControl::final
()
const
239
{
240
return
final_val
;
241
}
238
TimestepControl::final
()
const
{
…
}
242
243
244
inline
double
245
TimestepControl::step
()
const
246
{
247
return
current_step_val
;
248
}
245
TimestepControl::step
()
const
{
…
}
249
250
251
inline
double
252
TimestepControl::tolerance
()
const
253
{
254
return
tolerance_val
;
255
}
252
TimestepControl::tolerance
()
const
{
…
}
256
257
258
inline
double
259
TimestepControl::now
()
const
260
{
261
return
now_val
;
262
}
259
TimestepControl::now
()
const
{
…
}
263
264
265
inline
void
266
TimestepControl::start
(
double
t)
267
{
268
start_val
= t;
269
}
266
TimestepControl::start
(
double
t) {
…
}
270
271
272
inline
void
273
TimestepControl::final
(
double
t)
274
{
275
final_val
= t;
276
}
273
TimestepControl::final
(
double
t) {
…
}
277
278
279
inline
void
280
TimestepControl::tolerance
(
double
t)
281
{
282
tolerance_val
= t;
283
}
280
TimestepControl::tolerance
(
double
t) {
…
}
284
285
286
inline
void
287
TimestepControl::start_step
(
const
double
t)
288
{
289
start_step_val
= t;
290
}
287
TimestepControl::start_step
(
const
double
t) {
…
}
291
292
293
inline
void
294
TimestepControl::max_step
(
double
t)
295
{
296
max_step_val
= t;
297
}
294
TimestepControl::max_step
(
double
t) {
…
}
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
}
301
TimestepControl::restart
() {
…
}
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::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
EnableObserverPointer
Definition
enable_observer_pointer.h:73
ParameterHandler
Definition
parameter_handler.h:856
config.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition
config.h:522
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition
config.h:523
enable_observer_pointer.h
vector_memory.h
Algorithms
Definition
newton.h:37
observer_pointer.h
Generated by
1.9.8