chombo-discharge
CD_ElectrostaticEbBc.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_ElectrostaticEbBc_H
13 #define CD_ElectrostaticEbBc_H
14 
15 // Std includes
16 #include <functional>
17 #include <vector>
18 
19 // Chombo includes
20 #include <RealVect.H>
21 
22 // Our includes
23 #include <CD_Electrode.H>
24 #include <CD_NamespaceHeader.H>
25 
33 {
34 public:
38  using BcFunction = std::function<Real(const RealVect a_position, const Real a_time)>;
39 
44 
48  virtual ~ElectrostaticEbBc();
49 
53  void
54  clear();
55 
63  void
64  addEbBc(const Electrode& a_electrode, const BcFunction& a_bcFunction);
65 
71  void
72  setEbBc(const int a_electrode, const BcFunction& a_bcFunction);
73 
79  BcFunction&
80  getBc(const int a_electrode);
81 
87  const BcFunction&
88  getBc(const int a_electrode) const;
89 
94  std::vector<std::pair<Electrode, BcFunction>>&
95  getBcs();
96 
101  const std::vector<std::pair<Electrode, BcFunction>>&
102  getBcs() const;
103 
104 protected:
108  std::vector<std::pair<Electrode, BcFunction>> m_bcFunctions;
109 };
110 
111 #include <CD_NamespaceFooter.H>
112 
113 #endif
Declaration of an electrode class.
Electrode class for encapsulating the concept of an electrical conductor.
Definition: CD_Electrode.H:26
Class which maps boundary condition types to a side and direction.
Definition: CD_ElectrostaticEbBc.H:33
std::function< Real(const RealVect a_position, const Real a_time)> BcFunction
Function which maps f(R^3,t) : R. Used for setting the potential at an electrode.
Definition: CD_ElectrostaticEbBc.H:38
void setEbBc(const int a_electrode, const BcFunction &a_bcFunction)
Set the potential for a_electrode to be given by a_bcFunction.
Definition: CD_ElectrostaticEbBc.cpp:43
void addEbBc(const Electrode &a_electrode, const BcFunction &a_bcFunction)
Add a boundary condition.
Definition: CD_ElectrostaticEbBc.cpp:35
ElectrostaticEbBc()
Initializing constructor (does nothing)
Definition: CD_ElectrostaticEbBc.cpp:16
virtual ~ElectrostaticEbBc()
Destructor (does nothing)
Definition: CD_ElectrostaticEbBc.cpp:21
std::vector< std::pair< Electrode, BcFunction > > m_bcFunctions
Data structure which holds electrode and associated potential functions.
Definition: CD_ElectrostaticEbBc.H:108
BcFunction & getBc(const int a_electrode)
Return boundary condition associated with a particular electrode.
Definition: CD_ElectrostaticEbBc.cpp:55
std::vector< std::pair< Electrode, BcFunction > > & getBcs()
Get all boundary conditions.
Definition: CD_ElectrostaticEbBc.cpp:79
void clear()
Clears the object.
Definition: CD_ElectrostaticEbBc.cpp:27