Chombo + EB + MF  3.2
FourthOrderMappedCFInterp.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 _FOURTHORDERMAPPEDCFINTERP_H_
12 #define _FOURTHORDERMAPPEDCFINTERP_H_
13 
14 #include "FArrayBox.H"
15 #include "DisjointBoxLayout.H"
16 #include "LevelData.H"
17 #include "ProblemDomain.H"
19 
20 #include "NamespaceHeader.H"
21 
22 /// Fourth-order interpolation in space
23 
24 /**
25  */
27 {
28 public:
29  /// Default constructor
30  /**
31  Object requires define() to be called before all other functions.
32  */
34 
35  /// Destructor
36  /**
37  Destroys all objects created by define(). Passed in data references
38  of define() are left alone.
39  */
41 
42  /// Actual constructor.
43  /**
44  Set up object.
45  */
46  void define(/// layout at finer level
47  const DisjointBoxLayout& a_layout,
48  /// number of variables
49  int a_numStates,
50  /// refinement ratio between finer level and coarser level
51  int a_refineCoarse,
52  /// problem domain on finer level
53  const ProblemDomain& a_domain,
54  /// number of coarse-level ghost cells
55  int a_coarseGhostsFill = 0,
56  /// dimensions that are fixed, not interpolated
57  Interval a_fixedDims = Interval() );
58 
59  void setJ(
60  /// <J> on fine grids
61  const LevelData<FArrayBox>& a_FnLevJ,
62  /// <J> on coarsened fine grids
63  const LevelData<FArrayBox>& a_CrFnLevJ);
64 
65  void setCrFnLevUandJU(
66  /// <U> on coarsened fine grids
67  const LevelData<FArrayBox>& a_CrFnLevU,
68  /// <JU> on coarsened fine grids
69  const LevelData<FArrayBox>& a_CrFnLevJU);
70 
71  /**
72  Interpolate to <JU> on fine level.
73  */
74  void interpToFineJU(/// interpolated fine <JU>
75  LevelData<FArrayBox>& a_fineJU);
76 
77 protected:
78 
79  void setStencil(BaseFab<IntVect>& a_stencil,
80  const Box& a_coarseBox);
81 
82  void getGradient(FArrayBox& a_gradFab,
83  const FArrayBox& a_srcFab,
84  const Box& a_bx);
85 
86  void clearMemory();
87 
88  void freeJ();
89 
90  /// Problem domain - index space for this level
92 
93  // m_domain coarsened by m_refineVect
95 
96  /// Refinement ratio between this level and the next coarser
98 
99  /// dimensions that are fixed, not interpolated
101 
102  /// number of dimensions that are interpolated: SpaceDim - m_fixedDims.size()
104 
105  /// 1 in m_fixedDims, m_refineCoarse in other dimensions
107 
108  /// 0 in m_fixedDims, 1 in other dimensions
110 
111  /// Number of variables
113 
114  /// maximum distance of stencil from domain boundary
116 
117  /// (-m_maxStencilDist*interpUnit, m_maxStencilDist*interpUnit)
119 
120  /// max degree of approximations
121  int m_degree;
122 
123  /// number of nonzero powers
125 
126  /// number of layers of ghost cells at the coarser level whose fine cells are to be filled in
128 
129  /// Box layout for finer level
131 
132  /// Box layout for coarser level: m_layout coarsened by m_refineVect
134 
135  /// all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
137 
138  /// on m_layoutCoarsened; which stencil to use at each coarse point
140 
141  /// <(z - z0)^p>k for each fine cell k.
143 
144  /// gradient of m_fineAvgPowers
146 
147  /// ghost vector on m_coarseData
149 
150  /// ghost vector on coarsened fine data
152 
153  /// IntVect::Zero to m_refineVect-interpUnit
155 
156  /// copied coarse data in interpToFine, lives on m_layoutCoarsened
158 
159  /// <J*(z - z0)^p>k for each fine cell k.
161 
162  /// B(i) = sum_{k in F(i)} (<J*zvec**pvec>k); m_numNonzeroPowers components
164 
165  /// 2-norm of B(i); 1 component
167 
169 
171 
173 
175 
177 
179 
181 
182  /// Vector<Real> *m_A1[dit](cell, 0) has a component for each stencil cell
184 
185  /// define() has been called
186  bool m_defined;
187 
188  /// J has been set, together with all the arrays calculated from J
189  bool m_haveJ;
190 
191  /// coefficients has been set, from call to setCrFnLevUandJU
193 
194 private:
195 
196  // Disallowed for all the usual reasons
199 };
200 
201 #include "NamespaceFooter.H"
202 
203 #endif
Fourth-order interpolation in space.
Definition: FourthOrderMappedCFInterp.H:26
LevelData< FArrayBox > m_coeffs
Definition: FourthOrderMappedCFInterp.H:178
void operator=(const FourthOrderMappedCFInterp &)
~FourthOrderMappedCFInterp()
Destructor.
Box m_fineBox
IntVect::Zero to m_refineVect-interpUnit.
Definition: FourthOrderMappedCFInterp.H:154
void setCrFnLevUandJU(const LevelData< FArrayBox > &a_CrFnLevU, const LevelData< FArrayBox > &a_CrFnLevJU)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
LevelData< FArrayBox > m_coeff0
Definition: FourthOrderMappedCFInterp.H:176
LevelData< FArrayBox > m_coarseData
copied coarse data in interpToFine, lives on m_layoutCoarsened
Definition: FourthOrderMappedCFInterp.H:157
ProblemDomain m_coarseDomain
Definition: FourthOrderMappedCFInterp.H:94
BaseFab< FourthOrderMappedCFInterpStencil * > m_stencils
all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
Definition: FourthOrderMappedCFInterp.H:136
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
DisjointBoxLayout m_layout
Box layout for finer level.
Definition: FourthOrderMappedCFInterp.H:130
IntVect m_interpUnit
0 in m_fixedDims, 1 in other dimensions
Definition: FourthOrderMappedCFInterp.H:109
int m_coarseGhostsFill
number of layers of ghost cells at the coarser level whose fine cells are to be filled in ...
Definition: FourthOrderMappedCFInterp.H:127
void getGradient(FArrayBox &a_gradFab, const FArrayBox &a_srcFab, const Box &a_bx)
int m_refineCoarse
Refinement ratio between this level and the next coarser.
Definition: FourthOrderMappedCFInterp.H:97
void setStencil(BaseFab< IntVect > &a_stencil, const Box &a_coarseBox)
IntVect m_ghostVect
ghost vector on m_coarseData
Definition: FourthOrderMappedCFInterp.H:148
int m_degree
max degree of approximations
Definition: FourthOrderMappedCFInterp.H:121
LevelData< FArrayBox > m_B
B(i) = sum_{k in F(i)} (<J*zvec**pvec>k); m_numNonzeroPowers components.
Definition: FourthOrderMappedCFInterp.H:163
int m_nInterpDims
number of dimensions that are interpolated: SpaceDim - m_fixedDims.size()
Definition: FourthOrderMappedCFInterp.H:103
int m_numNonzeroPowers
number of nonzero powers
Definition: FourthOrderMappedCFInterp.H:124
FArrayBox m_fineAvgPowers
<(z - z0)^p>k for each fine cell k.
Definition: FourthOrderMappedCFInterp.H:142
LevelData< FArrayBox > m_JfineAvgPowers
<J*(z - z0)^p>k for each fine cell k.
Definition: FourthOrderMappedCFInterp.H:160
ProblemDomain m_domain
Problem domain - index space for this level.
Definition: FourthOrderMappedCFInterp.H:91
bool m_haveJ
J has been set, together with all the arrays calculated from J.
Definition: FourthOrderMappedCFInterp.H:189
bool m_defined
define() has been called
Definition: FourthOrderMappedCFInterp.H:186
LayoutData< BaseFab< Vector< Real > *> *> m_A1
Vector<Real> *m_A1[dit](cell, 0) has a component for each stencil cell.
Definition: FourthOrderMappedCFInterp.H:183
LevelData< FArrayBox > m_QRtau
Definition: FourthOrderMappedCFInterp.H:172
IntVect m_coarseGhostVect
ghost vector on coarsened fine data
Definition: FourthOrderMappedCFInterp.H:151
Structure for passing component ranges in code.
Definition: Interval.H:23
LevelData< FArrayBox > m_normB
2-norm of B(i); 1 component
Definition: FourthOrderMappedCFInterp.H:166
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LevelData< FArrayBox > m_FnLevJ
Definition: FourthOrderMappedCFInterp.H:174
LevelData< BaseFab< IntVect > > m_stencilHere
on m_layoutCoarsened; which stencil to use at each coarse point
Definition: FourthOrderMappedCFInterp.H:139
void setJ(const LevelData< FArrayBox > &a_FnLevJ, const LevelData< FArrayBox > &a_CrFnLevJ)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Box m_stencilBox
(-m_maxStencilDist*interpUnit, m_maxStencilDist*interpUnit)
Definition: FourthOrderMappedCFInterp.H:118
FourthOrderMappedCFInterp()
Default constructor.
FArrayBox m_gradFineAvgPowers
gradient of m_fineAvgPowers
Definition: FourthOrderMappedCFInterp.H:145
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Interval m_fixedDims
dimensions that are fixed, not interpolated
Definition: FourthOrderMappedCFInterp.H:100
Definition: FArrayBox.H:45
LevelData< FArrayBox > m_alpha
Definition: FourthOrderMappedCFInterp.H:168
void define(const DisjointBoxLayout &a_layout, int a_numStates, int a_refineCoarse, const ProblemDomain &a_domain, int a_coarseGhostsFill=0, Interval a_fixedDims=Interval())
Actual constructor.
int m_numStates
Number of variables.
Definition: FourthOrderMappedCFInterp.H:112
bool m_haveCoeffs
coefficients has been set, from call to setCrFnLevUandJU
Definition: FourthOrderMappedCFInterp.H:192
DisjointBoxLayout m_layoutCoarsened
Box layout for coarser level: m_layout coarsened by m_refineVect.
Definition: FourthOrderMappedCFInterp.H:133
IntVect m_refineVect
1 in m_fixedDims, m_refineCoarse in other dimensions
Definition: FourthOrderMappedCFInterp.H:106
LayoutData< BaseFab< Vector< Real > *> *> m_QRmatrix
Definition: FourthOrderMappedCFInterp.H:180
void interpToFineJU(LevelData< FArrayBox > &a_fineJU)
int m_maxStencilDist
maximum distance of stencil from domain boundary
Definition: FourthOrderMappedCFInterp.H:115
LevelData< FArrayBox > m_beta
Definition: FourthOrderMappedCFInterp.H:170