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/parser/eclipse/EclipseState/Schedule/Well/WList.hpp>
27 
28 namespace Opm {
29 
30 class WListManager {
31 public:
32  WListManager() = default;
33 
34  static WListManager serializeObject();
35 
36  std::size_t WListSize() const;
37  bool hasList(const std::string&) const;
38  WList& getList(const std::string& name);
39  const WList& getList(const std::string& name) const;
40  WList& newList(const std::string& name, const std::vector<std::string>& wname);
41 
42  const std::vector<std::string>& getWListNames(const std::string& wname) const;
43  std::size_t getNoWListsWell(std::string wname) const;
44  bool hasWList(const std::string& wname) const;
45  void addWListWell(const std::string& wname, const std::string& wlname);
46  void delWell(const std::string& wname);
47  void delWListWell(const std::string& wname, const std::string& wlname);
48 
49  bool operator==(const WListManager& data) const;
50  std::vector<std::string> wells(const std::string& wlist_pattern) const;
51  template<class Serializer>
52  void serializeOp(Serializer& serializer)
53  {
54  serializer.map(wlists);
55  serializer.template map<std::map<std::string, std::vector<std::string>>, false>(well_wlist_names);
56  serializer.template map<std::map<std::string, std::size_t>, false>(no_wlists_well);
57  }
58 
59 private:
60  std::map<std::string, WList> wlists;
61  std::map<std::string, std::vector<std::string>> well_wlist_names;
62  std::map<std::string, std::size_t> no_wlists_well;
63 };
64 
65 }
66 #endif
Definition: Serializer.hpp:38
Definition: WListManager.hpp:30
Definition: WList.hpp:29
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29