Chombo + EB  3.2
FourthOrderCFInterp.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 _FOURTHORDERCFINTERP_H_
12 #define _FOURTHORDERCFINTERP_H_
13 
14 #include "FArrayBox.H"
15 #include "DisjointBoxLayout.H"
16 #include "LevelData.H"
17 #include "ProblemDomain.H"
18 #include "FourthOrderFineInterp.H"
19 
20 #include "NamespaceHeader.H"
21 
22 /// Fourth-order interpolation in time and space to ghost cells.
23 
24 /**
25  */
27 {
28 public:
29  /// Default constructor
30  /**
31  Object requires define() to be called before all other functions.
32  */
34  {
35  m_defined = false;
36  }
37 
38  /// Full constructor
39  FourthOrderCFInterp(/// layout at this level
40  const DisjointBoxLayout& a_thisDisjointBoxLayout,
41  /// layout at coarser level
42  const DisjointBoxLayout& a_coarserDisjointBoxLayout,
43  /// number of variables
44  const int& a_numStates,
45  /// problem domain on the coarser level
46  const ProblemDomain& a_coarseDomain,
47  /// refinement ratio between this level and the coarser level
48  const int& a_refineCoarse,
49  /// number of layers of ghost cells to fill by interpolation
50  const int& a_interpRadius)
51  {
52  define(a_thisDisjointBoxLayout, a_coarserDisjointBoxLayout,
53  a_numStates, a_coarseDomain, a_refineCoarse, a_interpRadius);
54  }
55 
56  /// Destructor
57  /**
58  Destroys all objects created by define(). Passed in data references
59  of define() are left alone.
60  */
62  {
63  }
64 
65  ///fill ghostcells as if all the coarse data were zero (useful for multigrid)
66  void
67  homogeneousCoarseFineInterp(/// interpolated solution on this level
68  LevelData<FArrayBox>& a_fineData,
69  /// solution on coarser level
70  int a_srcComp,
71  /// starting fine data component
72  int a_dstComp,
73  /// number of data components to interpolate
74  int a_numComp);
75  /// Actual constructor.
76  /**
77  Set up object.
78  */
79  void define(/// layout at this level
80  const DisjointBoxLayout& a_thisDisjointBoxLayout,
81  /// layout at coarser level
82  const DisjointBoxLayout& a_coarserDisjointBoxLayout,
83  /// number of variables
84  const int& a_numStates,
85  /// problem domain on the coarser level
86  const ProblemDomain& a_coarseDomain,
87  /// refinement ratio between this level and the coarser level
88  const int& a_refineCoarse,
89  /// number of layers of ghost cells to fill by interpolation
90  const int& a_interpRadius);
91 
92 
93 
94 
95  /// Interpolate in space only.
96  /**
97  At a fixed time, interpolate in space to ghost cells of a_fine
98  from a_coarse.
99  */
100  void coarseFineInterp(/// interpolated solution on this level
101  LevelData<FArrayBox>& a_fineData,
102  /// solution on coarser level
103  const LevelData<FArrayBox>& a_coarseData,
104  /// starting coarse data component
105  int a_srcComp,
106  /// starting fine data component
107  int a_dstComp,
108  /// number of data components to interpolate
109  int a_numComp);
110 
111 
112 
113 protected:
114 
115  /// whether define() has been called
116  bool m_defined;
117 
118  /// box layout for this level
120 
121  /// this level's layout coarsened
123 
124  /// box layout for the coarse level
126 
127  /// number of layers of fine ghost cells to fill by interpolation
129 
130  /// problem domain at the coarser level
132 
133  /// refinement ratio between this level and the next coarser
135 
136  /// 1 in m_fixedDims, m_refineCoarse in other dimensions
138 
139  /// number of variables
141 
142  /// data on ghosted coarsened fine grids at intermediate time in fillInterp
144 
145  /// coarsened ghost cells of fine patches
147 
148 
149  /// interpolator in space
151 
152  /// Interpolate in space only, from coarsened fine grids.
153  void fillInterpSpaceFromCoarsened(/// interpolated solution on this level
154  LevelData<FArrayBox>& a_fineData,
155  /// starting coarse data component
156  int a_srcComp,
157  /// starting fine data component
158  int a_dstComp,
159  /// number of data components to interpolate
160  int a_numComp);
161 
162 private:
163 
164  // Disallowed for all the usual reasons
165  void operator=(const FourthOrderCFInterp&);
167 };
168 
169 #include "NamespaceFooter.H"
170 #endif
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int m_interpRadius
number of layers of fine ghost cells to fill by interpolation
Definition: FourthOrderCFInterp.H:128
~FourthOrderCFInterp()
Destructor.
Definition: FourthOrderCFInterp.H:61
bool m_defined
whether define() has been called
Definition: FourthOrderCFInterp.H:116
IntVect m_refineVect
1 in m_fixedDims, m_refineCoarse in other dimensions
Definition: FourthOrderCFInterp.H:137
ProblemDomain m_coarseDomain
problem domain at the coarser level
Definition: FourthOrderCFInterp.H:131
void fillInterpSpaceFromCoarsened(LevelData< FArrayBox > &a_fineData, int a_srcComp, int a_dstComp, int a_numComp)
Interpolate in space only, from coarsened fine grids.
DisjointBoxLayout m_layout
box layout for this level
Definition: FourthOrderCFInterp.H:119
void operator=(const FourthOrderCFInterp &)
Fourth-order interpolation in space.
Definition: FourthOrderFineInterp.H:25
int m_refineCoarse
refinement ratio between this level and the next coarser
Definition: FourthOrderCFInterp.H:134
FourthOrderCFInterp(const DisjointBoxLayout &a_thisDisjointBoxLayout, const DisjointBoxLayout &a_coarserDisjointBoxLayout, const int &a_numStates, const ProblemDomain &a_coarseDomain, const int &a_refineCoarse, const int &a_interpRadius)
Full constructor.
Definition: FourthOrderCFInterp.H:39
FourthOrderCFInterp()
Default constructor.
Definition: FourthOrderCFInterp.H:33
DisjointBoxLayout m_layoutCoarsened
this level's layout coarsened
Definition: FourthOrderCFInterp.H:122
DisjointBoxLayout m_coarseLayout
box layout for the coarse level
Definition: FourthOrderCFInterp.H:125
Fourth-order interpolation in time and space to ghost cells.
Definition: FourthOrderCFInterp.H:26
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LevelData< FArrayBox > m_coarsenedFineData
data on ghosted coarsened fine grids at intermediate time in fillInterp
Definition: FourthOrderCFInterp.H:143
void coarseFineInterp(LevelData< FArrayBox > &a_fineData, const LevelData< FArrayBox > &a_coarseData, int a_srcComp, int a_dstComp, int a_numComp)
Interpolate in space only.
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)
Actual constructor.
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
LayoutData< IntVectSet > m_coarsenedGhosts
coarsened ghost cells of fine patches
Definition: FourthOrderCFInterp.H:146
int m_numStates
number of variables
Definition: FourthOrderCFInterp.H:140
FourthOrderFineInterp m_spaceInterpolator
interpolator in space
Definition: FourthOrderCFInterp.H:150
void homogeneousCoarseFineInterp(LevelData< FArrayBox > &a_fineData, int a_srcComp, int a_dstComp, int a_numComp)
fill ghostcells as if all the coarse data were zero (useful for multigrid)