mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
Add module sizes
This commit is contained in:
parent
f3f86bb4ac
commit
54136c8e0c
@ -9,11 +9,15 @@
|
||||
#include <Surface.h>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cxxKinetics.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
#include <vector>
|
||||
|
||||
enum { POET_SOL = 0, POET_EXCH, POET_KIN, POET_EQUIL, POET_SURF };
|
||||
|
||||
class IPhreeqcPOET : public IPhreeqc {
|
||||
public:
|
||||
std::vector<double>
|
||||
@ -48,6 +52,7 @@ public:
|
||||
|
||||
std::vector<int> getSolutionIds() const { return this->solution_ids; }
|
||||
|
||||
|
||||
std::map<int, std::string> raw_dumps() {
|
||||
std::map<int, std::string> dumps;
|
||||
|
||||
@ -62,6 +67,17 @@ public:
|
||||
return dumps;
|
||||
}
|
||||
|
||||
using ModulesArray = std::array<std::uint32_t, 5>;
|
||||
|
||||
ModulesArray getModuleSizes() const {
|
||||
ModulesArray module_sizes;
|
||||
for (std::uint8_t i = 0; i < 5; i++) {
|
||||
module_sizes[i] = this->initial_names[i].size();
|
||||
}
|
||||
|
||||
return module_sizes;
|
||||
}
|
||||
|
||||
private:
|
||||
using essential_names = std::array<std::vector<std::string>, 5>;
|
||||
|
||||
|
||||
@ -44,15 +44,15 @@ void IPhreeqcPOET::valuesFromModule(const std::string &module_name,
|
||||
std::size_t dest_module_i = 0;
|
||||
std::vector<double> to_insert;
|
||||
if (module_name == "exchange") { // 1
|
||||
this->Get_exchange(cell_number)->dump_essential_names(names[1]);
|
||||
this->Get_exchange(cell_number)->dump_essential_names(names[POET_EXCH]);
|
||||
this->Get_exchange(cell_number)->get_essential_values(to_insert);
|
||||
dest_module_i = 1;
|
||||
} else if (module_name == "kinetics") { // 2
|
||||
this->Get_kinetic(cell_number)->dump_essential_names(names[2]);
|
||||
this->Get_kinetic(cell_number)->dump_essential_names(names[POET_KIN]);
|
||||
this->Get_kinetic(cell_number)->get_essential_values(to_insert);
|
||||
dest_module_i = 2;
|
||||
} else if (module_name == "surface") { // 4
|
||||
this->Get_surface(cell_number)->dump_essential_names(names[4]);
|
||||
this->Get_surface(cell_number)->dump_essential_names(names[POET_SURF]);
|
||||
this->Get_surface(cell_number)->get_essential_values(to_insert);
|
||||
dest_module_i = 4;
|
||||
}
|
||||
@ -191,31 +191,31 @@ IPhreeqcPOET::dump_essential_names(std::size_t cell_number) {
|
||||
|
||||
// Solutions
|
||||
if (this->Get_solution(cell_number) != NULL) {
|
||||
std::vector<std::string> &eSolNames = eNames[0];
|
||||
std::vector<std::string> &eSolNames = eNames[POET_SOL];
|
||||
this->Get_solution(cell_number)->dump_essential_names(eSolNames);
|
||||
}
|
||||
|
||||
// Exchange
|
||||
if (this->Get_exchange(cell_number) != NULL) {
|
||||
std::vector<std::string> &eExchNames = eNames[1];
|
||||
std::vector<std::string> &eExchNames = eNames[POET_EXCH];
|
||||
this->Get_exchange(cell_number)->dump_essential_names(eExchNames);
|
||||
}
|
||||
|
||||
// Kinetics
|
||||
if (this->Get_kinetic(cell_number) != NULL) {
|
||||
std::vector<std::string> &eKinNames = eNames[2];
|
||||
std::vector<std::string> &eKinNames = eNames[POET_KIN];
|
||||
this->Get_kinetic(cell_number)->dump_essential_names(eKinNames);
|
||||
}
|
||||
|
||||
// PPassemblage
|
||||
if (this->Get_equilibrium(cell_number) != NULL) {
|
||||
std::vector<std::string> &eEquNames = eNames[3];
|
||||
std::vector<std::string> &eEquNames = eNames[POET_EQUIL];
|
||||
this->Get_equilibrium(cell_number)->dump_essential_names(eEquNames);
|
||||
}
|
||||
|
||||
// Surface
|
||||
if (this->Get_surface(cell_number) != NULL) {
|
||||
std::vector<std::string> &eSurfNames = eNames[4];
|
||||
std::vector<std::string> &eSurfNames = eNames[POET_SURF];
|
||||
this->Get_surface(cell_number)->dump_essential_names(eSurfNames);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user