00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _EBISLAYOUT_H_
00014 #define _EBISLAYOUT_H_
00015
00016 #include "REAL.H"
00017 #include "IntVect.H"
00018 #include "IntVectSet.H"
00019 #include "VolIndex.H"
00020 #include "FaceIndex.H"
00021 #include "IntVectSet.H"
00022 #include "EBISBox.H"
00023 #include "DisjointBoxLayout.H"
00024 #include "LevelData.H"
00025 #include "EBGraph.H"
00026 #include "NamespaceHeader.H"
00027
00028 class EBIndexSpace;
00029 class EBISLayoutImplem;
00031
00037 class EBISLayout
00038 {
00039 public:
00041
00046 const EBISBox& operator[](const DataIndex& a_index) const;
00047
00049
00055 void setMaxRefinementRatio(const int& a_maxRefine, const EBIndexSpace* ebisPtr);
00056
00058
00064 void setMaxCoarseningRatio(const int& a_maxCoarsen);
00065
00067
00070 int getGhost() const
00071 {
00072 return m_nghost;
00073 }
00074
00076 EBISLayout();
00077
00079
00082 const BoxLayout& getGrownLayout() const;
00083
00085
00088 const DisjointBoxLayout& getDisjointLayout() const;
00089
00091 ~EBISLayout();
00092
00094
00100 VolIndex coarsen(const VolIndex& a_vof,
00101 const int& a_ratio,
00102 const DataIndex& a_datInd) const;
00103
00105
00111 Vector<VolIndex> refine(const VolIndex& a_vof,
00112 const int& a_ratio,
00113 const DataIndex& a_datInd) const;
00114
00116
00122 Vector<FaceIndex> refine(const FaceIndex& a_face,
00123 const int& a_ratio,
00124 const DataIndex& a_datInd) const;
00125
00127 int getMaxCoarseningRatio() const;
00128
00130 int getMaxRefinementRatio() const;
00131
00133 void define(const ProblemDomain& a_domain,
00134 const DisjointBoxLayout& a_grids,
00135 const int& a_nghost,
00136 const LevelData<EBGraph>& a_graph,
00137 const LevelData<EBData> & a_data);
00138
00139 bool isDefined() const;
00140
00141
00142 const EBIndexSpace* getEBIS() const;
00143 void setEBIS(const EBIndexSpace* const a_ebisPtr);
00144 private:
00146 RefCountedPtr<EBISLayoutImplem> m_implem;
00147 int m_nghost;
00148 };
00149
00151
00156 class EBISLayoutImplem
00157 {
00158 public:
00159
00161 const EBISBox& operator[](const DataIndex&) const;
00162
00164 EBISLayoutImplem();
00165
00167 ~EBISLayoutImplem();
00168
00170 const BoxLayout& getGrownLayout() const
00171 {
00172 return m_blGhostDom;
00173 }
00174
00175 const DisjointBoxLayout& getDisjointLayout() const
00176 {
00177 return m_dblInputDom;
00178 }
00179
00181
00187 VolIndex coarsen(const VolIndex& a_vof,
00188 const int& a_ratio,
00189 const DataIndex& a_datInd) const;
00190
00192
00198 FaceIndex coarsen(const FaceIndex& a_face,
00199 const int& a_ratio,
00200 const DataIndex& a_datInd) const;
00201
00203
00209 Vector<VolIndex> refine(const VolIndex& a_vof,
00210 const int& a_ratio,
00211 const DataIndex& a_datInd) const;
00212
00214
00220 Vector<FaceIndex> refine(const FaceIndex& a_face,
00221 const int& a_ratio,
00222 const DataIndex& a_datInd) const;
00223
00225
00231 void setMaxRefinementRatio(const int& a_maxRefine, const EBIndexSpace* ebisPtr);
00232
00234
00240 void setMaxCoarseningRatio(const int& a_maxCoarsen);
00241
00243 int getMaxCoarseningRatio() const;
00244
00246 int getMaxRefinementRatio() const;
00247
00249 void define(const ProblemDomain& a_domain,
00250 const DisjointBoxLayout& a_grids,
00251 const int& a_nghost,
00252 const LevelData<EBGraph>& a_graph,
00253 const LevelData<EBData> & a_data);
00254
00256 static void setVerbose(bool a_verbose);
00257
00258 bool isDefined() const {return m_defined;}
00259
00260 const EBIndexSpace* getEBIS() const
00261 {
00262 return m_ebisPtr;
00263 }
00264 void setEBIS(const EBIndexSpace* const a_ebisPtr)
00265 {
00266 m_ebisPtr = a_ebisPtr;
00267 }
00268 private:
00269
00270 const EBIndexSpace* m_ebisPtr;
00272 BoxLayout m_blGhostDom;
00273
00275 DisjointBoxLayout m_dblInputDom;
00276
00278 Vector<EBISLayout> m_fineLevels;
00279
00281 Vector<EBISLayout> m_coarLevels;
00282
00284 int m_nghost;
00285
00287 int m_maxCoarseningRatio;
00288
00290 int m_maxRefinementRatio;
00291
00293 ProblemDomain m_domain;
00294
00296 LayoutData<EBISBox> m_ebisBoxes;
00297
00298 bool m_defined;
00299
00300 private:
00301 static bool s_verbose;
00302 void operator=(const EBISLayoutImplem& ebiin)
00303 {;}
00304 EBISLayoutImplem(const EBISLayoutImplem& ebiin)
00305 {;}
00306
00307 };
00308
00309 #include "NamespaceFooter.H"
00310 #endif