12 #ifndef CD_KMCDualStateImplem_H
13 #define CD_KMCDualStateImplem_H
17 #include <CD_NamespaceHeader.H>
22 this->define(a_numReactiveSpecies, a_numNonReactiveSpecies);
24 CH_assert(m_reactiveState.size() > 0);
35 m_reactiveState.resize(a_numReactiveSpecies);
36 m_nonReactiveState.resize(a_numNonReactiveSpecies);
45 for (
const auto& p : m_reactiveState) {
53 for (
const auto& p : m_nonReactiveState) {
65 inline typename KMCDualState<T>::State&
68 return m_reactiveState;
72 inline const typename KMCDualState<T>::State&
75 return m_reactiveState;
79 inline typename KMCDualState<T>::State&
82 return m_nonReactiveState;
86 inline const typename KMCDualState<T>::State&
89 return m_nonReactiveState;
96 ostr <<
"KMCDualState : \n";
102 ostr <<
"\t Reactive = (";
103 for (
size_t i = 0; i < reactiveState.size(); i++) {
104 ostr << reactiveState[i];
105 if (i < reactiveState.size() - 1) {
111 ostr <<
"\t Non-reactive = (";
112 for (
size_t i = 0; i < nonReactiveState.size(); i++) {
113 ostr << nonReactiveState[i];
114 if (i < nonReactiveState.size() - 1) {
123 #include <CD_NamespaceFooter.H>
std::ostream & operator<<(std::ostream &ostr, const KMCDualState< T > &a_state)
State printing function.
Definition: CD_KMCDualStateImplem.H:94
Declaration of a simple state vector for running Kinetic Monte Carlo for plasma problems.
Declaration of a "dual state" for advancing with the Kinetic Monte Carlo module.
Definition: CD_KMCDualState.H:29
State & getNonReactiveState() noexcept
Get modifiable non-reactive state.
Definition: CD_KMCDualStateImplem.H:80
KMCDualState()=default
Default constructor.
bool isValidState() const noexcept
Check if state is a valid state. An invalid state will have a negative number of reactants/non-reacta...
Definition: CD_KMCDualStateImplem.H:41
void define(const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept
Define function constructor.
Definition: CD_KMCDualStateImplem.H:33
virtual ~KMCDualState()
Destructor.
Definition: CD_KMCDualStateImplem.H:28
State & getReactiveState() noexcept
Get modifiable reactive state.
Definition: CD_KMCDualStateImplem.H:66