Skip to content

Commit a0dbbf6

Browse files
kribenmagnesj
authored andcommitted
Remove deprecated size_t overloads from RigActiveCellInfo
Migrate all callers to use type-safe ReservoirCellIndex and ActiveCellIndex wrappers, then remove the deprecated isActive(size_t), cellResultIndex(size_t), and setCellResultIndex(size_t, size_t) methods.
1 parent f9a081e commit a0dbbf6

File tree

63 files changed

+134
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+134
-141
lines changed

ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ RigMswBranch buildMainBoreBranchFromGeometry( const RimWellPath*
179179
if ( overlapEnd > overlapStart )
180180
{
181181
if ( activeCellInfo && cellInfo.globCellIndex < mainGrid->totalCellCount() &&
182-
!activeCellInfo->isActive( cellInfo.globCellIndex ) )
182+
!activeCellInfo->isActive( ReservoirCellIndex( cellInfo.globCellIndex ) ) )
183183
continue;
184184
if ( auto ci = toMswCellIntersection( cellInfo, mainGrid, overlapStart, overlapEnd ) ) cellCompsegs.push_back( *ci );
185185
}

ApplicationLibCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
6262
size_t globalCellIndex = cellAndWellBoreParts.first;
6363
const std::vector<WellBorePartForTransCalc>& wellBoreParts = cellAndWellBoreParts.second;
6464

65-
bool cellIsActive = activeCellInfo->isActive( globalCellIndex );
65+
bool cellIsActive = activeCellInfo->isActive( ReservoirCellIndex( globalCellIndex ) );
6666
if ( !cellIsActive ) continue;
6767

6868
// Find main bore and number of laterals

ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ std::vector<RigCompletionData>
11701170

11711171
for ( auto& cell : intersectedCells )
11721172
{
1173-
bool cellIsActive = activeCellInfo->isActive( cell.globCellIndex );
1173+
bool cellIsActive = activeCellInfo->isActive( ReservoirCellIndex( cell.globCellIndex ) );
11741174
if ( !cellIsActive ) continue;
11751175

11761176
RigCompletionData completion( wellPath->completionSettings()->wellNameForExport(),
@@ -1313,7 +1313,7 @@ std::pair<double, cvf::Vec2i>
13131313
size_t gridLocalCellIndex = 0;
13141314
const RigGridBase* grid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( intersection.globCellIndex, &gridLocalCellIndex );
13151315

1316-
if ( grid->gridId() == gridId && activeCellInfo->isActive( intersection.globCellIndex ) )
1316+
if ( grid->gridId() == gridId && activeCellInfo->isActive( ReservoirCellIndex( intersection.globCellIndex ) ) )
13171317
{
13181318
size_t i, j, k;
13191319
if ( grid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )

ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswTableData.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ double RicWellPathExportMswTableData::computeIntitialMeasuredDepth( const RimEcl
737737
{
738738
for ( const WellPathCellIntersectionInfo& intersection : allIntersections )
739739
{
740-
if ( activeCellInfo->isActive( intersection.globCellIndex ) )
740+
if ( activeCellInfo->isActive( ReservoirCellIndex( intersection.globCellIndex ) ) )
741741
{
742742
candidateMeasuredDepth = intersection.startMD;
743743
break;
@@ -1512,7 +1512,7 @@ std::vector<RigCompletionData>
15121512

15131513
for ( auto& cell : intersectedCells )
15141514
{
1515-
bool cellIsActive = activeCellInfo->isActive( cell.globCellIndex );
1515+
bool cellIsActive = activeCellInfo->isActive( ReservoirCellIndex( cell.globCellIndex ) );
15161516
if ( !cellIsActive ) continue;
15171517

15181518
RigCompletionData completion( wellPath->completionSettings()->wellNameForExport(),
@@ -1702,7 +1702,8 @@ std::pair<double, double>
17021702
{
17031703
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
17041704
{
1705-
if ( intersection.globCellIndex < activeCellInfo->reservoirCellCount() && activeCellInfo->isActive( intersection.globCellIndex ) )
1705+
if ( intersection.globCellIndex < activeCellInfo->reservoirCellCount() &&
1706+
activeCellInfo->isActive( ReservoirCellIndex( intersection.globCellIndex ) ) )
17061707
{
17071708
double overlapStart = std::max( startMD, intersection.startMD );
17081709
double overlapEnd = std::min( endMD, intersection.endMD );

ApplicationLibCode/Commands/ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void RicSaveEclipseInputVisibleCellsFeature::executeCommand( RimEclipseView*
7777
values.resize( visibleCells.size() );
7878
for ( size_t i = 0; i < visibleCells.size(); ++i )
7979
{
80-
if ( activeCellInfo->isActive( i ) )
80+
if ( activeCellInfo->isActive( ReservoirCellIndex( i ) ) )
8181
{
8282
if ( visibleCells[i] )
8383
{

ApplicationLibCode/Commands/RicCreateTemporaryLgrFeature.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ RigGridBase* RicCreateTemporaryLgrFeature::createLgr( const LgrInfo& lgrInfo, Ri
254254
auto gridCell = localGrid->cell( cellIndex );
255255
if ( gridCell.parentCellIndex() != cvf::UNDEFINED_SIZE_T )
256256
{
257-
auto resultIndex = activeInfo->cellResultIndex( gridCell.parentCellIndex() );
258-
if ( resultIndex != cvf::UNDEFINED_SIZE_T )
257+
auto resultIndex = activeInfo->cellResultIndex( ReservoirCellIndex( gridCell.parentCellIndex() ) );
258+
if ( resultIndex.value() != cvf::UNDEFINED_SIZE_T )
259259
{
260-
activeInfo->setCellResultIndex( cellIndex + mainGridCellCount, resultIndex );
260+
activeInfo->setCellResultIndex( ReservoirCellIndex( cellIndex + mainGridCellCount ), resultIndex );
261261
activeCellCount++;
262262
}
263263
}

ApplicationLibCode/FileInterface/RifEclipseInputFileTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ std::expected<std::vector<double>, std::string> RifEclipseInputFileTools::extrac
319319

320320
size_t reservoirCellIndex = mainGrid->cellIndexFromIJK( mainI, mainJ, mainK );
321321

322-
size_t resIndex = activeCells->cellResultIndex( reservoirCellIndex );
322+
size_t resIndex = activeCells->cellResultIndex( ReservoirCellIndex( reservoirCellIndex ) ).value();
323323
if ( resIndex != cvf::UNDEFINED_SIZE_T )
324324
{
325325
auto value = resultAcc->cellScalarGlobIdx( reservoirCellIndex );
@@ -404,7 +404,7 @@ std::expected<std::vector<double>, std::string> RifEclipseInputFileTools::extrac
404404
{
405405
size_t mainI = min.x() + origI;
406406
size_t reservoirCellIndex = mainGrid->cellIndexFromIJK( mainI, mainJ, mainK );
407-
size_t resIndex = activeCells->cellResultIndex( reservoirCellIndex );
407+
size_t resIndex = activeCells->cellResultIndex( ReservoirCellIndex( reservoirCellIndex ) ).value();
408408
size_t subCountI = refinement.subcellCount( RigRefinement::DimI, origI );
409409

410410
double value = ( resIndex != cvf::UNDEFINED_SIZE_T ) ? resultAcc->cellScalarGlobIdx( reservoirCellIndex )

ApplicationLibCode/FileInterface/RifEclipseOutputFileTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,13 @@ bool RifEclipseOutputFileTools::assignActiveCellData( std::vector<std::vector<in
697697
{
698698
if ( actnumValue == matrixActive || actnumValue == matrixAndFractureActive )
699699
{
700-
activeCellInfo->setCellResultIndex( cellIdx, globalActiveMatrixIndex++ );
700+
activeCellInfo->setCellResultIndex( ReservoirCellIndex( cellIdx ), ActiveCellIndex( globalActiveMatrixIndex++ ) );
701701
activeMatrixIndex++;
702702
}
703703

704704
if ( actnumValue == fractureActive || actnumValue == matrixAndFractureActive )
705705
{
706-
fractureActiveCellInfo->setCellResultIndex( cellIdx, globalActiveFractureIndex++ );
706+
fractureActiveCellInfo->setCellResultIndex( ReservoirCellIndex( cellIdx ), ActiveCellIndex( globalActiveFractureIndex++ ) );
707707
activeFractureIndex++;
708708
}
709709

ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,15 @@ bool RifReaderEclipseOutput::transferGridCellData( RigMainGrid* mainGrid
184184
int matrixActiveIndex = ecl_grid_get_active_index1( localEclGrid, gridLocalCellIndex );
185185
if ( matrixActiveIndex != -1 )
186186
{
187-
activeCellInfo->setCellResultIndex( cellStartIndex + gridLocalCellIndex, matrixActiveStartIndex + matrixActiveIndex );
187+
activeCellInfo->setCellResultIndex( ReservoirCellIndex( cellStartIndex + gridLocalCellIndex ),
188+
ActiveCellIndex( matrixActiveStartIndex + matrixActiveIndex ) );
188189
}
189190

190191
int fractureActiveIndex = ecl_grid_get_active_fracture_index1( localEclGrid, gridLocalCellIndex );
191192
if ( fractureActiveIndex != -1 )
192193
{
193-
fractureActiveCellInfo->setCellResultIndex( cellStartIndex + gridLocalCellIndex, fractureActiveStartIndex + fractureActiveIndex );
194+
fractureActiveCellInfo->setCellResultIndex( ReservoirCellIndex( cellStartIndex + gridLocalCellIndex ),
195+
ActiveCellIndex( fractureActiveStartIndex + fractureActiveIndex ) );
194196
}
195197

196198
// Parent cell index

ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,15 @@ void RifReaderOpmCommon::transferActiveCells( Opm::EclIO::EGrid& opmGrid,
464464
int matrixActiveIndex = active_indexes[opmCellIndex];
465465
if ( matrixActiveIndex != -1 )
466466
{
467-
activeCellInfo->setCellResultIndex( cellStartIndex + opmCellIndex, matrixActiveStartIndex + matrixActiveIndex );
467+
activeCellInfo->setCellResultIndex( ReservoirCellIndex( cellStartIndex + opmCellIndex ),
468+
ActiveCellIndex( matrixActiveStartIndex + matrixActiveIndex ) );
468469
}
469470

470471
int fractureActiveIndex = active_frac_indexes[opmCellIndex];
471472
if ( fractureActiveIndex != -1 )
472473
{
473-
fractureActiveCellInfo->setCellResultIndex( cellStartIndex + opmCellIndex, fractureActiveStartIndex + fractureActiveIndex );
474+
fractureActiveCellInfo->setCellResultIndex( ReservoirCellIndex( cellStartIndex + opmCellIndex ),
475+
ActiveCellIndex( fractureActiveStartIndex + fractureActiveIndex ) );
474476
}
475477
}
476478
}

0 commit comments

Comments
 (0)