chombo-discharge
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
KMCDualState< T > Class Template Reference

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

#include <CD_KMCDualState.H>

Public Types

using State = std::vector< T >
 Alias for the state type.
 

Public Member Functions

 KMCDualState ()=default
 Default constructor.
 
 KMCDualState (const KMCDualState &)=default
 Copy constructor.
 
 KMCDualState (const KMCDualState &&)=delete
 Disallowed move constructor.
 
 KMCDualState (const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept
 Full constructor.
 
virtual ~KMCDualState ()
 Destructor.
 
KMCDualStateoperator= (const KMCDualState &a_other)=default
 Copy assignment operator.
 
KMCDualStateoperator= (const KMCDualState &&)=delete
 Disallowed move assignment.
 
void define (const size_t a_numReactiveSpecies, const size_t a_numNonReactiveSpecies) noexcept
 Define function.
 
bool isValidState () const noexcept
 Check if state is a valid state. An invalid state will have a negative number of reactants/non-reactants.
 
StategetReactiveState () noexcept
 Get modifiable reactive state.
 
const StategetReactiveState () const noexcept
 Get reactive state.
 
StategetNonReactiveState () noexcept
 Get modifiable non-reactive state.
 
const StategetNonReactiveState () const noexcept
 Get non-reactive state.
 
std::vector< TlinearOut () const noexcept
 Linearize the state onto an output vector.
 
void linearIn (const std::vector< T > &a_linearizedState) noexcept
 Linearize the input buffer onto the current state.
 

Protected Attributes

int m_numReactiveSpecies
 Number of reactive species.
 
int m_numNonReactiveSpecies
 Number of non-reactive species.
 
State m_reactiveState
 Reactive state.
 
State m_nonReactiveState
 Non-reactive state.
 

Detailed Description

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

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

This state consists of both reactive and non-reactive species. The reactive species can appear on the left- and right-hand side of the reaction. The non-reactive species can only appear on the right-hand side of the reaction.

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

Constructor & Destructor Documentation

◆ KMCDualState()

template<typename T >
KMCDualState< T >::KMCDualState ( const size_t  a_numReactiveSpecies,
const size_t  a_numNonReactiveSpecies 
)
inlinenoexcept

Full constructor.

Parameters
[in]a_numReactiveSpeciesNumber of reactive species in the state vector.
[in]a_numNonReactiveSpeciesNumber of non-reactive species in the state vector.

Member Function Documentation

◆ define()

template<typename T >
void KMCDualState< T >::define ( const size_t  a_numReactiveSpecies,
const size_t  a_numNonReactiveSpecies 
)
inlinenoexcept

Define function.

Parameters
[in]a_numReactiveSpeciesNumber of reactive species in the state vector.
[in]a_numNonReactiveSpeciesNumber of non-reactive species in the state vector.

◆ getNonReactiveState() [1/2]

template<typename T >
const KMCDualState< T >::State & KMCDualState< T >::getNonReactiveState ( ) const
inlinenoexcept

Get non-reactive state.

Returns
m_nonReactiveState

◆ getNonReactiveState() [2/2]

template<typename T >
KMCDualState< T >::State & KMCDualState< T >::getNonReactiveState ( )
inlinenoexcept

Get modifiable non-reactive state.

Returns
m_nonReactiveState

◆ getReactiveState() [1/2]

template<typename T >
const KMCDualState< T >::State & KMCDualState< T >::getReactiveState ( ) const
inlinenoexcept

Get reactive state.

Returns
m_reactiveState

◆ getReactiveState() [2/2]

template<typename T >
KMCDualState< T >::State & KMCDualState< T >::getReactiveState ( )
inlinenoexcept

Get modifiable reactive state.

Returns
m_reactiveState

◆ isValidState()

template<typename T >
bool KMCDualState< T >::isValidState ( ) const
inlinenoexcept

Check if state is a valid state. An invalid state will have a negative number of reactants/non-reactants.

Returns
Returns false if any populations are negative.

◆ linearIn()

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

Linearize the input buffer onto the current state.

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 > KMCDualState< T >::linearOut ( ) const
inlinenoexcept

Linearize the state onto an output vector.

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

Returns
Linearized state vector.

◆ operator=()

template<typename T = long long>
KMCDualState & KMCDualState< T >::operator= ( const KMCDualState< T > &  a_other)
inlinedefault

Copy assignment operator.

Parameters
[in]a_otherOther state.
Returns
Reference to this object.

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