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