swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: 9477ea5f4ef8ea3b617a17cacaaab8da9c52af8a authored by Norbert Grunwald on 09 September 2021, 12:46:32 UTC
update reference files
Tip revision: 9477ea5
BoundaryCondition.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 "BoundaryCondition.h"

namespace DataHolderLib
{
/// Managing data associated with a boundary condition
BoundaryCondition::BoundaryCondition(ProcessVariable const& process_var,
                                     std::string const& param_name,
                                     ConditionType type)
    : FemCondition(process_var, param_name), _type(type)
{
}

BoundaryCondition::ConditionType BoundaryCondition::convertStringToType(
    std::string const& str)
{
    if (str == "Dirichlet")
    {
        return ConditionType::DIRICHLET;
    }
    if (str == "Neumann")
    {
        return ConditionType::NEUMANN;
    }
    if (str == "Robin")
    {
        return ConditionType::ROBIN;
    }

    return ConditionType::NONE;
}

std::string BoundaryCondition::convertTypeToString(ConditionType type)
{
    if (type == ConditionType::DIRICHLET)
    {
        return "Dirichlet";
    }
    if (type == ConditionType::NEUMANN)
    {
        return "Neumann";
    }
    if (type == ConditionType::ROBIN)
    {
        return "Robin";
    }

    return "";
}

}  // namespace DataHolderLib
back to top