Revision d8578eb2733b2485be9f478c238cf74452966209 authored by renchao_lu on 30 April 2021, 14:04:44 UTC, committed by Dmitry Yu. Naumov on 01 May 2021, 12:51:18 UTC
1 parent a4d2d05
VariableType.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 "VariableType.h"
#include <boost/algorithm/string/predicate.hpp>
#include "BaseLib/Error.h"
namespace MaterialPropertyLib
{
Variable convertStringToVariable(std::string const& input)
{
if (boost::iequals(input, "concentration"))
{
return Variable::concentration;
}
if (boost::iequals(input, "phase_pressure"))
{
return Variable::phase_pressure;
}
if (boost::iequals(input, "capillary_pressure"))
{
return Variable::capillary_pressure;
}
if (boost::iequals(input, "density"))
{
return Variable::density;
}
if (boost::iequals(input, "equivalent_plastic_strain"))
{
return Variable::equivalent_plastic_strain;
}
if (boost::iequals(input, "temperature"))
{
return Variable::temperature;
}
if (boost::iequals(input, "molar_mass"))
{
return Variable::molar_mass;
}
if (boost::iequals(input, "liquid_saturation"))
{
return Variable::liquid_saturation;
}
if (boost::iequals(input, "displacement"))
{
return Variable::displacement;
}
if (boost::iequals(input, "grain_compressibility"))
{
return Variable::grain_compressibility;
}
if (boost::iequals(input, "solid_grain_pressure"))
{
return Variable::solid_grain_pressure;
}
if (boost::iequals(input, "vapour_pressure"))
{
return Variable::vapour_pressure;
}
OGS_FATAL(
"The variable name '{:s}' does not correspond to any known variable",
input);
return Variable::number_of_variables; // to avoid the 'no return' warning
}
} // namespace MaterialPropertyLib
Computing file changes ...