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