From 58ac8f2553492a6895e6bfab69c46c220d0299ef Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 18 Nov 2024 11:03:47 +0100 Subject: [PATCH] setPrimaryVarsDomain: take domain index as parameter --- opm/simulators/flow/BlackoilModelNldd.hpp | 4 ++-- opm/simulators/wells/BlackoilWellModel.hpp | 2 +- opm/simulators/wells/BlackoilWellModel_impl.hpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opm/simulators/flow/BlackoilModelNldd.hpp b/opm/simulators/flow/BlackoilModelNldd.hpp index 3ba2b2e07..1ee045655 100644 --- a/opm/simulators/flow/BlackoilModelNldd.hpp +++ b/opm/simulators/flow/BlackoilModelNldd.hpp @@ -825,7 +825,7 @@ private: Details::setGlobal(initial_local_solution, domain.cells, solution); model_.simulator().model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0, domain); } else { - model_.wellModel().setPrimaryVarsDomain(domain, initial_local_well_primary_vars); + model_.wellModel().setPrimaryVarsDomain(domain.index, initial_local_well_primary_vars); Details::setGlobal(initial_local_solution, domain.cells, solution); model_.simulator().model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0, domain); } @@ -881,7 +881,7 @@ private: auto local_solution = Details::extractVector(solution, domain.cells); Details::setGlobal(local_solution, domain.cells, locally_solved); } else { - model_.wellModel().setPrimaryVarsDomain(domain, initial_local_well_primary_vars); + model_.wellModel().setPrimaryVarsDomain(domain.index, initial_local_well_primary_vars); Details::setGlobal(initial_local_solution, domain.cells, solution); model_.simulator().model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0, domain); } diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index afaebb5bd..30cff149e 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -389,7 +389,7 @@ template class WellContributions; void logPrimaryVars() const; std::vector getPrimaryVarsDomain(const int domainIdx) const; - void setPrimaryVarsDomain(const Domain& domain, const std::vector& vars); + void setPrimaryVarsDomain(const int domainIdx, const std::vector& vars); void setupDomains(const std::vector& domains); diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 4c224e474..a725d2a57 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -3024,11 +3024,11 @@ namespace Opm { template void BlackoilWellModel:: - setPrimaryVarsDomain(const Domain& domain, const std::vector& vars) + setPrimaryVarsDomain(const int domainIdx, const std::vector& vars) { std::size_t offset = 0; for (auto& well : well_container_) { - if (well_domain_.at(well->name()) == domain.index) { + if (this->well_domain_.at(well->name()) == domainIdx) { int num_pri_vars = well->setPrimaryVars(vars.begin() + offset); offset += num_pri_vars; }