dune-fem 2.8.0
Loading...
Searching...
No Matches
implicit.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SOLVER_RUNGEKUTTA_IMPLICIT_HH
2#define DUNE_FEM_SOLVER_RUNGEKUTTA_IMPLICIT_HH
3
4//- system includes
5#include <sstream>
6#include <vector>
7
8//- dune-common includes
9#include <dune/common/exceptions.hh>
10
11//- dune-fem includes
15
16namespace DuneODE
17{
18
19 // ImplicitRungeKuttaSolver
20 // ------------------------
21
23 template< class HelmholtzOperator, class NonlinearSolver, class TimeStepControl = ImplicitRungeKuttaTimeStepControl >
25 : public BasicImplicitRungeKuttaSolver< HelmholtzOperator, NonlinearSolver, TimeStepControl >
26 {
29
30 public:
31 typedef HelmholtzOperator HelmholtzOperatorType;
33
34 typedef typename TimeStepControlType::TimeProviderType TimeProviderType;
37
46 TimeProviderType &timeProvider,
47 const SimpleButcherTable< double >& butcherTable,
49 : BaseType( helmholtzOp,
50 butcherTable,
51 TimeStepControlType( timeProvider, ParameterType( parameter ) ),
53 )
54 {}
55
65 TimeProviderType &timeProvider,
66 int order,
67 const ParameterType& tscParam,
68 const NonlinearSolverParameterType& nlsParam )
69 : BaseType( helmholtzOp,
70 defaultButcherTables( tscParam.selectedSolver( order ) ),
71 TimeStepControlType( timeProvider, tscParam ),
72 nlsParam )
73 {}
74
84 TimeProviderType &timeProvider,
85 int order,
87 : BaseType( helmholtzOp,
88 defaultButcherTables( ParameterType( parameter ).selectedSolver( order ) ),
89 TimeStepControlType( timeProvider, ParameterType( parameter ) ),
90 NonlinearSolverParameterType( parameter ) )
91 {}
92
101 TimeProviderType &timeProvider,
102 const ParameterType& tscParam,
103 const NonlinearSolverParameterType& nlsParam )
104 : BaseType( helmholtzOp,
105 defaultButcherTables( tscParam.selectedSolver( 1 ) ),
106 TimeStepControlType( timeProvider, tscParam ),
107 nlsParam )
108 {}
109
117 TimeProviderType &timeProvider,
119 : BaseType( helmholtzOp,
120 defaultButcherTables( ParameterType( parameter ).selectedSolver( 1 ) ),
121 TimeStepControlType( timeProvider, ParameterType( parameter ) ),
122 NonlinearSolverParameterType( parameter ) )
123 {}
124
125 protected:
127 {
128 switch( solverId )
129 {
130 case 1:
132 case 2:
133 return gauss2ButcherTable();
134 case 3:
135 return implicit3ButcherTable();
136 case 4:
137 return implicit34ButcherTable();
138 default:
139 DUNE_THROW( NotImplemented, "Implicit Runge-Kutta method with id " << solverId << " not implemented." );
140 }
141 }
142 };
143
144} // namespace DuneODE
145
146#endif // #ifndef DUNE_FEM_SOLVER_RUNGEKUTTA_IMPLICIT_HH
Definition: multistep.hh:17
SimpleButcherTable< double > implicit34ButcherTable()
Definition: butchertable.cc:121
SimpleButcherTable< double > implicitEulerButcherTable()
Definition: butchertable.cc:155
SimpleButcherTable< double > implicit3ButcherTable()
Definition: butchertable.cc:141
SimpleButcherTable< double > gauss2ButcherTable()
Definition: butchertable.cc:170
static ParameterContainer & container()
Definition: io/parameter.hh:193
Implicit RungeKutta ODE solver.
Definition: basicimplicit.hh:54
NonlinearSolver::ParameterType NonlinearSolverParameterType
Definition: basicimplicit.hh:70
TimeStepControl TimeStepControlType
Definition: basicimplicit.hh:64
TimeStepControlType::ParameterType ParameterType
Definition: basicimplicit.hh:69
Definition: butchertable.hh:17
Implicit RungeKutta ODE solver.
Definition: implicit.hh:26
ImplicitRungeKuttaSolver(HelmholtzOperatorType &helmholtzOp, TimeProviderType &timeProvider, const Dune::Fem::ParameterReader &parameter=Dune::Fem::Parameter::container())
constructor
Definition: implicit.hh:116
static SimpleButcherTable< double > defaultButcherTables(const int solverId)
Definition: implicit.hh:126
BaseType::NonlinearSolverParameterType NonlinearSolverParameterType
Definition: implicit.hh:36
ImplicitRungeKuttaSolver(HelmholtzOperatorType &helmholtzOp, TimeProviderType &timeProvider, const SimpleButcherTable< double > &butcherTable, const Dune::Fem::ParameterReader &parameter=Dune::Fem::Parameter::container())
constructor
Definition: implicit.hh:45
BaseType::TimeStepControlType TimeStepControlType
Definition: implicit.hh:32
ImplicitRungeKuttaSolver(HelmholtzOperatorType &helmholtzOp, TimeProviderType &timeProvider, const ParameterType &tscParam, const NonlinearSolverParameterType &nlsParam)
constructor
Definition: implicit.hh:100
TimeStepControlType::TimeProviderType TimeProviderType
Definition: implicit.hh:34
ImplicitRungeKuttaSolver(HelmholtzOperatorType &helmholtzOp, TimeProviderType &timeProvider, int order, const Dune::Fem::ParameterReader &parameter=Dune::Fem::Parameter::container())
constructor
Definition: implicit.hh:83
BaseType::ParameterType ParameterType
Definition: implicit.hh:35
HelmholtzOperator HelmholtzOperatorType
Definition: implicit.hh:31
ImplicitRungeKuttaSolver(HelmholtzOperatorType &helmholtzOp, TimeProviderType &timeProvider, int order, const ParameterType &tscParam, const NonlinearSolverParameterType &nlsParam)
constructor
Definition: implicit.hh:64