GRDECL: Import multiple grid files from dialog (#10142)

Add import of N .GRDECL grid files - as done for roff-files
This commit is contained in:
Jørgen Herje
2023-04-21 10:34:29 +02:00
committed by GitHub
parent 93ab49cf02
commit 0d8aee8995
8 changed files with 170 additions and 53 deletions

View File

@@ -1401,6 +1401,23 @@ cvf::StructGridInterface::FaceEnum RifEclipseInputFileTools::faceEnumFromText( c
return cvf::StructGridInterface::NO_FACE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseInputFileTools::hasGridData( const QString& fileName )
{
// Look for keyword "COORD" in file
// NOTE: If readKeywordAndValues is slow for large .GRDECL files, consider function in RifEclipseTextFileReader
// reading line for line and returns true on first hit of keyword. This prevents reading entire file on large cases
const auto keywordAndValues = RifEclipseTextFileReader::readKeywordAndValues( fileName.toStdString() );
auto coordKeywordItr = std::find_if( keywordAndValues.begin(),
keywordAndValues.end(),
[]( const auto& keywordAndValue ) { return keywordAndValue.keyword == "COORD"; } );
return coordKeywordItr != keywordAndValues.end();
}
//--------------------------------------------------------------------------------------------------
/// The file pointer is pointing at the line following the FAULTS keyword.
/// Parse content of this keyword until end of file or