Improve NNC memory use

This commit is contained in:
Gaute Lindkvist
2020-05-14 19:11:45 +02:00
committed by Magne Sjaastad
parent 4b3d41d53e
commit 72436f0a72
18 changed files with 178 additions and 162 deletions

View File

@@ -221,7 +221,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
RigMainGrid* mainGrid = eclipseView->eclipseCase()->eclipseCaseData()->mainGrid();
const RigConnection& nncConn = mainGrid->nncData()->connections()[nncIndex];
mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConn.m_c1GlobIdx, &gridLocalCellIndex );
mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConn.c1GlobIdx(), &gridLocalCellIndex );
}
}
else
@@ -298,10 +298,10 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
const RigConnection& nncConn = mainGrid->nncData()->connections()[nncIndex];
size_t c1LocalIdx = cvf::UNDEFINED_SIZE_T;
const RigGridBase* grid1 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.m_c1GlobIdx, &c1LocalIdx);
const RigGridBase* grid1 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.c1GlobIdx(), &c1LocalIdx);
size_t c1GridIdx = grid1->gridIndex();
size_t c2LocalIdx = cvf::UNDEFINED_SIZE_T;
const RigGridBase* grid2 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.m_c2GlobIdx, &c2LocalIdx);
const RigGridBase* grid2 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.c2GlobIdx(), &c2LocalIdx);
size_t c2GridIdx = grid2->gridIndex();
if (gridLocalCellIndex == c1LocalIdx && gridIndex == c1GridIdx)
@@ -311,7 +311,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
if (face == cvf::StructGridInterface::NO_FACE)
{
face = nncConn.m_c1Face;
face = nncConn.face();
}
else
{
@@ -324,7 +324,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
gridIndex = c1GridIdx;
if (face == cvf::StructGridInterface::NO_FACE)
{
face = cvf::StructGridInterface::oppositeFace(nncConn.m_c1Face);
face = cvf::StructGridInterface::oppositeFace(nncConn.face());
}
else
{

View File

@@ -446,7 +446,7 @@ QString RiuResultTextBuilder::nncResultText()
{
const RigConnection& conn = nncData->connections()[m_nncIndex];
cvf::StructGridInterface::FaceEnum face( conn.m_c1Face );
cvf::StructGridInterface::FaceEnum face( conn.face() );
if ( m_viewWithFaultsSettings && m_viewWithFaultsSettings->currentFaultResultColors() )
{
@@ -801,12 +801,12 @@ QString RiuResultTextBuilder::nncDetails()
text += "-- NNC details --\n";
{
const RigConnection& conn = nncData->connections()[m_nncIndex];
cvf::StructGridInterface::FaceEnum face( conn.m_c1Face );
cvf::StructGridInterface::FaceEnum face( conn.face() );
// First cell of NNC
{
CVF_ASSERT( conn.m_c1GlobIdx < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.m_c1GlobIdx];
CVF_ASSERT( conn.c1GlobIdx() < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.c1GlobIdx()];
RigGridBase* hostGrid = cell.hostGrid();
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
@@ -831,8 +831,8 @@ QString RiuResultTextBuilder::nncDetails()
// Second cell of NNC
{
CVF_ASSERT( conn.m_c2GlobIdx < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.m_c2GlobIdx];
CVF_ASSERT( conn.c2GlobIdx() < grid->globalCellArray().size() );
const RigCell& cell = grid->globalCellArray()[conn.c2GlobIdx()];
RigGridBase* hostGrid = cell.hostGrid();
size_t gridLocalCellIndex = cell.gridLocalCellIndex();