Chombo + EB + MF  3.2
LoHiCenter.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 _LOHICENTER_H_
12 #define _LOHICENTER_H_
13 
14 #include "Box.H"
15 #include "ProblemDomain.H"
16 #include "NamespaceHeader.H"
17 
18 ///
19 /**
20  This function is used when in direction a_dir a 3-point stencil of
21  cell-centered data is being used to compute something at the
22  center of the central cell of the stencil.
23 
24  Inputs:
25  * a_dir is the direction of the 3-point stencil;
26  * a_inBox is the cell-centered box on which we are to compute a
27  stencil (2-point or 3-point), expanded by 1 in a_dir direction,
28  and not intersected with the domain;
29  * a_domain is the problem domain.
30 
31  Output boxes are all cell-centered subboxes of a_inBox and
32  are also contained in a_domain:
33  * a_loBox is where a 2-point stencil must be used on the low side;
34  * a_centerBox is where the full 3-point stencil can be used;
35  * a_hiBox is where a 2-point stencil must be used on the high side;
36  * a_entireBox is the union of a_loBox and a_centerBox and a_hiBox.
37 
38  The boxes a_loBox and a_hiBox will be at most 1 cell wide;
39  here the 2-point stencil consists of a cell from this box and
40  the neighboring cell from a_centerBox in direction a_dir.
41 
42  a_entireBox will be a_inBox with one layer of cells removed
43  from both sides in dimension a_dir.
44 
45  Output flags:
46  * a_hasLo: 1 or 0, according to whether a_loBox is defined or not;
47  * a_hasHi: 1 or 0, according to whether a_hiBox is defined or not.
48  */
49 extern void loHiCenter(Box& a_loBox,
50  int& a_hasLo,
51  Box& a_hiBox,
52  int& a_hasHi,
53  Box& a_centerBox,
54  Box& a_entireBox,
55  const Box& a_inBox,
56  const ProblemDomain& a_domain,
57  const int& a_dir);
58 
59 ///
60 /**
61  This function is used when in direction a_dir a 2-point stencil of
62  cell-centered data is being used to compute something at the
63  face between cells of the stencil.
64 
65  Inputs:
66  * a_dir is the direction of the 2-point stencil;
67  * a_inBox is the cell-centered box (on whose faces we are to
68  compute a stencil), expanded by 1 in a_dir direction, and not
69  intersected with the domain.
70  * a_domain is the problem domain.
71 
72  Output boxes are all face-centered subboxes of the faces of a_inBox
73  in direction a_dir, and are also contained in the faces of a_domain:
74  * a_loBox is where a 1-point stencil must be used on the low side;
75  * a_centerBox is where the full 2-point stencil can be used;
76  * a_hiBox is where a 1-point stencil must be used on the high side;
77  * a_entireBox is the union of a_loBox and a_centerBox and a_hiBox.
78 
79  The boxes a_loBox and a_hiBox will be at most 1 face wide;
80  here the 1-point stencil consists of only 1 of the adjacent cells
81  in direction a_dir.
82 
83  Output flags:
84  * a_hasLo: 1 or 0, according to whether a_loBox is defined or not;
85  * a_hasHi: 1 or 0, according to whether a_hiBox is defined or not.
86  */
87 extern void loHiCenterFace(Box& a_loBox,
88  int& a_hasLo,
89  Box& a_hiBox,
90  int& a_hasHi,
91  Box& a_centerBox,
92  Box& a_entireBox,
93  const Box& a_inBox,
94  const ProblemDomain& a_domain,
95  const int& a_dir);
96 
97 ///
98 /**
99  This function is used when in direction a_dir a 4-point stencil of
100  cell-centered data is being used to compute something at the
101  face between cells of the stencil.
102 
103  Inputs:
104  * a_dir is the direction of the 4-point stencil;
105  * a_inBox is the cell-centered box on which we have data;
106  * a_domain is the problem domain.
107 
108  Output boxes are all face-centered subboxes of the faces of a_inBox
109  in direction a_dir, and are also contained in the faces of a_domain:
110  * a_loBox is where a stencil must be used on the low side
111  with all four points higher;
112  * a_nextLoBox is where a stencil must be used on the low side
113  with one point lower and three points higher;
114  * a_hiBox is where a stencil must be used on the high side
115  with all four points lower;
116  * a_nextHiBox is where a stencil must be used on the high side
117  with one point higher and three points lower;
118  * a_centerBox is union of a_innerCenterBox, a_nextLoBox, and a_nextHiBox,
119  where the regular 2-point stencil can be used;
120  * a_innerCenterBox is where the regular 4-point stencil can be used;
121  * a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box.
122 
123  Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox
124  will be at most 1 face wide.
125 
126  a_loBox and a_nextLoBox will both be defined or both be undefined.
127  a_hiBox and a_nextHiBox will both be defined or both be undefined.
128 
129  Output flags:
130  * a_hasLo: 1 or 0, according to whether a_loBox and a_nextLoBox
131  are defined or not;
132  * a_hasHi: 1 or 0, according to whether a_hiBox and a_nextHiBox
133  are defined or not.
134  */
135 extern void loHiCenterFace4(Box& a_loBox,
136  Box& a_nextLoBox,
137  int& a_hasLo,
138  Box& a_hiBox,
139  Box& a_nextHiBox,
140  int& a_hasHi,
141  Box& a_centerBox,
142  Box& a_innerCenterBox,
143  Box& a_entireBox,
144  const Box& a_inBox,
145  const ProblemDomain& a_domain,
146  const int& a_dir);
147 
148 ///
149 /**
150  This function is used when in direction a_dir a 5-point stencil of
151  cell-centered data is being used to compute something at the
152  center of the central cell of the stencil.
153 
154  Inputs:
155  * a_dir is the direction of the 5-point stencil;
156  * a_inBox is the cell-centered box on which we are to compute a
157  stencil (2-point or 3-point or 5-point), expanded by 1 in a_dir direction,
158  and not intersected with the domain;
159  * a_domain is the problem domain.
160 
161  Output boxes are all cell-centered subboxes of a_inBox and
162  are also contained in a_domain:
163  * a_loBox is where a 2-point stencil must be used on the low side;
164  * a_nextLoBox is where a 3-point stencil must be used on the low side
165  with one point lower and three points higher;
166  * a_hiBox is where a 2-point stencil must be used on the high side;
167  * a_nextHiBox is where a 3-point stencil must be used on the high side
168  with one point higher and three points lower;
169  * a_centerBox is union of a_innerCenterBox, a_nextLoBox, and a_nextHiBox,
170  where a 3-point stencil may be used;
171  * a_innerCenterBox is where the regular 5-point stencil can be used;
172  where a 5-point stencil may be used;
173  * a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box.
174 
175  Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox
176  will be at most 1 cell wide.
177 
178  a_loBox and a_nextLoBox will both be defined or both be undefined.
179  a_hiBox and a_nextHiBox will both be defined or both be undefined.
180 
181  Output flags:
182  * a_hasLo: 1 or 0, according to whether a_loBox and a_nextLoBox
183  are defined or not;
184  * a_hasHi: 1 or 0, according to whether a_hiBox and a_nextHiBox
185  are defined or not.
186  */
187 extern void loHiCenter5(Box& a_loBox,
188  Box& a_nextLoBox,
189  int& a_hasLo,
190  Box& a_hiBox,
191  Box& a_nextHiBox,
192  int& a_hasHi,
193  Box& a_centerBox,
194  Box& a_innerCenterBox,
195  Box& a_entireBox,
196  const Box& a_inBox,
197  const ProblemDomain& a_domain,
198  const int& a_dir);
199 
200 ///
201 /**
202  This function is used when in direction a_dir a 6-point stencil of
203  cell-centered data is being used to compute something at the
204  face between cells of the stencil.
205 
206  Inputs:
207  * a_dir is the direction of the 6-point stencil;
208  * a_inBox is the cell-centered box on which we have data;
209  * a_domain is the problem domain.
210 
211  Output boxes are all face-centered subboxes of the faces of a_inBox
212  in direction a_dir, and are also contained in the faces of a_domain:
213  * a_farLoBox is where a stencil must be used on the low side
214  with all 6 points higher;
215  * a_midLoBox is where a stencil must be used on the low side
216  with 1 point lower and 5 points higher;
217  * a_nearLoBox is where a stencil must be used on the low side
218  with 2 points lower and 4 points higher;
219  * a_farHiBox is where a stencil must be used on the high side
220  with all 6 points lower;
221  * a_midHiBox is where a stencil must be used on the high side
222  with 1 point higher and 5 points lower;
223  * a_nearHiBox is where a stencil must be used on the high side
224  with 2 points higher and 4 points lower;
225  * a_centerBox is union of a_innerCenterBox and a_near(Lo|Hi)Box,
226  where the regular 2-point stencil can be used;
227  * a_midCenterBox is union of a_innerCenterBox, a_near(Lo|Hi)Box, and
228  a_mid(Lo|Hi)Box, where the regular 4-point stencil can be used;
229  * a_innerCenterBox is where the regular 6-point stencil can be used;
230  * a_entireBox is union of a_(far|mid|near)(Lo|Hi)Box and a_innerCenterBox.
231 
232  Each of the boxes a_(far|mid|near)(Lo|Hi)Box will be at most 1 face wide.
233 
234  a_farLoBox, a_midLoBox, a_nearLoBox will all be defined or all be undefined.
235  a_farHiBox, a_midHiBox, a_nearHiBox will all be defined or all be undefined.
236 
237  Output flags:
238  * a_hasLo: 1 or 0, set to whether a_(far|mid|near)loBox defined or not;
239  * a_hasHi: 1 or 0, set to whether a_(far|mid|near)HiBox defined or not.
240  */
241 extern void loHiCenterFace6(Box& a_farLoBox,
242  Box& a_midLoBox,
243  Box& a_nearLoBox,
244  int& a_hasLo,
245  Box& a_farHiBox,
246  Box& a_midHiBox,
247  Box& a_nearHiBox,
248  int& a_hasHi,
249  Box& a_centerBox,
250  Box& a_midCenterBox,
251  Box& a_innerCenterBox,
252  Box& a_entireBox,
253  const Box& a_inBox,
254  const ProblemDomain& a_domain,
255  const int& a_dir);
256 
257 #include "NamespaceFooter.H"
258 #endif
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void loHiCenter5(Box &a_loBox, Box &a_nextLoBox, int &a_hasLo, Box &a_hiBox, Box &a_nextHiBox, int &a_hasHi, Box &a_centerBox, Box &a_innerCenterBox, Box &a_entireBox, const Box &a_inBox, const ProblemDomain &a_domain, const int &a_dir)
void loHiCenterFace(Box &a_loBox, int &a_hasLo, Box &a_hiBox, int &a_hasHi, Box &a_centerBox, Box &a_entireBox, const Box &a_inBox, const ProblemDomain &a_domain, const int &a_dir)
void loHiCenter(Box &a_loBox, int &a_hasLo, Box &a_hiBox, int &a_hasHi, Box &a_centerBox, Box &a_entireBox, const Box &a_inBox, const ProblemDomain &a_domain, const int &a_dir)
void loHiCenterFace4(Box &a_loBox, Box &a_nextLoBox, int &a_hasLo, Box &a_hiBox, Box &a_nextHiBox, int &a_hasHi, Box &a_centerBox, Box &a_innerCenterBox, Box &a_entireBox, const Box &a_inBox, const ProblemDomain &a_domain, const int &a_dir)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
void loHiCenterFace6(Box &a_farLoBox, Box &a_midLoBox, Box &a_nearLoBox, int &a_hasLo, Box &a_farHiBox, Box &a_midHiBox, Box &a_nearHiBox, int &a_hasHi, Box &a_centerBox, Box &a_midCenterBox, Box &a_innerCenterBox, Box &a_entireBox, const Box &a_inBox, const ProblemDomain &a_domain, const int &a_dir)