Phases.hpp
41 auto operator+=(Strings const& othersymbols) -> Speciate& { symbols = merge(symbols, othersymbols); return *this; }
54 auto operator+=(Strings const& othertags) -> Exclude& { tags = merge(tags, othertags); return *this; }
199 auto setAdditionalAggregateStates(Vec<AggregateState> const& options) -> GeneralPhasesGenerator&;
354 explicit AqueousPhase(Speciate elements) : GeneralPhase(elements += {"H", "O"}) { initialize(); }
357 explicit AqueousPhase(Speciate elements, Exclude const& withtags) : GeneralPhase(elements += {"H", "O"}, withtags) { initialize(); }
360 explicit AqueousPhase(Exclude const& withtags) : GeneralPhase(speciate("H O"), withtags) { initialize(); }
387 explicit GaseousPhase(Speciate const& elements, Exclude const& withtags) : GeneralPhase(elements, withtags) { initialize(); }
417 explicit LiquidPhase(Speciate const& elements, Exclude const& withtags) : GeneralPhase(elements, withtags) { initialize(); };
487 explicit MineralPhases(StringList const& species) : GeneralPhasesGenerator(species) { initialize(); }
490 explicit MineralPhases(Speciate const& elements) : GeneralPhasesGenerator(elements) { initialize(); }
493 explicit MineralPhases(Speciate const& elements, Exclude const& withtags) : GeneralPhasesGenerator(elements, withtags) { initialize(); };
496 explicit MineralPhases(Exclude const& withtags) : GeneralPhasesGenerator(withtags) { initialize(); };
532 setActivityModel(ActivityModelIdealSolution(StateOfMatter::Solid)); // TODO: Create ActivityModelIdealCondensedPhase(melting_temperature) or rely on a MeltingTemperature attribute in the species block of the database
545 explicit CondensedPhases(StringList const& species) : GeneralPhasesGenerator(species) { initialize(); }
548 explicit CondensedPhases(Speciate const& elements) : GeneralPhasesGenerator(elements) { initialize(); }
551 explicit CondensedPhases(Speciate const& elements, Exclude const& withtags) : GeneralPhasesGenerator(elements, withtags) { initialize(); };
554 explicit CondensedPhases(Exclude const& withtags) : GeneralPhasesGenerator(withtags) { initialize(); };
568 setActivityModel(ActivityModelIdealSolution(StateOfMatter::Solid)); // TODO: Create ActivityModelIdealCondensedPhase(melting_temperature)
The class used to configure an aqueous solution phase.
Definition: Phases.hpp:345
auto initialize() -> void
Initialize the default attributes of this AqueousPhase object.
Definition: Phases.hpp:363
AqueousPhase(Exclude const &withtags)
Construct an AqueousPhase object with tags indicating which species must be excluded from the final l...
Definition: Phases.hpp:360
AqueousPhase(Speciate elements, Exclude const &withtags)
Construct an AqueousPhase object with given element symbols and tags indicating which species must be...
Definition: Phases.hpp:357
AqueousPhase(StringList const &species)
Construct an AqueousPhase object with given species names.
Definition: Phases.hpp:351
AqueousPhase()
Construct a default AqueousPhase object.
Definition: Phases.hpp:348
AqueousPhase(Speciate elements)
Construct an AqueousPhase object with given element symbols.
Definition: Phases.hpp:354
The class used to configure a pure condensed phase.
Definition: Phases.hpp:514
CondensedPhase(String species)
Construct a default CondensedPhase object.
Definition: Phases.hpp:517
auto initialize() -> void
Initialize the default attributes of this CondensedPhase object.
Definition: Phases.hpp:520
The class used to configure automatic selection of pure condensed phases.
Definition: Phases.hpp:539
CondensedPhases(StringList const &species)
Construct a CondensedPhases object with given species names.
Definition: Phases.hpp:545
CondensedPhases(Speciate const &elements, Exclude const &withtags)
Construct a CondensedPhases object with given element symbols excluding the species with provided tag...
Definition: Phases.hpp:551
CondensedPhases(Exclude const &withtags)
Construct a CondensedPhases object excluding the species with provided tags.
Definition: Phases.hpp:554
auto initialize() -> void
Initialize the default attributes of this CondensedPhases object.
Definition: Phases.hpp:557
CondensedPhases(Speciate const &elements)
Construct a CondensedPhases object with given element symbols.
Definition: Phases.hpp:548
CondensedPhases()
Construct a default CondensedPhases object.
Definition: Phases.hpp:542
The class used to store and retrieve data of chemical species.
Definition: Database.hpp:32
The class used to configure a gaseous solution phase.
Definition: Phases.hpp:375
GaseousPhase(StringList const &species)
Construct a GaseousPhase object with given species names.
Definition: Phases.hpp:381
GaseousPhase(Speciate const &elements)
Construct a GaseousPhase object with given element symbols.
Definition: Phases.hpp:384
auto initialize() -> void
Initialize the default attributes of this GaseousPhase object.
Definition: Phases.hpp:393
GaseousPhase(Speciate const &elements, Exclude const &withtags)
Construct a GaseousPhase object with given element symbols and tags indicating which species must be ...
Definition: Phases.hpp:387
GaseousPhase()
Construct a default GaseousPhase object.
Definition: Phases.hpp:378
GaseousPhase(Exclude const &withtags)
Construct a GaseousPhase object with tags indicating which species must be excluded from the final li...
Definition: Phases.hpp:390
The base type for all other classes defining more specific phases.
Definition: Phases.hpp:63
auto set(AggregateState option) -> GeneralPhase &
Set the aggregate state of the species in the phase (equivalent to GeneralPhase::setAggregateState).
auto setActivityModel(ActivityModelGenerator const &model) -> GeneralPhase &
Set the activity model of the phase.
auto setAdditionalAggregateStates(Vec< AggregateState > const &options) -> GeneralPhase &
Set additional aggregate states to be considered when searching for species in a database.
GeneralPhase(Exclude const &withtags)
Construct a GeneralPhase object excluding the species with provided tags.
auto convert(Database const &db, Strings const &elements) const -> Phase
Convert this GeneralPhase object into a Phase object.
auto additionalAggregateStates() const -> Vec< AggregateState > const &
Return the additional aggregate states to be considered when searching for species in a database.
auto named(String name) -> GeneralPhase &
Set a unique name of the phase (equivalent to GeneralPhase::setName).
auto set(StateOfMatter option) -> GeneralPhase &
Set the state of matter of the phase (equivalent to GeneralPhase::setStateOfMatter).
auto aggregateState() const -> AggregateState
Return the common aggregate state of the species composing the phase.
auto set(ActivityModelGenerator const &model) -> GeneralPhase &
Set the activity model of the phase (equivalent to GeneralPhase::setActivityModel).
auto activityModel() const -> ActivityModelGenerator const &
Return the specified activity model of the phase.
auto setIdealActivityModel(ActivityModelGenerator const &model) -> GeneralPhase &
Set the ideal activity model of the phase.
auto setStateOfMatter(StateOfMatter option) -> GeneralPhase &
Set the state of matter of the phase.
auto idealActivityModel() const -> ActivityModelGenerator const &
Return the specified ideal activity model of the phase.
GeneralPhase(Speciate const &elements, Exclude const &withtags)
Construct a GeneralPhase object with given element symbols excluding the species with provided tags.
auto species() const -> Strings const &
Return the names of the selected species to compose the phase (empty if not given).
GeneralPhase(StringList const &species)
Construct a GeneralPhase object with given species names.
auto stateOfMatter() const -> StateOfMatter
Return the state of matter of the phase.
GeneralPhase(Speciate const &elements)
Construct a GeneralPhase object with given element symbols.
auto setAggregateState(AggregateState option) -> GeneralPhase &
Set the aggregate state of the species in the phase.
auto elements() const -> Strings const &
Return the element symbols for automatic species selection (empty if not given).
auto setName(String name) -> GeneralPhase &
Set the unique name of the phase.
The base type for a generator of general phases with a single species.
Definition: Phases.hpp:172
auto setActivityModel(ActivityModelGenerator const &model) -> GeneralPhasesGenerator &
Set the common activity model of the generated phases.
auto setStateOfMatter(StateOfMatter option) -> GeneralPhasesGenerator &
Set the common state of matter of the generated phases.
GeneralPhasesGenerator(Exclude const &withtags)
Construct a GeneralPhasesGenerator object excluding the species with provided tags.
auto setAggregateState(AggregateState option) -> GeneralPhasesGenerator &
Set the common aggregate state of the species in the generated phases.
auto set(StateOfMatter option) -> GeneralPhasesGenerator &
Set the common state of matter of the generated phases (equivalent to GeneralPhasesGenerator::setStat...
auto set(AggregateState option) -> GeneralPhasesGenerator &
Set the common aggregate state of the species in the generated phases (equivalent to GeneralPhasesGen...
auto setAdditionalAggregateStates(Vec< AggregateState > const &options) -> GeneralPhasesGenerator &
Set additional aggregate states to be considered when searching for species in a database.
auto setIdealActivityModel(ActivityModelGenerator const &model) -> GeneralPhasesGenerator &
Set the common ideal activity model of the generated phases.
GeneralPhasesGenerator(Speciate const &elements, Exclude const &withtags)
Construct a GeneralPhasesGenerator object with given element symbols excluding the species with provi...
virtual ~GeneralPhasesGenerator()
Destroy this GeneralPhasesGenerator object.
GeneralPhasesGenerator()
Construct a default GeneralPhasesGenerator object.
auto stateOfMatter() const -> StateOfMatter
Return the common state of matter of the generated phases.
auto set(ActivityModelGenerator const &model) -> GeneralPhasesGenerator &
Set the common activity model of the generated phases (equivalent to GeneralPhasesGenerator::setActiv...
GeneralPhasesGenerator(Speciate const &elements)
Construct a GeneralPhasesGenerator object with given element symbols.
GeneralPhasesGenerator(StringList const &species)
Construct a GeneralPhasesGenerator object with given species names.
The class used to configure an ion exchange phase.
Definition: Phases.hpp:575
auto initialize() -> void
Initialize the default attributes of this IonExchangePhase object.
Definition: Phases.hpp:582
IonExchangePhase(StringList const &species)
Construct an IonExchangePhase object with given species names.
Definition: Phases.hpp:579
LiquidPhase(Speciate const &elements)
Construct a LiquidPhase object with given element symbols.
Definition: Phases.hpp:414
LiquidPhase(Speciate const &elements, Exclude const &withtags)
Construct a LiquidPhase object with given element symbols excluding the species with provided tags.
Definition: Phases.hpp:417
LiquidPhase(StringList const &species)
Construct a LiquidPhase object with given species names.
Definition: Phases.hpp:411
auto initialize() -> void
Initialize the default attributes of this LiquidPhase object.
Definition: Phases.hpp:423
LiquidPhase(Exclude const &withtags)
Construct a LiquidPhase object excluding the species with provided tags.
Definition: Phases.hpp:420
LiquidPhase()
Construct a default LiquidPhase object.
Definition: Phases.hpp:408
auto initialize() -> void
Initialize the default attributes of this MineralPhase object.
Definition: Phases.hpp:465
MineralPhase(String mineral)
Construct a default MineralPhase object.
Definition: Phases.hpp:462
The class used to configure automatic selection of pure mineral phases.
Definition: Phases.hpp:481
MineralPhases()
Construct a default MineralPhases object.
Definition: Phases.hpp:484
auto initialize() -> void
Initialize the default attributes of this MineralPhases object.
Definition: Phases.hpp:499
MineralPhases(Speciate const &elements)
Construct a MineralPhases object with given element symbols.
Definition: Phases.hpp:490
MineralPhases(Exclude const &withtags)
Construct a MineralPhases object excluding the species with provided tags.
Definition: Phases.hpp:496
MineralPhases(Speciate const &elements, Exclude const &withtags)
Construct a MineralPhases object with given element symbols excluding the species with provided tags.
Definition: Phases.hpp:493
MineralPhases(StringList const &species)
Construct a MineralPhases object with given species names.
Definition: Phases.hpp:487
The class used to define the phases that will constitute the chemical system of interest.
Definition: Phases.hpp:282
auto add(GeneralPhase const &phase) -> void
Add a GeneralPhase object into the Phases container.
auto add(GeneralPhasesGenerator const &generator) -> void
Add a GeneralPhasesGenerator object into the Phases container.
Phases(Database const &db, GeneralPhases const &... gphases)
Construct a Phases object with given database and general phases.
Definition: Phases.hpp:292
auto database() const -> Database const &
Return the database object used to construct the species and elements in the phases.
auto initialize() -> void
Initialize the default attributes of this SolidPhase object.
Definition: Phases.hpp:441
SolidPhase(StringList const &species)
Construct a SolidPhase object with given species names.
Definition: Phases.hpp:438
A class for representing a list of strings with special constructors.
Definition: StringList.hpp:28
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
AggregateState
The aggregate states of substances according to IUPAC.
Definition: AggregateState.hpp:32
@ LiquidCrystal
for a liquid crystal (crystalline liquid) (symbol lc)
@ CondensedPhase
for either the solid or the liquid state (symbol cd)
@ Aqueous
for a species in a solution in which water is the solvent (symbol aq)
Fn< ActivityModel(SpeciesList const &species)> ActivityModelGenerator
The type for functions that construct an ActivityModel for a phase.
Definition: ActivityModel.hpp:53
constexpr auto areGeneralPhases
Used to determine if T and all types in Ts are either GeneralPhase or GeneralPhaseGenerator.
Definition: Phases.hpp:277
std::vector< std::string > Strings
Convenient alias for std::vector<String>.
Definition: Types.hpp:55
auto ActivityModelIdealSolution(StateOfMatter stateofmatter) -> ActivityModelGenerator
Return the activity model for an ideal solution.
auto ActivityModelIdealGas() -> ActivityModelGenerator
Return the activity model for an ideal gaseous solution.
auto ActivityModelIdealIonExchange() -> ActivityModelGenerator
Return the activity model for the ideal ion exchange.
auto exclude(StringList const &tags) -> Exclude
The function used to specify species that should be filtered out when contructing a phase.
auto speciate(StringList const &substances) -> Speciate
The function used to specify phase species to be determined from element symbols in a list of substan...
StateOfMatter
The list of states of matter for phases.
Definition: StateOfMatter.hpp:27
@ Condensed
when the state of matter of a phase can be either liquid or solid // TODO: StateOfMatter::Condensed n...
auto merge(const Container &a, const Container &b)
Return a container with items from both a and b without duplicates.
Definition: Algorithms.hpp:180
auto ActivityModelIdealAqueous() -> ActivityModelGenerator
Return the activity model for an ideal aqueous solution.
The auxiliary type used to specify species that should be filtered out when contructing a phase.
Definition: Phases.hpp:49
auto operator+=(Strings const &othertags) -> Exclude &
Add other tags symbols into the exclude list.
Definition: Phases.hpp:54
Strings tags
The tags which species cannot have when populating the species in a phase.
Definition: Phases.hpp:51
The auxiliary type used to specify phase species to be determined from element symbols.
Definition: Phases.hpp:36
auto operator+=(Strings const &othersymbols) -> Speciate &
Add other element symbols into the speciation list.
Definition: Phases.hpp:41
Strings symbols
The symbols of the elements composing the species in a phase.
Definition: Phases.hpp:38