chombo-discharge
Public Types | Public Member Functions | Protected Attributes | List of all members
KMCSingleState< T > Class Template Reference

Declaration of a straightforward state for advancing with the Kinetic Monte Carlo module. More...

#include <CD_KMCSingleState.H>

Public Types

using State = std::vector< T >
 

Public Member Functions

 KMCSingleState ()=delete
 Disallowed weak construction.
 
 KMCSingleState (const KMCSingleState &a_state)=default
 Copy constructor. More...
 
 KMCSingleState (KMCSingleState &&)=delete
 Disallowed move constructor.
 
 KMCSingleState (const size_t a_numSpecies) noexcept
 Full constructor. More...
 
virtual ~KMCSingleState ()
 Destructor.
 
KMCSingleStateoperator= (const KMCSingleState &)=default
 Copy assignment constructor.
 
KMCSingleStateoperator= (const KMCSingleState &&)=delete
 Disallowed move assignement.
 
T & operator[] (const size_t a_idx) noexcept
 Get the population of the input index. More...
 
const T & operator[] (const size_t a_idx) const noexcept
 Get the population of the input index. More...
 
bool isValidState () const noexcept
 Check if state is a valid state. More...
 
State & getState () noexcept
 Get modifiable state. More...
 
const State & getState () const noexcept
 Get state. More...
 

Protected Attributes

State m_state
 State vector.
 

Detailed Description

template<typename T = long long>
class KMCSingleState< T >

Declaration of a straightforward state for advancing with the Kinetic Monte Carlo module.

The state is simply a vector of integers (default long long type ints).

Note
The template parameter indicates the integer type used for tracking the state.

Constructor & Destructor Documentation

◆ KMCSingleState() [1/2]

template<typename T = long long>
KMCSingleState< T >::KMCSingleState ( const KMCSingleState< T > &  a_state)
inlinedefault

Copy constructor.

Parameters
[in]a_otherOther state

◆ KMCSingleState() [2/2]

template<typename T >
KMCSingleState< T >::KMCSingleState ( const size_t  a_numSpecies)
inlinenoexcept

Full constructor.

Parameters
[in]a_numSpeciesNumber of reactive species in the allocated state vector.

Member Function Documentation

◆ getState() [1/2]

template<typename T >
const KMCSingleState< T >::State & KMCSingleState< T >::getState
inlinenoexcept

Get state.

Returns
m_state

◆ getState() [2/2]

template<typename T >
KMCSingleState< T >::State & KMCSingleState< T >::getState
inlinenoexcept

Get modifiable state.

Returns
m_state

◆ isValidState()

template<typename T >
bool KMCSingleState< T >::isValidState
inlinenoexcept

Check if state is a valid state.

Returns
Returns false if any populations are negative.

◆ operator[]() [1/2]

template<typename T >
const T & KMCSingleState< T >::operator[] ( const size_t  a_idx) const
inlinenoexcept

Get the population of the input index.

Parameters
[in]a_idxIndex in state vector

◆ operator[]() [2/2]

template<typename T >
T & KMCSingleState< T >::operator[] ( const size_t  a_idx)
inlinenoexcept

Get the population of the input index.

Parameters
[in]a_idxIndex in state vector

The documentation for this class was generated from the following files: