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 // NodeIntegrals.H 00012 // petermc, 17 Oct 2005 00013 // used to be in Norms.H 00014 00015 #ifndef _NODEINTEGRALS_H_ 00016 #define _NODEINTEGRALS_H_ 00017 00018 #include "LevelData.H" 00019 #include "NodeFArrayBox.H" 00020 #include "Vector.H" 00021 #include "IntVectSet.H" 00022 #include "NamespaceHeader.H" 00023 00024 /// Computes integral of a subbox of a NodeFArrayBox. 00025 /** Computes integral of the data in a subbox of <i>a_nfab</i>. 00026 */ 00027 Real integral(/// the data on which to take the integral 00028 const NodeFArrayBox& a_nfab, 00029 /// mesh spacing at this level 00030 const Real a_dx, 00031 /// CELL-centered subbox over which to take integral 00032 const Box& a_subbox, 00033 /// starting component 00034 const int a_startComp = 0, 00035 /// number of components 00036 const int a_numComp = 1); 00037 00038 /// Computes integral of a NodeFArrayBox. 00039 /** Computes integral of the data in <i>a_nfab</i>. 00040 */ 00041 Real integral(/// the data on which to take the integral 00042 const NodeFArrayBox& a_nfab, 00043 /// mesh spacing at this level 00044 const Real a_dx, 00045 /// starting component 00046 const int a_startComp = 0, 00047 /// number of components 00048 const int a_numComp = 1); 00049 00050 /// Computes integral of a BoxLayoutData<NodeFArrayBox>. 00051 /** Computes integral of <i>a_layout</i>. Ignores ghost cells for LevelData. 00052 00053 This is an internal function that should NOT normally 00054 be called by the user. 00055 */ 00056 Real integral(/// the data on which to take the norm 00057 const BoxLayoutData<NodeFArrayBox>& a_layout, 00058 /// mesh spacing at this level 00059 const Real a_dx, 00060 /// interval of components to use 00061 const Interval& a_interval, 00062 /// verbosity, whether to print norms of each box 00063 bool a_verbose = true); 00064 00065 /// Computes integral of multilevel array, counting only valid nodes at each level. 00066 /** 00067 Computes integral of multilevel array <i>a_phi</i>. 00068 Only the valid nodes at each level are counted. 00069 The valid nodes at a level are those that are not covered 00070 by the interior of any finer level. 00071 */ 00072 Real integral(/// multilevel data on which to take the norm 00073 const Vector<LevelData<NodeFArrayBox>* >& a_phi, 00074 /// CELL-centered physical domain on each level 00075 const Vector<ProblemDomain>& a_domain, 00076 /// refinement ratios between successive levels 00077 const Vector<int>& a_nRefFine, 00078 /// mesh spacing at base level <i>a_lBase</i> 00079 const Real a_dxCrse, 00080 /// components to use in computing norm 00081 const Interval a_comps, 00082 /// index of base level to use in Vectors 00083 const int a_lBase, 00084 /// verbosity, whether to print norms of each box 00085 bool a_verbose = true); 00086 00087 /// Computes integral of multilevel array, counting only valid nodes at each level. 00088 /** 00089 Computes integral of multilevel array <i>a_phi</i>. 00090 Only the valid nodes at each level are counted. 00091 The valid nodes at a level are those that are not covered 00092 by the interior of any finer level. 00093 */ 00094 Real integral(/// multilevel data on which to take the norm 00095 const Vector<LevelData<NodeFArrayBox>* >& a_phi, 00096 /// CELL-centered physical domain on each level 00097 const Vector<Box>& a_domain, 00098 /// refinement ratios between successive levels 00099 const Vector<int>& a_nRefFine, 00100 /// mesh spacing at base level <i>a_lBase</i> 00101 const Real a_dxCrse, 00102 /// components to use in computing norm 00103 const Interval a_comps, 00104 /// index of base level to use in Vectors 00105 const int a_lBase, 00106 /// verbosity, whether to print norms of each box 00107 bool a_verbose = true); 00108 00109 00110 /// Computes integral of single-level array, counting only valid nodes. 00111 /** 00112 Computes integral of single-level array <i>a_phi</i>. 00113 Only the valid nodes at this level are counted. 00114 The valid nodes are the interior nodes of this level that are not 00115 projections of interior nodes of the finer level, if any. 00116 00117 This function computes exterior boundary nodes, and interior boundary 00118 nodes of the coarsened finer level, if any. It is more efficient 00119 to precompute these boundary-node objects and call one of the other 00120 integral functions below. 00121 */ 00122 Real integral(/// the data on which to take the norm 00123 const LevelData<NodeFArrayBox>& a_phi, 00124 /// CELL-centered physical domain on each level 00125 const ProblemDomain& a_domain, 00126 /// pointer to CELL-centered grids on the next finer level, or NULL if there is none. 00127 const DisjointBoxLayout* a_finerGridsPtr, 00128 /// refinement ratio to next finer level 00129 const int a_nRefFine, 00130 /// mesh spacing at this level 00131 const Real a_dx, 00132 /// interval of components to use 00133 const Interval a_comps, 00134 /// verbosity, whether to print norms of each box 00135 bool a_verbose = true); 00136 00137 /// Computes integral of single-level array, counting only valid nodes. 00138 /** 00139 Computes integral of single-level array <i>a_phi</i>. 00140 Only the valid nodes at this level are counted. 00141 The valid nodes are the interior nodes of this level that are not 00142 projections of interior nodes of the finer level, if any. 00143 00144 This function computes exterior boundary nodes, and interior boundary 00145 nodes of the coarsened finer level, if any. It is more efficient 00146 to precompute these boundary-node objects and call one of the other 00147 integral functions below. 00148 */ 00149 Real integral(/// the data on which to take the norm 00150 const LevelData<NodeFArrayBox>& a_phi, 00151 /// CELL-centered physical domain on each level 00152 const Box& a_domain, 00153 /// pointer to CELL-centered grids on the next finer level, or NULL if there is none. 00154 const DisjointBoxLayout* a_finerGridsPtr, 00155 /// refinement ratio to next finer level 00156 const int a_nRefFine, 00157 /// mesh spacing at this level 00158 const Real a_dx, 00159 /// interval of components to use 00160 const Interval a_comps, 00161 /// verbosity, whether to print norms of each box 00162 bool a_verbose = true); 00163 00164 /// Computes integral of single-level array, counting only valid nodes. 00165 /** 00166 Computes integral of single-level array <i>a_phi</i>. 00167 Only the valid nodes at this level are counted. 00168 The valid nodes are the interior nodes of this level that are not 00169 projections of interior nodes of the finer level, if any. 00170 00171 The <i>a_IVSVext</i> argument is obtained from the calls:<br> 00172 <tt> 00173 interiorBoundaryNodes(IVSVint, a_phi.getBoxes(), a_domain);<br> 00174 exteriorBoundaryNodes(a_IVSVext, IVSVint, a_phi.getBoxes(); 00175 </tt> 00176 00177 The <i>a_IVSVintFinerCoarsened</i> argument is obtained from the call:<br> 00178 <tt> 00179 interiorBoundaryNodes(a_IVSVintFinerCoarsened, 00180 a_phi.getBoxes(), a_finerGridsCoarsened, a_domain); 00181 </tt> 00182 */ 00183 Real integral(/// the data on which to take the norm 00184 const LevelData<NodeFArrayBox>& a_phi, 00185 /// CELL-centered physical domain on each level 00186 const ProblemDomain& a_domain, 00187 /// CELL-centered grids on the next finer level 00188 const DisjointBoxLayout& a_finerGridsCoarsened, 00189 /// exterior boundary nodes of this level 00190 const LayoutData< Vector<IntVectSet> >& a_IVSVext, 00191 /// interior boundary nodes of coarsened finer-level grids 00192 const LayoutData< Vector<IntVectSet> >& a_IVSVintFinerCoarsened, 00193 /// refinement ratio to next finer level 00194 const int a_nRefFine, 00195 /// mesh spacing at this level 00196 const Real a_dx, 00197 /// interval of components to use 00198 const Interval a_comps, 00199 /// verbosity, whether to print norms of each box 00200 bool a_verbose = true); 00201 00202 /// Computes integral of single-level array, counting only valid nodes. 00203 /** 00204 Computes integral of single-level array <i>a_phi</i>. 00205 Only the valid nodes at this level are counted. 00206 The valid nodes are the interior nodes of this level that are not 00207 projections of interior nodes of the finer level, if any. 00208 00209 The <i>a_IVSVext</i> argument is obtained from the calls:<br> 00210 <tt> 00211 interiorBoundaryNodes(IVSVint, a_phi.getBoxes(), a_domain);<br> 00212 exteriorBoundaryNodes(a_IVSVext, IVSVint, a_phi.getBoxes(); 00213 </tt> 00214 00215 The <i>a_IVSVintFinerCoarsened</i> argument is obtained from the call:<br> 00216 <tt> 00217 interiorBoundaryNodes(a_IVSVintFinerCoarsened, 00218 a_phi.getBoxes(), a_finerGridsCoarsened, a_domain); 00219 </tt> 00220 */ 00221 Real integral(/// the data on which to take the norm 00222 const LevelData<NodeFArrayBox>& a_phi, 00223 /// CELL-centered physical domain on each level 00224 const Box& a_domain, 00225 /// CELL-centered grids on the next finer level 00226 const DisjointBoxLayout& a_finerGridsCoarsened, 00227 /// exterior boundary nodes of this level 00228 const LayoutData< Vector<IntVectSet> >& a_IVSVext, 00229 /// interior boundary nodes of coarsened finer-level grids 00230 const LayoutData< Vector<IntVectSet> >& a_IVSVintFinerCoarsened, 00231 /// refinement ratio to next finer level 00232 const int a_nRefFine, 00233 /// mesh spacing at this level 00234 const Real a_dx, 00235 /// interval of components to use 00236 const Interval a_comps, 00237 /// verbosity, whether to print norms of each box 00238 bool a_verbose = true); 00239 00240 00241 /// Computes integral of single-level array, counting only valid nodes, with no finer level. 00242 /** 00243 Computes integral of single-level array <i>a_phi</i>, where there is no 00244 finer level. Only the valid nodes at this level are counted. 00245 The valid nodes are the interior nodes of this level. 00246 00247 The <i>a_IVSVext</i> argument is obtained from the calls:<br> 00248 <tt> 00249 interiorBoundaryNodes(IVSVint, a_phi.getBoxes(), a_domain);<br> 00250 exteriorBoundaryNodes(a_IVSVext, IVSVint, a_phi.getBoxes(); 00251 </tt> 00252 */ 00253 Real integral(/// the data on which to take the norm 00254 const LevelData<NodeFArrayBox>& a_phi, 00255 /// CELL-centered physical domain on each level 00256 const ProblemDomain& a_domain, 00257 /// exterior boundary nodes of this level 00258 const LayoutData< Vector<IntVectSet> >& a_IVSVext, 00259 /// mesh spacing at this level 00260 const Real a_dx, 00261 /// interval of components to use 00262 const Interval a_comps, 00263 /// verbosity, whether to print norms of each box 00264 bool a_verbose = true); 00265 00266 00267 /// Computes integral of single-level array, counting only valid nodes, with no finer level. 00268 /** 00269 Computes integral of single-level array <i>a_phi</i>, where there is no 00270 finer level. Only the valid nodes at this level are counted. 00271 The valid nodes are the interior nodes of this level. 00272 00273 The <i>a_IVSVext</i> argument is obtained from the calls:<br> 00274 <tt> 00275 interiorBoundaryNodes(IVSVint, a_phi.getBoxes(), a_domain);<br> 00276 exteriorBoundaryNodes(a_IVSVext, IVSVint, a_phi.getBoxes(); 00277 </tt> 00278 */ 00279 Real integral(/// the data on which to take the norm 00280 const LevelData<NodeFArrayBox>& a_phi, 00281 /// CELL-centered physical domain on each level 00282 const Box& a_domain, 00283 /// exterior boundary nodes of this level 00284 const LayoutData< Vector<IntVectSet> >& a_IVSVext, 00285 /// mesh spacing at this level 00286 const Real a_dx, 00287 /// interval of components to use 00288 const Interval a_comps, 00289 /// verbosity, whether to print norms of each box 00290 bool a_verbose = true); 00291 00292 #include "NamespaceFooter.H" 00293 #endif