LinearisedOutputTable.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 Equinor.
3 Copyright 2017 Statoil ASA.
4
5 This file is part of the Open Porous Media project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
22#define LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
23
24#include <cstddef>
25#include <vector>
26
27namespace Opm {
28
35 {
36 public:
58 LinearisedOutputTable(const std::size_t numTables,
59 const std::size_t numPrimary,
60 const std::size_t numRows,
61 const std::size_t numCols);
62
84 LinearisedOutputTable(const std::size_t numTables,
85 const std::size_t numPrimary,
86 const std::size_t numRows,
87 const std::size_t numCols,
88 const double fillValue);
89
106 std::vector<double>::iterator
107 column(const std::size_t tableID,
108 const std::size_t primID,
109 const std::size_t colID);
110
114 const std::vector<double>& getData() const;
115
121 std::vector<double> getDataDestructively();
122
123 private:
125 std::vector<double> data;
126
128 std::size_t numTables;
129
131 std::size_t numPrimary;
132
134 std::size_t numRows;
135 };
136
140 namespace DifferentiateOutputTable {
145 struct Descriptor {
149 std::size_t tableID{ 0 };
150
155 std::size_t primID{ 0 };
156
158 std::size_t numActRows{ 0 };
159 };
160
192 void calcSlopes(const std::size_t numDependent,
193 const Descriptor& desc,
194 LinearisedOutputTable& table);
195 } // DifferentiateOutputTable
196} // Opm
197
198#endif // LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
Definition: LinearisedOutputTable.hpp:35
LinearisedOutputTable(const std::size_t numTables, const std::size_t numPrimary, const std::size_t numRows, const std::size_t numCols, const double fillValue)
std::vector< double > getDataDestructively()
std::vector< double >::iterator column(const std::size_t tableID, const std::size_t primID, const std::size_t colID)
const std::vector< double > & getData() const
LinearisedOutputTable(const std::size_t numTables, const std::size_t numPrimary, const std::size_t numRows, const std::size_t numCols)
void calcSlopes(const std::size_t numDependent, const Descriptor &desc, LinearisedOutputTable &table)
Definition: A.hpp:4
Definition: LinearisedOutputTable.hpp:145
std::size_t numActRows
Number of active rows in this subtable.
Definition: LinearisedOutputTable.hpp:158
std::size_t tableID
Definition: LinearisedOutputTable.hpp:149
std::size_t primID
Definition: LinearisedOutputTable.hpp:155