Compute active and fracture cell count for all grids

Renamed numActiveCells on maingrid to globalMatrixActiveCellCount
p4#: 20295
This commit is contained in:
Magne Sjaastad
2013-01-30 10:39:45 +01:00
parent 76721130eb
commit 4275e67a82
9 changed files with 95 additions and 15 deletions

View File

@@ -28,7 +28,9 @@
RigGridBase::RigGridBase(RigMainGrid* mainGrid):
m_gridPointDimensions(0,0,0),
m_mainGrid(mainGrid),
m_indexToStartOfCells(0)
m_indexToStartOfCells(0),
m_matrixActiveCellCount(cvf::UNDEFINED_SIZE_T),
m_fractureActiveCellCount(cvf::UNDEFINED_SIZE_T)
{
if (mainGrid == NULL)
{
@@ -524,6 +526,59 @@ double RigGridBase::characteristicCellSize()
return characteristicCellSize;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::activeMatrixCellCount()
{
if (m_matrixActiveCellCount == cvf::UNDEFINED_SIZE_T)
{
computeMatrixAndFractureActiveCellCount();
}
CVF_ASSERT(m_matrixActiveCellCount != cvf::UNDEFINED_SIZE_T);
return m_matrixActiveCellCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGridBase::activeFractureCellCount()
{
if (m_fractureActiveCellCount == cvf::UNDEFINED_SIZE_T)
{
computeMatrixAndFractureActiveCellCount();
}
CVF_ASSERT(m_fractureActiveCellCount != cvf::UNDEFINED_SIZE_T);
return m_fractureActiveCellCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGridBase::computeMatrixAndFractureActiveCellCount()
{
m_matrixActiveCellCount = 0;
m_fractureActiveCellCount = 0;
for (size_t i = 0; i < cellCount(); i++)
{
const RigCell& c = cell(i);
if (c.matrixActive())
{
m_matrixActiveCellCount++;
}
if (c.fractureActive())
{
m_fractureActiveCellCount++;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------