mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1574 Add method: isEclipseCellWithinContainment
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
#include "RigHexIntersectionTools.h"
|
||||
#include "RimFractureContainment.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimFracture, "Fracture");
|
||||
|
||||
@@ -437,6 +438,18 @@ void RimFracture::setAnchorPosition(const cvf::Vec3d& pos)
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t globalCellIndex)
|
||||
{
|
||||
CVF_ASSERT(fractureTemplate());
|
||||
if (!fractureTemplate()->fractureContainment()->isEnabled()) return true;
|
||||
|
||||
size_t anchorEclipseCell = findAnchorEclipseCell(mainGrid);
|
||||
return fractureTemplate()->fractureContainment()->isEclipseCellWithinContainment(mainGrid, anchorEclipseCell, globalCellIndex);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,6 +72,8 @@ public:
|
||||
cvf::Vec3d anchorPosition() const ;
|
||||
void setAnchorPosition(const cvf::Vec3d& pos);
|
||||
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
size_t globalCellIndex);
|
||||
size_t findAnchorEclipseCell(const RigMainGrid* mainGrid) const;
|
||||
|
||||
cvf::Mat4f transformMatrix() const;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimFractureContainment.h"
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFractureContainment, "FractureContainment");
|
||||
@@ -42,12 +43,24 @@ RimFractureContainment::RimFractureContainment()
|
||||
CAF_PDM_InitObject("Fracture Containment", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_isUsingFractureContainment, "IsUsingFractureContainment", false, "Fracture Containment", "", "", "");
|
||||
CAF_PDM_InitField(&m_topKLayer, "topKLayer", 0, "Top Layer", "", "", "");
|
||||
CAF_PDM_InitField(&m_topKLayer, "TopKLayer", 0, "Top Layer", "", "", "");
|
||||
//m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField(&m_bottomKLayer, "bottomKLayer", 0, "Bottom Layer", "", "", "");
|
||||
CAF_PDM_InitField(&m_baseKLayer, "BaseKLayer", 0, "Base Layer", "", "", "");
|
||||
//m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "m_faultTruncation", "Fault Truncation", "", "", "");
|
||||
// This field is not active yet.
|
||||
CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "FaultTruncationType", "Fault Truncation", "", "", "");
|
||||
m_faultTruncation.uiCapability()->setUiHidden(true);
|
||||
m_faultTruncation.xmlCapability()->setIOWritable(false); // When in operation, remove
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureContainment::~RimFractureContainment()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -69,6 +82,28 @@ QList<caf::PdmOptionItemInfo> RimFractureContainment::calculateValueOptions(cons
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const
|
||||
{
|
||||
if (!this->m_isUsingFractureContainment()) return true;
|
||||
|
||||
CVF_ASSERT(mainGrid);
|
||||
|
||||
size_t i,j,k;
|
||||
if (globalCellIndex >= mainGrid->globalCellArray().size()) return false;
|
||||
|
||||
bool ok = mainGrid->ijkFromCellIndex(globalCellIndex, &i, &j, &k);
|
||||
|
||||
if (k <= m_topKLayer()) return false;
|
||||
if (k >= m_baseKLayer()) return false;
|
||||
|
||||
// Todo: use fault propagation mode
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -76,7 +111,7 @@ void RimFractureContainment::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
{
|
||||
uiOrdering.add(&m_isUsingFractureContainment);
|
||||
uiOrdering.add(&m_topKLayer);
|
||||
uiOrdering.add(&m_bottomKLayer);
|
||||
uiOrdering.add(&m_faultTruncation);
|
||||
uiOrdering.add(&m_baseKLayer);
|
||||
//uiOrdering.add(&m_faultTruncation);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
class RimFractureContainment : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFractureContainment();
|
||||
~RimFractureContainment();
|
||||
|
||||
enum FaultTruncType
|
||||
{
|
||||
@@ -35,8 +38,11 @@ public:
|
||||
CONTINUE_IN_CONTAINMENT_ZONE
|
||||
};
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
bool isEnabled() const { return m_isUsingFractureContainment();}
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const;
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
@@ -47,7 +53,7 @@ private:
|
||||
|
||||
caf::PdmField<bool> m_isUsingFractureContainment;
|
||||
caf::PdmField<int> m_topKLayer;
|
||||
caf::PdmField<int> m_bottomKLayer;
|
||||
caf::PdmField<int> m_baseKLayer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "RimFractureContainment.h"
|
||||
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
@@ -272,6 +271,14 @@ double RimFractureTemplate::perforationLengthInFractureUnit(RiaEclipseUnitTools:
|
||||
return cvf::UNDEFINED_DOUBLE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimFractureContainment * RimFractureTemplate::fractureContainment()
|
||||
{
|
||||
return m_fractureContainment();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -84,6 +84,8 @@ public:
|
||||
|
||||
virtual const RigFractureGrid* fractureGrid() const = 0;
|
||||
|
||||
const RimFractureContainment * fractureContainment();
|
||||
|
||||
protected:
|
||||
caf::PdmChildField<RimFractureContainment*> m_fractureContainment;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user