DOLFIN
DOLFIN C++ interface
RKSolver.h
1 // Copyright (C) 2013 Johan Hake
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2013-02-15
19 // Last changed: 2014-03-05
20 
21 #ifndef __RKSOLVER_H
22 #define __RKSOLVER_H
23 
24 #include <vector>
25 #include <memory>
26 #include <dolfin/fem/Assembler.h>
27 #include <dolfin/la/GenericVector.h>
28 
29 namespace dolfin
30 {
31  // Forward declarations
32  class MultiStageScheme;
33 
35  class RKSolver
36  {
37  public:
38 
41  explicit RKSolver(std::shared_ptr<MultiStageScheme> scheme);
42 
44  void step(double dt);
45 
47  void step_interval(double t0, double t1, double dt);
48 
50  std::shared_ptr<MultiStageScheme> scheme() const
51  {return _scheme;}
52 
53  private:
54 
55  // The MultiStageScheme
56  std::shared_ptr<MultiStageScheme> _scheme;
57 
58  // Temp vector for final stage
59  // FIXME: Add this as a Function called previous step or something
60  std::shared_ptr<GenericVector> _tmp;
61 
62  // Assembler for explicit stages
63  Assembler _assembler;
64 
65  };
66 
67 }
68 
69 #endif
void step(double dt)
Step solver with time step dt.
Definition: RKSolver.cpp:43
Definition: adapt.h:29
This class is a time integrator for general Runge Kutta problems.
Definition: RKSolver.h:35
Definition: Assembler.h:53
void step_interval(double t0, double t1, double dt)
Step solver an interval using dt as time step.
Definition: RKSolver.cpp:108
RKSolver(std::shared_ptr< MultiStageScheme > scheme)
Definition: RKSolver.cpp:37
std::shared_ptr< MultiStageScheme > scheme() const
Return the MultiStageScheme.
Definition: RKSolver.h:50