Chombo + EB  3.0
DirichletPoissonEBBC.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 _DIRICHLETPOISSONEBBC_H_
12 #define _DIRICHLETPOISSONEBBC_H_
13 
14 #include "RefCountedPtr.H"
15 
16 #include "BaseEBBC.H"
17 #include "BaseBCValue.H"
18 #include "LayoutData.H"
19 #include "IntVectSet.H"
20 #include "EBStencil.H"
21 #include "NamespaceHeader.H"
22 
23 ///
24 /**
25  */
27 {
28 public:
29 
30  ///
32 
33  DirichletPoissonEBBC(const ProblemDomain& a_domain,
34  const EBISLayout& a_layout,
35  const RealVect& a_dx,
36  const IntVect* a_ghostCellsPhi=0,
37  const IntVect* a_ghostCellsRhs=0);
38 
39  void construct(const ProblemDomain& a_domain,
40  const EBISLayout& a_layout,
41  const RealVect& a_dx,
42  const IntVect* a_ghostCellsPhi=0,
43  const IntVect* a_ghostCellsRhs=0);
44  ///
45  /**
46  */
47  virtual ~DirichletPoissonEBBC();
48 
49  ///
50  /**
51  */
52  virtual void define(const LayoutData<IntVectSet>& a_cfivs,
53  const Real& a_factor);
54 
55  ///
56  /**
57  */
58  virtual void setOrder(int a_order);
59 
61  {
62  return &m_fluxStencil;
63  }
64 
66  {
67  return m_fluxWeight;
68  }
69  ///
70  /**
71  */
72  virtual void setValue(Real a_value);
73 
74  ///
75  /**
76  */
77  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
78 
79  ///
80  /**
81  */
82  virtual void applyEBFlux(EBCellFAB& a_lphi,
83  const EBCellFAB& a_phi,
84  VoFIterator& a_vofit,
85  const LayoutData<IntVectSet>& a_cfivs,
86  const DataIndex& a_dit,
87  const RealVect& a_probLo,
88  const RealVect& a_dx,
89  const Real& a_factor,
90  const bool& a_useHomogeneous,
91  const Real& a_time);
92  ///
93  /** deprecated interface
94  */
95  virtual void getEBFlux(Real& a_flux,
96  const VolIndex& a_vof,
97  const LevelData<EBCellFAB>& a_phi,
98  const LayoutData<IntVectSet>& a_cfivs,
99  const DataIndex& a_dit,
100  const RealVect& a_probLo,
101  const RealVect& a_dx,
102  const bool& a_useHomogeneous,
103  const Real& a_time,
104  const pair<int,Real>* a_cacheHint=0 );
105 
106 
107  bool getSecondOrderStencil(VoFStencil& a_stencil,
108  Real& a_weight,
109  Vector<VoFStencil>& a_pointStencils,
110  Vector<Real>& a_distanceAlongLine,
111  const VolIndex& a_vof,
112  const EBISBox& a_ebisBox,
113  const RealVect& a_dx,
114  const IntVectSet& a_cfivs);
115 
116  //hack to let component of velocity get set
117  static int s_velComp;
118  static bool s_areaFracWeighted;
119 protected:
120 
121 private:
122  virtual void getFirstOrderStencil(VoFStencil& a_stencil,
123  Real& a_weight,
124  const VolIndex& a_vof,
125  const EBISBox& a_ebisBox,
126  const RealVect& a_dx);
127 
128  virtual void getSecondOrderStencil(VoFStencil& a_stencil,
129  Real& a_weight,
130  const VolIndex& a_vof,
131  const EBISBox& a_ebisBox,
132  const RealVect& a_dx,
133  const IntVectSet& a_cfivs);
134 
135 
136 public:
138 
141 
142  int m_order;
143 
146 
149 
151 
152 
153  //stencils for operator evaluation
156 
157  //the stuff below is to keep EBAMRPoissonOp working in the transition
158  virtual void define(const LayoutData<IntVectSet>& a_cfivs);
159  // m_fluxWeight is the weight of the Dirichlet BC value used when
160  // calculating the EB flux as a linear combination of the stencil
161  // cell values and the BC value.
164 
165 };
166 
167 ///
168 /**
169  */
171 {
172 public:
173  ///
174  /**
175  */
177 
178  ///
179  /**
180  */
182 
183  ///
184  /**
185  */
186  virtual void setOrder(int a_order);
187 
188  ///
189  /**
190  */
191  virtual void setValue(Real a_value);
192 
193  ///
194  /**
195  */
196  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
197 
198  ///
199  /**
200  */
201  virtual DirichletPoissonEBBC* create(const ProblemDomain& a_domain,
202  const EBISLayout& a_layout,
203  const RealVect& a_dx,
204  const IntVect* a_ghostCellsPhi=0,
205  const IntVect* a_ghostCellsRhs=0);
206 
207 private:
210 
211  int m_order;
212 
215 
216 };
217 
218 #include "NamespaceFooter.H"
219 #endif
virtual LayoutData< BaseIVFAB< VoFStencil > > * getFluxStencil(int ivar)
Definition: DirichletPoissonEBBC.H:60
void construct(const ProblemDomain &a_domain, const EBISLayout &a_layout, const RealVect &a_dx, const IntVect *a_ghostCellsPhi=0, const IntVect *a_ghostCellsRhs=0)
virtual ~DirichletPoissonEBBC()
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
virtual void setValue(Real a_value)
virtual void setOrder(int a_order)
one dimensional dynamic array
Definition: Vector.H:52
virtual void getFirstOrderStencil(VoFStencil &a_stencil, Real &a_weight, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx)
LayoutData< BaseIVFAB< Real > > m_fluxWeight
Definition: DirichletPoissonEBBC.H:162
Definition: EBISBox.H:46
IntVect m_ghostCellsPhi
Definition: DirichletPoissonEBBC.H:154
Real m_value
Definition: DirichletPoissonEBBC.H:144
virtual void setFunction(RefCountedPtr< BaseBCValue > a_func)
Definition: DirichletPoissonEBBC.H:170
bool m_isFunction
Definition: DirichletPoissonEBBC.H:209
bool getSecondOrderStencil(VoFStencil &a_stencil, Real &a_weight, Vector< VoFStencil > &a_pointStencils, Vector< Real > &a_distanceAlongLine, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx, const IntVectSet &a_cfivs)
ProblemDomain m_domain
Definition: DirichletPoissonEBBC.H:147
VoF-centered stencil.
Definition: Stencils.H:59
virtual DirichletPoissonEBBC * create(const ProblemDomain &a_domain, const EBISLayout &a_layout, const RealVect &a_dx, const IntVect *a_ghostCellsPhi=0, const IntVect *a_ghostCellsRhs=0)
Definition: DirichletPoissonEBBC.H:26
bool m_isFunction
Definition: DirichletPoissonEBBC.H:140
Definition: EBCellFAB.H:29
virtual void setOrder(int a_order)
double Real
Definition: REAL.H:33
virtual void setValue(Real a_value)
Real m_value
Definition: DirichletPoissonEBBC.H:213
IntVect m_ghostCellsRHS
Definition: DirichletPoissonEBBC.H:155
LayoutData< BaseIVFAB< VoFStencil > > m_fluxStencil
Definition: DirichletPoissonEBBC.H:163
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonEBBC.H:145
int m_order
Definition: DirichletPoissonEBBC.H:142
virtual void getEBFlux(Real &a_flux, const VolIndex &a_vof, const LevelData< EBCellFAB > &a_phi, const LayoutData< IntVectSet > &a_cfivs, const DataIndex &a_dit, const RealVect &a_probLo, const RealVect &a_dx, const bool &a_useHomogeneous, const Real &a_time, const pair< int, Real > *a_cacheHint=0)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Definition: BaseEBBC.H:31
Definition: DataIndex.H:112
Definition: BaseEBBC.H:303
EBISLayout m_layout
Definition: DirichletPoissonEBBC.H:148
Iterator for all vofs within an IntVectSet and an Ebgraph.
Definition: VoFIterator.H:27
virtual void setFunction(RefCountedPtr< BaseBCValue > a_func)
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonEBBC.H:214
int m_order
Definition: DirichletPoissonEBBC.H:211
RealVect m_dx
Definition: DirichletPoissonEBBC.H:150
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
bool m_onlyHomogeneous
Definition: DirichletPoissonEBBC.H:139
static int s_velComp
Definition: DirichletPoissonEBBC.H:117
Volume of Fluid Index.
Definition: VolIndex.H:31
static bool s_areaFracWeighted
Definition: DirichletPoissonEBBC.H:118
Definition: EBISLayout.H:39
LayoutData< BaseIVFAB< Real > > & getFluxWeight()
Definition: DirichletPoissonEBBC.H:65
bool m_isDefined
Definition: DirichletPoissonEBBC.H:137
virtual ~DirichletPoissonEBBCFactory()
virtual void applyEBFlux(EBCellFAB &a_lphi, const EBCellFAB &a_phi, VoFIterator &a_vofit, const LayoutData< IntVectSet > &a_cfivs, const DataIndex &a_dit, const RealVect &a_probLo, const RealVect &a_dx, const Real &a_factor, const bool &a_useHomogeneous, const Real &a_time)
virtual void define(const LayoutData< IntVectSet > &a_cfivs, const Real &a_factor)
bool m_onlyHomogeneous
Definition: DirichletPoissonEBBC.H:208