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
17namespace ChemistryLib
18{
20{
21 auto const charge_balance =
23 config.getConfigParameterOptional<std::string>("charge_balance");
24
25 if (!charge_balance)
26 {
28 }
29 if (*charge_balance == "pH")
30 {
31 return ChargeBalance::pH;
32 }
33 if (*charge_balance == "pe")
34 {
35 return ChargeBalance::pe;
36 }
37
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
#define OGS_FATAL(...)
Definition Error.h:26
std::optional< T > getConfigParameterOptional(std::string const &param) const
ChargeBalance createChargeBalance(BaseLib::ConfigTree const &config)