46class SimpleTimeIntegrator :
47 public INonlinearTimeIntegrator<TDomain, TAlgebra>,
48 public ITimeDiscDependentObject<TAlgebra>,
49 public DebugWritingObject<TAlgebra>
52 typedef ITimeDiscDependentObject<TAlgebra> tdisc_dep_type;
55 typedef INonlinearTimeIntegrator<TDomain, TAlgebra> base_type;
56 typedef ITimeDiscretization<TAlgebra> time_disc_type;
57 typedef typename TAlgebra::vector_type vector_type;
58 typedef typename base_type::grid_function_type grid_function_type;
59 typedef IGridFunctionSpace<grid_function_type> grid_function_space_type;
60 typedef VectorTimeSeries<typename base_type::vector_type> vector_time_series_type;
63 SimpleTimeIntegrator (SmartPtr<time_disc_type> tDisc)
64 : base_type(), ITimeDiscDependentObject<TAlgebra>(tDisc),
66 m_spDerivative(SPNULL), m_initial_consistency_error(0.0)
72 SmartPtr<time_disc_type> tDisc,
73 SmartPtr<grid_function_space_type> spSpace
75 : base_type(), ITimeDiscDependentObject<TAlgebra>(tDisc),
77 m_spDerivative(SPNULL), m_initial_consistency_error(0.0)
83 SmartPtr<grid_function_type> u1,
85 ConstSmartPtr<grid_function_type> u0,
89 time_disc_type &tdisc = *tdisc_dep_type::m_spTimeDisc;
91 if (tdisc.num_stages() == 1)
94 return apply_multi_stage(u1,t1,u0,t0);
97 void set_derivative(SmartPtr<grid_function_type> udot)
98 { m_spDerivative = udot; }
100 SmartPtr<grid_function_type> get_derivative()
101 {
return m_spDerivative; }
103 number get_consistency_error()
const
104 {
return m_initial_consistency_error; }
106 void set_banach_space(SmartPtr<IGridFunctionSpace<grid_function_type> > spSpace)
113 SmartPtr<grid_function_type> u1,
115 ConstSmartPtr<grid_function_type> u0,
119 bool apply_multi_stage
121 SmartPtr<grid_function_type> u1,
123 ConstSmartPtr<grid_function_type> u0,
127 inline bool hasTerminated(
double tCurrent,
double tStart,
double tFinal)
const
130 return tCurrent >= tFinal || tFinal-tCurrent < (tFinal-tStart)*base_type::m_precisionBound;
136 SmartPtr<grid_function_type> m_spDerivative;
138 number m_initial_consistency_error;