added: allow constructing Rock2dTables from vectors
also add accessors
This commit is contained in:
@@ -28,12 +28,21 @@ namespace Opm {
|
||||
class Rock2dTable {
|
||||
public:
|
||||
Rock2dTable();
|
||||
Rock2dTable(const std::vector<std::vector<double>>& pvmultValues,
|
||||
const std::vector<double>& pressureValues);
|
||||
void init(const Opm::DeckRecord& record, size_t tableIdx);
|
||||
size_t size() const;
|
||||
size_t sizeMultValues() const;
|
||||
double getPressureValue(size_t index) const;
|
||||
double getPvmultValue(size_t pressureIndex, size_t saturationIndex ) const;
|
||||
|
||||
const std::vector<std::vector<double>>& pvmultValues() const
|
||||
{ return m_pvmultValues; }
|
||||
|
||||
const std::vector<double>& pressureValues() const
|
||||
{ return m_pressureValues; }
|
||||
|
||||
bool operator==(const Rock2dTable& data) const;
|
||||
|
||||
protected:
|
||||
std::vector< std::vector <double> > m_pvmultValues;
|
||||
|
||||
@@ -29,6 +29,13 @@ namespace Opm {
|
||||
{
|
||||
}
|
||||
|
||||
Rock2dTable::Rock2dTable(const std::vector<std::vector<double>>& pvmultValues,
|
||||
const std::vector<double>& pressureValues)
|
||||
: m_pvmultValues(pvmultValues)
|
||||
, m_pressureValues(pressureValues)
|
||||
{
|
||||
}
|
||||
|
||||
void Rock2dTable::init(const DeckRecord& record, size_t /* tableIdx */)
|
||||
{
|
||||
m_pressureValues.push_back(record.getItem("PRESSURE").getSIDoubleData()[0]);
|
||||
@@ -55,5 +62,11 @@ namespace Opm {
|
||||
return m_pvmultValues[pressureIndex][saturationIndex];
|
||||
}
|
||||
|
||||
bool Rock2dTable::operator==(const Rock2dTable& data) const
|
||||
{
|
||||
return this->pvmultValues() == data.pvmultValues() &&
|
||||
this->pressureValues() == data.pressureValues();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user