add table classes for RSVD and RVVD
these keywords are used by opm-core, albeit currently in a "bare-metal" way.
This commit is contained in:
60
opm/parser/eclipse/Utility/RsvdTable.hpp
Normal file
60
opm/parser/eclipse/Utility/RsvdTable.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2014 by Andreas Lauser
|
||||
|
||||
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_RSVD_TABLE_HPP
|
||||
#define OPM_PARSER_RSVD_TABLE_HPP
|
||||
|
||||
#include "SingleRecordTable.hpp"
|
||||
|
||||
namespace Opm {
|
||||
class RsvdTable : protected SingleRecordTable {
|
||||
typedef SingleRecordTable ParentType;
|
||||
|
||||
public:
|
||||
RsvdTable() = default;
|
||||
|
||||
using ParentType::numTables;
|
||||
using ParentType::numRows;
|
||||
using ParentType::numColumns;
|
||||
using ParentType::evaluate;
|
||||
|
||||
/*!
|
||||
* \brief Read the RSVD keyword and provide some convenience
|
||||
* methods for it.
|
||||
*/
|
||||
void init(Opm::DeckKeywordConstPtr keyword, int recordIdx)
|
||||
{
|
||||
ParentType::init(keyword,
|
||||
std::vector<std::string>{"DEPTH", "RS"},
|
||||
recordIdx,
|
||||
/*firstEntityOffset=*/0);
|
||||
|
||||
ParentType::checkNonDefaultable("DEPTH");
|
||||
ParentType::checkMonotonic("DEPTH", /*isAscending=*/true);
|
||||
ParentType::checkNonDefaultable("RS");
|
||||
}
|
||||
|
||||
const std::vector<double> &getDepthColumn() const
|
||||
{ return ParentType::getColumn(0); }
|
||||
|
||||
const std::vector<double> &getRsColumn() const
|
||||
{ return ParentType::getColumn(1); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
60
opm/parser/eclipse/Utility/RvvdTable.hpp
Normal file
60
opm/parser/eclipse/Utility/RvvdTable.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2014 by Andreas Lauser
|
||||
|
||||
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_RVVD_TABLE_HPP
|
||||
#define OPM_PARSER_RVVD_TABLE_HPP
|
||||
|
||||
#include "SingleRecordTable.hpp"
|
||||
|
||||
namespace Opm {
|
||||
class RvvdTable : protected SingleRecordTable {
|
||||
typedef SingleRecordTable ParentType;
|
||||
|
||||
public:
|
||||
RvvdTable() = default;
|
||||
|
||||
using ParentType::numTables;
|
||||
using ParentType::numRows;
|
||||
using ParentType::numColumns;
|
||||
using ParentType::evaluate;
|
||||
|
||||
/*!
|
||||
* \brief Read the RSVD keyword and provide some convenience
|
||||
* methods for it.
|
||||
*/
|
||||
void init(Opm::DeckKeywordConstPtr keyword, int recordIdx)
|
||||
{
|
||||
ParentType::init(keyword,
|
||||
std::vector<std::string>{"DEPTH", "RV"},
|
||||
recordIdx,
|
||||
/*firstEntityOffset=*/0);
|
||||
|
||||
ParentType::checkNonDefaultable("DEPTH");
|
||||
ParentType::checkMonotonic("DEPTH", /*isAscending=*/true);
|
||||
ParentType::checkNonDefaultable("RV");
|
||||
}
|
||||
|
||||
const std::vector<double> &getDepthColumn() const
|
||||
{ return ParentType::getColumn(0); }
|
||||
|
||||
const std::vector<double> &getRvColumn() const
|
||||
{ return ParentType::getColumn(1); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user