swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: 3d6fdd8f952a4af3ef0b8e0a6643b2c300388e01 authored by wenqing on 16 September 2020, 14:38:09 UTC
Merge branch 'Test_Wenqing_3BHEarray' into 'apply_the_known_solutions_to_init'
Tip revision: 3d6fdd8
UserPunch.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "UserPunch.h"
#include "BaseLib/ConfigTreeUtil.h"

namespace ChemistryLib
{
namespace PhreeqcIOData
{
std::ostream& operator<<(std::ostream& os, UserPunch const& user_punch)
{
    os << "USER_PUNCH" << "\n";
    os << "-headings ";
    auto const& secondary_variables = user_punch.secondary_variables;
    for (auto& secondary_variable : secondary_variables)
    {
        os << secondary_variable.name << " ";
    }
    os << "\n";

    os << "-start" << "\n";
    int line_number = 1;
    for (auto const& statement : user_punch.statements)
    {
        os << line_number << " " << statement << "\n";
        ++line_number;
    }
    os << "-end" << "\n";

    return os;
}
}  // namespace PhreeqcIOData
}  // namespace ChemistryLib
back to top