Chombo + EB + MF  3.2
FourthOrderFillPatch.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 _FOURTHORDERFILLPATCH_H_
12 #define _FOURTHORDERFILLPATCH_H_
13 
14 #include "FArrayBox.H"
15 #include "DisjointBoxLayout.H"
16 #include "LevelData.H"
17 #include "ProblemDomain.H"
18 #include "TimeInterpolatorRK4.H"
19 #include "FourthOrderFineInterp.H"
20 
21 #include "NamespaceHeader.H"
22 
23 /// Fourth-order interpolation in time and space to ghost cells.
24 
25 /**
26  */
28 {
29 public:
30  /// Default constructor
31  /**
32  Object requires define() to be called before all other functions.
33  */
35 
36  /// Full constructor
37  FourthOrderFillPatch(/// layout at this level
38  const DisjointBoxLayout& a_thisDisjointBoxLayout,
39  /// layout at coarser level
40  const DisjointBoxLayout& a_coarserDisjointBoxLayout,
41  /// number of variables
42  const int& a_numStates,
43  /// problem domain on the coarser level
44  const ProblemDomain& a_coarseDomain,
45  /// refinement ratio between this level and the coarser level
46  const int& a_refineCoarse,
47  /// number of layers of ghost cells to fill by interpolation
48  const int& a_interpRadius,
49  /// whether this object is for a fixed time
50  bool a_fixedTime = false,
51  /// dimensions that are fixed, not interpolated
52  Interval a_fixedDims = Interval() )
53  {
54  define(a_thisDisjointBoxLayout, a_coarserDisjointBoxLayout,
55  a_numStates, a_coarseDomain, a_refineCoarse, a_interpRadius,
56  a_fixedTime, a_fixedDims);
57  }
58 
59  /// Destructor
60  /**
61  Destroys all objects created by define(). Passed in data references
62  of define() are left alone.
63  */
65 
66  /// Actual constructor.
67  /**
68  Set up object.
69  */
70  void define(/// layout at this level
71  const DisjointBoxLayout& a_thisDisjointBoxLayout,
72  /// layout at coarser level
73  const DisjointBoxLayout& a_coarserDisjointBoxLayout,
74  /// number of variables
75  const int& a_numStates,
76  /// problem domain on the coarser level
77  const ProblemDomain& a_coarseDomain,
78  /// refinement ratio between this level and the coarser level
79  const int& a_refineCoarse,
80  /// number of layers of ghost cells to fill by interpolation
81  const int& a_interpRadius,
82  /// whether this object is for a fixed time
83  bool a_fixedTime = false,
84  /// dimensions that are fixed, not interpolated
85  Interval a_fixedDims = Interval() );
86 
87  /// Interpolate in time and space.
88  /**
89  Interpolate in time and space to ghost cells of a_fine from coarse data.
90  The time interpolator must already contain the full Taylor polynomial
91  calculated from data at the coarser level.
92  */
93  void fillInterp(/// interpolated solution on this level
94  LevelData<FArrayBox>& a_fineData,
95  /// time interpolation coefficient, in [0:1]
96  Real a_timeInterpCoeff,
97  /// starting coarse data component
98  int a_srcComp,
99  /// starting fine data component
100  int a_dstComp,
101  /// number of data components to interpolate
102  int a_numComp);
103 
104 
105  /// Fill RK4 intermediate in time and space.
106  /**
107  Set RK4 intermediate interpolating in time and space
108  to ghost cells of a_fine from coarse data.
109  The time interpolator must already contain the full Taylor polynomial
110  calculated from data at the coarser level.
111  */
112  void fillRK4Intermediate(/// interpolated solution on this level
113  LevelData<FArrayBox>& a_fineData,
114  /// time interpolation coefficient, in [0:1]
115  Real a_timeInterpCoeff,
116  /// RK4 stage, in 0:3
117  int a_stage,
118  /// starting coarse data component
119  int a_srcComp,
120  /// starting fine data component
121  int a_dstComp,
122  /// number of data components to interpolate
123  int a_numComp);
124 
125 
126  /// Interpolate in space only.
127  /**
128  At a fixed time, interpolate in space to ghost cells of a_fine
129  from a_coarse.
130  */
131  void fillInterp(/// interpolated solution on this level
132  LevelData<FArrayBox>& a_fineData,
133  /// solution on coarser level
134  const LevelData<FArrayBox>& a_coarseData,
135  /// starting coarse data component
136  int a_srcComp,
137  /// starting fine data component
138  int a_dstComp,
139  /// number of data components to interpolate
140  int a_numComp);
141 
142 
143  /// Return time interpolator object.
144  /**
145  Return m_timeInterpolator.
146  */
148 
149 protected:
150 
151  /// whether define() has been called
152  bool m_defined;
153 
154  /// whether m_timeInterpolator is defined
156 
157  /// box layout for this level
159 
160  /// this level's layout coarsened
162 
163  /// box layout for the coarse level
165 
166  /// number of layers of fine ghost cells to fill by interpolation
168 
169  /// problem domain at the coarser level
171 
172  /// refinement ratio between this level and the next coarser
174 
175  /// dimensions that are fixed, not interpolated
177 
178  /// 1 in m_fixedDims, m_refineCoarse in other dimensions
180 
181  /// number of variables
183 
184  /// data on ghosted coarsened fine grids at intermediate time in fillInterp
186 
187  /// coarsened ghost cells of fine patches
189 
190  /// interpolator in time
192 
193  /// interpolator in space
195 
196  /// Interpolate in space only, from coarsened fine grids.
197  /**
198  At a fixed time, interpolate in space to ghost cells of a_fine
199  from m_coarseFineData.
200  */
201  void fillInterpSpaceFromCoarsened(/// interpolated solution on this level
202  LevelData<FArrayBox>& a_fineData,
203  /// starting coarse data component
204  int a_srcComp,
205  /// starting fine data component
206  int a_dstComp,
207  /// number of data components to interpolate
208  int a_numComp);
209 
210 private:
211 
212  // Disallowed for all the usual reasons
213  void operator=(const FourthOrderFillPatch&);
215 };
216 
217 #include "NamespaceFooter.H"
218 #endif
TimeInterpolatorRK4 m_timeInterpolator
interpolator in time
Definition: FourthOrderFillPatch.H:191
IntVect m_refineVect
1 in m_fixedDims, m_refineCoarse in other dimensions
Definition: FourthOrderFillPatch.H:179
~FourthOrderFillPatch()
Destructor.
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void fillInterpSpaceFromCoarsened(LevelData< FArrayBox > &a_fineData, int a_srcComp, int a_dstComp, int a_numComp)
Interpolate in space only, from coarsened fine grids.
ProblemDomain m_coarseDomain
problem domain at the coarser level
Definition: FourthOrderFillPatch.H:170
Interval m_fixedDims
dimensions that are fixed, not interpolated
Definition: FourthOrderFillPatch.H:176
bool m_timeInterpDefined
whether m_timeInterpolator is defined
Definition: FourthOrderFillPatch.H:155
Fourth-order interpolation in space.
Definition: FourthOrderFineInterp.H:25
void fillRK4Intermediate(LevelData< FArrayBox > &a_fineData, Real a_timeInterpCoeff, int a_stage, int a_srcComp, int a_dstComp, int a_numComp)
Fill RK4 intermediate in time and space.
DisjointBoxLayout m_layout
box layout for this level
Definition: FourthOrderFillPatch.H:158
Structure for passing component ranges in code.
Definition: Interval.H:23
int m_numStates
number of variables
Definition: FourthOrderFillPatch.H:182
double Real
Definition: REAL.H:33
LevelData< FArrayBox > m_coarsenedFineData
data on ghosted coarsened fine grids at intermediate time in fillInterp
Definition: FourthOrderFillPatch.H:185
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Time interpolator class using 4th-order Runge-Kutta.
Definition: TimeInterpolatorRK4.H:24
TimeInterpolatorRK4 & getTimeInterpolator()
Return time interpolator object.
FourthOrderFillPatch(const DisjointBoxLayout &a_thisDisjointBoxLayout, const DisjointBoxLayout &a_coarserDisjointBoxLayout, const int &a_numStates, const ProblemDomain &a_coarseDomain, const int &a_refineCoarse, const int &a_interpRadius, bool a_fixedTime=false, Interval a_fixedDims=Interval())
Full constructor.
Definition: FourthOrderFillPatch.H:37
void define(const DisjointBoxLayout &a_thisDisjointBoxLayout, const DisjointBoxLayout &a_coarserDisjointBoxLayout, const int &a_numStates, const ProblemDomain &a_coarseDomain, const int &a_refineCoarse, const int &a_interpRadius, bool a_fixedTime=false, Interval a_fixedDims=Interval())
Actual constructor.
int m_refineCoarse
refinement ratio between this level and the next coarser
Definition: FourthOrderFillPatch.H:173
int m_interpRadius
number of layers of fine ghost cells to fill by interpolation
Definition: FourthOrderFillPatch.H:167
DisjointBoxLayout m_coarseLayout
box layout for the coarse level
Definition: FourthOrderFillPatch.H:164
FourthOrderFillPatch()
Default constructor.
DisjointBoxLayout m_layoutCoarsened
this level&#39;s layout coarsened
Definition: FourthOrderFillPatch.H:161
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void operator=(const FourthOrderFillPatch &)
bool m_defined
whether define() has been called
Definition: FourthOrderFillPatch.H:152
Fourth-order interpolation in time and space to ghost cells.
Definition: FourthOrderFillPatch.H:27
void fillInterp(LevelData< FArrayBox > &a_fineData, Real a_timeInterpCoeff, int a_srcComp, int a_dstComp, int a_numComp)
Interpolate in time and space.
FourthOrderFineInterp m_spaceInterpolator
interpolator in space
Definition: FourthOrderFillPatch.H:194
LayoutData< IntVectSet > m_coarsenedGhosts
coarsened ghost cells of fine patches
Definition: FourthOrderFillPatch.H:188