mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
Use the last frame for each timestep.
This commit is contained in:
parent
b169900c41
commit
ae7139e18d
@ -503,36 +503,35 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
|
|||||||
{
|
{
|
||||||
std::vector<double> frameTimes = m_readerInterface->frameTimes( stepIndex );
|
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 )
|
|
||||||
{
|
|
||||||
componentDataVectors.push_back( &( componentResult->frameData( stepIndex ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ( resVarAddr.resultPosType )
|
std::vector<std::vector<float>*> componentDataVectors;
|
||||||
{
|
for ( auto& componentResult : resultsForEachComponent )
|
||||||
case RIG_NODAL:
|
{
|
||||||
m_readerInterface->readNodeField( resVarAddr.fieldName, partIndex, stepIndex, fIdx, &componentDataVectors );
|
componentDataVectors.push_back( &( componentResult->frameData( stepIndex ) ) );
|
||||||
break;
|
}
|
||||||
case RIG_ELEMENT_NODAL:
|
|
||||||
m_readerInterface->readElementNodeField( resVarAddr.fieldName,
|
switch ( resVarAddr.resultPosType )
|
||||||
partIndex,
|
{
|
||||||
stepIndex,
|
case RIG_NODAL:
|
||||||
fIdx,
|
m_readerInterface->readNodeField( resVarAddr.fieldName, partIndex, stepIndex, fIdx, &componentDataVectors );
|
||||||
&componentDataVectors );
|
break;
|
||||||
break;
|
case RIG_ELEMENT_NODAL:
|
||||||
case RIG_INTEGRATION_POINT:
|
m_readerInterface->readElementNodeField( resVarAddr.fieldName,
|
||||||
m_readerInterface->readIntegrationPointField( resVarAddr.fieldName,
|
partIndex,
|
||||||
partIndex,
|
stepIndex,
|
||||||
stepIndex,
|
fIdx,
|
||||||
fIdx,
|
&componentDataVectors );
|
||||||
&componentDataVectors );
|
break;
|
||||||
break;
|
case RIG_INTEGRATION_POINT:
|
||||||
default:
|
m_readerInterface->readIntegrationPointField( resVarAddr.fieldName,
|
||||||
break;
|
partIndex,
|
||||||
}
|
stepIndex,
|
||||||
|
fIdx,
|
||||||
|
&componentDataVectors );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress.incrementProgress();
|
progress.incrementProgress();
|
||||||
|
@ -168,7 +168,8 @@ bool RigGeoMechCaseData::readDisplacements( std::string* errorMessag
|
|||||||
#ifdef USE_ODB_API
|
#ifdef USE_ODB_API
|
||||||
if ( m_readerInterface.notNull() && m_readerInterface->isOpen() )
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,8 +250,8 @@ std::map<RifOdbReader::RifOdbResultKey, std::vector<std::string>> RifOdbReader::
|
|||||||
|
|
||||||
if ( stepFrames.size() > 1 )
|
if ( stepFrames.size() > 1 )
|
||||||
{
|
{
|
||||||
// Optimization: Get results metadata for the second frame of the first step only
|
// Optimization: Get results metadata for the last frame of the first step only
|
||||||
const odb_Frame& frame = stepFrames.constGet( 1 );
|
const odb_Frame& frame = stepFrames.constGet( stepFrames.size() - 1 );
|
||||||
|
|
||||||
const odb_FieldOutputRepository& fieldCon = frame.fieldOutputs();
|
const odb_FieldOutputRepository& fieldCon = frame.fieldOutputs();
|
||||||
odb_FieldOutputRepositoryIT fieldConIT( fieldCon );
|
odb_FieldOutputRepositoryIT fieldConIT( fieldCon );
|
||||||
|
Loading…
Reference in New Issue
Block a user