mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Compare commits
5 Commits
fb44cdd679
...
8fd537b6a5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fd537b6a5 | ||
|
|
29fbbc657b | ||
|
|
e1ee3f801a | ||
|
|
f3444ab2fa | ||
|
|
6b0bc8aaff |
@ -8,9 +8,6 @@ ExchangeWrapper::ExchangeCompWrapper::ExchangeCompWrapper(cxxExchComp &comp)
|
|||||||
|
|
||||||
void ExchangeWrapper::ExchangeCompWrapper::get(
|
void ExchangeWrapper::ExchangeCompWrapper::get(
|
||||||
std::span<LDBLE> &exchange) const {
|
std::span<LDBLE> &exchange) const {
|
||||||
|
|
||||||
std::size_t exch_index = this->NUM_NOT_TOTALS;
|
|
||||||
|
|
||||||
exchange[0] = exch_comp.Get_totals().find(exch_comp.Get_formula())->second;
|
exchange[0] = exch_comp.Get_totals().find(exch_comp.Get_formula())->second;
|
||||||
exchange[1] = exch_comp.Get_charge_balance();
|
exchange[1] = exch_comp.Get_charge_balance();
|
||||||
exchange[2] = exch_comp.Get_la();
|
exchange[2] = exch_comp.Get_la();
|
||||||
@ -19,16 +16,15 @@ void ExchangeWrapper::ExchangeCompWrapper::get(
|
|||||||
|
|
||||||
for (const auto &[name, value] : exch_comp.Get_totals()) {
|
for (const auto &[name, value] : exch_comp.Get_totals()) {
|
||||||
if (name != exch_comp.Get_formula()) {
|
if (name != exch_comp.Get_formula()) {
|
||||||
exchange[exch_index++] = value;
|
exchange[NUM_NOT_TOTALS +
|
||||||
|
std::distance(exch_comp.Get_totals().begin(),
|
||||||
|
exch_comp.Get_totals().find(name))] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExchangeWrapper::ExchangeCompWrapper::set(
|
void ExchangeWrapper::ExchangeCompWrapper::set(
|
||||||
const std::span<LDBLE> &exchange) {
|
const std::span<LDBLE> &exchange) {
|
||||||
|
|
||||||
std::size_t exch_index = this->NUM_NOT_TOTALS;
|
|
||||||
|
|
||||||
exch_comp.Get_totals().find(exch_comp.Get_formula())->second = exchange[0];
|
exch_comp.Get_totals().find(exch_comp.Get_formula())->second = exchange[0];
|
||||||
exch_comp.Set_charge_balance(exchange[1]);
|
exch_comp.Set_charge_balance(exchange[1]);
|
||||||
exch_comp.Set_la(exchange[2]);
|
exch_comp.Set_la(exchange[2]);
|
||||||
@ -37,7 +33,9 @@ void ExchangeWrapper::ExchangeCompWrapper::set(
|
|||||||
|
|
||||||
for (auto &[name, value] : exch_comp.Get_totals()) {
|
for (auto &[name, value] : exch_comp.Get_totals()) {
|
||||||
if (name != exch_comp.Get_formula()) {
|
if (name != exch_comp.Get_formula()) {
|
||||||
value = exchange[exch_index++];
|
value = exchange[NUM_NOT_TOTALS +
|
||||||
|
std::distance(exch_comp.Get_totals().begin(),
|
||||||
|
exch_comp.Get_totals().find(name))];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user