#1891 StimPlan : Add support for "Conductivity-propped"

This commit is contained in:
Magne Sjaastad
2017-09-14 13:48:30 +02:00
parent db233a970f
commit 1ec9e72ce2
5 changed files with 56 additions and 18 deletions

View File

@@ -217,7 +217,7 @@ void RimStimPlanFractureTemplate::setDefaultsBasedOnXMLfile()
//--------------------------------------------------------------------------------------------------
bool RimStimPlanFractureTemplate::setBorderPolygonResultNameToDefault()
{
//first option: Width
// first option: Width
for (std::pair<QString, QString> property : resultNamesWithUnit())
{
if (property.first == "WIDTH")
@@ -226,16 +226,15 @@ bool RimStimPlanFractureTemplate::setBorderPolygonResultNameToDefault()
return true;
}
}
//if width not found, use conductivity
for (std::pair<QString, QString> property : resultNamesWithUnit())
// if width not found, use conductivity
if (hasConductivity())
{
if (property.first == "CONDUCTIVITY")
{
m_borderPolygonResultName = property.first;
return true;
}
m_borderPolygonResultName = m_stimPlanFractureDefinitionData->conductivityResultName();
return true;
}
//else: Set to first property
// else: Set to first property
if (resultNamesWithUnit().size() > 0)
{
m_borderPolygonResultName = resultNamesWithUnit()[0].first;
@@ -391,6 +390,20 @@ std::vector<double> RimStimPlanFractureTemplate::fractureGridResults(const QStri
return m_stimPlanFractureDefinitionData->fractureGridResults(resultName, unitName, timeStepIndex);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimStimPlanFractureTemplate::hasConductivity() const
{
if (m_stimPlanFractureDefinitionData.notNull() &&
!m_stimPlanFractureDefinitionData->conductivityResultName().isEmpty())
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -81,6 +81,7 @@ public:
void computeMinMax(const QString& resultName, const QString& unitName, double* minValue, double* maxValue, double* posClosestToZero, double* negClosestToZero) const;
std::vector<std::vector<double>> resultValues(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
std::vector<double> fractureGridResults(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
bool hasConductivity() const;
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;