Reference documentation for deal.II version Git 92c1895bf8 2020-06-04 17:48:28 -0400
\(\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\}}\)
theta_timestepping.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_theta_timestepping_h
18 #define dealii_theta_timestepping_h
19 
20 #include <deal.II/base/config.h>
21 
24 
26 
28 
29 // Forward declaration
30 #ifndef DOXYGEN
31 class ParameterHandler;
32 #endif
33 
34 namespace Algorithms
35 {
45  struct TimestepData
46  {
48  double time;
50  double step;
51  };
52 
288  template <typename VectorType>
290  {
291  public:
297  ThetaTimestepping(OperatorBase &op_explicit, OperatorBase &op_implicit);
298 
310  virtual void
311  operator()(AnyData &out, const AnyData &in) override;
312 
316  virtual void
317  notify(const Event &) override;
318 
323  void
324  set_output(OutputOperator<VectorType> &output);
325 
329  static void
330  declare_parameters(ParameterHandler &param);
331 
335  void
336  parse_parameters(ParameterHandler &param);
337 
341  double
342  current_time() const;
343 
347  double
348  theta() const;
349 
353  double
354  theta(double new_theta);
355 
362  const TimestepData &
363  explicit_data() const;
364 
371  const TimestepData &
372  implicit_data() const;
373 
378  timestep_control();
379 
380  private:
386 
391  double vtheta;
395  bool adaptive;
396 
401 
406 
407 
419 
431 
437  };
438 
439 
440  template <typename VectorType>
441  inline const TimestepData &
443  {
444  return d_explicit;
445  }
446 
447 
448  template <typename VectorType>
449  inline const TimestepData &
451  {
452  return d_implicit;
453  }
454 
455 
456  template <typename VectorType>
457  inline TimestepControl &
459  {
460  return control;
461  }
462 
463  template <typename VectorType>
464  inline void
466  {
467  output = &out;
468  }
469 
470 
471  template <typename VectorType>
472  inline double
474  {
475  return vtheta;
476  }
477 
478 
479  template <typename VectorType>
480  inline double
482  {
483  const double tmp = vtheta;
484  vtheta = new_theta;
485  return tmp;
486  }
487 
488 
489  template <typename VectorType>
490  inline double
492  {
493  return control.now();
494  }
495 } // namespace Algorithms
496 
498 
499 #endif
TimestepControl & timestep_control()
const TimestepData & explicit_data() const
double time
The current time.
SmartPointer< OperatorBase, ThetaTimestepping< VectorType > > op_implicit
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:361
SmartPointer< OutputOperator< VectorType >, ThetaTimestepping< VectorType > > output
void set_output(OutputOperator< VectorType > &output)
double step
The current step size times something.
SmartPointer< OperatorBase, ThetaTimestepping< VectorType > > op_explicit
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:360
const TimestepData & implicit_data() const