Chombo + EB  3.2
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  virtual void applyEBFluxPoint(const VolIndex& a_vof,
117  EBCellFAB& a_lphi,
118  const EBCellFAB& a_phi,
119  VoFIterator& a_vofit,
120  const LayoutData<IntVectSet>& a_cfivs,
121  const DataIndex& a_dit,
122  const RealVect& a_probLo,
123  const RealVect& a_dx,
124  const Real& a_factor,
125  const bool& a_useHomogeneous,
126  const Real& a_time) ;
127 
128 
129  //hack to let component of velocity get set
130  static int s_velComp;
131  static int s_leastSquaresRad;
132  static bool s_areaFracWeighted;
134 
135  //protected:
136  virtual void getFirstOrderStencil(VoFStencil& a_stencil,
137  Real& a_weight,
138  const VolIndex& a_vof,
139  const EBISBox& a_ebisBox,
140  const RealVect& a_dx);
141 
142  virtual void getSecondOrderStencil(VoFStencil& a_stencil,
143  Real& a_weight,
144  const VolIndex& a_vof,
145  const EBISBox& a_ebisBox,
146  const RealVect& a_dx,
147  const IntVectSet& a_cfivs);
148 
149 public:
151 
154 
155  int m_order;
156 
159 
162 
164 
165 
166  //stencils for operator evaluation
169 
170  //the stuff below is to keep EBAMRPoissonOp working in the transition
171  virtual void define(const LayoutData<IntVectSet>& a_cfivs);
172  // m_fluxWeight is the weight of the Dirichlet BC value used when
173  // calculating the EB flux as a linear combination of the stencil
174  // cell values and the BC value.
177 
178 };
179 
180 ///
181 /**
182  */
184 {
185 public:
186  ///
187  /**
188  */
190 
191  ///
192  /**
193  */
194  virtual ~DirichletPoissonEBBCFactory();
195 
196  ///
197  /**
198  */
199  virtual void setOrder(int a_order);
200 
201  ///
202  /**
203  */
204  virtual void setValue(Real a_value);
205 
206  ///
207  /**
208  */
209  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
210 
211  ///
212  /**
213  */
214  virtual DirichletPoissonEBBC* create(const ProblemDomain& a_domain,
215  const EBISLayout& a_layout,
216  const RealVect& a_dx,
217  const IntVect* a_ghostCellsPhi=0,
218  const IntVect* a_ghostCellsRhs=0);
219 
220 protected:
223 
224  int m_order;
225 
228 
231 };
232 
233 #include "NamespaceFooter.H"
234 #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:141
virtual void setValue(Real a_value)
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:175
Definition: EBISBox.H:46
IntVect m_ghostCellsPhi
Definition: DirichletPoissonEBBC.H:167
Real m_value
Definition: DirichletPoissonEBBC.H:157
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_data
Definition: DirichletPoissonEBBC.H:229
static int s_leastSquaresRad
Definition: DirichletPoissonEBBC.H:131
Definition: DirichletPoissonEBBC.H:183
bool m_isFunction
Definition: DirichletPoissonEBBC.H:222
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:160
VoF-centered stencil.
Definition: Stencils.H:60
Definition: DirichletPoissonEBBC.H:26
bool m_isFunction
Definition: DirichletPoissonEBBC.H:153
Definition: EBCellFAB.H:29
virtual void setOrder(int a_order)
double Real
Definition: REAL.H:33
Real m_value
Definition: DirichletPoissonEBBC.H:226
IntVect m_ghostCellsRHS
Definition: DirichletPoissonEBBC.H:168
LayoutData< BaseIVFAB< VoFStencil > > m_fluxStencil
Definition: DirichletPoissonEBBC.H:176
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonEBBC.H:158
virtual void applyEBFluxPoint(const VolIndex &a_vof, 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)
static bool s_useQuadrantBasedStencil
Definition: DirichletPoissonEBBC.H:133
int m_order
Definition: DirichletPoissonEBBC.H:155
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:315
EBISLayout m_layout
Definition: DirichletPoissonEBBC.H:161
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:227
int m_order
Definition: DirichletPoissonEBBC.H:224
RealVect m_dx
Definition: DirichletPoissonEBBC.H:163
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
bool m_onlyHomogeneous
Definition: DirichletPoissonEBBC.H:152
static int s_velComp
Definition: DirichletPoissonEBBC.H:130
Volume of Fluid Index.
Definition: VolIndex.H:31
bool m_dataBased
Definition: DirichletPoissonEBBC.H:230
static bool s_areaFracWeighted
Definition: DirichletPoissonEBBC.H:132
Definition: EBISLayout.H:39
LayoutData< BaseIVFAB< Real > > & getFluxWeight()
Definition: DirichletPoissonEBBC.H:65
bool m_isDefined
Definition: DirichletPoissonEBBC.H:150
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:221