My Project
RestartFileView.hpp
1 /*
2  Copyright 2021 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 
20 #ifndef OPM_RESTART_FILE_VIEW_HPP
21 #define OPM_RESTART_FILE_VIEW_HPP
22 
23 #include <cstddef>
24 #include <memory>
25 #include <vector>
26 
27 namespace Opm { namespace EclIO {
28  class ERst;
29 }} // Opm::EclIO
30 
31 namespace Opm { namespace EclIO {
32 
34 {
35 public:
36  explicit RestartFileView(std::shared_ptr<ERst> restart_file,
37  const int report_step);
38 
39  ~RestartFileView();
40 
41  RestartFileView(const RestartFileView& rhs) = delete;
43 
44  RestartFileView& operator=(const RestartFileView& rhs) = delete;
45  RestartFileView& operator=(RestartFileView&& rhs);
46 
47  std::size_t simStep() const;
48  int reportStep() const;
49 
50  int occurrenceCount(const std::string& vector) const;
51 
52  template <typename ElmType>
53  bool hasKeyword(const std::string& vector) const;
54 
55  template <typename ElmType>
56  const std::vector<ElmType>&
57  getKeyword(const std::string& vector, const int occurrence = 0) const;
58 
59  const std::vector<int>& intehead() const;
60  const std::vector<bool>& logihead() const;
61  const std::vector<double>& doubhead() const;
62 
63 private:
64  class Implementation;
65  std::unique_ptr<Implementation> pImpl_;
66 };
67 
68 }} // Opm::RestartIO
69 
70 #endif // OPM_RESTART_FILE_VIEW_HPP
Definition: RestartFileView.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29