mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 17:02:13 -05:00
#2967 Fracture Truncation at Faults : Code cleanup before adding trunction
This commit is contained in:
1 parent
be14877525
commit
fec963931e
6 files changed
+51
-45
No files matched your search
@@ -390,7 +390,7 @@ void RimEllipseFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
geometryGroup->add(&m_azimuthAngle);
|
||||
|
||||
caf::PdmUiGroup* trGr = uiOrdering.addNewGroup("Fracture Truncation");
|
||||
m_fractureContainment()->defineUiOrdering(uiConfigName, *trGr);
|
||||
m_fractureContainment()->uiOrdering(uiConfigName, *trGr);
|
||||
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties");
|
||||
propertyGroup->add(&m_conductivityType);
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,13 +24,12 @@
|
||||
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFractureContainment, "FractureContainment");
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimFractureContainment::FaultTruncType>::setUp()
|
||||
void caf::AppEnum<RimFractureContainment::FaultTruncType>::setUp()
|
||||
{
|
||||
addItem(RimFractureContainment::DISABLED, "DISABLED", "Disable");
|
||||
addItem(RimFractureContainment::TRUNCATE_AT_FAULT, "TRUNCATE_AT_FAULT", "Truncate At Faults");
|
||||
@@ -38,59 +37,66 @@ void caf::AppEnum< RimFractureContainment::FaultTruncType>::setUp()
|
||||
|
||||
setDefault(RimFractureContainment::DISABLED);
|
||||
}
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureContainment::RimFractureContainment()
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture Containment", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_isUsingFractureContainment, "IsUsingFractureContainment", false, "Fracture Containment", "", "", "");
|
||||
CAF_PDM_InitField(&m_isUsingFractureContainment, "IsUsingFractureContainment", false, "Fracture Containment", "", "", "");
|
||||
CAF_PDM_InitField(&m_topKLayer, "TopKLayer", 0, "Top Layer", "", "", "");
|
||||
//m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
// m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField(&m_baseKLayer, "BaseKLayer", 0, "Base Layer", "", "", "");
|
||||
//m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
// m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
// This field is not active yet.
|
||||
CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "FaultTruncationType", "Fault Truncation", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "FaultTruncationType", "Fault Truncation", "", "", "");
|
||||
m_faultTruncation.uiCapability()->setUiHidden(true);
|
||||
m_faultTruncation.xmlCapability()->setIOWritable(false); // When in operation, remove
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureContainment::~RimFractureContainment()
|
||||
{
|
||||
|
||||
}
|
||||
RimFractureContainment::~RimFractureContainment() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimFractureContainment::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
QList<caf::PdmOptionItemInfo> RimFractureContainment::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
if (fieldNeedingOptions == &m_faultTruncation)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(DISABLED), DISABLED));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(TRUNCATE_AT_FAULT), TRUNCATE_AT_FAULT));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<FaultTruncType>::uiText(DISABLED), DISABLED));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<FaultTruncType>::uiText(TRUNCATE_AT_FAULT), TRUNCATE_AT_FAULT));
|
||||
if (m_isUsingFractureContainment())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(CONTINUE_IN_CONTAINMENT_ZONE), CONTINUE_IN_CONTAINMENT_ZONE));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<FaultTruncType>::uiText(CONTINUE_IN_CONTAINMENT_ZONE),
|
||||
CONTINUE_IN_CONTAINMENT_ZONE));
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const
|
||||
bool RimFractureContainment::isEnabled() const
|
||||
{
|
||||
return m_isUsingFractureContainment();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
size_t anchorEclipseCell,
|
||||
size_t globalCellIndex) const
|
||||
{
|
||||
if (!this->m_isUsingFractureContainment()) return true;
|
||||
|
||||
@@ -101,12 +107,12 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* m
|
||||
|
||||
mainGrid->ijkFromCellIndex(globalCellIndex, &i, &j, &k);
|
||||
|
||||
if (k + 1 < static_cast<size_t>(m_topKLayer()))
|
||||
if (k + 1 < static_cast<size_t>(m_topKLayer()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (k + 1 > static_cast<size_t>(m_baseKLayer()))
|
||||
if (k + 1 > static_cast<size_t>(m_baseKLayer()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -117,7 +123,7 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* m
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::setTopKLayer(int topKLayer)
|
||||
{
|
||||
@@ -125,7 +131,7 @@ void RimFractureContainment::setTopKLayer(int topKLayer)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::setBaseKLayer(int baseKLayer)
|
||||
{
|
||||
@@ -133,23 +139,24 @@ void RimFractureContainment::setBaseKLayer(int baseKLayer)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_isUsingFractureContainment);
|
||||
uiOrdering.add(&m_topKLayer);
|
||||
uiOrdering.add(&m_baseKLayer);
|
||||
//uiOrdering.add(&m_faultTruncation);
|
||||
// uiOrdering.add(&m_faultTruncation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
void RimFractureContainment::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_isUsingFractureContainment
|
||||
|| m_isUsingFractureContainment())
|
||||
if (changedField == &m_isUsingFractureContainment || m_isUsingFractureContainment())
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
@@ -159,4 +166,3 @@ void RimFractureContainment::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimFractureContainment : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
@@ -38,16 +41,14 @@ public:
|
||||
CONTINUE_IN_CONTAINMENT_ZONE
|
||||
};
|
||||
|
||||
bool isEnabled() const { return m_isUsingFractureContainment();}
|
||||
bool isEnabled() const;
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const;
|
||||
|
||||
void setTopKLayer(int topKLayer);
|
||||
void setBaseKLayer(int baseKLayer);
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
|
||||
@@ -770,7 +770,7 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd
|
||||
geometryGroup->add(&m_azimuthAngle);
|
||||
|
||||
caf::PdmUiGroup* trGr = uiOrdering.addNewGroup("Fracture Truncation");
|
||||
m_fractureContainment()->defineUiOrdering(uiConfigName, *trGr);
|
||||
m_fractureContainment()->uiOrdering(uiConfigName, *trGr);
|
||||
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties");
|
||||
propertyGroup->add(&m_conductivityResultNameOnFile);
|
||||
|
||||
@@ -131,7 +131,6 @@ private:
|
||||
void initAfterRead() override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
friend class RimStimPlanLegendConfig;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ void RimStimPlanLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiO
|
||||
{
|
||||
uiOrdering.add(&m_name);
|
||||
|
||||
m_legend->defineUiOrdering(uiConfigName, uiOrdering);
|
||||
m_legend->uiOrdering(uiConfigName, uiOrdering);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user