OGS
PropertyType.cpp
Go to the documentation of this file.
1
10
#include "
PropertyType.h
"
11
12
#include <boost/algorithm/string/predicate.hpp>
13
14
#include "
BaseLib/Error.h
"
15
16
namespace
MaterialPropertyLib
17
{
18
PropertyType
convertStringToProperty
(std::string
const
&
string
)
19
{
20
for
(
int
i = 0; i < static_cast<int>(
PropertyType::number_of_properties
);
21
++i)
22
{
23
if
(boost::iequals(
string
,
property_enum_to_string
[i]))
24
{
25
return
static_cast<
PropertyType
>
(i);
26
}
27
}
28
29
OGS_FATAL
(
30
"The property name '{:s}' does not correspond to any known property"
,
31
string
);
32
}
33
}
// namespace MaterialPropertyLib
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
PropertyType.h
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:21
MaterialPropertyLib::convertStringToProperty
PropertyType convertStringToProperty(std::string const &string)
Definition
PropertyType.cpp:18
MaterialPropertyLib::property_enum_to_string
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition
PropertyType.h:119
MaterialPropertyLib::PropertyType
PropertyType
Definition
PropertyType.h:33
MaterialPropertyLib::number_of_properties
@ number_of_properties
Definition
PropertyType.h:115
MaterialLib
MPL
PropertyType.cpp
Generated by
1.10.0