chombo-discharge
CD_EBHelmholtzRobinEBBCFactory.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_EBHelmholtzRobinEBBCFactory.H
8  @brief Declaration of a factory class for making Robin EB boundary conditions with EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzRobinEBBCFactory_H
13 #define CD_EBHelmholtzRobinEBBCFactory_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_EBHelmholtzEBBCFactory.H>
20 #include <CD_NamespaceHeader.H>
21 
29 {
30 public:
35 
44  EBHelmholtzRobinEBBCFactory(const int a_order, const int a_weight, const Real a_A, const Real a_B, const Real a_C);
45 
54  EBHelmholtzRobinEBBCFactory(const int a_order,
55  const int a_weight,
56  const std::function<Real(const RealVect& a_pos)>& a_A,
57  const std::function<Real(const RealVect& a_pos)>& a_B,
58  const std::function<Real(const RealVect& a_pos)>& a_C);
59 
64 
69  void
70  setOrder(const int a_order);
71 
76  void
77  setWeight(const int a_weight);
78 
85  void
86  setCoefficients(const Real a_A, const Real a_B, const Real a_C);
87 
94  void
95  setCoefficients(const std::function<Real(const RealVect& a_pos)>& a_A,
96  const std::function<Real(const RealVect& a_pos)>& a_B,
97  const std::function<Real(const RealVect& a_pos)>& a_C);
98 
102  virtual void
103  setDomainDropOrder(const int a_domainSize);
104 
109  RefCountedPtr<EBHelmholtzEBBC>
110  create() override;
111 
112 protected:
113  /*
114  @brief Use constant for BC
115  */
116  bool m_useConstant;
117 
122 
126  int m_order;
127 
131  int m_weight;
132 
137 
142 
147 
152 
156  std::function<Real(const RealVect& a_pos)> m_functionA;
157 
161  std::function<Real(const RealVect& a_pos)> m_functionB;
162 
166  std::function<Real(const RealVect& a_pos)> m_functionC;
167 };
168 
169 #include <CD_NamespaceFooter.H>
170 
171 #endif
Factory class for making EBHelmholtzEBBCs.
Definition: CD_EBHelmholtzEBBCFactory.H:26
Base class for making Robin boundary conditions with EBHelmholtzOp.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:29
void setWeight(const int a_weight)
Set equation weights for least squares reconstruction.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:76
virtual void setDomainDropOrder(const int a_domainSize)
Drop BC order if domain size is equal or below this.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:86
Real m_constantA
Constant A-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:141
std::function< Real(const RealVect &a_pos)> m_functionA
Function-based A-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:156
int m_domainDropOrder
Special flag for dropping stencil order when domains become coarser than this.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:136
Real m_constantC
Constant C-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:151
EBHelmholtzRobinEBBCFactory()
Constructor.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:17
std::function< Real(const RealVect &a_pos)> m_functionB
Function-based B-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:161
virtual ~EBHelmholtzRobinEBBCFactory()
Destructor (does nothing).
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:60
void setCoefficients(const Real a_A, const Real a_B, const Real a_C)
Set constant coefficients.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:94
int m_order
(Attempted) stencil order
Definition: CD_EBHelmholtzRobinEBBCFactory.H:126
Real m_constantB
Constant B-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:146
std::function< Real(const RealVect &a_pos)> m_functionC
Function-based C-coefficient.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:166
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:121
RefCountedPtr< EBHelmholtzEBBC > create() override
Factory method.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:122
void setOrder(const int a_order)
Set BC order.
Definition: CD_EBHelmholtzRobinEBBCFactory.cpp:66
int m_weight
Weight for least squares gradient reconstruction.
Definition: CD_EBHelmholtzRobinEBBCFactory.H:131