mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add RimVfpTableData used to represent connection to file and data
Extract data management from RimVfpPlot. Use pointer from RimVfpPlot to RimVfpTableData.
This commit is contained in:
@@ -85,94 +85,6 @@ Opm::VFPProdTable createProductionTable( const Opm::DeckKeyword& keyword )
|
||||
return { keyword, gaslift_opt_active, unitSystem };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<Opm::VFPInjTable> extractVfpInjectionTables( const std::string& filename )
|
||||
{
|
||||
std::vector<Opm::VFPInjTable> tables;
|
||||
|
||||
try
|
||||
{
|
||||
Opm::Parser parser( false );
|
||||
const ::Opm::ParserKeywords::VFPINJ kw1;
|
||||
const ::Opm::ParserKeywords::VFPIDIMS kw2;
|
||||
|
||||
parser.addParserKeyword( kw1 );
|
||||
parser.addParserKeyword( kw2 );
|
||||
|
||||
auto deck = parser.parseFile( filename );
|
||||
|
||||
std::string keyword = ::Opm::ParserKeywords::VFPINJ::keywordName;
|
||||
auto keywordList = deck.getKeywordList( keyword );
|
||||
for ( auto kw : keywordList )
|
||||
{
|
||||
auto table = createInjectionTable( *kw );
|
||||
tables.push_back( table );
|
||||
}
|
||||
}
|
||||
catch ( Opm::OpmInputError& e )
|
||||
{
|
||||
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
|
||||
.arg( QString::fromStdString( filename ) )
|
||||
.arg( QString::fromStdString( e.what() ) );
|
||||
|
||||
RiaLogging::warning( text );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
QString text =
|
||||
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
|
||||
|
||||
RiaLogging::warning( text );
|
||||
}
|
||||
|
||||
return tables;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<Opm::VFPProdTable> extractVfpProductionTables( const std::string& filename )
|
||||
{
|
||||
std::vector<Opm::VFPProdTable> tables;
|
||||
|
||||
try
|
||||
{
|
||||
Opm::Parser parser( false );
|
||||
const ::Opm::ParserKeywords::VFPPROD kw1;
|
||||
|
||||
parser.addParserKeyword( kw1 );
|
||||
|
||||
auto deck = parser.parseFile( filename );
|
||||
|
||||
std::string keyword = ::Opm::ParserKeywords::VFPPROD::keywordName;
|
||||
auto keywordList = deck.getKeywordList( keyword );
|
||||
for ( auto kw : keywordList )
|
||||
{
|
||||
auto table = createProductionTable( *kw );
|
||||
tables.push_back( table );
|
||||
}
|
||||
}
|
||||
catch ( Opm::OpmInputError& e )
|
||||
{
|
||||
QString text = QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete.\n%2" )
|
||||
.arg( QString::fromStdString( filename ) )
|
||||
.arg( QString::fromStdString( e.what() ) );
|
||||
|
||||
RiaLogging::warning( text );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
QString text =
|
||||
QString( "Error detected when parsing '%1'. Imported data might be missing or incomplete." ).arg( QString::fromStdString( filename ) );
|
||||
|
||||
RiaLogging::warning( text );
|
||||
}
|
||||
|
||||
return tables;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user