MathTL
|
00001 // -*- c++ -*- 00002 00003 // +--------------------------------------------------------------------+ 00004 // | This file is part of MathTL - the Mathematical Template Library | 00005 // | | 00006 // | Copyright (c) 2002-2009 | 00007 // | Thorsten Raasch, Manuel Werner | 00008 // +--------------------------------------------------------------------+ 00009 00010 #ifndef _MATHTL_ONESTEPSCHEME_H 00011 #define _MATHTL_ONESTEPSCHEME_H 00012 00013 #include <list> 00014 #include <map> 00015 #include <numerics/ivp.h> 00016 00017 namespace MathTL 00018 { 00037 template <class VECTOR> 00038 class OneStepScheme 00039 { 00040 public: 00044 virtual ~OneStepScheme() = 0; 00045 00050 virtual void increment(const AbstractIVP<VECTOR>* ivp, 00051 const double t_m, const VECTOR& u_m, 00052 const double tau, 00053 VECTOR& u_mplus1, 00054 VECTOR& error_estimate, 00055 const double tolerance = 1e-2) const = 0; 00056 00060 virtual int order() const = 0; 00061 }; 00062 00066 template <class VECTOR> 00067 class IVPSolution 00068 { 00069 public: 00070 std::list<double> t; 00071 std::list<VECTOR> u; 00072 }; 00073 00083 template <class VECTOR> 00084 void solve_IVP(const AbstractIVP<VECTOR>* ivp, 00085 const OneStepScheme<VECTOR>* scheme, 00086 const double T, 00087 const double atol, 00088 const double rtol, 00089 const double q, 00090 const double tau_max, 00091 IVPSolution<VECTOR>& result); 00092 } 00093 00094 #include <numerics/one_step_scheme.cpp> 00095 00096 #endif