opm-common
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 
30 namespace 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  result.m_neosres = 7;
58  result.m_neossur = 8;
59 
60  return result;
61  }
62 
63  size_t getNumSatTables() const {
64  return m_ntsfun;
65  }
66 
67  size_t getNumPVTTables() const {
68  return m_ntpvt;
69  }
70 
71  size_t getNumSatNodes() const {
72  return m_nssfun;
73  }
74 
75  size_t getNumPressureNodes() const {
76  return m_nppvt;
77  }
78 
79  size_t getNumFIPRegions() const {
80  return m_ntfip;
81  }
82 
83  size_t getNumRSNodes() const {
84  return m_nrpvt;
85  }
86 
87  size_t getNumEosRes() const {
88  return m_neosres;
89  }
90 
91  size_t getNumEosSur() const {
92  return m_neossur;
93  }
94 
95  bool operator==(const Tabdims& data) const {
96  return this->getNumSatTables() == data.getNumSatTables() &&
97  this->getNumPVTTables() == data.getNumPVTTables() &&
98  this->getNumSatNodes() == data.getNumSatNodes() &&
99  this->getNumPressureNodes() == data.getNumPressureNodes() &&
100  this->getNumFIPRegions() == data.getNumFIPRegions() &&
101  this->getNumRSNodes() == data.getNumRSNodes() &&
102  this->getNumEosRes() == data.getNumEosRes() &&
103  this->getNumEosSur() == data.getNumEosSur();
104  }
105 
106  template<class Serializer>
107  void serializeOp(Serializer& serializer)
108  {
109  serializer(m_ntsfun);
110  serializer(m_ntpvt);
111  serializer(m_nssfun);
112  serializer(m_nppvt);
113  serializer(m_ntfip);
114  serializer(m_nrpvt);
115  serializer(m_neosres);
116  serializer(m_neossur);
117  }
118 
119  private:
120  size_t m_ntsfun,m_ntpvt,m_nssfun,m_nppvt,m_ntfip,m_nrpvt, m_neosres, m_neossur;
121  };
122 }
123 
124 
125 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Deck.hpp:46
Class for (de-)serializing.
Definition: Serializer.hpp:94
Definition: Tabdims.hpp:36