00001 /* _______ __
00002 / ___/ / ___ __ _ / / ___
00003 / /__/ _ \/ _ \/ V \/ _ \/ _ \
00004 \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 // CHOMBO Copyright (c) 2000-2004, The Regents of the University of
00007 // California, through Lawrence Berkeley National Laboratory (subject to
00008 // receipt of any required approvals from U.S. Dept. of Energy). All
00009 // rights reserved.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are met:
00013 //
00014 // (1) Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 // (2) Redistributions in binary form must reproduce the above copyright
00017 // notice, this list of conditions and the following disclaimer in the
00018 // documentation and/or other materials provided with the distribution.
00019 // (3) Neither the name of Lawrence Berkeley National Laboratory, U.S.
00020 // Dept. of Energy nor the names of its contributors may be used to endorse
00021 // or promote products derived from this software without specific prior
00022 // written permission.
00023 //
00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035 //
00036 // You are under no obligation whatsoever to provide any bug fixes,
00037 // patches, or upgrades to the features, functionality or performance of
00038 // the source code ("Enhancements") to anyone; however, if you choose to
00039 // make your Enhancements available either publicly, or directly to
00040 // Lawrence Berkeley National Laboratory, without imposing a separate
00041 // written license agreement for such Enhancements, then you hereby grant
00042 // the following license: a non-exclusive, royalty-free perpetual license
00043 // to install, use, modify, prepare derivative works, incorporate into
00044 // other computer software, distribute, and sublicense such Enhancements or
00045 // derivative works thereof, in binary and source code form.
00046 //
00047 // TRADEMARKS. Product and company names mentioned herein may be the
00048 // trademarks of their respective owners. Any rights not expressly granted
00049 // herein are reserved.
00050 //
00051
00052 #ifndef _AMRLEVEL_H_
00053 #define _AMRLEVEL_H_
00054
00055 #include "REAL.H"
00056 #include "Box.H"
00057 #include "DisjointBoxLayout.H"
00058 #include "ProblemDomain.H"
00059
00060 class HDF5Handle;
00061 class IntVectSet;
00062 template <class TTYPE> class Vector;
00063
00065
00083 class AMRLevel
00084 {
00085 public:
00087
00090 AMRLevel();
00091
00093
00096 virtual
00097 ~AMRLevel();
00098
00100
00113 virtual
00114 void define(AMRLevel* a_coarser_level_ptr,
00115 const Box& a_problem_domain,
00116 int a_level,
00117 int a_ref_ratio);
00118
00120
00133 virtual
00134 void define(AMRLevel* a_coarser_level_ptr,
00135 const ProblemDomain& a_problem_domain,
00136 int a_level,
00137 int a_ref_ratio);
00138
00140
00143 virtual
00144 void finerLevelPtr(AMRLevel* a_finer_level_ptr);
00145
00147
00150 virtual
00151 void dt(Real a_dt);
00152
00154
00158 virtual
00159 void time(Real a_time);
00160
00162
00166 virtual
00167 Real dt() const;
00168
00170
00173 virtual
00174 Real time() const;
00175
00177
00180 virtual
00181 void initialDtMultiplier(Real a_initial_dt_multiplier);
00182
00184
00187 virtual
00188 Real initialDtMultiplier() const;
00189
00191
00195 virtual
00196 const ProblemDomain& problemDomain() const;
00197
00199
00203 virtual
00204 Vector<Box> boxes() const;
00205
00207
00211 bool isDefined() const;
00212
00214
00218 virtual
00219 int refRatio() const;
00220
00222
00226 static
00227 void verbosity(int a_verbosity);
00228
00230
00235 static
00236 int verbosity();
00237
00239
00247 virtual
00248 Real advance() = 0;
00249
00251
00258 virtual
00259 void postTimeStep() = 0;
00260
00262
00269 virtual
00270 void tagCells(IntVectSet& a_tags) = 0;
00271
00273
00280 virtual
00281 void tagCellsInit(IntVectSet& a_tags) = 0;
00282
00284
00291 virtual
00292 void regrid(const Vector<Box>& a_new_grids) = 0;
00293
00295
00302 virtual
00303 void postRegrid(int a_base_level);
00304
00306
00313 virtual
00314 void initialGrid(const Vector<Box>& a_new_grids) = 0;
00315
00317
00324 virtual
00325 void initialData() = 0;
00326
00328
00335 virtual
00336 void postInitialize() = 0;
00337
00339
00346 virtual
00347 Real computeDt() = 0;
00348
00350
00357 virtual
00358 Real computeInitialDt() = 0;
00359
00360 #ifdef HDF5
00361
00362
00369 virtual
00370 void writeCheckpointHeader (HDF5Handle& a_handle) const = 0;
00371
00373
00380 virtual
00381 void writeCheckpointLevel (HDF5Handle& a_handle) const = 0;
00382
00384
00391 virtual
00392 void readCheckpointHeader (HDF5Handle& a_handle) = 0;
00393
00395
00402 virtual
00403 void readCheckpointLevel (HDF5Handle& a_handle) = 0;
00404
00406
00413 virtual
00414 void writePlotHeader (HDF5Handle& a_handle) const = 0;
00415
00417
00424 virtual
00425 void writePlotLevel (HDF5Handle& a_handle) const = 0;
00426 #endif
00427
00428 protected:
00429 // the problem domain
00430 ProblemDomain m_problem_domain;
00431
00432 //
00433 Vector<Box> m_level_grids;
00434
00435 // the level
00436 int m_level;
00437
00438 // refinement ratio
00439 int m_ref_ratio;
00440
00441 // initial time step multipier
00442 Real m_initial_dt_multiplier;
00443
00444 // time step
00445 Real m_dt;
00446
00447 // time
00448 Real m_time;
00449
00450 // pointer to next coarser level
00451 AMRLevel* m_coarser_level_ptr;
00452
00453 // pointer to next finer level
00454 AMRLevel* m_finer_level_ptr;
00455
00456 // verbosity level
00457 static int s_verbosity;
00458
00459 bool m_isDefined;
00460 };
00461
00462 #endif
1.2.16