mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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());
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
|
||||
class RigActiveCellInfo
|
||||
class RigActiveCellInfo : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigActiveCellInfo();
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RigReservoirBuilderMock.h"
|
||||
#include "RigEclipseCase.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
|
||||
|
||||
/* rand example: guess the number */
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user