mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#1136, #1137) - pre-proto - Adding base class RimFractureTemplte, and classes for stimPlan fractureTemplate and data structures. Also adding features for creating new stimPlan Fracture templates.
This commit is contained in:
@@ -39,7 +39,9 @@ ${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewEllipseFractureTemplateFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewStimPlanFractureTemplateFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathFractureFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathFractureAtPosFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicFractureDefinitionsDeleteAllFeature.h
|
||||
@@ -93,7 +95,8 @@ ${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.cpp
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewEllipseFractureTemplateFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewStimPlanFractureTemplateFeature.cpp
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathFractureFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathFractureAtPosFeature.cpp
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewFractureDefinitionFeature.h"
|
||||
#include "RicNewEllipseFractureTemplateFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewFractureDefinitionFeature, "RicNewFractureDefinitionFeature");
|
||||
CAF_CMD_SOURCE_INIT(RicNewEllipseFractureTemplateFeature, "RicNewEllipseFractureTemplateFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFractureDefinitionFeature::onActionTriggered(bool isChecked)
|
||||
void RicNewEllipseFractureTemplateFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
@@ -53,7 +53,7 @@ void RicNewFractureDefinitionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEllipseFractureTemplate* fractureDef = new RimEllipseFractureTemplate();
|
||||
fracDefColl->fractureDefinitions.push_back(fractureDef);
|
||||
fractureDef->name = "Fracture Template";
|
||||
fractureDef->name = "Ellipse Fracture Template";
|
||||
|
||||
fracDefColl->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
||||
@@ -63,16 +63,16 @@ void RicNewFractureDefinitionFeature::onActionTriggered(bool isChecked)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFractureDefinitionFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicNewEllipseFractureTemplateFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/FractureTemplate16x16.png"));
|
||||
actionToSetup->setText("New Fracture Template");
|
||||
actionToSetup->setText("New Ellipse Fracture Template");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewFractureDefinitionFeature::isCommandEnabled()
|
||||
bool RicNewEllipseFractureTemplateFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewFractureDefinitionFeature : public caf::CmdFeature
|
||||
class RicNewEllipseFractureTemplateFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
@@ -88,11 +88,11 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (oilfield->fractureDefinitionCollection->fractureDefinitions.size() > 0)
|
||||
{
|
||||
RimEllipseFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
fracture->setFractureTemplate(fracDef);
|
||||
|
||||
fracture->azimuth = fracDef->azimuthAngle();
|
||||
fracture->perforationLength = fracDef->perforationLength();
|
||||
//fracture->perforationLength = fracDef->perforationLength();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,11 +73,11 @@ void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (oilfield->fractureDefinitionCollection->fractureDefinitions.size() > 0)
|
||||
{
|
||||
RimEllipseFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
fracture->setFractureTemplate(fracDef);
|
||||
|
||||
fracture->azimuth = fracDef->azimuthAngle();
|
||||
fracture->perforationLength = fracDef->perforationLength();
|
||||
//fracture->perforationLength = fracDef->perforationLength();
|
||||
}
|
||||
|
||||
fracture->updateFracturePositionFromLocation();
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- 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 "RicNewStimPlanFractureTemplateFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimFractureDefinitionCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewStimPlanFractureTemplateFeature, "RicNewStimPlanFractureTemplateFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
RimOilField* oilfield = project->activeOilField();
|
||||
if (oilfield == nullptr) return;
|
||||
|
||||
RimFractureDefinitionCollection* fracDefColl = oilfield->fractureDefinitionCollection();
|
||||
|
||||
if (fracDefColl)
|
||||
{
|
||||
RimStimPlanFractureTemplate* fractureDef = new RimStimPlanFractureTemplate();
|
||||
fracDefColl->fractureDefinitions.push_back(fractureDef);
|
||||
fractureDef->name = "StimPlan Fracture Template";
|
||||
|
||||
fracDefColl->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewStimPlanFractureTemplateFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/FractureTemplate16x16.png"));
|
||||
actionToSetup->setText("New StimPlan Fracture Template");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewStimPlanFractureTemplateFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- 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 "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewStimPlanFractureTemplateFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
virtual bool isCommandEnabled() override;
|
||||
|
||||
|
||||
};
|
||||
@@ -95,11 +95,11 @@ void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (oilfield->fractureDefinitionCollection->fractureDefinitions.size() > 0)
|
||||
{
|
||||
RimEllipseFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
fracture->setFractureTemplate(fracDef);
|
||||
|
||||
fracture->azimuth = fracDef->azimuthAngle();
|
||||
fracture->perforationLength = fracDef->perforationLength();
|
||||
//fracture->perforationLength = fracDef->perforationLength();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,11 +85,11 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (oilfield->fractureDefinitionCollection->fractureDefinitions.size() > 0)
|
||||
{
|
||||
RimEllipseFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection->fractureDefinitions[0];
|
||||
fracture->setFractureTemplate(fracDef);
|
||||
|
||||
fracture->azimuth = fracDef->azimuthAngle();
|
||||
fracture->perforationLength = fracDef->perforationLength();
|
||||
//fracture->perforationLength = fracDef->perforationLength();
|
||||
}
|
||||
|
||||
fractureCollection->updateConnectedEditors();
|
||||
|
||||
@@ -92,6 +92,9 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathFractureCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSimWellFracture.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSimWellFractureCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFractureExportSettings.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanFractureDefinition.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFractureTemplate.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanFractureTemplate.h
|
||||
|
||||
)
|
||||
|
||||
@@ -183,6 +186,10 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathFractureCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSimWellFracture.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSimWellFractureCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFractureExportSettings.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanFractureDefinition.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFractureTemplate.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanFractureTemplate.cpp
|
||||
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -383,7 +383,8 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
else if (dynamic_cast<RimFractureDefinitionCollection*>(uiItem) ||
|
||||
dynamic_cast<RimEllipseFractureTemplate*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewFractureDefinitionFeature";
|
||||
commandIds << "RicNewEllipseFractureTemplateFeature";
|
||||
commandIds << "RicNewStimPlanFractureTemplateFeature";
|
||||
commandIds << "RicFractureDefinitionsDeleteAllFeature";
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RigTesselatorTools.h"
|
||||
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
@@ -29,22 +30,7 @@
|
||||
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
|
||||
void caf::AppEnum< RimEllipseFractureTemplate::FracOrientationEnum>::setUp()
|
||||
{
|
||||
addItem(RimEllipseFractureTemplate::AZIMUTH, "Az", "Azimuth");
|
||||
addItem(RimEllipseFractureTemplate::ALONG_WELL_PATH, "AlongWellPath", "Along Well Path");
|
||||
addItem(RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH, "TransverseWellPath", "Transverse (normal) to Well Path");
|
||||
|
||||
setDefault(RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEllipseFractureTemplate, "FractureDefinition");
|
||||
CAF_PDM_SOURCE_INIT(RimEllipseFractureTemplate, "RimEllipseFractureTemplate");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -53,17 +39,11 @@ RimEllipseFractureTemplate::RimEllipseFractureTemplate(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture Template", ":/FractureTemplate16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Fracture Template"), "Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&halfLength, "HalfLength", 650.0f, "Halflength X_f", "", "", "");
|
||||
CAF_PDM_InitField(&height, "Height", 75.0f, "Height", "", "", "");
|
||||
CAF_PDM_InitField(&width, "Width", 1.0f, "Width", "", "", "");
|
||||
CAF_PDM_InitField(&orientation, "Orientation", caf::AppEnum<FracOrientationEnum>(TRANSVERSE_WELL_PATH), "Fracture orientation", "", "", "");
|
||||
CAF_PDM_InitField(&azimuthAngle, "AzimuthAngle", 0.0f, "Azimuth Angle", "", "", ""); //Is this correct description?
|
||||
CAF_PDM_InitField(&perforationLength, "PerforationLength", 0.0f, "Lenght of well perforation", "", "", ""); //Is this correct description?
|
||||
|
||||
|
||||
CAF_PDM_InitField(&skinFactor, "SkinFactor", 1.0f, "Skin Factor", "", "", "");
|
||||
CAF_PDM_InitField(&permeability,"Permeability", 22000.f, "Permeability", "", "", "");
|
||||
}
|
||||
|
||||
@@ -75,14 +55,6 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimEllipseFractureTemplate::userDescriptionField()
|
||||
{
|
||||
return &name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -200,18 +172,16 @@ void RimEllipseFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
geometryGroup->add(&orientation);
|
||||
geometryGroup->add(&azimuthAngle);
|
||||
|
||||
if (orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH
|
||||
|| orientation == RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH
|
||||
|| orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
azimuthAngle.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else if (orientation == RimEllipseFractureTemplate::AZIMUTH)
|
||||
else if (orientation == RimFractureTemplate::AZIMUTH)
|
||||
{
|
||||
azimuthAngle.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Fracture properties");
|
||||
propertyGroup->add(&permeability);
|
||||
propertyGroup->add(&width);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimFractureTemplate.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldHandle.h"
|
||||
@@ -34,7 +36,7 @@
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimEllipseFractureTemplate : public caf::PdmObject //Template i stedet for definition
|
||||
class RimEllipseFractureTemplate : public RimFractureTemplate
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -42,27 +44,13 @@ public:
|
||||
RimEllipseFractureTemplate(void);
|
||||
virtual ~RimEllipseFractureTemplate(void);
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
|
||||
caf::PdmField<float> halfLength;
|
||||
caf::PdmField<float> height;
|
||||
caf::PdmField<float> azimuthAngle;
|
||||
caf::PdmField<float> perforationLength;
|
||||
|
||||
|
||||
caf::PdmField<float> width;
|
||||
caf::PdmField<float> skinFactor;
|
||||
caf::PdmField<float> permeability;
|
||||
|
||||
enum FracOrientationEnum
|
||||
{
|
||||
AZIMUTH,
|
||||
ALONG_WELL_PATH,
|
||||
TRANSVERSE_WELL_PATH
|
||||
};
|
||||
caf::PdmField< caf::AppEnum< FracOrientationEnum > > orientation;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
double effectiveKh();
|
||||
|
||||
@@ -163,7 +163,8 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
||||
{
|
||||
if (changedField == &m_fractureTemplate)
|
||||
{
|
||||
perforationLength = m_fractureTemplate->perforationLength();
|
||||
//perforationLength = m_fractureTemplate->perforationLength();
|
||||
//TODO: Find out if performationLength should be in RimFractureTemplate or in RimEllipseFracTemplate
|
||||
azimuth = m_fractureTemplate->azimuthAngle();
|
||||
}
|
||||
|
||||
@@ -217,7 +218,7 @@ void RimFracture::computeGeometry()
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> polygonIndices;
|
||||
|
||||
RimEllipseFractureTemplate* fractureDef = attachedFractureDefinition();
|
||||
RimFractureTemplate* fractureDef = attachedFractureDefinition();
|
||||
if (fractureDef )
|
||||
{
|
||||
fractureDef->fractureGeometry(&nodeCoords, &polygonIndices);
|
||||
@@ -564,7 +565,7 @@ QList<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmF
|
||||
RimFractureDefinitionCollection* fracDefColl = oilField->fractureDefinitionCollection();
|
||||
if (fracDefColl == nullptr) return options;
|
||||
|
||||
for (RimEllipseFractureTemplate* fracDef : fracDefColl->fractureDefinitions())
|
||||
for (RimFractureTemplate* fracDef : fracDefColl->fractureDefinitions())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(fracDef->name(), fracDef));
|
||||
}
|
||||
@@ -664,7 +665,7 @@ const RigFracture* RimFracture::attachedRigFracture() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFracture::setFractureTemplate(RimEllipseFractureTemplate* fractureTemplate)
|
||||
void RimFracture::setFractureTemplate(RimFractureTemplate* fractureTemplate)
|
||||
{
|
||||
m_fractureTemplate = fractureTemplate;
|
||||
}
|
||||
@@ -672,7 +673,7 @@ void RimFracture::setFractureTemplate(RimEllipseFractureTemplate* fractureTempla
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEllipseFractureTemplate* RimFracture::attachedFractureDefinition() const
|
||||
RimFractureTemplate* RimFracture::attachedFractureDefinition() const
|
||||
{
|
||||
return m_fractureTemplate();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cvfPlane.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
|
||||
#include "RimFractureTemplate.h"
|
||||
//#include "RimEllipseFractureTemplate.h"
|
||||
|
||||
|
||||
class RigFracture;
|
||||
@@ -63,8 +65,9 @@ public:
|
||||
|
||||
const RigFracture* attachedRigFracture() const;
|
||||
|
||||
void setFractureTemplate(RimEllipseFractureTemplate* fractureTemplate);
|
||||
RimEllipseFractureTemplate* attachedFractureDefinition() const;
|
||||
void setFractureTemplate(RimFractureTemplate* fractureTemplate);
|
||||
RimFractureTemplate* attachedFractureDefinition() const;
|
||||
//TODO: Skal dette v<>re ellipseTemplate som f<>r?
|
||||
|
||||
RivWellFracturePartMgr* fracturePartManager();
|
||||
|
||||
@@ -100,7 +103,7 @@ private:
|
||||
bool planeCellIntersectionPolygons(size_t cellindex, std::vector<std::vector<cvf::Vec3d> > & polygons, cvf::Vec3d & localX, cvf::Vec3d & localY, cvf::Vec3d & localZ);
|
||||
|
||||
protected:
|
||||
caf::PdmPtrField<RimEllipseFractureTemplate*> m_fractureTemplate;
|
||||
caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate;
|
||||
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
|
||||
caf::PdmProxyValueField<QString> m_displayIJK;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RimFractureDefinitionCollection.h"
|
||||
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
class RimEllipseFractureTemplate;
|
||||
class RimFractureTemplate;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
RimFractureDefinitionCollection(void);
|
||||
virtual ~RimFractureDefinitionCollection(void);
|
||||
|
||||
caf::PdmChildArrayField<RimEllipseFractureTemplate*> fractureDefinitions;
|
||||
caf::PdmChildArrayField<RimFractureTemplate*> fractureDefinitions;
|
||||
|
||||
caf::PdmField<bool> isActive;
|
||||
|
||||
|
||||
143
ApplicationCode/ProjectDataModel/RimFractureTemplate.cpp
Normal file
143
ApplicationCode/ProjectDataModel/RimFractureTemplate.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimFractureTemplate.h"
|
||||
|
||||
#include "RigTesselatorTools.h"
|
||||
|
||||
#include "RimFracture.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cvfVector3.h"
|
||||
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
|
||||
void caf::AppEnum< RimFractureTemplate::FracOrientationEnum>::setUp()
|
||||
{
|
||||
addItem(RimFractureTemplate::AZIMUTH, "Az", "Azimuth");
|
||||
addItem(RimFractureTemplate::ALONG_WELL_PATH, "AlongWellPath", "Along Well Path");
|
||||
addItem(RimFractureTemplate::TRANSVERSE_WELL_PATH, "TransverseWellPath", "Transverse (normal) to Well Path");
|
||||
|
||||
setDefault(RimFractureTemplate::TRANSVERSE_WELL_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimFractureTemplate, "RimFractureTemplate");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureTemplate::RimFractureTemplate(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture Template", ":/FractureTemplate16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Fracture Template"), "Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&orientation, "Orientation", caf::AppEnum<FracOrientationEnum>(TRANSVERSE_WELL_PATH), "Fracture orientation", "", "", "");
|
||||
CAF_PDM_InitField(&azimuthAngle, "AzimuthAngle", 0.0f, "Azimuth Angle", "", "", ""); //Is this correct description?
|
||||
CAF_PDM_InitField(&skinFactor, "SkinFactor", 1.0f, "Skin Factor", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureTemplate::~RimFractureTemplate()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimFractureTemplate::userDescriptionField()
|
||||
{
|
||||
return &name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
//
|
||||
// if (changedField == &halfLength || changedField == &height || changedField == &azimuthAngle || changedField == &perforationLength || changedField == &orientation)
|
||||
// {
|
||||
// //Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||
// RimProject* proj;
|
||||
// this->firstAncestorOrThisOfType(proj);
|
||||
// if (proj)
|
||||
// {
|
||||
// //Regenerate geometry
|
||||
// std::vector<RimFracture*> fractures;
|
||||
// proj->descendantsIncludingThisOfType(fractures);
|
||||
//
|
||||
// for (RimFracture* fracture : fractures)
|
||||
// {
|
||||
// if (fracture->attachedFractureDefinition() == this)
|
||||
// {
|
||||
// if (changedField == &halfLength || changedField == &height)
|
||||
// {
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
||||
// {
|
||||
// fracture->azimuth = azimuthAngle;
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &orientation)
|
||||
// {
|
||||
// fracture->setAzimuth();
|
||||
// if (orientation() == FracOrientationEnum::AZIMUTH)
|
||||
// {
|
||||
// fracture->azimuth = azimuthAngle;
|
||||
// }
|
||||
//
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &perforationLength && (abs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
||||
// {
|
||||
// fracture->perforationLength = perforationLength;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// proj->createDisplayModelAndRedrawAllViews();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&name);
|
||||
}
|
||||
65
ApplicationCode/ProjectDataModel/RimFractureTemplate.h
Normal file
65
ApplicationCode/ProjectDataModel/RimFractureTemplate.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldHandle.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimFractureTemplate : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFractureTemplate(void);
|
||||
virtual ~RimFractureTemplate(void);
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
caf::PdmField<float> azimuthAngle;
|
||||
|
||||
caf::PdmField<float> skinFactor;
|
||||
|
||||
enum FracOrientationEnum
|
||||
{
|
||||
AZIMUTH,
|
||||
ALONG_WELL_PATH,
|
||||
TRANSVERSE_WELL_PATH
|
||||
};
|
||||
caf::PdmField< caf::AppEnum< FracOrientationEnum > > orientation;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
virtual void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices) = 0;
|
||||
virtual std::vector<cvf::Vec3f> fracturePolygon() = 0;
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
};
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
@@ -73,19 +74,19 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSimWellFracture::setAzimuth()
|
||||
{
|
||||
RimEllipseFractureTemplate::FracOrientationEnum orientation;
|
||||
RimFractureTemplate::FracOrientationEnum orientation;
|
||||
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
||||
else orientation = RimEllipseFractureTemplate::AZIMUTH;
|
||||
else orientation = RimFractureTemplate::AZIMUTH;
|
||||
|
||||
if (orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH || orientation== RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation== RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
updateBranchGeometry();
|
||||
double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition());
|
||||
if (orientation == RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH )
|
||||
if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH )
|
||||
{
|
||||
azimuth = simWellAzimuth;
|
||||
}
|
||||
if (orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
||||
{
|
||||
if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90;
|
||||
else azimuth = simWellAzimuth - 90;
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimStimPlanFractureDefinition.h"
|
||||
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include "QMessageBox"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimStimPlanFractureDefinition, "StimPlanFractureDefinition");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStimPlanFractureDefinition::RimStimPlanFractureDefinition()
|
||||
{
|
||||
CAF_PDM_InitObject("Formation Names", ":/Formations16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_StimPlanFileName, "StimPlanFileName", QString(""), "File Name", "", "", "");
|
||||
|
||||
m_StimPlanFileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStimPlanFractureDefinition::~RimStimPlanFractureDefinition()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (&m_StimPlanFileName == changedField)
|
||||
{
|
||||
updateUiTreeName();
|
||||
QString errorMessage;
|
||||
readFormationNamesFile(&errorMessage);
|
||||
if (!errorMessage.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(nullptr, "StimPlanFile", errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::initAfterRead()
|
||||
{
|
||||
updateUiTreeName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::updateUiTreeName()
|
||||
{
|
||||
this->uiCapability()->setUiName(fileNameWoPath());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::setFileName(const QString& fileName)
|
||||
{
|
||||
m_StimPlanFileName = fileName;
|
||||
|
||||
updateUiTreeName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString& RimStimPlanFractureDefinition::fileName()
|
||||
{
|
||||
return m_StimPlanFileName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimStimPlanFractureDefinition::fileNameWoPath()
|
||||
{
|
||||
QFileInfo stimplanfileFileInfo(m_StimPlanFileName());
|
||||
return stimplanfileFileInfo.fileName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::updateConnectedViews()
|
||||
{
|
||||
//TODO!!!
|
||||
// std::vector<caf::PdmObjectHandle*> usingObjs;
|
||||
// this->objectsWithReferringPtrFields(usingObjs);
|
||||
// for (caf::PdmObjectHandle* obj: usingObjs)
|
||||
// {
|
||||
// RimCase* caseObj = dynamic_cast<RimCase*>(obj);
|
||||
// if (caseObj)
|
||||
// {
|
||||
// caseObj->updateFormationNamesData();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::readFormationNamesFile(QString * errorMessage)
|
||||
{
|
||||
QFile dataFile(m_StimPlanFileName());
|
||||
|
||||
if (!dataFile.open(QFile::ReadOnly))
|
||||
{
|
||||
if (errorMessage) (*errorMessage) += "Could not open the File: " + (m_StimPlanFileName()) + "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
// m_formationNamesData = new RigFormationNames;
|
||||
//
|
||||
// QTextStream stream(&dataFile);
|
||||
// int lineNumber = 1;
|
||||
// while (!stream.atEnd())
|
||||
// {
|
||||
// QString line = stream.readLine();
|
||||
// QStringList lineSegs = line.split("'", QString::KeepEmptyParts);
|
||||
//
|
||||
// if(lineSegs.size() == 0) continue; // Empty line
|
||||
// if(lineSegs.size() == 1) continue; // No name present. Comment line ?
|
||||
// if(lineSegs.size() == 2)
|
||||
// {
|
||||
// if (errorMessage) (*errorMessage) += "Missing quote on line : " + QString::number(lineNumber) + "\n";
|
||||
// continue; // One quote present
|
||||
// }
|
||||
//
|
||||
// if (lineSegs.size() == 3) // Normal case
|
||||
// {
|
||||
// if ( lineSegs[0].contains("--")) continue; // Comment line
|
||||
// QString formationName = lineSegs[1];
|
||||
// int commentMarkPos = lineSegs[2].indexOf("--");
|
||||
// QString numberString = lineSegs[2];
|
||||
// if (commentMarkPos >= 0) numberString.truncate(commentMarkPos);
|
||||
//
|
||||
// QStringList numberWords = numberString.split(QRegExp("-"), QString::SkipEmptyParts);
|
||||
// if (numberWords.size() == 2)
|
||||
// {
|
||||
// bool isNumber1 = false;
|
||||
// bool isNumber2 = false;
|
||||
// int startK = numberWords[0].toInt(&isNumber1);
|
||||
// int endK = numberWords[1].toInt(&isNumber2);
|
||||
//
|
||||
// if (!(isNumber2 && isNumber1))
|
||||
// {
|
||||
// if (errorMessage) (*errorMessage) += "Format error on line: " + QString::number(lineNumber) + "\n";
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// int tmp = startK; startK = tmp < endK ? tmp : endK;
|
||||
// endK = tmp > endK ? tmp: endK;
|
||||
//
|
||||
// m_formationNamesData->appendFormationRange(formationName, startK-1, endK-1);
|
||||
// }
|
||||
// else if (numberWords.size() == 1)
|
||||
// {
|
||||
// bool isNumber1 = false;
|
||||
// int kLayerCount = numberWords[0].toInt(&isNumber1);
|
||||
//
|
||||
// if ( !isNumber1 )
|
||||
// {
|
||||
// if ( errorMessage ) (*errorMessage) += "Format error on line: " + QString::number(lineNumber) + "\n";
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// m_formationNamesData->appendFormationRangeHeight(formationName, kLayerCount);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (errorMessage) (*errorMessage) += "Format error on line: " + QString::number(lineNumber) + "\n";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ++lineNumber;
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureDefinition::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||
{
|
||||
m_StimPlanFileName = RimTools::relocateFile(m_StimPlanFileName(), newProjectPath, oldProjectPath, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
// class RigStimPlanFractureDefinition;
|
||||
|
||||
class RimStimPlanFractureDefinition : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimStimPlanFractureDefinition();
|
||||
~RimStimPlanFractureDefinition();
|
||||
|
||||
void setFileName(const QString& fileName);
|
||||
const QString& fileName();
|
||||
QString fileNameWoPath();
|
||||
|
||||
// RigStimPlanFractureDefinition* stimPlanData() { return m_StimPlanFractureDefinitionData.p();}
|
||||
void updateConnectedViews();
|
||||
|
||||
void readFormationNamesFile(QString * errorMessage);
|
||||
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void initAfterRead() override;
|
||||
|
||||
private:
|
||||
void updateUiTreeName();
|
||||
|
||||
caf::PdmField<QString> m_StimPlanFileName;
|
||||
|
||||
// cvf::ref<RigStimPlanFractureDefinition> m_StimPlanFractureDefinitionData;
|
||||
};
|
||||
150
ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp
Normal file
150
ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp
Normal file
@@ -0,0 +1,150 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimStimPlanFractureTemplate.h"
|
||||
|
||||
#include "RigTesselatorTools.h"
|
||||
|
||||
#include "RimFracture.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cvfVector3.h"
|
||||
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimStimPlanFractureTemplate, "RimStimPlanFractureTemplate");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture Template", ":/FractureTemplate16x16.png", "", "");
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStimPlanFractureTemplate::~RimStimPlanFractureTemplate()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
//
|
||||
// if (changedField == &halfLength || changedField == &height || changedField == &azimuthAngle || changedField == &perforationLength || changedField == &orientation)
|
||||
// {
|
||||
// //Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||
// RimProject* proj;
|
||||
// this->firstAncestorOrThisOfType(proj);
|
||||
// if (proj)
|
||||
// {
|
||||
// //Regenerate geometry
|
||||
// std::vector<RimFracture*> fractures;
|
||||
// proj->descendantsIncludingThisOfType(fractures);
|
||||
//
|
||||
// for (RimFracture* fracture : fractures)
|
||||
// {
|
||||
// if (fracture->attachedFractureDefinition() == this)
|
||||
// {
|
||||
// if (changedField == &halfLength || changedField == &height)
|
||||
// {
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
||||
// {
|
||||
// fracture->azimuth = azimuthAngle;
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &orientation)
|
||||
// {
|
||||
// fracture->setAzimuth();
|
||||
// if (orientation() == FracOrientationEnum::AZIMUTH)
|
||||
// {
|
||||
// fracture->azimuth = azimuthAngle;
|
||||
// }
|
||||
//
|
||||
// fracture->setRecomputeGeometryFlag();
|
||||
// }
|
||||
//
|
||||
// if (changedField == &perforationLength && (abs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
||||
// {
|
||||
// fracture->perforationLength = perforationLength;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// proj->createDisplayModelAndRedrawAllViews();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices)
|
||||
{
|
||||
// RigEllipsisTesselator tesselator(20);
|
||||
//
|
||||
// float a = halfLength;
|
||||
// float b = height / 2.0f;
|
||||
//
|
||||
// tesselator.tesselateEllipsis(a, b, polygonIndices, nodeCoords);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
||||
{
|
||||
std::vector<cvf::Vec3f> polygon;
|
||||
//
|
||||
// std::vector<cvf::Vec3f> nodeCoords;
|
||||
// std::vector<cvf::uint> polygonIndices;
|
||||
//
|
||||
// fractureGeometry(&nodeCoords, &polygonIndices);
|
||||
//
|
||||
// for (size_t i = 1; i < nodeCoords.size(); i++)
|
||||
// {
|
||||
// polygon.push_back(nodeCoords[i]);
|
||||
// }
|
||||
//
|
||||
return polygon;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimFractureTemplate.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldHandle.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimStimPlanFractureDefinition;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimStimPlanFractureTemplate : public RimFractureTemplate
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimStimPlanFractureTemplate(void);
|
||||
virtual ~RimStimPlanFractureTemplate(void);
|
||||
|
||||
RimStimPlanFractureDefinition* stimPlanFracDef;
|
||||
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices);
|
||||
std::vector<cvf::Vec3f> fracturePolygon();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
};
|
||||
@@ -89,11 +89,11 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFracture::setAzimuth()
|
||||
{
|
||||
RimEllipseFractureTemplate::FracOrientationEnum orientation;
|
||||
RimFractureTemplate::FracOrientationEnum orientation;
|
||||
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
||||
else orientation = RimEllipseFractureTemplate::AZIMUTH;
|
||||
else orientation = RimFractureTemplate::AZIMUTH;
|
||||
|
||||
if (orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH || orientation == RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
|
||||
@@ -105,11 +105,11 @@ void RimWellPathFracture::setAzimuth()
|
||||
|
||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
double wellPathAzimuth = wellPathGeometry->wellPathAzimuthAngle(fracturePosition());
|
||||
if (orientation == RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
azimuth = wellPathAzimuth;
|
||||
}
|
||||
if (orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH)
|
||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
||||
{
|
||||
if (wellPathAzimuth + 90 < 360) azimuth = wellPathAzimuth + 90;
|
||||
else azimuth = wellPathAzimuth - 90;
|
||||
@@ -154,12 +154,12 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
locationGroup->add(&azimuth);
|
||||
if (attachedFractureDefinition())
|
||||
{
|
||||
if (attachedFractureDefinition()->orientation == RimEllipseFractureTemplate::ALONG_WELL_PATH
|
||||
|| attachedFractureDefinition()->orientation == RimEllipseFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
if (attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH
|
||||
|| attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
azimuth.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else if (attachedFractureDefinition()->orientation == RimEllipseFractureTemplate::AZIMUTH)
|
||||
else if (attachedFractureDefinition()->orientation == RimFractureTemplate::AZIMUTH)
|
||||
{
|
||||
azimuth.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFracture.h
|
||||
${CEE_CURRENT_LIST_DIR}RigTesselatorTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.h
|
||||
|
||||
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -102,6 +105,8 @@ ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFracture.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTesselatorTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.cpp
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RigStimPlanFractureDefinition.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigStimPlanFractureDefinition::RigStimPlanFractureDefinition()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigStimPlanFractureDefinition::~RigStimPlanFractureDefinition()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// /
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// QString RigStimPlanFractureDefinition::formationNameFromKLayerIdx(size_t Kidx)
|
||||
// {
|
||||
// int idx = formationIndexFromKLayerIdx(Kidx);
|
||||
// if(idx >= static_cast<int>(m_formationNames.size())) return "";
|
||||
// if(idx == -1) return "";
|
||||
//
|
||||
// return m_formationNames[idx];
|
||||
// }
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// /
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// void RigStimPlanFractureDefinition::appendFormationRange(const QString& name, int kStartIdx, int kEndIdx)
|
||||
// {
|
||||
// CVF_ASSERT(kStartIdx <= kEndIdx);
|
||||
//
|
||||
// int nameIdx = static_cast<int>(m_formationNames.size());
|
||||
//
|
||||
// m_formationNames.push_back(name);
|
||||
//
|
||||
// if ( kEndIdx >= static_cast<int>(m_nameIndexPrKLayer.size()) )
|
||||
// {
|
||||
// m_nameIndexPrKLayer.resize(kEndIdx + 1, -1);
|
||||
// }
|
||||
//
|
||||
// for ( int kIdx = kStartIdx; kIdx <= kEndIdx; ++kIdx )
|
||||
// {
|
||||
// m_nameIndexPrKLayer[kIdx] = nameIdx;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// /
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// void RigStimPlanFractureDefinition::appendFormationRangeHeight(const QString& name, int kLayerCount)
|
||||
// {
|
||||
// if (kLayerCount < 1) return;
|
||||
//
|
||||
// int nameIdx = static_cast<int>(m_formationNames.size());
|
||||
//
|
||||
// m_formationNames.push_back(name);
|
||||
//
|
||||
// int kStartIdx = static_cast<int>(m_nameIndexPrKLayer.size());
|
||||
//
|
||||
// m_nameIndexPrKLayer.resize(kStartIdx + kLayerCount, -1);
|
||||
//
|
||||
// for ( int kIdx = kStartIdx; kIdx < kStartIdx + kLayerCount; ++kIdx )
|
||||
// {
|
||||
// m_nameIndexPrKLayer[kIdx] = nameIdx;
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1,52 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RigStimPlanFractureDefinition: public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigStimPlanFractureDefinition();
|
||||
~RigStimPlanFractureDefinition();
|
||||
|
||||
// int formationIndexFromKLayerIdx(size_t Kidx)
|
||||
// {
|
||||
// if(Kidx >= m_nameIndexPrKLayer.size()) return -1;
|
||||
// return m_nameIndexPrKLayer[Kidx];
|
||||
// }
|
||||
//
|
||||
// QString formationNameFromKLayerIdx(size_t Kidx);
|
||||
//
|
||||
// const std::vector<QString>& formationNames() const { return m_formationNames;}
|
||||
//
|
||||
// void appendFormationRange(const QString& name, int kStartIdx, int kEndIdx);
|
||||
// void appendFormationRangeHeight(const QString& name, int kLayerCount);
|
||||
//
|
||||
// private:
|
||||
//
|
||||
// std::vector<int> m_nameIndexPrKLayer;
|
||||
// std::vector<QString> m_formationNames;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user