My Project
WListManager.hpp
1 /*
2  Copyright 2019 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 #ifndef WLISTMANAGER_HPP
20 #define WLISTMANAGER_HPP
21 
22 #include <cstddef>
23 #include <map>
24 #include <vector>
25 #include <string>
26 #include <opm/input/eclipse/Schedule/Well/WList.hpp>
27 
28 namespace Opm {
29 
30 namespace RestartIO {
31 struct RstState;
32 }
33 
34 class WListManager {
35 public:
36  WListManager() = default;
37  explicit WListManager(const RestartIO::RstState& rst_state);
38  static WListManager serializeObject();
39 
40  std::size_t WListSize() const;
41  bool hasList(const std::string&) const;
42  WList& getList(const std::string& name);
43  const WList& getList(const std::string& name) const;
44  WList& newList(const std::string& name, const std::vector<std::string>& wname);
45 
46  const std::vector<std::string>& getWListNames(const std::string& wname) const;
47  std::size_t getNoWListsWell(std::string wname) const;
48  bool hasWList(const std::string& wname) const;
49  void addWListWell(const std::string& wname, const std::string& wlname);
50  void delWell(const std::string& wname);
51  void delWListWell(const std::string& wname, const std::string& wlname);
52 
53  bool operator==(const WListManager& data) const;
54  std::vector<std::string> wells(const std::string& wlist_pattern) const;
55  template<class Serializer>
56  void serializeOp(Serializer& serializer)
57  {
58  serializer.map(wlists);
59  serializer.template map<std::map<std::string, std::vector<std::string>>, false>(well_wlist_names);
60  serializer.template map<std::map<std::string, std::size_t>, false>(no_wlists_well);
61  }
62 
63 private:
64  std::map<std::string, WList> wlists;
65  std::map<std::string, std::vector<std::string>> well_wlist_names;
66  std::map<std::string, std::size_t> no_wlists_well;
67 };
68 
69 }
70 #endif
Definition: Serializer.hpp:38
Definition: WListManager.hpp:34
Definition: WList.hpp:29
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: state.hpp:51