00001 /* _______ __ 00002 / ___/ / ___ __ _ / / ___ 00003 / /__/ _ \/ _ \/ ' \/ _ \/ _ \ 00004 \___/_//_/\___/_/_/_/_.__/\___/ 00005 */ 00006 // 00007 // This software is copyright (C) by the Lawrence Berkeley 00008 // National Laboratory. Permission is granted to reproduce 00009 // this software for non-commercial purposes provided that 00010 // this notice is left intact. 00011 // 00012 // It is acknowledged that the U.S. Government has rights to 00013 // this software under Contract DE-AC03-765F00098 between 00014 // the U.S. Department of Energy and the University of 00015 // California. 00016 // 00017 // This software is provided as a professional and academic 00018 // contribution for joint exchange. Thus it is experimental, 00019 // is provided ``as is'', with no warranties of any kind 00020 // whatsoever, no support, no promise of updates, or printed 00021 // documentation. By using this software, you acknowledge 00022 // that the Lawrence Berkeley National Laboratory and 00023 // Regents of the University of California shall have no 00024 // liability with respect to the infringement of other 00025 // copyrights by any part of this software. 00026 // 00027 00028 #ifndef _AMRLEVEL_H_ 00029 #define _AMRLEVEL_H_ 00030 00031 #include "REAL.H" 00032 #include "Box.H" 00033 #include "DisjointBoxLayout.H" 00034 #include "ProblemDomain.H" 00035 00036 class HDF5Handle; 00037 class IntVectSet; 00038 template <class TTYPE> class Vector; 00039 00041 00059 class AMRLevel 00060 { 00061 public: 00063 00066 AMRLevel(); 00067 00069 00072 virtual 00073 ~AMRLevel(); 00074 00076 00089 virtual 00090 void define(AMRLevel* a_coarser_level_ptr, 00091 const Box& a_problem_domain, 00092 int a_level, 00093 int a_ref_ratio); 00094 00096 00109 virtual 00110 void define(AMRLevel* a_coarser_level_ptr, 00111 const ProblemDomain& a_problem_domain, 00112 int a_level, 00113 int a_ref_ratio); 00114 00116 00119 virtual 00120 void finerLevelPtr(AMRLevel* a_finer_level_ptr); 00121 00123 00126 virtual 00127 void dt(Real a_dt); 00128 00130 00134 virtual 00135 void time(Real a_time); 00136 00138 00142 virtual 00143 Real dt() const; 00144 00146 00149 virtual 00150 Real time() const; 00151 00153 00156 virtual 00157 void initialDtMultiplier(Real a_initial_dt_multiplier); 00158 00160 00163 virtual 00164 Real initialDtMultiplier() const; 00165 00167 00171 virtual 00172 const ProblemDomain& problemDomain() const; 00173 00175 00179 virtual 00180 Vector<Box> boxes() const; 00181 00183 00187 bool isDefined() const; 00188 00190 00194 virtual 00195 int refRatio() const; 00196 00198 00202 static 00203 void verbosity(int a_verbosity); 00204 00206 00211 static 00212 int verbosity(); 00213 00215 00222 virtual 00223 Real advance() = 0; 00224 00226 00233 virtual 00234 void postTimeStep() = 0; 00235 00237 00244 virtual 00245 void tagCells(IntVectSet& a_tags) = 0; 00246 00248 00255 virtual 00256 void tagCellsInit(IntVectSet& a_tags) = 0; 00257 00259 00266 virtual 00267 void regrid(const Vector<Box>& a_new_grids) = 0; 00268 00270 00277 virtual 00278 void postRegrid(int a_base_level); 00279 00281 00288 virtual 00289 void initialGrid(const Vector<Box>& a_new_grids) = 0; 00290 00292 00299 virtual 00300 void initialData() = 0; 00301 00303 00310 virtual 00311 void postInitialize() = 0; 00312 00314 00321 virtual 00322 Real computeDt() = 0; 00323 00325 00332 virtual 00333 Real computeInitialDt() = 0; 00334 00335 #ifdef HDF5 00336 00337 00344 virtual 00345 void writeCheckpointHeader (HDF5Handle& a_handle) const = 0; 00346 00348 00355 virtual 00356 void writeCheckpointLevel (HDF5Handle& a_handle) const = 0; 00357 00359 00366 virtual 00367 void readCheckpointHeader (HDF5Handle& a_handle) = 0; 00368 00370 00377 virtual 00378 void readCheckpointLevel (HDF5Handle& a_handle) = 0; 00379 00381 00388 virtual 00389 void writePlotHeader (HDF5Handle& a_handle) const = 0; 00390 00392 00399 virtual 00400 void writePlotLevel (HDF5Handle& a_handle) const = 0; 00401 #endif 00402 00403 protected: 00404 // the problem domain 00405 ProblemDomain m_problem_domain; 00406 00407 // 00408 Vector<Box> m_level_grids; 00409 00410 // the level 00411 int m_level; 00412 00413 // refinement ratio 00414 int m_ref_ratio; 00415 00416 // initial time step multipier 00417 Real m_initial_dt_multiplier; 00418 00419 // time step 00420 Real m_dt; 00421 00422 // time 00423 Real m_time; 00424 00425 // pointer to next coarser level 00426 AMRLevel* m_coarser_level_ptr; 00427 00428 // pointer to next finer level 00429 AMRLevel* m_finer_level_ptr; 00430 00431 // verbosity level 00432 static int s_verbosity; 00433 00434 bool m_isDefined; 00435 }; 00436 #endif