Reaktoro 
A unified framework for modeling chemically reactive systems
Reaktoro::Database Class Reference

Detailed Description

Provides operations to retrive physical and thermodynamic data of chemical species.

The Database class is used to retrieve information of chemical species. It is initialized from a xml database file, which must satisfy some format conditions. Once it is initialized, one can, for example, retrieve thermodynamic information of an aqueous species that will be used to calculate its standard chemical potential.

#include <Database.hpp>

Public Member Functions

 Database ()
 Construct a default Database instance.
 
 Database (std::string filename)
 Construct a Database instance by parsing a xml database file. More...
 
auto addElement (const Element &element) -> void
 Add an Element instance in the database.
 
auto addAqueousSpecies (const AqueousSpecies &species) -> void
 Add an AqueousSpecies instance in the database.
 
auto addGaseousSpecies (const GaseousSpecies &species) -> void
 Add a GaseousSpecies instance in the database.
 
auto addMineralSpecies (const MineralSpecies &species) -> void
 Add a MineralSpecies instance in the database.
 
auto elements () -> std::vector< Element >
 Return all elements in the database.
 
auto aqueousSpecies () -> std::vector< AqueousSpecies >
 Return all aqueous species in the database.
 
auto aqueousSpecies (std::string name) const -> const AqueousSpecies &
 Return an aqueous species in the database. More...
 
auto gaseousSpecies () -> std::vector< GaseousSpecies >
 Return all gaseous species in the database.
 
auto gaseousSpecies (std::string name) const -> const GaseousSpecies &
 Return a gaseous species in the database. More...
 
auto mineralSpecies () -> std::vector< MineralSpecies >
 Return all mineral species in the database.
 
auto mineralSpecies (std::string name) const -> const MineralSpecies &
 Return a mineral species in the database. More...
 
auto containsAqueousSpecies (std::string species) const -> bool
 Check if the database contains a given aqueous species. More...
 
auto containsGaseousSpecies (std::string species) const -> bool
 Check if the database contains a given gaseous species. More...
 
auto containsMineralSpecies (std::string species) const -> bool
 Check if the database contains a given mineral species. More...
 
auto aqueousSpeciesWithElements (const std::vector< std::string > &elements) const -> std::vector< AqueousSpecies >
 Return the aqueous species that contains at least one of the specified elements.
 
auto gaseousSpeciesWithElements (const std::vector< std::string > &elements) const -> std::vector< GaseousSpecies >
 Return the gaseous species that contains at least one of the specified elements.
 
auto mineralSpeciesWithElements (const std::vector< std::string > &elements) const -> std::vector< MineralSpecies >
 Return the mineral species that contains at least one of the specified elements.
 

Constructor & Destructor Documentation

Reaktoro::Database::Database ( std::string  filename)
explicit

Construct a Database instance by parsing a xml database file.

If filename does not point to a valid database file or the database file is not found, then a default built-in database with the same name will be tried. If no default built-in database exist with given name, an exception will be thrown.

Parameters
filenameThe name of the database file

Member Function Documentation

auto Reaktoro::Database::aqueousSpecies ( std::string  name) const -> const AqueousSpecies&

Return an aqueous species in the database.

Note: An exception is thrown if the database does not contain the species.

Parameters
nameThe name of the aqueous species
auto Reaktoro::Database::gaseousSpecies ( std::string  name) const -> const GaseousSpecies&

Return a gaseous species in the database.

Note: An exception is thrown if the database does not contain the species.

Parameters
nameThe name of the gaseous species
auto Reaktoro::Database::mineralSpecies ( std::string  name) const -> const MineralSpecies&

Return a mineral species in the database.

Note: An exception is thrown if the database does not contain the species.

Parameters
nameThe name of the mineral species
auto Reaktoro::Database::containsAqueousSpecies ( std::string  species) const -> bool

Check if the database contains a given aqueous species.

Parameters
speciesThe name of the aqueous species
auto Reaktoro::Database::containsGaseousSpecies ( std::string  species) const -> bool

Check if the database contains a given gaseous species.

Parameters
speciesThe name of the gaseous species
auto Reaktoro::Database::containsMineralSpecies ( std::string  species) const -> bool

Check if the database contains a given mineral species.

Parameters
speciesThe name of the mineral species

The documentation for this class was generated from the following files:
  • Reaktoro/Thermodynamics/Core/Database.hpp
  • Reaktoro/Thermodynamics/Core/Database.cpp