chombo-discharge
CD_EBHelmholtzDirichletEBBC.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_EBHelmholtzDirichletEBBC.H
8  @brief Declaration of a boundary condition class for EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzDirichletEBBC_H
13 #define CD_EBHelmholtzDirichletEBBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_VofUtils.H>
20 #include <CD_EBHelmholtzEBBC.H>
21 #include <CD_NamespaceHeader.H>
22 
27 {
28 public:
33 
37  virtual ~EBHelmholtzDirichletEBBC();
38 
44  virtual void
45  setOrder(const int a_order);
46 
52  virtual void
53  setWeight(const int a_weight);
54 
59  virtual void
60  setValue(const int a_value);
61 
66  virtual void
67  setValue(const std::function<Real(const RealVect& a_pos)>& a_value);
68 
72  virtual void
73  setDomainDropOrder(const int a_domainSize);
74 
85  virtual void
86  applyEBFlux(VoFIterator& a_vofit,
87  EBCellFAB& a_Lphi,
88  const EBCellFAB& a_phi,
89  const BaseIVFAB<Real>& a_Bcoef,
90  const DataIndex& a_dit,
91  const Real& a_beta,
92  const bool& a_homogeneousPhysBC) const override;
93 
94 protected:
99 
104 
108  int m_order;
109 
113  int m_weight;
114 
119 
124 
128  std::function<Real(const RealVect& a_pos)> m_functionValue;
129 
133  LayoutData<BaseIVFAB<Real>> m_boundaryWeights;
134 
138  virtual void
139  define() override;
140 
151  virtual bool
152  getLeastSquaresStencil(std::pair<Real, VoFStencil>& a_stencil,
153  const VolIndex& a_vof,
154  const VofUtils::Neighborhood a_neighborhood,
155  const DataIndex& a_dit,
156  const int a_order) const;
157 
166  virtual bool
167  getJohansenStencil(std::pair<Real, VoFStencil>& a_stencil,
168  const VolIndex& a_vof,
169  const DataIndex& a_dit,
170  const int a_order) const;
171 
180  virtual bool
181  getChomboLsqStencil(std::pair<Real, VoFStencil>& a_stencil, const VolIndex& a_vof, const DataIndex& a_dit) const;
182 };
183 
184 #include <CD_NamespaceFooter.H>
185 
186 #endif
Various functions for getting Vofs near cut-cells.
Base class for passing Dirichlet EB boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDirichletEBBC.H:27
virtual bool getJohansenStencil(std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const DataIndex &a_dit, const int a_order) const
Get johansen stencil with specified order. Not used but exists for backward compatibility testing and...
Definition: CD_EBHelmholtzDirichletEBBC.cpp:282
EBHelmholtzDirichletEBBC()
Default constructor.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:23
std::function< Real(const RealVect &a_pos)> m_functionValue
Value on the EB.
Definition: CD_EBHelmholtzDirichletEBBC.H:128
int m_order
Stencil approximation order,.
Definition: CD_EBHelmholtzDirichletEBBC.H:108
LayoutData< BaseIVFAB< Real > > m_boundaryWeights
Boundary weights.
Definition: CD_EBHelmholtzDirichletEBBC.H:133
virtual void setValue(const int a_value)
Set the value on the EB.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:60
virtual bool getChomboLsqStencil(std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const DataIndex &a_dit) const
Get Chombo's least squares gradient stencil. Not used but kept for backward compatibility testing and...
Definition: CD_EBHelmholtzDirichletEBBC.cpp:353
virtual void setDomainDropOrder(const int a_domainSize)
Drop BC order if domain size is equal or below this.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:82
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 override
Apply the EB flux. This is the version that is called by EBHelmholtzOp.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:197
virtual void setOrder(const int a_order)
Set BC order.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:41
int m_weight
Distance weighting factor for stencils.
Definition: CD_EBHelmholtzDirichletEBBC.H:113
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzDirichletEBBC.H:103
virtual void define() override
User define function.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:90
virtual bool getLeastSquaresStencil(std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const VofUtils::Neighborhood a_neighborhood, const DataIndex &a_dit, const int a_order) const
Get stencil with specified order.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:239
int m_domainDropOrder
Special flag for dropping stencil order when domains become coarser than this.
Definition: CD_EBHelmholtzDirichletEBBC.H:118
bool m_useConstant
Use constant for BC.
Definition: CD_EBHelmholtzDirichletEBBC.H:98
virtual void setWeight(const int a_weight)
Set stencil weights.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:50
Real m_constantValue
Value on EB.
Definition: CD_EBHelmholtzDirichletEBBC.H:123
virtual ~EBHelmholtzDirichletEBBC()
Destructor.
Definition: CD_EBHelmholtzDirichletEBBC.cpp:35
Base class for passing EB boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzEBBC.H:29
Neighborhood
Neighborhood type.
Definition: CD_VofUtils.H:55