ECLGraph.hpp
Go to the documentation of this file.
1/*
2 Copyright 2016, 2017 Statoil 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
20#ifndef OPM_ECLGRAPH_HEADER_INCLUDED
21#define OPM_ECLGRAPH_HEADER_INCLUDED
22
26
27#include <array>
28#include <cstddef>
29#include <memory>
30#include <string>
31#include <vector>
32
33#include <boost/filesystem.hpp>
34
40
41extern "C" {
42 struct ecl_grid_struct;
43 typedef ecl_grid_struct ecl_grid_type;
44} // extern "C"
45
46namespace Opm {
47
52 {
53 public:
55 ECLGraph() = delete;
56
59
65
67 ECLGraph(const ECLGraph& rhs) = delete;
68
75
77 ECLGraph& operator=(const ECLGraph& rhs) = delete;
78
96 static ECLGraph
97 load(const boost::filesystem::path& gridFile,
98 const ECLInitFileData& init);
99
100 static ECLGraph
101 load(const ecl_grid_type* grid,
102 const ECLInitFileData& init);
103
107 int numGrids() const;
108
122 int activeCell(const std::array<int,3>& ijk,
123 const std::string& gridID = "") const;
124
126 std::size_t numCells() const;
127
129 std::size_t numCells(const std::string& gridID) const;
130
132 std::size_t numConnections() const;
133
135 std::vector<int> localCellID() const;
136
141 const std::vector<ECLPhaseIndex>& activePhases() const;
142
146 const std::vector<std::string>& activeGrids() const;
147
153 std::vector<int> neighbours() const;
154
160 std::vector<double> poreVolume() const;
161
169 std::vector<double> transmissibility() const;
170
181 std::vector<double>
182 flux(const ECLRestartData& rstrt,
183 const ECLPhaseIndex phase) const;
184
193 template <typename T, class ResultSet>
194 std::vector<T>
195 rawLinearisedCellData(const ResultSet& rset,
196 const std::string& vector) const;
197
210 template <typename T, class ResultSet>
211 std::vector<T>
212 rawLinearisedCellData(const ResultSet& rset,
213 const std::string& vector,
214 const std::string& gridID) const;
215
218 typedef double (ECLUnits::UnitSystem::*UnitConvention)() const;
219
242 std::vector<double>
244 const std::string& vector,
245 UnitConvention unit) const;
246
249 std::array<int, 3> size;
250 std::vector<double> zcorn;
251 std::vector<double> coord;
252 std::vector<int> actnum;
253 };
254
258
259 private:
261 class Impl;
262
263 using ImplPtr = std::unique_ptr<Impl>;
264
266 ECLGraph(ImplPtr pImpl);
267
269 ImplPtr pImpl_;
270 };
271
272} // namespace Opm
273
274#endif // OPM_ECLGRAPH_HEADER_INCLUDED
ecl_grid_struct ecl_grid_type
Definition: ECLGraph.hpp:43
const char *const string
Definition: cJSON.h:170
Definition: ECLGraph.hpp:52
std::vector< int > localCellID() const
Retrieve active cell indices for all global cells in all grids.
const std::vector< ECLPhaseIndex > & activePhases() const
std::size_t numCells() const
Retrieve number of active cells in graph.
int activeCell(const std::array< int, 3 > &ijk, const std::string &gridID="") const
ECLGraph(ECLGraph &&rhs)
std::vector< double > linearisedCellData(const ECLRestartData &rstrt, const std::string &vector, UnitConvention unit) const
std::vector< T > rawLinearisedCellData(const ResultSet &rset, const std::string &vector) const
double(ECLUnits::UnitSystem::* UnitConvention)() const
Definition: ECLGraph.hpp:218
std::vector< double > transmissibility() const
std::size_t numCells(const std::string &gridID) const
Retrieve number of active cells in particular subgrid.
static ECLGraph load(const ecl_grid_type *grid, const ECLInitFileData &init)
ECLGraph()=delete
Disabled default constructor.
std::vector< T > rawLinearisedCellData(const ResultSet &rset, const std::string &vector, const std::string &gridID) const
std::size_t numConnections() const
Retrieve number of connections in graph.
ECLGraph(const ECLGraph &rhs)=delete
Disabled copy constructor.
ECLGraph & operator=(const ECLGraph &rhs)=delete
Disabled assignment operator.
static ECLGraph load(const boost::filesystem::path &gridFile, const ECLInitFileData &init)
ECLGraph & operator=(ECLGraph &&rhs)
const std::vector< std::string > & activeGrids() const
int numGrids() const
const ECLGeometryGrid & getGeometryGrid() const
std::vector< double > flux(const ECLRestartData &rstrt, const ECLPhaseIndex phase) const
~ECLGraph()
Destructor.
std::vector< double > poreVolume() const
std::vector< int > neighbours() const
Definition: ECLResultData.hpp:177
Definition: ECLResultData.hpp:57
std::vector< double > init(const std::string &kewyord, const TableManager &tables, const Phases &phases, const std::vector< double > &cell_depth, const std::vector< int > &num, const std::vector< int > &endnum)
Definition: A.hpp:4
ECLPhaseIndex
Definition: ECLPhaseIndex.hpp:28
Raw grid data (geometric grid) for corner-point grids.
Definition: ECLGraph.hpp:248
std::vector< int > actnum
Definition: ECLGraph.hpp:252
std::vector< double > coord
Definition: ECLGraph.hpp:251
std::vector< double > zcorn
Definition: ECLGraph.hpp:250
std::array< int, 3 > size
Definition: ECLGraph.hpp:249
Definition: ECLUnitHandling.hpp:30