BCConfig.hpp
Go to the documentation of this file.
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
27
28
29namespace Opm {
30
31class Deck;
32class DeckRecord;
33
34enum class BCType {
35 RATE,
36 FREE
37};
38
39enum class BCComponent {
40 OIL,
41 GAS,
42 WATER,
43 SOLVENT,
44 POLYMER,
45 NONE
46};
47
48
49class BCConfig {
50public:
51
52 struct BCFace {
53 int i1,i2;
54 int j1,j2;
55 int k1,k2;
59 double rate;
60
61 BCFace() = default;
62 BCFace(const DeckRecord& record);
63
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
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
101private:
102 std::vector<BCFace> m_faces;
103};
104
105} //namespace Opm
106
107
108
109#endif
Definition: BCConfig.hpp:49
bool operator==(const BCConfig &other) const
std::vector< BCFace >::const_iterator begin() const
static BCConfig serializeObject()
BCConfig(const Deck &deck)
void serializeOp(Serializer &serializer)
Definition: BCConfig.hpp:96
std::vector< BCFace >::const_iterator end() const
std::size_t size() const
BCConfig()=default
Definition: Deck.hpp:115
Definition: DeckRecord.hpp:32
Definition: Serializer.hpp:38
DirEnum
Definition: FaceDir.hpp:30
Definition: A.hpp:4
BCComponent
Definition: BCConfig.hpp:39
BCType
Definition: BCConfig.hpp:34
Definition: BCConfig.hpp:52
static BCFace serializeObject()
void serializeOp(Serializer &serializer)
Definition: BCConfig.hpp:69
int i1
Definition: BCConfig.hpp:53
bool operator==(const BCFace &other) const
int j2
Definition: BCConfig.hpp:54
int k1
Definition: BCConfig.hpp:55
double rate
Definition: BCConfig.hpp:59
BCFace(const DeckRecord &record)
int i2
Definition: BCConfig.hpp:53
int k2
Definition: BCConfig.hpp:55
int j1
Definition: BCConfig.hpp:54
BCType bctype
Definition: BCConfig.hpp:56
BCComponent component
Definition: BCConfig.hpp:58
FaceDir::DirEnum dir
Definition: BCConfig.hpp:57