make and use equilGrid only on IO process.

With the change of CPgrid to only holding the grid on one process
it will be an empty grid on all other processes. This has really
strange side effects like Schedule::filterConnections removing all
well perforations on theses processes.
This commit is contained in:
Markus Blatt
2019-10-14 14:32:22 +02:00
parent 5001645d6a
commit 42c20171eb
+16 -7
View File
@@ -244,6 +244,7 @@ public:
int mpiRank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
assert(mpiRank == 0);
assert(equilCartesianIndexMapper_);
#endif
return *equilCartesianIndexMapper_;
}
@@ -280,8 +281,16 @@ protected:
// the initial condition is calculated.
// After loadbalance grid_ will contain a global and distribute view.
// equilGrid_being a shallow copy only the global view.
equilGrid_ = new Dune::CpGrid(*grid_);
equilCartesianIndexMapper_ = new CartesianIndexMapper(*equilGrid_);
if (grid_->size(0))
{
equilGrid_ = new Dune::CpGrid(*grid_);
equilCartesianIndexMapper_ = new CartesianIndexMapper(*equilGrid_);
}
else
{
equilGrid_ = nullptr;
equilCartesianIndexMapper_ = nullptr;
}
globalTrans_ = nullptr;
}
@@ -289,11 +298,11 @@ protected:
// removing some connection located in inactive grid cells
void filterConnections_()
{
assert(grid_);
Grid grid = *grid_;
grid.switchToGlobalView();
const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(grid, this->eclState().getInputGrid());
this->schedule().filterConnections(eclipseGrid);
if (equilGrid_)
{
const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(equilGrid(), this->eclState().getInputGrid());
this->schedule().filterConnections(eclipseGrid);
}
}
Grid* grid_;