My Project
Tabdims.hpp
1/*
2 Copyright (C) 2015 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 TABDIMS_HPP
21#define TABDIMS_HPP
22
23#include <cstddef>
24
25/*
26 The Tabdims class is a small utility class designed to hold on to
27 the values from the TABDIMS keyword.
28*/
29
30namespace Opm {
31
32 class Deck;
33 class DeckKeyword;
34 class DeckRecord;
35
36 class Tabdims {
37 public:
38
39 /*
40 The TABDIMS keyword has a total of 25 items; most of them
41 are ECLIPSE300 only and quite exotic. Here we only
42 internalize the most common items.
43 */
44 Tabdims();
45
46 explicit Tabdims(const Deck& deck);
47
48 static Tabdims serializationTestObject()
49 {
50 Tabdims result;
51 result.m_ntsfun = 1;
52 result.m_ntpvt = 2;
53 result.m_nssfun = 3;
54 result.m_nppvt = 4;
55 result.m_ntfip = 5;
56 result.m_nrpvt = 6;
57
58 return result;
59 }
60
61 size_t getNumSatTables() const {
62 return m_ntsfun;
63 }
64
65 size_t getNumPVTTables() const {
66 return m_ntpvt;
67 }
68
69 size_t getNumSatNodes() const {
70 return m_nssfun;
71 }
72
73 size_t getNumPressureNodes() const {
74 return m_nppvt;
75 }
76
77 size_t getNumFIPRegions() const {
78 return m_ntfip;
79 }
80
81 size_t getNumRSNodes() const {
82 return m_nrpvt;
83 }
84
85 bool operator==(const Tabdims& data) const {
86 return this->getNumSatTables() == data.getNumSatTables() &&
87 this->getNumPVTTables() == data.getNumPVTTables() &&
88 this->getNumSatNodes() == data.getNumSatNodes() &&
89 this->getNumPressureNodes() == data.getNumPressureNodes() &&
90 this->getNumFIPRegions() == data.getNumFIPRegions() &&
91 this->getNumRSNodes() == data.getNumRSNodes();
92 }
93
94 template<class Serializer>
95 void serializeOp(Serializer& serializer)
96 {
97 serializer(m_ntsfun);
98 serializer(m_ntpvt);
99 serializer(m_nssfun);
100 serializer(m_nppvt);
101 serializer(m_ntfip);
102 serializer(m_nrpvt);
103 }
104
105 private:
106 size_t m_ntsfun,m_ntpvt,m_nssfun,m_nppvt,m_ntfip,m_nrpvt;
107 };
108}
109
110
111#endif
Definition: Deck.hpp:49
Class for (de-)serializing.
Definition: Serializer.hpp:84
Definition: Tabdims.hpp:36
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30