From aef87b96fa1b71cfa86996c51ace4cdfcac1aa6a Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Thu, 26 Jun 2025 15:28:54 +0200 Subject: [PATCH] Check if there are LGRs only once --- opm/simulators/flow/CpGridVanguard.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/opm/simulators/flow/CpGridVanguard.hpp b/opm/simulators/flow/CpGridVanguard.hpp index 0bece90db5..8cf1980de5 100644 --- a/opm/simulators/flow/CpGridVanguard.hpp +++ b/opm/simulators/flow/CpGridVanguard.hpp @@ -272,12 +272,11 @@ public: this->updateGridView_(); this->updateCellDepths_(); this->updateCellThickness_(); - } - if (this->grid_->comm().size()>1) { - // Add LGRs and update the leaf grid view in the global (undistributed) simulation grid. - // Purpose: To enable synchronization of cell ids in 'serial mode', - // we rely on the "parent-to-children" cell id mapping. - if (const auto& lgrs = this->eclState().getLgrs(); lgrs.size() > 0) { + + if (this->grid_->comm().size()>1) { + // Add LGRs and update the leaf grid view in the global (undistributed) simulation grid. + // Purpose: To enable synchronization of cell ids in 'serial mode', + // we rely on the "parent-to-children" cell id mapping. OpmLog::info("\nAdding LGRs to the global view and updating its leaf grid view"); this->grid_->switchToGlobalView(); this->addLgrsUpdateLeafView(lgrs, lgrs.size(), *this->grid_);