/*************************************************************************** gh.hh - Grid Hierarchy bounding boxes for each multigrid level of each component of each refinement level ------------------- begin : Sun Jun 11 2000 copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gh.hh,v 1.8 2001/12/14 16:39:43 schnetter Exp $ ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef GH_HH #define GH_HH #include #include #include #include #include "bbox.hh" #include "defs.hh" #include "dggh.hh" #include "dist.hh" #include "vect.hh" using namespace std; // Forward declaration template class dh; template class gh; // A refinement hierarchy, where higher levels are finer than the base // level. The extents do not include ghost zones. template class gh: public dimgeneric_gh { public: // Types typedef vect ivect; typedef bbox ibbox; typedef vector mexts; // ... for each multigrid level typedef vector cexts; // ... for each component typedef vector rexts; // ... for each refinement level typedef vector cprocs; // ... for each component typedef vector rprocs; // ... for each refinement level public: // should be readonly ibbox baseextent; // bounds (inclusive) of base level vector > bases; // [rl][ml] rexts extents; // bounds of all grids rprocs processors; // processor numbers of all grids list*> dhs; // list of all data hierarchies public: // Constructors gh (const int reffact, const centering refcent, const int mgfact, const centering mgcent, const ibbox& baseextent); // Destructors virtual ~gh (); // Modifiers void recompose (const rexts& exts, const rprocs& procs); // Helpers cexts make_reflevel_multigrid_boxes (const vector& exts, const int mglevels) const; rexts make_multigrid_boxes (const vector >& exts, const int mglevels) const; // Accessors int reflevels () const { return (int)extents.size(); } int components (const int rl) const { assert (rl>=0 && rl=0 && rl=0 && c=0 && rl=0 && c* d); void remove (dh* d); // Output virtual ostream& output (ostream& os) const; }; #if defined(TMPL_IMPLICIT) # include "gh.cc" #endif #endif // GH_HH