swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: ef7566fb95c11afb18df954f8f446b264f49328c authored by Wenqing Wang on 14 April 2021, 15:09:49 UTC
[Web] Added a description of "A test with nodal source term"
Tip revision: ef7566f
UserPunch.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#pragma once

#include <iosfwd>
#include <string>
#include <vector>

#include "MeshLib/PropertyVector.h"
#include "Output.h"

namespace BaseLib
{
class ConfigTree;
}

namespace ChemistryLib
{
namespace PhreeqcIOData
{
struct SecondaryVariable
{
    SecondaryVariable(std::string name_,
                      MeshLib::PropertyVector<double>* value_)
        : name(std::move(name_)), value(value_)
    {
    }

    std::string const name;
    MeshLib::PropertyVector<double>* value;
    static const ItemType item_type = ItemType::SecondaryVariable;
};

struct UserPunch
{
    UserPunch(std::vector<SecondaryVariable>&& secondary_variables_,
              std::vector<std::string>&& statements_)
        : secondary_variables(std::move(secondary_variables_)),
          statements(std::move(statements_))
    {
    }

    void initialize(std::size_t const num_chemical_systems);

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

    std::vector<SecondaryVariable> secondary_variables;
    std::vector<std::string> const statements;
};
}  // namespace PhreeqcIOData
}  // namespace ChemistryLib
back to top