From 756988da3142c7ff285ed52fb46aba4acf232d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20L=C3=BCbke?= Date: Thu, 21 Mar 2024 21:36:09 +0000 Subject: [PATCH] Add support for importing and exporting initial grid in InitialList class --- src/Init/InitialList.cpp | 4 ++++ src/Init/InitialList.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Init/InitialList.cpp b/src/Init/InitialList.cpp index aa66f71a6..0931c34f3 100644 --- a/src/Init/InitialList.cpp +++ b/src/Init/InitialList.cpp @@ -31,6 +31,9 @@ void InitialList::importList(const Rcpp::List &setup) { this->porosity = Rcpp::as>( setup[static_cast(ExportList::GRID_POROSITY)]); + this->initial_grid = + Rcpp::List(setup[static_cast(ExportList::GRID_INITIAL)]); + this->transport_names = Rcpp::as>( setup[static_cast(ExportList::DIFFU_TRANSPORT)]); this->boundaries = @@ -61,6 +64,7 @@ Rcpp::List InitialList::exportList() { out[static_cast(ExportList::GRID_CONSTANT)] = Rcpp::wrap(this->constant_cells); out[static_cast(ExportList::GRID_POROSITY)] = Rcpp::wrap(this->porosity); + out[static_cast(ExportList::GRID_INITIAL)] = this->initial_grid; out[static_cast(ExportList::DIFFU_TRANSPORT)] = Rcpp::wrap(this->transport_names); diff --git a/src/Init/InitialList.hpp b/src/Init/InitialList.hpp index 060fc19a0..7a97bbead 100644 --- a/src/Init/InitialList.hpp +++ b/src/Init/InitialList.hpp @@ -35,6 +35,7 @@ private: GRID_SPATIAL, GRID_CONSTANT, GRID_POROSITY, + GRID_INITIAL, DIFFU_TRANSPORT, DIFFU_BOUNDARIES, DIFFU_ALPHA_X,