#8403 Ensure the NNC connection polygon is created before computing area

This commit is contained in:
Magne Sjaastad 2022-01-04 12:01:51 +01:00
parent e09a839228
commit 87780b2b8a
2 changed files with 59 additions and 54 deletions

View File

@ -164,6 +164,8 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
faceNormal = ( faceCenter - cellCenter ).getNormalized() * arrowScaling;
};
if ( !resultAddresses.empty() && !directions.empty() )
{
#pragma omp parallel for
for ( int gcIdx = 0; gcIdx < static_cast<int>( cells.size() ); ++gcIdx )
{
@ -230,6 +232,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
}
}
}
}
if ( result->showNncData() )
{

View File

@ -645,12 +645,14 @@ bool RigNNCData::generateScalarValues( const RigEclipseResultAddress& resVarAddr
auto it = m_connectionResults.find( nameit->second );
if ( it == m_connectionResults.end() ) return false;
auto& srcdata = it->second;
// Connection polygons are used to compute the center for the NNC flow vectors
// If connection polygons are present, this is a no-op
buildPolygonsForEclipseConnections();
auto& srcdata = it->second;
auto& dstdata = makeDynamicConnectionScalarResult( resVarAddr.resultName(), srcdata.size() );
const double epsilon = 1.0e-3;
std::vector<double> areas( m_connections.size() );
for ( size_t dataIdx = 0; dataIdx < m_connections.size(); dataIdx++ )