#2483 Use update pattern of intersections when updating simwell fractures

This commit is contained in:
Magne Sjaastad 2018-03-02 12:43:12 +01:00
parent db276fff03
commit e39105503b
5 changed files with 34 additions and 29 deletions

View File

@ -66,7 +66,7 @@ RimSimWellFracture::~RimSimWellFracture()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex) void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex)
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
double location = m_branchCenterLines[branchIndex].locationAlongWellCoords(position); double location = m_branchCenterLines[branchIndex].locationAlongWellCoords(position);
@ -81,7 +81,7 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle() void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle()
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
if (!fractureTemplate()) return; if (!fractureTemplate()) return;
if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH
@ -117,7 +117,7 @@ double RimSimWellFracture::wellAzimuthAtFracturePosition() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimSimWellFracture::wellDipAtFracturePosition() double RimSimWellFracture::wellDipAtFracturePosition()
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
double simWellDip = m_branchCenterLines[m_branchIndex].simWellDipAngle(fracturePosition()); double simWellDip = m_branchCenterLines[m_branchIndex].simWellDipAngle(fracturePosition());
return simWellDip; return simWellDip;
} }
@ -127,7 +127,7 @@ double RimSimWellFracture::wellDipAtFracturePosition()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::loadDataAndUpdate() void RimSimWellFracture::loadDataAndUpdate()
{ {
setBranchGeometry(); computeSimWellBranchCenterLines();
updateFracturePositionFromLocation(); updateFracturePositionFromLocation();
updateAzimuthBasedOnWellAzimuthAngle(); updateAzimuthBasedOnWellAzimuthAngle();
} }
@ -190,7 +190,7 @@ void RimSimWellFracture::recomputeWellCenterlineCoordinates()
{ {
m_branchCenterLines.clear(); m_branchCenterLines.clear();
updateBranchGeometry(); computeSimWellBranchesIfRequired();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -198,7 +198,7 @@ void RimSimWellFracture::recomputeWellCenterlineCoordinates()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateFracturePositionFromLocation() void RimSimWellFracture::updateFracturePositionFromLocation()
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
if (m_branchCenterLines.size() > 0) if (m_branchCenterLines.size() > 0)
{ {
@ -258,7 +258,7 @@ void RimSimWellFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
if (myAttr) if (myAttr)
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
if (m_branchCenterLines.size() > 0) if (m_branchCenterLines.size() > 0)
{ {
@ -283,7 +283,7 @@ QList<caf::PdmOptionItemInfo> RimSimWellFracture::calculateValueOptions(const ca
{ {
if (m_branchCenterLines.size() == 0) if (m_branchCenterLines.size() == 0)
{ {
updateBranchGeometry(); computeSimWellBranchesIfRequired();
} }
if (m_branchCenterLines.size() > 0) if (m_branchCenterLines.size() > 0)
@ -318,18 +318,18 @@ RigMainGrid* RimSimWellFracture::ownerCaseMainGrid() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateBranchGeometry() void RimSimWellFracture::computeSimWellBranchesIfRequired()
{ {
if (m_branchCenterLines.size() == 0) if (m_branchCenterLines.size() == 0)
{ {
setBranchGeometry(); computeSimWellBranchCenterLines();
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::setBranchGeometry() void RimSimWellFracture::computeSimWellBranchCenterLines()
{ {
m_branchCenterLines.clear(); m_branchCenterLines.clear();

View File

@ -62,8 +62,8 @@ protected:
RigMainGrid* ownerCaseMainGrid() const; RigMainGrid* ownerCaseMainGrid() const;
private: private:
void updateBranchGeometry(); void computeSimWellBranchesIfRequired();
void setBranchGeometry(); void computeSimWellBranchCenterLines();
private: private:
caf::PdmField<float> m_location; caf::PdmField<float> m_location;

View File

@ -1,17 +1,17 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2016- Statoil ASA // Copyright (C) 2016- Statoil ASA
// //
// ResInsight is free software: you can redistribute it and/or modify // ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or // WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. // FITNESS FOR A PARTICULAR PURPOSE.
// //
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> // See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details. // for more details.
// //
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@ -21,13 +21,10 @@
#include "RimSimWellFracture.h" #include "RimSimWellFracture.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
CAF_PDM_SOURCE_INIT(RimSimWellFractureCollection, "SimWellFractureCollection"); CAF_PDM_SOURCE_INIT(RimSimWellFractureCollection, "SimWellFractureCollection");
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimSimWellFractureCollection::RimSimWellFractureCollection(void) RimSimWellFractureCollection::RimSimWellFractureCollection(void)
{ {
@ -38,18 +35,28 @@ RimSimWellFractureCollection::RimSimWellFractureCollection(void)
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimSimWellFractureCollection::~RimSimWellFractureCollection() RimSimWellFractureCollection::~RimSimWellFractureCollection()
{ {
simwellFractures.deleteAllChildObjects(); simwellFractures.deleteAllChildObjects();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFractureCollection::deleteFractures() void RimSimWellFractureCollection::deleteFractures()
{ {
simwellFractures.deleteAllChildObjects(); simwellFractures.deleteAllChildObjects();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSimWellFractureCollection::recomputeSimWellCenterlines()
{
for (RimSimWellFracture* frac : simwellFractures())
{
frac->recomputeWellCenterlineCoordinates();
}
}

View File

@ -40,4 +40,5 @@ public:
void deleteFractures(); void deleteFractures();
void recomputeSimWellCenterlines();
}; };

View File

@ -32,7 +32,6 @@
#include "RimEclipseView.h" #include "RimEclipseView.h"
#include "RimIntersectionCollection.h" #include "RimIntersectionCollection.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimSimWellFracture.h"
#include "RimSimWellFractureCollection.h" #include "RimSimWellFractureCollection.h"
#include "RimSimWellInView.h" #include "RimSimWellInView.h"
#include "RimWellAllocationPlot.h" #include "RimWellAllocationPlot.h"
@ -470,10 +469,8 @@ void RimSimWellInViewCollection::fieldChangedByUi(const caf::PdmFieldHandle* cha
for (RimSimWellInView* w : wells) for (RimSimWellInView* w : wells)
{ {
for (RimSimWellFracture* frac : w->simwellFractureCollection()->simwellFractures()) w->simwellFractureCollection()->recomputeSimWellCenterlines();
{
frac->recomputeWellCenterlineCoordinates();
}
} }
} }
} }