Revert "define fluxes and max fluxes as class members"

This reverts commit d218697c3bc7769c285d8f1e865bf0bd20cf2299.
This commit is contained in:
Max Lübke 2023-09-05 09:04:37 +02:00 committed by Max Lübke
parent 3a2769b1f6
commit 7187582910
2 changed files with 2 additions and 25 deletions

View File

@ -107,6 +107,8 @@ void AdvectionModule::simulate(double dt) {
flux[i] = flux_2d;
}
MSG("Advection time step requested: " + std::to_string(dt));
std::vector<double> max_fluxes(flux.size());
for (std::size_t i = 0; i < max_fluxes.size(); i++) {
std::array<double, 4> abs_flux;
@ -116,8 +118,6 @@ void AdvectionModule::simulate(double dt) {
max_fluxes[i] = *std::max_element(abs_flux.begin(), abs_flux.end());
}
MSG("Advection time step requested: " + std::to_string(dt));
const auto time_vec = CFLTimeVec(dt, max_fluxes);
MSG("CFL yielding " + std::to_string(time_vec.size()) + " inner iterations");
@ -215,24 +215,6 @@ void AdvectionModule::initializeParams(RInsidePOET &R) {
}
this->t_field = Field(field_size, init_field, prop_names);
// FIXME: this should be done before each iteration
const auto flux_list =
Rcpp::as<Rcpp::DataFrame>(R.parseEval("mysetup$advection$const_flux"));
this->flux.resize(flux_list.size());
for (std::size_t i = 0; i < flux_list.size(); i++) {
const auto flux_2d = Rcpp::as<std::vector<double>>(flux_list[i]);
this->flux[i] = flux_2d;
}
this->max_fluxes.resize(flux.size());
for (std::size_t i = 0; i < max_fluxes.size(); i++) {
std::array<double, 4> abs_flux;
for (std::size_t j = 0; j < abs_flux.size(); j++) {
abs_flux[j] = std::abs(flux[i][j]);
}
this->max_fluxes[i] = *std::max_element(abs_flux.begin(), abs_flux.end());
}
}
} // namespace poet

View File

@ -95,11 +95,6 @@ private:
std::map<std::uint32_t, std::vector<double>> inactive_cells;
std::vector<double> boundary_condition;
// FIXME: This will be removed in the future and is now only intended for
// speed purposes
std::vector<double> max_fluxes;
std::vector<std::vector<double>> flux;
Field t_field;
/**