mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 07:56:08 -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_baseLayer, "baseLayer", -1, "Base Layer", "", "", "");
|
||||
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())
|
||||
{
|
||||
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();
|
||||
for (auto wellPath : wellPaths)
|
||||
@ -98,8 +110,6 @@ void RicfCreateMultipleFractures::execute()
|
||||
settings->clearOptions();
|
||||
settings->insertOptionItem(nullptr, options);
|
||||
|
||||
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
||||
auto feature = dynamic_cast<RicCreateMultipleFracturesFeature*>(commandManager->getCommandFeature("RicCreateMultipleFracturesFeature"));
|
||||
|
||||
if (feature)
|
||||
{
|
||||
@ -117,12 +127,11 @@ bool RicfCreateMultipleFractures::validateArguments() const
|
||||
{
|
||||
bool valid =
|
||||
m_caseId >= 0 &&
|
||||
m_templateId >= 0 &&
|
||||
!(m_action == MultipleFractures::NONE);
|
||||
m_templateId >= 0;
|
||||
|
||||
if (valid) return true;
|
||||
|
||||
RiaLogging::error(QString("createMultipleFractures: Command argument validation failed"));
|
||||
RiaLogging::error(QString("createMultipleFractures: Mandatory argument(s) missing"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,21 @@ void RicCreateMultipleFracturesFeature::replaceFractures()
|
||||
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();
|
||||
|
||||
cvf::Vec3st minIJK;
|
||||
cvf::Vec3st maxIJK;
|
||||
if (firstSourceCase && firstSourceCase->eclipseCaseData())
|
||||
{
|
||||
firstSourceCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->IJKBoundingBox(minIJK, maxIJK);
|
||||
}
|
||||
|
||||
topK = static_cast<int>(minIJK.z());
|
||||
baseK = static_cast<int>(maxIJK.z());
|
||||
auto ijkRange = ijkRangeForGrid(firstSourceCase);
|
||||
topK = static_cast<int>(ijkRange.first.z());
|
||||
baseK = static_cast<int>(ijkRange.second.z());
|
||||
|
||||
double minimumDistanceFromTip = 100.0;
|
||||
int maxFractureCount = 100;
|
||||
|
@ -20,9 +20,12 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RiuCreateMultipleFractionsUi;
|
||||
class RimEclipseCase;
|
||||
|
||||
namespace caf {
|
||||
class PdmUiPropertyViewDialog;
|
||||
@ -41,6 +44,7 @@ public:
|
||||
|
||||
void appendFractures();
|
||||
void replaceFractures();
|
||||
std::pair<cvf::Vec3st, cvf::Vec3st> ijkRangeForGrid(RimEclipseCase* gridCase) const;
|
||||
|
||||
private slots:
|
||||
void slotDeleteAndAppendFractures();
|
||||
|
Loading…
Reference in New Issue
Block a user