diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index a620ce1893..a5650aa826 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -112,29 +112,29 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn // Loop over cells and fill them with data #pragma omp parallel for - for (int localCellIdx = 0; localCellIdx < cellCount; ++localCellIdx) + for (int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex) { - RigCell& cell = mainGrid->cells()[cellStartIndex + localCellIdx]; + RigCell& cell = mainGrid->cells()[cellStartIndex + gridLocalCellIndex]; - cell.setCellIndex(localCellIdx); + cell.setCellIndex(gridLocalCellIndex); // Active cell index - int matrixActiveIndex = ecl_grid_get_active_index1(localEclGrid, localCellIdx); + int matrixActiveIndex = ecl_grid_get_active_index1(localEclGrid, gridLocalCellIndex); if (matrixActiveIndex != -1) { - activeCellInfo->setCellResultIndex(cellStartIndex + localCellIdx, matrixActiveStartIndex + matrixActiveIndex); + activeCellInfo->setCellResultIndex(cellStartIndex + gridLocalCellIndex, matrixActiveStartIndex + matrixActiveIndex); } - int fractureActiveIndex = ecl_grid_get_active_fracture_index1(localEclGrid, localCellIdx); + int fractureActiveIndex = ecl_grid_get_active_fracture_index1(localEclGrid, gridLocalCellIndex); if (fractureActiveIndex != -1) { - fractureActiveCellInfo->setCellResultIndex(cellStartIndex + localCellIdx, fractureActiveStartIndex + fractureActiveIndex); + fractureActiveCellInfo->setCellResultIndex(cellStartIndex + gridLocalCellIndex, fractureActiveStartIndex + fractureActiveIndex); } // Parent cell index - int parentCellIndex = ecl_grid_get_parent_cell1(localEclGrid, localCellIdx); + int parentCellIndex = ecl_grid_get_parent_cell1(localEclGrid, gridLocalCellIndex); if (parentCellIndex == -1) { cell.setParentCellIndex(cvf::UNDEFINED_SIZE_T); @@ -148,14 +148,14 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn int cIdx; for (cIdx = 0; cIdx < 8; ++cIdx) { - double * point = mainGrid->nodes()[nodeStartIndex + localCellIdx * 8 + cellMappingECLRi[cIdx]].ptr(); - ecl_grid_get_corner_xyz1(localEclGrid, localCellIdx, cIdx, &(point[0]), &(point[1]), &(point[2])); + double * point = mainGrid->nodes()[nodeStartIndex + gridLocalCellIndex * 8 + cellMappingECLRi[cIdx]].ptr(); + ecl_grid_get_corner_xyz1(localEclGrid, gridLocalCellIndex, cIdx, &(point[0]), &(point[1]), &(point[2])); point[2] = -point[2]; // Flipping Z making depth become negative z values - cell.cornerIndices()[cIdx] = nodeStartIndex + localCellIdx*8 + cIdx; + cell.cornerIndices()[cIdx] = nodeStartIndex + gridLocalCellIndex*8 + cIdx; } // Sub grid in cell - const ecl_grid_type* subGrid = ecl_grid_get_cell_lgr1(localEclGrid, localCellIdx); + const ecl_grid_type* subGrid = ecl_grid_get_cell_lgr1(localEclGrid, gridLocalCellIndex); if (subGrid != NULL) { int subGridId = ecl_grid_get_lgr_nr(subGrid); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index d7cb997020..39492f74ec 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -1899,10 +1899,10 @@ void RimReservoirView::appendNNCResultInfo(size_t nncIndex, QString* resultInfo) const RigCell& cell = grid->cells()[conn.m_c1GlobIdx]; RigGridBase* hostGrid = cell.hostGrid(); - size_t localCellIndex = cell.cellIndex(); + size_t gridLocalCellIndex = cell.cellIndex(); size_t i, j, k; - if (hostGrid->ijkFromCellIndex(localCellIndex, &i, &j, &k)) + if (hostGrid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k)) { // Adjust to 1-based Eclipse indexing i++; @@ -1921,10 +1921,10 @@ void RimReservoirView::appendNNCResultInfo(size_t nncIndex, QString* resultInfo) const RigCell& cell = grid->cells()[conn.m_c2GlobIdx]; RigGridBase* hostGrid = cell.hostGrid(); - size_t localCellIndex = cell.cellIndex(); + size_t gridLocalCellIndex = cell.cellIndex(); size_t i, j, k; - if (hostGrid->ijkFromCellIndex(localCellIndex, &i, &j, &k)) + if (hostGrid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k)) { // Adjust to 1-based Eclipse indexing i++; diff --git a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp index a72a3b1ec4..7555ad8c4d 100644 --- a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp @@ -35,11 +35,11 @@ RigActiveCellsResultAccessor::RigActiveCellsResultAccessor(const RigGridBase* gr //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigActiveCellsResultAccessor::cellScalar(size_t localCellIndex) const +double RigActiveCellsResultAccessor::cellScalar(size_t gridLocalCellIndex) const { if (m_reservoirResultValues == NULL || m_reservoirResultValues->size() == 0 ) return HUGE_VAL; - size_t globalGridCellIndex = m_grid->globalGridCellIndex(localCellIndex); + size_t globalGridCellIndex = m_grid->globalGridCellIndex(gridLocalCellIndex); size_t resultValueIndex = m_activeCellInfo->cellResultIndex(globalGridCellIndex); if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL; @@ -51,8 +51,8 @@ double RigActiveCellsResultAccessor::cellScalar(size_t localCellIndex) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigActiveCellsResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const +double RigActiveCellsResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const { - return cellScalar(localCellIndex); + return cellScalar(gridLocalCellIndex); } diff --git a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h index 9647033722..4cd7ae73f0 100644 --- a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h @@ -32,8 +32,8 @@ class RigActiveCellsResultAccessor : public RigResultAccessor public: RigActiveCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const RigActiveCellInfo* activeCellInfo); - virtual double cellScalar(size_t localCellIndex) const; - virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; + virtual double cellScalar(size_t gridLocalCellIndex) const; + virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const; private: const RigActiveCellInfo* m_activeCellInfo; diff --git a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp index 5ba549176f..14b7b30a3c 100644 --- a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp @@ -35,11 +35,11 @@ RigAllGridCellsResultAccessor::RigAllGridCellsResultAccessor(const RigGridBase* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigAllGridCellsResultAccessor::cellScalar(size_t localCellIndex) const +double RigAllGridCellsResultAccessor::cellScalar(size_t gridLocalCellIndex) const { if (m_reservoirResultValues->size() == 0 ) return HUGE_VAL; - size_t globalGridCellIndex = m_grid->globalGridCellIndex(localCellIndex); + size_t globalGridCellIndex = m_grid->globalGridCellIndex(gridLocalCellIndex); CVF_TIGHT_ASSERT(globalGridCellIndex < m_reservoirResultValues->size()); return m_reservoirResultValues->at(globalGridCellIndex); @@ -48,8 +48,8 @@ double RigAllGridCellsResultAccessor::cellScalar(size_t localCellIndex) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigAllGridCellsResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const +double RigAllGridCellsResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const { - return cellScalar(localCellIndex); + return cellScalar(gridLocalCellIndex); } diff --git a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h index 840e3f46a7..194b591d4d 100644 --- a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h @@ -31,8 +31,8 @@ class RigAllGridCellsResultAccessor : public RigResultAccessor public: RigAllGridCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues); - virtual double cellScalar(size_t localCellIndex) const; - virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; + virtual double cellScalar(size_t gridLocalCellIndex) const; + virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const; private: const RigGridBase* m_grid; diff --git a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp index 52f1c136da..f21876d427 100644 --- a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp @@ -40,7 +40,7 @@ void RigCellEdgeResultAccessor::setDataAccessObjectForFace(cvf::StructGridInterf //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigCellEdgeResultAccessor::cellScalar(size_t localCellIndex) const +double RigCellEdgeResultAccessor::cellScalar(size_t gridLocalCellIndex) const { // TODO: How to handle when we get here? @@ -52,12 +52,12 @@ double RigCellEdgeResultAccessor::cellScalar(size_t localCellIndex) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigCellEdgeResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const +double RigCellEdgeResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const { const RigResultAccessor* resultAccessObj = m_resultAccessObjects[faceId].p(); if (resultAccessObj != NULL) { - return resultAccessObj->cellFaceScalar(localCellIndex, faceId); + return resultAccessObj->cellFaceScalar(gridLocalCellIndex, faceId); } return HUGE_VAL; diff --git a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h index b6fb3d8534..4ca4d0a09a 100644 --- a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h @@ -33,8 +33,8 @@ public: void setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject); - virtual double cellScalar(size_t localCellIndex) const; - virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; + virtual double cellScalar(size_t gridLocalCellIndex) const; + virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const; private: caf::FixedArray, 6> m_resultAccessObjects; diff --git a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp index 2e67ac5b6f..715a073137 100644 --- a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp @@ -49,7 +49,7 @@ void RigCombTransResultAccessor::setTransResultAccessors(RigResultAccessor* xTra //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigCombTransResultAccessor::cellScalar(size_t localCellIndex) const +double RigCombTransResultAccessor::cellScalar(size_t gridLocalCellIndex) const { CVF_TIGHT_ASSERT(false); @@ -59,7 +59,7 @@ double RigCombTransResultAccessor::cellScalar(size_t localCellIndex) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const +double RigCombTransResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const { switch (faceId) { @@ -67,7 +67,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St { if (m_xTransAccessor.notNull()) { - return m_xTransAccessor->cellScalar(localCellIndex); + return m_xTransAccessor->cellScalar(gridLocalCellIndex); } } break; @@ -76,7 +76,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St if (m_xTransAccessor.notNull()) { size_t i, j, k, neighborGridCellIdx; - m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k); + m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k); if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_I, &neighborGridCellIdx)) { @@ -89,7 +89,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St { if (m_yTransAccessor.notNull()) { - return m_yTransAccessor->cellScalar(localCellIndex); + return m_yTransAccessor->cellScalar(gridLocalCellIndex); } } break; @@ -98,7 +98,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St if (m_yTransAccessor.notNull()) { size_t i, j, k, neighborGridCellIdx; - m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k); + m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k); if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_J, &neighborGridCellIdx)) { @@ -111,7 +111,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St { if (m_zTransAccessor.notNull()) { - return m_zTransAccessor->cellScalar(localCellIndex); + return m_zTransAccessor->cellScalar(gridLocalCellIndex); } } break; @@ -120,7 +120,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St if (m_zTransAccessor.notNull()) { size_t i, j, k, neighborGridCellIdx; - m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k); + m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k); if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_K, &neighborGridCellIdx)) { diff --git a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h index fe9b89128f..2ecdc6202c 100644 --- a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h @@ -37,8 +37,8 @@ public: RigResultAccessor* yTransAccessor, RigResultAccessor* zTransAccessor); - virtual double cellScalar(size_t localCellIndex) const; - virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; + virtual double cellScalar(size_t gridLocalCellIndex) const; + virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const; private: diff --git a/ApplicationCode/ReservoirDataModel/RigFault.cpp b/ApplicationCode/ReservoirDataModel/RigFault.cpp index 6bfaba0dca..8d9cfc5560 100644 --- a/ApplicationCode/ReservoirDataModel/RigFault.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFault.cpp @@ -115,16 +115,16 @@ void RigFault::computeFaultFacesFromCellRanges(const RigMainGrid* mainGrid) } // Do not need to compute global grid cell index as for a maingrid localIndex == globalIndex - //size_t globalCellIndex = grid->globalGridCellIndex(localCellIndex); + //size_t globalCellIndex = grid->globalGridCellIndex(gridLocalCellIndex); size_t ni, nj, nk; mainGrid->neighborIJKAtCellFace(i, j, k, faceEnum, &ni, &nj, &nk); if (ni < mainGrid->cellCountI() && nj < mainGrid->cellCountJ() && nk < mainGrid->cellCountK()) { - size_t localCellIndex = mainGrid->cellIndexFromIJK(i, j, k); + size_t gridLocalCellIndex = mainGrid->cellIndexFromIJK(i, j, k); size_t oppositeCellIndex = mainGrid->cellIndexFromIJK(ni, nj, nk); - m_faultFaces.push_back(FaultFace(localCellIndex, faceEnum, oppositeCellIndex)); + m_faultFaces.push_back(FaultFace(gridLocalCellIndex, faceEnum, oppositeCellIndex)); } else { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigResultAccessor.h index a49bdc62da..1113695e22 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessor.h @@ -31,8 +31,8 @@ class RigResultAccessor : public cvf::Object { public: - virtual double cellScalar(size_t localCellIndex) const = 0; - virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0; + virtual double cellScalar(size_t gridLocalCellIndex) const = 0; + virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0; }; #if 0 @@ -43,8 +43,8 @@ public: class RigResultAccessor2d : public cvf::Object { public: - virtual cvf::Vec2d cellScalar(size_t localCellIndex) const = 0; - virtual cvf::Vec2d cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0; + virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) const = 0; + virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0; virtual QString resultName() const = 0; @@ -61,8 +61,8 @@ public: /// Returns [SOil, SWat] regardless of which one of the three is missing. if Soil or SWat is missing, it is calculated /// based on the two others - virtual cvf::Vec2d cellScalar(size_t localCellIndex) { }; - virtual cvf::Vec2d cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) { return cellScalar(size_t localCellIndex); }; + virtual cvf::Vec2d cellScalar(size_t gridLocalCellIndex) { }; + virtual cvf::Vec2d cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) { return cellScalar(size_t gridLocalCellIndex); }; virtual QString resultName() const = 0; diff --git a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp index a682b5b3cb..567dc990eb 100644 --- a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp @@ -101,8 +101,8 @@ public: { for (size_t i = 0; i < cellCountI; i++) { - size_t localCellIdx = rigGrid->cellIndexFromIJK(i, j, k); - cvf::Vec3d center = rigGrid->cell(localCellIdx).center(); + size_t gridLocalCellIndex = rigGrid->cellIndexFromIJK(i, j, k); + cvf::Vec3d center = rigGrid->cell(gridLocalCellIndex).center(); doubleValues[valueIndex++] = center[coordIdx]; } @@ -268,8 +268,8 @@ public: { for (size_t i = 0; i < cellCountI; i++) { - size_t localCellIdx = rigGrid->cellIndexFromIJK(i, j, k); - rigGrid->cellCornerVertices(localCellIdx, cornerVerts); + size_t gridLocalCellIndex = rigGrid->cellIndexFromIJK(i, j, k); + rigGrid->cellCornerVertices(gridLocalCellIndex, cornerVerts); doubleValues[valueIndex++] = cornerVerts[cornerIndexMapping][coordIdx]; }