mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use the ParallelEclipseState and ParallelFieldPropsManager
with these in place, we now only parse the deck on the root process.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user