chombo-discharge
CD_CdrDomainBC.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_CdrDomainBC_H
13 #define CD_CdrDomainBC_H
14 
15 // Std includes
16 #include <map>
17 #include <functional>
18 
19 // Our includes
20 #include <CD_NamespaceHeader.H>
21 
31 {
32 public:
36  enum class BcType
37  {
38  DataBased,
39  Wall,
40  Function,
41  Outflow,
42  Solver,
43  };
44 
51  using FluxFunction = std::function<Real(const RealVect a_position, const Real a_time)>;
52 
56  using DomainSide = std::pair<int, Side::LoHiSide>;
57 
62  inline CdrDomainBC();
63 
68  CdrDomainBC(const CdrDomainBC& a_other) = default;
69 
74  CdrDomainBC(const CdrDomainBC&& a_other) = delete;
75 
81  operator=(const CdrDomainBC& a_other) = default;
82 
88  operator=(const CdrDomainBC&& a_other) = delete;
89 
96  inline DomainSide
97  domainSide(const int a_dir, const Side::LoHiSide a_side) const;
98 
102  inline ~CdrDomainBC();
103 
109  inline const BcType&
110  getBcType(const DomainSide& a_domainSide) const;
111 
117  inline const FluxFunction&
118  getBcFunction(const DomainSide& a_domainSide) const;
119 
125  inline void
126  setBcType(const DomainSide& a_domainSide, const BcType& a_bcType);
127 
133  inline void
134  setBcFunction(const DomainSide& a_domainSide, const FluxFunction& a_function);
135 
136 protected:
140  std::map<DomainSide, BcType> m_bcTypes;
141 
145  std::map<DomainSide, FluxFunction> m_bcFunctions;
146 };
147 
148 #include <CD_NamespaceFooter.H>
149 
150 #include <CD_CdrDomainBCImplem.H>
151 
152 #endif
Implementation of CD_CdrDomainBC.H.
Class for encapsulating possible domain boundary conditions for CdrSolver.
Definition: CD_CdrDomainBC.H:31
~CdrDomainBC()
Destructor. Does nothing.
Definition: CD_CdrDomainBCImplem.H:39
const FluxFunction & getBcFunction(const DomainSide &a_domainSide) const
Get the BC type on a particular domain side.
Definition: CD_CdrDomainBCImplem.H:55
CdrDomainBC & operator=(const CdrDomainBC &&a_other)=delete
Disallowed move assignment.
void setBcFunction(const DomainSide &a_domainSide, const FluxFunction &a_function)
Set the BC type on a domain side.
Definition: CD_CdrDomainBCImplem.H:67
CdrDomainBC()
Initializing constructor.
Definition: CD_CdrDomainBCImplem.H:19
CdrDomainBC(const CdrDomainBC &&a_other)=delete
Disallowed copy constructor.
std::function< Real(const RealVect a_position, const Real a_time)> FluxFunction
Function which maps f(R^3,t) : R. Used for setting the associated value and boundary condition type.
Definition: CD_CdrDomainBC.H:51
const BcType & getBcType(const DomainSide &a_domainSide) const
Get the BC type on a particular domain side.
Definition: CD_CdrDomainBCImplem.H:49
std::map< DomainSide, FluxFunction > m_bcFunctions
BC functions on various domain edges.
Definition: CD_CdrDomainBC.H:145
std::map< DomainSide, BcType > m_bcTypes
BC types on various domain edges.
Definition: CD_CdrDomainBC.H:140
std::pair< int, Side::LoHiSide > DomainSide
Alias for mapping a direction and side. The first element in pair is the coordinate direction and the...
Definition: CD_CdrDomainBC.H:56
void setBcType(const DomainSide &a_domainSide, const BcType &a_bcType)
Set the BC type on a domain side.
Definition: CD_CdrDomainBCImplem.H:61
CdrDomainBC(const CdrDomainBC &a_other)=default
Copy constructor.
BcType
Boundary condition types for the CDR solvers.
Definition: CD_CdrDomainBC.H:37
DomainSide domainSide(const int a_dir, const Side::LoHiSide a_side) const
Create a domain side from dir/side.
Definition: CD_CdrDomainBCImplem.H:43
CdrDomainBC & operator=(const CdrDomainBC &a_other)=default
Copy assignment.