changed: avoid usage of equilGrid on non-root processes

This commit is contained in:
Arne Morten Kvarving
2019-09-11 08:05:36 +02:00
committed by Markus Blatt
parent 40f91b0e32
commit 7efbee9fb0
2 changed files with 33 additions and 22 deletions

View File

@@ -119,7 +119,12 @@ public:
* same as the grid which is used for the actual simulation.
*/
const EquilGrid& equilGrid() const
{ return *equilGrid_; }
{
int mpiRank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
assert(mpiRank == 0);
return *equilGrid_;
}
/*!
* \brief Indicates that the initial condition has been computed and the memory used
@@ -232,7 +237,12 @@ public:
* \brief Returns mapper from compressed to cartesian indices for the EQUIL grid
*/
const CartesianIndexMapper& equilCartesianIndexMapper() const
{ return *equilCartesianIndexMapper_; }
{
int mpiRank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
assert(mpiRank == 0);
return *equilCartesianIndexMapper_;
}
std::unordered_set<std::string> defunctWellNames() const
{ return defunctWellNames_; }