Chombo + EB + MF  3.2
MBAggLevelExchange.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 _MBAGGLEVELEXCHANGE_H_
12 #define _MBAGGLEVELEXCHANGE_H_
13 
14 #include "MultiBlockLevelGeom.H"
15 #include "IVSFAB.H"
16 #include "VectorTransformation.H"
17 #include "MBStencil.H"
18 #include "MBAggStencil.H"
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 ~MBAggLevelExchange();
41 
42  /// full constructor
43  MBAggLevelExchange(const MultiBlockLevelGeom* a_geomPtr,
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  /// accessor
82  /**
83  IVSFAB<MBStencil> *m_stencils[dit] lives on m_ghostCells[dit]
84  and has 1 component.
85  For each IntVect thisGhostCell in IntVectSet m_ghostCells[dit]
86  (i.e., thisGhostCell an extra-block ghost cell of m_grids[dit]),
87  MBStencil *m_stencils[dit](thisGhostCell, 0) contains the
88  interpolation stencil for thisGhostCell.
89  */
91  { CH_assert(isDefined());
92  return m_stencils; }
93 
94  bool isDefined() const
95  {
96  return m_isDefined;
97  }
98 
99 protected:
100 
101  /// remove from m_ghostCells all cells that do not have complete stencils.
102  virtual void removeNoValidSource(const LayoutData< RefCountedPtr< IVSFAB<MBStencil> > >& a_slowStencils);
103 
104 
105  /// is defined?
107 
108  /// is defined for vector transformations?
110 
111  /// either IndexType::TheCellType() for averaged, or IndexType::TheNodeType() for centered
113 
114  /// underlying grids
116 
117  /// width of ghost layer around m_grids, at which data will be filled in
118  int m_ghosts;
119 
120  /// order of approximation wanted
121  int m_order;
122 
123  /// radius of neighborhood of data used for interpolation to ghost cell
124  int m_radius;
125 
126  /// degree of Taylor polynomials
127  int m_degree;
128 
129  /// [0:m_degree]^D
131 
132  /// powers in Taylor polynomial
134 
135  /// number of coefficients in Taylor polynomial
137 
138  /// contains topological and geometric information
140 
141  /// contains coordinate systems; from m_geomPtr
143 
144  /// original underlying grids
146 
147  /// Number of mapping blocks
149 
150  /// extra-block ghost cells of m_grids that need to be filled in
152 
153  /// interval of dimensions that are fixed. Default empty.
155 
156  /// dimensions that are fixed. Default empty.
158 
159  /// dimensions that are not fixed. Default 0:SpaceDim-1.
161 
162  /// fixed values of dimensions that are fixed. Default empty.
164 
165  /// displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedDimsVect
167 
168  /// whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
170 
171 
172  /// interpolation stencils
173  /**
174  For each dit, IVSFAB<MBStencil> *m_stencils[dit]
175  lives on IntVectSet m_ghostCells[dit] and has 1 component,
176  containing the stencil for each extra-block ghost cell of m_grids[dit].
177  */
179 
180  /// for each source block, min Box containing valid cells
181  /**
182  For each srcBlock and dit,
183  Box (*(m_validLayout[srcBlock]))[dit]
184  is the minimum Box containing all valid cells that are needed
185  to fill in the ghost cells of m_ghostCells[dit].
186  */
188 
190 
191  /// Copier *m_copiers[srcBlock] for copying from m_grids to BoxLayout *m_validLayout[srcBlock]
193 
195 
197 };
198 
199 #include "NamespaceFooter.H"
200 #endif
Vector< IntVect > m_powers
powers in Taylor polynomial
Definition: MBAggLevelExchange.H:133
The class MultiBlockLevelGeom stores topological and geometric information.
Definition: MultiBlockLevelGeom.H:29
int m_nblocks
Number of mapping blocks.
Definition: MBAggLevelExchange.H:148
int m_ghosts
width of ghost layer around m_grids, at which data will be filled in
Definition: MBAggLevelExchange.H:118
const LayoutData< IntVectSet > & ghostCells() const
accessor
Definition: MBAggLevelExchange.H:75
A reference-counting handle class.
Definition: RefCountedPtr.H:173
#define CH_assert(cond)
Definition: CHArray.H:37
virtual ~MBAggLevelExchange()
destructor
bool m_allGridsHaveFixedPt
whether all original underlying grids contain m_fixedPt in m_fixedDimsVect
Definition: MBAggLevelExchange.H:169
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
int m_order
order of approximation wanted
Definition: MBAggLevelExchange.H:121
MBAggLevelExchange()
default constructor
Definition: MBAggLevelExchange.H:35
DisjointBoxLayout m_grids
underlying grids
Definition: MBAggLevelExchange.H:115
Vector< int > m_fixedPt
fixed values of dimensions that are fixed. Default empty.
Definition: MBAggLevelExchange.H:163
LayoutData< RefCountedPtr< MBAggStencil > > m_stencils
interpolation stencils
Definition: MBAggLevelExchange.H:178
BoxLayout m_gridsFixedOff
displacement of original underlying grids from m_grids: 0 in m_interpDimsVect but varying in m_fixedD...
Definition: MBAggLevelExchange.H:166
Interval m_fixedDims
interval of dimensions that are fixed. Default empty.
Definition: MBAggLevelExchange.H:154
Definition: IVSFAB.H:31
int m_numTaylorCoeffs
number of coefficients in Taylor polynomial
Definition: MBAggLevelExchange.H:136
Box m_degreeBox
[0:m_degree]^D
Definition: MBAggLevelExchange.H:130
int m_radius
radius of neighborhood of data used for interpolation to ghost cell
Definition: MBAggLevelExchange.H:124
Vector< int > m_interpDimsVect
dimensions that are not fixed. Default 0:SpaceDim-1.
Definition: MBAggLevelExchange.H:160
virtual void undefine()
LayoutData< IntVectSet > m_ghostCells
extra-block ghost cells of m_grids that need to be filled in
Definition: MBAggLevelExchange.H:151
virtual void defineVector()
must be in the derived class, else error when calling.
Vector< int > m_fixedDimsVect
dimensions that are fixed. Default empty.
Definition: MBAggLevelExchange.H:157
Structure for passing component ranges in code.
Definition: Interval.H:23
virtual void define(const MultiBlockLevelGeom *a_geomPtr, int a_ghosts, int a_order)
int m_degree
degree of Taylor polynomials
Definition: MBAggLevelExchange.H:127
MultiBlockCoordSys * m_coordSysPtr
contains coordinate systems; from m_geomPtr
Definition: MBAggLevelExchange.H:142
bool m_isDefined
is defined?
Definition: MBAggLevelExchange.H:106
Vector< BoxLayout * > m_validLayout
for each source block, min Box containing valid cells
Definition: MBAggLevelExchange.H:187
Vector< Copier * > m_copiersFull
Definition: MBAggLevelExchange.H:194
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
MultiBlockUtil * m_mbUtil
Definition: MBAggLevelExchange.H:196
virtual void removeNoValidSource(const LayoutData< RefCountedPtr< IVSFAB< MBStencil > > > &a_slowStencils)
remove from m_ghostCells all cells that do not have complete stencils.
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
DisjointBoxLayout m_gridsFull
original underlying grids
Definition: MBAggLevelExchange.H:145
Vector< BoxLayout * > m_validFullLayout
Definition: MBAggLevelExchange.H:189
The class MultiBlockLevelExchange stores topological and geometric information.
Definition: MBAggLevelExchange.H:29
Cell-Based or Node-Based Indices.
Definition: Box.H:45
virtual void interpGhostsVector(LevelData< FArrayBox > &a_data) const
fill extra-block ghost cells of vector a_data at all components
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 ...
bool m_isVectorDefined
is defined for vector transformations?
Definition: MBAggLevelExchange.H:109
IndexType m_type
either IndexType::TheCellType() for averaged, or IndexType::TheNodeType() for centered ...
Definition: MBAggLevelExchange.H:112
const LayoutData< RefCountedPtr< MBAggStencil > > & stencils() const
accessor
Definition: MBAggLevelExchange.H:90
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
MultiBlockLevelGeom * m_geomPtr
contains topological and geometric information
Definition: MBAggLevelExchange.H:139
Vector< Copier * > m_copiers
Copier *m_copiers[srcBlock] for copying from m_grids to BoxLayout *m_validLayout[srcBlock].
Definition: MBAggLevelExchange.H:192
bool isDefined() const
Definition: MBAggLevelExchange.H:94