Move the if-serial run into CpGridVanguard::addLgrs(), warn if parallel

This commit is contained in:
Antonella Ritorto committed 2025-05-07 16:50:31 +02:00
1 parent faea69fdb2
commit bdfafbd5cd
2 files changed
+8 -7

No files matched your search

+4 -6
View File
@@ -139,17 +139,15 @@ public:
OPM_END_PARALLEL_TRY_CATCH("Could not distribute the vanguard data: ", comm);
}
// Only relevant for CpGrid
// Only relevant for CpGrid and serial runs.
if (verbose_) {
std::cout << "Adding LGRs, if any, in serial run\n" << std::flush;
}
{
if ( comm.size() == 1 ) { // serial run
OPM_BEGIN_PARALLEL_TRY_CATCH();
vanguard_->addLgrs();
OPM_END_PARALLEL_TRY_CATCH("Adding LGRs to the simulation vanguard in serial run failed: ", comm);
}
OPM_BEGIN_PARALLEL_TRY_CATCH();
vanguard_->addLgrs();
OPM_END_PARALLEL_TRY_CATCH("Adding LGRs to the simulation vanguard in serial run failed: ", comm);
}
if (verbose_) {
+4 -1
View File
@@ -255,7 +255,7 @@ public:
// Check if input file contains Lgrs.
//
// If there are lgrs, create the grid with them, and update the leaf grid view.
if (const auto& lgrs = this->eclState().getLgrs(); lgrs.size() > 0) {
if (const auto& lgrs = this->eclState().getLgrs(); (lgrs.size() > 0) && (this->grid_->comm().size() == 1)) {
OpmLog::info("\nAdding LGRs to the grid and updating its leaf grid view");
this->addLgrsUpdateLeafView(lgrs, lgrs.size(), *this->grid_);
@@ -263,6 +263,9 @@ public:
this->updateCellDepths_();
this->updateCellThickness_();
}
else {
Opm::OpmLog::warning("Adding LGRs in parallel run is not supported yet.\n");
}
}
unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const {