Chombo + EB + MF  3.2
FourthOrderFineInterp.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 _FOURTHORDERFINEINTERP_H_
12 #define _FOURTHORDERFINEINTERP_H_
13 
14 #include "FArrayBox.H"
15 #include "DisjointBoxLayout.H"
16 #include "LevelData.H"
17 #include "ProblemDomain.H"
18 #include "FourthOrderPatchInterp.H"
19 #include "NamespaceHeader.H"
20 
21 /// Fourth-order interpolation in space
22 
23 /**
24  */
26 {
27 public:
28  /// Default constructor
29  /**
30  Object requires define() to be called before all other functions.
31  */
33 
34  /// Destructor
35  /**
36  Destroys all objects created by define(). Passed in data references
37  of define() are left alone.
38  */
40 
41  /// Actual constructor.
42  /**
43  Set up object.
44  */
45  void define(/// layout at this level
46  const DisjointBoxLayout& a_layout,
47  /// number of variables
48  const int& a_numStates,
49  /// refinement ratio between this level and next coarser level
50  const int& a_refineCoarse,
51  /// problem domain on this level
52  const ProblemDomain& a_domain,
53  /// number of coarse ghost cells
54  const int& a_coarseGhostsFill = 0,
55  /// dimensions that are fixed, not interpolated
56  Interval a_fixedDims = Interval() );
57 
58  /// return stencil indices
59  /**
60  Get stencil indices for patch a_dit.
61  */
62  const BaseFab<IntVect>& getStencil(const DataIterator& a_dit) const;
63 
64  /// return stencil indices
65  /**
66  Get stencil indices for patch a_dind.
67  */
68  const BaseFab<IntVect>& getStencil(const DataIndex& a_dind) const;
69 
70  /// return reference to coarse data
71  /**
72  Return reference to m_coarseData.
73  */
75 
76  /// return patch interpolator
77  /**
78  Get object for interpolating on a single patch.
79  */
81 
82  /// Interpolate in space.
83  /**
84  Interpolate in space to a_fine from a_coarse.
85  */
86  void interpToFine(/// interpolated solution on this level
87  LevelData<FArrayBox>& a_fine,
88  /// coarse solution
89  const LevelData<FArrayBox>& a_coarse);
90 
91  /// Interpolate in space on a single patch.
92  /**
93  Interpolate in space to a_fine from a_coarse, where both
94  are related to index a_dit.
95  */
96  void interpOnPatch(
97  /// interpolated solution on this level
98  FArrayBox& a_fine,
99  /// coarse solution
100  const FArrayBox& a_coarse,
101  /// index
102  const DataIterator& a_dit);
103 
104  /// Interpolate in space on a single patch.
105  /**
106  Interpolate in space to a_fine from a_coarse, where both
107  are related to index a_dind.
108  */
109  void interpOnPatch(
110  /// interpolated solution on this level
111  FArrayBox& a_fine,
112  /// coarse solution
113  const FArrayBox& a_coarse,
114  /// index
115  const DataIndex& a_dind);
116 
117 
118  /// Interpolate in space on a single patch, to a set of cells.
119  /**
120  Interpolate in space to a_fine from a_coarse, where both
121  are related to index a_dit, to the fine cells within a_ivs.
122  */
123  void interpOnPatch(
124  /// interpolated solution on this level
125  FArrayBox& a_fine,
126  /// coarse solution
127  const FArrayBox& a_coarse,
128  /// index
129  const DataIterator& a_dit,
130  /// we fill in fine cells within these coarse cells
131  const IntVectSet& a_ivs);
132 
133  /// Interpolate in space on a single patch.
134  /**
135  Interpolate in space to a_fine from a_coarse, where both
136  are related to index a_dind, to the fine cells within a_ivs.
137  */
138  void interpOnPatch(
139  /// interpolated solution on this level
140  FArrayBox& a_fine,
141  /// coarse solution
142  const FArrayBox& a_coarse,
143  /// index
144  const DataIndex& a_dind,
145  /// we fill in fine cells within these coarse cells
146  const IntVectSet& a_ivs);
147 
148 protected:
149 
150  /// Box layout for this level
152 
153  /// Box layout for the coarse level: m_layout coarsened by m_refineCoarse
155 
156  /// object for patch-based operations
158 
159  /// on m_layoutCoarsened; which stencil to use at each coarse point
161 
162  /// ghost vector on m_coarseData
164 
165  /// copied coarse data in interpToFine, lives on m_layoutCoarsened
167 
168  /// Problem domain - index space for this level
170 
171  /// Refinement ratio between this level and the next coarser
173 
174  /// dimensions that are fixed, not interpolated
176 
177  /// 1 in m_fixedDims, m_refineCoarse in other dimensions
179 
180  /// Number of variables
182 
183  /// maximum distance of stencil from domain boundary
185 
186  /// number of layers of ghost cells at the coarser level whose fine cells are to be filled in
188 
189  /// define() has been called
190  bool m_defined;
191 
192 private:
193 
194  // Disallowed for all the usual reasons
195  void operator=(const FourthOrderFineInterp&);
197 };
198 
199 #include "NamespaceFooter.H"
200 #endif
FourthOrderFineInterp()
Default constructor.
FourthOrderPatchInterp & patchInterp()
return patch interpolator
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void define(const DisjointBoxLayout &a_layout, const int &a_numStates, const int &a_refineCoarse, const ProblemDomain &a_domain, const int &a_coarseGhostsFill=0, Interval a_fixedDims=Interval())
Actual constructor.
int m_refineCoarse
Refinement ratio between this level and the next coarser.
Definition: FourthOrderFineInterp.H:172
Fourth-order interpolation in space.
Definition: FourthOrderFineInterp.H:25
const BaseFab< IntVect > & getStencil(const DataIterator &a_dit) const
return stencil indices
void interpOnPatch(FArrayBox &a_fine, const FArrayBox &a_coarse, const DataIterator &a_dit)
Interpolate in space on a single patch.
Definition: DataIterator.H:190
DisjointBoxLayout m_layout
Box layout for this level.
Definition: FourthOrderFineInterp.H:151
Interval m_fixedDims
dimensions that are fixed, not interpolated
Definition: FourthOrderFineInterp.H:175
LevelData< BaseFab< IntVect > > m_stencilHere
on m_layoutCoarsened; which stencil to use at each coarse point
Definition: FourthOrderFineInterp.H:160
int m_numStates
Number of variables.
Definition: FourthOrderFineInterp.H:181
IntVect m_refineVect
1 in m_fixedDims, m_refineCoarse in other dimensions
Definition: FourthOrderFineInterp.H:178
FourthOrderPatchInterp m_patchInterp
object for patch-based operations
Definition: FourthOrderFineInterp.H:157
int m_coarseGhostsFill
number of layers of ghost cells at the coarser level whose fine cells are to be filled in ...
Definition: FourthOrderFineInterp.H:187
int m_maxStencilDist
maximum distance of stencil from domain boundary
Definition: FourthOrderFineInterp.H:184
Structure for passing component ranges in code.
Definition: Interval.H:23
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LevelData< FArrayBox > m_coarseData
copied coarse data in interpToFine, lives on m_layoutCoarsened
Definition: FourthOrderFineInterp.H:166
DisjointBoxLayout m_layoutCoarsened
Box layout for the coarse level: m_layout coarsened by m_refineCoarse.
Definition: FourthOrderFineInterp.H:154
LevelData< FArrayBox > & coarsenedFineData()
return reference to coarse data
Definition: DataIndex.H:114
void operator=(const FourthOrderFineInterp &)
ProblemDomain m_domain
Problem domain - index space for this level.
Definition: FourthOrderFineInterp.H:169
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
void interpToFine(LevelData< FArrayBox > &a_fine, const LevelData< FArrayBox > &a_coarse)
Interpolate in space.
IntVect m_ghostVect
ghost vector on m_coarseData
Definition: FourthOrderFineInterp.H:163
Fourth-order interpolation in space on a single patch.
Definition: FourthOrderPatchInterp.H:24
~FourthOrderFineInterp()
Destructor.
bool m_defined
define() has been called
Definition: FourthOrderFineInterp.H:190