OGS
AqueousSolution.cpp
Go to the documentation of this file.
1
11#include "AqueousSolution.h"
12
13#include <cmath>
14#include <ostream>
15
19
20namespace ChemistryLib
21{
22namespace PhreeqcIOData
23{
24void AqueousSolution::print(std::ostream& os,
25 std::size_t const chemical_system_id) const
26{
27 os << "temp " << temperature << "\n";
28
29 os << "pressure " << pressure << "\n";
30
32 switch (charge_balance)
33 {
35 os << "pH " << -std::log10((*pH)[chemical_system_id]) << " charge"
36 << "\n";
37 os << "pe " << (*pe)[chemical_system_id] << "\n";
38 break;
40 os << "pH " << -std::log10((*pH)[chemical_system_id]) << "\n";
41 os << "pe " << (*pe)[chemical_system_id] << " charge"
42 << "\n";
43 break;
45 os << "pH " << -std::log10((*pH)[chemical_system_id]) << "\n";
46 os << "pe " << (*pe)[chemical_system_id] << "\n";
47 break;
48 }
49
50 os << "units mol/kgw\n";
51
52 for (auto const& component : components)
53 {
55 os << component.name << " " << (*component.amount)[chemical_system_id];
56 component.chemical_formula.empty()
57 ? os << "\n"
58 : os << " as " << component.chemical_formula << "\n";
59 }
60
61 os << "\n\n";
62}
63} // namespace PhreeqcIOData
64} // namespace ChemistryLib
void setLocalAccessibleVector(PETScVector const &x)
Definition LinAlg.cpp:27
void print(std::ostream &os, std::size_t const chemical_system_id) const