Chombo + EB + MF  3.2
EBNormalizeByVolumeFraction.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 _EBNORMALIZEBYVOLUMEFRACTION_H_
12 #define _EBNORMALIZEBYVOLUMEFRACTION_H_
13 
14 #include "EBCellFAB.H"
15 #include "LevelData.H"
16 #include "EBLevelGrid.H"
17 #include "AggStencil.H"
18 #include "NamespaceHeader.H"
19 
20 ///
21 /**
22  * This class represents an operation that takes a volume-fraction-weighted
23  * quantity kappa*Q (where kappa is the volume fraction) and computes Q
24  * from it by normalizing it w.r.t. the volume fractions of cells within a
25  * monotone path radius. The radius may either be specified explicitly or
26  * computed from a given EBLevelGrid.
27  */
29 {
30 public:
31 
32  ///
33  /** Construct an EBNormalizeByVolumeFraction object associated with the
34  * associated with the given EBLevelGrid.
35  * \param EBLevelGrid The level grid for which data can be normalized
36  * by the resulting object.
37  wacky interface is for backward compatibility
38  if data is null, define is not called.
39  */
41  const LevelData<EBCellFAB> * a_data = NULL,
42  const int a_radius = 1)
43  {
44  CH_assert(a_radius > 0);
45  m_eblg = a_eblg;
46  m_radius = a_radius;
47  m_isDefined = false;
48  if(a_data != NULL)
49  {
50  define(*a_data);
51  }
52  }
53 
54 
55  ///define all the ste3ncils
56  void define(const LevelData<EBCellFAB>& a_data);
57 
58 
59  /** Destructor. */
61  {
62  }
63 
64  /** Compute the normalized quantity corresponding to the given
65  * volume-fraction-weighted quantity by volume-averaging that quantity
66  * over every monotone path radius for each cell in the level.
67  * \param a_Q A volume-fraction-weighted quantity to be normalized.
68  * \param a_compInterval An interval representing the range of components
69  * to be normalized by this operation.
70  */
72  const Interval& a_compInterval);
73 
74  /** Compute the normalized quantity corresponding to the given
75  * volume-fraction-weighted quantity by volume-averaging that quantity
76  * over every monotone path radius for each cell in the level. This
77  * version of the correction normalizes all components of \a a_Q.
78  * \param a_Q A volume-fraction-weighted quantity to be normalized.
79  */
81 
83  const Interval& a_compInterval)
84  {
85  (*this)(a_Q, a_compInterval);
86  }
87 
89  {
90  (*this)(a_Q);
91  }
92 protected:
93 
94  void getLocalStencil(VoFStencil & a_stencil,
95  const VolIndex & a_vof,
96  const DataIndex & a_dit);
97 
101 
102 private:
104  int m_radius;
107 };
108 
109 #include "NamespaceFooter.H"
110 #endif
int m_radius
Definition: EBNormalizeByVolumeFraction.H:104
#define CH_assert(cond)
Definition: CHArray.H:37
EBLevelGrid m_eblg
Definition: EBNormalizeByVolumeFraction.H:106
EBNormalizeByVolumeFraction(const EBLevelGrid &a_eblg, const LevelData< EBCellFAB > *a_data=NULL, const int a_radius=1)
Definition: EBNormalizeByVolumeFraction.H:40
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
void operator()(LevelData< EBCellFAB > &a_Q, const Interval &a_compInterval)
Definition: EBLevelGrid.H:30
EBNormalizeByVolumeFraction & operator=(const EBNormalizeByVolumeFraction &)
VoF-centered stencil.
Definition: Stencils.H:60
void getLocalStencil(VoFStencil &a_stencil, const VolIndex &a_vof, const DataIndex &a_dit)
LayoutData< RefCountedPtr< AggStencil< EBCellFAB, EBCellFAB > > > m_stencil
Definition: EBNormalizeByVolumeFraction.H:105
Structure for passing component ranges in code.
Definition: Interval.H:23
bool m_isDefined
Definition: EBNormalizeByVolumeFraction.H:103
Definition: EBNormalizeByVolumeFraction.H:28
~EBNormalizeByVolumeFraction()
Definition: EBNormalizeByVolumeFraction.H:60
Definition: DataIndex.H:114
void normalize(LevelData< EBCellFAB > &a_Q, const Interval &a_compInterval)
Definition: EBNormalizeByVolumeFraction.H:82
Volume of Fluid Index.
Definition: VolIndex.H:31
void normalize(LevelData< EBCellFAB > &a_Q)
Definition: EBNormalizeByVolumeFraction.H:88
void define(const LevelData< EBCellFAB > &a_data)
define all the ste3ncils