mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-15 12:28:22 +01:00
feat(grid): enable cell_ID integration in chemistry data flow
This commit is contained in:
parent
15e397ecf2
commit
9f1d69982d
@ -60,6 +60,9 @@ pqc_to_grid <- function(pqc_mat, grid) {
|
||||
# Convert the result matrix to a data frame
|
||||
res_df <- as.data.frame(result_mat)
|
||||
|
||||
# Add cell_ID column to beginning of res_df
|
||||
res_df <- cbind(cell_ID = seq(0, nrow(res_df) - 1), res_df)
|
||||
|
||||
# Remove all columns which only contain NaN
|
||||
# res_df <- res_df[, colSums(is.na(res_df)) != nrow(res_df)]
|
||||
|
||||
|
||||
@ -428,14 +428,23 @@ namespace poet
|
||||
{
|
||||
to_ignore.push_back(wp_id);
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: remove the first element (cell_id) before sending to phreeqc
|
||||
inout_chem[wp_id].erase(
|
||||
inout_chem[wp_id].begin(), inout_chem[wp_id].begin() + 1);
|
||||
}
|
||||
|
||||
this->pqc_runner->run(inout_chem, dTimestep, to_ignore);
|
||||
|
||||
for (std::size_t wp_id = 0; wp_id < work_package.size; wp_id++)
|
||||
{
|
||||
if (work_package.mapping[wp_id] == CHEM_PQC)
|
||||
{
|
||||
work_package.output[wp_id] = inout_chem[wp_id];
|
||||
// HACK: as we removed the first element (cell_id) before sending to phreeqc,
|
||||
// copy back with an offset of 1
|
||||
work_package.output[wp_id] = work_package.input[wp_id];
|
||||
std::copy(inout_chem[wp_id].begin(), inout_chem[wp_id].end(),
|
||||
work_package.output[wp_id].begin() + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user