mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fracture Templates : Refactor load and update logic when geometry changes
This commit is contained in:
@@ -69,5 +69,5 @@ void RicfScaleFractureTemplate::execute()
|
||||
}
|
||||
|
||||
templ->setScaleFactors(m_widthScaleFactor, m_heightScaleFactor, m_dFactorScaleFactor, m_conductivityScaleFactor);
|
||||
templ->reload();
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
}
|
||||
|
||||
@@ -68,5 +68,5 @@ void RicfSetFractureContainment::execute()
|
||||
|
||||
templ->setContainmentTopKLayer(m_topLayer);
|
||||
templ->setContainmentBaseKLayer(m_baseLayer);
|
||||
templ->reload();
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ RimEllipseFractureTemplate::RimEllipseFractureTemplate()
|
||||
CAF_PDM_InitField(&m_permeability,"Permeability", 0.0, "Permeability [mD]", "", "", "");
|
||||
|
||||
m_fractureGrid = new RigFractureGrid();
|
||||
assignConductivityToCellsInsideEllipse();
|
||||
createFractureGridAndAssignConductivities();
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
@@ -75,7 +75,7 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::loadDataAndUpdate()
|
||||
{
|
||||
assignConductivityToCellsInsideEllipse();
|
||||
createFractureGridAndAssignConductivities();
|
||||
|
||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||
if (activeView) activeView->loadDataAndUpdate();
|
||||
@@ -96,12 +96,7 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
m_scaleApplyButton = false;
|
||||
|
||||
// Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||
reload();
|
||||
}
|
||||
|
||||
if (changedField == &m_width || changedField == &m_permeability)
|
||||
{
|
||||
assignConductivityToCellsInsideEllipse();
|
||||
onLoadDataAndUpdateGeometryHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +154,7 @@ void RimEllipseFractureTemplate::changeUnits()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::assignConductivityToCellsInsideEllipse()
|
||||
void RimEllipseFractureTemplate::createFractureGridAndAssignConductivities()
|
||||
{
|
||||
std::vector<RigFractureCell> fractureCells;
|
||||
|
||||
@@ -349,8 +344,10 @@ std::vector<std::pair<QString, QString>> RimEllipseFractureTemplate::uiResultNam
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::reload()
|
||||
void RimEllipseFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfType(eclipseCase);
|
||||
if (eclipseCase)
|
||||
@@ -361,8 +358,6 @@ void RimEllipseFractureTemplate::reload()
|
||||
{
|
||||
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||
}
|
||||
|
||||
assignConductivityToCellsInsideEllipse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -66,14 +66,14 @@ public:
|
||||
|
||||
void loadDataAndUpdate() override;
|
||||
std::vector<std::pair<QString, QString>> uiResultNamesWithUnit() const override;
|
||||
virtual void reload() override;
|
||||
|
||||
protected:
|
||||
private:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
void assignConductivityToCellsInsideEllipse();
|
||||
void onLoadDataAndUpdateGeometryHasChanged() override;
|
||||
|
||||
void createFractureGridAndAssignConductivities();
|
||||
std::vector<cvf::Vec3f> fractureBorderPolygon() const;
|
||||
|
||||
FractureWidthAndConductivity widthAndConductivityAtWellPathIntersection(const RimFracture* fractureInstance) const override;
|
||||
|
||||
@@ -809,6 +809,14 @@ double RimFractureTemplate::computeFractureWidth(const RimFracture* fractureInst
|
||||
return m_fractureWidth;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::loadDataAndUpdateGeometryHasChanged()
|
||||
{
|
||||
onLoadDataAndUpdateGeometryHasChanged();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -156,7 +156,6 @@ public:
|
||||
void setId(int id);
|
||||
void setScaleFactors(double widthScale, double heightScale, double dFactorScale, double conductivityScale);
|
||||
void scaleFactors(double* widthScale, double* heightScale, double* dFactorScale, double* conductivityScale) const;
|
||||
virtual void reload() {}
|
||||
|
||||
void setContainmentTopKLayer(int topKLayer);
|
||||
void setContainmentBaseKLayer(int baseKLayer);
|
||||
@@ -167,6 +166,8 @@ public:
|
||||
double computeWellRadiusForDFactorCalculation(const RimFracture* fractureInstance) const;
|
||||
double computeFractureWidth(const RimFracture* fractureInstance) const;
|
||||
|
||||
void loadDataAndUpdateGeometryHasChanged();
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
@@ -175,6 +176,7 @@ protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
std::vector<RimFracture*> fracturesUsingThisTemplate() const;
|
||||
virtual void onLoadDataAndUpdateGeometryHasChanged() = 0;
|
||||
|
||||
private:
|
||||
void prepareFieldsForUiDisplay();
|
||||
|
||||
@@ -154,7 +154,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
if (changedField == &m_scaleApplyButton)
|
||||
{
|
||||
m_scaleApplyButton = false;
|
||||
reload();
|
||||
onLoadDataAndUpdateGeometryHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void RimStimPlanFractureTemplate::convertToUnitSystem(RiaEclipseUnitTools::UnitS
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::reload()
|
||||
void RimStimPlanFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
|
||||
|
||||
@@ -92,15 +92,14 @@ public:
|
||||
|
||||
|
||||
void convertToUnitSystem(RiaEclipseUnitTools::UnitSystem neededUnit) override;
|
||||
virtual void reload() override;
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
|
||||
private:
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
void onLoadDataAndUpdateGeometryHasChanged() override;
|
||||
|
||||
void setDefaultConductivityResultIfEmpty();
|
||||
bool setBorderPolygonResultNameToDefault();
|
||||
void computeDepthOfWellPathAtFracture();
|
||||
|
||||
Reference in New Issue
Block a user