UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ode.hpp
1 /* ode.hpp */
2 /* $Id$ */
3 #ifndef __ode_hpp
4 #define __ode_hpp
5 
6 #include <vector>
7 #include <utility>
8 
10 namespace ode
11 {
13  template <typename T, typename X, typename F> class Solver1D
14  {
15  public:
16 
18  virtual ~Solver1D(){;}
19 
21  bool operator()(const T &t,
22  const T &dt,
23  F &f,
24  X &x,
25  X &dx
26  ) const
27  {return step(t, dt, f, x, dx);}
28 
29  protected:
30 
32  virtual bool step(const T &t,
33  const T &dt,
34  F &f,
35  X &x,
36  X &dx
37  ) const = 0;
38  };
39 
41  template <typename T, typename X, typename F> class Solver
42  {
43  public:
44 
46  virtual ~Solver(){;}
47 
49  bool operator()(const T &t,
50  const T &dt,
51  const std::vector<F> &f,
52  std::vector<X> &x,
53  std::vector<X> &dx
54  ) const
55  {return step(t, dt, f, x, dx);}
56 
57  protected:
58 
60  virtual bool step(const T &t,
61  const T &dt,
62  const std::vector<F> &f,
63  std::vector<X> &x,
64  std::vector<X> &dx
65  ) const = 0;
66  };
67 };
68 
69 #endif /* ode.hpp */
virtual ~Solver1D()
Definition: ode.hpp:18
bool operator()(const T &t, const T &dt, const std::vector< F > &f, std::vector< X > &x, std::vector< X > &dx) const
Definition: ode.hpp:49
bool operator()(const T &t, const T &dt, F &f, X &x, X &dx) const
Definition: ode.hpp:21
Definition: ode.hpp:41
virtual bool step(const T &t, const T &dt, F &f, X &x, X &dx) const =0
virtual ~Solver()
Definition: ode.hpp:46
virtual bool step(const T &t, const T &dt, const std::vector< F > &f, std::vector< X > &x, std::vector< X > &dx) const =0
Definition: ode.hpp:13