Chombo + EB  3.0
computeSum.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 _COMPUTESUM_H_
12 #define _COMPUTESUM_H_
13 
14 #include "REAL.H"
15 #include "Vector.H"
16 #include "LevelData.H"
17 #include "FArrayBox.H"
18 #include "Interval.H"
19 #include "NamespaceHeader.H"
20 
21 /// Returns the volume-weighted sum (integral) of phi over all valid regions
22 /*
23  */
25  const Vector<int>& a_nRefFine,
26  const Real& a_dxCrse,
27  const Interval& a_comps = Interval(0,0),
28  const int& a_lBase = 0);
29 
30 /// Returns the volume-weighted sum (integral) of phi over all valid regions and the volume
31 /*
32  */
33 Real computeSum(Real& a_volume,
34  const Vector<LevelData<FArrayBox>* >& a_phi,
35  const Vector<int>& a_nRefFine,
36  const Real& a_dxCrse,
37  const Interval& a_comps = Interval(0,0),
38  const int& a_lBase = 0);
39 
40 /// Returns the volume-weighted sum (integral) of phi over the valid region
41 /*
42  This is the single-level version. If a_global is true, then do any MPI
43  reductions in this function. If it's false, don't do any MPI stuff
44  (assumption is that it will be done outside this function). In serial,
45  the value of the a_global parameter has no effect.
46  */
48  const DisjointBoxLayout* a_finerGrids,
49  const int& a_nRefFine,
50  const Real& a_dx,
51  const Interval& a_comps = Interval(0,0),
52  const bool a_global= true);
53 
54 /// Returns the volume-weighted sum (integral) of phi over the valid region and the volume
55 /*
56  This is the single-level version. If a_global is true, then do any MPI
57  reductions in this function. If it's false, don't do any MPI stuff
58  (assumption is that it will be done outside this function). In serial,
59  the value of the a_global parameter has no effect.
60  */
61 Real computeSum(Real& a_volume,
62  const LevelData<FArrayBox>& a_phi,
63  const DisjointBoxLayout* a_finerGrids,
64  const int& a_nRefFine,
65  const Real& a_dx,
66  const Interval& a_comps = Interval(0,0),
67  const bool a_global= true);
68 
69 #include "NamespaceFooter.H"
70 #endif
one dimensional dynamic array
Definition: Vector.H:52
Structure for passing component ranges in code.
Definition: Interval.H:23
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
Real computeSum(const Vector< LevelData< FArrayBox > * > &a_phi, const Vector< int > &a_nRefFine, const Real &a_dxCrse, const Interval &a_comps=Interval(0, 0), const int &a_lBase=0)
Returns the volume-weighted sum (integral) of phi over all valid regions.