make PvtwsaltTable constructible from variables

also add accessor and equality operator
This commit is contained in:
Arne Morten Kvarving 2019-12-16 14:27:16 +01:00 committed by Tor Harald Sandve
parent bc67976cb3
commit eb6159fceb
2 changed files with 27 additions and 1 deletions

View File

@ -28,6 +28,10 @@ namespace Opm {
class PvtwsaltTable {
public:
PvtwsaltTable();
PvtwsaltTable(double refPressValue,
double refSaltConValue,
const std::vector<double>& tableValues);
void init(const Opm::DeckRecord& record0, const Opm::DeckRecord& record1);
size_t size() const;
std::vector<double> getSaltConcentrationColumn() const;
@ -37,8 +41,9 @@ namespace Opm {
std::vector<double> getViscosibilityColumn() const;
double getReferencePressureValue() const;
double getReferenceSaltConcentrationValue() const;
const std::vector<double>& getTableValues() const;
bool operator==(const PvtwsaltTable& data) const;
protected:

View File

@ -30,6 +30,15 @@ namespace Opm {
{
}
PvtwsaltTable::PvtwsaltTable(double refPressValue,
double refSaltConValue,
const std::vector<double>& tableValues)
: m_pRefValues(refPressValue)
, m_saltConsRefValues(refSaltConValue)
, m_tableValues(tableValues)
{
}
void PvtwsaltTable::init(const Opm::DeckRecord& record0, const Opm::DeckRecord& record1)
{
@ -43,6 +52,11 @@ namespace Opm {
return m_tableValues.size()/numEntries;
}
const std::vector<double>& PvtwsaltTable::getTableValues() const
{
return m_tableValues;
}
double PvtwsaltTable::getReferencePressureValue() const
{
return m_pRefValues;
@ -113,5 +127,12 @@ namespace Opm {
}
bool PvtwsaltTable::operator==(const PvtwsaltTable& data) const
{
return m_pRefValues == data.m_pRefValues &&
m_saltConsRefValues == data.m_saltConsRefValues &&
m_tableValues == data.m_tableValues;
}
}