VFPInjTable.hpp
Go to the documentation of this file.
1/*
2 Copyright 2015 SINTEF ICT, Applied Mathematics.
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
21#ifndef OPM_PARSER_ECLIPSE_ECLIPSESTATE_TABLES_VFPINJTABLE_HPP_
22#define OPM_PARSER_ECLIPSE_ECLIPSESTATE_TABLES_VFPINJTABLE_HPP_
23
24
25#include <array>
26#include <vector>
27
28namespace Opm {
29
30class DeckKeyword;
31class UnitSystem;
32
34public:
35 typedef std::vector<double> array_type;
36
37 enum FLO_TYPE {
42 };
43
44
46 VFPInjTable(const DeckKeyword& table, const UnitSystem& deck_unit_system);
47
49
50 inline int getTableNum() const {
51 return m_table_num;
52 }
53
54 inline double getDatumDepth() const {
55 return m_datum_depth;
56 }
57
58 inline FLO_TYPE getFloType() const {
59 return m_flo_type;
60 }
61
62 inline const std::vector<double>& getFloAxis() const {
63 return m_flo_data;
64 }
65
66 inline const std::vector<double>& getTHPAxis() const {
67 return m_thp_data;
68 }
69
82 inline const array_type& getTable() const {
83 return m_data;
84 }
85
86 bool operator==(const VFPInjTable& data) const;
87
88 std::array<size_t,2> shape() const;
89
90 double operator()(size_t thp_idx, size_t flo_idx) const;
91
92 template<class Serializer>
93 void serializeOp(Serializer& serializer)
94 {
95 serializer(m_table_num);
96 serializer(m_datum_depth);
97 serializer(m_flo_type);
98 serializer(m_flo_data);
99 serializer(m_thp_data);
100 serializer(m_data);
101 }
102
103private:
104 int m_table_num;
105 double m_datum_depth;
106 FLO_TYPE m_flo_type;
107
108 std::vector<double> m_flo_data;
109 std::vector<double> m_thp_data;
110
111
112 array_type m_data;
113 void check();
114
115 double& operator()(size_t thp_idx, size_t flo_idx);
116
117 static FLO_TYPE getFloType(std::string flo_string);
118
119 static void scaleValues(std::vector<double>& values,
120 const double& scaling_factor);
121
122 static void convertFloToSI(const FLO_TYPE& type,
123 std::vector<double>& values,
124 const UnitSystem& unit_system);
125 static void convertTHPToSI(std::vector<double>& values,
126 const UnitSystem& unit_system);
127};
128
129
130}
131
132
133#endif
const char *const string
Definition: cJSON.h:170
Definition: DeckKeyword.hpp:38
Definition: Serializer.hpp:38
Definition: UnitSystem.hpp:32
Definition: VFPInjTable.hpp:33
bool operator==(const VFPInjTable &data) const
static VFPInjTable serializeObject()
FLO_TYPE getFloType() const
Definition: VFPInjTable.hpp:58
std::array< size_t, 2 > shape() const
std::vector< double > array_type
Definition: VFPInjTable.hpp:35
const std::vector< double > & getTHPAxis() const
Definition: VFPInjTable.hpp:66
double operator()(size_t thp_idx, size_t flo_idx) const
int getTableNum() const
Definition: VFPInjTable.hpp:50
double getDatumDepth() const
Definition: VFPInjTable.hpp:54
const array_type & getTable() const
Definition: VFPInjTable.hpp:82
const std::vector< double > & getFloAxis() const
Definition: VFPInjTable.hpp:62
FLO_TYPE
Definition: VFPInjTable.hpp:37
@ FLO_OIL
Definition: VFPInjTable.hpp:38
@ FLO_INVALID
Definition: VFPInjTable.hpp:41
@ FLO_GAS
Definition: VFPInjTable.hpp:40
@ FLO_WAT
Definition: VFPInjTable.hpp:39
VFPInjTable(const DeckKeyword &table, const UnitSystem &deck_unit_system)
void serializeOp(Serializer &serializer)
Definition: VFPInjTable.hpp:93
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022