Chombo + EB  3.0
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 "UsingNamespace.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 
56 
57  /// return stencil indices
58  /**
59  Get stencil indices for patch a_dit.
60  */
61  const BaseFab<IntVect>& getStencil(const DataIterator& a_dit) const;
62 
63  /// return stencil indices
64  /**
65  Get stencil indices for patch a_dind.
66  */
67  const BaseFab<IntVect>& getStencil(const DataIndex& a_dind) const;
68 
69  /// return reference to coarse data
70  /**
71  Return reference to m_coarseData.
72  */
74 
75  /// return patch interpolator
76  /**
77  Get object for interpolating on a single patch.
78  */
80 
81  /// Interpolate in space.
82  /**
83  Interpolate in space to a_fine from a_coarse.
84  */
85  void interpToFine(/// interpolated solution on this level
86  LevelData<FArrayBox>& a_fine,
87  /// coarse solution
88  const LevelData<FArrayBox>& a_coarse);
89 
90  /// Interpolate in space on a single patch.
91  /**
92  Interpolate in space to a_fine from a_coarse, where both
93  are related to index a_dit.
94  */
95  void interpOnPatch(
96  /// interpolated solution on this level
97  FArrayBox& a_fine,
98  /// coarse solution
99  const FArrayBox& a_coarse,
100  /// index
101  const DataIterator& a_dit);
102 
103  /// Interpolate in space on a single patch.
104  /**
105  Interpolate in space to a_fine from a_coarse, where both
106  are related to index a_dind.
107  */
108  void interpOnPatch(
109  /// interpolated solution on this level
110  FArrayBox& a_fine,
111  /// coarse solution
112  const FArrayBox& a_coarse,
113  /// index
114  const DataIndex& a_dind);
115 
116 
117  /// Interpolate in space on a single patch, to a set of cells.
118  /**
119  Interpolate in space to a_fine from a_coarse, where both
120  are related to index a_dit, to the fine cells within a_ivs.
121  */
122  void interpOnPatch(
123  /// interpolated solution on this level
124  FArrayBox& a_fine,
125  /// coarse solution
126  const FArrayBox& a_coarse,
127  /// index
128  const DataIterator& a_dit,
129  /// we fill in fine cells within these coarse cells
130  const IntVectSet& a_ivs);
131 
132  /// Interpolate in space on a single patch.
133  /**
134  Interpolate in space to a_fine from a_coarse, where both
135  are related to index a_dind, to the fine cells within a_ivs.
136  */
137  void interpOnPatch(
138  /// interpolated solution on this level
139  FArrayBox& a_fine,
140  /// coarse solution
141  const FArrayBox& a_coarse,
142  /// index
143  const DataIndex& a_dind,
144  /// we fill in fine cells within these coarse cells
145  const IntVectSet& a_ivs);
146 
147 protected:
148 
149  /// Box layout for this level
151 
152  /// Box layout for the coarse level: m_layout coarsened by m_refineCoarse
154 
155  /// object for patch-based operations
157 
158  /// on m_layoutCoarsened; which stencil to use at each coarse point
160 
161  /// ghost vector on m_coarseData
163 
164  /// copied coarse data in interpToFine, lives on m_layoutCoarsened
166 
167  /// Problem domain - index space for this level
169 
170  /// Refinement ratio between this level and the next coarser
172 
173  /// Number of variables
175 
176  /// maximum distance of stencil from domain boundary
178 
179  /// number of layers of ghost cells at the coarser level whose fine cells are to be filled in
181 
182  /// define() has been called
183  bool m_defined;
184 
185 private:
186 
187  // Disallowed for all the usual reasons
188  void operator=(const FourthOrderFineInterp& a_input)
189  {
190  MayDay::Error("invalid operator");
191  }
192 
193  // Disallowed for all the usual reasons
195  {
196  MayDay::Error("invalid operator");
197  }
198 };
199 
200 #endif
FourthOrderFineInterp()
Default constructor.
FourthOrderPatchInterp & patchInterp()
return patch interpolator
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
void operator=(const FourthOrderFineInterp &a_input)
Definition: FourthOrderFineInterp.H:188
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
int m_refineCoarse
Refinement ratio between this level and the next coarser.
Definition: FourthOrderFineInterp.H:171
Fourth-order interpolation in space.
Definition: FourthOrderFineInterp.H:25
FourthOrderFineInterp(const FourthOrderFineInterp &a_input)
Definition: FourthOrderFineInterp.H:194
void interpOnPatch(FArrayBox &a_fine, const FArrayBox &a_coarse, const DataIterator &a_dit)
Interpolate in space on a single patch.
Definition: DataIterator.H:140
DisjointBoxLayout m_layout
Box layout for this level.
Definition: FourthOrderFineInterp.H:150
LevelData< BaseFab< IntVect > > m_stencilHere
on m_layoutCoarsened; which stencil to use at each coarse point
Definition: FourthOrderFineInterp.H:159
int m_numStates
Number of variables.
Definition: FourthOrderFineInterp.H:174
FourthOrderPatchInterp m_patchInterp
object for patch-based operations
Definition: FourthOrderFineInterp.H:156
int m_coarseGhostsFill
number of layers of ghost cells at the coarser level whose fine cells are to be filled in ...
Definition: FourthOrderFineInterp.H:180
int m_maxStencilDist
maximum distance of stencil from domain boundary
Definition: FourthOrderFineInterp.H:177
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
LevelData< FArrayBox > m_coarseData
copied coarse data in interpToFine, lives on m_layoutCoarsened
Definition: FourthOrderFineInterp.H:165
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
Definition: BaseFab.H:76
void define(const DisjointBoxLayout &a_layout, const int &a_numStates, const int &a_refineCoarse, const ProblemDomain &a_domain, const int &a_coarseGhostsFill=0)
Actual constructor.
DisjointBoxLayout m_layoutCoarsened
Box layout for the coarse level: m_layout coarsened by m_refineCoarse.
Definition: FourthOrderFineInterp.H:153
LevelData< FArrayBox > & coarsenedFineData()
return reference to coarse data
Definition: DataIndex.H:112
ProblemDomain m_domain
Problem domain - index space for this level.
Definition: FourthOrderFineInterp.H:168
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:44
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:162
Fourth-order interpolation in space on a single patch.
Definition: FourthOrderPatchInterp.H:24
const BaseFab< IntVect > & getStencil(const DataIterator &a_dit) const
return stencil indices
~FourthOrderFineInterp()
Destructor.
bool m_defined
define() has been called
Definition: FourthOrderFineInterp.H:183