#3531 Temporary LGR : Simplify adding of grid to active cell info

This commit is contained in:
Magne Sjaastad
2018-10-24 12:07:36 +02:00
parent e33bfc895f
commit 6445ab05fe
5 changed files with 38 additions and 26 deletions

View File

@@ -196,21 +196,21 @@ void RigActiveCellInfo::clear()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::addLgr(int lgrStartIndex, int cellCount)
void RigActiveCellInfo::addLgr(size_t cellCount)
{
GridActiveCellCounts count;
count.setActiveCellCount(cellCount);
m_perGridActiveCellInfo.push_back(count);
size_t currentGridCount = m_perGridActiveCellInfo.size();
size_t currentActiveCellCount = reservoirActiveCellCount();
size_t currentReservoirCellCount = reservoirCellCount();
auto prevActiveCount = m_reservoirActiveCellCount;
auto newActiveCount = prevActiveCount + cellCount;
m_cellIndexToResultIndex.resize(lgrStartIndex + cellCount, cvf::UNDEFINED_SIZE_T);
m_reservoirActiveCellCount = newActiveCount;
m_reservoirCellResultCount = newActiveCount;
setGridCount(currentGridCount + 1);
setGridActiveCellCounts(currentGridCount, cellCount);
setReservoirCellCount(currentReservoirCellCount + cellCount);
for (int i = 0; i < cellCount; i++)
computeDerivedData();
for (size_t i = 0; i < cellCount; i++)
{
m_cellIndexToResultIndex[lgrStartIndex + i] = prevActiveCount + i;
setCellResultIndex(currentReservoirCellCount + i, currentActiveCellCount + i);
}
}

View File

@@ -56,7 +56,7 @@ public:
void clear();
void addLgr(int lgrStartIndex, int cellCount);
void addLgr(size_t cellCount);
private:
class GridActiveCellCounts