opm-common
WelSegsSet.hpp
1 /*
2  Copyright 2013 Statoil 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 WEL_SEGS_SET_HPP
20 #define WEL_SEGS_SET_HPP
21 
22 #include <opm/common/OpmLog/KeywordLocation.hpp>
23 
24 #include <set>
25 #include <string>
26 #include <utility>
27 #include <vector>
28 
29 namespace Opm {
30 
31 class Well;
32 
34 {
35 public:
36  using Entry = std::pair<std::string,KeywordLocation>;
37 
38  void insert(const std::string& well_name,
39  const KeywordLocation& location);
40 
41  std::vector<Entry> difference(const std::set<std::string>& compsegs,
42  const std::vector<Well>& wells) const;
43  std::vector<Entry> intersection(const std::set<std::string>& compsegs,
44  const std::set<std::string>& comptraj) const;
45 
46 private:
47  struct PairComp
48  {
49  bool operator()(const Entry& pair, const std::string& str) const;
50  bool operator()(const Entry& pair1, const Entry& pair2) const;
51  bool operator()(const std::string& str, const Entry& pair) const;
52  };
53 
54  std::set<Entry,PairComp> entries_;
55 };
56 
57 } // end namespace Opm
58 
59 #endif // WEL_SEGS_SET_HPP
Definition: KeywordLocation.hpp:27
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: WelSegsSet.hpp:33