1#ifndef DUNE_FEM_SOLVER_RUNGEKUTTA_EXPLICIT_HH
2#define DUNE_FEM_SOLVER_RUNGEKUTTA_EXPLICIT_HH
62 template<
class DestinationImp>
69 typedef typename DestinationType :: DiscreteFunctionSpaceType
SpaceType;
87 std::cerr<<
"Warning: ExplicitRungeKutta of order "<< order <<
" not implemented, using order 6!" << std::endl;
103 :
A_( butcherTable.A() ),
104 b_( butcherTable.b() ),
105 c_( butcherTable.c() ),
109 ord_( butcherTable.order() ),
110 stages_( butcherTable.stages() ),
168 DUNE_THROW(InvalidStateException,
"ExplicitRungeKuttaSolver wasn't initialized before first call!");
188 for (
int j=0; j<i ; ++j)
206 U0.axpy((
b_[j]*dt), *(
Upd[j]));
212 out <<
"ExplRungeKutta, steps: " <<
ord_
214 <<
"\\\\" <<std::endl;
219 Dune::DynamicMatrix< double >
A_;
220 Dune::DynamicVector< double >
b_;
221 Dune::DynamicVector< double >
c_;
224 std::vector< std::unique_ptr< DestinationType > >
Upd;
Definition: bindguard.hh:11
void axpy(const T &a, const T &x, T &y)
Definition: space/basisfunctionset/functor.hh:38
Definition: multistep.hh:17
SimpleButcherTable< double > expl6ButcherTable()
Definition: butchertable.cc:76
SimpleButcherTable< double > explicitEulerButcherTable()
Definition: butchertable.cc:16
SimpleButcherTable< double > tvd3ButcherTable()
Definition: butchertable.cc:43
SimpleButcherTable< double > tvd2ButcherTable()
Definition: butchertable.cc:29
SimpleButcherTable< double > rk4ButcherTable()
Definition: butchertable.cc:58
static ParameterContainer & container()
Definition: io/parameter.hh:193
interface for time evolution operators
Definition: spaceoperatorif.hh:38
virtual void setTime(const double time)
set time for operators
Definition: spaceoperatorif.hh:76
virtual const DiscreteFunctionSpaceType & space() const =0
return reference to space (needed by ode solvers)
virtual double timeStepEstimate() const
estimate maximum time step
Definition: spaceoperatorif.hh:86
Interface class for ODE Solver.
Definition: odesolverinterface.hh:21
Definition: odesolverinterface.hh:27
void reset()
Definition: odesolverinterface.hh:43
Definition: butchertable.hh:17
Exlicit RungeKutta ODE solver.
Definition: explicit.hh:65
bool initialized_
Definition: explicit.hh:236
OperatorType & op_
Definition: explicit.hh:227
OdeSolverInterface< DestinationImp >::MonitorType MonitorType
Definition: explicit.hh:71
SimpleButcherTable< double > defaultButcherTables(const int order) const
Definition: explicit.hh:75
Dune::DynamicMatrix< double > A_
Definition: explicit.hh:219
DestinationType::DiscreteFunctionSpaceType SpaceType
Definition: explicit.hh:69
ExplicitRungeKuttaSolver(OperatorType &op, TimeProviderBase &tp, const int pord, bool verbose)
constructor
Definition: explicit.hh:130
DestinationImp DestinationType
Definition: explicit.hh:67
void description(std::ostream &out) const
print description of ODE solver to out stream
Definition: explicit.hh:210
std::vector< std::unique_ptr< DestinationType > > Upd
Definition: explicit.hh:224
const int stages_
Definition: explicit.hh:234
TimeProviderBase & tp_
Definition: explicit.hh:229
ExplicitRungeKuttaSolver(OperatorType &op, TimeProviderBase &tp, const SimpleButcherTable< double > &butcherTable, bool verbose)
constructor
Definition: explicit.hh:99
SpaceOperatorInterface< DestinationImp > OperatorType
Definition: explicit.hh:68
Dune::DynamicVector< double > b_
Definition: explicit.hh:220
void solve(DestinationType &U0, MonitorType &monitor)
solve the system
Definition: explicit.hh:160
ExplicitRungeKuttaSolver(OperatorType &op, TimeProviderBase &tp, const int pord, const Dune::Fem::ParameterReader ¶meter=Dune::Fem::Parameter::container())
Definition: explicit.hh:138
Dune::DynamicVector< double > c_
Definition: explicit.hh:221
void initialize(const DestinationType &U0)
apply operator once to get dt estimate
Definition: explicit.hh:146
const int ord_
Definition: explicit.hh:232
general base for time providers
Definition: timeprovider.hh:36
double time() const
obtain the current time
Definition: timeprovider.hh:94
void provideTimeStepEstimate(const double dtEstimate)
set time step estimate to minimum of given value and internal time step estiamte
Definition: timeprovider.hh:142
double deltaT() const
obtain the size of the current time step
Definition: timeprovider.hh:113