mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Compute active and fracture cell count for all grids
Renamed numActiveCells on maingrid to globalMatrixActiveCellCount p4#: 20295
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user