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\}}\)
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:
298 
310  virtual void
311  operator()(AnyData &out, const AnyData &in) override;
312 
316  virtual void
317  notify(const Event &) override;
318 
323  void
325 
329  static void
331 
335  void
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 
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
AnyData
Definition: any_data.h:37
Algorithms::ThetaTimestepping::declare_parameters
static void declare_parameters(ParameterHandler &param)
Algorithms::ThetaTimestepping::op_implicit
SmartPointer< OperatorBase, ThetaTimestepping< VectorType > > op_implicit
Definition: theta_timestepping.h:430
Algorithms::ThetaTimestepping::d_explicit
TimestepData d_explicit
Definition: theta_timestepping.h:400
Algorithms::ThetaTimestepping::implicit_data
const TimestepData & implicit_data() const
Definition: theta_timestepping.h:450
operator.h
Algorithms::ThetaTimestepping::operator()
virtual void operator()(AnyData &out, const AnyData &in) override
Algorithms::OperatorBase
Definition: operator.h:72
Algorithms::ThetaTimestepping::op_explicit
SmartPointer< OperatorBase, ThetaTimestepping< VectorType > > op_explicit
Definition: theta_timestepping.h:418
Algorithms::ThetaTimestepping::output
SmartPointer< OutputOperator< VectorType >, ThetaTimestepping< VectorType > > output
Definition: theta_timestepping.h:436
Algorithms::Event
Definition: event.h:49
Algorithms::TimestepData
Definition: theta_timestepping.h:45
Algorithms::ThetaTimestepping::current_time
double current_time() const
Definition: theta_timestepping.h:491
Algorithms::ThetaTimestepping::explicit_data
const TimestepData & explicit_data() const
Definition: theta_timestepping.h:442
Algorithms::ThetaTimestepping::parse_parameters
void parse_parameters(ParameterHandler &param)
Algorithms::ThetaTimestepping::timestep_control
TimestepControl & timestep_control()
Definition: theta_timestepping.h:458
timestep_control.h
Algorithms::ThetaTimestepping::adaptive
bool adaptive
Definition: theta_timestepping.h:395
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Algorithms::TimestepData::step
double step
The current step size times something.
Definition: theta_timestepping.h:50
smartpointer.h
Algorithms::ThetaTimestepping::vtheta
double vtheta
Definition: theta_timestepping.h:391
Algorithms
Definition: newton.h:36
Algorithms::TimestepControl
Definition: timestep_control.h:61
Algorithms::ThetaTimestepping::control
TimestepControl control
Definition: theta_timestepping.h:385
Algorithms::ThetaTimestepping::ThetaTimestepping
ThetaTimestepping(OperatorBase &op_explicit, OperatorBase &op_implicit)
Algorithms::ThetaTimestepping::set_output
void set_output(OutputOperator< VectorType > &output)
Definition: theta_timestepping.h:465
SmartPointer
Definition: smartpointer.h:68
Algorithms::ThetaTimestepping::notify
virtual void notify(const Event &) override
ParameterHandler
Definition: parameter_handler.h:845
Algorithms::ThetaTimestepping::d_implicit
TimestepData d_implicit
Definition: theta_timestepping.h:405
config.h
Algorithms::ThetaTimestepping
Definition: theta_timestepping.h:289
Algorithms::OutputOperator
Definition: operator.h:113
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Algorithms::ThetaTimestepping::theta
double theta() const
Definition: theta_timestepping.h:473
Algorithms::TimestepData::time
double time
The current time.
Definition: theta_timestepping.h:48