OGS
UserPunch.cpp
Go to the documentation of this file.
1
11#include "UserPunch.h"
12
14
15namespace ChemistryLib
16{
17namespace PhreeqcIOData
18{
19void UserPunch::initialize(std::size_t const num_chemical_systems)
20{
21 for (auto& secondary_variable : secondary_variables)
22 {
23 secondary_variable.value->resize(num_chemical_systems);
24 }
25}
26
27std::ostream& operator<<(std::ostream& os, UserPunch const& user_punch)
28{
29 os << "USER_PUNCH"
30 << "\n";
31 os << "-headings ";
32 auto const& secondary_variables = user_punch.secondary_variables;
33 for (auto const& secondary_variable : secondary_variables)
34 {
35 os << secondary_variable.name << " ";
36 }
37 os << "\n";
38
39 os << "-start"
40 << "\n";
41 int line_number = 1;
42 for (auto const& statement : user_punch.statements)
43 {
44 os << line_number << " " << statement << "\n";
45 ++line_number;
46 }
47 os << "-end"
48 << "\n";
49
50 return os;
51}
52} // namespace PhreeqcIOData
53} // namespace ChemistryLib
std::ostream & operator<<(std::ostream &os, PhreeqcIO const &phreeqc_io)
void initialize(std::size_t const num_chemical_systems)
Definition UserPunch.cpp:19
std::vector< SecondaryVariable > secondary_variables
Definition UserPunch.h:56
std::vector< std::string > const statements
Definition UserPunch.h:57