Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
theta_timestepping.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 2018 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/algorithms/operator.h>
21 #include <deal.II/algorithms/timestep_control.h>
22 
23 #include <deal.II/base/smartpointer.h>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
27 class ParameterHandler;
28 
29 namespace Algorithms
30 {
40  struct TimestepData
41  {
43  double time;
45  double step;
46  };
47 
190  template <typename VectorType>
192  {
193  public:
200 
212  virtual void
213  operator()(AnyData &out, const AnyData &in) override;
214 
218  virtual void
219  notify(const Event &) override;
220 
225  void
227 
231  static void
233 
237  void
239 
243  double
244  current_time() const;
245 
249  double
250  theta() const;
251 
255  double
256  theta(double new_theta);
257 
264  const TimestepData &
265  explicit_data() const;
266 
273  const TimestepData &
274  implicit_data() const;
275 
281 
282  private:
288 
293  double vtheta;
297  bool adaptive;
298 
303 
308 
309 
321 
333 
339  };
340 
341 
342  template <typename VectorType>
343  inline const TimestepData &
345  {
346  return d_explicit;
347  }
348 
349 
350  template <typename VectorType>
351  inline const TimestepData &
353  {
354  return d_implicit;
355  }
356 
357 
358  template <typename VectorType>
359  inline TimestepControl &
361  {
362  return control;
363  }
364 
365  template <typename VectorType>
366  inline void
368  {
369  output = &out;
370  }
371 
372 
373  template <typename VectorType>
374  inline double
376  {
377  return vtheta;
378  }
379 
380 
381  template <typename VectorType>
382  inline double
384  {
385  const double tmp = vtheta;
386  vtheta = new_theta;
387  return tmp;
388  }
389 
390 
391  template <typename VectorType>
392  inline double
394  {
395  return control.now();
396  }
397 } // namespace Algorithms
398 
399 DEAL_II_NAMESPACE_CLOSE
400 
401 #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:332
Algorithms::ThetaTimestepping::d_explicit
TimestepData d_explicit
Definition: theta_timestepping.h:302
Algorithms::ThetaTimestepping::implicit_data
const TimestepData & implicit_data() const
Definition: theta_timestepping.h:352
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:320
Algorithms::ThetaTimestepping::output
SmartPointer< OutputOperator< VectorType >, ThetaTimestepping< VectorType > > output
Definition: theta_timestepping.h:338
Algorithms::Event
Definition: event.h:49
Algorithms::TimestepData
Definition: theta_timestepping.h:40
Algorithms::ThetaTimestepping::current_time
double current_time() const
Definition: theta_timestepping.h:393
Algorithms::ThetaTimestepping::explicit_data
const TimestepData & explicit_data() const
Definition: theta_timestepping.h:344
Algorithms::ThetaTimestepping::parse_parameters
void parse_parameters(ParameterHandler &param)
Algorithms::ThetaTimestepping::timestep_control
TimestepControl & timestep_control()
Definition: theta_timestepping.h:360
Algorithms::ThetaTimestepping::adaptive
bool adaptive
Definition: theta_timestepping.h:297
Algorithms::TimestepData::step
double step
The current step size times something.
Definition: theta_timestepping.h:45
Algorithms::ThetaTimestepping::vtheta
double vtheta
Definition: theta_timestepping.h:293
Algorithms
Definition: newton.h:31
Algorithms::TimestepControl
Definition: timestep_control.h:52
Algorithms::ThetaTimestepping::control
TimestepControl control
Definition: theta_timestepping.h:287
Algorithms::ThetaTimestepping::ThetaTimestepping
ThetaTimestepping(OperatorBase &op_explicit, OperatorBase &op_implicit)
Algorithms::ThetaTimestepping::set_output
void set_output(OutputOperator< VectorType > &output)
Definition: theta_timestepping.h:367
SmartPointer
Definition: smartpointer.h:68
Algorithms::ThetaTimestepping::notify
virtual void notify(const Event &) override
ParameterHandler
Definition: parameter_handler.h:844
Algorithms::ThetaTimestepping::d_implicit
TimestepData d_implicit
Definition: theta_timestepping.h:307
Algorithms::ThetaTimestepping
Definition: theta_timestepping.h:191
Algorithms::OutputOperator
Definition: operator.h:112
Algorithms::ThetaTimestepping::theta
double theta() const
Definition: theta_timestepping.h:375
Algorithms::TimestepData::time
double time
The current time.
Definition: theta_timestepping.h:43