swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: 5ae119f15068d4d29baa6003848a26ff785f043f authored by Dmitri Naumov on 13 March 2021, 15:51:21 UTC
[BL] clang-format of previous change set.
Tip revision: 5ae119f
SourceTerm.cpp
/**
 * \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
 *
 *
 */

#include "SourceTerm.h"

namespace DataHolderLib
{
SourceTerm::SourceTerm(ProcessVariable const& process_var,
                       std::string const& param_name, ConditionType type)
    : FemCondition(process_var, param_name), _type(type)
{
}

SourceTerm::ConditionType SourceTerm::convertStringToType(
    std::string const& str)
{
    if (str == "Nodal")
    {
        return ConditionType::NODAL;
    }
    if (str == "Volume")
    {
        return ConditionType::VOLUME;
    }

    return ConditionType::NONE;
}

std::string SourceTerm::convertTypeToString(ConditionType type)
{
    if (type == ConditionType::NODAL)
    {
        return "Nodal";
    }
    if (type == ConditionType::VOLUME)
    {
        return "Volume";
    }

    return "";
}

}  // namespace DataHolderLib
back to top