Fix of crash: Compute SOIL for Fracture Results

https://github.com/OPM/ResInsight/issues/179
This commit is contained in:
Jacob Støren 2014-06-30 11:10:35 +02:00
parent e1c55e4452
commit f5b0e03211

View File

@ -932,10 +932,16 @@ void RimReservoirView::loadDataAndUpdate()
RiaApplication* app = RiaApplication::instance();
if (app->preferences()->autocomputeSOIL)
{
RimReservoirCellResultsStorage* results = currentGridCellResults();
CVF_ASSERT(results);
results->loadOrComputeSOIL();
results->createCombinedTransmissibilityResults();
{
RimReservoirCellResultsStorage* results = m_reservoir->results(RifReaderInterface::MATRIX_RESULTS);
results->loadOrComputeSOIL();
results->createCombinedTransmissibilityResults();
}
{
RimReservoirCellResultsStorage* results = m_reservoir->results(RifReaderInterface::FRACTURE_RESULTS);
results->loadOrComputeSOIL();
results->createCombinedTransmissibilityResults();
}
}
}
}
@ -1464,10 +1470,13 @@ void RimReservoirView::updateLegends()
double localMax = 1.0;
size_t scalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL");
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
if (scalarSetIndex != cvf::UNDEFINED_SIZE_T)
{
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SOIL_IDX, globalMin, globalMax, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SOIL_IDX, globalMin, globalMax, localMin, localMax);
}
}
{
@ -1477,10 +1486,13 @@ void RimReservoirView::updateLegends()
double localMax = 1.0;
size_t scalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SGAS");
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
if (scalarSetIndex != cvf::UNDEFINED_SIZE_T)
{
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SGAS_IDX, globalMin, globalMax, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SGAS_IDX, globalMin, globalMax, localMin, localMax);
}
}
{
@ -1490,10 +1502,13 @@ void RimReservoirView::updateLegends()
double localMax = 1.0;
size_t scalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SWAT");
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
if (scalarSetIndex != cvf::UNDEFINED_SIZE_T)
{
results->minMaxCellScalarValues(scalarSetIndex, globalMin, globalMax);
results->minMaxCellScalarValues(scalarSetIndex, m_currentTimeStep, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SWAT_IDX, globalMin, globalMax, localMin, localMax);
this->cellResult()->ternaryLegendConfig()->setAutomaticRanges(RimTernaryLegendConfig::TERNARY_SWAT_IDX, globalMin, globalMax, localMin, localMax);
}
}
if (this->cellResult()->ternaryLegendConfig->legend())