mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2505 Add setFractureContainment batch command
This commit is contained in:
@@ -19,6 +19,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -41,6 +42,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#include "RicfSetExportFolder.h"
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicfSetFractureContainment.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfSetFractureContainment, "setFractureContainment");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetFractureContainment::RicfSetFractureContainment()
|
||||
{
|
||||
RICF_InitField(&m_id, "id", -1, "Id", "", "", "");
|
||||
RICF_InitField(&m_topLayer, "topLayer", 1.0, "TopLayer", "", "", "");
|
||||
RICF_InitField(&m_baseLayer, "baseLayer", 1.0, "BaseLayer", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicfSetFractureContainment::execute()
|
||||
{
|
||||
if (m_id < 0)
|
||||
{
|
||||
RiaLogging::error("setFractureContainment: Fracture template id not specified");
|
||||
return;
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
if (!project)
|
||||
{
|
||||
RiaLogging::error("setFractureContainment: Project not found");
|
||||
return;
|
||||
}
|
||||
|
||||
RimFractureTemplateCollection* templColl = !project->allFractureTemplateCollections().empty() ? project->allFractureTemplateCollections()[0] : nullptr;
|
||||
RimFractureTemplate* templ = templColl ? templColl->fractureTemplate(m_id) : nullptr;
|
||||
|
||||
if (!templ)
|
||||
{
|
||||
RiaLogging::error(QString("setFractureContainment: Fracture template not found. Id=%1").arg(m_id));
|
||||
return;
|
||||
}
|
||||
|
||||
templ->setContainmentTopKLayer(m_topLayer);
|
||||
templ->setContainmentBaseKLayer(m_baseLayer);
|
||||
templ->reload();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicfCommandObject.h"
|
||||
|
||||
#include "RicfCommandFileExecutor.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RicfSetFractureContainment : public RicfCommandObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicfSetFractureContainment();
|
||||
|
||||
virtual void execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_id;
|
||||
caf::PdmField<double> m_topLayer;
|
||||
caf::PdmField<double> m_baseLayer;
|
||||
};
|
||||
@@ -116,6 +116,22 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* m
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::setTopKLayer(int topKLayer)
|
||||
{
|
||||
m_topKLayer = topKLayer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureContainment::setBaseKLayer(int baseKLayer)
|
||||
{
|
||||
m_baseKLayer = baseKLayer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -41,6 +41,9 @@ public:
|
||||
bool isEnabled() const { return m_isUsingFractureContainment();}
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const;
|
||||
|
||||
void setTopKLayer(int topKLayer);
|
||||
void setBaseKLayer(int baseKLayer);
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -683,6 +683,22 @@ void RimFractureTemplate::setScaleFactors(double width, double height, double dF
|
||||
m_conductivityScaleFactor = supportsConductivityScaling() ? conductivity : 1.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::setContainmentTopKLayer(int topKLayer)
|
||||
{
|
||||
m_fractureContainment->setTopKLayer(topKLayer);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::setContainmentBaseKLayer(int baseKLayer)
|
||||
{
|
||||
m_fractureContainment->setBaseKLayer(baseKLayer);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -150,6 +150,9 @@ public:
|
||||
void setScaleFactors(double width, double height, double dFactor, double conductivity);
|
||||
virtual void reload() {}
|
||||
|
||||
void setContainmentTopKLayer(int topKLayer);
|
||||
void setContainmentBaseKLayer(int baseKLayer);
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
Reference in New Issue
Block a user