Whitespace

This commit is contained in:
Magne Sjaastad 2018-10-19 15:43:29 +02:00
parent fa2d96ebcf
commit 4632fd7dff
8 changed files with 148 additions and 142 deletions

View File

@ -110,7 +110,7 @@ public:
std::vector<size_t> getPotentiallyFracturedCells(const RigMainGrid* mainGrid) const; std::vector<size_t> getPotentiallyFracturedCells(const RigMainGrid* mainGrid) const;
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;
cvf::Vec3d fracturePosition() const; cvf::Vec3d fracturePosition() const;
virtual void updateAzimuthBasedOnWellAzimuthAngle() = 0; virtual void updateAzimuthBasedOnWellAzimuthAngle() = 0;
@ -137,9 +137,9 @@ public:
double endMD() const override; double endMD() const override;
protected: protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
private: private:
cvf::Vec3d fracturePositionForUi() const; cvf::Vec3d fracturePositionForUi() const;
@ -149,7 +149,7 @@ private:
QString wellFractureAzimuthDiffText() const; QString wellFractureAzimuthDiffText() const;
QString wellAzimuthAtFracturePositionText() const; QString wellAzimuthAtFracturePositionText() const;
cvf::BoundingBox boundingBoxInDomainCoords() const override; cvf::BoundingBox boundingBoxInDomainCoords() const override;
protected: protected:
caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate; caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate;

View File

@ -180,10 +180,10 @@ public:
void loadDataAndUpdateGeometryHasChanged(); void loadDataAndUpdateGeometryHasChanged();
protected: protected:
caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* userDescriptionField() 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;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
std::vector<RimFracture*> fracturesUsingThisTemplate() const; std::vector<RimFracture*> fracturesUsingThisTemplate() const;
virtual void onLoadDataAndUpdateGeometryHasChanged() = 0; virtual void onLoadDataAndUpdateGeometryHasChanged() = 0;

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.
// //
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@ -29,15 +29,13 @@
#include "RimProject.h" #include "RimProject.h"
#include "RimSimWellInView.h" #include "RimSimWellInView.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "RigWellPath.h" #include "RigWellPath.h"
#include "cafPdmUiDoubleSliderEditor.h"
CAF_PDM_SOURCE_INIT(RimSimWellFracture, "SimWellFracture"); CAF_PDM_SOURCE_INIT(RimSimWellFracture, "SimWellFracture");
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimSimWellFracture::RimSimWellFracture(void) RimSimWellFracture::RimSimWellFracture(void)
{ {
@ -55,14 +53,12 @@ RimSimWellFracture::RimSimWellFracture(void)
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimSimWellFracture::~RimSimWellFracture() RimSimWellFracture::~RimSimWellFracture() {}
{
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex) void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex)
{ {
@ -77,43 +73,46 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle() void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle()
{ {
computeSimWellBranchesIfRequired(); computeSimWellBranchesIfRequired();
if (!fractureTemplate()) return; if (!fractureTemplate()) return;
if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH
|| fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH) if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ||
fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
double simWellAzimuth = wellAzimuthAtFracturePosition(); double simWellAzimuth = wellAzimuthAtFracturePosition();
if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ) if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
{ {
m_azimuth = simWellAzimuth; m_azimuth = simWellAzimuth;
} }
else if (fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH) else if (fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
if (simWellAzimuth + 90 < 360) m_azimuth = simWellAzimuth + 90; if (simWellAzimuth + 90 < 360)
else m_azimuth = simWellAzimuth - 90; m_azimuth = simWellAzimuth + 90;
else
m_azimuth = simWellAzimuth - 90;
} }
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimSimWellFracture::wellAzimuthAtFracturePosition() const double RimSimWellFracture::wellAzimuthAtFracturePosition() const
{ {
double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition()); double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition());
if (simWellAzimuth < 0) simWellAzimuth += 360; if (simWellAzimuth < 0) simWellAzimuth += 360;
return simWellAzimuth; return simWellAzimuth;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimSimWellFracture::wellDipAtFracturePosition() double RimSimWellFracture::wellDipAtFracturePosition()
{ {
@ -123,7 +122,7 @@ double RimSimWellFracture::wellDipAtFracturePosition()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::loadDataAndUpdate() void RimSimWellFracture::loadDataAndUpdate()
{ {
@ -133,7 +132,7 @@ void RimSimWellFracture::loadDataAndUpdate()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimSimWellFracture::perforationLengthCenterLineCoords() const std::vector<cvf::Vec3d> RimSimWellFracture::perforationLengthCenterLineCoords() const
{ {
@ -147,7 +146,7 @@ std::vector<cvf::Vec3d> RimSimWellFracture::perforationLengthCenterLineCoords()
wellPathGeometry.m_measuredDepths = m_branchCenterLines[m_branchIndex].measuredDepths(); wellPathGeometry.m_measuredDepths = m_branchCenterLines[m_branchIndex].measuredDepths();
double startMd = m_location - perforationLength() / 2.0; double startMd = m_location - perforationLength() / 2.0;
double endMd = m_location + perforationLength() / 2.0; double endMd = m_location + perforationLength() / 2.0;
coords = wellPathGeometry.clippedPointSubset(startMd, endMd).first; coords = wellPathGeometry.clippedPointSubset(startMd, endMd).first;
} }
@ -156,21 +155,23 @@ std::vector<cvf::Vec3d> RimSimWellFracture::perforationLengthCenterLineCoords()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{ {
RimFracture::fieldChangedByUi(changedField, oldValue, newValue); RimFracture::fieldChangedByUi(changedField, oldValue, newValue);
if ( changedField == &m_location if (changedField == &m_location || changedField == &m_branchIndex)
|| changedField == &m_branchIndex
)
{ {
updateFracturePositionFromLocation(); updateFracturePositionFromLocation();
RimFractureTemplate::FracOrientationEnum orientation; RimFractureTemplate::FracOrientationEnum orientation;
if (fractureTemplate()) orientation = fractureTemplate()->orientationType(); if (fractureTemplate())
else orientation = RimFractureTemplate::AZIMUTH; orientation = fractureTemplate()->orientationType();
else
orientation = RimFractureTemplate::AZIMUTH;
if (orientation != RimFractureTemplate::AZIMUTH) if (orientation != RimFractureTemplate::AZIMUTH)
{ {
@ -184,7 +185,7 @@ void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::recomputeWellCenterlineCoordinates() void RimSimWellFracture::recomputeWellCenterlineCoordinates()
{ {
@ -194,7 +195,7 @@ void RimSimWellFracture::recomputeWellCenterlineCoordinates()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateFracturePositionFromLocation() void RimSimWellFracture::updateFracturePositionFromLocation()
{ {
@ -212,9 +213,8 @@ void RimSimWellFracture::updateFracturePositionFromLocation()
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{ {
@ -246,9 +246,11 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) void RimSimWellFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute)
{ {
RimFracture::defineEditorAttribute(field, uiConfigName, attribute); RimFracture::defineEditorAttribute(field, uiConfigName, attribute);
@ -264,8 +266,8 @@ void RimSimWellFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
{ {
const RigSimulationWellCoordsAndMD& pointAndMd = m_branchCenterLines[m_branchIndex]; const RigSimulationWellCoordsAndMD& pointAndMd = m_branchCenterLines[m_branchIndex];
myAttr->m_minimum = pointAndMd.measuredDepths().front(); myAttr->m_minimum = pointAndMd.measuredDepths().front();
myAttr->m_maximum = pointAndMd.measuredDepths().back(); myAttr->m_maximum = pointAndMd.measuredDepths().back();
myAttr->m_sliderTickCount = pointAndMd.measuredDepths().back(); myAttr->m_sliderTickCount = pointAndMd.measuredDepths().back();
} }
} }
@ -273,9 +275,10 @@ void RimSimWellFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimSimWellFracture::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) QList<caf::PdmOptionItemInfo> RimSimWellFracture::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly)
{ {
QList<caf::PdmOptionItemInfo> options = RimFracture::calculateValueOptions(fieldNeedingOptions, useOptionsOnly); QList<caf::PdmOptionItemInfo> options = RimFracture::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
@ -302,21 +305,21 @@ QList<caf::PdmOptionItemInfo> RimSimWellFracture::calculateValueOptions(const ca
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigMainGrid* RimSimWellFracture::ownerCaseMainGrid() const RigMainGrid* RimSimWellFracture::ownerCaseMainGrid() const
{ {
RimEclipseView* ownerEclView; RimEclipseView* ownerEclView;
this->firstAncestorOrThisOfType(ownerEclView); this->firstAncestorOrThisOfType(ownerEclView);
if (ownerEclView) if (ownerEclView)
return ownerEclView->mainGrid(); return ownerEclView->mainGrid();
else else
return nullptr; return nullptr;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::computeSimWellBranchesIfRequired() void RimSimWellFracture::computeSimWellBranchesIfRequired()
{ {
@ -327,7 +330,7 @@ void RimSimWellFracture::computeSimWellBranchesIfRequired()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::computeSimWellBranchCenterLines() void RimSimWellFracture::computeSimWellBranchCenterLines()
{ {
@ -337,11 +340,10 @@ void RimSimWellFracture::computeSimWellBranchCenterLines()
this->firstAncestorOrThisOfType(rimWell); this->firstAncestorOrThisOfType(rimWell);
CVF_ASSERT(rimWell); CVF_ASSERT(rimWell);
std::vector< std::vector <cvf::Vec3d> > pipeBranchesCLCoords; std::vector<std::vector<cvf::Vec3d>> pipeBranchesCLCoords;
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds; std::vector<std::vector<RigWellResultPoint>> pipeBranchesCellIds;
rimWell->calculateWellPipeStaticCenterLine(pipeBranchesCLCoords, rimWell->calculateWellPipeStaticCenterLine(pipeBranchesCLCoords, pipeBranchesCellIds);
pipeBranchesCellIds);
for (const auto& branch : pipeBranchesCLCoords) for (const auto& branch : pipeBranchesCLCoords)
{ {
@ -352,17 +354,17 @@ void RimSimWellFracture::computeSimWellBranchCenterLines()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RimSimWellFracture::createOneBasedIJKText() const QString RimSimWellFracture::createOneBasedIJKText() const
{ {
RigMainGrid* mainGrid = ownerCaseMainGrid(); RigMainGrid* mainGrid = ownerCaseMainGrid();
size_t i,j,k; size_t i, j, k;
size_t anchorCellIdx= mainGrid->findReservoirCellIndexFromPoint(anchorPosition()); size_t anchorCellIdx = mainGrid->findReservoirCellIndexFromPoint(anchorPosition());
if (anchorCellIdx == cvf::UNDEFINED_SIZE_T) return ""; if (anchorCellIdx == cvf::UNDEFINED_SIZE_T) return "";
size_t gridLocalCellIdx; size_t gridLocalCellIdx;
const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(anchorCellIdx, &gridLocalCellIdx); const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(anchorCellIdx, &gridLocalCellIdx);
bool ok = hostGrid->ijkFromCellIndex(gridLocalCellIdx, &i, &j, &k); bool ok = hostGrid->ijkFromCellIndex(gridLocalCellIdx, &i, &j, &k);

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.
// //
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@ -23,54 +23,59 @@
#include "RigSimulationWellCoordsAndMD.h" #include "RigSimulationWellCoordsAndMD.h"
#include "RimEllipseFractureTemplate.h" #include "RimEllipseFractureTemplate.h"
//================================================================================================== //==================================================================================================
/// ///
/// ///
//================================================================================================== //==================================================================================================
class RimSimWellFracture : public RimFracture class RimSimWellFracture : public RimFracture
{ {
CAF_PDM_HEADER_INIT; CAF_PDM_HEADER_INIT;
public: public:
RimSimWellFracture(void); RimSimWellFracture(void);
~RimSimWellFracture(void) override; ~RimSimWellFracture(void) override;
void setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex); void setClosestWellCoord(cvf::Vec3d& position, size_t branchIndex);
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void recomputeWellCenterlineCoordinates();
void updateFracturePositionFromLocation();
void updateAzimuthBasedOnWellAzimuthAngle() override;
void recomputeWellCenterlineCoordinates(); double wellAzimuthAtFracturePosition() const override;
void updateFracturePositionFromLocation(); double wellDipAtFracturePosition();
void updateAzimuthBasedOnWellAzimuthAngle() override; double fractureMD() const override
{
return m_location;
}
double wellAzimuthAtFracturePosition() const override; int branchIndex() const
double wellDipAtFracturePosition(); {
double fractureMD() const override { return m_location; } return m_branchIndex();
}
int branchIndex() const { return m_branchIndex(); } void loadDataAndUpdate() override;
void loadDataAndUpdate() override; std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override;
std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override;
protected: protected:
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; void defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
RigMainGrid* ownerCaseMainGrid() const; caf::PdmUiEditorAttribute* attribute) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly) override;
private: private:
void computeSimWellBranchesIfRequired(); RigMainGrid* ownerCaseMainGrid() const;
void computeSimWellBranchCenterLines(); void computeSimWellBranchesIfRequired();
void computeSimWellBranchCenterLines();
QString createOneBasedIJKText() const;
private: private:
caf::PdmField<float> m_location; caf::PdmField<float> m_location;
caf::PdmField<int> m_branchIndex; caf::PdmField<int> m_branchIndex;
std::vector<RigSimulationWellCoordsAndMD> m_branchCenterLines; std::vector<RigSimulationWellCoordsAndMD> m_branchCenterLines;
caf::PdmProxyValueField<QString> m_displayIJK;
QString createOneBasedIJKText() const;
caf::PdmProxyValueField<QString> m_displayIJK;
}; };

View File

@ -323,7 +323,7 @@ QList<caf::PdmOptionItemInfo> RimStimPlanFractureTemplate::calculateValueOptions
if (isBetaFactorAvailableOnFile()) if (isBetaFactorAvailableOnFile())
{ {
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<BetaFactorEnum>::uiText(BETA_FACTOR_FROM_FRACTURE), options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<BetaFactorEnum>::uiText(BETA_FACTOR_FROM_FRACTURE),
BETA_FACTOR_FROM_FRACTURE)); BETA_FACTOR_FROM_FRACTURE));
} }
} }

View File

@ -107,7 +107,7 @@ private:
std::vector<double> fractureGridResultsForUnitSystem(const QString& resultName, const QString& unitName, size_t timeStepIndex, RiaEclipseUnitTools::UnitSystem requiredUnitSystem) const; std::vector<double> fractureGridResultsForUnitSystem(const QString& resultName, const QString& unitName, size_t timeStepIndex, RiaEclipseUnitTools::UnitSystem requiredUnitSystem) const;
WellFractureIntersectionData wellFractureIntersectionData(const RimFracture* fractureInstance) const override; WellFractureIntersectionData wellFractureIntersectionData(const RimFracture* fractureInstance) const override;
std::pair<QString, QString> widthParameterNameAndUnit() const; std::pair<QString, QString> widthParameterNameAndUnit() const;
std::pair<QString, QString> conductivityParameterNameAndUnit() const; std::pair<QString, QString> conductivityParameterNameAndUnit() const;

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.
// //
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@ -26,30 +26,26 @@
#include "cafPdmUiDoubleSliderEditor.h" #include "cafPdmUiDoubleSliderEditor.h"
CAF_PDM_SOURCE_INIT(RimWellPathFracture, "WellPathFracture"); CAF_PDM_SOURCE_INIT(RimWellPathFracture, "WellPathFracture");
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellPathFracture::RimWellPathFracture(void) RimWellPathFracture::RimWellPathFracture(void)
{ {
CAF_PDM_InitObject("Fracture", ":/FractureSymbol16x16.png", "", ""); CAF_PDM_InitObject("Fracture", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitField( &m_measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location", "", "", ""); CAF_PDM_InitField(&m_measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location", "", "", "");
m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName()); m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellPathFracture::~RimWellPathFracture() RimWellPathFracture::~RimWellPathFracture() {}
{
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimWellPathFracture::fractureMD() const double RimWellPathFracture::fractureMD() const
{ {
@ -57,7 +53,7 @@ double RimWellPathFracture::fractureMD() const
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::setMeasuredDepth(double mdValue) void RimWellPathFracture::setMeasuredDepth(double mdValue)
{ {
@ -67,9 +63,11 @@ void RimWellPathFracture::setMeasuredDepth(double mdValue)
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{ {
RimFracture::fieldChangedByUi(changedField, oldValue, newValue); RimFracture::fieldChangedByUi(changedField, oldValue, newValue);
@ -85,16 +83,15 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::updateAzimuthBasedOnWellAzimuthAngle() void RimWellPathFracture::updateAzimuthBasedOnWellAzimuthAngle()
{ {
if (!fractureTemplate()) return; if (!fractureTemplate()) return;
if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ||
|| fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH) fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
double wellPathAzimuth = wellAzimuthAtFracturePosition(); double wellPathAzimuth = wellAzimuthAtFracturePosition();
if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH) if (fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
@ -103,14 +100,16 @@ void RimWellPathFracture::updateAzimuthBasedOnWellAzimuthAngle()
} }
if (fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH) if (fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
if (wellPathAzimuth + 90 < 360) m_azimuth = wellPathAzimuth + 90; if (wellPathAzimuth + 90 < 360)
else m_azimuth = wellPathAzimuth - 90; m_azimuth = wellPathAzimuth + 90;
else
m_azimuth = wellPathAzimuth - 90;
} }
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimWellPathFracture::wellAzimuthAtFracturePosition() const double RimWellPathFracture::wellAzimuthAtFracturePosition() const
{ {
@ -119,7 +118,7 @@ double RimWellPathFracture::wellAzimuthAtFracturePosition() const
if (!wellPath) return cvf::UNDEFINED_DOUBLE; if (!wellPath) return cvf::UNDEFINED_DOUBLE;
double wellPathAzimuth = 0.0; double wellPathAzimuth = 0.0;
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry(); RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
if (wellPathGeometry) if (wellPathGeometry)
{ {
@ -132,7 +131,7 @@ double RimWellPathFracture::wellAzimuthAtFracturePosition() const
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::loadDataAndUpdate() void RimWellPathFracture::loadDataAndUpdate()
{ {
@ -141,7 +140,7 @@ void RimWellPathFracture::loadDataAndUpdate()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords() const std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords() const
{ {
@ -152,7 +151,7 @@ std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords()
if (wellPath && wellPath->wellPathGeometry()) if (wellPath && wellPath->wellPathGeometry())
{ {
double startMd = m_measuredDepth - perforationLength() / 2.0; double startMd = m_measuredDepth - perforationLength() / 2.0;
double endMd = m_measuredDepth + perforationLength() / 2.0; double endMd = m_measuredDepth + perforationLength() / 2.0;
auto coordsAndMd = wellPath->wellPathGeometry()->clippedPointSubset(startMd, endMd); auto coordsAndMd = wellPath->wellPathGeometry()->clippedPointSubset(startMd, endMd);
@ -163,7 +162,7 @@ std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellPathFracture::compareByWellPathNameAndMD(const RimWellPathFracture* lhs, const RimWellPathFracture* rhs) bool RimWellPathFracture::compareByWellPathNameAndMD(const RimWellPathFracture* lhs, const RimWellPathFracture* rhs)
{ {
@ -187,7 +186,7 @@ bool RimWellPathFracture::compareByWellPathNameAndMD(const RimWellPathFracture*
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::updatePositionFromMeasuredDepth() void RimWellPathFracture::updatePositionFromMeasuredDepth()
{ {
@ -210,7 +209,7 @@ void RimWellPathFracture::updatePositionFromMeasuredDepth()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{ {
@ -237,13 +236,14 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup("Fracture Center Info"); caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup("Fracture Center Info");
fractureCenterGroup->add(&m_uiAnchorPosition); fractureCenterGroup->add(&m_uiAnchorPosition);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathFracture::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) void RimWellPathFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute)
{ {
RimFracture::defineEditorAttribute(field, uiConfigName, attribute); RimFracture::defineEditorAttribute(field, uiConfigName, attribute);
@ -268,4 +268,3 @@ void RimWellPathFracture::defineEditorAttribute(const caf::PdmFieldHandle* field
} }
} }
} }

View File

@ -37,27 +37,27 @@ public:
RimWellPathFracture(void); RimWellPathFracture(void);
~RimWellPathFracture(void) override; ~RimWellPathFracture(void) override;
double fractureMD() const override; double fractureMD() const override;
void setMeasuredDepth(double mdValue); void setMeasuredDepth(double mdValue);
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;
void updateAzimuthBasedOnWellAzimuthAngle() override; void updateAzimuthBasedOnWellAzimuthAngle() override;
double wellAzimuthAtFracturePosition() const override; double wellAzimuthAtFracturePosition() const override;
void loadDataAndUpdate() override; void loadDataAndUpdate() override;
std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override; std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override;
static bool compareByWellPathNameAndMD(const RimWellPathFracture* lhs, const RimWellPathFracture* rhs); static bool compareByWellPathNameAndMD(const RimWellPathFracture* lhs, const RimWellPathFracture* rhs);
protected: protected:
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
private: private:
void updatePositionFromMeasuredDepth(); void updatePositionFromMeasuredDepth();
private: private:
caf::PdmField<float> m_measuredDepth; caf::PdmField<float> m_measuredDepth;
}; };