Reaktoro
A unified framework for modeling chemically reactive systems
PhreeqcEditor.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2018 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 <memory>
22 #include <string>
23 #include <vector>
24 
25 namespace Reaktoro {
26 
27 // Forward declarations
28 class ChemicalSystem;
29 class Phreeqc;
30 class StringList;
31 
33 {
34 public:
36  PhreeqcEditor();
37 
40  PhreeqcEditor(std::string database);
41 
43  PhreeqcEditor(const PhreeqcEditor& other);
44 
46  virtual ~PhreeqcEditor();
47 
49  auto operator=(PhreeqcEditor other) -> PhreeqcEditor&;
50 
53  auto setDatabase(std::string database) -> void;
54 
57  auto setAqueousPhase(StringList elements) -> void;
58 
61  auto setGaseousPhase(StringList gases) -> void;
62 
65  auto setMineralPhases(StringList minerals) -> void;
66 
68  operator ChemicalSystem() const;
69 
71  operator Phreeqc() const;
72 
73 private:
74  struct Impl;
75 
76  std::unique_ptr<Impl> pimpl;
77 };
78 
79 } // namespace Reaktoro
A class for representing a list of strings with special constructors.
Definition: StringList.hpp:28
auto setGaseousPhase(StringList gases) -> void
Set the gaseous phase in the system by specifying the end-member gases.
Definition: PhreeqcEditor.cpp:86
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
auto database(std::string name) -> std::string
Return the contents of a built-in database as a string.
Definition: DatabaseUtils.cpp:65
virtual ~PhreeqcEditor()
Destroy this PhreeqcEditor instance.
Definition: PhreeqcEditor.cpp:62
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
Definition: PhreeqcEditor.hpp:33
auto setDatabase(std::string database) -> void
Set the PHREEQC database file to be used by the PhreeqcEditor.
Definition: PhreeqcEditor.cpp:71
auto elements() -> std::vector< std::string >
Return a vector of all known 116 chemical elements.
Definition: ElementUtils.cpp:155
PhreeqcEditor()
Construct a default PhreeqcEditor instance.
Definition: PhreeqcEditor.cpp:47
auto setMineralPhases(StringList minerals) -> void
Set the mineral phases in the system by specifying the names of the pure minerals.
Definition: PhreeqcEditor.cpp:91
Definition: Phreeqc.hpp:32
auto setAqueousPhase(StringList elements) -> void
Set the aqueous species in the system by specifying which elements should exist.
Definition: PhreeqcEditor.cpp:76
auto operator=(PhreeqcEditor other) -> PhreeqcEditor &
Assign another PhreeqcEditor instance to this.
Definition: PhreeqcEditor.cpp:65