00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _AMRLEVEL_H_ 00012 #define _AMRLEVEL_H_ 00013 00014 #include "REAL.H" 00015 #include "Box.H" 00016 #include "ProblemDomain.H" 00017 #include "DataIterator.H" 00018 #include "Vector.H" 00019 #include "IntVectSet.H" 00020 #include "CH_HDF5.H" 00021 #include "NamespaceHeader.H" 00022 00023 //class HDF5Handle; 00024 //class IntVectSet; 00025 //template <class TTYPE> class Vector; 00026 00028 00046 class AMRLevel 00047 { 00048 public: 00050 00053 AMRLevel(); 00054 00056 00059 virtual 00060 ~AMRLevel(); 00061 00063 00076 virtual 00077 void define(AMRLevel* a_coarser_level_ptr, 00078 const Box& a_problem_domain, 00079 int a_level, 00080 int a_ref_ratio); 00081 00083 00096 virtual 00097 void define(AMRLevel* a_coarser_level_ptr, 00098 const ProblemDomain& a_problem_domain, 00099 int a_level, 00100 int a_ref_ratio); 00101 00103 00106 virtual 00107 void finerLevelPtr(AMRLevel* a_finer_level_ptr); 00108 00110 00113 virtual 00114 void dt(Real a_dt); 00115 00117 00121 virtual 00122 void time(Real a_time); 00123 00125 00129 virtual 00130 Real dt() const; 00131 00133 00136 virtual 00137 Real time() const; 00138 00140 00143 virtual 00144 void initialDtMultiplier(Real a_initial_dt_multiplier); 00145 00147 00150 virtual 00151 Real initialDtMultiplier() const; 00152 00154 00158 virtual 00159 const ProblemDomain& problemDomain() const; 00160 00162 00166 virtual 00167 Vector<Box> boxes() const; 00168 00170 00174 bool isDefined() const; 00175 00177 00181 virtual 00182 int refRatio() const; 00183 00185 00189 static 00190 void verbosity(int a_verbosity); 00191 00193 00198 static 00199 int verbosity(); 00200 00202 00210 virtual 00211 Real advance() = 0; 00212 00214 00221 virtual 00222 void postTimeStep() = 0; 00223 00225 00232 virtual 00233 void tagCells(IntVectSet& a_tags) = 0; 00234 00236 00243 virtual 00244 void tagCellsInit(IntVectSet& a_tags) = 0; 00245 00247 00254 virtual 00255 void preRegrid(int a_base_level, const Vector<Vector<Box> >& a_new_grids); 00256 00257 virtual 00258 void preRegrid(int a_base_level); 00259 00261 00268 virtual 00269 void regrid(const Vector<Box>& a_new_grids) = 0; 00270 00272 00279 virtual 00280 void postRegrid(int a_base_level); 00281 00283 00290 virtual 00291 void initialGrid(const Vector<Box>& a_new_grids) = 0; 00292 00294 00301 virtual 00302 void initialData() = 0; 00303 00305 00312 virtual 00313 void postInitialize() = 0; 00314 00316 00323 virtual 00324 Real computeDt() = 0; 00325 00327 00334 virtual 00335 Real computeInitialDt() = 0; 00336 00337 #ifdef CH_USE_HDF5 00339 00346 virtual 00347 void writeCheckpointHeader (HDF5Handle& a_handle) const = 0; 00348 00350 00357 virtual 00358 void writeCheckpointLevel (HDF5Handle& a_handle) const = 0; 00359 00361 00368 virtual 00369 void readCheckpointHeader (HDF5Handle& a_handle) = 0; 00370 00372 00379 virtual 00380 void readCheckpointLevel (HDF5Handle& a_handle) = 0; 00381 00383 00390 virtual 00391 void writePlotHeader (HDF5Handle& a_handle) const = 0; 00392 00394 00401 virtual 00402 void writePlotLevel (HDF5Handle& a_handle) const = 0; 00403 #endif 00404 00405 Vector<AMRLevel*> getAMRLevelHierarchy(); 00406 00407 protected: 00408 // the problem domain 00409 ProblemDomain m_problem_domain; 00410 00411 // 00412 Vector<Box> m_level_grids; 00413 00414 // the level 00415 int m_level; 00416 00417 // refinement ratio between this level and the next finer 00418 int m_ref_ratio; 00419 00420 // initial time step multipier 00421 Real m_initial_dt_multiplier; 00422 00423 // time step 00424 Real m_dt; 00425 00426 // time 00427 Real m_time; 00428 00429 // pointer to next coarser level 00430 AMRLevel* m_coarser_level_ptr; 00431 00432 // pointer to next finer level 00433 AMRLevel* m_finer_level_ptr; 00434 00435 // verbosity level 00436 static int s_verbosity; 00437 00438 bool m_isDefined; 00439 }; 00440 00441 #include "NamespaceFooter.H" 00442 #endif