My Project
Loading...
Searching...
No Matches
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#include <optional>
26
27#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
28#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
29
30
31namespace Opm {
32
33class Deck;
34class DeckRecord;
35
36class BCConfig {
37public:
38
39 struct BCRegion {
40 int index;
41 int i1,i2;
42 int j1,j2;
43 int k1,k2;
44 FaceDir::DirEnum dir;
45
46 BCRegion() = default;
47 explicit BCRegion(const DeckRecord& record, const GridDims& grid);
48
49 static BCRegion serializationTestObject();
50
51 bool operator==(const BCRegion& other) const;
52
53 template<class Serializer>
54 void serializeOp(Serializer& serializer)
55 {
56 serializer(index);
57 serializer(i1);
58 serializer(i2);
59 serializer(j1);
60 serializer(j2);
61 serializer(k1);
62 serializer(k2);
63 serializer(dir);
64 }
65 };
66
67
68 BCConfig() = default;
69 explicit BCConfig(const Deck& deck);
70
71 static BCConfig serializationTestObject();
72
73 std::size_t size() const;
74 std::vector<BCRegion>::const_iterator begin() const;
75 std::vector<BCRegion>::const_iterator end() const;
76 bool operator==(const BCConfig& other) const;
77
78 template<class Serializer>
79 void serializeOp(Serializer& serializer)
80 {
81 serializer(m_faces);
82 }
83
84private:
85 std::vector<BCRegion> m_faces;
86};
87
88} //namespace Opm
89
90
91
92#endif
Definition BCConfig.hpp:36
Definition DeckRecord.hpp:32
Definition Deck.hpp:49
Definition GridDims.hpp:31
Class for (de-)serializing.
Definition Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition BCConfig.hpp:39