Define a type that describes the equation of a reaction. More...
#include <ReactionEquation.hpp>
Public Member Functions | |
ReactionEquation () | |
Construct a default ReactionEquation instance. | |
ReactionEquation (std::string equation) | |
Construct a ReactionEquation instance by parsing a string. More... | |
ReactionEquation (const std::map< std::string, double > &equation) | |
Construct a ReactionEquation instance from a list of species names and a list of stoichiometries. More... | |
auto | empty () const -> bool |
Return true if the rection equation is empty. | |
auto | numSpecies () const -> unsigned |
Return the number of species in the reaction equation. | |
auto | stoichiometry (std::string species) const -> double |
Return the stoichiometry of a species in the reaction equation. More... | |
auto | equation () const -> const std::map< std::string, double > & |
Return the reaction equation as a map of species names and stoichiometries. | |
operator std::string () const | |
Convert the ReactionEquation instance into a string. | |
Detailed Description
Define a type that describes the equation of a reaction.
The equation of a reaction is assumed as a sequence of pairs (species, stoichiometry). It is shown below how the equation of reaction \(\mathrm{CO_{2}(g)+H_{2}O\rightleftharpoons H^{+}+HCO_{3}^{-}}\) can be defined by two equivalent ways:
Constructor & Destructor Documentation
◆ ReactionEquation() [1/2]
ReactionEquation | ( | std::string | equation | ) |
Construct a ReactionEquation instance by parsing a string.
Below are examples of how to set a reaction equation via a formatted string.
Note that unity stoichiometry coefficients can be ommited from the equation. The operator *
must be used when this is not the case.
- Parameters
-
equation The string representing the rection equation
◆ ReactionEquation() [2/2]
ReactionEquation | ( | const std::map< std::string, double > & | equation | ) |
Construct a ReactionEquation instance from a list of species names and a list of stoichiometries.
- Parameters
-
species The names of the participating chemical species coeffs The stoichiometries of the participating chemical species
Member Function Documentation
◆ stoichiometry()
auto stoichiometry | ( | std::string | species | ) | const -> double |
Return the stoichiometry of a species in the reaction equation.
- Parameters
-
species The name of the species.
The documentation for this class was generated from the following files:
- Reaktoro/Common/ReactionEquation.hpp
- Reaktoro/Common/ReactionEquation.cpp