mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into hdf-prototype
This commit is contained in:
@@ -72,7 +72,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
|
||||
CAF_PDM_InitFieldNoDefault(&m_porosityModel, "PorosityModelType", "Porosity", "", "", "");
|
||||
m_porosityModel.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_resultVariable, "ResultVariable", RimDefines::undefinedResultName(), "Variable", "", "", "" );
|
||||
CAF_PDM_InitField(&m_resultVariable, "ResultVariable", RiaDefines::undefinedResultName(), "Variable", "", "", "" );
|
||||
m_resultVariable.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowSolution, "FlowDiagSolution", "Solution", "", "", "");
|
||||
@@ -82,6 +82,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
|
||||
m_selectedTracers.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowTracerSelectionMode, "FlowTracerSelectionMode", "Tracers", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_phaseSelection, "PhaseSelection", "Phases", "", "", "");
|
||||
|
||||
// Ui only fields
|
||||
|
||||
@@ -93,7 +94,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
|
||||
m_porosityModelUiField.xmlCapability()->setIOReadable(false);
|
||||
m_porosityModelUiField.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitField(&m_resultVariableUiField, "MResultVariable", RimDefines::undefinedResultName(), "Result property", "", "", "" );
|
||||
CAF_PDM_InitField(&m_resultVariableUiField, "MResultVariable", RiaDefines::undefinedResultName(), "Result property", "", "", "" );
|
||||
m_resultVariableUiField.xmlCapability()->setIOReadable(false);
|
||||
m_resultVariableUiField.xmlCapability()->setIOWritable(false);
|
||||
m_resultVariableUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||
@@ -131,6 +132,7 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot
|
||||
this->setFlowSolution(other->m_flowSolution());
|
||||
this->setSelectedTracers(other->m_selectedTracers());
|
||||
m_flowTracerSelectionMode = other->m_flowTracerSelectionMode();
|
||||
m_phaseSelection = other->m_phaseSelection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -151,9 +153,7 @@ RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResul
|
||||
{
|
||||
if (!m_eclipseCase ) return nullptr;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_porosityModel());
|
||||
|
||||
return m_eclipseCase->results(porosityModel);
|
||||
return m_eclipseCase->results(m_porosityModel());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -170,7 +170,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|
||||
QStringList varList = getResultNamesForCurrentUiResultType();
|
||||
|
||||
bool isFlowDiagFieldsRelevant = (m_resultType() == RimDefines::FLOW_DIAGNOSTICS);
|
||||
bool isFlowDiagFieldsRelevant = (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS);
|
||||
|
||||
|
||||
if ( ( m_flowSolutionUiField() == m_flowSolution() || !isFlowDiagFieldsRelevant)
|
||||
@@ -198,7 +198,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
m_resultType = m_resultTypeUiField;
|
||||
m_resultVariable = m_resultVariableUiField;
|
||||
|
||||
if (m_resultTypeUiField() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
m_flowSolution = m_flowSolutionUiField();
|
||||
m_selectedTracers = m_selectedTracersUiField();
|
||||
@@ -239,6 +239,11 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
if (&m_phaseSelection == changedField)
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
if (&m_selectedTracersUiFieldFilter == changedField)
|
||||
{
|
||||
auto visibleTracerNames = tracerNamesMatchingFilter();
|
||||
@@ -308,7 +313,7 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::setTofAndSelectTracer(const QString& tracerName)
|
||||
{
|
||||
setResultType(RimDefines::FLOW_DIAGNOSTICS);
|
||||
setResultType(RiaDefines::FLOW_DIAGNOSTICS);
|
||||
setResultVariable("TOF");
|
||||
setFlowDiagTracerSelectionType(FLOW_TR_BY_SELECTION);
|
||||
|
||||
@@ -421,12 +426,10 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
|
||||
if ( fieldNeedingOptions == &m_resultTypeUiField )
|
||||
{
|
||||
bool hasFlowDiagFluxes = false;
|
||||
bool hasSourSimRLFile = false;
|
||||
RimEclipseResultCase* eclResCase = dynamic_cast<RimEclipseResultCase*>(m_eclipseCase.p());
|
||||
if ( eclResCase && eclResCase->eclipseCaseData() )
|
||||
{
|
||||
hasFlowDiagFluxes = eclResCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes();
|
||||
hasSourSimRLFile = eclResCase->hasSourSimFile();
|
||||
}
|
||||
|
||||
@@ -440,19 +443,20 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
RimGridTimeHistoryCurve* timeHistoryCurve;
|
||||
this->firstAncestorOrThisOfType(timeHistoryCurve);
|
||||
|
||||
if ( !hasFlowDiagFluxes || timeHistoryCurve != nullptr || !hasSourSimRLFile)
|
||||
// Do not include flow diagnostics results if it is a time history curve
|
||||
if ( timeHistoryCurve != nullptr )
|
||||
{
|
||||
using ResCatEnum = caf::AppEnum< RimDefines::ResultCatType >;
|
||||
using ResCatEnum = caf::AppEnum< RiaDefines::ResultCatType >;
|
||||
for ( size_t i = 0; i < ResCatEnum::size(); ++i )
|
||||
{
|
||||
RimDefines::ResultCatType resType = ResCatEnum::fromIndex(i);
|
||||
if ( resType == RimDefines::FLOW_DIAGNOSTICS
|
||||
&& (!hasFlowDiagFluxes || timeHistoryCurve) )
|
||||
RiaDefines::ResultCatType resType = ResCatEnum::fromIndex(i);
|
||||
if ( resType == RiaDefines::FLOW_DIAGNOSTICS
|
||||
&& (timeHistoryCurve) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( resType == RimDefines::SOURSIMRL
|
||||
if ( resType == RiaDefines::SOURSIMRL
|
||||
&& (!hasSourSimRLFile ) )
|
||||
{
|
||||
continue;
|
||||
@@ -464,7 +468,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_resultTypeUiField() != RimDefines::FLOW_DIAGNOSTICS )
|
||||
if ( m_resultTypeUiField() != RiaDefines::FLOW_DIAGNOSTICS )
|
||||
{
|
||||
if ( fieldNeedingOptions == &m_resultVariableUiField )
|
||||
{
|
||||
@@ -533,7 +537,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard()
|
||||
{
|
||||
CVF_ASSERT(m_resultTypeUiField() != RimDefines::FLOW_DIAGNOSTICS);
|
||||
CVF_ASSERT(m_resultTypeUiField() != RiaDefines::FLOW_DIAGNOSTICS);
|
||||
|
||||
if (this->currentGridCellResults())
|
||||
{
|
||||
@@ -544,7 +548,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
|
||||
foreach(QString s, getResultNamesForCurrentUiResultType())
|
||||
{
|
||||
if (RimDefines::isPerCellFaceResult(s))
|
||||
if (RiaDefines::isPerCellFaceResult(s))
|
||||
{
|
||||
cellFaceResultNames.push_back(s);
|
||||
}
|
||||
@@ -569,9 +573,9 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
else if (cellCenterResultNames.contains("SGAS")) hasAtLeastOneTernaryComponent = true;
|
||||
else if (cellCenterResultNames.contains("SWAT")) hasAtLeastOneTernaryComponent = true;
|
||||
|
||||
if (m_resultTypeUiField == RimDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent)
|
||||
if (m_resultTypeUiField == RiaDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent)
|
||||
{
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::ternarySaturationResultName(), RimDefines::ternarySaturationResultName()));
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RiaDefines::ternarySaturationResultName(), RiaDefines::ternarySaturationResultName()));
|
||||
}
|
||||
|
||||
// Cell Face result names
|
||||
@@ -595,7 +599,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
}
|
||||
}
|
||||
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::undefinedResultName(), RimDefines::undefinedResultName()));
|
||||
optionList.push_front(caf::PdmOptionItemInfo(RiaDefines::undefinedResultName(), RiaDefines::undefinedResultName()));
|
||||
|
||||
// Remove Per Cell Face options
|
||||
{
|
||||
@@ -625,7 +629,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RimEclipseResultDefinition::getResultNamesForCurrentUiResultType()
|
||||
{
|
||||
if ( m_resultTypeUiField() != RimDefines::FLOW_DIAGNOSTICS )
|
||||
if ( m_resultTypeUiField() != RiaDefines::FLOW_DIAGNOSTICS )
|
||||
{
|
||||
RimReservoirCellResultsStorage* cellResultsStorage = currentGridCellResults();
|
||||
|
||||
@@ -653,7 +657,7 @@ size_t RimEclipseResultDefinition::scalarResultIndex() const
|
||||
{
|
||||
size_t gridScalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
||||
|
||||
if (m_resultType() == RimDefines::FLOW_DIAGNOSTICS) return cvf::UNDEFINED_SIZE_T;
|
||||
if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS) return cvf::UNDEFINED_SIZE_T;
|
||||
|
||||
const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
||||
if (gridCellResults && gridCellResults->cellResults())
|
||||
@@ -669,7 +673,7 @@ size_t RimEclipseResultDefinition::scalarResultIndex() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
{
|
||||
CVF_ASSERT(m_resultType() == RimDefines::FLOW_DIAGNOSTICS);
|
||||
CVF_ASSERT(m_resultType() == RiaDefines::FLOW_DIAGNOSTICS);
|
||||
|
||||
size_t timeStep = 0;
|
||||
|
||||
@@ -733,7 +737,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
}
|
||||
}
|
||||
|
||||
return RigFlowDiagResultAddress(m_resultVariable().toStdString(), selTracerNames);
|
||||
return RigFlowDiagResultAddress(m_resultVariable().toStdString(), m_phaseSelection(), selTracerNames);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -749,7 +753,7 @@ void RimEclipseResultDefinition::setFlowDiagTracerSelectionType(FlowTracerSelect
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEclipseResultDefinition::resultVariableUiName() const
|
||||
{
|
||||
if (resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
if (resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
QString fullName;
|
||||
|
||||
@@ -774,7 +778,7 @@ QString RimEclipseResultDefinition::resultVariableUiName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEclipseResultDefinition::resultVariableUiShortName() const
|
||||
{
|
||||
if (resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
if (resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
QString shortName;
|
||||
|
||||
@@ -808,7 +812,7 @@ QString RimEclipseResultDefinition::resultVariableUiShortName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::loadResult()
|
||||
{
|
||||
if (m_resultType() == RimDefines::FLOW_DIAGNOSTICS) return; // Will load automatically on access
|
||||
if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS) return; // Will load automatically on access
|
||||
|
||||
RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
||||
if (gridCellResults)
|
||||
@@ -824,7 +828,7 @@ void RimEclipseResultDefinition::loadResult()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasStaticResult() const
|
||||
{
|
||||
if (this->resultType() == RimDefines::FLOW_DIAGNOSTICS) return false;
|
||||
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS) return false;
|
||||
|
||||
const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
||||
size_t gridScalarResultIndex = this->scalarResultIndex();
|
||||
@@ -844,7 +848,7 @@ bool RimEclipseResultDefinition::hasStaticResult() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasResult() const
|
||||
{
|
||||
if (this->resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
if (m_flowSolution() && !m_resultVariable().isEmpty()) return true;
|
||||
}
|
||||
@@ -866,15 +870,15 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
|
||||
{
|
||||
if (hasResult())
|
||||
{
|
||||
if (m_resultType() == RimDefines::DYNAMIC_NATIVE)
|
||||
if (m_resultType() == RiaDefines::DYNAMIC_NATIVE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_resultType() == RimDefines::SOURSIMRL)
|
||||
else if (m_resultType() == RiaDefines::SOURSIMRL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
else if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -912,7 +916,7 @@ void RimEclipseResultDefinition::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::setResultType(RimDefines::ResultCatType val)
|
||||
void RimEclipseResultDefinition::setResultType(RiaDefines::ResultCatType val)
|
||||
{
|
||||
m_resultType = val;
|
||||
m_resultTypeUiField = val;
|
||||
@@ -921,7 +925,7 @@ void RimEclipseResultDefinition::setResultType(RimDefines::ResultCatType val)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::setPorosityModel(RimDefines::PorosityModelType val)
|
||||
void RimEclipseResultDefinition::setPorosityModel(RiaDefines::PorosityModelType val)
|
||||
{
|
||||
m_porosityModel = val;
|
||||
m_porosityModelUiField = val;
|
||||
@@ -967,23 +971,34 @@ void RimEclipseResultDefinition::setSelectedTracers(const std::vector<QString>&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::isTernarySaturationSelected() const
|
||||
{
|
||||
bool isTernary = (m_resultType() == RimDefines::DYNAMIC_NATIVE) &&
|
||||
(m_resultVariable().compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0);
|
||||
bool isTernary = (m_resultType() == RiaDefines::DYNAMIC_NATIVE) &&
|
||||
(m_resultVariable().compare(RiaDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0);
|
||||
|
||||
return isTernary;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::isCompletionTypeSelected() const
|
||||
{
|
||||
return (m_resultType() == RiaDefines::DYNAMIC_NATIVE && m_resultVariable() == RiaDefines::completionTypeResultName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasCategoryResult() const
|
||||
{
|
||||
if (this->m_resultType() == RimDefines::FORMATION_NAMES
|
||||
if (this->m_resultType() == RiaDefines::FORMATION_NAMES
|
||||
&& m_eclipseCase
|
||||
&& m_eclipseCase->eclipseCaseData()
|
||||
&& m_eclipseCase->eclipseCaseData()->activeFormationNames() ) return true;
|
||||
|
||||
if (this->m_resultType() == RimDefines::FLOW_DIAGNOSTICS
|
||||
if (this->m_resultType() == RiaDefines::DYNAMIC_NATIVE
|
||||
&& this->resultVariable() == RiaDefines::completionTypeResultName()) return true;
|
||||
|
||||
if (this->m_resultType() == RiaDefines::FLOW_DIAGNOSTICS
|
||||
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
|
||||
|
||||
if (!this->hasStaticResult()) return false;
|
||||
@@ -999,8 +1014,8 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult()
|
||||
{
|
||||
if ( m_eclipseCase
|
||||
&& m_eclipseCase->eclipseCaseData()
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount() > 0 )
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1021,7 +1036,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
uiOrdering.add(&m_porosityModelUiField);
|
||||
}
|
||||
|
||||
if ( m_resultTypeUiField() == RimDefines::FLOW_DIAGNOSTICS )
|
||||
if ( m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS )
|
||||
{
|
||||
uiOrdering.add(&m_flowSolutionUiField);
|
||||
|
||||
@@ -1033,6 +1048,8 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
uiOrdering.add(&m_selectedTracersUiField);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_phaseSelection);
|
||||
|
||||
if ( m_flowSolution() == nullptr )
|
||||
{
|
||||
assignFlowSolutionFromCase();
|
||||
@@ -1048,7 +1065,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (m_resultTypeUiField() == RimDefines::FLOW_DIAGNOSTICS
|
||||
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS
|
||||
&& field == &m_resultVariableUiField)
|
||||
{
|
||||
caf::PdmUiListEditorAttribute* listEditAttr = dynamic_cast<caf::PdmUiListEditorAttribute*>(attribute);
|
||||
@@ -1069,7 +1086,7 @@ void RimEclipseResultDefinition::removePerCellFaceOptionItems(QList<caf::PdmOpti
|
||||
{
|
||||
QString text = optionItems[i].optionUiText;
|
||||
|
||||
if (RimDefines::isPerCellFaceResult(text))
|
||||
if (RiaDefines::isPerCellFaceResult(text))
|
||||
{
|
||||
indicesToRemove.push_back(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user