From 15588fe7ca313a8eb04c8a3d934a97aa777f8259 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Wed, 7 Sep 2016 16:09:19 +0200 Subject: [PATCH] Added EclipseGrid::allActive() convenience method. --- opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp | 4 ++++ opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp index 518e48ceb..7920d415d 100644 --- a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp +++ b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp @@ -574,6 +574,10 @@ namespace Opm { return static_cast(ecl_grid_get_nactive( c_ptr() )); } + bool EclipseGrid::allActive( ) const { + return (getNumActive() == getCartesianSize()); + } + bool EclipseGrid::cellActive( size_t globalIndex ) const { assertGlobalIndex( globalIndex ); return ecl_grid_cell_active1( c_ptr() , static_cast(globalIndex)); diff --git a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp index 7942aeae2..ccf4f7e0b 100644 --- a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp +++ b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp @@ -83,6 +83,7 @@ namespace Opm { static bool hasCornerPointKeywords(const Deck&); static bool hasCartesianKeywords(const Deck&); size_t getNumActive( ) const; + bool allActive() const; size_t activeIndex(size_t i, size_t j, size_t k) const; size_t activeIndex(size_t globalIndex) const;