chombo-discharge
CD_EBHelmholtzDirichletDomainBC.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_EBHelmholtzDirichletDomainBC.H
8  @brief Declaration of a Dirichlet boundary condition class for EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzDirichletDomainBC_H
13 #define CD_EBHelmholtzDirichletDomainBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_EBHelmholtzDomainBC.H>
20 #include <CD_NamespaceHeader.H>
21 
26 {
27 public:
32 
37  EBHelmholtzDirichletDomainBC(const Real a_value);
38 
43  EBHelmholtzDirichletDomainBC(const std::function<Real(const RealVect& a_pos)>& a_value);
44 
49 
54  void
55  setValue(const Real a_value);
56 
61  void
62  setValue(const std::function<Real(const RealVect& a_pos)>& a_value);
63 
75  virtual void
76  getFaceFlux(BaseFab<Real>& a_faceFlux,
77  const BaseFab<Real>& a_phi,
78  const BaseFab<Real>& a_Bcoef,
79  const int& a_dir,
80  const Side::LoHiSide& a_side,
81  const DataIndex& a_dit,
82  const bool a_useHomogeneous) const override;
83 
94  virtual Real
95  getFaceFlux(const VolIndex& a_vof,
96  const EBCellFAB& a_phi,
97  const EBFaceFAB& a_Bcoef,
98  const int& a_dir,
99  const Side::LoHiSide& a_side,
100  const DataIndex& a_dit,
101  const bool a_useHomogeneous) const override;
102 
103 protected:
108 
113 
118 
122  std::function<Real(const RealVect& a_pos)> m_functionValue;
123 };
124 
125 #include <CD_NamespaceFooter.H>
126 
127 #endif
Boundary condition class for passing Dirichlet domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDirichletDomainBC.H:26
virtual ~EBHelmholtzDirichletDomainBC()
Destructor.
Definition: CD_EBHelmholtzDirichletDomainBC.cpp:43
virtual void getFaceFlux(BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const BaseFab< Real > &a_Bcoef, const int &a_dir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const bool a_useHomogeneous) const override
Get face flux. This is for regular cells, and it uses first order finite differences for filling the ...
Definition: CD_EBHelmholtzDirichletDomainBC.cpp:71
Real m_constantValue
Constant value on domain sides.
Definition: CD_EBHelmholtzDirichletDomainBC.H:117
std::function< Real(const RealVect &a_pos)> m_functionValue
Spatially dependent value on domain sides.
Definition: CD_EBHelmholtzDirichletDomainBC.H:122
EBHelmholtzDirichletDomainBC()
Constructor. Must subsequently call setValue.
Definition: CD_EBHelmholtzDirichletDomainBC.cpp:21
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzDirichletDomainBC.H:112
void setValue(const Real a_value)
Set the constant value on the domain side.
Definition: CD_EBHelmholtzDirichletDomainBC.cpp:49
bool m_useConstant
Use constant for BC.
Definition: CD_EBHelmholtzDirichletDomainBC.H:107
Base class for passing domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDomainBC.H:29