From 1a235529ac1c3fb9f57382dd1d83d9e114c02ccb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 25 Feb 2013 14:07:59 +0100 Subject: [PATCH] Removed active cell info from RigCell Set all cells active for mock models p4#: 20614 --- .../FileInterface/RifReaderEclipseOutput.cpp | 5 --- .../ProjectDataModel/RimInputReservoir.cpp | 8 +++-- .../ProjectDataModel/RimResultReservoir.cpp | 8 +++-- .../ReservoirDataModel/RigCell.cpp | 1 - ApplicationCode/ReservoirDataModel/RigCell.h | 6 ---- .../RigReservoirBuilderMock.cpp | 34 ++++++++----------- 6 files changed, 26 insertions(+), 36 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 597da8587e..a405e20190 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -118,13 +118,8 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn int matrixActiveIndex = ecl_grid_get_active_index1(localEclGrid, localCellIdx); if (matrixActiveIndex != -1) { - cell.setActiveIndexInMatrixModel(matrixActiveStartIndex + matrixActiveIndex); activeCellInfo->setActiveIndexInMatrixModel(cellStartIndex + localCellIdx, matrixActiveStartIndex + matrixActiveIndex); } - else - { - cell.setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); - } int fractureActiveIndex = ecl_grid_get_active_fracture_index1(localEclGrid, localCellIdx); if (fractureActiveIndex != -1) diff --git a/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp b/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp index f79fd5c6d2..27c50d2e63 100644 --- a/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp @@ -383,12 +383,16 @@ cvf::ref RimInputReservoir::createMockModel(QString modelNam mockFileInterface->open("", reservoir.p()); { size_t idx = reservoir->mainGrid()->cellIndexFromIJK(1, 3, 4); - reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); + + //TODO: Rewrite active cell info in mock models + //reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); } { size_t idx = reservoir->mainGrid()->cellIndexFromIJK(2, 2, 3); - reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); + + //TODO: Rewrite active cell info in mock models + //reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); } // Add a property diff --git a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp index a312b79ceb..5461b8b8f2 100644 --- a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp @@ -109,12 +109,16 @@ cvf::ref RimResultReservoir::createMockModel(QString modelNa mockFileInterface->open("", reservoir.p()); { size_t idx = reservoir->mainGrid()->cellIndexFromIJK(1, 3, 4); - reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); + + //TODO: Rewrite active cell info in mock models + //reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); } { size_t idx = reservoir->mainGrid()->cellIndexFromIJK(2, 2, 3); - reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); + + //TODO: Rewrite active cell info in mock models + //reservoir->mainGrid()->cell(idx).setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); } } else if (modelName == "Result Mock Debug Model With Results") diff --git a/ApplicationCode/ReservoirDataModel/RigCell.cpp b/ApplicationCode/ReservoirDataModel/RigCell.cpp index 1228fa9860..84f16b9fdc 100644 --- a/ApplicationCode/ReservoirDataModel/RigCell.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCell.cpp @@ -42,7 +42,6 @@ RigCell::RigCell() : m_hostGrid(NULL), m_isInvalid(false), m_isWellCell(false), - m_activeIndexInMatrixModel(cvf::UNDEFINED_SIZE_T), m_cellIndex(cvf::UNDEFINED_SIZE_T), m_isInCoarseCell(false) { diff --git a/ApplicationCode/ReservoirDataModel/RigCell.h b/ApplicationCode/ReservoirDataModel/RigCell.h index a6ee7c6395..f328103f05 100644 --- a/ApplicationCode/ReservoirDataModel/RigCell.h +++ b/ApplicationCode/ReservoirDataModel/RigCell.h @@ -37,10 +37,6 @@ public: caf::SizeTArray8& cornerIndices() { return m_cornerIndices;} const caf::SizeTArray8& cornerIndices() const { return m_cornerIndices;} - bool isActiveInMatrixModel() const { return m_activeIndexInMatrixModel != cvf::UNDEFINED_SIZE_T; } - size_t activeIndexInMatrixModel() const { return m_activeIndexInMatrixModel; } - void setActiveIndexInMatrixModel(size_t val) { m_activeIndexInMatrixModel = val; } - bool isInvalid() const { return m_isInvalid; } void setInvalid( bool val ) { m_isInvalid = val; } @@ -89,6 +85,4 @@ private: // Result case specific data bool m_isWellCell; - - size_t m_activeIndexInMatrixModel; ///< This cell's running index of all the active calls (matrix) in the reservoir }; diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp index 3b6fc38cd0..00efac4260 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp @@ -152,6 +152,8 @@ void RigReservoirBuilderMock::appendCells(size_t nodeStartIndex, size_t cellCoun riCell.setParentCellIndex(0); + //TODO: Rewrite active cell info in mock models + /* if (!(i % 5)) { riCell.setActiveIndexInMatrixModel(cvf::UNDEFINED_SIZE_T); @@ -160,6 +162,7 @@ void RigReservoirBuilderMock::appendCells(size_t nodeStartIndex, size_t cellCoun { riCell.setActiveIndexInMatrixModel(activeCellIndex++); } + */ cells.push_back(riCell); } @@ -242,6 +245,14 @@ void RigReservoirBuilderMock::populateReservoir(RigEclipseCase* eclipseCase) eclipseCase->mainGrid()->setGridPointDimensions(m_gridPointDimensions); addWellData(eclipseCase, eclipseCase->mainGrid()); + + // Set all cells active + RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(); + activeCellInfo->setGlobalCellCount(eclipseCase->mainGrid()->cells().size()); + for (size_t i = 0; i < eclipseCase->mainGrid()->cells().size(); i++) + { + activeCellInfo->setActiveIndexInMatrixModel(i, i); + } } @@ -293,17 +304,8 @@ bool RigReservoirBuilderMock::staticResult(RigEclipseCase* eclipseCase, const QS for (k = 0; k < eclipseCase->mainGrid()->cells().size(); k++) { - RigCell& cell = eclipseCase->mainGrid()->cells()[k]; - if (cell.isActiveInMatrixModel()) { - if (cell.hostGrid() == eclipseCase->mainGrid()) - { - values->push_back((k * 2) % eclipseCase->mainGrid()->cells().size()); - } - else - { - values->push_back(500); - } + values->push_back((k * 2) % eclipseCase->mainGrid()->cells().size()); } } @@ -331,17 +333,9 @@ bool RigReservoirBuilderMock::dynamicResult(RigEclipseCase* eclipseCase, const Q for (k = 0; k < eclipseCase->mainGrid()->cells().size(); k++) { RigCell& cell = eclipseCase->mainGrid()->cells()[k]; - if (cell.isActiveInMatrixModel()) { - if (cell.hostGrid() == eclipseCase->mainGrid()) - { - double val = offsetValue + scaleValue * ( (stepIndex * 1000 + k) % eclipseCase->mainGrid()->cells().size() ); - values->push_back(val); - } - else - { - values->push_back(500); - } + double val = offsetValue + scaleValue * ( (stepIndex * 1000 + k) % eclipseCase->mainGrid()->cells().size() ); + values->push_back(val); } }