Reference documentation for deal.II version 9.2.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\}}\)
timestep_control.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_time_step_control_h
18 #define dealii_time_step_control_h
19 
20 #include <deal.II/base/config.h>
21 
24 
26 
27 #include <cstdio>
28 
30 
31 // Forward declaration
32 #ifndef DOXYGEN
33 class ParameterHandler;
34 #endif
35 
36 namespace Algorithms
37 {
62  {
63  public:
67  TimestepControl(double start = 0.,
68  double final = 1.,
69  double tolerance = 1.e-2,
70  double start_step = 1.e-2,
71  double print_step = -1.,
72  double max_step = 1.);
73 
77  static void
79 
87  void
89 
93  double
94  start() const;
99  double
100  final() const;
104  double
105  tolerance() const;
109  double
110  step() const;
111 
115  double
116  now() const;
117 
122  bool
123  advance();
124 
128  void
129  start(double);
133  void
134  final(double);
138  void
139  tolerance(double);
140 
148  void
149  start_step(const double step);
150 
154  void
155  max_step(double);
156 
161  void
162  restart();
163 
167  bool
168  print();
169 
170  private:
174  double start_val;
175 
179  double final_val;
180 
185 
190 
194  double max_step_val;
195 
199  double min_step_val;
200 
206 
211  double step_val;
212 
216  double now_val;
217 
222  double print_step;
223 
228  };
229 
230 
231  inline double
233  {
234  return start_val;
235  }
236 
237 
238  inline double
240  {
241  return final_val;
242  }
243 
244 
245  inline double
247  {
248  return current_step_val;
249  }
250 
251 
252  inline double
254  {
255  return tolerance_val;
256  }
257 
258 
259  inline double
261  {
262  return now_val;
263  }
264 
265 
266  inline void
268  {
269  start_val = t;
270  }
271 
272 
273  inline void
275  {
276  final_val = t;
277  }
278 
279 
280  inline void
282  {
283  tolerance_val = t;
284  }
285 
286 
287  inline void
289  {
290  start_step_val = t;
291  }
292 
293 
294  inline void
296  {
297  max_step_val = t;
298  }
299 
300 
301  inline void
303  {
304  now_val = start_val;
307  if (print_step > 0.)
309  else
310  next_print_val = now_val - 1.;
311  }
312 
313 } // namespace Algorithms
314 
316 
317 #endif
Algorithms::TimestepControl::advance
bool advance()
Definition: timestep_control.cc:77
Algorithms::TimestepControl::tolerance
double tolerance() const
Definition: timestep_control.h:253
Algorithms::TimestepControl::min_step_val
double min_step_val
Definition: timestep_control.h:199
Algorithms::TimestepControl::restart
void restart()
Definition: timestep_control.h:302
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:25
Algorithms::TimestepControl::tolerance_val
double tolerance_val
Definition: timestep_control.h:184
Algorithms::TimestepControl::next_print_val
double next_print_val
Definition: timestep_control.h:227
Algorithms::TimestepControl::declare_parameters
static void declare_parameters(ParameterHandler &param)
Definition: timestep_control.cc:51
Physics::Elasticity::Kinematics::e
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Algorithms::TimestepControl::print
bool print()
Definition: timestep_control.cc:102
Algorithms::TimestepControl::print_step
double print_step
Definition: timestep_control.h:222
Algorithms::TimestepControl::start_val
double start_val
Definition: timestep_control.h:174
Algorithms::TimestepControl::start
double start() const
Definition: timestep_control.h:232
Subscriptor
Definition: subscriptor.h:62
Algorithms::TimestepControl::now
double now() const
Definition: timestep_control.h:260
Algorithms::TimestepControl::start_step_val
double start_step_val
Definition: timestep_control.h:189
Algorithms::TimestepControl::current_step_val
double current_step_val
Definition: timestep_control.h:205
Algorithms::TimestepControl::start_step
void start_step(const double step)
Definition: timestep_control.h:288
double
subscriptor.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Algorithms::TimestepControl::max_step
void max_step(double)
Definition: timestep_control.h:295
Algorithms::TimestepControl::max_step_val
double max_step_val
Definition: timestep_control.h:194
Algorithms::TimestepControl::final
double final() const
Definition: timestep_control.h:239
smartpointer.h
Algorithms
Definition: newton.h:36
Algorithms::TimestepControl
Definition: timestep_control.h:61
Algorithms::TimestepControl::parse_parameters
void parse_parameters(ParameterHandler &param)
Definition: timestep_control.cc:64
Algorithms::TimestepControl::step_val
double step_val
Definition: timestep_control.h:211
Algorithms::TimestepControl::final_val
double final_val
Definition: timestep_control.h:179
vector_memory.h
ParameterHandler
Definition: parameter_handler.h:845
config.h
Algorithms::TimestepControl::step
double step() const
Definition: timestep_control.h:246
Algorithms::TimestepControl::now_val
double now_val
Definition: timestep_control.h:216
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359