chombo-discharge
Loading...
Searching...
No Matches
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.
 
 KMCSingleState (const KMCSingleState &&)=delete
 Disallowed move constructor.
 
 KMCSingleState (const size_t a_numSpecies) noexcept
 Full constructor.
 
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.
 
const T & operator[] (const size_t a_idx) const noexcept
 Get the population of the input index.
 
bool isValidState () const noexcept
 Check if state is a valid state.
 
std::vector< T > linearOut () const noexcept
 Linearize the state onto an output vector.
 
void linearIn (const std::vector< T > &a_linearizedState) noexcept
 Linearize the input buffer.
 
State & getState () noexcept
 Get modifiable state.
 
const State & getState () const noexcept
 Get state.
 

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 ( ) const
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 ( ) const
inlinenoexcept

Check if state is a valid state.

Returns
Returns false if any populations are negative.

◆ linearIn()

template<typename T >
void KMCSingleState< T >::linearIn ( const std::vector< T > &  a_linearizedState)
inlinenoexcept

Linearize the input buffer.

This routine should take the input vector and linearize it onto the current state. This is mostly used by KMCSolver when computing the Jacobians for implicit updates.

Parameters
[in]a_linearizedStateLinearized state vector

◆ linearOut()

template<typename T >
std::vector< T > KMCSingleState< T >::linearOut ( ) const
inlinenoexcept

Linearize the state onto an output vector.

This is mostly by KMCSolver when computing the necessary Jacobians for implicit updates

◆ 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: