Chombo + EB + MF  3.2
MultiBlockLevelExchange.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 _MULTIBLOCKLEVELEXCHANGE_H_
12 #define _MULTIBLOCKLEVELEXCHANGE_H_
13 
14 #include "MultiBlockLevelGeom.H"
15 #include "IVSFAB.H"
16 #include "MBStencil.H"
17 #include "MBVectorStencil.H"
18 
19 #include "NamespaceHeader.H"
20 
21 /// The class MultiBlockLevelExchange stores topological and geometric information
22 /**
23  MultiBlockLevelExchange 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  { m_isDefined = false;
37  m_isVectorDefined = false; }
38 
39  /// destructor
40  virtual ~MultiBlockLevelExchange();
41 
42  /// full constructor
44  int a_ghosts,
45  int a_order);
46 
47  virtual void undefine();
48 
49  virtual void define(const MultiBlockLevelGeom* a_geomPtr,
50  int a_ghosts,
51  int a_order);
52 
53  /// must be in the derived class, else error when calling.
54  virtual void defineVector();
55 
56  /// fill extra-block ghost cells of a_data at components in a_intvl
57  virtual void interpGhosts(LevelData<FArrayBox>& a_data,
58  const Interval& a_intvl) const;
59 
60  /// fill extra-block ghost cells of a_data at all components
61  virtual void interpGhosts(LevelData<FArrayBox>& a_data) const;
62 
63  /// fill extra-block ghost cells of vector a_data at all components
64  virtual void interpGhostsVector(LevelData<FArrayBox>& a_data) const;
65 
66  /// fill extra-block ghost cells of vector a_data at components in a_intvl, of length SpaceDim. Must be in the derived class, else error when calling.
67  virtual void interpGhostsVector(LevelData<FArrayBox>& a_data,
68  const Interval& a_intvl) const;
69 
70  /// fill extra-block ghost cells of all components of a_data at components, where a_vecIntvl is interval of components of a vector, and the other components are scalars
72  const Interval& a_vecIntvl) const;
73 
74  /// accessor
76  { CH_assert(isDefined());
77  return m_ghostCells; }
78 
79  /// accessor
80  /**
81  IVSFAB<MBStencil> *m_stencils[dit] lives on m_ghostCells[dit]
82  and has 1 component.
83  For each IntVect thisGhostCell in IntVectSet m_ghostCells[dit]
84  (i.e., thisGhostCell an extra-block ghost cell of m_grids[dit]),
85  MBStencil *m_stencils[dit](thisGhostCell, 0) contains the
86  interpolation stencil for thisGhostCell.
87  */
89  { CH_assert(isDefined());
90  return m_stencils; }
91 
92  /// accessor
93  /**
94  IVSFAB<MBVectorStencil> *m_vectorstencils[dit] lives on m_ghostCells[dit]
95  and has 1 component.
96  For each IntVect thisGhostCell in IntVectSet m_ghostCells[dit]
97  (i.e., thisGhostCell an extra-block ghost cell of m_grids[dit]),
98  MBVectorStencil *m_vectorstencils[dit](thisGhostCell, 0) contains the
99  vector interpolation stencil for thisGhostCell.
100  */
102  { CH_assert(isDefined());
103  return m_vectorstencils; }
104 
105  bool isDefined() const
106  {
107  return m_isDefined;
108  }
109 
110 protected:
111 
112  /// remove from m_ghostCells all cells that do not have complete stencils.
113  virtual void removeNoValidSource();
114 
115  /// is defined?
117 
118  /// is defined for vector transformations?
120 
121  /// either IndexType::TheCellType() for averaged, or IndexType::TheNodeType() for centered
123 
124  /// underlying grids
126 
127  /// width of ghost layer around m_grids, at which data will be filled in
128  int m_ghosts;
129 
130  /// order of approximation wanted
131  int m_order;
132 
133  /// radius of neighborhood of data used for interpolation to ghost cell
134  int m_radius;
135 
136  /// degree of Taylor polynomials
137  int m_degree;
138 
139  /// [0:m_degree]^D
141 
142  /// powers in Taylor polynomial
144 
145  /// number of coefficients in Taylor polynomial
147 
148  /// contains topological and geometric information
150 
151  /// contains coordinate systems; from m_geomPtr
153 
154  /// original underlying grids
156 
157  /// Number of mapping blocks
159 
160  /// extra-block ghost cells of m_grids that need to be filled in
162 
163  /// interval of dimensions that are fixed. Default empty.
165 
166  /// dimensions that are fixed. Default empty.
168 
169  /// dimensions that are not fixed. Default 0:SpaceDim-1.
171 
172  /// fixed values of dimensions that are fixed. Default empty.
174 
175  /// displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedDimsVect
177 
178  /// whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
180 
181  /// interpolation stencils
182  /**
183  For each dit, IVSFAB<MBStencil> *m_stencils[dit]
184  lives on IntVectSet m_ghostCells[dit] and has 1 component,
185  containing the stencil for each extra-block ghost cell of m_grids[dit].
186  */
188 
189  /// vector interpolation stencils
190  /**
191  For each dit, IVSFAB<MBVectorStencil> *m_vectorstencils[dit]
192  lives on IntVectSet m_ghostCells[dit] and has 1 component,
193  containing the vector stencil for each extra-block ghost cell of m_grids[dit].
194  */
196 
197  /// for each source block, min Box containing valid cells
198  /**
199  For each srcBlock and dit,
200  Box (*(m_validLayout[srcBlock]))[dit]
201  is the minimum Box containing all valid cells that are needed
202  to fill in the ghost cells of m_ghostCells[dit].
203  */
205 
207 
209 
211 
212  /// Copier *m_copiers[srcBlock] for copying from m_grids to BoxLayout *m_validLayout[srcBlock]
214 
216 
218 };
219 
220 #include "NamespaceFooter.H"
221 #endif
The class MultiBlockLevelGeom stores topological and geometric information.
Definition: MultiBlockLevelGeom.H:29
Vector< IntVect > m_powers
powers in Taylor polynomial
Definition: MultiBlockLevelExchange.H:143
int m_degree
degree of Taylor polynomials
Definition: MultiBlockLevelExchange.H:137
Vector< RefCountedPtr< LayoutData< Box > > > m_stencilCellsFullMinBox
Definition: MultiBlockLevelExchange.H:210
MultiBlockCoordSys * m_coordSysPtr
contains coordinate systems; from m_geomPtr
Definition: MultiBlockLevelExchange.H:152
MultiBlockLevelGeom * m_geomPtr
contains topological and geometric information
Definition: MultiBlockLevelExchange.H:149
#define CH_assert(cond)
Definition: CHArray.H:37
Vector< int > m_interpDimsVect
dimensions that are not fixed. Default 0:SpaceDim-1.
Definition: MultiBlockLevelExchange.H:170
virtual void defineVector()
must be in the derived class, else error when calling.
LayoutData< RefCountedPtr< IVSFAB< MBStencil > > > m_stencils
interpolation stencils
Definition: MultiBlockLevelExchange.H:187
LayoutData< RefCountedPtr< IVSFAB< MBVectorStencil > > > m_vectorstencils
vector interpolation stencils
Definition: MultiBlockLevelExchange.H:195
const LayoutData< IntVectSet > & ghostCells() const
accessor
Definition: MultiBlockLevelExchange.H:75
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
virtual void interpGhosts(LevelData< FArrayBox > &a_data, const Interval &a_intvl) const
fill extra-block ghost cells of a_data at components in a_intvl
int m_order
order of approximation wanted
Definition: MultiBlockLevelExchange.H:131
virtual void interpGhostsVector(LevelData< FArrayBox > &a_data) const
fill extra-block ghost cells of vector a_data at all components
LayoutData< IntVectSet > m_ghostCells
extra-block ghost cells of m_grids that need to be filled in
Definition: MultiBlockLevelExchange.H:161
Vector< int > m_fixedPt
fixed values of dimensions that are fixed. Default empty.
Definition: MultiBlockLevelExchange.H:173
bool m_isDefined
is defined?
Definition: MultiBlockLevelExchange.H:116
virtual void interpGhostsAllWithVector(LevelData< FArrayBox > &a_data, const Interval &a_vecIntvl) const
fill extra-block ghost cells of all components of a_data at components, where a_vecIntvl is interval ...
The class MultiBlockLevelExchange stores topological and geometric information.
Definition: MultiBlockLevelExchange.H:29
bool isDefined() const
Definition: MultiBlockLevelExchange.H:105
BoxLayout m_gridsFixedOff
displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedD...
Definition: MultiBlockLevelExchange.H:176
DisjointBoxLayout m_gridsFull
original underlying grids
Definition: MultiBlockLevelExchange.H:155
bool m_isVectorDefined
is defined for vector transformations?
Definition: MultiBlockLevelExchange.H:119
int m_nblocks
Number of mapping blocks.
Definition: MultiBlockLevelExchange.H:158
Box m_degreeBox
[0:m_degree]^D
Definition: MultiBlockLevelExchange.H:140
Vector< BoxLayout * > m_validLayout
for each source block, min Box containing valid cells
Definition: MultiBlockLevelExchange.H:204
const LayoutData< RefCountedPtr< IVSFAB< MBStencil > > > & stencils() const
accessor
Definition: MultiBlockLevelExchange.H:88
virtual void undefine()
Vector< Copier * > m_copiers
Copier *m_copiers[srcBlock] for copying from m_grids to BoxLayout *m_validLayout[srcBlock].
Definition: MultiBlockLevelExchange.H:213
Structure for passing component ranges in code.
Definition: Interval.H:23
virtual ~MultiBlockLevelExchange()
destructor
virtual void removeNoValidSource()
remove from m_ghostCells all cells that do not have complete stencils.
Vector< RefCountedPtr< LayoutData< Box > > > m_stencilCellsMinBox
Definition: MultiBlockLevelExchange.H:208
int m_ghosts
width of ghost layer around m_grids, at which data will be filled in
Definition: MultiBlockLevelExchange.H:128
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Vector< Copier * > m_copiersFull
Definition: MultiBlockLevelExchange.H:215
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
Vector< BoxLayout * > m_validFullLayout
Definition: MultiBlockLevelExchange.H:206
Vector< int > m_fixedDimsVect
dimensions that are fixed. Default empty.
Definition: MultiBlockLevelExchange.H:167
MultiBlockLevelExchange()
default constructor
Definition: MultiBlockLevelExchange.H:35
The class MultiBlockUtil contains some functions used by MultiBlockLevelGeom, MultiBlockLevelExchange...
Definition: MultiBlockUtil.H:23
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
virtual void define(const MultiBlockLevelGeom *a_geomPtr, int a_ghosts, int a_order)
int m_radius
radius of neighborhood of data used for interpolation to ghost cell
Definition: MultiBlockLevelExchange.H:134
const LayoutData< RefCountedPtr< IVSFAB< MBVectorStencil > > > & vectorstencils() const
accessor
Definition: MultiBlockLevelExchange.H:101
int m_numTaylorCoeffs
number of coefficients in Taylor polynomial
Definition: MultiBlockLevelExchange.H:146
Cell-Based or Node-Based Indices.
Definition: Box.H:45
MultiBlockUtil * m_mbUtil
Definition: MultiBlockLevelExchange.H:217
DisjointBoxLayout m_grids
underlying grids
Definition: MultiBlockLevelExchange.H:125
bool m_allGridsHaveFixedPt
whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
Definition: MultiBlockLevelExchange.H:179
Interval m_fixedDims
interval of dimensions that are fixed. Default empty.
Definition: MultiBlockLevelExchange.H:164
IndexType m_type
either IndexType::TheCellType() for averaged, or IndexType::TheNodeType() for centered ...
Definition: MultiBlockLevelExchange.H:122