mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary HDF : Make sure all summary data is loaded before export to HDF
This commit is contained in:
@@ -41,6 +41,10 @@ bool RifHdf5SummaryExporter::ensureHdf5FileIsCreated( const std::string& smspecF
|
|||||||
{
|
{
|
||||||
Opm::EclIO::ESmry sourceSummaryData( smspecFileName );
|
Opm::EclIO::ESmry sourceSummaryData( smspecFileName );
|
||||||
|
|
||||||
|
// Read all data summary data before starting export to HDF. Loading one and one summary vector causes huge
|
||||||
|
// performance penalty
|
||||||
|
sourceSummaryData.LoadData();
|
||||||
|
|
||||||
RifHdf5Exporter exporter( h5FileName );
|
RifHdf5Exporter exporter( h5FileName );
|
||||||
|
|
||||||
writeGeneralSection( exporter, sourceSummaryData );
|
writeGeneralSection( exporter, sourceSummaryData );
|
||||||
@@ -155,7 +159,11 @@ bool RifHdf5SummaryExporter::writeSummaryVectors( RifHdf5Exporter& exporter, Opm
|
|||||||
const std::vector<float>& values = sourceSummaryData.get( summaryNode );
|
const std::vector<float>& values = sourceSummaryData.get( summaryNode );
|
||||||
|
|
||||||
exporter.writeDataset( dataValuesGroup, datasetName, values );
|
exporter.writeDataset( dataValuesGroup, datasetName, values );
|
||||||
|
|
||||||
|
dataValuesGroup.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
keywordGroup.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -25,12 +25,10 @@ TEST( DISABLED_HDFTests, WriteToHdf5SummaryExporter )
|
|||||||
{
|
{
|
||||||
QString file_path = H5_TEST_DATA_DIRECTORY_2 + "NORNE_ATW2013_RFTPLT_V2.SMSPEC";
|
QString file_path = H5_TEST_DATA_DIRECTORY_2 + "NORNE_ATW2013_RFTPLT_V2.SMSPEC";
|
||||||
|
|
||||||
Opm::EclIO::ESmry esmry( file_path.toStdString() );
|
|
||||||
|
|
||||||
RifHdf5SummaryExporter exporter;
|
RifHdf5SummaryExporter exporter;
|
||||||
std::string exportFileName = "e:/project/scratch_export/hdf_complete.h5";
|
std::string exportFileName = "e:/project/scratch_export/hdf_complete.h5";
|
||||||
|
|
||||||
exporter.ensureHdf5FileIsCreated( exportFileName, exportFileName );
|
exporter.ensureHdf5FileIsCreated( file_path.toStdString(), exportFileName );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user