opm-grid
GridManager.hpp
1 /*
2  Copyright 2012 SINTEF ICT, Applied Mathematics.
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 
20 #ifndef OPM_GRIDMANAGER_HEADER_INCLUDED
21 #define OPM_GRIDMANAGER_HEADER_INCLUDED
22 
23 #include <string>
24 #include <vector>
25 
26 struct UnstructuredGrid;
27 struct grdecl;
28 
29 namespace Opm
30 {
31 
32 #if HAVE_OPM_COMMON
33 class EclipseGrid;
34 #endif
35 
45  {
46  public:
47 
48 #if HAVE_OPM_COMMON
49  explicit GridManager(const EclipseGrid& inputGrid,
51  bool edge_conformal = false);
52 
58  GridManager(const EclipseGrid& inputGrid,
59  const std::vector<double>& poreVolumes,
60  bool edge_conformal);
61 #endif
62 
64  GridManager(int nx, int ny);
65 
67  GridManager(int nx, int ny, double dx, double dy);
68 
70  GridManager(int nx, int ny, int nz);
71 
73  GridManager(int nx, int ny, int nz,
74  double dx, double dy, double dz);
75 
79  explicit GridManager(const std::string& input_filename);
80 
82  ~GridManager();
83 
87  const UnstructuredGrid* c_grid() const;
88 
89  private:
90  // Disable copying and assignment.
91  GridManager(const GridManager& other) = delete;
92  GridManager& operator=(const GridManager& other) = delete;
93 
94 #if HAVE_OPM_COMMON
95  // Construct corner-point grid from EclipseGrid.
96  void initFromEclipseGrid(const EclipseGrid& inputGrid,
97  const std::vector<double>& poreVolumes,
98  bool edge_conformal);
99 #endif
100 
101  // The managed UnstructuredGrid.
102  UnstructuredGrid* ug_;
103  };
104 
105 } // namespace Opm
106 
107 #endif // OPM_GRIDMANAGER_HEADER_INCLUDED
Raw corner-point specification of a particular geological model.
Definition: preprocess.h:56
~GridManager()
Destructor.
Definition: GridManager.cpp:113
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.cpp:71
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: UnstructuredGrid.h:100
const UnstructuredGrid * c_grid() const
Access the managed UnstructuredGrid.
Definition: GridManager.cpp:124
GridManager(int nx, int ny)
Construct a 2d cartesian grid with cells of unit size.
Definition: GridManager.cpp:58
This class manages an Opm::UnstructuredGrid in the sense that it encapsulates creation and destructio...
Definition: GridManager.hpp:44