My Project
PolyInjTable.hpp
1 /*
2  Copyright (C) 2018 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_POLY_INJ_TABLE_HPP
21 #define OPM_PARSER_POLY_INJ_TABLE_HPP
22 
23 
24 /* This class is introduced for the following keywords related to polymer injectivity study.
25  * PLYMWINJ, SKPRWAT, SKPRPOLY .
26  * These keywords share very similar structure with small difference.
27  *
28  * KEYWORD
29  * 1 / --table number
30  * 0 20 30 / -- water throughputs
31  * 0 0.1 0.2 0.3 / -- water velocities
32  * -- the rest is the table data,
33  * -- each row corresponds to one value in throughputs
34  * -- each column corresponds to one value in water velocities
35  * 20 19 18 17 /
36  * 20 18 17 16 /
37  * 20 17 16 15 /
38  */
39 
40 #include <vector>
41 
42 namespace Opm {
43 
44  class PolyInjTable {
45  public:
46  static PolyInjTable serializeObject();
47 
48  int getTableNumber() const;
49 
50  const std::vector<double>& getThroughputs() const;
51  const std::vector<double>& getVelocities() const;
52  const std::vector<std::vector<double>>& getTableData() const;
53 
54  bool operator==(const PolyInjTable& data) const;
55 
56  template<class Serializer>
57  void serializeOp(Serializer& serializer)
58  {
59  serializer(m_throughputs);
60  serializer(m_velocities);
61  serializer(m_table_number);
62  serializer(m_data);
63  }
64 
65  protected:
66  std::vector<double> m_throughputs;
67  std::vector<double> m_velocities;
68 
69  // TODO: maybe not needed, since this is also stored in the std::map
70  int m_table_number = 0;
71 
72  // each vector corresponds to the values corresponds to one value related to one x sampling point
73  // as a result, the number of the vector should be equal to be the size of m_x_points,
74  // the size of each vector should be equal to the size of m_y_points
75  std::vector<std::vector<double> > m_data;
76  };
77 }
78 
79 #endif // OPM_PARSER_POLY_INJ_TABLE_HPP
Definition: PolyInjTable.hpp:44
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29