My Project
Loading...
Searching...
No Matches
MULTREGTScanner.hpp
1/*
2 Copyright 2014 Statoil 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_PARSER_MULTREGTSCANNER_HPP
21#define OPM_PARSER_MULTREGTSCANNER_HPP
22
23#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
24#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
25
26#include <cstddef>
27#include <map>
28#include <string>
29#include <utility>
30#include <vector>
31
32namespace Opm {
33
34 class DeckRecord;
35 class DeckKeyword;
36 class FieldPropsManager;
37
38} // namespace Opm
39
40namespace Opm {
41
42 namespace MULTREGT {
43 enum class NNCBehaviourEnum
44 {
45 NNC = 1,
46 NONNC = 2,
47 ALL = 3,
48 NOAQUNNC = 4
49 };
50
51 std::string RegionNameFromDeckValue(const std::string& stringValue);
52 NNCBehaviourEnum NNCBehaviourFromString(const std::string& stringValue);
53 } // namespace MULTREGT
54
56 {
57 int src_value;
58 int target_value;
59 double trans_mult;
60 int directions;
61 MULTREGT::NNCBehaviourEnum nnc_behaviour;
62 std::string region_name;
63
64 bool operator==(const MULTREGTRecord& data) const
65 {
66 return (src_value == data.src_value)
67 && (target_value == data.target_value)
68 && (trans_mult == data.trans_mult)
69 && (directions == data.directions)
70 && (nnc_behaviour == data.nnc_behaviour)
71 && (region_name == data.region_name)
72 ;
73 }
74
75 template<class Serializer>
76 void serializeOp(Serializer& serializer)
77 {
78 serializer(src_value);
79 serializer(target_value);
80 serializer(trans_mult);
81 serializer(directions);
82 serializer(nnc_behaviour);
83 serializer(region_name);
84 }
85 };
86
88 {
89 public:
90 MULTREGTScanner() = default;
92 MULTREGTScanner(const GridDims& grid,
93 const FieldPropsManager* fp_arg,
94 const std::vector<const DeckKeyword*>& keywords);
95
96 static MULTREGTScanner serializationTestObject();
97
98 bool operator==(const MULTREGTScanner& data) const;
99 MULTREGTScanner& operator=(const MULTREGTScanner& data);
100
101 void applyNumericalAquifer(const std::vector<std::size_t>& aquifer_cells);
102
103 double getRegionMultiplier(std::size_t globalCellIdx1,
104 std::size_t globalCellIdx2,
105 FaceDir::DirEnum faceDir) const;
106
107 double getRegionMultiplierNNC(std::size_t globalCellIdx1,
108 std::size_t globalCellIdx2) const;
109
110 template <class Serializer>
111 void serializeOp(Serializer& serializer)
112 {
113 serializer(gridDims);
114
115 serializer(m_records);
116 serializer(m_searchMap);
117
118 serializer(regions);
119 serializer(aquifer_cells);
120 }
121
122 private:
123 using MULTREGTSearchMap = std::map<
124 std::pair<int, int>,
125 std::vector<MULTREGTRecord>::size_type
126 >;
127
128 GridDims gridDims{};
129 const FieldPropsManager* fp{nullptr};
130
131 std::vector<MULTREGTRecord> m_records{};
132 std::map<std::string, MULTREGTSearchMap> m_searchMap{};
133 std::map<std::string, std::vector<int>> regions{};
134 std::vector<std::size_t> aquifer_cells{};
135
136 void addKeyword(const DeckKeyword& deckKeyword);
137 void assertKeywordSupported(const DeckKeyword& deckKeyword);
138
139 bool isAquNNC(std::size_t globalCellIdx1, std::size_t globalCellIdx2) const;
140 bool isAquCell(std::size_t globalCellIdx) const;
141 };
142
143} // namespace Opm
144
145#endif // OPM_PARSER_MULTREGTSCANNER_HPP
Definition DeckKeyword.hpp:36
Definition FieldPropsManager.hpp:41
Definition GridDims.hpp:31
Definition MULTREGTScanner.hpp:88
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 MULTREGTScanner.hpp:56