OGS
CreateChargeBalance.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
5
7#include "BaseLib/Error.h"
8#include "ChargeBalance.h"
9
10namespace ChemistryLib
11{
13{
14 auto const charge_balance =
16 config.getConfigParameterOptional<std::string>("charge_balance");
17
18 if (!charge_balance)
19 {
21 }
22 if (*charge_balance == "pH")
23 {
24 return ChargeBalance::pH;
25 }
26 if (*charge_balance == "pe")
27 {
28 return ChargeBalance::pe;
29 }
30
32 "Error in specifying the way in which charge balance is achieved. "
33 "Adjusting pH value or pe value are supported at this moment.");
34}
35} // namespace ChemistryLib
#define OGS_FATAL(...)
Definition Error.h:19
std::optional< T > getConfigParameterOptional(std::string const &param) const
ChargeBalance createChargeBalance(BaseLib::ConfigTree const &config)