mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3958 Refactoring : Moved formation names calculation into CaseCellResultsData.
Made one more method private.
This commit is contained in:
@@ -675,62 +675,7 @@ void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setActiveFormationNames(RigFormationNames* activeFormationNames)
|
||||
{
|
||||
m_activeFormationNamesData = activeFormationNames;
|
||||
|
||||
size_t totalGlobCellCount = m_mainGrid->globalCellArray().size();
|
||||
size_t resIndex = m_matrixModelResults->addStaticScalarResult(RiaDefines::FORMATION_NAMES,
|
||||
RiaDefines::activeFormationNamesResultName(),
|
||||
false,
|
||||
totalGlobCellCount);
|
||||
|
||||
std::vector<double>& fnData = m_matrixModelResults->cellScalarResults(RigEclipseResultAddress(resIndex),0);
|
||||
|
||||
if (m_activeFormationNamesData.isNull())
|
||||
{
|
||||
for ( size_t cIdx = 0; cIdx < totalGlobCellCount; ++cIdx )
|
||||
{
|
||||
fnData[cIdx] = HUGE_VAL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
size_t localCellCount = m_mainGrid->cellCount();
|
||||
for (size_t cIdx = 0; cIdx < localCellCount; ++cIdx)
|
||||
{
|
||||
size_t i (cvf::UNDEFINED_SIZE_T), j(cvf::UNDEFINED_SIZE_T), k(cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
if(!m_mainGrid->ijkFromCellIndex(cIdx, &i, &j, &k)) continue;
|
||||
|
||||
int formNameIdx = activeFormationNames->formationIndexFromKLayerIdx(k);
|
||||
if (formNameIdx != -1)
|
||||
{
|
||||
fnData[cIdx] = formNameIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
fnData[cIdx] = HUGE_VAL;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t cIdx = localCellCount; cIdx < totalGlobCellCount; ++cIdx)
|
||||
{
|
||||
size_t mgrdCellIdx = m_mainGrid->globalCellArray()[cIdx].mainGridCellIndex();
|
||||
|
||||
size_t i (cvf::UNDEFINED_SIZE_T), j(cvf::UNDEFINED_SIZE_T), k(cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
if(!m_mainGrid->ijkFromCellIndex(mgrdCellIdx, &i, &j, &k)) continue;
|
||||
|
||||
int formNameIdx = activeFormationNames->formationIndexFromKLayerIdx(k);
|
||||
if (formNameIdx != -1)
|
||||
{
|
||||
fnData[cIdx] = formNameIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
fnData[cIdx] = HUGE_VAL;
|
||||
}
|
||||
}
|
||||
m_matrixModelResults->setActiveFormationNames(activeFormationNames);
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
@@ -747,7 +692,7 @@ void RigEclipseCaseData::setActiveFormationNames(RigFormationNames* activeFormat
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFormationNames* RigEclipseCaseData::activeFormationNames()
|
||||
{
|
||||
return m_activeFormationNamesData.p();
|
||||
return m_matrixModelResults->activeFormationNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user