mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#401) WIP: Activated the visibility calculation code.
Started on mapping calculation.
This commit is contained in:
parent
f092c4daef
commit
36bc2f8f69
@ -34,6 +34,7 @@
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RimViewLink.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RigCaseToCaseCellMapper.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -175,7 +176,6 @@ void RivFemElmVisibilityCalculator::computeOverriddenCellVisibility(cvf::UByteAr
|
||||
const RigFemPart* femPart,
|
||||
RimViewLink* masterViewLink)
|
||||
{
|
||||
#if 0
|
||||
CVF_ASSERT(elmVisibilities != NULL);
|
||||
CVF_ASSERT(femPart != NULL);
|
||||
|
||||
@ -186,13 +186,13 @@ void RivFemElmVisibilityCalculator::computeOverriddenCellVisibility(cvf::UByteAr
|
||||
elmVisibilities->resize(elmCount);
|
||||
elmVisibilities->setAll(false);
|
||||
|
||||
RigCaseToCaseCellMapper* cellMapper = masterViewLink->cellMapper();
|
||||
const RigCaseToCaseCellMapper* cellMapper = masterViewLink->cellMapper();
|
||||
|
||||
for (size_t elmIdx = 0; elmIdx < elmCount; ++elmIdx)
|
||||
for (int elmIdx = 0; elmIdx < elmCount; ++elmIdx)
|
||||
{
|
||||
// We are assuming that there is only one part.
|
||||
int cellCount = 0;
|
||||
const int* cellIndicesInMasterCase = cellMapper->masterCaseCellIndex(elmIdx, &cellCount);
|
||||
const int* cellIndicesInMasterCase = cellMapper->masterCaseCellIndices(elmIdx, &cellCount);
|
||||
|
||||
for (int mcIdx = 0; mcIdx < cellCount; ++mcIdx)
|
||||
{
|
||||
@ -200,6 +200,5 @@ void RivFemElmVisibilityCalculator::computeOverriddenCellVisibility(cvf::UByteAr
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "RivGridPartMgr.h"
|
||||
#include "RimViewLink.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RigCaseToCaseCellMapper.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -602,7 +603,6 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility(cvf::UByteArray* c
|
||||
|
||||
RimView* masterView = masterViewLink->ownerViewLinker()->mainView();
|
||||
|
||||
#if 0
|
||||
// get cell visibility
|
||||
#if 1
|
||||
cvf::ref<cvf::UByteArray> totCellVisibility = masterView->currentTotalCellVisibility();
|
||||
@ -618,14 +618,14 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility(cvf::UByteArray* c
|
||||
cellVisibility->resize(gridCellCount);
|
||||
cellVisibility->setAll(false);
|
||||
|
||||
RigCaseToCaseCellMapper* cellMapper = masterViewLink->cellMapper();
|
||||
const RigCaseToCaseCellMapper* cellMapper = masterViewLink->cellMapper();
|
||||
|
||||
for (size_t lcIdx = 0; lcIdx < gridCellCount; ++lcIdx)
|
||||
{
|
||||
#if 1
|
||||
size_t reservoirCellIdx = grid->reservoirCellIndex(lcIdx);
|
||||
int reservoirCellIdx = static_cast<int>(grid->reservoirCellIndex(lcIdx));
|
||||
int cellCount = 0;
|
||||
const int* cellIndicesInMasterCase = cellMapper->masterCaseCellIndex(reservoirCellIdx, &cellCount);
|
||||
const int* cellIndicesInMasterCase = cellMapper->masterCaseCellIndices(reservoirCellIdx, &cellCount);
|
||||
|
||||
for (int mcIdx = 0; mcIdx < cellCount; ++mcIdx)
|
||||
{
|
||||
@ -646,7 +646,6 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility(cvf::UByteArray* c
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigCaseToCaseCellMapper.h"
|
||||
#include "RigFemPart.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -29,7 +30,8 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigMainGrid* masterEclGrid, Rig
|
||||
m_masterFemPart(dependentFemPart),
|
||||
m_dependentFemPart(NULL)
|
||||
{
|
||||
|
||||
m_masterCellOrIntervalIndex.resize(dependentFemPart->elementCount(), cvf::UNDEFINED_INT);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -72,9 +74,16 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const int * RigCaseToCaseCellMapper::masterCaseCellIndices(int dependentCaseReservoirCellIndex, int* masterCaseCellIndexCount)
|
||||
const int * RigCaseToCaseCellMapper::masterCaseCellIndices(int dependentCaseReservoirCellIndex, int* masterCaseCellIndexCount) const
|
||||
{
|
||||
int seriesIndex = m_masterCellOrIntervalIndex[dependentCaseReservoirCellIndex];
|
||||
|
||||
if (seriesIndex == cvf::UNDEFINED_INT)
|
||||
{
|
||||
(*masterCaseCellIndexCount) = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (seriesIndex < 0)
|
||||
{
|
||||
(*masterCaseCellIndexCount) = static_cast<int>(m_masterCellIndexSeries[-seriesIndex].size());
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigMainGrid* dependentEclGrid);
|
||||
RigCaseToCaseCellMapper(RigFemPart* masterFemPart, RigFemPart* dependentFemPart);
|
||||
|
||||
const int * masterCaseCellIndices(int dependentCaseReservoirCellIndex, int* masterCaseCellIndexCount);
|
||||
const int * masterCaseCellIndices(int dependentCaseReservoirCellIndex, int* masterCaseCellIndexCount) const;
|
||||
|
||||
const RigMainGrid* masterGrid() const { return m_masterGrid;}
|
||||
const RigMainGrid* dependentGrid() const { return m_dependentGrid;}
|
||||
|
Loading…
Reference in New Issue
Block a user