mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3180 Create multiple fractures command. Set correct defaults
This commit is contained in:
parent
a73fbff5bb
commit
3e561c312b
@ -66,7 +66,7 @@ RicfCreateMultipleFractures::RicfCreateMultipleFractures()
|
|||||||
RICF_InitField(&m_topLayer, "topLayer", -1, "Top Layer", "", "", "");
|
RICF_InitField(&m_topLayer, "topLayer", -1, "Top Layer", "", "", "");
|
||||||
RICF_InitField(&m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "");
|
RICF_InitField(&m_baseLayer, "baseLayer", -1, "Base Layer", "", "", "");
|
||||||
RICF_InitField(&m_spacing, "spacing", 300.0, "Spacing", "", "", "");
|
RICF_InitField(&m_spacing, "spacing", 300.0, "Spacing", "", "", "");
|
||||||
RICF_InitField(&m_action, "action", caf::AppEnum<MultipleFractures::Action>(MultipleFractures::NONE), "Action", "", "", "");
|
RICF_InitField(&m_action, "action", caf::AppEnum<MultipleFractures::Action>(MultipleFractures::APPEND_FRACTURES), "Action", "", "", "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,19 @@ void RicfCreateMultipleFractures::execute()
|
|||||||
if (gridCase && fractureTemplate && !wellPaths.empty() && validateArguments())
|
if (gridCase && fractureTemplate && !wellPaths.empty() && validateArguments())
|
||||||
{
|
{
|
||||||
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
|
RicCreateMultipleFracturesOptionItemUi* options = new RicCreateMultipleFracturesOptionItemUi();
|
||||||
options->setValues(m_topLayer, m_baseLayer, fractureTemplate, m_spacing);
|
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
||||||
|
auto feature = dynamic_cast<RicCreateMultipleFracturesFeature*>(commandManager->getCommandFeature("RicCreateMultipleFracturesFeature"));
|
||||||
|
|
||||||
|
// Default layers
|
||||||
|
int topLayer = m_topLayer;
|
||||||
|
int baseLayer = m_baseLayer;
|
||||||
|
if (feature && (topLayer < 0 || baseLayer < 0))
|
||||||
|
{
|
||||||
|
auto ijkRange = feature->ijkRangeForGrid(gridCase);
|
||||||
|
if (topLayer < 0) topLayer = static_cast<int>(ijkRange.first.z());
|
||||||
|
if (baseLayer < 0) baseLayer = static_cast<int>(ijkRange.second.z());
|
||||||
|
}
|
||||||
|
options->setValues(topLayer, baseLayer, fractureTemplate, m_spacing);
|
||||||
|
|
||||||
settings->clearWellPaths();
|
settings->clearWellPaths();
|
||||||
for (auto wellPath : wellPaths)
|
for (auto wellPath : wellPaths)
|
||||||
@ -98,8 +110,6 @@ void RicfCreateMultipleFractures::execute()
|
|||||||
settings->clearOptions();
|
settings->clearOptions();
|
||||||
settings->insertOptionItem(nullptr, options);
|
settings->insertOptionItem(nullptr, options);
|
||||||
|
|
||||||
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
|
||||||
auto feature = dynamic_cast<RicCreateMultipleFracturesFeature*>(commandManager->getCommandFeature("RicCreateMultipleFracturesFeature"));
|
|
||||||
|
|
||||||
if (feature)
|
if (feature)
|
||||||
{
|
{
|
||||||
@ -117,12 +127,11 @@ bool RicfCreateMultipleFractures::validateArguments() const
|
|||||||
{
|
{
|
||||||
bool valid =
|
bool valid =
|
||||||
m_caseId >= 0 &&
|
m_caseId >= 0 &&
|
||||||
m_templateId >= 0 &&
|
m_templateId >= 0;
|
||||||
!(m_action == MultipleFractures::NONE);
|
|
||||||
|
|
||||||
if (valid) return true;
|
if (valid) return true;
|
||||||
|
|
||||||
RiaLogging::error(QString("createMultipleFractures: Command argument validation failed"));
|
RiaLogging::error(QString("createMultipleFractures: Mandatory argument(s) missing"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,21 @@ void RicCreateMultipleFracturesFeature::replaceFractures()
|
|||||||
slotDeleteAndAppendFractures();
|
slotDeleteAndAppendFractures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::pair<cvf::Vec3st, cvf::Vec3st> RicCreateMultipleFracturesFeature::ijkRangeForGrid(RimEclipseCase* gridCase) const
|
||||||
|
{
|
||||||
|
cvf::Vec3st minIJK;
|
||||||
|
cvf::Vec3st maxIJK;
|
||||||
|
if (gridCase && gridCase->eclipseCaseData())
|
||||||
|
{
|
||||||
|
gridCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->IJKBoundingBox(minIJK, maxIJK);
|
||||||
|
return std::make_pair(minIJK, maxIJK);
|
||||||
|
}
|
||||||
|
return std::make_pair(cvf::Vec3st(), cvf::Vec3st());
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -171,15 +186,9 @@ void RicCreateMultipleFracturesFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
firstSourceCase = proj->eclipseCases().front();
|
firstSourceCase = proj->eclipseCases().front();
|
||||||
|
|
||||||
cvf::Vec3st minIJK;
|
auto ijkRange = ijkRangeForGrid(firstSourceCase);
|
||||||
cvf::Vec3st maxIJK;
|
topK = static_cast<int>(ijkRange.first.z());
|
||||||
if (firstSourceCase && firstSourceCase->eclipseCaseData())
|
baseK = static_cast<int>(ijkRange.second.z());
|
||||||
{
|
|
||||||
firstSourceCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->IJKBoundingBox(minIJK, maxIJK);
|
|
||||||
}
|
|
||||||
|
|
||||||
topK = static_cast<int>(minIJK.z());
|
|
||||||
baseK = static_cast<int>(maxIJK.z());
|
|
||||||
|
|
||||||
double minimumDistanceFromTip = 100.0;
|
double minimumDistanceFromTip = 100.0;
|
||||||
int maxFractureCount = 100;
|
int maxFractureCount = 100;
|
||||||
|
@ -20,9 +20,12 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
#include "cvfVector3.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
class RiuCreateMultipleFractionsUi;
|
class RiuCreateMultipleFractionsUi;
|
||||||
|
class RimEclipseCase;
|
||||||
|
|
||||||
namespace caf {
|
namespace caf {
|
||||||
class PdmUiPropertyViewDialog;
|
class PdmUiPropertyViewDialog;
|
||||||
@ -41,6 +44,7 @@ public:
|
|||||||
|
|
||||||
void appendFractures();
|
void appendFractures();
|
||||||
void replaceFractures();
|
void replaceFractures();
|
||||||
|
std::pair<cvf::Vec3st, cvf::Vec3st> ijkRangeForGrid(RimEclipseCase* gridCase) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotDeleteAndAppendFractures();
|
void slotDeleteAndAppendFractures();
|
||||||
|
Loading…
Reference in New Issue
Block a user