24#ifndef OPM_COUNTGLOBALCELLS_HEADER_INCLUDED
25#define OPM_COUNTGLOBALCELLS_HEADER_INCLUDED
27#include <dune/grid/common/gridview.hh>
44 template <
class Gr
idView>
45 std::size_t countLocalInteriorCellsGridView(
const GridView& gridView)
47 if (gridView.comm().size() == 1) {
48 return gridView.size(0);
51 return std::distance(gridView.template begin<0, Dune::Interior_Partition>(),
52 gridView.template end<0, Dune::Interior_Partition>());
64 std::size_t countLocalInteriorCells(
const Grid& grid)
66 return countLocalInteriorCellsGridView(grid.leafGridView());
80 std::size_t countGlobalCells(
const Grid& grid)
82 if ( grid.comm().size() == 1)
86 const std::size_t count = countLocalInteriorCellsGridView(grid.leafGridView());
87 return grid.comm().sum(count);
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43