Reaction type for advancing a KMCSingleState for Kinetic Monte Carlo.
More...
#include <CD_KMCSingleStateReaction.H>
|
|
| KMCSingleStateReaction ()=default |
| | Default constructor.
|
| |
|
| KMCSingleStateReaction (const KMCSingleStateReaction &)=default |
| | Copy constructor.
|
| |
| | KMCSingleStateReaction (const std::list< size_t > &a_reactants, const std::list< size_t > &a_products) noexcept |
| | Full constructor, sets reactants and products.
|
| |
|
virtual | ~KMCSingleStateReaction () |
| | Destructor.
|
| |
| Real & | rate () const noexcept |
| | Get modifiable reaction rate.
|
| |
| Real | propensity (const State &a_state) const noexcept |
| | Compute the propensity function for this reaction type.
|
| |
| T | computeCriticalNumberOfReactions (const State &a_state) const noexcept |
| | Compute the number of times the reaction can fire before exhausting one of the reactants.
|
| |
| const std::list< size_t > & | getReactants () const noexcept |
| | Get the reactants involved in the reaction.
|
| |
| T | getStateChange (const size_t a_particleReactant) const noexcept |
| | Get the state change due to a change in the input reactant species.
|
| |
| void | advanceState (State &a_state, const T &a_numReactions) const noexcept |
| | Advance the incoming state with the number of reactions.
|
| |
|
| static T | population (const size_t &a_reactant, const State &a_state) noexcept |
| | Get the population of the reactant in the input state.
|
| |
|
|
void | computeStateChanges () noexcept |
| | Compute state change vectors from the reactant/product lists.
|
| |
|
|
Real | m_rate |
| | Reaction rate.
|
| |
| Real | m_propensityFactor |
| | Factor for the case where two or more particles of the same species react.
|
| |
|
std::list< size_t > | m_reactants |
| | Reactants.
|
| |
|
std::list< size_t > | m_products |
| | Products.
|
| |
|
std::map< size_t, T > | m_stateChange |
| | State change for reactants/products.
|
| |
template<typename State = KMCSingleState<long long>, typename T = long long>
class KMCSingleStateReaction< State, T >
Reaction type for advancing a KMCSingleState for Kinetic Monte Carlo.
- Note
- T is the integer type used for the state.
◆ KMCSingleStateReaction()
template<typename State , typename T >
Full constructor, sets reactants and products.
For a reaction X_0 -> X_0 + X_0 we have a_reactants = [0] and a_products = [0,0].
- Parameters
-
| [in] | a_reactants | Species on the left-hand side of the reaction. |
| [in] | a_products | Species on the right-hand side of the reaction. |
◆ advanceState()
template<typename State , typename T >
Advance the incoming state with the number of reactions.
- Parameters
-
| [in,out] | a_state | State vector. |
| [in] | a_numReactions | Number of reactions. |
◆ computeCriticalNumberOfReactions()
template<typename State , typename T >
Compute the number of times the reaction can fire before exhausting one of the reactants.
- Parameters
-
- Returns
- Critical number of reactions.
◆ getReactants()
template<typename State , typename T >
Get the reactants involved in the reaction.
Returned by reference for the same reason as in KMCDualStateReaction: KMCSolver walks this list once per reaction per grid cell when assembling the reactant set for the time step calculation, and returning by value deep-copied the list on every walk.
- Returns
- m_reactants
◆ getStateChange()
template<typename State , typename T >
Get the state change due to a change in the input reactant species.
- Parameters
-
| [in] | a_particleReactant | Reactant species. |
- Returns
- State change for the reactant.
◆ population()
template<typename State , typename T >
Get the population of the reactant in the input state.
- Parameters
-
| [in] | a_reactant | Reactant. |
| [in] | a_state | State. |
- Returns
- Population of the reactant.
◆ propensity()
template<typename State , typename T >
Compute the propensity function for this reaction type.
- Parameters
-
- Returns
- Reaction propensity.
- Note
- User should set the rate before calling this routine.
◆ rate()
template<typename State , typename T >
Get modifiable reaction rate.
- Returns
- m_rate
◆ m_propensityFactor
template<typename State = KMCSingleState<long long>, typename T = long long>
Factor for the case where two or more particles of the same species react.
For reactions X + X -> null the propensity is k * X * (X-1)/2 because there are X * (X-1)/2 unique pairs of particles in the cell.
The documentation for this class was generated from the following files: