Check if there are LGRs only once

This commit is contained in:
Antonella Ritorto committed 2025-06-26 15:28:54 +02:00
1 parent 52e0868ed8
commit aef87b96fa
1 file changed
+5 -6
+5 -6
View File
@@ -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_);