Use the ParallelEclipseState and ParallelFieldPropsManager

with these in place, we now only parse the deck on the root process.
This commit is contained in:
Arne Morten Kvarving
2020-01-24 12:30:22 +01:00
parent 68a9d17de1
commit 05c0c4b6e8
3 changed files with 40 additions and 11 deletions

View File

@@ -33,6 +33,7 @@
#include <opm/grid/CpGrid.hpp>
#include <opm/grid/cpgrid/GridHelpers.hpp>
#include <opm/simulators/utils/ParallelEclipseState.hpp>
#include <dune/grid/common/mcmgmapper.hh>
@@ -206,8 +207,18 @@ public:
#endif
cartesianIndexMapper_.reset(new CartesianIndexMapper(*grid_));
this->updateGridView_();
if (mpiSize > 1) {
std::vector<int> cartIndices;
cartIndices.reserve(grid_->numCells());
auto locElemIt = this->gridView().template begin</*codim=*/0>();
const auto& locElemEndIt = this->gridView().template end</*codim=*/0>();
for (; locElemIt != locElemEndIt; ++locElemIt) {
cartIndices.push_back(cartesianIndexMapper_->cartesianIndex(locElemIt->index()));
}
static_cast<ParallelEclipseState&>(this->eclState()).setupLocalProps(cartIndices);
static_cast<ParallelEclipseState&>(this->eclState()).switchToDistributedProps();
}
}
/*!