mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4024 Always report that a time step dependent result is visible in GeoMech contour maps
* However, if a result is not a valid time step result, we instead show a dummy 0-result across the reservoir. * This way we show something even if a valid result is not chosen. * Also make this more obvious by reporting it in info box and legend.
This commit is contained in:
@@ -772,6 +772,10 @@ QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData, Ri
|
||||
"<tr> <td>%1</td> <td> %2</td> <td> %3</td> <td> %4</td> <td> %5</td> <td> %6</td> </tr>"
|
||||
"</table>").arg(histData.min).arg(histData.p10).arg(histData.mean).arg(histData.p90).arg(histData.max).arg(histData.sum);
|
||||
}
|
||||
else
|
||||
{
|
||||
infoText += QString("<b>No valid result selected</b>");
|
||||
}
|
||||
}
|
||||
return infoText;
|
||||
}
|
||||
|
||||
@@ -105,10 +105,17 @@ void RimGeoMechContourMapProjection::updateLegend()
|
||||
legendConfig()->setAutomaticRanges(minmaxValAllTimeSteps.first, minmaxValAllTimeSteps.second, minVal, maxVal);
|
||||
|
||||
QString projectionLegendText = QString("Map Projection\n%1").arg(m_resultAggregation().uiText());
|
||||
projectionLegendText += QString("\nResult: %1").arg(cellColors->resultFieldUiName());
|
||||
if (!cellColors->resultComponentUiName().isEmpty())
|
||||
if (cellColors->resultAddress().isValid())
|
||||
{
|
||||
projectionLegendText += QString(", %1").arg(cellColors->resultComponentUiName());
|
||||
projectionLegendText += QString("\nResult: %1").arg(cellColors->resultFieldUiName());
|
||||
if (!cellColors->resultComponentUiName().isEmpty())
|
||||
{
|
||||
projectionLegendText += QString(", %1").arg(cellColors->resultComponentUiName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectionLegendText += QString("\nNo Result Selected");
|
||||
}
|
||||
|
||||
legendConfig()->setTitle(projectionLegendText);
|
||||
@@ -308,8 +315,12 @@ std::vector<double> RimGeoMechContourMapProjection::generateResultsFromAddress(R
|
||||
size_t nCells = numberOfCells();
|
||||
std::vector<double> aggregatedResults = std::vector<double>(nCells, std::numeric_limits<double>::infinity());
|
||||
|
||||
bool wasInvalid = false;
|
||||
if (!resultAddress.isValid())
|
||||
return aggregatedResults;
|
||||
{
|
||||
wasInvalid = true;
|
||||
resultAddress = RigFemResultAddress(RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "");
|
||||
}
|
||||
|
||||
if (resultAddress.fieldName == "PP")
|
||||
{
|
||||
@@ -327,6 +338,19 @@ std::vector<double> RimGeoMechContourMapProjection::generateResultsFromAddress(R
|
||||
std::vector<float> resultValuesF = resultCollection->resultValues(resultAddress, 0, timeStep);
|
||||
std::vector<double> resultValues = gridCellValues(resultAddress, resultValuesF);
|
||||
|
||||
if (wasInvalid)
|
||||
{
|
||||
// For invalid result addresses we just use the POR-Bar result to get the reservoir region
|
||||
// And display a dummy 0-result in the region.
|
||||
for (double& value : resultValues)
|
||||
{
|
||||
if (value != std::numeric_limits<double>::infinity())
|
||||
{
|
||||
value = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma omp parallel for
|
||||
for (int index = 0; index < static_cast<int>(nCells); ++index)
|
||||
{
|
||||
|
||||
@@ -160,6 +160,14 @@ bool RimGeoMechContourMapView::isGridVisualizationMode() const
|
||||
return m_contourMapProjection->isChecked();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechContourMapView::isTimeStepDependentDataVisible() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -40,6 +40,8 @@ public:
|
||||
void updateCurrentTimeStepAndRedraw() override;
|
||||
bool isGridVisualizationMode() const override;
|
||||
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void createDisplayModel() override;
|
||||
|
||||
Reference in New Issue
Block a user