Add total_grid_cells to ChemistryInit struct

This commit is contained in:
Max Luebke 2024-03-21 22:33:40 +00:00
parent 756988da31
commit d3632156a5
4 changed files with 28 additions and 20 deletions

View File

@ -6,6 +6,8 @@ InitialList::ChemistryInit InitialList::getChemistryInit() const {
chem_init.initial_grid = Field(initial_grid);
chem_init.total_grid_cells = this->n_cols * this->n_rows;
chem_init.database = database;
chem_init.pqc_scripts = pqc_scripts;
chem_init.pqc_ids = pqc_ids;

View File

@ -174,4 +174,27 @@ void InitialList::initDiffusion(const Rcpp::List &diffusion_input) {
// R.parseEval("print(alpha_x)");
// R.parseEval("print(alpha_y)");
}
InitialList::DiffusionInit InitialList::getDiffusionInit() const {
DiffusionInit diff_init;
diff_init.dim = this->dim;
diff_init.n_cols = this->n_cols;
diff_init.n_rows = this->n_rows;
diff_init.s_cols = this->s_cols;
diff_init.s_rows = this->s_rows;
diff_init.constant_cells = this->constant_cells;
diff_init.transport_names = this->transport_names;
diff_init.initial_grid = Field(this->initial_grid);
diff_init.boundaries = Field(this->boundaries);
diff_init.alpha_x = Field(this->alpha_x);
diff_init.alpha_y = Field(this->alpha_y);
return diff_init;
}
} // namespace poet

View File

@ -179,24 +179,4 @@ void InitialList::initGrid(const Rcpp::List &grid_input) {
}
}
InitialList::DiffusionInit InitialList::getDiffusionInit() const {
DiffusionInit diff_init;
diff_init.n_cols = this->n_cols;
diff_init.n_rows = this->n_rows;
diff_init.s_cols = this->s_cols;
diff_init.s_rows = this->s_rows;
diff_init.constant_cells = this->constant_cells;
diff_init.transport_names = this->transport_names;
diff_init.initial_grid = Field(this->initial_grid);
diff_init.boundaries = Field(this->boundaries);
diff_init.alpha_x = Field(this->alpha_x);
diff_init.alpha_y = Field(this->alpha_y);
return diff_init;
}
} // namespace poet

View File

@ -93,6 +93,7 @@ private:
public:
struct DiffusionInit {
uint8_t dim;
std::uint32_t n_cols;
std::uint32_t n_rows;
@ -152,6 +153,8 @@ public:
struct ChemistryInit {
Field initial_grid;
uint32_t total_grid_cells;
std::string database;
std::vector<std::string> pqc_scripts;
std::vector<int> pqc_ids;