My Project
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 <opm/grid/utility/OpmParserIncludes.hpp>
24 
25 #include <string>
26 
27 struct UnstructuredGrid;
28 struct grdecl;
29 
30 namespace Opm
31 {
41  {
42  public:
43 
44 #if HAVE_ECL_INPUT
46  explicit GridManager(const EclipseGrid& inputGrid);
47 
53  GridManager(const EclipseGrid& inputGrid,
54  const std::vector<double>& poreVolumes);
55 #endif
56 
58  GridManager(int nx, int ny);
59 
61  GridManager(int nx, int ny, double dx, double dy);
62 
64  GridManager(int nx, int ny, int nz);
65 
67  GridManager(int nx, int ny, int nz,
68  double dx, double dy, double dz);
69 
73  explicit GridManager(const std::string& input_filename);
74 
76  ~GridManager();
77 
81  const UnstructuredGrid* c_grid() const;
82 
83  private:
84  // Disable copying and assignment.
85  GridManager(const GridManager& other);
86  GridManager& operator=(const GridManager& other);
87 
88 #if HAVE_ECL_INPUT
89  // Construct corner-point grid from EclipseGrid.
90  void initFromEclipseGrid(const EclipseGrid& inputGrid,
91  const std::vector<double>& poreVolumes);
92 #endif
93 
94  // The managed UnstructuredGrid.
95  UnstructuredGrid* ug_;
96  };
97 
98 } // namespace Opm
99 
100 #endif // OPM_GRIDMANAGER_HEADER_INCLUDED
This class manages an Opm::UnstructuredGrid in the sense that it encapsulates creation and destructio...
Definition: GridManager.hpp:41
GridManager(int nx, int ny)
Construct a 2d cartesian grid with cells of unit size.
Definition: GridManager.cpp:58
const UnstructuredGrid * c_grid() const
Access the managed UnstructuredGrid.
Definition: GridManager.cpp:123
~GridManager()
Destructor.
Definition: GridManager.cpp:112
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.hpp:29
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: UnstructuredGrid.h:99
Raw corner-point specification of a particular geological model.
Definition: preprocess.h:56