Loading...
Searching...
No Matches
LinearisedOutputTable.hpp
/*
Copyright 2019 Equinor.
Copyright 2017 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
#define LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
#include <cstddef>
#include <vector>
namespace Opm {
class LinearisedOutputTable
{
public:
LinearisedOutputTable(const std::size_t numTables,
const std::size_t numPrimary,
const std::size_t numRows,
const std::size_t numCols);
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>::iterator
column(const std::size_t tableID,
const std::size_t primID,
const std::size_t colID);
const std::vector<double>& getData() const;
std::vector<double> getDataDestructively();
private:
std::vector<double> data;
std::size_t numTables;
std::size_t numPrimary;
std::size_t numRows;
};
namespace DifferentiateOutputTable {
struct Descriptor {
std::size_t tableID{ 0 };
std::size_t primID{ 0 };
std::size_t numActRows{ 0 };
};
void calcSlopes(const std::size_t numDependent,
const Descriptor& desc,
LinearisedOutputTable& table);
} // DifferentiateOutputTable
} // Opm
#endif // LINEARISED_OUTPUT_TABLE_HPP_INCLUDED
Opm::LinearisedOutputTable
Manage tables of column data, possibly with sub-tables, all with equal number of rows (i....
Definition LinearisedOutputTable.hpp:35
Opm::LinearisedOutputTable::getDataDestructively
std::vector< double > getDataDestructively()
Destructive access to internal data buffer.
Definition LinearisedOutputTable.cpp:72
Opm::LinearisedOutputTable::column
std::vector< double >::iterator column(const std::size_t tableID, const std::size_t primID, const std::size_t colID)
Retrieve iterator to start of numRows (contiguous) column elements of a particular sub-table of a par...
Definition LinearisedOutputTable.cpp:50
Opm::LinearisedOutputTable::getData
const std::vector< double > & getData() const
Read-only access to internal data buffer.
Definition LinearisedOutputTable.cpp:66
Opm::LinearisedOutputTable::LinearisedOutputTable
LinearisedOutputTable(const std::size_t numTables, const std::size_t numPrimary, const std::size_t numRows, const std::size_t numCols)
Constructor.
Definition LinearisedOutputTable.cpp:29
Opm::DifferentiateOutputTable
Apply piecewise linear differentiation (i.e., compute slopes) on a set of dependent variables in a li...
Definition LinearisedOutputTable.hpp:140
Opm::DifferentiateOutputTable::calcSlopes
void calcSlopes(const std::size_t numDependent, const Descriptor &desc, LinearisedOutputTable &table)
Apply piecewise linear differentiation (i.e., compute slopes) on a set of dependent variables in a li...
Definition LinearisedOutputTable.cpp:80
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Opm::DifferentiateOutputTable::Descriptor
Columnar data differentantiation table request.
Definition LinearisedOutputTable.hpp:145
Opm::DifferentiateOutputTable::Descriptor::numActRows
std::size_t numActRows
Number of active rows in this subtable.
Definition LinearisedOutputTable.hpp:158
Opm::DifferentiateOutputTable::Descriptor::tableID
std::size_t tableID
Table ID–usually corresponds to the region ID of a tabulated function pertaining to a specific region...
Definition LinearisedOutputTable.hpp:149
Opm::DifferentiateOutputTable::Descriptor::primID
std::size_t primID
Primary ID–nontrivial (!= 0) only for miscible PVT tables for oil or gas in which case this entry ref...
Definition LinearisedOutputTable.hpp:155