Provides operations to retrieve physical and thermodynamic data of chemical species. More...
#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... | |
Database (const ThermoFun::Database &fundatabase) | |
Construct a Database instance with a given ThermoFun database. | |
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 addLiquidSpecies (const LiquidSpecies &species) -> void | |
Add a LiquidSpecies instance in the database. | |
auto addMineralSpecies (const MineralSpecies &species) -> void | |
Add a MineralSpecies instance in the database. | |
auto elements () const -> 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 liquidSpecies () -> std::vector< LiquidSpecies > | |
Return all liquid species in the database. | |
auto liquidSpecies (std::string name) const -> const LiquidSpecies & | |
Return a liquid 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 containsLiquidSpecies (std::string species) const -> bool | |
Check if the database contains a given liquid 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 liquidSpeciesWithElements (const std::vector< std::string > &elements) const -> std::vector< LiquidSpecies > | |
Return the liquid 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. | |
Detailed Description
Provides operations to retrieve 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.
Usage
In the example below, a Database instance is initialized and queries are made to retrieve information of aqueous, gaseous and liquid species. Note that an exception is thrown if a species is not present in the database.
- See also
- AqueousSpecies, GaseousSpecies, LiquidSpecies, MineralSpecies
Constructor & Destructor Documentation
◆ Database()
|
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 exists with a given name, an exception will be thrown.
- Parameters
-
filename The name of the database file
Member Function Documentation
◆ aqueousSpecies()
Return an aqueous species in the database.
Note: An exception is thrown if the database does not contain the species.
- Parameters
-
name The name of the aqueous species
◆ gaseousSpecies()
Return a gaseous species in the database.
Note: An exception is thrown if the database does not contain the species.
- Parameters
-
name The name of the gaseous species
◆ liquidSpecies()
Return a liquid species in the database.
Note: An exception is thrown if the database does not contain the species.
- Parameters
-
name The name of the liquid species
◆ mineralSpecies()
Return a mineral species in the database.
Note: An exception is thrown if the database does not contain the species.
- Parameters
-
name The name of the mineral species
◆ containsAqueousSpecies()
Check if the database contains a given aqueous species.
- Parameters
-
species The name of the aqueous species
◆ containsGaseousSpecies()
Check if the database contains a given gaseous species.
- Parameters
-
species The name of the gaseous species
◆ containsLiquidSpecies()
Check if the database contains a given liquid species.
- Parameters
-
species The name of the liquid species
◆ containsMineralSpecies()
Check if the database contains a given mineral species.
- Parameters
-
species The 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