My Project
Node.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 
21 #ifndef NETWORK_NODE_HPP
22 #define NETWORK_NODE_HPP
23 
24 #include <optional>
25 #include <string>
26 
27 namespace Opm {
28 namespace Network {
29 
30 class Node {
31 public:
32  Node() = default;
33  Node(const std::string& name);
34 
35  const std::string& name() const;
36  const std::optional<double>& terminal_pressure() const;
37  bool as_choke() const;
38  bool add_gas_lift_gas() const;
39  const std::optional<std::string>& target_group() const;
40 
41  void terminal_pressure(double pressure);
42  void add_gas_lift_gas(bool add_gas);
43  void as_choke(const std::string& target_group);
44 
45  static Node serializeObject();
46  bool operator==(const Node& other) const;
47 
48  template<class Serializer>
49  void serializeOp(Serializer& serializer)
50  {
51  serializer(m_name);
52  serializer(m_terminal_pressure);
53  serializer(m_add_gas_lift_gas);
54  serializer(m_choke_target_group);
55  }
56 private:
57  std::string m_name;
58  std::optional<double> m_terminal_pressure;
59  std::optional<std::string> m_choke_target_group;
60  bool m_add_gas_lift_gas = false;
61 };
62 }
63 }
64 #endif
Definition: Node.hpp:30
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29