chombo-discharge
CD_ItoKMCSurfaceReactionsImplem.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2023 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_ItoKMCSurfaceReactionsImplem_H
13 #define CD_ItoKMCSurfaceReactionsImplem_H
14 
15 // Our includes
17 #include <CD_NamespaceHeader.H>
18 
19 using namespace Physics::ItoKMC;
20 
22 {
23  this->reset();
24 }
25 
27 {
28  this->reset();
29 }
30 
31 inline void
32 ItoKMCSurfaceReactions::add(const ItoKMCSurfaceReaction& a_surfaceReaction) noexcept
33 {
34  if (m_isDefined) {
35 
36  if (m_reactant != a_surfaceReaction.getReactant()) {
37  MayDay::Warning("ItoKMCSurfaceReaction::addReaction - reactant indicies do not match!");
38  }
39  }
40  else {
41  this->reset();
42 
43  m_reactant = a_surfaceReaction.getReactant();
44  }
45 
46  m_products.emplace_back(a_surfaceReaction.getProducts());
47  m_efficiencies.emplace_back(a_surfaceReaction.getEfficiency());
48 
49  m_distribution = std::discrete_distribution<size_t>(std::begin(m_efficiencies), std::end(m_efficiencies));
50 
51  m_isDefined = true;
52 }
53 
54 inline void
56 {
57  m_reactant = 0;
58  m_products.clear();
59  m_efficiencies.clear();
60 
61  m_isDefined = false;
62 }
63 
64 inline const size_t&
66 {
67  return m_reactant;
68 }
69 
70 inline const std::vector<ItoKMCSurfaceReactions::Products>&
72 {
73  return m_products;
74 }
75 
76 inline const std::vector<Real>&
78 {
79  return m_efficiencies;
80 }
81 
82 inline std::discrete_distribution<size_t>&
84 {
85  return m_distribution;
86 }
87 
88 #include <CD_NamespaceFooter.H>
89 
90 #endif
Declaration of a class that encapsulates a set secondary emission at EBs and domain edges/faces.
Reaction class for describing secondary emissions due to a single outgoing particle in ItoKMCPhysics.
Definition: CD_ItoKMCSurfaceReaction.H:32
size_t m_reactant
Reactant index.
Definition: CD_ItoKMCSurfaceReactions.H:92
void add(const ItoKMCSurfaceReaction &a_surfaceReaction) noexcept
Add a reaction.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:32
const size_t & getReactant() const noexcept
Get the reactant.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:65
std::discrete_distribution< size_t > & getDistribution() const noexcept
Get the discrete distribution for the reaction efficiencies.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:83
virtual ~ItoKMCSurfaceReactions() noexcept
Destructor.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:26
const std::vector< Real > & getEfficiencies() const noexcept
Get the reaction efficiency.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:77
std::vector< Products > m_products
Plasma product indices.
Definition: CD_ItoKMCSurfaceReactions.H:97
bool m_isDefined
Is defined or not.
Definition: CD_ItoKMCSurfaceReactions.H:87
const std::vector< Products > & getProducts() const noexcept
Get the plasma products for each reaction.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:71
ItoKMCSurfaceReactions() noexcept
Allowed, but you need to call the define function afterwards.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:21
std::discrete_distribution< size_t > m_distribution
Discrete distribution – useful when drawing a reaction.
Definition: CD_ItoKMCSurfaceReactions.H:107
std::vector< Real > m_efficiencies
Reaction efficiencies.
Definition: CD_ItoKMCSurfaceReactions.H:102
void reset() noexcept
Reset method for clearing class.
Definition: CD_ItoKMCSurfaceReactionsImplem.H:55