RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
Reaction Struct Referenceexport
module reaction

Represents a chemical reaction within the simulation. More...

Collaboration diagram for Reaction:

Public Member Functions

 Reaction ()
 Default constructor for the Reaction struct.
 
 Reaction (std::size_t id, std::vector< std::size_t > reactantStoichiometry, std::vector< std::size_t > productStoichiometry)
 Constructs a Reaction with specified parameters.
 
bool operator== (Reaction const &) const =default
 
std::string printStatus () const
 Returns a string representation of the Reaction status.
 
nlohmann::json jsonStatus () const
 Returns a JSON representation of the Reaction status.
 

Public Attributes

std::uint64_t versionNumber {1}
 Version number of the Reaction struct.
 
std::size_t id
 Unique identifier for the reaction.
 
std::vector< std::size_t > reactantStoichiometry
 Stoichiometry of reactants.
 
std::vector< std::size_t > productStoichiometry
 Stoichiometry of products.
 
PropertyLambdaProbabilityHistogram lambda
 Histogram for lambda probabilities.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const Reaction &r)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, Reaction &r)
 

Detailed Description

Represents a chemical reaction within the simulation.

The Reaction struct encapsulates the properties and behaviors of a chemical reaction, including its unique identifier, stoichiometry of reactants and products, a histogram for lambda probabilities, and methods for printing and serialization.

Constructor & Destructor Documentation

◆ Reaction() [1/2]

Reaction::Reaction ( )
inline

Default constructor for the Reaction struct.

Initializes a Reaction object with default values.

◆ Reaction() [2/2]

Reaction::Reaction ( std::size_t  id,
std::vector< std::size_t >  reactantStoichiometry,
std::vector< std::size_t >  productStoichiometry 
)
inline

Constructs a Reaction with specified parameters.

Initializes a Reaction with the provided identifier and stoichiometry for reactants and products.

Parameters
idThe unique identifier for the reaction.
reactantStoichiometryA vector containing the stoichiometry of reactants.
productStoichiometryA vector containing the stoichiometry of products.

Member Function Documentation

◆ jsonStatus()

nlohmann::json Reaction::jsonStatus ( ) const

Returns a JSON representation of the Reaction status.

Generates a JSON object containing information about the Reaction's current state.

Returns
A JSON object representing the Reaction's status.

◆ printStatus()

std::string Reaction::printStatus ( ) const

Returns a string representation of the Reaction status.

Generates a string containing information about the Reaction's current state.

Returns
A string representing the Reaction's status.

The documentation for this struct was generated from the following file: