Chombo + EB  3.2
NeumannConductivityDomainBC.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 _NEUMANNCONDUCTIVITYDOMAINBC_H_
12 #define _NEUMANNCONDUCTIVITYDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
16 #include "NeumannPoissonDomainBC.H"
17 #include "BaseBCValue.H"
18 #include "NamespaceHeader.H"
19 
21 {
22 public:
24 
26 
27  virtual int whichBC(int a_idir,
28  Side::LoHiSide a_side);
29 
30  bool isDirichletDom(const VolIndex& a_ivof,
31  const VolIndex& a_jvof,
32  const EBCellFAB& a_phi) const
33  {
34  return false;
35  }
36 
37  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
38  const BaseFab<Real>& a_phi,
39  const RealVect& a_probLo,
40  const RealVect& a_dx,
41  const int& a_idir,
42  const Side::LoHiSide& a_side,
43  const DataIndex& a_dit,
44  const Real& a_time,
45  const bool& a_useHomogeneous);
46 
47  virtual void getFaceFlux(Real& a_faceFlux,
48  const VolIndex& a_vof,
49  const int& a_comp,
50  const EBCellFAB& a_phi,
51  const RealVect& a_probLo,
52  const RealVect& a_dx,
53  const int& a_idir,
54  const Side::LoHiSide& a_side,
55  const DataIndex& a_dit,
56  const Real& a_time,
57  const bool& a_useHomogeneous);
58 
59  virtual void getFaceGradPhi(Real& a_faceFlux,
60  const FaceIndex& a_face,
61  const int& a_comp,
62  const EBCellFAB& a_phi,
63  const RealVect& a_probLo,
64  const RealVect& a_dx,
65  const int& a_idir,
66  const Side::LoHiSide& a_side,
67  const DataIndex& a_dit,
68  const Real& a_time,
69  const bool& a_useAreaFrac,
70  const RealVect& a_centroid,
71  const bool& a_useHomogeneous);
72 
73  virtual void getFaceVel(Real& a_faceFlux,
74  const FaceIndex& a_face,
75  const EBFluxFAB& a_vel,
76  const RealVect& a_probLo,
77  const RealVect& a_dx,
78  const int& a_idir,
79  const int& a_icomp,
80  const Real& a_time,
81  const Side::LoHiSide& a_side);
82 
83  virtual void
85  const Box& a_valid,
86  const Box& a_domain,
87  Real a_dx,
88  bool a_homogeneous)
89  {
90  Box grownBox = a_valid;
91  grownBox.grow(1);
92 
93  for (int idir=0; idir<CH_SPACEDIM; ++idir)
94  {
95  for(SideIterator sit; sit.ok(); ++sit)
96  {
97  Box choppedBox = grownBox;
98  choppedBox.grow(idir,-1);
99  Box toRegion = adjCellBox(choppedBox, idir, sit(), 1);
100 
101  if(!a_domain.contains(toRegion))
102  {
103  for (BoxIterator bit(toRegion); bit.ok(); ++bit)
104  {
105  const IntVect& iv = bit();
106  //fake vof just to get the location
107  VolIndex vof(iv, 0);
109  int isign = sign(sit());
110  IntVect ivneigh = iv - isign*BASISV(idir);
111  Real value = bcvaluefunc(loc, idir, sit());
112  if(a_homogeneous) value = 0;
113  a_phi(iv, 0) = a_phi(ivneigh, 0) + a_dx*value;
114  }
115  }
116  }
117  }//end loop over directions
118  }
119 private:
120 
121 
122 };
123 
125 {
126 public:
128 
130 
131  virtual void setValue(Real a_value);
132 
133  virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_flux);
134 
135  virtual NeumannConductivityDomainBC* create(const ProblemDomain& a_domain,
136  const EBISLayout& a_layout,
137  const RealVect& a_dx);
138 
139 private:
142 
145 
146 };
147 
148 #include "NamespaceFooter.H"
149 #endif
bool ok()
Definition: BoxIterator.H:281
RefCountedPtr< BaseBCFuncEval > m_flux
Definition: NeumannConductivityDomainBC.H:144
bool ok() const
#define CH_SPACEDIM
Definition: SPACE.H:51
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
Definition: ConductivityBaseDomainBC.H:52
int sign(const CH_XD::Side::LoHiSide &a_side)
virtual void fillPhiGhost(FArrayBox &a_phi, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: NeumannConductivityDomainBC.H:84
Definition: FaceIndex.H:28
Real m_value
Definition: NeumannConductivityDomainBC.H:143
Definition: ConductivityBaseDomainBC.H:32
bool contains(const IntVect &p) const
Definition: Box.H:1871
IntVect BASISV(int dir)
Definition: IntVect.H:1266
iterates through the IntVects of a Box
Definition: BoxIterator.H:37
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)
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
static const RealVect Zero
Definition: RealVect.H:421
Definition: EBCellFAB.H:29
bool m_onlyHomogeneous
Definition: NeumannConductivityDomainBC.H:140
double Real
Definition: REAL.H:33
bool m_isFunction
Definition: NeumannConductivityDomainBC.H:141
Definition: BaseDomainBC.H:212
LoHiSide
Definition: LoHiSide.H:27
void setValue(Real a_value)
Definition: ConductivityBaseDomainBC.H:44
virtual int whichBC(int a_idir, Side::LoHiSide a_side)
bool isDirichletDom(const VolIndex &a_ivof, const VolIndex &a_jvof, const EBCellFAB &a_phi) const
Definition: NeumannConductivityDomainBC.H:30
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Iterator for low and high side.
Definition: LoHiSide.H:74
Definition: NeumannConductivityDomainBC.H:124
Definition: DataIndex.H:112
Real bcvaluefunc(const RealVect &a_point, const int &a_dir, const Side::LoHiSide &a_side)
Definition: ConductivityBaseDomainBC.H:78
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
virtual void getFaceVel(Real &a_faceFlux, const FaceIndex &a_face, 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)
Volume of Fluid Index.
Definition: VolIndex.H:31
Box & grow(int i)
grow functions
Definition: Box.H:2247
Definition: EBISLayout.H:39
static RealVect getVoFLocation(const VolIndex &a_vof, const RealVect &a_dx, const RealVect &a_probLo)
I have misspelled this one time too many.
Definition: EBArith.H:623
virtual ~NeumannConductivityDomainBC()
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)
Definition: NeumannConductivityDomainBC.H:20