Chombo + EB + MF  3.2
MultiBlockLevelGeom.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 #ifndef _MULTIBLOCKLEVELGEOM_H_
12 #define _MULTIBLOCKLEVELGEOM_H_
13 
14 #include "MultiBlockCoordSys.H"
15 #include "MultiBlockUtil.H"
16 #include "IVSFAB.H"
17 #include "LevelData.H"
18 
19 #include "NamespaceHeader.H"
20 
21 /// The class MultiBlockLevelGeom stores topological and geometric information
22 /**
23  MultiBlockLevelGeom stores topological and geometric information
24  about a particular layout with a particular MultiBlockCoordSys.
25 
26  Implementations of specific multiblock coordinate systems will be
27  provided by derived classes.
28 */
30 {
31 
32 public:
33 
34  /// default constructor
36  {
37  m_isDefined = false;
38  }
39 
40  /// destructor
42 
43  /// full constructor
44  MultiBlockLevelGeom(const MultiBlockCoordSys* a_coordSysPtr,
45  const DisjointBoxLayout& a_grids,
46  int a_ghosts,
47  Interval a_fixedDims = Interval(),
48  Vector<int> a_fixedPt = Vector<int>());
49 
50  void undefine();
51 
52  /// define knowing only ghosts required for the solution update procedure. DEPRECATED.
53  void define(const MultiBlockCoordSys* a_coordSysPtr,
54  const DisjointBoxLayout& a_grids,
55  const int a_solUpdateGhosts,
56  const int a_spaceOrder,
57  Interval a_fixedDims = Interval(),
58  Vector<int> a_fixedPt = Vector<int>());
59 
60 
61  /// define with explicit specification of number of multiblock ghosts
62  void define(const MultiBlockCoordSys* a_coordSysPtr,
63  const DisjointBoxLayout& a_grids,
64  int a_ghosts,
65  Interval a_fixedDims = Interval(),
66  Vector<int> a_fixedPt = Vector<int>());
67 
68  /// accessor
69  int ghosts() const
70  { return m_ghosts; }
71 
72  /// accessor
73  const DisjointBoxLayout& grids() const
74  { return m_grids; }
75 
76  /// accessor
78  { return m_gridsFull; }
79 
80  /// accessor
82  { return m_coordSysPtr; }
83 
84  /// accessor
85  const LayoutData<int>& block() const
86  { return m_block; }
87 
88  /// accessor
90  { return m_validIndices; }
91 
92  /// accessor
94  { return m_validBlock; }
95 
96  /// accessor
98  { return m_validMappedCenter; }
99 
100  const Interval& fixedDims() const
101  { return m_fixedDims; }
102 
103  const Vector<int>& fixedDimsVect() const
104  { return m_fixedDimsVect; }
105 
107  { return m_interpDimsVect; }
108 
109  const Vector<int>& fixedPt() const
110  { return m_fixedPt; }
111 
112  const BoxLayout& gridsFixedOff() const
113  { return m_gridsFixedOff; }
114 
115  bool allGridsHaveFixedPt() const
116  { return m_allGridsHaveFixedPt; }
117 
119  { return m_mbUtil; }
120 
121  /// return indices of destination ghost cells for a particular width
122  /**
123  In a_ghostCells, return ghost cells of m_grids out to a_ghostLayer,
124  which is width of destination ghost cell layer.
125  This function requires
126  m_grids, m_coordSysPtr, m_block, and m_boundaries, but
127  NOT anything else like m_validIndices, m_validBlock, m_validMappedCenter.
128  */
129  void extraBlockGhosts(LayoutData< IntVectSet >& a_ghostCells,
130  int a_ghostLayer) const;
131 
132  bool isDefined() const
133  {
134  return m_isDefined;
135  }
136 
137 protected:
138 
139  /// is this object defined?
140  /// covers m_coordSysPtr, m_grids, m_ghosts, m_boundaries, m_block, m_ghostCells, m_validIndices, m_validBlock, m_validMappedCenter
142 
143  /// coordinate system (given in constructor)
145 
146  /// original underlying grids
148 
149  /// underlying grids (given in constructor) varying in m_interpDimsVect but set to m_fixedPt in m_fixedDimsVect
151 
152  /// displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedDimsVect
154 
155  /// whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
157 
158  /// width of ghost layer around m_grids, from which data will be taken (given in constructor)
159  int m_ghosts;
160 
161  /// dimensions that are fixed. Default is empty.
163 
164  /// dimensions that are fixed. Default is empty.
166 
167  /// coordinates in dimensions of m_fixedDims. Default is empty.
169 
170  /// dimensions that will be interpolated, which is all dimensions that are not in m_fixedDims. Default is 0:SpaceDim-1.
172 
173  /// all block boundaries; from m_coordSysPtr
175 
176  /// block containing each box of m_grids
178 
179  /// extra-block ghost cells from which data will be taken. Lives on m_grids.
181 
182  /// coordinate indices within the valid block of the cell in which the center of each extra-block ghost cell falls. Lives on m_ghostCells, has 1 component.
184 
185  /// index of the valid block in which the center of each extra-block ghost cell falls. Lives on m_ghostCells, has 1 component.
187 
188  /// mapped coordinates, in valid block's index space, of center of each extra-block ghost cell. Lives on m_ghostCells, has 1 component.
190 
192 };
193 
194 #include "NamespaceFooter.H"
195 #endif
const LayoutData< IVSFAB< IntVect > *> & validIndices() const
accessor
Definition: MultiBlockLevelGeom.H:89
MultiBlockCoordSys * m_coordSysPtr
coordinate system (given in constructor)
Definition: MultiBlockLevelGeom.H:144
The class MultiBlockLevelGeom stores topological and geometric information.
Definition: MultiBlockLevelGeom.H:29
MultiBlockLevelGeom()
default constructor
Definition: MultiBlockLevelGeom.H:35
const LayoutData< IVSFAB< RealVect > *> & validMappedCenter() const
accessor
Definition: MultiBlockLevelGeom.H:97
bool m_allGridsHaveFixedPt
whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
Definition: MultiBlockLevelGeom.H:156
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
void define(const MultiBlockCoordSys *a_coordSysPtr, const DisjointBoxLayout &a_grids, const int a_solUpdateGhosts, const int a_spaceOrder, Interval a_fixedDims=Interval(), Vector< int > a_fixedPt=Vector< int >())
define knowing only ghosts required for the solution update procedure. DEPRECATED.
DisjointBoxLayout m_gridsFull
original underlying grids
Definition: MultiBlockLevelGeom.H:147
LayoutData< IntVectSet > m_ghostCells
extra-block ghost cells from which data will be taken. Lives on m_grids.
Definition: MultiBlockLevelGeom.H:180
int m_ghosts
width of ghost layer around m_grids, from which data will be taken (given in constructor) ...
Definition: MultiBlockLevelGeom.H:159
Interval m_fixedDims
dimensions that are fixed. Default is empty.
Definition: MultiBlockLevelGeom.H:162
MultiBlockCoordSys * coordSysPtr() const
accessor
Definition: MultiBlockLevelGeom.H:81
bool allGridsHaveFixedPt() const
Definition: MultiBlockLevelGeom.H:115
Vector< int > m_fixedDimsVect
dimensions that are fixed. Default is empty.
Definition: MultiBlockLevelGeom.H:165
const LayoutData< IVSFAB< int > *> & validBlock() const
accessor
Definition: MultiBlockLevelGeom.H:93
bool m_isDefined
Definition: MultiBlockLevelGeom.H:141
Structure for passing component ranges in code.
Definition: Interval.H:23
const Interval & fixedDims() const
Definition: MultiBlockLevelGeom.H:100
LayoutData< IVSFAB< int > *> m_validBlock
index of the valid block in which the center of each extra-block ghost cell falls. Lives on m_ghostCells, has 1 component.
Definition: MultiBlockLevelGeom.H:186
BoxLayout m_gridsFixedOff
displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedD...
Definition: MultiBlockLevelGeom.H:153
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Vector< Tuple< BlockBoundary, 2 *SpaceDim > > m_boundaries
all block boundaries; from m_coordSysPtr
Definition: MultiBlockLevelGeom.H:174
~MultiBlockLevelGeom()
destructor
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
bool isDefined() const
Definition: MultiBlockLevelGeom.H:132
const Vector< int > & fixedPt() const
Definition: MultiBlockLevelGeom.H:109
LayoutData< IVSFAB< RealVect > *> m_validMappedCenter
mapped coordinates, in valid block&#39;s index space, of center of each extra-block ghost cell...
Definition: MultiBlockLevelGeom.H:189
The class MultiBlockUtil contains some functions used by MultiBlockLevelGeom, MultiBlockLevelExchange...
Definition: MultiBlockUtil.H:23
MultiBlockUtil * m_mbUtil
Definition: MultiBlockLevelGeom.H:191
Vector< int > m_fixedPt
coordinates in dimensions of m_fixedDims. Default is empty.
Definition: MultiBlockLevelGeom.H:168
LayoutData< IVSFAB< IntVect > *> m_validIndices
coordinate indices within the valid block of the cell in which the center of each extra-block ghost c...
Definition: MultiBlockLevelGeom.H:183
const DisjointBoxLayout & gridsFull() const
accessor
Definition: MultiBlockLevelGeom.H:77
LayoutData< int > m_block
block containing each box of m_grids
Definition: MultiBlockLevelGeom.H:177
const Vector< int > & interpDimsVect() const
Definition: MultiBlockLevelGeom.H:106
const DisjointBoxLayout & grids() const
accessor
Definition: MultiBlockLevelGeom.H:73
Vector< int > m_interpDimsVect
dimensions that will be interpolated, which is all dimensions that are not in m_fixedDims. Default is 0:SpaceDim-1.
Definition: MultiBlockLevelGeom.H:171
MultiBlockUtil * mbUtil() const
Definition: MultiBlockLevelGeom.H:118
const Vector< int > & fixedDimsVect() const
Definition: MultiBlockLevelGeom.H:103
int ghosts() const
accessor
Definition: MultiBlockLevelGeom.H:69
const LayoutData< int > & block() const
accessor
Definition: MultiBlockLevelGeom.H:85
DisjointBoxLayout m_grids
underlying grids (given in constructor) varying in m_interpDimsVect but set to m_fixedPt in m_fixedDi...
Definition: MultiBlockLevelGeom.H:150
const BoxLayout & gridsFixedOff() const
Definition: MultiBlockLevelGeom.H:112
void extraBlockGhosts(LayoutData< IntVectSet > &a_ghostCells, int a_ghostLayer) const
return indices of destination ghost cells for a particular width