6877 well fracture intersection per fracture (#7251)

* #6877 Move well/fracture intersection to fracture (from template).
* #6877 Read stimplan xml without scaling and well/fracture intersection offset
* #6877 Move fracture grid to RimFracture from template.
* #6877 Use RiaDefines::conductivityResultName() where applicable.
* #6877 Reintroduce fracture template scaling.
* #6877 Hide well/fracture intersection option for elliptical template
* #7280: Fix crash when picking in first time step of StimPlan fracture
* #7279 Redraw after deleting fracture to make it disappear.
This commit is contained in:
Kristian Bendiksen
2021-01-26 15:32:18 +01:00
committed by GitHub
parent 05aceef936
commit f8aae6691d
22 changed files with 317 additions and 227 deletions

View File

@@ -57,9 +57,6 @@ RimEllipseFractureTemplate::RimEllipseFractureTemplate()
CAF_PDM_InitField( &m_width, "Width", 0.0, "Width", "", "", "" );
CAF_PDM_InitField( &m_permeability, "Permeability", 0.0, "Permeability [mD]", "", "", "" );
m_fractureGrid = new RigFractureGrid();
createFractureGridAndAssignConductivities();
setDeletable( true );
}
@@ -75,8 +72,12 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate()
//--------------------------------------------------------------------------------------------------
void RimEllipseFractureTemplate::loadDataAndUpdate()
{
createFractureGridAndAssignConductivities();
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
{
fracture->updateFractureGrid();
}
// TODO: is this necessary? Strange responsibility for a fracture template.
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>( RiaApplication::instance()->activeReservoirView() );
if ( activeView ) activeView->loadDataAndUpdate();
}
@@ -104,7 +105,8 @@ void RimEllipseFractureTemplate::fieldChangedByUi( const caf::PdmFieldHandle* ch
///
//--------------------------------------------------------------------------------------------------
void RimEllipseFractureTemplate::fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* triangleIndices ) const
std::vector<cvf::uint>* triangleIndices,
double wellPathDepthAtFracture ) const
{
RigEllipsisTesselator tesselator( 20 );
@@ -124,7 +126,7 @@ std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fractureBorderPolygon() cons
std::vector<cvf::Vec3f> nodeCoords;
std::vector<cvf::uint> triangleIndices;
fractureTriangleGeometry( &nodeCoords, &triangleIndices );
fractureTriangleGeometry( &nodeCoords, &triangleIndices, -1.0 );
for ( size_t i = 1; i < nodeCoords.size(); i++ )
{
@@ -154,8 +156,9 @@ void RimEllipseFractureTemplate::changeUnits()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEllipseFractureTemplate::createFractureGridAndAssignConductivities()
cvf::cref<RigFractureGrid> RimEllipseFractureTemplate::createFractureGrid( double wellPathDepthAtFracture ) const
{
cvf::ref<RigFractureGrid> fractureGrid = new RigFractureGrid();
std::vector<RigFractureCell> fractureCells;
int numberOfCellsI = 35;
@@ -215,14 +218,15 @@ void RimEllipseFractureTemplate::createFractureGridAndAssignConductivities()
}
}
m_fractureGrid->setFractureCells( fractureCells );
fractureGrid->setFractureCells( fractureCells );
// Set well intersection to center of ellipse
std::pair<size_t, size_t> wellCenterFractureCellIJ = std::make_pair( numberOfCellsI / 2, numberOfCellsJ / 2 );
m_fractureGrid->setWellCenterFractureCellIJ( wellCenterFractureCellIJ );
fractureGrid->setWellCenterFractureCellIJ( wellCenterFractureCellIJ );
m_fractureGrid->setICellCount( numberOfCellsI );
m_fractureGrid->setJCellCount( numberOfCellsJ );
fractureGrid->setICellCount( numberOfCellsI );
fractureGrid->setJCellCount( numberOfCellsJ );
return cvf::cref<RigFractureGrid>( fractureGrid.p() );
}
//--------------------------------------------------------------------------------------------------
@@ -269,14 +273,6 @@ QList<caf::PdmOptionItemInfo>
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigFractureGrid* RimEllipseFractureTemplate::fractureGrid() const
{
return m_fractureGrid.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -46,12 +46,13 @@ public:
~RimEllipseFractureTemplate() override;
void fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* polygonIndices ) const override;
std::vector<cvf::uint>* polygonIndices,
double wellPathDepthAtFracture ) const override;
void changeUnits();
const RigFractureGrid* fractureGrid() const override;
void setDefaultValuesFromUnit();
double conductivity() const;
void changeUnits();
cvf::cref<RigFractureGrid> createFractureGrid( double wellPathDepthAtFracture ) const override;
void setDefaultValuesFromUnit();
double conductivity() const;
double halfLength() const;
double height() const;
@@ -81,8 +82,6 @@ private:
WellFractureIntersectionData wellFractureIntersectionData( const RimFracture* fractureInstance ) const override;
private:
cvf::ref<RigFractureGrid> m_fractureGrid;
caf::PdmField<double> m_halfLength;
caf::PdmField<double> m_height;
caf::PdmField<double> m_width;

View File

@@ -116,6 +116,9 @@ RimFracture::RimFracture()
m_createStimPlanFractureTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
m_createStimPlanFractureTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
CAF_PDM_InitField( &m_wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Well/Fracture Intersection Depth", "", "", "" );
m_wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "" );
m_anchorPosition.uiCapability()->setUiHidden( true );
m_anchorPosition.xmlCapability()->disableIO();
@@ -247,6 +250,7 @@ void RimFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
setFractureTemplate( m_fractureTemplate );
setDefaultFractureColorResult();
updateFractureGrid();
}
else if ( changedField == &m_editFractureTemplate )
{
@@ -265,6 +269,13 @@ void RimFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
{
RicNewStimPlanFractureTemplateFeature::createNewTemplateForFractureAndUpdate( this );
}
else if ( changedField == &m_wellPathDepthAtFracture )
{
updateFractureGrid();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
if ( changedField == &m_azimuth || changedField == &m_fractureTemplate ||
changedField == &m_stimPlanTimeIndexToPlot || changedField == this->objectToggleField() ||
changedField == &m_dip || changedField == &m_tilt || changedField == &m_perforationLength )
@@ -451,7 +462,7 @@ cvf::BoundingBox RimFracture::boundingBoxInDomainCoords() const
std::vector<cvf::Vec3f> nodeCoordVec;
std::vector<cvf::uint> triangleIndices;
this->triangleGeometry( &triangleIndices, &nodeCoordVec );
this->triangleGeometryTransformed( &triangleIndices, &nodeCoordVec, true );
cvf::BoundingBox fractureBBox;
for ( const auto& nodeCoord : nodeCoordVec )
@@ -551,23 +562,36 @@ void RimFracture::setFractureTemplateNoUpdate( RimFractureTemplate* fractureTemp
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFracture::triangleGeometry( std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* nodeCoords ) const
void RimFracture::triangleGeometry( std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices ) const
{
triangleGeometryTransformed( triangleIndices, nodeCoords, false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFracture::triangleGeometryTransformed( std::vector<cvf::uint>* triangleIndices,
std::vector<cvf::Vec3f>* nodeCoords,
bool transform ) const
{
RimFractureTemplate* fractureDef = fractureTemplate();
if ( fractureDef )
{
fractureDef->fractureTriangleGeometry( nodeCoords, triangleIndices );
fractureDef->fractureTriangleGeometry( nodeCoords, triangleIndices, m_wellPathDepthAtFracture );
}
cvf::Mat4d m = transformMatrix();
for ( cvf::Vec3f& v : *nodeCoords )
if ( transform )
{
cvf::Vec3d vd( v );
cvf::Mat4d m = transformMatrix();
vd.transformPoint( m );
for ( cvf::Vec3f& v : *nodeCoords )
{
cvf::Vec3d vd( v );
v = cvf::Vec3f( vd );
vd.transformPoint( m );
v = cvf::Vec3f( vd );
}
}
}
@@ -713,10 +737,13 @@ void RimFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& ui
m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden( false );
m_stimPlanTimeIndexToPlot.uiCapability()->setUiReadOnly( true );
m_wellPathDepthAtFracture.uiCapability()->setUiHidden( false );
}
else
{
m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden( true );
m_wellPathDepthAtFracture.uiCapability()->setUiHidden( true );
}
}
else
@@ -752,6 +779,22 @@ void RimFracture::defineEditorAttribute( const caf::PdmFieldHandle* field,
}
}
if ( field == &m_wellPathDepthAtFracture )
{
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
if ( myAttr )
{
RimStimPlanFractureTemplate* stimPlanFracTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( fractureTemplate() );
if ( stimPlanFracTemplate )
{
auto [minimum, maximum] = stimPlanFracTemplate->wellPathDepthAtFractureRange();
myAttr->m_minimum = minimum;
myAttr->m_maximum = maximum;
}
}
}
if ( field == &m_createEllipseFractureTemplate )
{
auto myAttr = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute );
@@ -820,6 +863,7 @@ void RimFracture::setFractureTemplate( RimFractureTemplate* fractureTemplate )
if ( stimPlanFracTemplate )
{
m_stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex();
m_wellPathDepthAtFracture = stimPlanFracTemplate->wellPathDepthAtFracture();
}
if ( fractureTemplate->orientationType() == RimFractureTemplate::AZIMUTH )
@@ -853,3 +897,24 @@ RivWellFracturePartMgr* RimFracture::fracturePartManager()
return m_fracturePartMgr.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFracture::updateFractureGrid()
{
m_fractureGrid = nullptr;
if ( m_fractureTemplate() )
{
m_fractureGrid = m_fractureTemplate->createFractureGrid( m_wellPathDepthAtFracture );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigFractureGrid* RimFracture::fractureGrid() const
{
return m_fractureGrid.p();
}

View File

@@ -40,6 +40,7 @@ class RivWellFracturePartMgr;
class RimFractureTemplate;
class RigFracturedEclipseCellExportData;
class RigMainGrid;
class RigFractureGrid;
class NonDarcyData
{
@@ -120,6 +121,11 @@ public:
void ensureValidNonDarcyProperties();
void clearCachedNonDarcyProperties();
virtual void triangleGeometry( std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices ) const;
void updateFractureGrid();
const RigFractureGrid* fractureGrid() const;
friend class RimFractureTemplate;
// RimWellPathCompletionsInterface overrides.
@@ -141,7 +147,9 @@ protected:
private:
cvf::Vec3d fracturePositionForUi() const;
double wellFractureAzimuthDiff() const;
void triangleGeometry( std::vector<cvf::uint>* triangleIndices, std::vector<cvf::Vec3f>* vxCoords ) const;
void triangleGeometryTransformed( std::vector<cvf::uint>* triangleIndices,
std::vector<cvf::Vec3f>* vxCoords,
bool transform ) const;
QString wellFractureAzimuthDiffText() const;
QString wellAzimuthAtFracturePositionText() const;
@@ -153,6 +161,7 @@ protected:
caf::PdmField<bool> m_editFractureTemplate;
caf::PdmField<bool> m_createEllipseFractureTemplate;
caf::PdmField<bool> m_createStimPlanFractureTemplate;
caf::PdmField<double> m_wellPathDepthAtFracture;
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
caf::PdmField<caf::AppEnum<RiaDefines::EclipseUnitSystem>> m_fractureUnit;
@@ -172,6 +181,7 @@ private:
caf::PdmField<cvf::Vec3d> m_anchorPosition;
cvf::ref<RivWellFracturePartMgr> m_fracturePartMgr;
cvf::cref<RigFractureGrid> m_fractureGrid;
NonDarcyData m_cachedFractureProperties;
};

View File

@@ -28,6 +28,7 @@
#include "cafPdmObject.h"
#include "cafPdmProxyValueField.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include <limits>
@@ -136,10 +137,11 @@ public:
double perforationLength() const;
virtual void fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* triangleIndices ) const = 0;
std::vector<cvf::uint>* triangleIndices,
double wellPathDepthAtFracture ) const = 0;
virtual const RigFractureGrid* fractureGrid() const = 0;
const RimFractureContainment* fractureContainment() const;
virtual cvf::cref<RigFractureGrid> createFractureGrid( double wellPathDepthAtFracture ) const = 0;
const RimFractureContainment* fractureContainment() const;
virtual void appendDataToResultStatistics( const QString& resultName,
const QString& unit,

View File

@@ -223,7 +223,7 @@ void RimFractureTemplateCollection::createAndAssignTemplateCopyForNonMatchingUni
for ( RimFractureTemplate* fractureTemplate : m_fractureDefinitions() )
{
if ( fractureTemplate && fractureTemplate->fractureGrid() )
if ( fractureTemplate )
{
RimFractureTemplate* templateWithMatchingUnit = nullptr;

View File

@@ -97,8 +97,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
CAF_PDM_InitField( &m_showStimPlanMesh_OBSOLETE, "ShowStimPlanMesh", true, "", "", "", "" );
m_showStimPlanMesh_OBSOLETE.uiCapability()->setUiHidden( true );
m_fractureGrid = new RigFractureGrid();
m_readError = false;
m_readError = false;
setDeletable( true );
}
@@ -147,35 +146,24 @@ void RimStimPlanFractureTemplate::fieldChangedByUi( const caf::PdmFieldHandle* c
if ( &m_activeTimeStepIndex == changedField )
{
// Changes to this parameters should change all fractures with this fracture template attached.
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
if ( proj )
RimProject* proj = RimProject::current();
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
{
std::vector<RimFracture*> fractures;
proj->descendantsIncludingThisOfType( fractures );
for ( RimFracture* fracture : fractures )
{
if ( fracture->fractureTemplate() == this )
{
fracture->setStimPlanTimeIndexToPlot( m_activeTimeStepIndex );
}
}
proj->scheduleCreateDisplayModelAndRedrawAllViews();
fracture->setStimPlanTimeIndexToPlot( m_activeTimeStepIndex );
}
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
if ( &m_wellPathDepthAtFracture == changedField || &m_borderPolygonResultName == changedField ||
&m_activeTimeStepIndex == changedField || &m_stimPlanFileName == changedField ||
&m_conductivityResultNameOnFile == changedField )
if ( &m_borderPolygonResultName == changedField || &m_activeTimeStepIndex == changedField ||
&m_stimPlanFileName == changedField || &m_conductivityResultNameOnFile == changedField )
{
updateFractureGrid();
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
if ( proj )
// Update fracture grid for all fractures using this template
RimProject* proj = RimProject::current();
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
fracture->updateFractureGrid();
}
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
if ( changedField == &m_scaleApplyButton )
@@ -281,9 +269,6 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader::readStimPlanXMLFile( m_stimPlanFileName().path(),
m_conductivityScaleFactor(),
m_halfLengthScaleFactor(),
m_heightScaleFactor(),
-m_wellPathDepthAtFracture(),
RifStimPlanXmlReader::MIRROR_AUTO,
fractureTemplateUnit(),
&errorMessage );
@@ -311,10 +296,9 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
m_readError = true;
}
updateFractureGrid();
for ( RimFracture* fracture : fracturesUsingThisTemplate() )
{
fracture->updateFractureGrid();
fracture->clearCachedNonDarcyProperties();
}
@@ -482,7 +466,8 @@ WellFractureIntersectionData
{
WellFractureIntersectionData values;
if ( m_fractureGrid.notNull() )
const RigFractureGrid* fractureGrid = fractureInstance->fractureGrid();
if ( fractureGrid )
{
if ( orientationType() == ALONG_WELL_PATH )
{
@@ -591,9 +576,9 @@ WellFractureIntersectionData
}
else
{
std::pair<size_t, size_t> wellCellIJ = m_fractureGrid->fractureCellAtWellCenter();
size_t wellCellIndex = m_fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
const RigFractureCell& wellCell = m_fractureGrid->cellFromIndex( wellCellIndex );
std::pair<size_t, size_t> wellCellIJ = fractureGrid->fractureCellAtWellCenter();
size_t wellCellIndex = fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
const RigFractureCell& wellCell = fractureGrid->cellFromIndex( wellCellIndex );
double conductivity = wellCell.getConductivityValue();
values.m_conductivity = conductivity;
@@ -842,13 +827,8 @@ void RimStimPlanFractureTemplate::onLoadDataAndUpdateGeometryHasChanged()
{
loadDataAndUpdate();
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
if ( proj )
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
}
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
@@ -953,11 +933,12 @@ bool RimStimPlanFractureTemplate::hasConductivity() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimStimPlanFractureTemplate::resultValueAtIJ( const QString& uiResultName,
const QString& unitName,
size_t timeStepIndex,
size_t i,
size_t j )
double RimStimPlanFractureTemplate::resultValueAtIJ( const RigFractureGrid* fractureGrid,
const QString& uiResultName,
const QString& unitName,
size_t timeStepIndex,
size_t i,
size_t j )
{
auto values = resultValues( uiResultName, unitName, timeStepIndex );
@@ -966,7 +947,7 @@ double RimStimPlanFractureTemplate::resultValueAtIJ( const QString& uiResultName
size_t adjustedI = i + 1;
size_t adjustedJ = j + 1;
if ( adjustedI >= fractureGrid()->iCellCount() || adjustedJ >= fractureGrid()->jCellCount() )
if ( adjustedI >= fractureGrid->iCellCount() || adjustedJ >= fractureGrid->jCellCount() )
{
return HUGE_VAL;
}
@@ -1012,39 +993,18 @@ void RimStimPlanFractureTemplate::appendDataToResultStatistics( const QString&
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
{
return m_fractureGrid.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate::updateFractureGrid()
{
m_fractureGrid = nullptr;
if ( m_stimPlanFractureDefinitionData.notNull() )
{
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid( m_conductivityResultNameOnFile,
m_activeTimeStepIndex,
m_wellPathDepthAtFracture,
m_fractureTemplateUnit() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate::fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* triangleIndices ) const
std::vector<cvf::uint>* triangleIndices,
double wellPathDepthAtFracture ) const
{
if ( m_stimPlanFractureDefinitionData.notNull() )
{
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry( m_wellPathDepthAtFracture,
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry( m_halfLengthScaleFactor(),
m_heightScaleFactor(),
wellPathDepthAtFracture,
name(),
nodeCoords,
triangleIndices );
@@ -1142,3 +1102,39 @@ void RimStimPlanFractureTemplate::initAfterRead()
m_useUserDefinedWellPathDepthAtFracture = true;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimStimPlanFractureTemplate::wellPathDepthAtFracture() const
{
return m_wellPathDepthAtFracture;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<double, double> RimStimPlanFractureTemplate::wellPathDepthAtFractureRange() const
{
if ( m_stimPlanFractureDefinitionData.isNull() ) return std::make_pair( 0.0, 1.0 );
return std::make_pair( m_stimPlanFractureDefinitionData->minDepth(), m_stimPlanFractureDefinitionData->maxDepth() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::cref<RigFractureGrid> RimStimPlanFractureTemplate::createFractureGrid( double wellPathDepthAtFracture ) const
{
if ( m_stimPlanFractureDefinitionData.notNull() )
{
return m_stimPlanFractureDefinitionData->createFractureGrid( m_conductivityResultNameOnFile,
m_activeTimeStepIndex,
m_halfLengthScaleFactor(),
m_heightScaleFactor(),
wellPathDepthAtFracture,
m_fractureTemplateUnit() );
}
return cvf::cref<RigFractureGrid>();
}

View File

@@ -61,22 +61,30 @@ public:
void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
// Fracture geometry
double wellPathDepthAtFracture() const;
std::pair<double, double> wellPathDepthAtFractureRange() const;
const RigFractureGrid* fractureGrid() const override;
void updateFractureGrid();
void fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* triangleIndices ) const override;
// Fracture geometry
cvf::cref<RigFractureGrid> createFractureGrid( double wellPathDepthAtFracture ) const override;
void fractureTriangleGeometry( std::vector<cvf::Vec3f>* nodeCoords,
std::vector<cvf::uint>* triangleIndices,
double wellPathDepthAtFracture ) const override;
// Result Access
std::vector<double> timeSteps();
std::vector<std::pair<QString, QString>> uiResultNamesWithUnit() const override;
std::vector<std::vector<double>>
resultValues( const QString& uiResultName, const QString& unitName, size_t timeStepIndex ) const;
resultValues( const QString& uiResultName, const QString& unitName, size_t timeStepIndex ) const;
std::vector<double> fractureGridResults( const QString& resultName, const QString& unitName, size_t timeStepIndex ) const;
bool hasConductivity() const;
double resultValueAtIJ( const QString& uiResultName, const QString& unitName, size_t timeStepIndex, size_t i, size_t j );
double resultValueAtIJ( const RigFractureGrid* fractureGrid,
const QString& uiResultName,
const QString& unitName,
size_t timeStepIndex,
size_t i,
size_t j );
std::vector<double> widthResultValues() const;
@@ -133,7 +141,6 @@ private:
caf::PdmField<caf::FilePath> m_stimPlanFileName;
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
cvf::ref<RigFractureGrid> m_fractureGrid;
bool m_readError;
caf::PdmField<bool> m_showStimPlanMesh_OBSOLETE;

View File

@@ -77,7 +77,7 @@ void RimWellPathFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
{
RimFracture::fieldChangedByUi( changedField, oldValue, newValue );
if ( changedField == &m_measuredDepth )
if ( changedField == &m_measuredDepth || changedField == &m_wellPathDepthAtFracture )
{
updatePositionFromMeasuredDepth();
updateAzimuthBasedOnWellAzimuthAngle();
@@ -275,6 +275,8 @@ void RimWellPathFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup( "Fracture Center Info" );
fractureCenterGroup->add( &m_uiAnchorPosition );
uiOrdering.add( &m_wellPathDepthAtFracture );
uiOrdering.skipRemainingFields( true );
}
@@ -302,3 +304,11 @@ void RimWellPathFracture::defineEditorAttribute( const caf::PdmFieldHandle* fiel
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFracture::triangleGeometry( std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices ) const
{
m_fractureTemplate->fractureTriangleGeometry( nodeCoords, triangleIndices, m_wellPathDepthAtFracture );
}

View File

@@ -55,6 +55,8 @@ public:
bool isEnabled() const override; // RimWellPathCompletionsInterface override
void triangleGeometry( std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices ) const override;
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,

View File

@@ -134,15 +134,13 @@ void RimWellPathFractureCollection::fieldChangedByUi( const caf::PdmFieldHandle*
const QVariant& oldValue,
const QVariant& newValue )
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
if ( changedField == &m_isChecked )
{
proj->reloadCompletionTypeResultsInAllViews();
RimProject::current()->reloadCompletionTypeResultsInAllViews();
}
else
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
}
@@ -161,3 +159,12 @@ void RimWellPathFractureCollection::initAfterRead()
m_mswParameters->setManualReferenceMD( m_refMD_OBSOLETE() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}

View File

@@ -50,6 +50,9 @@ public:
std::vector<RimWellPathFracture*> allFractures() const;
std::vector<RimWellPathFracture*> activeFractures() const;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;

View File

@@ -21,6 +21,7 @@
#include "RiaFractureDefines.h"
#include "RimEclipseView.h"
#include "RimFracture.h"
#include "RimFractureTemplateCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
@@ -209,12 +210,7 @@ void RimStimPlanColors::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
if ( changedField == &m_showStimPlanMesh )
{
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
if ( proj )
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
if ( changedField == &m_stimPlanCellVizMode )
@@ -309,18 +305,15 @@ void RimStimPlanColors::updateLegendData()
void RimStimPlanColors::updateStimPlanTemplates() const
{
// Get all frac templates and re-generate stimplan cells
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
if ( proj )
RimProject* proj = RimProject::current();
std::vector<RimFracture*> fractures;
proj->descendantsIncludingThisOfType( fractures );
for ( RimFracture* fracture : fractures )
{
std::vector<RimStimPlanFractureTemplate*> stimPlanFracTemplates;
proj->descendantsIncludingThisOfType( stimPlanFracTemplates );
for ( RimStimPlanFractureTemplate* stimPlanFracTemplate : stimPlanFracTemplates )
{
stimPlanFracTemplate->updateFractureGrid();
}
proj->scheduleCreateDisplayModelAndRedrawAllViews();
fracture->updateFractureGrid();
}
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
@@ -331,12 +324,12 @@ void RimStimPlanColors::updateConductivityResultName()
// Conductivity result name as reported from the XML file was moved to the fracture template
// Replace all conductivity names with the one and only conductivity uiName reported from by fracture template
if ( m_resultNameAndUnit().contains( "conductivity", Qt::CaseInsensitive ) )
if ( m_resultNameAndUnit().contains( RiaDefines::conductivityResultName(), Qt::CaseInsensitive ) )
{
RimFractureTemplateCollection* fractureTemplates = fractureTemplateCollection();
for ( auto resultNameAndUnit : fractureTemplates->resultNamesAndUnits() )
{
if ( resultNameAndUnit.first.contains( "conductivity", Qt::CaseInsensitive ) )
if ( resultNameAndUnit.first.contains( RiaDefines::conductivityResultName(), Qt::CaseInsensitive ) )
{
QString resultNameAndUnitString = toString( resultNameAndUnit );
m_resultNameAndUnit = resultNameAndUnitString;
@@ -350,12 +343,7 @@ void RimStimPlanColors::updateConductivityResultName()
//--------------------------------------------------------------------------------------------------
RimFractureTemplateCollection* RimStimPlanColors::fractureTemplateCollection() const
{
RimProject* proj = nullptr;
this->firstAncestorOrThisOfType( proj );
if ( !proj ) return nullptr;
return proj->activeOilField()->fractureDefinitionCollection();
return RimProject::current()->activeOilField()->fractureDefinitionCollection();
}
//--------------------------------------------------------------------------------------------------
@@ -411,10 +399,8 @@ void RimStimPlanColors::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
colorGroup->add( &m_resultNameAndUnit );
colorGroup->add( &m_defaultColor );
bool stimPlanExists = false;
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
std::vector<RimFractureTemplate*> fracTemplates = proj->allFractureTemplates();
bool stimPlanExists = false;
std::vector<RimFractureTemplate*> fracTemplates = RimProject::current()->allFractureTemplates();
for ( auto fractemplate : fracTemplates )
{