mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1585 Remove RigFracture. No caching of transformed triangles related to each fracture instance
This commit is contained in:
parent
b9c6f5cc9e
commit
a2de4efb66
@ -22,7 +22,6 @@
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFracture.h"
|
||||
#include "RigFractureTransCalc.h"
|
||||
#include "RigFractureCell.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
@ -73,15 +73,10 @@ void RivWellFracturePartMgr::updatePartGeometry(caf::DisplayCoordTransform* disp
|
||||
|
||||
if (m_rimFracture)
|
||||
{
|
||||
if (!m_rimFracture->hasValidGeometry())
|
||||
{
|
||||
m_rimFracture->computeGeometry();
|
||||
}
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
m_rimFracture->triangleGeometry(&triangleIndices, &nodeCoords);
|
||||
|
||||
if (!m_rimFracture->hasValidGeometry()) return;
|
||||
|
||||
const std::vector<cvf::Vec3f>& nodeCoords = m_rimFracture->nodeCoords();
|
||||
const std::vector<cvf::uint>& triangleIndices = m_rimFracture->triangleIndices();
|
||||
std::vector<cvf::Vec3f> displayCoords;
|
||||
|
||||
for (size_t i = 0; i < nodeCoords.size(); i++)
|
||||
@ -128,13 +123,6 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
||||
|
||||
if (m_rimFracture)
|
||||
{
|
||||
if (!m_rimFracture->hasValidGeometry())
|
||||
{
|
||||
m_rimFracture->computeGeometry();
|
||||
}
|
||||
|
||||
if (!m_rimFracture->hasValidGeometry()) return;
|
||||
|
||||
RimLegendConfig* legendConfig = nullptr;
|
||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||
if (activeView && activeView->stimPlanColors())
|
||||
@ -152,8 +140,11 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
||||
return;
|
||||
}
|
||||
|
||||
const std::vector<cvf::Vec3f>& nodeCoords = m_rimFracture->nodeCoords();
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
m_rimFracture->triangleGeometry(&triangleIndices, &nodeCoords);
|
||||
|
||||
std::vector<cvf::Vec3f> displayCoords;
|
||||
|
||||
for (size_t i = 0; i < nodeCoords.size(); i++)
|
||||
@ -163,7 +154,6 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
||||
displayCoords.push_back(static_cast<cvf::Vec3f>(displayCoordsDouble));
|
||||
}
|
||||
|
||||
const std::vector<cvf::uint>& triangleIndices = m_rimFracture->triangleIndices();
|
||||
if (triangleIndices.size() == 0 || displayCoords.size() == 0)
|
||||
{
|
||||
return;
|
||||
|
@ -88,7 +88,7 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
{
|
||||
if (fracture->fractureTemplate() == this)
|
||||
{
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "RigCell.h"
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFracture.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessor.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
@ -107,9 +106,6 @@ RimFracture::RimFracture(void)
|
||||
m_displayIJK.registerGetMethod(this, &RimFracture::createOneBasedIJKText);
|
||||
m_displayIJK.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
m_rigFracture = new RigFracture;
|
||||
m_recomputeGeometry = true;
|
||||
|
||||
m_fracturePartMgr = new RivWellFracturePartMgr(this);
|
||||
}
|
||||
|
||||
@ -119,22 +115,6 @@ RimFracture::RimFracture(void)
|
||||
RimFracture::~RimFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::uint>& RimFracture::triangleIndices() const
|
||||
{
|
||||
return m_rigFracture->triangleIndices();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::Vec3f>& RimFracture::nodeCoords() const
|
||||
{
|
||||
return m_rigFracture->nodeCoords();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -144,14 +124,9 @@ std::vector<size_t> RimFracture::getPotentiallyFracturedCells(const RigMainGrid*
|
||||
std::vector<size_t> cellindecies;
|
||||
if (!mainGrid) return cellindecies;
|
||||
|
||||
if (!hasValidGeometry()) computeGeometry();
|
||||
cvf::BoundingBox fractureBBox = this->boundingBoxInDomainCoords();
|
||||
|
||||
const std::vector<cvf::Vec3f>& nodeCoordVec = nodeCoords();
|
||||
|
||||
cvf::BoundingBox polygonBBox;
|
||||
for (cvf::Vec3f nodeCoord : nodeCoordVec) polygonBBox.add(nodeCoord);
|
||||
|
||||
mainGrid->findIntersectingCells(polygonBBox, &cellindecies);
|
||||
mainGrid->findIntersectingCells(fractureBBox, &cellindecies);
|
||||
|
||||
return cellindecies;
|
||||
}
|
||||
@ -203,7 +178,7 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
||||
changedField == &tilt)
|
||||
{
|
||||
|
||||
setRecomputeGeometryFlag();
|
||||
clearDisplayGeometryCache();
|
||||
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
@ -238,41 +213,17 @@ cvf::Vec3d RimFracture::fracturePosition() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox RimFracture::boundingBoxInDomainCoords()
|
||||
{
|
||||
cvf::BoundingBox bb;
|
||||
std::vector<cvf::Vec3f> nodeCoordVec;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
for (auto coord : nodeCoords())
|
||||
{
|
||||
bb.add(coord);
|
||||
}
|
||||
this->triangleGeometry(&triangleIndices, &nodeCoordVec);
|
||||
|
||||
return bb;
|
||||
cvf::BoundingBox fractureBBox;
|
||||
for (cvf::Vec3f nodeCoord : nodeCoordVec) fractureBBox.add(nodeCoord);
|
||||
|
||||
return fractureBBox;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFracture::computeGeometry()
|
||||
{
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
RimFractureTemplate* fractureDef = fractureTemplate();
|
||||
if (fractureDef )
|
||||
{
|
||||
fractureDef->fractureTriangleGeometry(&nodeCoords, &triangleIndices, fractureUnit());
|
||||
}
|
||||
|
||||
cvf::Mat4f m = transformMatrix();
|
||||
|
||||
for (cvf::Vec3f& v : nodeCoords)
|
||||
{
|
||||
v.transformPoint(m);
|
||||
}
|
||||
|
||||
m_rigFracture->setGeometry(triangleIndices, nodeCoords);
|
||||
|
||||
m_recomputeGeometry = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -327,21 +278,31 @@ cvf::Mat4f RimFracture::transformMatrix() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFracture::setRecomputeGeometryFlag()
|
||||
void RimFracture::clearDisplayGeometryCache()
|
||||
{
|
||||
m_recomputeGeometry = true;
|
||||
|
||||
m_fracturePartMgr->clearGeometryCache();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::isRecomputeGeometryFlagSet()
|
||||
void RimFracture::triangleGeometry(std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* nodeCoords)
|
||||
{
|
||||
return m_recomputeGeometry;
|
||||
RimFractureTemplate* fractureDef = fractureTemplate();
|
||||
if (fractureDef )
|
||||
{
|
||||
fractureDef->fractureTriangleGeometry(nodeCoords, triangleIndices, fractureUnit());
|
||||
}
|
||||
|
||||
cvf::Mat4f m = transformMatrix();
|
||||
|
||||
for (cvf::Vec3f& v : *nodeCoords)
|
||||
{
|
||||
v.transformPoint(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -500,7 +461,7 @@ void RimFracture::defineEditorAttribute(const caf::PdmFieldHandle* field, QStrin
|
||||
void RimFracture::setAnchorPosition(const cvf::Vec3d& pos)
|
||||
{
|
||||
m_anchorPosition = pos;
|
||||
setRecomputeGeometryFlag();
|
||||
clearDisplayGeometryCache();
|
||||
|
||||
// Update ijk
|
||||
{
|
||||
@ -539,16 +500,6 @@ void RimFracture::setAnchorPosition(const cvf::Vec3d& pos)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFracture* RimFracture::attachedRigFracture() const
|
||||
{
|
||||
CVF_ASSERT(m_rigFracture.notNull());
|
||||
|
||||
return m_rigFracture.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -583,14 +534,3 @@ RivWellFracturePartMgr* RimFracture::fracturePartManager()
|
||||
return m_fracturePartMgr.p();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::hasValidGeometry() const
|
||||
{
|
||||
if (m_recomputeGeometry) return false;
|
||||
|
||||
return (nodeCoords().size() > 0 && triangleIndices().size() > 0);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
|
||||
class RigFracture;
|
||||
class RimEclipseCase;
|
||||
class RimEllipseFractureTemplate;
|
||||
class RivWellFracturePartMgr;
|
||||
@ -74,19 +73,14 @@ public:
|
||||
|
||||
cvf::Mat4f transformMatrix() const;
|
||||
|
||||
const RigFracture* attachedRigFracture() const;
|
||||
|
||||
void setFractureTemplate(RimFractureTemplate* fractureTemplate);
|
||||
RimFractureTemplate* fractureTemplate() const;
|
||||
|
||||
RivWellFracturePartMgr* fracturePartManager();
|
||||
|
||||
bool hasValidGeometry() const;
|
||||
void computeGeometry();
|
||||
void setRecomputeGeometryFlag();
|
||||
void clearDisplayGeometryCache();
|
||||
|
||||
const std::vector<cvf::uint>& triangleIndices() const;
|
||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||
void triangleGeometry(std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* vxCoords );
|
||||
|
||||
std::vector<size_t> getPotentiallyFracturedCells(const RigMainGrid* mainGrid);
|
||||
|
||||
@ -102,7 +96,6 @@ protected:
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
|
||||
private:
|
||||
bool isRecomputeGeometryFlagSet();
|
||||
cvf::Vec3d fracturePositionForUi() const;
|
||||
|
||||
QString createOneBasedIJKText() const;
|
||||
@ -116,8 +109,6 @@ protected:
|
||||
|
||||
private:
|
||||
caf::PdmField<cvf::Vec3d> m_anchorPosition;
|
||||
cvf::ref<RigFracture> m_rigFracture;
|
||||
bool m_recomputeGeometry;
|
||||
|
||||
caf::PdmField<int> m_anchorPosEclipseCellI; // Zero based indexing
|
||||
caf::PdmField<int> m_anchorPosEclipseCellJ; // Zero based indexing
|
||||
|
@ -124,14 +124,14 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
||||
{
|
||||
fracture->updateAzimuthFromFractureTemplate();
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
|
||||
if (changedField == &orientationType)
|
||||
{
|
||||
fracture->updateAzimuthFromFractureTemplate();
|
||||
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
if (fracture->fractureTemplate() == this)
|
||||
{
|
||||
fracture->stimPlanTimeIndexToPlot = activeTimeStepIndex;
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
}
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
@ -131,7 +131,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
{
|
||||
if (fracture->fractureTemplate() == this)
|
||||
{
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void RimEclipseView::updateScaleTransform()
|
||||
this->descendantsIncludingThisOfType(fractures);
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
fracture->setRecomputeGeometryFlag();
|
||||
fracture->clearDisplayGeometryCache();
|
||||
}
|
||||
|
||||
if (m_viewer) m_viewer->updateCachedValuesInScene();
|
||||
|
@ -57,7 +57,6 @@ ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.h
|
||||
${CEE_CURRENT_LIST_DIR}RigLasFileExporter.h
|
||||
${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFracture.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransCalc.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.h
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.h
|
||||
@ -120,7 +119,6 @@ ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigLasFileExporter.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFracture.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransCalc.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.cpp
|
||||
|
@ -1,51 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFracture.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFracture::RigFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFracture::setGeometry(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords)
|
||||
{
|
||||
m_nodeCoords = nodeCoords;
|
||||
m_triangleIndices = triangleIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::uint>& RigFracture::triangleIndices() const
|
||||
{
|
||||
return m_triangleIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Returns node coordinates in domain coordinate system
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::Vec3f>& RigFracture::nodeCoords() const
|
||||
{
|
||||
return m_nodeCoords;
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfMath.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigFracture : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigFracture();
|
||||
|
||||
void setGeometry(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
|
||||
const std::vector<cvf::uint>& triangleIndices() const;
|
||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||
|
||||
private:
|
||||
std::vector<cvf::uint> m_triangleIndices;
|
||||
std::vector<cvf::Vec3f> m_nodeCoords;
|
||||
};
|
||||
|
@ -25,11 +25,9 @@
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RigFracture.h"
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigFracture.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
|
||||
#include <QString>
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
#include "RigFracture.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user