rungekutta2.hh

Go to the documentation of this file.
1 
6 #ifndef rungekutta2_hh
7 #define rungekutta2_hh
8 
9 #include "basics/typedefs.hh"
10 #include "function/vector.hh"
11 #include "strategy.hh"
12 
13 namespace concepts {
14  template<typename F>
15  class Operator;
16 }
17 
18 namespace timestepping {
19 
20  using concepts::Real;
21 
22  class TimeVector;
23 
24  // ************************************************* Runge Kutta 2nd order **
25 
37  class RungeKutta2 : public TimeStepStrategy {
38  public:
52  const concepts::Vector<Real>& Y0,
53  Real dt,
54  Real alpha = 0.5);
55  virtual ~RungeKutta2();
56  protected:
57  virtual std::ostream& info(std::ostream& os) const;
58  virtual void next();
59  private:
65  concepts::Vector<Real> Yn1_; // Yn1 = Y(t_{n-1})
68  };
69 
70 }
71 
72 #endif // rungekutta2_hh
73 
Timestep strategy for the explicit 2nd order RungeKutta algorithm to solve first order problems in ti...
Definition: rungekutta2.hh:37
virtual void next()
The overloaded member function next() has to calculate the new right hand side and to release the sol...
Timestepping methods used to solve PDEs in time and space.
Definition: alpha.hh:18
RungeKutta2(concepts::SolverFabric< Real > &fabric, concepts::Operator< Real > &D1, concepts::Operator< Real > &D0, timestepping::TimeVector &trhs, const concepts::Vector< Real > &Y0, Real dt, Real alpha=0.5)
Constructor.
timestepping::TimeVector & trhs_
External driver function.
Definition: rungekutta2.hh:63
Abstract strategy class for the class Timestepping.
Definition: strategy.hh:32
concepts::Vector< Real > Yn1_
Store the latest timestep.
Definition: rungekutta2.hh:65
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Operator< Real > & D0_
Space operator.
Definition: rungekutta2.hh:61
Class implementing time dependent vectors.
Definition: vectors.hh:53
Real alpha_
Parameters of the scheme.
Definition: rungekutta2.hh:67
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich