My Project
Loading...
Searching...
No Matches
UDQDims.hpp
1/*
2 Copyright (c) 2021 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_UDQDIMS_HPP
21#define OPM_UDQDIMS_HPP
22
23#include <cstddef>
24#include <functional>
25#include <optional>
26#include <vector>
27
28namespace Opm {
29
30class UDQConfig;
31
32} // namespace Opm
33
34namespace Opm {
35
37{
38public:
39 explicit UDQDims(const UDQConfig& config, const std::vector<int>& intehead);
40
41 static std::size_t entriesPerIUDQ() { return 3; }
42 static std::size_t entriesPerIUAD() { return 5; }
43 static std::size_t entriesPerZUDN() { return 2; }
44 static std::size_t entriesPerZUDL() { return 16; }
45
46 std::size_t totalNumUDQs() const;
47 std::size_t numIUAD() const;
48 std::size_t numIGPH() const;
49 std::size_t numIUAP() const;
50
51 std::size_t numFieldUDQs() const;
52
53 std::size_t maxNumGroups() const;
54 std::size_t numGroupUDQs() const;
55
56 std::size_t maxNumWells() const;
57 std::size_t numWellUDQs() const;
58
59 const std::vector<int>& data() const
60 {
61 if (! this->dimensionData_.has_value()) {
62 this->collectDimensions();
63 }
64
65 return *this->dimensionData_;
66 }
67
68private:
69 std::size_t totalNumUDQs_{};
70 std::reference_wrapper<const std::vector<int>> intehead_;
71
72 mutable std::optional<std::vector<int>> dimensionData_;
73
74 void collectDimensions() const;
75
76 std::size_t intehead(const std::vector<int>::size_type i) const;
77};
78
79} // namespace Opm
80
81#endif // OPM_UDQDIMS_HPP
Definition UDQConfig.hpp:63
Definition UDQDims.hpp:37
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30