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->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->setContainmentTopKLayer(m_topLayer);
|
||||||
templ->setContainmentBaseKLayer(m_baseLayer);
|
templ->setContainmentBaseKLayer(m_baseLayer);
|
||||||
templ->reload();
|
templ->loadDataAndUpdateGeometryHasChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ RimEllipseFractureTemplate::RimEllipseFractureTemplate()
|
|||||||
CAF_PDM_InitField(&m_permeability,"Permeability", 0.0, "Permeability [mD]", "", "", "");
|
CAF_PDM_InitField(&m_permeability,"Permeability", 0.0, "Permeability [mD]", "", "", "");
|
||||||
|
|
||||||
m_fractureGrid = new RigFractureGrid();
|
m_fractureGrid = new RigFractureGrid();
|
||||||
assignConductivityToCellsInsideEllipse();
|
createFractureGridAndAssignConductivities();
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate() {}
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEllipseFractureTemplate::loadDataAndUpdate()
|
void RimEllipseFractureTemplate::loadDataAndUpdate()
|
||||||
{
|
{
|
||||||
assignConductivityToCellsInsideEllipse();
|
createFractureGridAndAssignConductivities();
|
||||||
|
|
||||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||||
if (activeView) activeView->loadDataAndUpdate();
|
if (activeView) activeView->loadDataAndUpdate();
|
||||||
@@ -96,12 +96,7 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
m_scaleApplyButton = false;
|
m_scaleApplyButton = false;
|
||||||
|
|
||||||
// Changes to one of these parameters should change all fractures with this fracture template attached.
|
// Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||||
reload();
|
onLoadDataAndUpdateGeometryHasChanged();
|
||||||
}
|
|
||||||
|
|
||||||
if (changedField == &m_width || changedField == &m_permeability)
|
|
||||||
{
|
|
||||||
assignConductivityToCellsInsideEllipse();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +154,7 @@ void RimEllipseFractureTemplate::changeUnits()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEllipseFractureTemplate::assignConductivityToCellsInsideEllipse()
|
void RimEllipseFractureTemplate::createFractureGridAndAssignConductivities()
|
||||||
{
|
{
|
||||||
std::vector<RigFractureCell> fractureCells;
|
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;
|
RimEclipseCase* eclipseCase = nullptr;
|
||||||
this->firstAncestorOrThisOfType(eclipseCase);
|
this->firstAncestorOrThisOfType(eclipseCase);
|
||||||
if (eclipseCase)
|
if (eclipseCase)
|
||||||
@@ -361,8 +358,6 @@ void RimEllipseFractureTemplate::reload()
|
|||||||
{
|
{
|
||||||
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
assignConductivityToCellsInsideEllipse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -66,14 +66,14 @@ public:
|
|||||||
|
|
||||||
void loadDataAndUpdate() override;
|
void loadDataAndUpdate() override;
|
||||||
std::vector<std::pair<QString, QString>> uiResultNamesWithUnit() const 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 defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
private:
|
void onLoadDataAndUpdateGeometryHasChanged() override;
|
||||||
void assignConductivityToCellsInsideEllipse();
|
|
||||||
|
void createFractureGridAndAssignConductivities();
|
||||||
std::vector<cvf::Vec3f> fractureBorderPolygon() const;
|
std::vector<cvf::Vec3f> fractureBorderPolygon() const;
|
||||||
|
|
||||||
FractureWidthAndConductivity widthAndConductivityAtWellPathIntersection(const RimFracture* fractureInstance) const override;
|
FractureWidthAndConductivity widthAndConductivityAtWellPathIntersection(const RimFracture* fractureInstance) const override;
|
||||||
|
|||||||
@@ -809,6 +809,14 @@ double RimFractureTemplate::computeFractureWidth(const RimFracture* fractureInst
|
|||||||
return m_fractureWidth;
|
return m_fractureWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFractureTemplate::loadDataAndUpdateGeometryHasChanged()
|
||||||
|
{
|
||||||
|
onLoadDataAndUpdateGeometryHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ public:
|
|||||||
void setId(int id);
|
void setId(int id);
|
||||||
void setScaleFactors(double widthScale, double heightScale, double dFactorScale, double conductivityScale);
|
void setScaleFactors(double widthScale, double heightScale, double dFactorScale, double conductivityScale);
|
||||||
void scaleFactors(double* widthScale, double* heightScale, double* dFactorScale, double* conductivityScale) const;
|
void scaleFactors(double* widthScale, double* heightScale, double* dFactorScale, double* conductivityScale) const;
|
||||||
virtual void reload() {}
|
|
||||||
|
|
||||||
void setContainmentTopKLayer(int topKLayer);
|
void setContainmentTopKLayer(int topKLayer);
|
||||||
void setContainmentBaseKLayer(int baseKLayer);
|
void setContainmentBaseKLayer(int baseKLayer);
|
||||||
@@ -167,6 +166,8 @@ public:
|
|||||||
double computeWellRadiusForDFactorCalculation(const RimFracture* fractureInstance) const;
|
double computeWellRadiusForDFactorCalculation(const RimFracture* fractureInstance) const;
|
||||||
double computeFractureWidth(const RimFracture* fractureInstance) const;
|
double computeFractureWidth(const RimFracture* fractureInstance) const;
|
||||||
|
|
||||||
|
void loadDataAndUpdateGeometryHasChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) 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;
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||||
|
|
||||||
std::vector<RimFracture*> fracturesUsingThisTemplate() const;
|
std::vector<RimFracture*> fracturesUsingThisTemplate() const;
|
||||||
|
virtual void onLoadDataAndUpdateGeometryHasChanged() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void prepareFieldsForUiDisplay();
|
void prepareFieldsForUiDisplay();
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
|||||||
if (changedField == &m_scaleApplyButton)
|
if (changedField == &m_scaleApplyButton)
|
||||||
{
|
{
|
||||||
m_scaleApplyButton = false;
|
m_scaleApplyButton = false;
|
||||||
reload();
|
onLoadDataAndUpdateGeometryHasChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,7 +685,7 @@ void RimStimPlanFractureTemplate::convertToUnitSystem(RiaEclipseUnitTools::UnitS
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimStimPlanFractureTemplate::reload()
|
void RimStimPlanFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
|
||||||
{
|
{
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -92,15 +92,14 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
void convertToUnitSystem(RiaEclipseUnitTools::UnitSystem neededUnit) override;
|
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:
|
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();
|
void setDefaultConductivityResultIfEmpty();
|
||||||
bool setBorderPolygonResultNameToDefault();
|
bool setBorderPolygonResultNameToDefault();
|
||||||
void computeDepthOfWellPathAtFracture();
|
void computeDepthOfWellPathAtFracture();
|
||||||
|
|||||||
Reference in New Issue
Block a user