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