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