00001 //************************************************************************************// 00002 // Module : ab.hpp 00003 // Date : 11/8/04 (DLR) 00004 // Copyright : 2004-2006 Copyright University Corporation for Atmospheric 00005 // Research 00006 // Description : Encapsulates the methods and data associated with 00007 // specifying and computing coefficients in an 00008 // Adams-Bashforth scheme with variable timestep. 00009 // Derived From : none. 00010 // Modifications: 00011 //************************************************************************************// 00012 #if !defined(AB_HPP) 00013 #define AB_HPP 00014 00015 #include "gtbuffer.hpp" 00016 00017 00018 class AB 00019 { 00020 public: 00021 AB(GSHORT iorder=2); 00022 ~AB(); 00023 AB(const AB &a); 00024 00025 void SetOrder(GSHORT iorder); 00026 void SetTimestepHistory(GDBuffer *dthist); 00027 GDBuffer *GetCoeffs(); 00028 GDBuffer *GetTimestepHistory(); 00029 void ComputeCoeffs(); 00030 friend ostream& operator<<(ostream&, AB &); // Output stream operator 00031 GDOUBLE &operator()(const GSHORT i); 00032 GDOUBLE &operator[](const GSHORT i); 00033 00034 00035 00036 private: 00037 // Private methods: 00038 00039 // Private data: 00040 GSHORT iorder_; // specified AB order 00041 GSHORT maxorder_; // max AB order allowed by class 00042 GDBuffer coeffs_; // buffer of AB coeffs 00043 GDBuffer *dthist_; // timestep history pointer, managed outside of class 00044 }; 00045 #endif 00046