Allen : Guard max number of connections with flow rate results

This commit is contained in:
Magne Sjaastad 2020-01-21 07:57:35 +01:00
parent a3eaa32b38
commit c5e0138072

View File

@ -298,7 +298,10 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNNCflow( const std::vect
{
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::MATRIX_MODEL );
for ( size_t connectionIndex = 0; connectionIndex < connections.size(); connectionIndex++ )
// Find max count for connections with result. Allen results introduce connections without results
size_t connectionsWithResultCount = std::min( flowrateNNC->size(), connections.size() );
for ( size_t connectionIndex = 0; connectionIndex < connectionsWithResultCount; connectionIndex++ )
{
RigConnection connection = connections[connectionIndex];
double connectionValue = flowrateNNC->at( connectionIndex );