00001 // -*- C++ -*- 00002 00003 // Copyright (C) 2002 Ralf Deiterding 00004 // Brandenburgische Universitaet Cottbus 00005 // 00006 // Copyright (C) 2003-2007 California Institute of Technology 00007 // Ralf Deiterding, ralf@cacr.caltech.edu 00008 00009 #ifndef AMROC_AMRBASE_H 00010 #define AMROC_AMRBASE_H 00011 00025 template <class VectorType,int dim> 00026 class AMRBase : public controlable { 00027 public: 00028 typedef GridFunction<VectorType,dim> vec_grid_fct_type; 00029 typedef GridData<VectorType,dim> vec_grid_data_type; 00030 00031 AMRBase() : 00032 _Equations(VectorType::Length()), _Ghosts(0), _Dim(dim) { 00033 _Hierarchy = (GridHierarchy*) 0; 00034 } 00035 00036 virtual ~AMRBase() {} 00037 00038 virtual void register_at(ControlDevice& Ctrl) {} 00039 virtual void register_at(ControlDevice& Ctrl, const std::string& prefix) {} 00040 virtual void init() {} 00041 virtual void update() {} 00042 virtual void finish() {} 00043 00044 virtual void SetupData(GridHierarchy* gh, const int& ghosts) { 00045 _Hierarchy = gh; 00046 _Ghosts = ghosts; 00047 } 00048 00049 GridHierarchy& GH() { return *_Hierarchy; } 00050 const GridHierarchy& GH() const { return *_Hierarchy; } 00051 00052 const int& NEquations() const { return _Equations; } 00053 const int& NGhosts() const { return _Ghosts; } 00054 const int& Dim() const { return _Dim; } 00055 00056 protected: 00057 int _Equations; 00058 int _Ghosts; 00059 int _Dim; 00060 GridHierarchy* _Hierarchy; 00061 ControlDevice LocCtrl; 00062 }; 00063 00064 00065 #endif