Chombo + EB + MF  3.2
FineInterpFace.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 _FINEINTERPFACE_H_
12 #define _FINEINTERPFACE_H_
13 
14 #include "REAL.H"
15 #include "LevelData.H"
16 #include "BaseFab.H"
17 #include "FArrayBox.H"
18 #include "FluxBox.H"
19 #include "ProblemDomain.H"
20 
21 #include "NamespaceHeader.H"
22 
23 class DisjointBoxLayout;
24 
25 /// replaces face-centered fine data with interpolation of coarse level data.
26 /**
27  This class replaces data at a fine level of refinement with data
28  interpolated from a coarser level of refinement. Interpolation on
29  fine faces which overlie coarse faces is piecewise bi(tri)linear,
30  with van Leer slopes if there is room for the stencil, with
31  lower-order slopes if there isn't. For the intermediate fine-level
32  faces, interpolate linearly between the corresponding fine-grid faces
33  which _do_ overlie coarse-grid faces.
34  */
36 {
37 public:
38  ///
39 /**
40  Default constructor. User must subsequently call define().
41  */
43 
44  ///
45 /**
46  Destructor.
47 */
49 
50  ///
51  /**
52  Defining constructor. Constructs a valid object.
53  Equivalent to default construction followed by define().
54 
55  {\bf Arguments:}\\
56  a_fine_domain (not modified): the fine level domain.\\
57  a_numcomps (not modified): the number of components.\\
58  a_ref_ratio (not modified): the refinement ratio.\\
59  a_fine_problem_domain (not modified): problem domain at the fine level.\\
60 
61  */
62  FineInterpFace(const DisjointBoxLayout& a_fine_domain,
63  const int& a_numcomps,
64  const int& a_ref_ratio,
65  const Box& a_fine_problem_domain);
66 
67 
68  ///
69  /**
70  Defining constructor. Constructs a valid object.
71  Equivalent to default construction followed by define().
72 
73  {\bf Arguments:}\\
74  a_fine_domain (not modified): the fine level domain.\\
75  a_numcomps (not modified): the number of components.\\
76  a_ref_ratio (not modified): the refinement ratio.\\
77  a_fine_problem_domain (not modified): problem domain at the fine level.\\
78 
79  */
80  FineInterpFace(const DisjointBoxLayout& a_fine_domain,
81  const int& a_numcomps,
82  const int& a_ref_ratio,
83  const ProblemDomain& a_fine_problem_domain);
84 
85  ///
86  /**
87  Defines this object. Existing information is overriden.
88 
89  {\bf Arguments:}\\
90  a_fine_domain (not modified): the fine level domain.\\
91  a_numcomps (not modified): the number of components.\\
92  a_ref_ratio (not modified): the refinement ratio.\\
93  a_fine_problem_domain (not modified): problem domain at the fine level.\\
94 
95  {\bf This:}\\
96  ---This object is modified.---
97 
98  */
99  void
100  define(const DisjointBoxLayout& a_fine_domain, // the fine level domain
101  const int& a_numcomps, // the number of components
102  const int& a_ref_ratio, // the refinement ratio
103  const Box& a_fine_problem_domain); // problem domain
104 
105  ///
106  /**
107  Defines this object. Existing information is overriden.
108 
109  {\bf Arguments:}\\
110  a_fine_domain (not modified): the fine level domain.\\
111  a_numcomps (not modified): the number of components.\\
112  a_ref_ratio (not modified): the refinement ratio.\\
113  a_fine_problem_domain (not modified): problem domain at the fine level.\\
114 
115  {\bf This:}\\
116  ---This object is modified.---
117 
118  */
119  void
120  define(const DisjointBoxLayout& a_fine_domain, // the fine level domain
121  const int& a_numcomps, // the number of components
122  const int& a_ref_ratio, // the refinement ratio
123  const ProblemDomain& a_fine_problem_domain); // problem domain
124 
125  ///
126  /**
127  Returns true if this object was created with the defining
128  constructor or if define() has been called.
129 
130  {\bf This:}\\
131  This object is not modified.
132  */
133  bool
134  isDefined() const;
135 
136  ///
137  /**
138  Replaces a_fine_data with data interpolated from a_coarse_data. It
139  is an error to call if not this->isDefined(). The domain of
140  a_fine_data should be the same as the fine domain specified in the
141  most recent call to define(). It is expected that the coarse and
142  fine level's domains are properly nested. Both a_coarse_data and
143  a_fine_data should have the same number of components specified in
144  the most recent call to define().
145 
146  {\bf Arguments:}\\
147  a_fine_data (modified): fine data. \\
148  a_coarse_data (not modified): coarse data. \\
149 
150  {\bf This:}\\
151  Well, it's complicated. As far as the user is concerned, this object
152  is not modified. See the design document if you care for details.
153 
154  */
155  void
156  interpToFine(LevelData<FluxBox>& a_fine_data,
157  const LevelData<FluxBox>& a_coarse_data,
158  bool a_averageFromDest = false);
159 
160 protected:
161  void
163  const BaseFab<Real>& a_coarse,
164  const Box& a_coarsened_fine_box,
165  const int& a_ref_ratio, const int& a_dir)
166  const;
167 
168 protected:
170  // the refinement ratio
172  // work array for the coarse level data in a domain that is the
173  // outline of the fine level domain on the coarse level
175  // coarse level problem domain
177 };
178 
179 #include "NamespaceFooter.H"
180 
181 #endif
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void interpToFine(LevelData< FluxBox > &a_fine_data, const LevelData< FluxBox > &a_coarse_data, bool a_averageFromDest=false)
replaces face-centered fine data with interpolation of coarse level data.
Definition: FineInterpFace.H:35
ProblemDomain m_coarse_problem_domain
Definition: FineInterpFace.H:176
bool isDefined() const
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void define(const DisjointBoxLayout &a_fine_domain, const int &a_numcomps, const int &a_ref_ratio, const Box &a_fine_problem_domain)
bool is_defined
Definition: FineInterpFace.H:169
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
LevelData< FluxBox > m_coarsened_fine_data
Definition: FineInterpFace.H:174
int m_ref_ratio
Definition: FineInterpFace.H:171
void interpGridData(BaseFab< Real > &a_fine, const BaseFab< Real > &a_coarse, const Box &a_coarsened_fine_box, const int &a_ref_ratio, const int &a_dir) const