Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
NamingUtils.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2024 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <string>
22 #include <vector>
23 #include <cctype>
24 
25 namespace Reaktoro {
26 
29 auto alternativeWaterNames() -> std::vector<std::string>;
30 
36 auto alternativeChargedSpeciesNames(std::string name) -> std::vector<std::string>&;
37 
42 auto alternativeNeutralSpeciesNames(std::string name) -> std::vector<std::string>&;
43 
45 auto conventionalWaterName() -> std::string;
46 
52 auto conventionalChargedSpeciesName(std::string name) -> std::string;
53 
59 auto conventionalNeutralSpeciesName(std::string name) -> std::string;
60 
63 auto isAlternativeWaterName(std::string trial) -> bool;
64 
68 auto isAlternativeChargedSpeciesName(std::string trial, std::string name) -> bool;
69 
73 auto isAlternativeNeutralSpeciesName(std::string trial, std::string name) -> bool;
74 
79 auto splitChargedSpeciesName(std::string name) -> std::pair<std::string, double>;
80 
85 auto baseNameChargedSpecies(std::string name) -> std::string;
86 
89 auto baseNameNeutralSpecies(std::string name) -> std::string;
90 
95 auto chargeInSpeciesName(std::string name) -> double;
96 
111 auto splitSpeciesNameSuffix(std::string name) -> std::pair<std::string, std::string>;
112 
113 } // namespace Reaktoro
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
auto isAlternativeWaterName(std::string trial) -> bool
Return true if a trial name is an alternative to a water species name.
auto splitChargedSpeciesName(std::string name) -> std::pair< std::string, double >
Return a pair with the base name of a charged species and its electrical charge.
auto alternativeNeutralSpeciesNames(std::string name) -> std::vector< std::string > &
Return a collection of alternative names to the given neutral species name.
auto conventionalNeutralSpeciesName(std::string name) -> std::string
Return the conventional neutral species name adopted in Reaktoro.
auto alternativeWaterNames() -> std::vector< std::string >
Return a collection of alternative names to the given species name.
auto splitSpeciesNameSuffix(std::string name) -> std::pair< std::string, std::string >
Split name and suffix from a substance name or chemical formula.
auto isAlternativeChargedSpeciesName(std::string trial, std::string name) -> bool
Return true if a trial name is an alternative to a given charged species name.
auto conventionalWaterName() -> std::string
Return the conventional water name, which is H2O(l).
auto chargeInSpeciesName(std::string name) -> double
Return the electrical charge in a species name.
auto baseNameChargedSpecies(std::string name) -> std::string
Return the name of a charged species without charge suffix.
auto conventionalChargedSpeciesName(std::string name) -> std::string
Return the conventional charged species name adopted in Reaktoro.
auto baseNameNeutralSpecies(std::string name) -> std::string
Return the name of a neutral species without suffix (aq).
auto alternativeChargedSpeciesNames(std::string name) -> std::vector< std::string > &
Return a collection of alternative names to the given charged species name.
auto isAlternativeNeutralSpeciesName(std::string trial, std::string name) -> bool
Return true if a trial name is an alternative to a given neutral species name.