My Project
ActiveGridCells.hpp
1 /*
2  Copyright 2019 Equinor ASA
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef ACTIVEGRIDCELLS_HPP
20 #define ACTIVEGRIDCELLS_HPP
21 
22 #include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
23 
24 #include <array>
25 
26 namespace Opm
27 {
28 
34  : public GridDims
35 {
36 public:
42  ActiveGridCells(std::array<int, 3> xyz,
43  const int* globalCell, std::size_t nc);
44 
52  ActiveGridCells(std::size_t nx, std::size_t ny, std::size_t nz,
53  const int* globalCell, std::size_t nc);
54 
55  bool cellActive(std::size_t i, std::size_t j, std::size_t k) const;
56 
57  bool cellActive(std::size_t cartesianIndex) const;
58 
59  std::vector<int> actNum() const;
60 
64  int localCell(std::size_t cartesianIndex) const;
65 
71  int localCell(std::size_t i, std::size_t j, std::size_t k) const;
72 protected:
76  std::vector<int> localCell_;
77 };
78 } // end namespace Opm
79 #endif // ACTIVEGRIDCELLS_HPP
Simple class capturing active cells of a grid.
Definition: ActiveGridCells.hpp:35
int localCell(std::size_t i, std::size_t j, std::size_t k) const
Get the local index of a cell.
ActiveGridCells(std::array< int, 3 > xyz, const int *globalCell, std::size_t nc)
Constructs mapping of active cells.
ActiveGridCells(std::size_t nx, std::size_t ny, std::size_t nz, const int *globalCell, std::size_t nc)
Constructs mapping of active cells.
int localCell(std::size_t cartesianIndex) const
Get the local index of a cell.
std::vector< int > localCell_
Maps the cartesian index to a compressed local index.
Definition: ActiveGridCells.hpp:76
Definition: GridDims.hpp:32
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29