#3268 MSW Fracture Export: Add allFractures and allFishbones

This commit is contained in:
Magne Sjaastad
2018-09-07 13:32:53 +02:00
parent 7cd6c29c9c
commit 3e10e59445
14 changed files with 32 additions and 42 deletions

View File

@@ -65,17 +65,11 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
{ {
std::vector<const RimFracture*> fracturesAlongWellPath; std::vector<const RimFracture*> fracturesAlongWellPath;
if (wellPath->fractureCollection()->isChecked()) for (auto& frac : wellPath->fractureCollection()->activeFractures())
{ {
for (auto& frac : wellPath->fractureCollection()->fractures()) frac->ensureValidNonDarcyProperties();
{
if (frac->isChecked())
{
frac->ensureValidNonDarcyProperties();
fracturesAlongWellPath.push_back(frac); fracturesAlongWellPath.push_back(frac);
}
}
} }
return generateCompdatValues(caseToApply, return generateCompdatValues(caseToApply,
@@ -444,11 +438,11 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
reportItem.setData(transmissibility, allCompletionsForOneFracture.size(), fcd, area); reportItem.setData(transmissibility, allCompletionsForOneFracture.size(), fcd, area);
double conductivity = 0.0; double conductivity = 0.0;
double width = 0.0; double width = 0.0;
double height = 0.0; double height = 0.0;
double halfLength = 0.0; double halfLength = 0.0;
RiaEclipseUnitTools::UnitSystem unitSystem = RiaEclipseUnitTools::UNITS_METRIC; RiaEclipseUnitTools::UnitSystem unitSystem = RiaEclipseUnitTools::UNITS_METRIC;
{ {
auto* ellipseTemplate = dynamic_cast<const RimEllipseFractureTemplate*>(fracTemplate); auto* ellipseTemplate = dynamic_cast<const RimEllipseFractureTemplate*>(fracTemplate);

View File

@@ -130,12 +130,9 @@ void RicExportFracturesWellSegmentsFeature::onActionTriggered(bool isChecked)
} }
else else
{ {
for (RimWellPathFracture* fracture : collection->fractures()) for (RimWellPathFracture* fracture : collection->activeFractures())
{ {
if (fracture->isChecked()) fractures.push_back(fracture);
{
fractures.push_back(fracture);
}
} }
} }

View File

@@ -1102,7 +1102,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(
{ {
std::set<RimWellPath*> wellPathsSet; std::set<RimWellPath*> wellPathsSet;
auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures(); auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithActiveFractures();
for (const auto& wellPath : allWellPaths) for (const auto& wellPath : allWellPaths)
{ {
for (const auto& reportItem : wellPathFractureReportItems) for (const auto& reportItem : wellPathFractureReportItems)

View File

@@ -148,7 +148,7 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
std::vector<RimWellPathFracture*> wellPathFractures; std::vector<RimWellPathFracture*> wellPathFractures;
for (const auto& w : wellPaths) for (const auto& w : wellPaths)
{ {
for (const auto& frac : w->fractureCollection()->fractures()) for (const auto& frac : w->fractureCollection()->activeFractures())
{ {
wellPathFractures.push_back(frac); wellPathFractures.push_back(frac);
} }
@@ -182,7 +182,7 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RicWellPathFractureTextReportFeatureImpl::wellPathsWithFractures() std::vector<RimWellPath*> RicWellPathFractureTextReportFeatureImpl::wellPathsWithActiveFractures()
{ {
std::vector<RimWellPath*> wellPaths; std::vector<RimWellPath*> wellPaths;
@@ -191,7 +191,7 @@ std::vector<RimWellPath*> RicWellPathFractureTextReportFeatureImpl::wellPathsWit
{ {
for (const auto& wellPath : wellPathColl->wellPaths()) for (const auto& wellPath : wellPathColl->wellPaths())
{ {
if (!wellPath->fractureCollection()->fractures().empty()) if (!wellPath->fractureCollection()->activeFractures().empty())
{ {
wellPaths.push_back(wellPath); wellPaths.push_back(wellPath);
} }

View File

@@ -39,7 +39,7 @@ public:
const std::vector<RimWellPath*>& wellPaths, const std::vector<RimWellPath*>& wellPaths,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems); const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems);
static std::vector<RimWellPath*> wellPathsWithFractures(); static std::vector<RimWellPath*> wellPathsWithActiveFractures();
private: private:
QString createWellFileLocationText(const std::vector<RimWellPath*>& wellPaths) const; QString createWellFileLocationText(const std::vector<RimWellPath*>& wellPaths) const;

View File

@@ -115,7 +115,7 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
RimWellPathFractureCollection* fractureCollection = item.wellPath->fractureCollection(); RimWellPathFractureCollection* fractureCollection = item.wellPath->fractureCollection();
// If this is the first fracture, set default result name // If this is the first fracture, set default result name
if (fractureCollection->fractures().empty()) if (fractureCollection->allFractures().empty())
{ {
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView()); RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (activeView) if (activeView)

View File

@@ -61,7 +61,7 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
RimWellPathFractureCollection* fractureCollection = wellPath->fractureCollection(); RimWellPathFractureCollection* fractureCollection = wellPath->fractureCollection();
CVF_ASSERT(fractureCollection); CVF_ASSERT(fractureCollection);
if (fractureCollection->fractures().empty()) if (fractureCollection->allFractures().empty())
{ {
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView()); RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (activeView) if (activeView)

View File

@@ -131,7 +131,7 @@ bool RicDeleteSubItemsFeature::hasDeletableSubItems(caf::PdmUiItem* uiItem)
{ {
auto collection = dynamic_cast<RimWellPathFractureCollection*>(uiItem); auto collection = dynamic_cast<RimWellPathFractureCollection*>(uiItem);
if (collection && !collection->fractures().empty()) if (collection && !collection->allFractures().empty())
{ {
return true; return true;
} }

View File

@@ -135,7 +135,7 @@ void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList*
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return; if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
for (RimWellPathFracture* f : m_rimWellPath->fractureCollection()->fractures()) for (RimWellPathFracture* f : m_rimWellPath->fractureCollection()->activeFractures())
{ {
CVF_ASSERT(f); CVF_ASSERT(f);

View File

@@ -190,7 +190,7 @@ std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::activeFishbonesSu
if (isChecked()) if (isChecked())
{ {
for (const auto& f : fishbonesSubs()) for (const auto& f : allFishbonesSubs())
{ {
if (f->isActive()) if (f->isActive())
{ {
@@ -205,7 +205,7 @@ std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::activeFishbonesSu
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::fishbonesSubs() const std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::allFishbonesSubs() const
{ {
return m_fishbonesSubs.childObjects(); return m_fishbonesSubs.childObjects();
} }

View File

@@ -49,7 +49,7 @@ public:
const RimMswCompletionParameters* mswParameters() const; const RimMswCompletionParameters* mswParameters() const;
std::vector<RimFishbonesMultipleSubs*> activeFishbonesSubs() const; std::vector<RimFishbonesMultipleSubs*> activeFishbonesSubs() const;
std::vector<RimFishbonesMultipleSubs*> fishbonesSubs() const; std::vector<RimFishbonesMultipleSubs*> allFishbonesSubs() const;
void recalculateStartMD(); void recalculateStartMD();
double startMD() const; double startMD() const;

View File

@@ -170,12 +170,12 @@ RimWellPathFractureCollection* RimWellPathCompletions::fractureCollection() cons
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellPathCompletions::hasCompletions() const bool RimWellPathCompletions::hasCompletions() const
{ {
if (!fractureCollection()->fractures().empty()) if (!fractureCollection()->allFractures().empty())
{ {
return true; return true;
} }
return !fishbonesCollection()->fishbonesSubs().empty() || return !fishbonesCollection()->allFishbonesSubs().empty() ||
!fishbonesCollection()->wellPathCollection()->wellPaths().empty() || !fishbonesCollection()->wellPathCollection()->wellPaths().empty() ||
!perforationCollection()->perforations().empty(); !perforationCollection()->perforations().empty();
} }
@@ -201,13 +201,13 @@ void RimWellPathCompletions::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTree
uiTreeOrdering.add(&m_perforationCollection); uiTreeOrdering.add(&m_perforationCollection);
} }
if (!fishbonesCollection()->fishbonesSubs().empty() || if (!fishbonesCollection()->allFishbonesSubs().empty() ||
!fishbonesCollection()->wellPathCollection()->wellPaths().empty()) !fishbonesCollection()->wellPathCollection()->wellPaths().empty())
{ {
uiTreeOrdering.add(&m_fishbonesCollection); uiTreeOrdering.add(&m_fishbonesCollection);
} }
if (!fractureCollection()->fractures().empty()) if (!fractureCollection()->allFractures().empty())
{ {
uiTreeOrdering.add(&m_fractureCollection); uiTreeOrdering.add(&m_fractureCollection);
} }

View File

@@ -120,7 +120,7 @@ double RimWellPathFractureCollection::manualReferenceMD() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::fractures() const std::vector<RimWellPathFracture*> RimWellPathFractureCollection::allFractures() const
{ {
return m_fractures.childObjects(); return m_fractures.childObjects();
} }
@@ -134,7 +134,7 @@ std::vector<RimWellPathFracture*> RimWellPathFractureCollection::activeFractures
if (isChecked()) if (isChecked())
{ {
for (const auto& f : fractures()) for (const auto& f : allFractures())
{ {
if (f->isChecked()) if (f->isChecked())
{ {

View File

@@ -56,15 +56,14 @@ public:
ReferenceMDType referenceMDType() const; ReferenceMDType referenceMDType() const;
double manualReferenceMD() const; double manualReferenceMD() const;
std::vector<RimWellPathFracture*> fractures() const; std::vector<RimWellPathFracture*> allFractures() const;
std::vector<RimWellPathFracture*> activeFractures() const; std::vector<RimWellPathFracture*> activeFractures() const;
protected: private:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
private: private:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
caf::PdmChildArrayField<RimWellPathFracture*> m_fractures; caf::PdmChildArrayField<RimWellPathFracture*> m_fractures;
caf::PdmField<ReferenceMDEnum> m_refMDType; caf::PdmField<ReferenceMDEnum> m_refMDType;
caf::PdmField<double> m_refMD; caf::PdmField<double> m_refMD;