All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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_OPM_PARSER
45  explicit GridManager(const Opm::EclipseGrid& inputGrid);
47 
53  GridManager(const Opm::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 #if HAVE_OPM_PARSER
84  static void createGrdecl(const Opm::Deck& deck, struct grdecl &grdecl);
85 #endif
86 
87  private:
88  // Disable copying and assignment.
89  GridManager(const GridManager& other);
90  GridManager& operator=(const GridManager& other);
91 
92 #if HAVE_OPM_PARSER
93  // Construct corner-point grid from EclipseGrid.
94  void initFromEclipseGrid(const Opm::EclipseGrid& inputGrid,
95  const std::vector<double>& poreVolumes);
96 #endif
97 
98  // The managed UnstructuredGrid.
99  UnstructuredGrid* ug_;
100  };
101 
102 } // namespace Opm
103 
104 #endif // OPM_GRIDMANAGER_HEADER_INCLUDED
Raw corner-point specification of a particular geological model.
Definition: preprocess.h:56
~GridManager()
Destructor.
Definition: GridManager.cpp:112
const UnstructuredGrid * c_grid() const
Access the managed UnstructuredGrid.
Definition: GridManager.cpp:123
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: grid.h:98
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:40