Add support for importing and exporting initial grid in InitialList class

This commit is contained in:
Max Lübke 2024-03-21 21:36:09 +00:00
parent 5d4a05fe9b
commit d8dddf14f2
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,9 @@ void InitialList::importList(const Rcpp::List &setup) {
this->porosity = Rcpp::as<std::vector<double>>(
setup[static_cast<int>(ExportList::GRID_POROSITY)]);
this->initial_grid =
Rcpp::List(setup[static_cast<int>(ExportList::GRID_INITIAL)]);
this->transport_names = Rcpp::as<std::vector<std::string>>(
setup[static_cast<int>(ExportList::DIFFU_TRANSPORT)]);
this->boundaries =
@ -61,6 +64,7 @@ Rcpp::List InitialList::exportList() {
out[static_cast<int>(ExportList::GRID_CONSTANT)] =
Rcpp::wrap(this->constant_cells);
out[static_cast<int>(ExportList::GRID_POROSITY)] = Rcpp::wrap(this->porosity);
out[static_cast<int>(ExportList::GRID_INITIAL)] = this->initial_grid;
out[static_cast<int>(ExportList::DIFFU_TRANSPORT)] =
Rcpp::wrap(this->transport_names);

View File

@ -35,6 +35,7 @@ private:
GRID_SPATIAL,
GRID_CONSTANT,
GRID_POROSITY,
GRID_INITIAL,
DIFFU_TRANSPORT,
DIFFU_BOUNDARIES,
DIFFU_ALPHA_X,