OGS
CreateChargeBalance.cpp
Go to the documentation of this file.
1
11
#include "
CreateChargeBalance.h
"
12
13
#include "
BaseLib/ConfigTree.h
"
14
#include "
BaseLib/Error.h
"
15
#include "
ChargeBalance.h
"
16
17
namespace
ChemistryLib
18
{
19
ChargeBalance
createChargeBalance
(
BaseLib::ConfigTree
const
& config)
20
{
21
auto
const
charge_balance =
23
config.
getConfigParameterOptional
<std::string>(
"charge_balance"
);
24
25
if
(!charge_balance)
26
{
27
return
ChargeBalance::Unspecified
;
28
}
29
if
(*charge_balance ==
"pH"
)
30
{
31
return
ChargeBalance::pH
;
32
}
33
if
(*charge_balance ==
"pe"
)
34
{
35
return
ChargeBalance::pe
;
36
}
37
38
OGS_FATAL
(
39
"Error in specifying the way in which charge balance is achieved. "
40
"Adjusting pH value or pe value are supported at this moment."
);
41
}
42
}
// namespace ChemistryLib
ChargeBalance.h
ConfigTree.h
CreateChargeBalance.h
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
BaseLib::ConfigTree
Definition
ConfigTree.h:107
BaseLib::ConfigTree::getConfigParameterOptional
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
Definition
ConfigTree-impl.h:64
ChemistryLib
Definition
ChemicalSolverInterface.h:31
ChemistryLib::ChargeBalance
ChargeBalance
Definition
ChargeBalance.h:16
ChemistryLib::ChargeBalance::pH
@ pH
ChemistryLib::ChargeBalance::Unspecified
@ Unspecified
ChemistryLib::ChargeBalance::pe
@ pe
ChemistryLib::createChargeBalance
ChargeBalance createChargeBalance(BaseLib::ConfigTree const &config)
Definition
CreateChargeBalance.cpp:19
ChemistryLib
Common
CreateChargeBalance.cpp
Generated by
1.12.0