opm-common
Loading...
Searching...
No Matches
WList.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 WLIST_HPP
20#define WLIST_HPP
21
22#include <cstddef>
23#include <string>
24#include <unordered_set>
25#include <vector>
26
27namespace Opm {
28
29class WList
30{
31public:
32 using storage = std::vector<std::string>;
33
34 WList() = default;
35 WList(const storage& wlist, const std::string& wlname);
36
37 std::size_t size() const;
38
40 bool empty() const { return this->size() == 0; }
41
42 void clear();
43
44 void add(const std::string& well);
45 void del(const std::string& well);
46 bool has(const std::string& well) const;
47 const std::string& getName() const { return this->name; }
48
49 const std::vector<std::string>& wells() const;
50 bool operator==(const WList& data) const;
51
52 template<class Serializer>
53 void serializeOp(Serializer& serializer)
54 {
55 serializer(well_list);
56 serializer(name);
57 }
58
59private:
60 storage well_list;
61 std::string name;
62};
63
64} // namespace Opm
65
66#endif // WLIST_HPP
bool empty() const
Predicate for an empty list.
Definition WList.hpp:40
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
bool has(const std::string &name) const
This method checks if there is something with name name in the parameter gropup.