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
10namespace MaterialPropertyLib
11{
12PropertyType 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
24 "The property name '{:s}' does not correspond to any known property",
25 string);
26}
27} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
PropertyType convertStringToProperty(std::string const &string)
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string