Reaktoro  v2.0.0
A unified framework for modeling chemically reactive systems
ElementalComposition Class Reference

A type used to describe the elemental composition of chemical species. More...

#include <ElementalComposition.hpp>

Public Member Functions

 ElementalComposition ()
 Construct a default ElementalComposition object.
 
 ElementalComposition (std::initializer_list< Pair< Element, double >> const &elements)
 Construct an ElementalComposition object with given elements and respective coefficients.
 
 ElementalComposition (Pairs< Element, double > const &elements)
 Construct an ElementalComposition object with given elements and respective coefficients.
 
 ElementalComposition (Pairs< String, double > const &elements)
 Construct an ElementalComposition object with given element symbols and respective coefficients.
 
auto size () const -> Index
 Return the number of elements.
 
auto symbols () const -> Strings
 Return the symbols of the elements.
 
auto coefficients () const -> Vec< double >
 Return the coefficients of the elements.
 
auto coefficient (const String &symbol) const -> double
 Return the coefficient of an element symbol in the elemental composition.
 
auto molarMass () const -> double
 Return the molar mass of the elemental composition (in kg/mol).
 
auto repr () const -> String
 Return a string representation of the elemental composition.
 
 operator Pairs< Element, double > () const
 Convert this ElementalComposition object into a Pairs<Element, double> object.
 
 operator Pairs< String, double > () const
 Convert this ElementalComposition object into a Pairs<String, double> object.
 
 operator String () const
 Convert this ElementalComposition object into a String representation object.
 
auto begin () const
 Return begin const iterator of this ElementalComposition instance (for STL compatibility reasons).
 
auto begin ()
 Return begin iterator of this ElementalComposition instance (for STL compatibility reasons).
 
auto end () const
 Return end const iterator of this ElementalComposition instance (for STL compatibility reasons).
 
auto end ()
 Return end iterator of this ElementalComposition instance (for STL compatibility reasons).
 

Detailed Description

A type used to describe the elemental composition of chemical species.


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