Chombo + EB  3.2
MonomialIF.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 _MONOMIALIF_H_
12 #define _MONOMIALIF_H_
13 
14 #include "MayDay.H"
15 #include "RealVect.H"
16 
17 #include "BaseIF.H"
18 #include "OneDIntegrator.H"
19 
20 #include "NamespaceHeader.H"
21 
22 ///
23 /**
24  class to implement 1-D function that gets integrated
25  to compute EBMoments for monomials
26 */
28 {
29 public:
30  ///
31  /**
32  Q = power of monomial
33  p = moment being calculated
34  */
36  const IvSpaceDim& a_p)
37  {
38  m_Q = a_Q;
39  m_p = a_p;
40  }
41 
42 
44  {; }
45 
46  virtual Real value(const Real& location) const;
47 
48 private:
49  //power of monomial
51  //moment being calculated
53  //strong construction is best when it can be used
55  { ; }
56 
57 };
58 ///
59 /**
60  This implicit function specifies a Monomial.
61 */
62 class MonomialIF: public BaseIF
63 {
64 public:
65  ///
66  /**
67  in 2d
68  y = (x)^p[0]
69  in 3d
70  z = [(x)^p[0]*(y)^p[1]]
71 
72  p == a_power
73  */
74  MonomialIF(const IndexTM<int, SpaceDim-1> & a_power,
75  const bool & a_inside);
76 
77  /// Destructor
78  virtual ~MonomialIF()
79  {
80  }
81 
82  virtual Real value(const IndexTM<int,SpaceDim> & a_partialDerivative,
83  const IndexTM<Real,SpaceDim>& a_point) const;
84 
85  virtual Real value(const RealVect& a_point) const;
86 
87  virtual Real value(const IndexTM<Real,SpaceDim>& a_point) const;
88 
89  virtual BaseIF* newImplicitFunction() const;
90 
91  ///return int x^p dV for the vof
92  virtual IndMomSpaceDim getExactVolumeMoments(const VolIndex & a_vof,
93  const Real & a_dx) const;
94 
95 
96  ///return int_eb x^p dA for the eb
97  virtual IndMomSpaceDim getExactEBMoments(const VolIndex & a_vof,
98  const Real & a_dx) const;
99 
100 
101  ///return int_eb x^p n_i dA for the eb
102  virtual IndMomSpaceDim getExactEBNormalMoments(const VolIndex & a_vof,
103  const Real & a_dx,
104  const int & a_ni) const;
105 
106  ///
107  virtual IndMomSpaceDim getExactEBNormalPartialDerivs(const VolIndex & a_vof,
108  const Real & a_dx,
109  const int & a_ni) const;
110 
111  ///
112  Real
113  getZerothDerivativeOfXNormal(const Real& a_xloc) const;
114  ///
115  Real
116  getFirstDerivativeOfXNormal(const Real& a_xloc) const;
117  ///
118  Real
119  getSecondDerivativeOfXNormal(const Real& a_xloc) const;
120  ///
121  Real
122  getThirdDerivativeOfXNormal(const Real& a_xloc) const;
123  ///
124  Real
125  getFourthDerivativeOfXNormal(const Real& a_xloc) const;
126  ///
127  Real
128  getZerothDerivativeOfYNormal(const Real& a_xloc) const;
129  ///
130  Real
131  getFirstDerivativeOfYNormal(const Real& a_xloc) const;
132  ///
133  Real
134  getSecondDerivativeOfYNormal(const Real& a_xloc) const;
135  ///
136  Real
137  getThirdDerivativeOfYNormal(const Real& a_xloc) const;
138  ///
139  Real
140  getFourthDerivativeOfYNormal(const Real& a_xloc) const;
141 
142 
143  ///return int x^p dA for the face
144  virtual IndMomSDMinOne getExactFaceMoments(const FaceIndex & a_face,
145  const Real & a_dx) const;
146 
147  void getTloThi(bool& a_noEB,
148  Real& a_tlo,
149  Real& a_thi,
150  const VolIndex & a_vof,
151  const Real & a_dx) const;
152 
153  Real getEBNormMomX(const Real & a_tlo,
154  const Real & a_thi,
155  const IvSpaceDim & a_p) const;
156 
157  Real getEBNormMomY(const Real & a_tlo,
158  const Real & a_thi,
159  const IvSpaceDim & a_p) const;
160 
161  Real xToTheQ(const IndexTM<Real,SpaceDim>& a_point) const;
162 
164  getUncutVolumeSection(const RealVect& a_xlo,
165  const RealVect& a_xhi,
166  const RealVect& a_xbar,
167  const Real & a_dx) const;
168 
170  getCutVolumeSection(const RealVect & a_xlo,
171  const RealVect & a_xhi,
172  const RealVect & a_xbar,
173  const Real & a_dx) const;
174 
175  void shiftToXBar(IndMomSpaceDim& a_moment,
176  const RealVect& a_xbar) const;
177 protected:
178 
180  bool m_inside;
181 
182 private:
183  MonomialIF();
184 
185 };
186 
187 #include "NamespaceFooter.H"
188 #endif
bool m_inside
Definition: MonomialIF.H:180
base class for integration
Definition: OneDIntegrator.H:25
virtual ~MonomialIF()
Destructor.
Definition: MonomialIF.H:78
Definition: FaceIndex.H:28
virtual Real value(const Real &location) const
MonomialEBMomentFunc(const IvSDMinOne &a_Q, const IvSpaceDim &a_p)
Definition: MonomialIF.H:35
virtual ~MonomialEBMomentFunc()
Definition: MonomialIF.H:43
const int SpaceDim
Definition: SPACE.H:38
Definition: MonomialIF.H:62
IvSDMinOne m_Q
Definition: MonomialIF.H:50
Definition: BaseIF.H:32
double Real
Definition: REAL.H:33
IvSpaceDim m_p
Definition: MonomialIF.H:52
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Volume of Fluid Index.
Definition: VolIndex.H:31
MonomialEBMomentFunc()
Definition: MonomialIF.H:54
IndexTM< int, SpaceDim-1 > m_power
Definition: MonomialIF.H:179
Definition: MonomialIF.H:27