My Project
SummaryNode.hpp
1 /*
2  Copyright 2020 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_IO_SUMMARYNODE_HPP
21 #define OPM_IO_SUMMARYNODE_HPP
22 
23 #include <functional>
24 #include <optional>
25 #include <string>
26 #include <unordered_set>
27 #include <array>
28 #include <limits>
29 
30 namespace Opm { namespace EclIO {
31 
32  struct lgr_info {
33  std::string name;
34  std::array<int, 3> ijk;
35  };
36 
37 struct SummaryNode {
38  enum class Category {
39  Well,
40  Group,
41  Field,
42  Region,
43  Block,
44  Connection,
45  Segment,
46  Aquifer,
47  Node,
48  Miscellaneous,
49  };
50 
51  enum class Type {
52  Rate,
53  Total,
54  Ratio,
55  Pressure,
56  Count,
57  Mode,
58  ProdIndex,
59  Undefined,
60  };
61 
62 
63  std::string keyword;
64  Category category;
65  Type type;
66  std::string wgname;
67  int number;
68  std::optional<std::string> fip_region;
69  std::optional<lgr_info> lgr;
70 
71  constexpr static int default_number { std::numeric_limits<int>::min() };
72 
73  std::string unique_key() const;
74 
75  using number_renderer = std::function<std::string(const SummaryNode&)>;
76  std::string unique_key(number_renderer) const;
77 
78  bool is_user_defined() const;
79 
80  static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
81 
82  std::optional<std::string> display_name() const;
83  std::optional<std::string> display_number() const;
84  std::optional<std::string> display_number(number_renderer) const;
85 };
86 
87 }} // namespace Opm::EclIO
88 
89 #endif // OPM_IO_SUMMARYNODE_HPP
Definition: Connection.hpp:43
Definition: Group.hpp:44
Definition: Segment.hpp:63
Definition: Well.hpp:75
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: SummaryNode.hpp:37
Definition: SummaryNode.hpp:32