From b1c9e3a2cf112ae999a37305b1fac6dbd2492e66 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 1 Mar 2021 16:35:27 +0100 Subject: [PATCH] Add comment about distribution --- ebos/eclcpgridvanguard.hh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ebos/eclcpgridvanguard.hh b/ebos/eclcpgridvanguard.hh index 8a8e296b1..500b2cd3d 100644 --- a/ebos/eclcpgridvanguard.hh +++ b/ebos/eclcpgridvanguard.hh @@ -340,14 +340,22 @@ public: protected: void createGrids_() { + const EclipseGrid * input_grid = nullptr; + std::vector porv; + // At this stage the ParallelEclipseState instance is still in global + // view; on rank 0 we have undistributed data for the entire grid, on + // the other ranks the EclipseState is empty. + if (mpiRank == 0) { + input_grid = &this->eclState().getInputGrid(); + porv = this->eclState().fieldProps().porv(true); + } + grid_.reset(new Dune::CpGrid()); - grid_->processEclipseFormat(mpiRank == 0 ? &this->eclState().getInputGrid() - : nullptr, + grid_->processEclipseFormat(input_grid, /*isPeriodic=*/false, /*flipNormals=*/false, /*clipZ=*/false, - mpiRank == 0 ? this->eclState().fieldProps().porv(true) - : std::vector(), + porv, this->eclState().getInputNNC()); // we use separate grid objects: one for the calculation of the initial condition