mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Store coarsening boxes in RigGridBase
Assign index to coarse cells back to coarse box they are a part of p4#: 21675
This commit is contained in:
@@ -141,10 +141,6 @@ bool transferGridCellData(RigMainGrid* mainGrid, RigActiveCellInfo* activeCellIn
|
||||
cell.setParentCellIndex(parentCellIndex);
|
||||
}
|
||||
|
||||
// Coarse cell info
|
||||
ecl_coarse_cell_type * coarseCellData = ecl_grid_get_cell_coarse_group1( localEclGrid , localCellIdx);
|
||||
cell.setInCoarseCell(coarseCellData != NULL);
|
||||
|
||||
// Corner coordinates
|
||||
int cIdx;
|
||||
for (cIdx = 0; cIdx < 8; ++cIdx)
|
||||
@@ -308,7 +304,8 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid,
|
||||
activeCellInfo->setGridActiveCellCounts(0, globalMatrixActiveSize);
|
||||
fractureActiveCellInfo->setGridActiveCellCounts(0, globalFractureActiveSize);
|
||||
|
||||
|
||||
transferCoarseningInfo(mainEclGrid, mainGrid);
|
||||
|
||||
|
||||
for (lgrIdx = 0; lgrIdx < numLGRs; ++lgrIdx)
|
||||
{
|
||||
@@ -327,6 +324,9 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid,
|
||||
|
||||
activeCellInfo->setGridActiveCellCounts(lgrIdx + 1, matrixActiveCellCount);
|
||||
fractureActiveCellInfo->setGridActiveCellCounts(lgrIdx + 1, fractureActiveCellCount);
|
||||
|
||||
transferCoarseningInfo(localEclGrid, localGrid);
|
||||
|
||||
progInfo.setProgress(3 + lgrIdx);
|
||||
}
|
||||
|
||||
@@ -1024,3 +1024,39 @@ std::vector<QDateTime> RifReaderEclipseOutput::timeSteps()
|
||||
return m_timeSteps;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseOutput::transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid)
|
||||
{
|
||||
int coarseGroupCount = ecl_grid_get_num_coarse_groups(eclGrid);
|
||||
for (int i = 0; i < coarseGroupCount; i++)
|
||||
{
|
||||
ecl_coarse_cell_type* coarse_cell = ecl_grid_iget_coarse_group(eclGrid, i);
|
||||
CVF_ASSERT(coarse_cell);
|
||||
|
||||
size_t i1 = static_cast<size_t>(ecl_coarse_cell_get_i1(coarse_cell));
|
||||
size_t i2 = static_cast<size_t>(ecl_coarse_cell_get_i2(coarse_cell));
|
||||
size_t j1 = static_cast<size_t>(ecl_coarse_cell_get_j1(coarse_cell));
|
||||
size_t j2 = static_cast<size_t>(ecl_coarse_cell_get_j2(coarse_cell));
|
||||
size_t k1 = static_cast<size_t>(ecl_coarse_cell_get_k1(coarse_cell));
|
||||
size_t k2 = static_cast<size_t>(ecl_coarse_cell_get_k2(coarse_cell));
|
||||
|
||||
size_t coarseningBoxIdx = grid->addCoarseningBox(i1, i2, j1, j2, k1, k2);
|
||||
|
||||
for (size_t k = k1; k <= k2; k++)
|
||||
{
|
||||
for (size_t j = j1; j <= j2; j++)
|
||||
{
|
||||
for (size_t i = i1; i <= i2; i++)
|
||||
{
|
||||
size_t cellIdx = grid->cellIndexFromIJK(i, j, k);
|
||||
RigCell c = grid->cell(cellIdx);
|
||||
|
||||
c.setCoarseningBoxIndex(coarseningBoxIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user