Chombo + EB + MF  3.2
BaseDomainBC.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 _BASEDOMAINBC_H_
12 #define _BASEDOMAINBC_H_
13 
14 #include "LoHiSide.H"
15 #include "RealVect.H"
16 #include "FArrayBox.H"
17 
18 #include "VolIndex.H"
19 #include "EBCellFAB.H"
20 #include "EBFaceFAB.H"
21 #include "EBFluxFAB.H"
22 #include "EBISLayout.H"
23 #include "EBLevelGrid.H"
24 #include "TensorCFInterp.H"
25 #include "BaseBCFuncEval.H"
26 #include "NamespaceHeader.H"
27 
28 ///
29 /**
30  */
32 {
33 public:
34  ///
35  /**
36  */
38  {
39  }
40 
41  ///
42  /**
43  */
44  virtual ~BaseDomainBC()
45  {
46  }
47 
48  ///
49  /**
50  */
51  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
52  const BaseFab<Real>& a_phi,
53  const RealVect& a_probLo,
54  const RealVect& a_dx,
55  const int& a_idir,
56  const Side::LoHiSide& a_side,
57  const DataIndex& a_dit,
58  const Real& a_time,
59  const bool& a_useHomogeneous) = 0;
60 
61  // virtual LayoutData<BaseIVFAB<VoFStencil> >* getFluxStencil(int ivar)= 0;
62 
63  virtual void getFluxStencil( VoFStencil& a_stencil,
64  const VolIndex& a_vof,
65  const int& a_comp,
66  const RealVect& a_dx,
67  const int& a_idir,
68  const Side::LoHiSide& a_side,
69  const EBISBox& a_ebisBox)
70  {
71  a_stencil.clear();
72  }
73 
74  virtual void getFluxStencil( VoFStencil& a_stencil,
75  const FaceIndex& a_face,
76  const int& a_comp,
77  const RealVect& a_dx,
78  const int& a_idir,
79  const Side::LoHiSide& a_side,
80  const EBISBox& a_ebisBox)
81  {
82  a_stencil.clear();
83  }
84 
85  ///
86  /**
87  This is used by the elliptic solvers to get
88  the flux of stuff through domain faces.
89  */
90  virtual void getFaceFlux(Real& a_faceFlux,
91  const VolIndex& a_vof,
92  const int& a_comp,
93  const EBCellFAB& a_phi,
94  const RealVect& a_probLo,
95  const RealVect& a_dx,
96  const int& a_idir,
97  const Side::LoHiSide& a_side,
98  const DataIndex& a_dit,
99  const Real& a_time,
100  const bool& a_useHomogeneous) = 0;
101 
102 
103  ///
104  /**
105  A query of whether a_jvof is Dirichlet Domain boundary to a_ivof. a_jvof is the ghost vof; a_ivof is the valid computational vof.
106  For now this is mainly used in form_matrix, which needs to know the type of BC at the boundary.
107  Default implementation is MayDay::Error();
108  */
109  virtual bool isDirichletDom(const VolIndex& a_ivof,
110  const VolIndex& a_jvof,
111  const EBCellFAB& a_phi) const
112  {
113  MayDay::Error("BaseDomainBC:: isDirichletDom:: default implementation is invalid");
114  return true;
115  }
116 
117 
118  ///
119  /**
120  This is used by the elliptic solvers to get
121  the flux of stuff through domain faces.
122  */
123  virtual void getInhomFaceFlux(Real& a_faceFlux,
124  const VolIndex& a_vof,
125  const int& a_comp,
126  const EBCellFAB& a_phi,
127  const RealVect& a_probLo,
128  const RealVect& a_dx,
129  const int& a_idir,
130  const Side::LoHiSide& a_side,
131  const DataIndex& a_dit,
132  const Real& a_time)
133  {
134  MayDay::Error();
135  }
136 
137  ///
138  /**
139  This is used by the projections to get
140  a) grad(phi) at domain faces.
141  */
142  virtual void getFaceGradPhi(Real& a_faceFlux,
143  const FaceIndex& a_face,
144  const int& a_comp,
145  const EBCellFAB& a_phi,
146  const RealVect& a_probLo,
147  const RealVect& a_dx,
148  const int& a_idir,
149  const Side::LoHiSide& a_side,
150  const DataIndex& a_dit,
151  const Real& a_time,
152  const bool& a_useAreaFrac,
153  const RealVect& a_centroid,
154  const bool& a_useHomogeneous) = 0;
155 
156 
157  virtual void enforceFaceVel(LevelData<EBFluxFAB>& a_velocity,
158  const DisjointBoxLayout& a_grids,
159  const EBISLayout& a_ebisl,
160  const ProblemDomain& a_domain,
161  const RealVect& a_dx,
162  const Real& a_time,
163  const RealVect& a_origin);
164 
165  virtual void enforceFaceVel(LevelData<EBFluxFAB>& a_velocity,
166  const DisjointBoxLayout& a_grids,
167  const EBISLayout& a_ebisl,
168  const ProblemDomain& a_domain,
169  const RealVect& a_dx,
170  const Real& a_time,
171  const RealVect& a_origin,
172  const int& a_comp);
173 
174  virtual void setData(LevelData<EBCellFAB>* a_data)
175  {
176  m_data = a_data;
177  m_dataBased = true;
178  }
179 
180  bool dataBased() const
181  {
182  return m_dataBased;
183  }
184 
185  ///
186  /**
187  This is used by the projections to get
188  velocity at domain faces.
189  */
190  virtual void getFaceVel(Real& a_faceFlux,
191  const FaceIndex& a_vof,
192  const EBFluxFAB& a_vel,
193  const RealVect& a_probLo,
194  const RealVect& a_dx,
195  const int& a_idir,
196  const int& a_icomp,
197  const Real& a_time,
198  const Side::LoHiSide& a_side)
199  {
200  MayDay::Error("getFaceVel called but not implemented");
201  }
202 
203 protected:
204 
207 
208 };
209 ///
210 /**
211  */
213 {
214 public:
215  ///
216  /**
217  */
219  {
220  }
221 
222  ///
223  /**
224  */
226  {
227  }
228 
229  ///
230  /**
231  */
232  virtual BaseDomainBC* create(const ProblemDomain& a_domain,
233  const EBISLayout& a_layout,
234  const RealVect& a_dx) = 0;
235 };
236 
237 #include "NamespaceFooter.H"
238 #endif
virtual void getFaceFlux(BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useHomogeneous)=0
virtual ~BaseDomainBCFactory()
Definition: BaseDomainBC.H:225
virtual void getFaceVel(Real &a_faceFlux, const FaceIndex &a_vof, const EBFluxFAB &a_vel, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const int &a_icomp, const Real &a_time, const Side::LoHiSide &a_side)
Definition: BaseDomainBC.H:190
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Definition: BaseDomainBC.H:31
void clear()
Definition: FaceIndex.H:28
Definition: EBISBox.H:46
virtual ~BaseDomainBC()
Definition: BaseDomainBC.H:44
virtual bool isDirichletDom(const VolIndex &a_ivof, const VolIndex &a_jvof, const EBCellFAB &a_phi) const
Definition: BaseDomainBC.H:109
virtual void getInhomFaceFlux(Real &a_faceFlux, const VolIndex &a_vof, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time)
Definition: BaseDomainBC.H:123
virtual void setData(LevelData< EBCellFAB > *a_data)
Definition: BaseDomainBC.H:174
VoF-centered stencil.
Definition: Stencils.H:60
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
virtual void getFluxStencil(VoFStencil &a_stencil, const VolIndex &a_vof, const int &a_comp, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const EBISBox &a_ebisBox)
Definition: BaseDomainBC.H:63
Definition: EBCellFAB.H:29
bool dataBased() const
Definition: BaseDomainBC.H:180
double Real
Definition: REAL.H:33
virtual void enforceFaceVel(LevelData< EBFluxFAB > &a_velocity, const DisjointBoxLayout &a_grids, const EBISLayout &a_ebisl, const ProblemDomain &a_domain, const RealVect &a_dx, const Real &a_time, const RealVect &a_origin)
Definition: BaseDomainBC.H:212
BaseDomainBC()
Definition: BaseDomainBC.H:37
virtual void getFluxStencil(VoFStencil &a_stencil, const FaceIndex &a_face, const int &a_comp, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const EBISBox &a_ebisBox)
Definition: BaseDomainBC.H:74
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LoHiSide
Definition: LoHiSide.H:27
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
BaseDomainBCFactory()
Definition: BaseDomainBC.H:218
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Definition: DataIndex.H:114
virtual void getFaceGradPhi(Real &a_faceFlux, const FaceIndex &a_face, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useAreaFrac, const RealVect &a_centroid, const bool &a_useHomogeneous)=0
Volume of Fluid Index.
Definition: VolIndex.H:31
LevelData< EBCellFAB > * m_data
Definition: BaseDomainBC.H:205
Definition: EBISLayout.H:39
bool m_dataBased
Definition: BaseDomainBC.H:206