OGS
ChemistryLib::PhreeqcIOData::UserPunch Struct Reference

Detailed Description

Definition at line 35 of file UserPunch.h.

#include <UserPunch.h>

Public Member Functions

 UserPunch (std::vector< SecondaryVariable > &&secondary_variables_, std::vector< std::string > &&statements_)
void initialize (std::size_t const num_chemical_systems)

Public Attributes

std::vector< SecondaryVariablesecondary_variables
std::vector< std::string > const statements

Friends

std::ostream & operator<< (std::ostream &os, UserPunch const &user_punch)

Constructor & Destructor Documentation

◆ UserPunch()

ChemistryLib::PhreeqcIOData::UserPunch::UserPunch ( std::vector< SecondaryVariable > && secondary_variables_,
std::vector< std::string > && statements_ )
inline

Definition at line 37 of file UserPunch.h.

39 : secondary_variables(std::move(secondary_variables_)),
40 statements(std::move(statements_))
41 {
42 }
std::vector< SecondaryVariable > secondary_variables
Definition UserPunch.h:49
std::vector< std::string > const statements
Definition UserPunch.h:50

References secondary_variables, and statements.

Referenced by operator<<.

Member Function Documentation

◆ initialize()

void ChemistryLib::PhreeqcIOData::UserPunch::initialize ( std::size_t const num_chemical_systems)

Definition at line 12 of file UserPunch.cpp.

13{
14 for (auto& secondary_variable : secondary_variables)
15 {
16 secondary_variable.value->resize(num_chemical_systems);
17 }
18}

References secondary_variables.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
UserPunch const & user_punch )
friend

Definition at line 20 of file UserPunch.cpp.

21{
22 os << "USER_PUNCH"
23 << "\n";
24 os << "-headings ";
25 auto const& secondary_variables = user_punch.secondary_variables;
26 for (auto const& secondary_variable : secondary_variables)
27 {
28 os << secondary_variable.name << " ";
29 }
30 os << "\n";
31
32 os << "-start"
33 << "\n";
34 int line_number = 1;
35 for (auto const& statement : user_punch.statements)
36 {
37 os << line_number << " " << statement << "\n";
38 ++line_number;
39 }
40 os << "-end"
41 << "\n";
42
43 return os;
44}

References UserPunch(), secondary_variables, and statements.

Member Data Documentation

◆ secondary_variables

std::vector<SecondaryVariable> ChemistryLib::PhreeqcIOData::UserPunch::secondary_variables

Definition at line 49 of file UserPunch.h.

Referenced by UserPunch(), initialize(), and operator<<.

◆ statements

std::vector<std::string> const ChemistryLib::PhreeqcIOData::UserPunch::statements

Definition at line 50 of file UserPunch.h.

Referenced by UserPunch(), and operator<<.


The documentation for this struct was generated from the following files: