chombo-discharge
Loading...
Searching...
No Matches
CD_KMCSingleState.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_KMCSingleState_H
13#define CD_KMCSingleState_H
14
15// Std includes
16#include <vector>
17#include <cstddef>
18#include <ostream>
19
20// Our includes
21#include <CD_NamespaceHeader.H>
22
28template <typename T = long long>
30{
31public:
32 using State = std::vector<T>;
33
37 inline KMCSingleState() = delete;
38
43 inline KMCSingleState(const KMCSingleState& a_state) = default;
44
48 inline KMCSingleState(const KMCSingleState&&) = delete;
49
54 inline KMCSingleState(const size_t a_numSpecies) noexcept;
55
59 virtual ~KMCSingleState();
60
64 inline KMCSingleState&
65 operator=(const KMCSingleState&) = default;
66
70 inline KMCSingleState&
71 operator=(const KMCSingleState&&) = delete;
72
77 inline T&
78 operator[](const size_t a_idx) noexcept;
79
84 inline const T&
85 operator[](const size_t a_idx) const noexcept;
86
91 inline bool
93
98 inline std::vector<T>
100
107 inline void
109
114 inline State&
116
121 inline const State&
123
128 State m_state;
129};
130
131#include <CD_NamespaceFooter.H>
132
134
135#endif
Implementation of CD_KMCSingleState.H.
Declaration of a straightforward state for advancing with the Kinetic Monte Carlo module.
Definition CD_KMCSingleState.H:30
KMCSingleState(const KMCSingleState &&)=delete
Disallowed move constructor.
KMCSingleState(const KMCSingleState &a_state)=default
Copy constructor.
T & operator[](const size_t a_idx) noexcept
Get the population of the input index.
Definition CD_KMCSingleStateImplem.H:57
KMCSingleState & operator=(const KMCSingleState &&)=delete
Disallowed move assignement.
virtual ~KMCSingleState()
Destructor.
Definition CD_KMCSingleStateImplem.H:31
KMCSingleState()=delete
Disallowed weak construction.
State m_state
State vector.
Definition CD_KMCSingleState.H:128
void linearIn(const std::vector< T > &a_linearizedState) noexcept
Linearize the input buffer.
Definition CD_KMCSingleStateImplem.H:82
State & getState() noexcept
Get modifiable state.
Definition CD_KMCSingleStateImplem.H:89
KMCSingleState & operator=(const KMCSingleState &)=default
Copy assignment constructor.
std::vector< T > linearOut() const noexcept
Linearize the state onto an output vector.
Definition CD_KMCSingleStateImplem.H:75
bool isValidState() const noexcept
Check if state is a valid state.
Definition CD_KMCSingleStateImplem.H:38
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