One shared active cell info for all statistical cases

Invalidate existing statisticsCases when adding/removing source cases
Moved computation of active cell union from RigStatistics to RimIdenticalGridCaseGroup
Recompute active cell union when opening project file
p4#: 21023
This commit is contained in:
Magne Sjaastad
2013-03-21 10:31:58 +01:00
parent 92bd95d683
commit a5fb1e1764
14 changed files with 244 additions and 138 deletions

View File

@@ -45,7 +45,7 @@ bool RigActiveCellInfo::isActiveInMatrixModel(size_t globalCellIndex) const
{
if (m_activeInMatrixModel.size() == 0)
{
return false;
return true;
}
CVF_TIGHT_ASSERT(globalCellIndex < m_activeInMatrixModel.size());
@@ -60,7 +60,7 @@ size_t RigActiveCellInfo::activeIndexInMatrixModel(size_t globalCellIndex) const
{
if (m_activeInMatrixModel.size() == 0)
{
return cvf::UNDEFINED_SIZE_T;
return globalCellIndex;
}
CVF_TIGHT_ASSERT(globalCellIndex < m_activeInMatrixModel.size());

View File

@@ -27,7 +27,7 @@
class RigActiveCellInfo
class RigActiveCellInfo : public cvf::Object
{
public:
RigActiveCellInfo();

View File

@@ -30,6 +30,9 @@ RigEclipseCase::RigEclipseCase()
m_matrixModelResults = new RigReservoirCellResults(m_mainGrid.p());
m_fractureModelResults = new RigReservoirCellResults(m_mainGrid.p());
m_activeCellInfo = new RigActiveCellInfo;
m_fractureActiveCellInfo = new RigActiveCellInfo;
}
//--------------------------------------------------------------------------------------------------
@@ -285,19 +288,19 @@ void RigEclipseCase::computeActiveCellData()
size_t i, j, k;
m_mainGrid->ijkFromCellIndex(idx, &i, &j, &k);
if (m_activeCellInfo.isActiveInMatrixModel(idx))
if (m_activeCellInfo->isActiveInMatrixModel(idx))
{
matrixModelActiveBB.add(i, j, k);
}
if (m_fractureActiveCellInfo.isActiveInMatrixModel(idx))
if (m_fractureActiveCellInfo->isActiveInMatrixModel(idx))
{
fractureModelActiveBB.add(i, j, k);
}
}
m_activeCellInfo.setMatrixModelActiveCellsBoundingBox(matrixModelActiveBB.m_min, matrixModelActiveBB.m_max);
m_fractureActiveCellInfo.setMatrixModelActiveCellsBoundingBox(fractureModelActiveBB.m_min, fractureModelActiveBB.m_max);
m_activeCellInfo->setMatrixModelActiveCellsBoundingBox(matrixModelActiveBB.m_min, matrixModelActiveBB.m_max);
m_fractureActiveCellInfo->setMatrixModelActiveCellsBoundingBox(fractureModelActiveBB.m_min, fractureModelActiveBB.m_max);
}
//--------------------------------------------------------------------------------------------------
@@ -316,10 +319,10 @@ RigActiveCellInfo* RigEclipseCase::activeCellInfo(RifReaderInterface::PorosityMo
{
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
{
return &m_activeCellInfo;
return m_activeCellInfo.p();
}
return &m_fractureActiveCellInfo;
return m_fractureActiveCellInfo.p();
}
//--------------------------------------------------------------------------------------------------
@@ -329,12 +332,28 @@ const RigActiveCellInfo* RigEclipseCase::activeCellInfo(RifReaderInterface::Poro
{
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
{
return &m_activeCellInfo;
return m_activeCellInfo.p();
}
return &m_fractureActiveCellInfo;
return m_fractureActiveCellInfo.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCase::setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo)
{
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
{
m_activeCellInfo = activeCellInfo;
}
else
{
m_fractureActiveCellInfo = activeCellInfo;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -343,14 +362,14 @@ void RigEclipseCase::computeActiveCellsGeometryBoundingBox()
if (m_mainGrid.isNull())
{
cvf::BoundingBox bb;
m_activeCellInfo.setMatrixActiveCellsGeometryBoundingBox(bb);
m_fractureActiveCellInfo.setMatrixActiveCellsGeometryBoundingBox(bb);
m_activeCellInfo->setMatrixActiveCellsGeometryBoundingBox(bb);
m_fractureActiveCellInfo->setMatrixActiveCellsGeometryBoundingBox(bb);
return;
}
RigActiveCellInfo* activeInfos[2];
activeInfos[0] = &m_fractureActiveCellInfo;
activeInfos[1] = &m_activeCellInfo; // Last, to make this bb.min become display offset
activeInfos[0] = m_fractureActiveCellInfo.p();
activeInfos[1] = m_activeCellInfo.p(); // Last, to make this bb.min become display offset
cvf::BoundingBox bb;
for (int acIdx = 0; acIdx < 2; ++acIdx)
@@ -428,6 +447,8 @@ cvf::ref<cvf::StructGridScalarDataAccess> RigEclipseCase::dataAccessObject(const
return NULL;
}
/*
//--------------------------------------------------------------------------------------------------
///

View File

@@ -51,6 +51,7 @@ public:
RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel);
const RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) const;
void setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject(const RigGridBase* grid,
@@ -78,8 +79,8 @@ private:
private:
cvf::ref<RigMainGrid> m_mainGrid;
RigActiveCellInfo m_activeCellInfo;
RigActiveCellInfo m_fractureActiveCellInfo;
cvf::ref<RigActiveCellInfo> m_activeCellInfo;
cvf::ref<RigActiveCellInfo> m_fractureActiveCellInfo;
cvf::ref<RigReservoirCellResults> m_matrixModelResults;
cvf::ref<RigReservoirCellResults> m_fractureModelResults;

View File

@@ -18,6 +18,7 @@
#include "RigReservoirBuilderMock.h"
#include "RigEclipseCase.h"
#include "RigActiveCellInfo.h"
/* rand example: guess the number */

View File

@@ -505,10 +505,13 @@ void RigReservoirCellResults::removeResult(const QString& resultName)
//--------------------------------------------------------------------------------------------------
void RigReservoirCellResults::clearAllResults()
{
for (size_t i = 0; i < m_cellScalarResults.size(); i++)
{
m_cellScalarResults[i].clear();
}
m_cellScalarResults.clear();
m_maxMinValues.clear();
m_histograms.clear();
m_p10p90.clear();
m_meanValues.clear();
m_maxMinValuesPrTs.clear();
m_resultInfos.clear();
}
//--------------------------------------------------------------------------------------------------