00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OPM_CREATE_GLOBAL_CELL_ARRAY_HPP
00020 #define OPM_CREATE_GLOBAL_CELL_ARRAY_HPP
00021
00022 #include <opm/autodiff/GridHelpers.hpp>
00023
00024 namespace Opm
00025 {
00030 template <class Grid>
00031 void createGlobalCellArray(const Grid &grid, std::vector<int>& dest)
00032 {
00033 int numCells = Opm::UgGridHelpers::numCells(grid);
00034 dest.resize(numCells);
00035 const auto& globalCell = Opm::UgGridHelpers::globalCell(grid);
00036 std::vector<int> compressedToCartesianIdx(numCells);
00037 for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
00038 if (globalCell) {
00039 dest[cellIdx] = globalCell[cellIdx];
00040 }
00041 else {
00042 dest[cellIdx] = cellIdx;
00043 }
00044 }
00045
00046 }
00047 }
00048
00049 #endif