chombo-discharge
CD_ElectrostaticDomainBc.H
Go to the documentation of this file.
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 
12 #ifndef CD_ElectrostaticDomainBc_H
13 #define CD_ElectrostaticDomainBc_H
14 
15 // Std include
16 #include <functional>
17 #include <map>
18 
19 // Chombo includes
20 #include <RealVect.H>
21 #include <LoHiSide.H>
22 
23 // Our includes
24 #include <CD_NamespaceHeader.H>
25 
33 {
34 public:
38  enum class BcType
39  {
40  Dirichlet,
41  Neumann
42  };
43 
49  using BcFunction = std::function<Real(const RealVect a_position, const Real a_time)>;
50 
54  using DomainSide = std::pair<int, Side::LoHiSide>;
55 
59  using Bc = std::pair<BcType, BcFunction>;
60 
65 
70  ElectrostaticDomainBc(const ElectrostaticDomainBc& a_other) = default;
71 
76  ElectrostaticDomainBc(const ElectrostaticDomainBc&& a_other) = delete;
77 
83  operator=(const ElectrostaticDomainBc& a_other) = default;
84 
90  operator=(const ElectrostaticDomainBc&& a_other) = delete;
91 
95  virtual ~ElectrostaticDomainBc();
96 
103  void
104  setBc(const DomainSide a_wall, const Bc a_bc);
105 
111  Bc
112  getBc(const DomainSide a_domainSide) const;
113 
114 protected:
119  std::map<DomainSide, Bc> m_bcFunctions;
120 };
121 
122 #include <CD_NamespaceFooter.H>
123 
124 #endif
Class which maps boundary condition types to a side and direction.
Definition: CD_ElectrostaticDomainBc.H:33
virtual ~ElectrostaticDomainBc()
Destructor. This.
Definition: CD_ElectrostaticDomainBc.cpp:40
ElectrostaticDomainBc(const ElectrostaticDomainBc &a_other)=default
Copy constructor.
BcType
Supported boundary condition types.
Definition: CD_ElectrostaticDomainBc.H:39
std::map< DomainSide, Bc > m_bcFunctions
This holds the map to the boundary condition type and side. The first entry in the map is the directi...
Definition: CD_ElectrostaticDomainBc.H:119
ElectrostaticDomainBc & operator=(const ElectrostaticDomainBc &a_other)=default
Copy assignment.
Bc getBc(const DomainSide a_domainSide) const
Returns the boundary condition for a domain side.
Definition: CD_ElectrostaticDomainBc.cpp:56
std::pair< BcType, BcFunction > Bc
Alias for mapping a bctype and function.
Definition: CD_ElectrostaticDomainBc.H:59
ElectrostaticDomainBc & operator=(const ElectrostaticDomainBc &&a_other)=delete
Disallowed move assignment.
std::pair< int, Side::LoHiSide > DomainSide
Alias for mapping a direction and side.
Definition: CD_ElectrostaticDomainBc.H:54
ElectrostaticDomainBc()
Initializing constructor. This populates the BC functions with homogeneous Neumann boundary condition...
Definition: CD_ElectrostaticDomainBc.cpp:19
std::function< Real(const RealVect a_position, const Real a_time)> BcFunction
Function which maps f(R^3,t) : R. Used for setting the associated value and boundary condition type.
Definition: CD_ElectrostaticDomainBc.H:49
ElectrostaticDomainBc(const ElectrostaticDomainBc &&a_other)=delete
Disallowed move constructor.
void setBc(const DomainSide a_wall, const Bc a_bc)
Set the boundary condition on a domain side. You must set both the type, and the associated function.
Definition: CD_ElectrostaticDomainBc.cpp:48