swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: e6f7fc96c27af1e4b2bbaf93c86bdb5f3fa97e3d authored by Lars Bilke on 31 August 2021, 10:19:57 UTC
Merge branch 'git-clang-format' into 'master'
Tip revision: e6f7fc9
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