Chombo + EB  3.0
EBLevelGrid.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // dtgraves Nov 14, 2006
12 
13 #ifndef _EBLEVELGRID_H_
14 #define _EBLEVELGRID_H_
15 
16 #include "REAL.H"
17 #include "FArrayBox.H"
18 #include "LevelData.H"
19 #include "DisjointBoxLayout.H"
20 #include "EBISLayout.H"
21 #include "EBCellFAB.H"
22 #include "Interval.H"
23 #include "EBIndexSpace.H"
24 #include "NamespaceHeader.H"
25 
26 ///
27 /**
28  A structure to hold the various components of an EB calculation grid.
29  */
31 {
32 public:
33  ///
34  /**
35  Default constructor. User must subsequently call define().
36  */
37  EBLevelGrid();
38 
39  ///
40  ~EBLevelGrid();
41 
42  ///
43  /**
44  Defining constructor. Constructs a valid object.
45  Equivalent to default construction followed by define().
46  */
47  EBLevelGrid(const DisjointBoxLayout& a_dbl,
48  const ProblemDomain& a_domain,
49  const int& a_numGhostEBISL,
50  const EBIndexSpace* a_ebisPtr);
51 
52  ///
53  EBLevelGrid(const DisjointBoxLayout& a_dbl,
54  const EBISLayout& a_ebisl,
55  const ProblemDomain& a_domain);
56 
57  ///
58  /**
59  Define function that generates EBISL and CFIVS
60  */
61  void define(const DisjointBoxLayout& a_dbl,
62  const ProblemDomain& a_domain,
63  const int& a_numGhostEBISL,
64  const EBIndexSpace* a_ebisPtr);
65 
66 
67  ///
68  /**
69  only generates cfivs. set EBISPtr = chombo_ebis::instance
70  */
71  void define(const DisjointBoxLayout& a_dbl,
72  const EBISLayout& a_ebisl,
73  const ProblemDomain& a_domain);
74 
75  ///
76  EBLevelGrid(const EBLevelGrid& ebcin);
77 
78  ///
79  int getGhost() const
80  {
82  return m_nghost;
83  }
84 
85  ///
87  {
89  return m_grids;
90  }
91 
92  ///
94  {
96  return m_ebisl;
97  }
98 
99  ///
101  {
103  return m_cfivs;
104  }
105 
106  ///
107  bool isDefined() const
108  {
109  return m_isDefined;
110  }
111 
112  ///
113  const EBIndexSpace* getEBIS() const
114  {
116  return m_ebisPtr;
117  }
118 
119  ///
120  const IntVectSet& getCoveringIVS() const
121  {
124  {
125  EBLevelGrid& getAroundConst = (EBLevelGrid&)(*this);
126  getAroundConst.defineCoveringIVS();
127  }
128  return m_coveringIVS;
129  }
130 
131  ///
132  const ProblemDomain& getDomain() const
133  {
135  return m_domain;
136  }
137 
138  ///
139  /**
140  Sets the maximum level of refinement that the EBISLayout
141  will have to perform. Creates and holds new EBISLayouts
142  at intermediate levels of refinement.
143  Default is one (no refinement done).
144  */
145  void setMaxRefinementRatio(const int& a_maxRefine)
146  {
149  }
150 
151  ///
152  /**
153  Sets the maximum level of coarsening that the
154  will have to perform. Creates and holds new EBISLayouts
155  at intermediate levels of refinement.
156  Default is one (no coarsening done).
157  */
158  void setMaxCoarseningRatio(const int& a_maxCoarsen,
159  const EBIndexSpace* const a_ebisPtr)
160  {
162  m_ebisl.setMaxCoarseningRatio(a_maxCoarsen,a_ebisPtr);
163  }
164 
166  {
169  }
170 
171  int
173  {
176  }
177  ///
178  /*
179  returns m_grids.coarsenable(a_ref);
180  */
181  bool
182  coarsenable(const int& a_ref) const;
183 
184  ///
185  /**
186  Coarsen eblgFine by a_ref
187  */
188  friend void coarsen(EBLevelGrid& a_eblgCoar,
189  const EBLevelGrid& a_eblgFine,
190  const int& a_ref);
191 
192 
193  friend void refine(EBLevelGrid& a_eblgCoar,
194  const EBLevelGrid& a_eblgFine,
195  const int& a_ref);
196 
197 protected:
198  void defineCoveringIVS();
199  void setDefaultValues();
201 
208  int m_nghost;
209 
210 private:
211 };
212 
213 #include "NamespaceFooter.H"
214 #endif
int getGhost() const
Definition: EBLevelGrid.H:79
void setMaxCoarseningRatio(const int &a_maxCoarsen, const EBIndexSpace *const a_ebisPtr)
const IntVectSet & getCoveringIVS() const
Definition: EBLevelGrid.H:120
const EBIndexSpace * getEBIS() const
Definition: EBLevelGrid.H:113
IntVectSet m_coveringIVS
Definition: EBLevelGrid.H:206
A reference-counting handle class.
Definition: RefCountedPtr.H:66
EBISLayout getEBISL() const
Definition: EBLevelGrid.H:93
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_assert(cond)
Definition: CHArray.H:37
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
Definition: EBIndexSpace.H:260
void setMaxRefinementRatio(const int &a_maxRefine)
Definition: EBLevelGrid.H:145
const ProblemDomain & getDomain() const
Definition: EBLevelGrid.H:132
int getMaxRefinementRatio() const
Definition: EBLevelGrid.H:172
Definition: EBLevelGrid.H:30
DisjointBoxLayout getDBL() const
Definition: EBLevelGrid.H:86
int getMaxCoarseningRatio() const
Definition: EBLevelGrid.H:165
void setMaxCoarseningRatio(const int &a_maxCoarsen, const EBIndexSpace *const a_ebisPtr)
Definition: EBLevelGrid.H:158
friend void refine(EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, const int &a_ref)
int getMaxCoarseningRatio() const
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
bool m_isDefined
Definition: EBLevelGrid.H:200
int m_nghost
Definition: EBLevelGrid.H:208
bool isDefined() const
Definition: EBLevelGrid.H:107
void defineCoveringIVS()
const EBIndexSpace * m_ebisPtr
Definition: EBLevelGrid.H:207
void setDefaultValues()
int getMaxRefinementRatio() const
EBISLayout m_ebisl
Definition: EBLevelGrid.H:203
friend void coarsen(EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, const int &a_ref)
ProblemDomain m_domain
Definition: EBLevelGrid.H:204
Definition: EBISLayout.H:39
void define(const DisjointBoxLayout &a_dbl, const ProblemDomain &a_domain, const int &a_numGhostEBISL, const EBIndexSpace *a_ebisPtr)
RefCountedPtr< LayoutData< IntVectSet > > m_cfivs
Definition: EBLevelGrid.H:205
RefCountedPtr< LayoutData< IntVectSet > > getCFIVS() const
Definition: EBLevelGrid.H:100
void setMaxRefinementRatio(const int &a_maxRefine, const EBIndexSpace *const a_ebisPtr)
bool coarsenable(const int &a_ref) const
bool m_isCoveringIVSDefined
Definition: EBLevelGrid.H:200
DisjointBoxLayout m_grids
Definition: EBLevelGrid.H:202