Use the last frame for each timestep.

This commit is contained in:
jonjenssen 2021-10-15 16:55:55 +02:00 committed by jonjenssen
parent b169900c41
commit ae7139e18d
3 changed files with 32 additions and 32 deletions

View File

@ -503,8 +503,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
{
std::vector<double> frameTimes = m_readerInterface->frameTimes( stepIndex );
for ( int fIdx = 1; (size_t)fIdx < frameTimes.size() && fIdx < 2; ++fIdx ) // Read only the second frame
{
int fIdx = (int)( frameTimes.size() - 1 );
std::vector<std::vector<float>*> componentDataVectors;
for ( auto& componentResult : resultsForEachComponent )
{
@ -533,7 +533,6 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
default:
break;
}
}
progress.incrementProgress();
}

View File

@ -168,7 +168,8 @@ bool RigGeoMechCaseData::readDisplacements( std::string* errorMessag
#ifdef USE_ODB_API
if ( m_readerInterface.notNull() && m_readerInterface->isOpen() )
{
m_readerInterface->readDisplacements( partId, timeStep, 1, displacements );
const auto& frames = m_readerInterface->frameTimes( timeStep );
m_readerInterface->readDisplacements( partId, timeStep, (int)frames.size() - 1, displacements );
return true;
}

View File

@ -250,8 +250,8 @@ std::map<RifOdbReader::RifOdbResultKey, std::vector<std::string>> RifOdbReader::
if ( stepFrames.size() > 1 )
{
// Optimization: Get results metadata for the second frame of the first step only
const odb_Frame& frame = stepFrames.constGet( 1 );
// Optimization: Get results metadata for the last frame of the first step only
const odb_Frame& frame = stepFrames.constGet( stepFrames.size() - 1 );
const odb_FieldOutputRepository& fieldCon = frame.fieldOutputs();
odb_FieldOutputRepositoryIT fieldConIT( fieldCon );