mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Rename from cells to globalCellArray
This commit is contained in:
@@ -99,12 +99,12 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn
|
||||
CVF_ASSERT(activeCellInfo && fractureActiveCellInfo);
|
||||
|
||||
int cellCount = ecl_grid_get_global_size(localEclGrid);
|
||||
size_t cellStartIndex = mainGrid->cells().size();
|
||||
size_t cellStartIndex = mainGrid->globalCellArray().size();
|
||||
size_t nodeStartIndex = mainGrid->nodes().size();
|
||||
|
||||
RigCell defaultCell;
|
||||
defaultCell.setHostGrid(localGrid);
|
||||
mainGrid->cells().resize(cellStartIndex + cellCount, defaultCell);
|
||||
mainGrid->globalCellArray().resize(cellStartIndex + cellCount, defaultCell);
|
||||
|
||||
mainGrid->nodes().resize(nodeStartIndex + cellCount*8, cvf::Vec3d(0,0,0));
|
||||
|
||||
@@ -117,7 +117,7 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn
|
||||
#pragma omp parallel for
|
||||
for (int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex)
|
||||
{
|
||||
RigCell& cell = mainGrid->cells()[cellStartIndex + gridLocalCellIndex];
|
||||
RigCell& cell = mainGrid->globalCellArray()[cellStartIndex + gridLocalCellIndex];
|
||||
|
||||
cell.setGridLocalCellIndex(gridLocalCellIndex);
|
||||
|
||||
@@ -295,7 +295,7 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid,
|
||||
|
||||
// Reserve room for the cells and nodes and fill them with data
|
||||
|
||||
mainGrid->cells().reserve(totalCellCount);
|
||||
mainGrid->globalCellArray().reserve(totalCellCount);
|
||||
mainGrid->nodes().reserve(8*totalCellCount);
|
||||
|
||||
caf::ProgressInfo progInfo(3 + numLGRs, "");
|
||||
@@ -569,7 +569,7 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
|
||||
}
|
||||
|
||||
// Check if number of cells is matching
|
||||
if (m_eclipseCase->mainGrid()->cells().size() != reservoirCellCount)
|
||||
if (m_eclipseCase->mainGrid()->globalCellArray().size() != reservoirCellCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1226,7 +1226,7 @@ void RivEclipseCrossSectionGrid::findIntersectingCells(const cvf::BoundingBox& i
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivEclipseCrossSectionGrid::useCell(size_t cellIndex) const
|
||||
{
|
||||
const RigCell& cell = m_mainGrid->cells()[cellIndex];
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex];
|
||||
|
||||
return !(cell.isInvalid() || (cell.subGrid() != NULL));
|
||||
}
|
||||
@@ -1244,7 +1244,7 @@ void RivEclipseCrossSectionGrid::cellCornerVertices(size_t cellIndex, cvf::Vec3d
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivEclipseCrossSectionGrid::cellCornerIndices(size_t cellIndex, size_t cornerIndices[8]) const
|
||||
{
|
||||
const caf::SizeTArray8& cornerIndicesSource = m_mainGrid->cells()[cellIndex].cornerIndices();
|
||||
const caf::SizeTArray8& cornerIndicesSource = m_mainGrid->globalCellArray()[cellIndex].cornerIndices();
|
||||
memcpy(cornerIndices, cornerIndicesSource.data(), 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ void RivNNCGeometryGenerator::computeArrays()
|
||||
std::vector<RigCell>* allCells = NULL;
|
||||
if (isVisibilityCalcActive)
|
||||
{
|
||||
allCells = &(m_grid->mainGrid()->cells());
|
||||
allCells = &(m_grid->mainGrid()->globalCellArray());
|
||||
}
|
||||
|
||||
#pragma omp parallel for ordered
|
||||
|
||||
@@ -265,7 +265,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
if (eclipseView->eclipseCase() && eclipseView->eclipseCase()->reservoirData() && eclipseView->eclipseCase()->reservoirData()->mainGrid())
|
||||
{
|
||||
caseName = eclipseView->eclipseCase()->caseUserDescription();
|
||||
totCellCount = QString::number(eclipseView->eclipseCase()->reservoirData()->mainGrid()->cells().size());
|
||||
totCellCount = QString::number(eclipseView->eclipseCase()->reservoirData()->mainGrid()->globalCellArray().size());
|
||||
size_t mxActCellCount = eclipseView->eclipseCase()->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount();
|
||||
size_t frActCellCount = eclipseView->eclipseCase()->reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount();
|
||||
if (frActCellCount > 0) activeCellCountText += "Matrix : ";
|
||||
|
||||
@@ -312,7 +312,7 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::
|
||||
{
|
||||
if (sourceCases.size() > 0)
|
||||
{
|
||||
m_reservoirCellCount = sourceCases[0]->reservoirData()->mainGrid()->cells().size();
|
||||
m_reservoirCellCount = sourceCases[0]->reservoirData()->mainGrid()->globalCellArray().size();
|
||||
}
|
||||
|
||||
CVF_ASSERT(m_destinationCase);
|
||||
|
||||
@@ -1578,7 +1578,7 @@ void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilte
|
||||
void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility)
|
||||
{
|
||||
size_t gridCount = this->eclipseCase()->reservoirData()->gridCount();
|
||||
size_t cellCount = this->eclipseCase()->reservoirData()->mainGrid()->cells().size();
|
||||
size_t cellCount = this->eclipseCase()->reservoirData()->mainGrid()->globalCellArray().size();
|
||||
|
||||
totalVisibility->resize(cellCount);
|
||||
totalVisibility->setAll(false);
|
||||
|
||||
@@ -256,7 +256,7 @@ void RimFaultCollection::syncronizeFaults()
|
||||
QString secondConnectionText;
|
||||
|
||||
{
|
||||
const RigCell& cell = mainGrid->cells()[nncConnections[i].m_c1GlobIdx];
|
||||
const RigCell& cell = mainGrid->globalCellArray()[nncConnections[i].m_c1GlobIdx];
|
||||
|
||||
RigGridBase* hostGrid = cell.hostGrid();
|
||||
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
|
||||
@@ -279,7 +279,7 @@ void RimFaultCollection::syncronizeFaults()
|
||||
}
|
||||
|
||||
{
|
||||
const RigCell& cell = mainGrid->cells()[nncConnections[i].m_c2GlobIdx];
|
||||
const RigCell& cell = mainGrid->globalCellArray()[nncConnections[i].m_c2GlobIdx];
|
||||
|
||||
RigGridBase* hostGrid = cell.hostGrid();
|
||||
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
|
||||
|
||||
@@ -294,8 +294,8 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
|
||||
return;
|
||||
}
|
||||
|
||||
m_unionOfMatrixActiveCells->setReservoirCellCount(m_mainGrid->cells().size());
|
||||
m_unionOfFractureActiveCells->setReservoirCellCount(m_mainGrid->cells().size());
|
||||
m_unionOfMatrixActiveCells->setReservoirCellCount(m_mainGrid->globalCellArray().size());
|
||||
m_unionOfFractureActiveCells->setReservoirCellCount(m_mainGrid->globalCellArray().size());
|
||||
m_unionOfMatrixActiveCells->setGridCount(m_mainGrid->gridCount());
|
||||
m_unionOfFractureActiveCells->setGridCount(m_mainGrid->gridCount());
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ void RimReservoirCellResultsStorage::computeDepthRelatedResults()
|
||||
bool computeTops = false;
|
||||
bool computeBottom = false;
|
||||
|
||||
size_t resultValueCount = m_ownerMainGrid->cells().size();
|
||||
size_t resultValueCount = m_ownerMainGrid->globalCellArray().size();
|
||||
|
||||
if (depthResultGridIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
@@ -635,9 +635,9 @@ void RimReservoirCellResultsStorage::computeDepthRelatedResults()
|
||||
std::vector< std::vector<double> >& bottom = m_cellResults->cellScalarResults(bottomResultGridIndex);
|
||||
|
||||
size_t cellIdx = 0;
|
||||
for (cellIdx = 0; cellIdx < m_ownerMainGrid->cells().size(); cellIdx++)
|
||||
for (cellIdx = 0; cellIdx < m_ownerMainGrid->globalCellArray().size(); cellIdx++)
|
||||
{
|
||||
const RigCell& cell = m_ownerMainGrid->cells()[cellIdx];
|
||||
const RigCell& cell = m_ownerMainGrid->globalCellArray()[cellIdx];
|
||||
|
||||
if (computeDepth)
|
||||
{
|
||||
@@ -866,14 +866,14 @@ void RimReservoirCellResultsStorage::computeRiTransComponent(const QString& riTr
|
||||
const std::vector<cvf::Vec3d>& nodes = m_ownerMainGrid->nodes();
|
||||
bool isFaceNormalsOutwards = m_ownerMainGrid->isFaceNormalsOutwards();
|
||||
|
||||
for (size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->cells().size(); nativeResvCellIndex++)
|
||||
for (size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->globalCellArray().size(); nativeResvCellIndex++)
|
||||
{
|
||||
// Do nothing if we are only dealing with active cells, and this cell is not active:
|
||||
size_t tranResIdx = (*riTranIdxFunc)(activeCellInfo, nativeResvCellIndex);
|
||||
|
||||
if (tranResIdx == cvf::UNDEFINED_SIZE_T) continue;
|
||||
|
||||
const RigCell& nativeCell = m_ownerMainGrid->cells()[nativeResvCellIndex];
|
||||
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
|
||||
RigGridBase* grid = nativeCell.hostGrid();
|
||||
|
||||
size_t gridLocalNativeCellIndex = nativeCell.gridLocalCellIndex();
|
||||
@@ -885,7 +885,7 @@ void RimReservoirCellResultsStorage::computeRiTransComponent(const QString& riTr
|
||||
if (grid->cellIJKNeighbor(i, j, k, faceId, &gridLocalNeighborCellIdx))
|
||||
{
|
||||
size_t neighborResvCellIdx = grid->reservoirCellIndex(gridLocalNeighborCellIdx);
|
||||
const RigCell& neighborCell = m_ownerMainGrid->cells()[neighborResvCellIdx];
|
||||
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
|
||||
|
||||
// Do nothing if neighbor cell has no results
|
||||
size_t neighborCellPermResIdx = (*permIdxFunc)(activeCellInfo, neighborResvCellIdx);
|
||||
@@ -1059,8 +1059,8 @@ void RimReservoirCellResultsStorage::computeNncCombRiTrans()
|
||||
if (neighborCellPermResIdx == cvf::UNDEFINED_SIZE_T) continue;
|
||||
|
||||
|
||||
const RigCell& nativeCell = m_ownerMainGrid->cells()[nativeResvCellIndex];
|
||||
const RigCell& neighborCell = m_ownerMainGrid->cells()[neighborResvCellIdx];
|
||||
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
|
||||
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
|
||||
|
||||
|
||||
// Connection geometry
|
||||
@@ -1299,14 +1299,14 @@ void RimReservoirCellResultsStorage::computeRiTRANSbyAreaComponent(const QString
|
||||
const RigActiveCellInfo* activeCellInfo = m_cellResults->activeCellInfo();
|
||||
const std::vector<cvf::Vec3d>& nodes = m_ownerMainGrid->nodes();
|
||||
|
||||
for (size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->cells().size(); nativeResvCellIndex++)
|
||||
for (size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->globalCellArray().size(); nativeResvCellIndex++)
|
||||
{
|
||||
// Do nothing if we are only dealing with active cells, and this cell is not active:
|
||||
size_t nativeCellResValIdx = (*resValIdxFunc)(activeCellInfo, nativeResvCellIndex);
|
||||
|
||||
if (nativeCellResValIdx == cvf::UNDEFINED_SIZE_T) continue;
|
||||
|
||||
const RigCell& nativeCell = m_ownerMainGrid->cells()[nativeResvCellIndex];
|
||||
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
|
||||
RigGridBase* grid = nativeCell.hostGrid();
|
||||
|
||||
size_t gridLocalNativeCellIndex = nativeCell.gridLocalCellIndex();
|
||||
@@ -1318,7 +1318,7 @@ void RimReservoirCellResultsStorage::computeRiTRANSbyAreaComponent(const QString
|
||||
if (grid->cellIJKNeighbor(i, j, k, faceId, &gridLocalNeighborCellIdx))
|
||||
{
|
||||
size_t neighborResvCellIdx = grid->reservoirCellIndex(gridLocalNeighborCellIdx);
|
||||
const RigCell& neighborCell = m_ownerMainGrid->cells()[neighborResvCellIdx];
|
||||
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
|
||||
|
||||
// Connection geometry
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ bool RigCaseCellResultsData::isUsingGlobalActiveIndex(size_t scalarResultIndex)
|
||||
if (!m_cellScalarResults[scalarResultIndex].size()) return true;
|
||||
|
||||
size_t firstTimeStepResultValueCount = m_cellScalarResults[scalarResultIndex][0].size();
|
||||
if (firstTimeStepResultValueCount == m_ownerMainGrid->cells().size()) return false;
|
||||
if (firstTimeStepResultValueCount == m_ownerMainGrid->globalCellArray().size()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ void RigCaseData::computeActiveCellsGeometryBoundingBox()
|
||||
{
|
||||
if (activeInfos[acIdx]->isActive(i))
|
||||
{
|
||||
const RigCell& c = m_mainGrid->cells()[i];
|
||||
const RigCell& c = m_mainGrid->globalCellArray()[i];
|
||||
const caf::SizeTArray8& indices = c.cornerIndices();
|
||||
|
||||
size_t idx;
|
||||
|
||||
@@ -34,7 +34,7 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigMainGrid* masterEclGrid, Rig
|
||||
m_masterFemPart(NULL),
|
||||
m_dependentFemPart(NULL)
|
||||
{
|
||||
m_masterCellOrIntervalIndex.resize(dependentEclGrid->cells().size(), cvf::UNDEFINED_INT);
|
||||
m_masterCellOrIntervalIndex.resize(dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT);
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigM
|
||||
m_masterFemPart(masterFemPart),
|
||||
m_dependentFemPart(NULL)
|
||||
{
|
||||
m_masterCellOrIntervalIndex.resize(dependentEclGrid->cells().size(), cvf::UNDEFINED_INT);
|
||||
m_masterCellOrIntervalIndex.resize(dependentEclGrid->globalCellArray().size(), cvf::UNDEFINED_INT);
|
||||
this->calculateEclToGeomCellMapping(dependentEclGrid, masterFemPart, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
if (offsetK > 0 && m_baseK == m_mainGrid->cellCountK()-1) return NULL;
|
||||
|
||||
size_t gridLocalCellIndex = m_mainGrid->cellIndexFromIJK(m_baseI + offsetI, m_baseJ + offsetJ, m_baseK + offsetK);
|
||||
const RigCell& cell = m_mainGrid->cells()[gridLocalCellIndex];
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[gridLocalCellIndex];
|
||||
return &(cell.cornerIndices());
|
||||
}
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ RigCaseToCaseRangeFilterMapper::findBestFemCellFromEclCell(const RigMainGrid* ma
|
||||
|
||||
size_t cellIdx = masterEclGrid->cellIndexFromIJK(ei, ej, ek);
|
||||
|
||||
bool isCollapsedCell = masterEclGrid->cells()[cellIdx].isCollapsedCell();
|
||||
bool isCollapsedCell = masterEclGrid->globalCellArray()[cellIdx].isCollapsedCell();
|
||||
|
||||
cvf::Vec3d geoMechConvertedEclCell[8];
|
||||
RigCaseToCaseCellMapperTools::estimatedFemCellFromEclCell(masterEclGrid, cellIdx, geoMechConvertedEclCell);
|
||||
@@ -475,7 +475,7 @@ RigCaseToCaseRangeFilterMapper::findBestEclCellFromFemCell(const RigFemPart* dep
|
||||
if (globCellIdxToBestMatch != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
masterEclGrid->ijkFromCellIndex(globCellIdxToBestMatch, ei, ej, ek);
|
||||
isCollapsedCell = masterEclGrid->cells()[globCellIdxToBestMatch].isCollapsedCell();
|
||||
isCollapsedCell = masterEclGrid->globalCellArray()[globCellIdxToBestMatch].isCollapsedCell();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
cvf::Vec3d hexCorners[8];
|
||||
for (size_t cIdx = 0; cIdx < closeCells.size(); ++cIdx)
|
||||
{
|
||||
const RigCell& cell = m_caseData->mainGrid()->cells()[closeCells[cIdx]];
|
||||
const RigCell& cell = m_caseData->mainGrid()->globalCellArray()[closeCells[cIdx]];
|
||||
const caf::SizeTArray8& cornerIndices = cell.cornerIndices();
|
||||
|
||||
hexCorners[0] = nodeCoords[cornerIndices[0]];
|
||||
|
||||
@@ -72,9 +72,9 @@ RigCell& RigGridBase::cell(size_t gridLocalCellIndex)
|
||||
{
|
||||
CVF_ASSERT(m_mainGrid);
|
||||
|
||||
CVF_ASSERT(m_indexToStartOfCells + gridLocalCellIndex < m_mainGrid->cells().size());
|
||||
CVF_ASSERT(m_indexToStartOfCells + gridLocalCellIndex < m_mainGrid->globalCellArray().size());
|
||||
|
||||
return m_mainGrid->cells()[m_indexToStartOfCells + gridLocalCellIndex];
|
||||
return m_mainGrid->globalCellArray()[m_indexToStartOfCells + gridLocalCellIndex];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -84,7 +84,7 @@ const RigCell& RigGridBase::cell(size_t gridLocalCellIndex) const
|
||||
{
|
||||
CVF_ASSERT(m_mainGrid);
|
||||
|
||||
return m_mainGrid->cells()[m_indexToStartOfCells + gridLocalCellIndex];
|
||||
return m_mainGrid->globalCellArray()[m_indexToStartOfCells + gridLocalCellIndex];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
std::vector<cvf::Vec3d>& nodes() {return m_nodes;}
|
||||
const std::vector<cvf::Vec3d>& nodes() const {return m_nodes;}
|
||||
|
||||
std::vector<RigCell>& cells() {return m_cells;}
|
||||
const std::vector<RigCell>& cells() const {return m_cells;}
|
||||
std::vector<RigCell>& globalCellArray() {return m_cells;}
|
||||
const std::vector<RigCell>& globalCellArray() const {return m_cells;}
|
||||
|
||||
void addLocalGrid(RigLocalGrid* localGrid);
|
||||
size_t gridCount() const { return m_localGrids.size() + 1; }
|
||||
|
||||
@@ -40,8 +40,8 @@ void RigNNCData::processConnections(const RigMainGrid& mainGrid)
|
||||
|
||||
for (size_t cnIdx = 0; cnIdx < m_connections.size(); ++cnIdx)
|
||||
{
|
||||
const RigCell& c1 = mainGrid.cells()[m_connections[cnIdx].m_c1GlobIdx];
|
||||
const RigCell& c2 = mainGrid.cells()[m_connections[cnIdx].m_c2GlobIdx];
|
||||
const RigCell& c1 = mainGrid.globalCellArray()[m_connections[cnIdx].m_c1GlobIdx];
|
||||
const RigCell& c2 = mainGrid.globalCellArray()[m_connections[cnIdx].m_c2GlobIdx];
|
||||
|
||||
// Try to find the shared face
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ void RigReservoirBuilderMock::populateReservoir(RigCaseData* eclipseCase)
|
||||
size_t mainGridCellCount = mainGridNodeCount / 8;
|
||||
|
||||
// Must create cells in main grid here, as this information is used when creating LGRs
|
||||
appendCells(0, mainGridCellCount, eclipseCase->mainGrid(), eclipseCase->mainGrid()->cells());
|
||||
appendCells(0, mainGridCellCount, eclipseCase->mainGrid(), eclipseCase->mainGrid()->globalCellArray());
|
||||
|
||||
size_t totalCellCount = mainGridCellCount;
|
||||
|
||||
@@ -217,7 +217,7 @@ void RigReservoirBuilderMock::populateReservoir(RigCaseData* eclipseCase)
|
||||
size_t cellIdx;
|
||||
for (cellIdx = 0; cellIdx < mainGridIndicesWithSubGrid.size(); cellIdx++)
|
||||
{
|
||||
RigCell& cell = eclipseCase->mainGrid()->cells()[mainGridIndicesWithSubGrid[cellIdx]];
|
||||
RigCell& cell = eclipseCase->mainGrid()->globalCellArray()[mainGridIndicesWithSubGrid[cellIdx]];
|
||||
|
||||
caf::SizeTArray8& indices = cell.cornerIndices();
|
||||
int nodeIdx;
|
||||
@@ -233,7 +233,7 @@ void RigReservoirBuilderMock::populateReservoir(RigCaseData* eclipseCase)
|
||||
appendNodes(bb.min(), bb.max(), lgrCellDimensions, mainGridNodes);
|
||||
|
||||
size_t subGridCellCount = (mainGridNodes.size() / 8) - totalCellCount;
|
||||
appendCells(totalCellCount*8, subGridCellCount, localGrid, eclipseCase->mainGrid()->cells());
|
||||
appendCells(totalCellCount*8, subGridCellCount, localGrid, eclipseCase->mainGrid()->globalCellArray());
|
||||
totalCellCount += subGridCellCount;
|
||||
}
|
||||
|
||||
@@ -248,14 +248,14 @@ void RigReservoirBuilderMock::populateReservoir(RigCaseData* eclipseCase)
|
||||
|
||||
// Set all cells active
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->cells().size());
|
||||
for (size_t i = 0; i < eclipseCase->mainGrid()->cells().size(); i++)
|
||||
activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->globalCellArray().size());
|
||||
for (size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++)
|
||||
{
|
||||
activeCellInfo->setCellResultIndex(i, i);
|
||||
}
|
||||
|
||||
activeCellInfo->setGridCount(1);
|
||||
activeCellInfo->setGridActiveCellCounts(0, eclipseCase->mainGrid()->cells().size());
|
||||
activeCellInfo->setGridActiveCellCounts(0, eclipseCase->mainGrid()->globalCellArray().size());
|
||||
activeCellInfo->computeDerivedData();
|
||||
|
||||
// Add grid coarsening for main grid
|
||||
@@ -300,7 +300,7 @@ bool RigReservoirBuilderMock::inputProperty(RigCaseData* eclipseCase, const QStr
|
||||
/* generate secret number: */
|
||||
int iSecret = rand() % 20 + 1;
|
||||
|
||||
for (k = 0; k < eclipseCase->mainGrid()->cells().size(); k++)
|
||||
for (k = 0; k < eclipseCase->mainGrid()->globalCellArray().size(); k++)
|
||||
{
|
||||
values->push_back(k * iSecret);
|
||||
}
|
||||
@@ -313,12 +313,12 @@ bool RigReservoirBuilderMock::inputProperty(RigCaseData* eclipseCase, const QStr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigReservoirBuilderMock::staticResult(RigCaseData* eclipseCase, const QString& result, std::vector<double>* values)
|
||||
{
|
||||
values->resize(eclipseCase->mainGrid()->cells().size());
|
||||
values->resize(eclipseCase->mainGrid()->globalCellArray().size());
|
||||
|
||||
#pragma omp parallel for
|
||||
for (long long k = 0; k < static_cast<long long>(eclipseCase->mainGrid()->cells().size()); k++)
|
||||
for (long long k = 0; k < static_cast<long long>(eclipseCase->mainGrid()->globalCellArray().size()); k++)
|
||||
{
|
||||
values->at(k) = (k * 2) % eclipseCase->mainGrid()->cells().size();
|
||||
values->at(k) = (k * 2) % eclipseCase->mainGrid()->globalCellArray().size();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -341,12 +341,12 @@ bool RigReservoirBuilderMock::dynamicResult(RigCaseData* eclipseCase, const QStr
|
||||
double scaleValue = 1.0 + resultIndex * 0.1;
|
||||
double offsetValue = 100 * resultIndex;
|
||||
|
||||
values->resize(eclipseCase->mainGrid()->cells().size());
|
||||
values->resize(eclipseCase->mainGrid()->globalCellArray().size());
|
||||
|
||||
#pragma omp parallel for
|
||||
for (long long k = 0; k < static_cast<long long>(eclipseCase->mainGrid()->cells().size()); k++)
|
||||
for (long long k = 0; k < static_cast<long long>(eclipseCase->mainGrid()->globalCellArray().size()); k++)
|
||||
{
|
||||
double val = offsetValue + scaleValue * ( (stepIndex * 1000 + k) % eclipseCase->mainGrid()->cells().size() );
|
||||
double val = offsetValue + scaleValue * ( (stepIndex * 1000 + k) % eclipseCase->mainGrid()->globalCellArray().size() );
|
||||
values->at(k) = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
hostCellK.reserve(numMatrixModelActiveCells);
|
||||
globalCoarseningBoxIdx.reserve(numMatrixModelActiveCells);
|
||||
|
||||
const std::vector<RigCell>& reservoirCells = reservoirCase->reservoirData()->mainGrid()->cells();
|
||||
const std::vector<RigCell>& reservoirCells = reservoirCase->reservoirData()->mainGrid()->globalCellArray();
|
||||
|
||||
|
||||
std::vector<size_t> globalCoarseningBoxIndexStart;
|
||||
|
||||
@@ -178,11 +178,11 @@ public:
|
||||
{
|
||||
quint64 valueIndex = 0;
|
||||
|
||||
for (size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->cells().size(); reservoirCellIndex++)
|
||||
for (size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->globalCellArray().size(); reservoirCellIndex++)
|
||||
{
|
||||
if (!actCellInfo->isActive(reservoirCellIndex)) continue;
|
||||
|
||||
cvf::Vec3d center = mainGrid->cells()[reservoirCellIndex].center();
|
||||
cvf::Vec3d center = mainGrid->globalCellArray()[reservoirCellIndex].center();
|
||||
|
||||
doubleValues[valueIndex++] = center[coordIdx];
|
||||
}
|
||||
@@ -352,7 +352,7 @@ public:
|
||||
|
||||
quint64 valueIndex = 0;
|
||||
|
||||
for (size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->cells().size(); reservoirCellIndex++)
|
||||
for (size_t reservoirCellIndex = 0; reservoirCellIndex < mainGrid->globalCellArray().size(); reservoirCellIndex++)
|
||||
{
|
||||
if (!actCellInfo->isActive(reservoirCellIndex)) continue;
|
||||
|
||||
|
||||
@@ -949,7 +949,7 @@ public:
|
||||
// The size of this array must match the test in RigCaseCellResultsData::isUsingGlobalActiveIndex(),
|
||||
// as it is used to determine if we have data for active cells or all cells
|
||||
// See RigCaseCellResultsData::isUsingGlobalActiveIndex()
|
||||
size_t totalNumberOfCellsIncludingLgrCells = grid->mainGrid()->cells().size();
|
||||
size_t totalNumberOfCellsIncludingLgrCells = grid->mainGrid()->globalCellArray().size();
|
||||
|
||||
m_scalarResultsToAdd->at(tsId).resize(totalNumberOfCellsIncludingLgrCells, HUGE_VAL);
|
||||
}
|
||||
|
||||
@@ -515,8 +515,8 @@ QString RiuResultTextBuilder::nncDetails()
|
||||
|
||||
// First cell of NNC
|
||||
{
|
||||
CVF_ASSERT(conn.m_c1GlobIdx < grid->cells().size());
|
||||
const RigCell& cell = grid->cells()[conn.m_c1GlobIdx];
|
||||
CVF_ASSERT(conn.m_c1GlobIdx < grid->globalCellArray().size());
|
||||
const RigCell& cell = grid->globalCellArray()[conn.m_c1GlobIdx];
|
||||
|
||||
RigGridBase* hostGrid = cell.hostGrid();
|
||||
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
|
||||
@@ -536,8 +536,8 @@ QString RiuResultTextBuilder::nncDetails()
|
||||
|
||||
// Second cell of NNC
|
||||
{
|
||||
CVF_ASSERT(conn.m_c2GlobIdx < grid->cells().size());
|
||||
const RigCell& cell = grid->cells()[conn.m_c2GlobIdx];
|
||||
CVF_ASSERT(conn.m_c2GlobIdx < grid->globalCellArray().size());
|
||||
const RigCell& cell = grid->globalCellArray()[conn.m_c2GlobIdx];
|
||||
|
||||
RigGridBase* hostGrid = cell.hostGrid();
|
||||
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
|
||||
|
||||
@@ -450,7 +450,7 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
|
||||
{
|
||||
size_t globalCellIndex = crossSectionSourceInfo->triangleToCellIndex()[firstPartTriangleIndex];
|
||||
|
||||
const RigCell& cell = eclipseView->eclipseCase()->reservoirData()->mainGrid()->cells()[globalCellIndex];
|
||||
const RigCell& cell = eclipseView->eclipseCase()->reservoirData()->mainGrid()->globalCellArray()[globalCellIndex];
|
||||
cellIndex = cell.gridLocalCellIndex();
|
||||
gridIndex = cell.hostGrid()->gridIndex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user