Merged in changes from maintenance branch

This commit is contained in:
Magne Sjaastad 2016-08-11 10:29:14 +02:00
commit cb4aa45cd3
11 changed files with 259 additions and 51 deletions

View File

@ -61,7 +61,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
// Create result access objects
cvf::ref<RigResultAccessor> cellCenterDataAccessObject = createCellCenterResultAccessor(cellResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeResultAccessor(cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
size_t vertexCount = geo->vertexArray()->size();
size_t quadCount = vertexCount / 4;
@ -202,7 +202,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(size_t tim
RigCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->reservoirData();
CVF_ASSERT(eclipseCase != NULL);
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeResultAccessor(cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
size_t vertexCount = geo->vertexArray()->size();
size_t quadCount = vertexCount / 4;
@ -290,7 +290,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(size_t tim
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeCenterResultAccessor(
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccessor(
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
size_t timeStepIndex,
@ -303,11 +303,19 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeCenterResult
cellEdgeResultColors->gridScalarIndices(resultIndices);
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
std::vector<RimCellEdgeMetaData> metaData;
cellEdgeResultColors->cellEdgeMetaData(&metaData);
size_t cubeFaceIdx;
for (cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++)
{
// Assuming static values to be mapped onto cell edge, always using time step zero
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, 0, resultIndices[cubeFaceIdx]);
size_t adjustedTimeStep = timeStepIndex;
if (metaData[cubeFaceIdx].m_isStatic)
{
adjustedTimeStep = 0;
}
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, adjustedTimeStep, resultIndices[cubeFaceIdx]);
cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx), daObj.p());
}
}

View File

@ -63,7 +63,7 @@ private:
RigCaseData* eclipseCase,
const RigGridBase* grid);
static cvf::ref<RigResultAccessor> createCellEdgeCenterResultAccessor(
static cvf::ref<RigResultAccessor> createCellEdgeResultAccessor(
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
size_t timeStepIndex,

View File

@ -22,11 +22,13 @@
#include "RigCaseCellResultsData.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimLegendConfig.h"
#include "RimReservoirCellResultsStorage.h"
#include "cafPdmUiListEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cvfMath.h"
@ -41,17 +43,18 @@ RimCellEdgeColors::RimCellEdgeColors()
CAF_PDM_InitObject("Cell Edge Result", ":/EdgeResult_1.png", "", "");
CAF_PDM_InitField(&enableCellEdgeColors, "EnableCellEdgeColors", true, "Enable cell edge results", "", "", "");
enableCellEdgeColors.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&resultVariable, "CellEdgeVariable", "Result property", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_resultVariable, "CellEdgeVariable", "Result property", "", "", "");
CAF_PDM_InitField(&useXVariable, "UseXVariable", true, "Use X values", "", "", "");
CAF_PDM_InitField(&useYVariable, "UseYVariable", true, "Use Y values", "", "", "");
CAF_PDM_InitField(&useZVariable, "UseZVariable", true, "Use Z values", "", "", "");
CAF_PDM_InitFieldNoDefault(&legendConfig, "LegendDefinition", "Legend Definition", ":/Legend.png", "", "");
legendConfig.uiCapability()->setUiHidden(true);
resultVariable.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&m_customFaultResultColors, "CustomEdgeResult", "Custom Edge Result", ":/CellResult.png", "", "");
m_customFaultResultColors = new RimEclipseCellColors();
m_resultVariable.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
legendConfig = new RimLegendConfig();
@ -65,6 +68,7 @@ RimCellEdgeColors::RimCellEdgeColors()
RimCellEdgeColors::~RimCellEdgeColors()
{
delete legendConfig();
delete m_customFaultResultColors;
}
//--------------------------------------------------------------------------------------------------
@ -74,6 +78,7 @@ void RimCellEdgeColors::setReservoirView(RimEclipseView* ownerReservoirView)
{
m_reservoirView = ownerReservoirView;
this->legendConfig()->setReservoirView(ownerReservoirView);
m_customFaultResultColors->setReservoirView(ownerReservoirView);
}
//--------------------------------------------------------------------------------------------------
@ -83,30 +88,56 @@ void RimCellEdgeColors::loadResult()
{
CVF_ASSERT(m_reservoirView && m_reservoirView->currentGridCellResults());
resetResultIndices();
QStringList vars = findResultVariableNames();
updateIgnoredScalarValue();
int i;
for (i = 0; i < vars.size(); ++i)
if (m_resultVariable == RimCellEdgeColors::customEdgeResultUiText())
{
size_t resultindex = m_reservoirView->currentGridCellResults()->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, vars[i]);
int cubeFaceIdx;
for (cubeFaceIdx = 0; cubeFaceIdx < 6; ++cubeFaceIdx)
{
if ( ((cubeFaceIdx == 0 || cubeFaceIdx == 1) && useXVariable())
|| ((cubeFaceIdx == 2 || cubeFaceIdx == 3) && useYVariable())
|| ((cubeFaceIdx == 4 || cubeFaceIdx == 5) && useZVariable()))
{
QString varEnd = EdgeFaceEnum::textFromIndex(cubeFaceIdx);
size_t resultindex = m_reservoirView->currentGridCellResults()->findOrLoadScalarResult(m_customFaultResultColors->resultType(), m_customFaultResultColors->resultVariable());
if (vars[i].endsWith(varEnd))
for (int cubeFaceIdx = 0; cubeFaceIdx < 6; ++cubeFaceIdx)
{
m_resultNameToIndexPairs[cubeFaceIdx] = std::make_pair(m_customFaultResultColors->resultVariable(), resultindex);
}
}
else
{
resetResultIndices();
QStringList vars = findResultVariableNames();
updateIgnoredScalarValue();
int i;
for (i = 0; i < vars.size(); ++i)
{
size_t resultindex = m_reservoirView->currentGridCellResults()->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, vars[i]);
int cubeFaceIdx;
for (cubeFaceIdx = 0; cubeFaceIdx < 6; ++cubeFaceIdx)
{
if ( ((cubeFaceIdx == 0 || cubeFaceIdx == 1) && useXVariable())
|| ((cubeFaceIdx == 2 || cubeFaceIdx == 3) && useYVariable())
|| ((cubeFaceIdx == 4 || cubeFaceIdx == 5) && useZVariable()))
{
m_resultNameToIndexPairs[cubeFaceIdx] = std::make_pair(vars[i], resultindex);
QString varEnd = EdgeFaceEnum::textFromIndex(cubeFaceIdx);
if (vars[i].endsWith(varEnd))
{
m_resultNameToIndexPairs[cubeFaceIdx] = std::make_pair(vars[i], resultindex);
}
}
}
}
}
}
updateFieldVisibility();
updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::initAfterRead()
{
m_customFaultResultColors->initAfterRead();
updateFieldVisibility();
}
//--------------------------------------------------------------------------------------------------
@ -140,7 +171,7 @@ namespace caf
QList<caf::PdmOptionItemInfo> RimCellEdgeColors::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
{
if (fieldNeedingOptions == &resultVariable)
if (fieldNeedingOptions == &m_resultVariable)
{
if (m_reservoirView && m_reservoirView->currentGridCellResults())
{
@ -201,7 +232,9 @@ QList<caf::PdmOptionItemInfo> RimCellEdgeColors::calculateValueOptions(const caf
}
optionList.push_front(caf::PdmOptionItemInfo( RimDefines::undefinedResultName(), "" ));
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::undefinedResultName(), ""));
optionList.push_back(caf::PdmOptionItemInfo(RimCellEdgeColors::customEdgeResultUiText(), RimCellEdgeColors::customEdgeResultUiText()));
if (useOptionsOnly) *useOptionsOnly = true;
@ -212,6 +245,39 @@ QList<caf::PdmOptionItemInfo> RimCellEdgeColors::calculateValueOptions(const caf
return QList<caf::PdmOptionItemInfo>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_resultVariable);
if (m_resultVariable().compare(RimCellEdgeColors::customEdgeResultUiText()) == 0)
{
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Custom Edge Result");
group1->add(&(m_customFaultResultColors->m_resultTypeUiField));
group1->add(&(m_customFaultResultColors->m_porosityModelUiField));
group1->add(&(m_customFaultResultColors->m_resultVariableUiField));
}
else
{
uiOrdering.add(&useXVariable);
uiOrdering.add(&useYVariable);
uiOrdering.add(&useZVariable);
}
uiOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
uiTreeOrdering.add(legendConfig());
uiTreeOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -219,7 +285,7 @@ QStringList RimCellEdgeColors::findResultVariableNames()
{
QStringList varNames;
if (m_reservoirView && m_reservoirView->currentGridCellResults() && !resultVariable().isEmpty())
if (m_reservoirView && m_reservoirView->currentGridCellResults() && !m_resultVariable().isEmpty())
{
QStringList varList;
varList = m_reservoirView->currentGridCellResults()->cellResults()->resultNames(RimDefines::STATIC_NATIVE);
@ -230,7 +296,7 @@ QStringList RimCellEdgeColors::findResultVariableNames()
{
if (RimDefines::isPerCellFaceResult(varList[i])) continue;
if (varList[i].startsWith(resultVariable))
if (varList[i].startsWith(m_resultVariable))
{
varNames.append(varList[i]);
}
@ -256,7 +322,7 @@ void RimCellEdgeColors::gridScalarIndices(size_t resultIndices[6])
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::gridScalarResultNames(QStringList* resultNames)
void RimCellEdgeColors::gridScalarResultNames(std::vector<QString>* resultNames)
{
CVF_ASSERT(resultNames);
@ -265,7 +331,44 @@ void RimCellEdgeColors::gridScalarResultNames(QStringList* resultNames)
{
resultNames->push_back(m_resultNameToIndexPairs[cubeFaceIndex].first);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::cellEdgeMetaData(std::vector<RimCellEdgeMetaData>* metaDataVector)
{
CVF_ASSERT(metaDataVector);
size_t resultIndices[6];
this->gridScalarIndices(resultIndices);
std::vector<QString> resultNames;
this->gridScalarResultNames(&resultNames);
bool isStatic = true;
if (m_resultVariable == RimCellEdgeColors::customEdgeResultUiText())
{
isStatic = m_customFaultResultColors->resultType() == RimDefines::STATIC_NATIVE;
}
for (size_t i = 0; i < 6; i++)
{
RimCellEdgeMetaData metaData;
metaData.m_resultIndex = resultIndices[i];
metaData.m_resultVariable = resultNames[i];
metaData.m_isStatic = isStatic;
metaDataVector->push_back(metaData);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::updateFieldVisibility()
{
m_customFaultResultColors->updateFieldVisibility();
}
//--------------------------------------------------------------------------------------------------
@ -302,7 +405,7 @@ bool RimCellEdgeColors::hasResult() const
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::updateIgnoredScalarValue()
{
if (resultVariable == "MULT" || resultVariable == "riMULT")
if (m_resultVariable == "MULT" || m_resultVariable == "riMULT")
{
m_ignoredResultScalar = 1.0;
}
@ -369,6 +472,37 @@ void RimCellEdgeColors::posNegClosestToZero(double& pos, double& neg)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::setEclipseCase(RimEclipseCase* eclipseCase)
{
m_customFaultResultColors->setEclipseCase(eclipseCase);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::setResultVariable(const QString& variableName)
{
m_resultVariable = variableName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimCellEdgeColors::resultVariable() const
{
if (m_resultVariable == RimCellEdgeColors::customEdgeResultUiText())
{
return m_customFaultResultColors->resultVariable();
}
else
{
return m_resultVariable;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -29,9 +29,18 @@
#include "cafPdmObject.h"
class RigCaseCellResultsData;
class RimEclipseCase;
class RimEclipseCellColors;
class RimEclipseView;
class RimLegendConfig;
class RimCellEdgeMetaData
{
public:
size_t m_resultIndex;
QString m_resultVariable;
bool m_isStatic;
};
//==================================================================================================
///
@ -54,14 +63,18 @@ public:
typedef caf::AppEnum<RimCellEdgeColors::EdgeFaceType> EdgeFaceEnum;
void setReservoirView(RimEclipseView* ownerReservoirView);
void setEclipseCase(RimEclipseCase* eclipseCase);
void setResultVariable(const QString& variableName);
QString resultVariable() const;
caf::PdmField<QString> resultVariable;
caf::PdmField<bool> enableCellEdgeColors;
caf::PdmChildField<RimLegendConfig*> legendConfig;
double ignoredScalarValue() { return m_ignoredResultScalar; }
void gridScalarIndices(size_t resultIndices[6]);
void gridScalarResultNames(QStringList* resultNames);
void cellEdgeMetaData(std::vector<RimCellEdgeMetaData>* metaData);
void loadResult();
bool hasResult() const;
@ -69,18 +82,26 @@ public:
void posNegClosestToZero(double& pos, double& neg);
protected:
virtual void initAfterRead();
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly );
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
QStringList findResultVariableNames();
private:
void updateFieldVisibility();
void resetResultIndices();
void updateIgnoredScalarValue();
void gridScalarResultNames(std::vector<QString>* resultNames);
static QString customEdgeResultUiText() { return "Custom Edge Result"; }
virtual caf::PdmFieldHandle* objectToggleField();
caf::PdmField<QString> m_resultVariable;
caf::PdmField<bool> useXVariable;
caf::PdmField<bool> useYVariable;
caf::PdmField<bool> useZVariable;
@ -88,5 +109,7 @@ private:
caf::FixedArray<std::pair<QString, size_t>, 6 > m_resultNameToIndexPairs;
caf::PdmPointer<RimEclipseView> m_reservoirView;
double m_ignoredResultScalar;
caf::PdmChildField<RimEclipseCellColors*> m_customFaultResultColors;
};

View File

@ -157,7 +157,7 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
{
RimEclipseView* riv = new RimEclipseView();
riv->setEclipseCase(this);
riv->cellEdgeResult()->resultVariable = "MULT";
riv->cellEdgeResult()->setResultVariable("MULT");
riv->cellEdgeResult()->enableCellEdgeColors = false;
caf::PdmDocument::updateUiIconStateRecursively(riv);
@ -243,7 +243,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
RimCellEdgeColors* cellEdgeResult = reservoirView->cellEdgeResult;
CVF_ASSERT(cellEdgeResult);
cellEdgeResult->resultVariable.v() = RimDefines::undefinedResultName();
cellEdgeResult->setResultVariable(RimDefines::undefinedResultName());
cellEdgeResult->loadResult();
reservoirView->createDisplayModelAndRedraw();

View File

@ -20,6 +20,7 @@
#include "RimEclipseCellColors.h"
#include "RimCellEdgeColors.h"
#include "RimEclipseFaultColors.h"
#include "RimEclipseView.h"
#include "RimLegendConfig.h"
@ -91,6 +92,12 @@ void RimEclipseCellColors::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
{
faultColors->updateConnectedEditors();
}
RimCellEdgeColors* cellEdgeColors = dynamic_cast<RimCellEdgeColors*>(this->parentField()->ownerObject());
if (cellEdgeColors)
{
cellEdgeColors->updateConnectedEditors();
}
}
if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw();

View File

@ -57,6 +57,7 @@ protected:
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
friend class RimEclipseFaultColors;
friend class RimCellEdgeColors;
virtual void initAfterRead();
private:

View File

@ -23,6 +23,7 @@
#include "RigCaseCellResultsData.h"
#include "RigCaseData.h"
#include "RimCellEdgeColors.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseFaultColors.h"
@ -131,6 +132,9 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
RimWellLogCurve* curve = NULL;
this->firstAnchestorOrThisOfType(curve);
RimCellEdgeColors* cellEdgeColors = NULL;
this->firstAnchestorOrThisOfType(cellEdgeColors);
if (&m_resultVariableUiField == changedField)
{
m_porosityModel = m_porosityModelUiField;
@ -163,6 +167,16 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
}
}
if (cellEdgeColors)
{
cellEdgeColors->loadResult();
if (view)
{
view->scheduleCreateDisplayModelAndRedraw();
}
}
if (curve)
{
curve->loadDataAndUpdate();
@ -180,6 +194,11 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
faultColors->updateConnectedEditors();
}
if (cellEdgeColors)
{
cellEdgeColors->updateConnectedEditors();
}
if (curve)
{
curve->updateConnectedEditors();
@ -203,8 +222,13 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
RimWellLogCurve* curve = NULL;
this->firstAnchestorOrThisOfType(curve);
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
if (propFilter || curve)
RimEclipsePropertyFilter* propFilter = NULL;
this->firstAnchestorOrThisOfType(propFilter);
RimCellEdgeColors* cellEdge = NULL;
this->firstAnchestorOrThisOfType(cellEdge);
if (propFilter || curve || cellEdge)
{
removePerCellFaceOptionItems(optionItems);
}

View File

@ -944,7 +944,7 @@ void RimEclipseView::updateLegends()
this->cellEdgeResult()->legendConfig->setAutomaticRanges(globalMin, globalMax, globalMin, globalMax);
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig->legend());
this->cellEdgeResult()->legendConfig->setTitle(cvfqt::Utils::toString(QString("Edge Results: \n") + this->cellEdgeResult()->resultVariable));
this->cellEdgeResult()->legendConfig->setTitle(cvfqt::Utils::toString(QString("Edge Results: \n") + this->cellEdgeResult()->resultVariable()));
}
else
{
@ -1067,6 +1067,7 @@ void RimEclipseView::setEclipseCase(RimEclipseCase* reservoir)
cellResult()->setEclipseCase(reservoir);
faultResultSettings()->customFaultResult()->setEclipseCase(reservoir);
cellEdgeResult()->setEclipseCase(reservoir);
}
//--------------------------------------------------------------------------------------------------

View File

@ -428,7 +428,7 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults()
{
RimEclipseView* rimReservoirView = rimStaticsCase->reservoirViews[j];
rimReservoirView->cellResult()->setResultVariable(RimDefines::undefinedResultName());
rimReservoirView->cellEdgeResult()->resultVariable = RimDefines::undefinedResultName();
rimReservoirView->cellEdgeResult()->setResultVariable(RimDefines::undefinedResultName());
rimReservoirView->loadDataAndUpdate();
}
}

View File

@ -463,23 +463,33 @@ QString RiuResultTextBuilder::cellEdgeResultDetails()
if (m_reservoirView->cellEdgeResult()->hasResult())
{
size_t resultIndices[6];
QStringList resultNames;
m_reservoirView->cellEdgeResult()->gridScalarIndices(resultIndices);
m_reservoirView->cellEdgeResult()->gridScalarResultNames(&resultNames);
std::vector<RimCellEdgeMetaData> metaData;
m_reservoirView->cellEdgeResult()->cellEdgeMetaData(&metaData);
std::set<size_t> uniqueResultIndices;
text += "-- Cell edge result data --\n";
for (int idx = 0; idx < 6; idx++)
{
if (resultIndices[idx] == cvf::UNDEFINED_SIZE_T) continue;
size_t resultIndex = metaData[idx].m_resultIndex;
if (resultIndex == cvf::UNDEFINED_SIZE_T) continue;
if (uniqueResultIndices.find(resultIndex) != uniqueResultIndices.end()) continue;
size_t adjustedTimeStep = m_timeStepIndex;
if (metaData[idx].m_isStatic)
{
adjustedTimeStep = 0;
}
// Cell edge results are static, results are loaded for first time step only
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_reservoirView->cellResult()->porosityModel());
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createResultAccessor(m_reservoirView->eclipseCase()->reservoirData(), m_gridIndex, porosityModel, 0, resultIndices[idx]);
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createResultAccessor(m_reservoirView->eclipseCase()->reservoirData(), m_gridIndex, porosityModel, adjustedTimeStep, resultIndex);
if (resultAccessor.notNull())
{
double scalarValue = resultAccessor->cellScalar(m_cellIndex);
text.append(QString("%1 : %2\n").arg(resultNames[idx]).arg(scalarValue));
text.append(QString("%1 : %2\n").arg(metaData[idx].m_resultVariable).arg(scalarValue));
uniqueResultIndices.insert(resultIndex);
}
}
}