00001 // strategy for timestepping 00002 00003 #ifndef timestpStrg_hh 00004 #define timestpStrg_hh 00005 00006 #include "basics/typedefs.hh" 00007 #include "operator/compositions.hh" 00008 #include "function/vector.hh" 00009 #include "operator/solverFabric.hh" 00010 00011 namespace timestepping { 00012 00013 using concepts::Real; 00014 00015 class TimeStepping; 00016 00017 // ****************************************************** TimeStepStrategy ** 00018 00029 class TimeStepStrategy : public concepts::OutputOperator { 00030 public: 00036 TimeStepStrategy(concepts::SolverFabric<Real>& fabric, 00037 concepts::Operator<Real>* lhs, 00038 const concepts::Vector<Real>& sol, 00039 const concepts::Vector<Real>& rhs, 00040 Real dt) : 00041 solver_(fabric(*lhs)), 00042 liCo_(lhs), 00043 sol_(sol), 00044 rhs_(rhs), 00045 dt_(dt), 00046 t_(0) {} 00047 protected: 00048 friend class TimeStepping; 00053 virtual void next() = 0; 00055 std::auto_ptr<concepts::Operator<Real> > solver_; 00061 concepts::Operator<Real>* liCo_; 00066 concepts::Vector<Real> sol_; // sol_ = Y(t_n) 00071 concepts::Vector<Real> rhs_; // rhs_ = rhs(t_n) 00073 Real dt_; // dt_ = t_n - t_{n-1}, 00075 Real t_; // t_ = t_n 00076 }; 00077 00078 } 00079 00080 #endif // timestpStrg_hh