diff --git a/opm/output/eclipse/RegionCache.hpp b/opm/output/eclipse/RegionCache.hpp index 9287ebef6..a132e2b6a 100644 --- a/opm/output/eclipse/RegionCache.hpp +++ b/opm/output/eclipse/RegionCache.hpp @@ -23,7 +23,6 @@ #include namespace Opm { - class Eclipse3DProperties; class Schedule; class EclipseGrid; @@ -31,7 +30,7 @@ namespace out { class RegionCache { public: RegionCache() = default; - RegionCache(const Eclipse3DProperties& properties, const EclipseGrid& grid, const Schedule& schedule); + RegionCache(const std::vector& fipnum, const EclipseGrid& grid, const Schedule& schedule); const std::vector>& connections( int region_id ) const; private: diff --git a/src/opm/output/eclipse/RegionCache.cpp b/src/opm/output/eclipse/RegionCache.cpp index e2f0abedf..f5b14e7ba 100644 --- a/src/opm/output/eclipse/RegionCache.cpp +++ b/src/opm/output/eclipse/RegionCache.cpp @@ -30,17 +30,15 @@ namespace Opm { namespace out { -RegionCache::RegionCache(const Eclipse3DProperties& properties, const EclipseGrid& grid, const Schedule& schedule) { - const auto& fipnum_data = properties.getIntGridProperty("FIPNUM").getData(); +RegionCache::RegionCache(const std::vector& fipnum, const EclipseGrid& grid, const Schedule& schedule) { const auto& wells = schedule.getWellsatEnd(); for (const auto& well : wells) { const auto& connections = well.getConnections( ); for (const auto& c : connections) { - size_t global_index = grid.getGlobalIndex( c.getI() , c.getJ() , c.getK()); - if (grid.cellActive( global_index )) { - size_t active_index = grid.activeIndex( global_index ); - int region_id = fipnum_data[global_index]; + if (grid.cellActive(c.getI(), c.getJ(), c.getK())) { + size_t active_index = grid.activeIndex(c.getI(), c.getJ(), c.getK()); + int region_id = fipnum[active_index]; auto& well_index_list = this->connection_map[ region_id ]; well_index_list.push_back( { well.name() , active_index } ); } diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index e10ac7b62..3196207a6 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -2052,7 +2052,11 @@ SummaryImplementation(const EclipseState& es, const Schedule& sched, const std::string& basename) : grid_ (std::cref(grid)) - , regCache_ (es.get3DProperties(), grid, sched) +#ifdef ENABLE_3DPROPS_TESTING + , regCache_ (es.get3DProperties().getIntGridProperty("FIPNUM").compressedCopy(grid), grid, sched) +#else + , regCache_ (es.fieldProps().get("FIPNMUM"), grid, sched) +#endif , deferredSMSpec_(makeDeferredSMSpecCreation(es, grid, sched)) , rset_ (makeResultSet(es.cfg().io(), basename)) , fmt_ { es.cfg().io().getFMTOUT() } diff --git a/tests/test_regionCache.cpp b/tests/test_regionCache.cpp index 506dfe4c5..ae177ae57 100644 --- a/tests/test_regionCache.cpp +++ b/tests/test_regionCache.cpp @@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(create) { EclipseState es(deck); const EclipseGrid& grid = es.getInputGrid(); Schedule schedule( deck, es); - out::RegionCache rc(es.get3DProperties() , grid, schedule); + out::RegionCache rc(es.get3DProperties().getIntGridProperty("FIPNUM").compressedCopy(grid) , grid, schedule); { const auto& empty = rc.connections( 4 );