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
include
deal.II
algorithms
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
19
#include <
deal.II/base/enable_observer_pointer.h
>
20
#include <
deal.II/base/observer_pointer.h
>
21
22
#include <
deal.II/lac/vector_memory.h
>
23
24
#include <cstdio>
25
26
DEAL_II_NAMESPACE_OPEN
27
28
// Forward declaration
29
#ifndef DOXYGEN
30
class
ParameterHandler
;
31
#endif
32
33
namespace
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
75
declare_parameters
(
ParameterHandler
¶m);
76
84
void
85
parse_parameters
(
const
ParameterHandler
¶m);
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
181
double
tolerance_val
;
182
186
double
start_step_val
;
187
191
double
max_step_val
;
192
196
double
min_step_val
;
197
202
double
current_step_val
;
203
208
double
step_val
;
209
213
double
now_val
;
214
219
double
print_step
;
220
224
double
next_print_val
;
225
};
226
227
228
inline
double
229
TimestepControl::start
()
const
230
{
231
return
start_val
;
232
}
233
234
235
inline
double
236
TimestepControl::final
()
const
237
{
238
return
final_val
;
239
}
240
241
242
inline
double
243
TimestepControl::step
()
const
244
{
245
return
current_step_val
;
246
}
247
248
249
inline
double
250
TimestepControl::tolerance
()
const
251
{
252
return
tolerance_val
;
253
}
254
255
256
inline
double
257
TimestepControl::now
()
const
258
{
259
return
now_val
;
260
}
261
262
263
inline
void
264
TimestepControl::start
(
double
t)
265
{
266
start_val
= t;
267
}
268
269
270
inline
void
271
TimestepControl::final
(
double
t)
272
{
273
final_val
= t;
274
}
275
276
277
inline
void
278
TimestepControl::tolerance
(
double
t)
279
{
280
tolerance_val
= t;
281
}
282
283
284
inline
void
285
TimestepControl::start_step
(
const
double
t)
286
{
287
start_step_val
= t;
288
}
289
290
291
inline
void
292
TimestepControl::max_step
(
double
t)
293
{
294
max_step_val
= t;
295
}
296
297
298
inline
void
299
TimestepControl::restart
()
300
{
301
now_val
=
start_val
;
302
step_val
=
start_step_val
;
303
current_step_val
=
step_val
;
304
if
(
print_step
> 0.)
305
next_print_val
=
now_val
+
print_step
;
306
else
307
next_print_val
=
now_val
- 1.;
308
}
309
310
}
// namespace Algorithms
311
312
DEAL_II_NAMESPACE_CLOSE
313
314
#endif
Algorithms::TimestepControl::start
double start() const
Definition
timestep_control.h:229
Algorithms::TimestepControl::parse_parameters
void parse_parameters(const ParameterHandler ¶m)
Definition
timestep_control.cc:66
Algorithms::TimestepControl::final
double final() const
Definition
timestep_control.h:236
Algorithms::TimestepControl::current_step_val
double current_step_val
Definition
timestep_control.h:202
Algorithms::TimestepControl::final_val
double final_val
Definition
timestep_control.h:176
Algorithms::TimestepControl::tolerance
double tolerance() const
Definition
timestep_control.h:250
Algorithms::TimestepControl::step_val
double step_val
Definition
timestep_control.h:208
Algorithms::TimestepControl::now_val
double now_val
Definition
timestep_control.h:213
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:27
Algorithms::TimestepControl::max_step_val
double max_step_val
Definition
timestep_control.h:191
Algorithms::TimestepControl::min_step_val
double min_step_val
Definition
timestep_control.h:196
Algorithms::TimestepControl::now
double now() const
Definition
timestep_control.h:257
Algorithms::TimestepControl::print
bool print()
Definition
timestep_control.cc:104
Algorithms::TimestepControl::start_step_val
double start_step_val
Definition
timestep_control.h:186
Algorithms::TimestepControl::restart
void restart()
Definition
timestep_control.h:299
Algorithms::TimestepControl::start_step
void start_step(const double step)
Definition
timestep_control.h:285
Algorithms::TimestepControl::step
double step() const
Definition
timestep_control.h:243
Algorithms::TimestepControl::tolerance_val
double tolerance_val
Definition
timestep_control.h:181
Algorithms::TimestepControl::start_val
double start_val
Definition
timestep_control.h:171
Algorithms::TimestepControl::print_step
double print_step
Definition
timestep_control.h:219
Algorithms::TimestepControl::next_print_val
double next_print_val
Definition
timestep_control.h:224
Algorithms::TimestepControl::max_step
void max_step(double)
Definition
timestep_control.h:292
Algorithms::TimestepControl::declare_parameters
static void declare_parameters(ParameterHandler ¶m)
Definition
timestep_control.cc:53
EnableObserverPointer::EnableObserverPointer
EnableObserverPointer()
Definition
enable_observer_pointer.h:303
ParameterHandler
Definition
parameter_handler.h:854
config.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition
config.h:38
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition
config.h:39
enable_observer_pointer.h
vector_memory.h
Algorithms
Definition
newton.h:35
observer_pointer.h
advance
void advance(std::tuple< I1, I2 > &t, const unsigned int n)
Definition
synchronous_iterator.h:155
Generated by
1.16.1