My Project
BCConfig.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 #ifndef OPM_BCCONFIG_HPP
21 #define OPM_BCCONFIG_HPP
22 
23 #include <vector>
24 #include <cstddef>
25 
26 #include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
27 
28 
29 namespace Opm {
30 
31 class Deck;
32 class DeckRecord;
33 
34 enum class BCType {
35  RATE,
36  FREE
37 };
38 
39 enum class BCComponent {
40  OIL,
41  GAS,
42  WATER,
43  SOLVENT,
44  POLYMER,
45  NONE
46 };
47 
48 
49 class BCConfig {
50 public:
51 
52  struct BCFace {
53  int i1,i2;
54  int j1,j2;
55  int k1,k2;
56  BCType bctype;
57  FaceDir::DirEnum dir;
58  BCComponent component;
59  double rate;
60 
61  BCFace() = default;
62  explicit BCFace(const DeckRecord& record);
63 
64  static BCFace serializeObject();
65 
66  bool operator==(const BCFace& other) const;
67 
68  template<class Serializer>
69  void serializeOp(Serializer& serializer)
70  {
71  serializer(i1);
72  serializer(i2);
73  serializer(j1);
74  serializer(j2);
75  serializer(k1);
76  serializer(k2);
77  serializer(bctype);
78  serializer(dir);
79  serializer(component);
80  serializer(rate);
81  }
82  };
83 
84 
85  BCConfig() = default;
86  explicit BCConfig(const Deck& deck);
87 
88  static BCConfig serializeObject();
89 
90  std::size_t size() const;
91  std::vector<BCFace>::const_iterator begin() const;
92  std::vector<BCFace>::const_iterator end() const;
93  bool operator==(const BCConfig& other) const;
94 
95  template<class Serializer>
96  void serializeOp(Serializer& serializer)
97  {
98  serializer.vector(m_faces);
99  }
100 
101 private:
102  std::vector<BCFace> m_faces;
103 };
104 
105 } //namespace Opm
106 
107 
108 
109 #endif
Definition: BCConfig.hpp:49
Definition: DeckRecord.hpp:32
Definition: Deck.hpp:63
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: BCConfig.hpp:52