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

The class used to store and retrieve data of chemical species from ThermoFun databases. More...

#include <ThermoFunDatabase.hpp>

Collaboration diagram for ThermoFunDatabase:
[legend]

Public Member Functions

 ThermoFunDatabase ()
 Construct a default ThermoFunDatabase object.
 
 ThermoFunDatabase (const String &name)
 Construct a ThermoFunDatabase object with given name of embedded database file. More...
 
 ThermoFunDatabase (const ThermoFun::Database &db)
 Construct a ThermoFunDatabase object with given object of class ThermoFun::Database.
 
- Public Member Functions inherited from Database
 Database ()
 Construct a default Database object.
 
 Database (const Database &other)
 Construct a copy of a Database object.
 
 Database (const Vec< Element > &elements, const Vec< Species > &species)
 Construct a Database object with given elements and species.
 
 Database (const Vec< Species > &species)
 Construct a Database object with given species (elements extracted from them).
 
 ~Database ()
 Destroy this Database object.
 
auto operator= (Database other) -> Database &
 Assign another Database object to this.
 
auto clear () -> void
 Remove all species and elements from the database.
 
auto addElement (const Element &element) -> void
 Add an element in the database. More...
 
auto addSpecies (const Species &species) -> void
 Add a species in the database. More...
 
auto addSpecies (const Vec< Species > &species) -> void
 Add a list of species in the database.
 
auto attachData (const Any &data) -> void
 Attach data to this database whose type is known at runtime only.
 
auto extend (const Database &other) -> void
 Extend this database with the elements, species and other contents from another database.
 
auto elements () const -> const ElementList &
 Return all elements in the database.
 
auto species () const -> const SpeciesList &
 Return all species in the database.
 
auto speciesWithAggregateState (AggregateState option) const -> SpeciesList
 Return all species in the database with given aggregate state.
 
auto element (const String &symbol) const -> const Element &
 Return an element with given symbol in the database. More...
 
auto species (const String &name) const -> const Species &
 Return a species with given name in the database. More...
 
auto reaction (const String &equation) const -> Reaction
 Construct a reaction with given equation. More...
 
auto attachedData () const -> const Any &
 Return the attached data to this database whose type is known at runtime only.
 

Static Public Member Functions

static auto withName (const String &name) -> ThermoFunDatabase
 Return a ThermoFunDatabase object constructed with an embedded database file. More...
 
static auto fromFile (const String &filepath) -> ThermoFunDatabase
 Return a ThermoFunDatabase object constructed with a given local file. More...
 
static auto fromContents (const String &contents) -> ThermoFunDatabase
 Return a ThermoFunDatabase object constructed with given database text contents. More...
 
- Static Public Member Functions inherited from Database
static auto fromFile (const String &path) -> Database
 Return a Database object constructed with a given local file. More...
 
static auto fromContents (const String &contents) -> Database
 Return a Database object constructed with given database text contents. More...
 
static auto fromStream (std::istream &stream) -> Database
 Return a Database object constructed with given input stream containing the database text contents. More...
 

Detailed Description

The class used to store and retrieve data of chemical species from ThermoFun databases.

Constructor & Destructor Documentation

◆ ThermoFunDatabase()

ThermoFunDatabase ( const String name)
explicit

Construct a ThermoFunDatabase object with given name of embedded database file.

For a list of currently supported names for embedded ThermoFun databases, see ThermoFunDatabase::withName.

Member Function Documentation

◆ withName()

static auto withName ( const String name) -> ThermoFunDatabase
static

Return a ThermoFunDatabase object constructed with an embedded database file.

The currently supported database file names are:

  • aq17 (corresponding file: aq17-thermofun.json)
  • cemdata18 (corresponding file: cemdata18-thermofun.json)
  • heracles (corresponding file: heracles-thermofun.json)
  • mines16 (corresponding file: mines16-thermofun.json)
  • psinagra-12-07 (corresponding file: psinagra-12-07-thermofun.json)
  • slop98-organic (corresponding file: slop98-organic-thermofun.json)
  • slop98 (corresponding file: slop98-thermofun.json)
    Parameters
    nameThe name of the embedded ThermoFun database.
    Warning
    An exception is thrown if name is not one of the above names.

◆ fromFile()

static auto fromFile ( const String filepath) -> ThermoFunDatabase
static

Return a ThermoFunDatabase object constructed with a given local file.

Parameters
filepathThe path, including file name, to the database file.
Warning
An exception is thrown if filepath does not point to a valid database file.

◆ fromContents()

static auto fromContents ( const String contents) -> ThermoFunDatabase
static

Return a ThermoFunDatabase object constructed with given database text contents.

Parameters
contentsThe contents of the database as a string.

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