Loading...
Searching...
No Matches
PvtxTable.hpp
/*
Copyright 2015 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 OPM_PARSER_PVTX_TABLE_HPP
#define OPM_PARSER_PVTX_TABLE_HPP
#include <opm/input/eclipse/EclipseState/Tables/ColumnSchema.hpp>
#include <opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TableColumn.hpp>
#include <opm/input/eclipse/EclipseState/Tables/TableSchema.hpp>
#include <cstddef>
#include <string>
#include <utility>
#include <vector>
namespace Opm {
class DeckKeyword;
} // namespace Opm
namespace Opm {
class PvtxTable
{
public:
static std::size_t numTables(const DeckKeyword& keyword);
static std::vector<std::pair<std::size_t, std::size_t>>
recordRanges(const DeckKeyword& keyword);
PvtxTable() = default;
explicit PvtxTable(const std::string& columnName);
virtual ~PvtxTable() = default;
static PvtxTable serializationTestObject();
const SimpleTable& getSaturatedTable() const;
const SimpleTable& getUnderSaturatedTable(std::size_t tableNumber) const;
double getArgValue(std::size_t index) const;
std::size_t size() const;
auto begin() const { return this->m_underSaturatedTables.begin(); }
auto cbegin() const { return this->m_underSaturatedTables.cbegin(); }
auto end() const { return this->m_underSaturatedTables.end(); }
auto cend() const { return this->m_underSaturatedTables.cend(); }
bool operator==(const PvtxTable& data) const;
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_outerColumnSchema);
serializer(m_outerColumn);
serializer(m_underSaturatedSchema);
serializer(m_saturatedSchema);
serializer(m_underSaturatedTables);
serializer(m_saturatedTable);
}
protected:
ColumnSchema m_outerColumnSchema{};
TableColumn m_outerColumn{};
TableSchema m_underSaturatedSchema{};
TableSchema m_saturatedSchema{};
std::vector<SimpleTable> m_underSaturatedTables{};
SimpleTable m_saturatedTable{};
void init(const DeckKeyword& keyword, std::size_t tableIdx);
private:
void populateUndersaturatedTables(const DeckKeyword& keyword,
const std::size_t tableIdx,
const std::size_t first,
const std::size_t last);
void populateSaturatedTable(const std::string& tableName);
};
} // namespace Opm
#endif // OPM_PARSER_PVTX_TABLE_HPP
Opm::ColumnSchema
Definition ColumnSchema.hpp:31
Opm::DeckKeyword
Definition DeckKeyword.hpp:36
Opm::PvtxTable
Base class for PVTG and PVTO tables.
Definition PvtxTable.hpp:117
Opm::PvtxTable::size
std::size_t size() const
Number of sub-tables.
Definition PvtxTable.cpp:140
Opm::PvtxTable::cend
auto cend() const
End of sequence of sub-tables.
Definition PvtxTable.hpp:205
Opm::PvtxTable::getArgValue
double getArgValue(std::size_t index) const
Retrieve composition/pressure node value at input point.
Definition PvtxTable.cpp:145
Opm::PvtxTable::m_underSaturatedSchema
TableSchema m_underSaturatedSchema
Table description of under-saturated states.
Definition PvtxTable.hpp:242
Opm::PvtxTable::getUnderSaturatedTable
const SimpleTable & getUnderSaturatedTable(std::size_t tableNumber) const
Retrieve sub-table for a single composition or pressure node.
Definition PvtxTable.cpp:127
Opm::PvtxTable::numTables
static std::size_t numTables(const DeckKeyword &keyword)
Number of complete tables in input PVTx keyword.
Definition PvtxTable.cpp:71
Opm::PvtxTable::operator==
bool operator==(const PvtxTable &data) const
Equality predicate.
Definition PvtxTable.cpp:156
Opm::PvtxTable::m_underSaturatedTables
std::vector< SimpleTable > m_underSaturatedTables
Under-saturated sub-tables.
Definition PvtxTable.hpp:250
Opm::PvtxTable::m_outerColumn
TableColumn m_outerColumn
Primary lookup key values.
Definition PvtxTable.hpp:239
Opm::PvtxTable::m_outerColumnSchema
ColumnSchema m_outerColumnSchema
Table description of primary lookup key.
Definition PvtxTable.hpp:236
Opm::PvtxTable::serializationTestObject
static PvtxTable serializationTestObject()
Create a serialisation test object.
Definition PvtxTable.cpp:105
Opm::PvtxTable::PvtxTable
PvtxTable()=default
Default constructor.
Opm::PvtxTable::~PvtxTable
virtual ~PvtxTable()=default
Virtual destructor.
Opm::PvtxTable::recordRanges
static std::vector< std::pair< std::size_t, std::size_t > > recordRanges(const DeckKeyword &keyword)
Identify which input records pertain to which PVT regions.
Definition PvtxTable.cpp:79
Opm::PvtxTable::end
auto end() const
End of sequence of sub-tables.
Definition PvtxTable.hpp:202
Opm::PvtxTable::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition PvtxTable.hpp:222
Opm::PvtxTable::begin
auto begin() const
Start of sequence of sub-tables.
Definition PvtxTable.hpp:193
Opm::PvtxTable::m_saturatedSchema
TableSchema m_saturatedSchema
Table description of saturated states.
Definition PvtxTable.hpp:245
Opm::PvtxTable::cbegin
auto cbegin() const
Start of sequence of sub-tables.
Definition PvtxTable.hpp:199
Opm::PvtxTable::getSaturatedTable
const SimpleTable & getSaturatedTable() const
Retrieve derived table of saturated states.
Definition PvtxTable.cpp:121
Opm::PvtxTable::m_saturatedTable
SimpleTable m_saturatedTable
Inferred table of saturated states.
Definition PvtxTable.hpp:253
Opm::PvtxTable::init
void init(const DeckKeyword &keyword, std::size_t tableIdx)
Populate internal data structures from PVTx input table data.
Definition PvtxTable.cpp:170
Opm::Serializer
Class for (de-)serializing.
Definition Serializer.hpp:94
Opm::SimpleTable
Definition SimpleTable.hpp:35
Opm::TableColumn
Definition TableColumn.hpp:32
Opm::TableSchema
Definition TableSchema.hpp:32
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30