InitCond.h
00001 #ifndef gridripper_amr1d_InitCond_h
00002 #define gridripper_amr1d_InitCond_h
00003
00004 #include "Grid.h"
00005 #include <string>
00006
00007 namespace gridripper { namespace amr1d {
00008
00009 class PDE;
00010 class AMError;
00011
00012 using namespace std;
00013
00020 class InitCond
00021 {
00022 public:
00026 class Exception: public gridripper::Exception
00027 {
00028 public:
00032 Exception(const Exception& other):
00033 gridripper::Exception(other) { }
00034
00040 Exception(const string& msg, const string& where):
00041 gridripper::Exception(msg, where) { }
00042
00048 Exception(const exception& orig, const string& where):
00049 gridripper::Exception(orig, where) { }
00050
00057 Exception(const exception& orig, const string& msg,
00058 const string& where):
00059 gridripper::Exception(orig, msg, where) { }
00060 };
00061
00062 public:
00063
00064 virtual ~InitCond() { }
00065
00078 virtual int init(tvalarray< tvector<Grid*> >& grids, PDE* pde, GReal_t dt,
00079 int r, int maxlevel,
00080 int bufzone, AMError* amerr, double maxerr)
00081 throw(InitCond::Exception&) =0;
00082
00087 virtual GReal_t getTime() const =0;
00088
00094 virtual bool isOnInitialHypersurface() const {
00095 return true;
00096 }
00097
00103 virtual bool isAppended(const string& fname) const {
00104 return false;
00105 }
00106
00111 virtual string getMessage() const {
00112 return "";
00113 }
00114 };
00115
00116 } }
00117
00118 #endif