OGS
PropertyType.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
PropertyType.h
"
5
6
#include <boost/algorithm/string/predicate.hpp>
7
8
#include "
BaseLib/Error.h
"
9
10
namespace
MaterialPropertyLib
11
{
12
PropertyType
convertStringToProperty
(std::string
const
&
string
)
13
{
14
for
(
int
i = 0; i < static_cast<int>(
PropertyType::number_of_properties
);
15
++i)
16
{
17
if
(boost::iequals(
string
,
property_enum_to_string
[i]))
18
{
19
return
static_cast<
PropertyType
>
(i);
20
}
21
}
22
23
OGS_FATAL
(
24
"The property name '{:s}' does not correspond to any known property"
,
25
string
);
26
}
27
}
// namespace MaterialPropertyLib
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:19
PropertyType.h
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:98
MaterialPropertyLib::convertStringToProperty
PropertyType convertStringToProperty(std::string const &string)
Definition
PropertyType.cpp:12
MaterialPropertyLib::property_enum_to_string
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition
PropertyType.h:110
MaterialPropertyLib::PropertyType
PropertyType
Definition
PropertyType.h:24
MaterialPropertyLib::number_of_properties
@ number_of_properties
Definition
PropertyType.h:106
MaterialLib
MPL
PropertyType.cpp
Generated by
1.14.0