chombo-discharge
Loading...
Searching...
No Matches
CD_KMCDualState.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2022 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_KMCDualState_H
13#define CD_KMCDualState_H
14
15// Std includes
16#include <vector>
17#include <cstddef>
18#include <ostream>
19
20// Our includes
21#include <CD_NamespaceHeader.H>
22
29template <typename T = long long>
31{
32public:
33 using State = std::vector<T>;
34
38 inline KMCDualState() = default;
39
43 inline KMCDualState(const KMCDualState&) = default;
44
48 inline KMCDualState(const KMCDualState&&) = delete;
49
55 inline KMCDualState(const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept;
56
60 virtual ~KMCDualState();
61
65 inline KMCDualState&
66 operator=(const KMCDualState&) = default;
67
71 inline KMCDualState&
72 operator=(const KMCDualState&&) = delete;
73
79 inline void
80 define(const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept;
81
85 inline bool
87
92 inline State&
94
99 inline const State&
101
106 inline State&
108
113 inline const State&
115
120 inline std::vector<T>
122
129 inline void
131
137
142
147
152};
153
162
163#include <CD_NamespaceFooter.H>
164
166
167#endif
Implementation of CD_KMCDualState.H.
Declaration of a "dual state" for advancing with the Kinetic Monte Carlo module.
Definition CD_KMCDualState.H:31
State & getNonReactiveState() noexcept
Get modifiable non-reactive state.
Definition CD_KMCDualStateImplem.H:116
KMCDualState(const KMCDualState &&)=delete
Disallowed move constructor.
KMCDualState()=default
Default constructor.
KMCDualState(const KMCDualState &)=default
Copy constructor.
int m_numNonReactiveSpecies
Number of non-reactive species.
Definition CD_KMCDualState.H:141
State m_nonReactiveState
Non-reactive state.
Definition CD_KMCDualState.H:151
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:50
void define(const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept
Define function constructor.
Definition CD_KMCDualStateImplem.H:37
void linearIn(const std::vector< T > &a_linearizedState) noexcept
Linearize the input buffer.
Definition CD_KMCDualStateImplem.H:89
virtual ~KMCDualState()
Destructor.
Definition CD_KMCDualStateImplem.H:32
KMCDualState & operator=(const KMCDualState &)=default
Copy assignment constructor.
std::vector< T > linearOut() const noexcept
Linearize the state onto an output vector.
Definition CD_KMCDualStateImplem.H:77
State m_reactiveState
Reactive state.
Definition CD_KMCDualState.H:146
State & getReactiveState() noexcept
Get modifiable reactive state.
Definition CD_KMCDualStateImplem.H:102
KMCDualState & operator=(const KMCDualState &&)=delete
Disallowed move assignement.
int m_numReactiveSpecies
Number of reactive species.
Definition CD_KMCDualState.H:136
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25