chombo-discharge
CD_EBHelmholtzEBBC.H
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
6 /*
7  @file CD_EBHelmholtzEBBC.H
8  @brief Declaration of a base boundary condition class for EB boundary conditions in EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzEBBC_H
13 #define CD_EBHelmholtzEBBC_H
14 
15 // Chombo includes
16 #include <EBLevelGrid.H>
17 #include <RefCountedPtr.H>
18 #include <LevelData.H>
19 #include <BaseIVFAB.H>
20 
21 // Our includes
22 #include <CD_Location.H>
23 #include <CD_NamespaceHeader.H>
24 
29 {
30 public:
35 
39  virtual ~EBHelmholtzEBBC();
40 
44  EBHelmholtzEBBC(const EBHelmholtzEBBC& a_other) = delete;
45 
50  operator=(const EBHelmholtzEBBC& a_other) = delete;
51 
60  void
61  define(const Location::Cell a_dataLocation,
62  const EBLevelGrid& a_eblg,
63  const RealVect& a_probLo,
64  const Real& a_dx,
65  const int a_ghostCF);
66 
77  virtual void
78  applyEBFlux(VoFIterator& a_vofit,
79  EBCellFAB& a_Lphi,
80  const EBCellFAB& a_phi,
81  const BaseIVFAB<Real>& a_Bcoef,
82  const DataIndex& a_dit,
83  const Real& a_beta,
84  const bool& a_homogeneousPhysBC) const = 0;
85 
93  const LayoutData<BaseIVFAB<VoFStencil>>&
94  getGradPhiStencils() const;
95 
96 protected:
100  constexpr static int m_comp = 0;
101 
105  constexpr static int m_nComp = 1;
106 
111 
116 
120  Real m_dx;
121 
125  RealVect m_probLo;
126 
130  EBLevelGrid m_eblg;
131 
135  LayoutData<BaseIVFAB<VoFStencil>> m_gradPhiStencils;
136 
140  virtual void
141  define() = 0;
142 
149  inline bool
150  isStencilValidCF(const VoFStencil& a_stencil, const DataIndex& a_dit) const;
151 
155  inline RealVect
156  getBoundaryPosition(const VolIndex& a_vof, const DataIndex& a_dit) const;
157 
161  inline Real
162  applyStencil(const VoFStencil& a_stencil, const EBCellFAB& a_phi) const;
163 };
164 
165 #include <CD_NamespaceFooter.H>
166 
167 #include <CD_EBHelmholtzEBBCImplem.H>
168 
169 #endif
Declaration of cell positions.
Base class for passing EB boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzEBBC.H:29
Real applyStencil(const VoFStencil &a_stencil, const EBCellFAB &a_phi) const
Apply stencil to data holder and return result.
Definition: CD_EBHelmholtzEBBCImplem.H:37
const LayoutData< BaseIVFAB< VoFStencil > > & getGradPhiStencils() const
Get the stencil for computing the finite-volume approximation to kappa*Div(F).
Definition: CD_EBHelmholtzEBBC.cpp:56
EBLevelGrid m_eblg
Level grid.
Definition: CD_EBHelmholtzEBBC.H:130
EBHelmholtzEBBC & operator=(const EBHelmholtzEBBC &a_other)=delete
Disallowed - don't see why you would need it.
Location::Cell m_dataLocation
Data centering.
Definition: CD_EBHelmholtzEBBC.H:110
int m_ghostCF
Number of ghost cells that were filled across CF interface.
Definition: CD_EBHelmholtzEBBC.H:115
RealVect getBoundaryPosition(const VolIndex &a_vof, const DataIndex &a_dit) const
Returns physical position at the boundary.
Definition: CD_EBHelmholtzEBBCImplem.H:23
constexpr static int m_nComp
Number of components. Always have m_nComp = 1.
Definition: CD_EBHelmholtzEBBC.H:105
EBHelmholtzEBBC(const EBHelmholtzEBBC &a_other)=delete
Disallowed – don't see why you would need it.
LayoutData< BaseIVFAB< VoFStencil > > m_gradPhiStencils
Stencils for computing the flux on a single level. This is a single-level object.
Definition: CD_EBHelmholtzEBBC.H:135
RealVect m_probLo
Lower-left corner of computational domain.
Definition: CD_EBHelmholtzEBBC.H:125
virtual void define()=0
User define function.
bool isStencilValidCF(const VoFStencil &a_stencil, const DataIndex &a_dit) const
Check if stencil is valid.
Definition: CD_EBHelmholtzEBBCImplem.H:50
virtual void applyEBFlux(VoFIterator &a_vofit, EBCellFAB &a_Lphi, const EBCellFAB &a_phi, const BaseIVFAB< Real > &a_Bcoef, const DataIndex &a_dit, const Real &a_beta, const bool &a_homogeneousPhysBC) const =0
Apply the EB flux. This is the version that is called by EBHelmholtzOp.
constexpr static int m_comp
Component that everything is defined for. Always have m_comp = 0.
Definition: CD_EBHelmholtzEBBC.H:100
EBHelmholtzEBBC()
Default constructor.
Definition: CD_EBHelmholtzEBBC.cpp:23
Real m_dx
Grid resolution.
Definition: CD_EBHelmholtzEBBC.H:120
virtual ~EBHelmholtzEBBC()
Destructor.
Definition: CD_EBHelmholtzEBBC.cpp:28
Cell
Enum for distinguishing between cell locations.
Definition: CD_Location.H:30