00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _LOHICENTER_H_ 00012 #define _LOHICENTER_H_ 00013 00014 #include "Box.H" 00015 #include "ProblemDomain.H" 00016 #include "NamespaceHeader.H" 00017 00018 /// 00019 /** 00020 This function is used when in direction a_dir a 3-point stencil of 00021 cell-centered data is being used to compute something at the 00022 center of the central cell of the stencil. 00023 00024 Inputs: 00025 * a_dir is the direction of the 3-point stencil; 00026 * a_inBox is the cell-centered box on which we are to compute a 00027 stencil (2-point or 3-point), expanded by 1 in a_dir direction, 00028 and not intersected with the domain; 00029 * a_domain is the problem domain. 00030 00031 Output boxes are all cell-centered subboxes of a_inBox and 00032 are also contained in a_domain: 00033 * a_loBox is where a 2-point stencil must be used on the low side; 00034 * a_centerBox is where the full 3-point stencil can be used; 00035 * a_hiBox is where a 2-point stencil must be used on the high side; 00036 * a_entireBox is the union of a_loBox and a_centerBox and a_hiBox. 00037 00038 The boxes a_loBox and a_hiBox will be at most 1 cell wide; 00039 here the 2-point stencil consists of a cell from this box and 00040 the neighboring cell from a_centerBox in direction a_dir. 00041 00042 a_entireBox will be a_inBox with one layer of cells removed 00043 from both sides in dimension a_dir. 00044 00045 Output flags: 00046 * a_hasLo: 1 or 0, according to whether a_loBox is defined or not; 00047 * a_hasHi: 1 or 0, according to whether a_hiBox is defined or not. 00048 */ 00049 extern void loHiCenter(Box& a_loBox, 00050 int& a_hasLo, 00051 Box& a_hiBox, 00052 int& a_hasHi, 00053 Box& a_centerBox, 00054 Box& a_entireBox, 00055 const Box& a_inBox, 00056 const ProblemDomain& a_domain, 00057 const int& a_dir); 00058 00059 /// 00060 /** 00061 This function is used when in direction a_dir a 2-point stencil of 00062 cell-centered data is being used to compute something at the 00063 face between cells of the stencil. 00064 00065 Inputs: 00066 * a_dir is the direction of the 2-point stencil; 00067 * a_inBox is the cell-centered box (on whose faces we are to 00068 compute a stencil), expanded by 1 in a_dir direction, and not 00069 intersected with the domain. 00070 * a_domain is the problem domain. 00071 00072 Output boxes are all face-centered subboxes of the faces of a_inBox 00073 in direction a_dir, and are also contained in the faces of a_domain: 00074 * a_loBox is where a 1-point stencil must be used on the low side; 00075 * a_centerBox is where the full 2-point stencil can be used; 00076 * a_hiBox is where a 1-point stencil must be used on the high side; 00077 * a_entireBox is the union of a_loBox and a_centerBox and a_hiBox. 00078 00079 The boxes a_loBox and a_hiBox will be at most 1 face wide; 00080 here the 1-point stencil consists of only 1 of the adjacent cells 00081 in direction a_dir. 00082 00083 Output flags: 00084 * a_hasLo: 1 or 0, according to whether a_loBox is defined or not; 00085 * a_hasHi: 1 or 0, according to whether a_hiBox is defined or not. 00086 */ 00087 extern void loHiCenterFace(Box& a_loBox, 00088 int& a_hasLo, 00089 Box& a_hiBox, 00090 int& a_hasHi, 00091 Box& a_centerBox, 00092 Box& a_entireBox, 00093 const Box& a_inBox, 00094 const ProblemDomain& a_domain, 00095 const int& a_dir); 00096 00097 /// 00098 /** 00099 This function is used when in direction a_dir a 4-point stencil of 00100 cell-centered data is being used to compute something at the 00101 face between cells of the stencil. 00102 00103 Inputs: 00104 * a_dir is the direction of the 4-point stencil; 00105 * a_inBox is the cell-centered box on which we have data; 00106 * a_domain is the problem domain. 00107 00108 Output boxes are all face-centered subboxes of the faces of a_inBox 00109 in direction a_dir, and are also contained in the faces of a_domain: 00110 * a_loBox is where a stencil must be used on the low side 00111 with all four points higher; 00112 * a_nextLoBox is where a stencil must be used on the low side 00113 with one point lower and three points higher; 00114 * a_hiBox is where a stencil must be used on the high side 00115 with all four points lower; 00116 * a_nextHiBox is where a stencil must be used on the high side 00117 with one point higher and three points lower; 00118 * a_centerBox is union of a_innerCenterBox, a_nextLoBox, and a_nextHiBox, 00119 where the regular 2-point stencil can be used; 00120 * a_innerCenterBox is where the regular 4-point stencil can be used; 00121 * a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box. 00122 00123 Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox 00124 will be at most 1 face wide. 00125 00126 a_loBox and a_nextLoBox will both be defined or both be undefined. 00127 a_hiBox and a_nextHiBox will both be defined or both be undefined. 00128 00129 Output flags: 00130 * a_hasLo: 1 or 0, according to whether a_loBox and a_nextLoBox 00131 are defined or not; 00132 * a_hasHi: 1 or 0, according to whether a_hiBox and a_nextHiBox 00133 are defined or not. 00134 */ 00135 extern void loHiCenterFace4(Box& a_loBox, 00136 Box& a_nextLoBox, 00137 int& a_hasLo, 00138 Box& a_hiBox, 00139 Box& a_nextHiBox, 00140 int& a_hasHi, 00141 Box& a_centerBox, 00142 Box& a_innerCenterBox, 00143 Box& a_entireBox, 00144 const Box& a_inBox, 00145 const ProblemDomain& a_domain, 00146 const int& a_dir); 00147 00148 /// 00149 /** 00150 This function is used when in direction a_dir a 5-point stencil of 00151 cell-centered data is being used to compute something at the 00152 center of the central cell of the stencil. 00153 00154 Inputs: 00155 * a_dir is the direction of the 5-point stencil; 00156 * a_inBox is the cell-centered box on which we are to compute a 00157 stencil (2-point or 3-point or 5-point), expanded by 1 in a_dir direction, 00158 and not intersected with the domain; 00159 * a_domain is the problem domain. 00160 00161 Output boxes are all cell-centered subboxes of a_inBox and 00162 are also contained in a_domain: 00163 * a_loBox is where a 2-point stencil must be used on the low side; 00164 * a_nextLoBox is where a 3-point stencil must be used on the low side 00165 with one point lower and three points higher; 00166 * a_hiBox is where a 2-point stencil must be used on the high side; 00167 * a_nextHiBox is where a 3-point stencil must be used on the high side 00168 with one point higher and three points lower; 00169 * a_centerBox is union of a_innerCenterBox, a_nextLoBox, and a_nextHiBox, 00170 where a 3-point stencil may be used; 00171 * a_innerCenterBox is where the regular 5-point stencil can be used; 00172 where a 5-point stencil may be used; 00173 * a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box. 00174 00175 Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox 00176 will be at most 1 cell wide. 00177 00178 a_loBox and a_nextLoBox will both be defined or both be undefined. 00179 a_hiBox and a_nextHiBox will both be defined or both be undefined. 00180 00181 Output flags: 00182 * a_hasLo: 1 or 0, according to whether a_loBox and a_nextLoBox 00183 are defined or not; 00184 * a_hasHi: 1 or 0, according to whether a_hiBox and a_nextHiBox 00185 are defined or not. 00186 */ 00187 extern void loHiCenter5(Box& a_loBox, 00188 Box& a_nextLoBox, 00189 int& a_hasLo, 00190 Box& a_hiBox, 00191 Box& a_nextHiBox, 00192 int& a_hasHi, 00193 Box& a_centerBox, 00194 Box& a_innerCenterBox, 00195 Box& a_entireBox, 00196 const Box& a_inBox, 00197 const ProblemDomain& a_domain, 00198 const int& a_dir); 00199 00200 /// 00201 /** 00202 This function is used when in direction a_dir a 6-point stencil of 00203 cell-centered data is being used to compute something at the 00204 face between cells of the stencil. 00205 00206 Inputs: 00207 * a_dir is the direction of the 6-point stencil; 00208 * a_inBox is the cell-centered box on which we have data; 00209 * a_domain is the problem domain. 00210 00211 Output boxes are all face-centered subboxes of the faces of a_inBox 00212 in direction a_dir, and are also contained in the faces of a_domain: 00213 * a_farLoBox is where a stencil must be used on the low side 00214 with all 6 points higher; 00215 * a_midLoBox is where a stencil must be used on the low side 00216 with 1 point lower and 5 points higher; 00217 * a_nearLoBox is where a stencil must be used on the low side 00218 with 2 points lower and 4 points higher; 00219 * a_farHiBox is where a stencil must be used on the high side 00220 with all 6 points lower; 00221 * a_midHiBox is where a stencil must be used on the high side 00222 with 1 point higher and 5 points lower; 00223 * a_nearHiBox is where a stencil must be used on the high side 00224 with 2 points higher and 4 points lower; 00225 * a_centerBox is union of a_innerCenterBox and a_near(Lo|Hi)Box, 00226 where the regular 2-point stencil can be used; 00227 * a_midCenterBox is union of a_innerCenterBox, a_near(Lo|Hi)Box, and 00228 a_mid(Lo|Hi)Box, where the regular 4-point stencil can be used; 00229 * a_innerCenterBox is where the regular 6-point stencil can be used; 00230 * a_entireBox is union of a_(far|mid|near)(Lo|Hi)Box and a_innerCenterBox. 00231 00232 Each of the boxes a_(far|mid|near)(Lo|Hi)Box will be at most 1 face wide. 00233 00234 a_farLoBox, a_midLoBox, a_nearLoBox will all be defined or all be undefined. 00235 a_farHiBox, a_midHiBox, a_nearHiBox will all be defined or all be undefined. 00236 00237 Output flags: 00238 * a_hasLo: 1 or 0, set to whether a_(far|mid|near)loBox defined or not; 00239 * a_hasHi: 1 or 0, set to whether a_(far|mid|near)HiBox defined or not. 00240 */ 00241 extern void loHiCenterFace6(Box& a_farLoBox, 00242 Box& a_midLoBox, 00243 Box& a_nearLoBox, 00244 int& a_hasLo, 00245 Box& a_farHiBox, 00246 Box& a_midHiBox, 00247 Box& a_nearHiBox, 00248 int& a_hasHi, 00249 Box& a_centerBox, 00250 Box& a_midCenterBox, 00251 Box& a_innerCenterBox, 00252 Box& a_entireBox, 00253 const Box& a_inBox, 00254 const ProblemDomain& a_domain, 00255 const int& a_dir); 00256 00257 #include "NamespaceFooter.H" 00258 #endif