mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Read date information directly from restart file
This commit is contained in:
parent
502f7d4b2b
commit
018e911736
@ -441,22 +441,29 @@ std::vector<RifReaderOpmCommon::TimeDataFile> RifReaderOpmCommon::readTimeSteps(
|
|||||||
{
|
{
|
||||||
namespace VI = Opm::RestartIO::Helpers::VectorItems;
|
namespace VI = Opm::RestartIO::Helpers::VectorItems;
|
||||||
|
|
||||||
for ( auto seqNumber : restartFile->listOfReportStepNumbers() )
|
for ( auto seqNum : restartFile->listOfReportStepNumbers() )
|
||||||
{
|
{
|
||||||
auto fileView = std::make_shared<EclIO::RestartFileView>( restartFile, seqNumber );
|
const std::string inteheadString = "INTEHEAD";
|
||||||
|
const std::string doubheadString = "DOUBHEAD";
|
||||||
|
|
||||||
auto intehead = fileView->intehead();
|
if ( restartFile->hasArray( inteheadString, seqNum ) )
|
||||||
|
{
|
||||||
|
auto intehead = restartFile->getRestartData<int>( inteheadString, seqNum );
|
||||||
|
auto year = intehead[VI::intehead::YEAR];
|
||||||
|
auto month = intehead[VI::intehead::MONTH];
|
||||||
|
auto day = intehead[VI::intehead::DAY];
|
||||||
|
|
||||||
auto year = intehead[VI::intehead::YEAR];
|
double daySinceSimStart = 0.0;
|
||||||
auto month = intehead[VI::intehead::MONTH];
|
|
||||||
auto day = intehead[VI::intehead::DAY];
|
|
||||||
|
|
||||||
auto doubhead = fileView->doubhead();
|
if ( restartFile->hasArray( doubheadString, seqNum ) )
|
||||||
|
{
|
||||||
|
auto doubhead = restartFile->getRestartData<double>( doubheadString, seqNum );
|
||||||
|
daySinceSimStart = doubhead[VI::doubhead::TsInit];
|
||||||
|
}
|
||||||
|
|
||||||
auto daySinceSimStart = doubhead[VI::doubhead::TsInit];
|
reportTimeData.emplace_back(
|
||||||
|
TimeDataFile{ .sequenceNumber = seqNum, .year = year, .month = month, .day = day, .simulationTimeFromStart = daySinceSimStart } );
|
||||||
reportTimeData.emplace_back(
|
}
|
||||||
TimeDataFile{ .sequenceNumber = seqNumber, .year = year, .month = month, .day = day, .simulationTimeFromStart = daySinceSimStart } );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( std::exception& e )
|
catch ( std::exception& e )
|
||||||
|
Loading…
Reference in New Issue
Block a user