#3433 Fracture header : Make sure ordering is stable

Using multithreading causes ordering issues
This commit is contained in:
Magne Sjaastad
2018-10-04 15:56:42 +02:00
parent 927e65cb44
commit 355b980032
5 changed files with 52 additions and 14 deletions

View File

@@ -445,7 +445,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
if (fractureDataReportItems)
{
RicWellPathFractureReportItem reportItem(wellPathName, fracture->name(), fracTemplate->name());
RicWellPathFractureReportItem reportItem(wellPathName, fracture->name(), fracTemplate->name(), fracture->fractureMD());
reportItem.setUnitSystem(fracTemplate->fractureTemplateUnit());
RicExportFractureCompletionsImpl::calculateAndSetReportItemData(

View File

@@ -1167,6 +1167,21 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(
if (!wellPathFractureReportItems.empty())
{
std::vector<RicWellPathFractureReportItem> sortedReportItems;
{
std::set<RicWellPathFractureReportItem> fractureReportItemsSet;
for (const auto& reportItem : wellPathFractureReportItems)
{
fractureReportItemsSet.insert(reportItem);
}
for (const auto& reportItem : fractureReportItemsSet)
{
sortedReportItems.emplace_back(reportItem);
}
}
std::vector<RimWellPath*> wellPathsToReport;
{
std::set<RimWellPath*> wellPathsSet;
@@ -1174,7 +1189,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(
auto allWellPaths = RicWellPathFractureTextReportFeatureImpl::wellPathsWithActiveFractures();
for (const auto& wellPath : allWellPaths)
{
for (const auto& reportItem : wellPathFractureReportItems)
for (const auto& reportItem : sortedReportItems)
{
if (reportItem.wellPathNameForExport() == wellPath->completions()->wellNameForExport())
{
@@ -1184,14 +1199,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(
}
std::copy(wellPathsSet.begin(), wellPathsSet.end(), std::back_inserter(wellPathsToReport));
RicWellPathFractureTextReportFeatureImpl reportGenerator;
QString summaryText =
reportGenerator.wellPathFractureReport(sourceCase, wellPathsToReport, wellPathFractureReportItems);
stream << summaryText;
}
RicWellPathFractureTextReportFeatureImpl reportGenerator;
QString summaryText = reportGenerator.wellPathFractureReport(sourceCase, wellPathsToReport, sortedReportItems);
stream << summaryText;
}
}

View File

@@ -23,10 +23,12 @@
//--------------------------------------------------------------------------------------------------
RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& wellPathName,
const QString& fractureName,
const QString& fractureTemplateName)
const QString& fractureTemplateName,
double measuredDepth)
: m_wellPathNameForExport(wellPathName)
, m_wellPathFracture(fractureName)
, m_wellPathFractureTemplate(fractureTemplateName)
, m_mesuredDepth(measuredDepth)
, m_transmissibility(0.0)
, m_connectionCount(0)
, m_fcd(0.0)
@@ -88,7 +90,7 @@ QString RicWellPathFractureReportItem::wellPathNameForExport() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RicWellPathFractureReportItem::fractureName() const
{
@@ -96,7 +98,7 @@ QString RicWellPathFractureReportItem::fractureName() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RicWellPathFractureReportItem::fractureTemplateName() const
{
@@ -198,3 +200,16 @@ double RicWellPathFractureReportItem::km() const
{
return m_km;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathFractureReportItem::operator<(const RicWellPathFractureReportItem& other) const
{
if (this->wellPathNameForExport() != other.wellPathNameForExport())
{
return this->wellPathNameForExport() < other.wellPathNameForExport();
}
return this->m_mesuredDepth < other.m_mesuredDepth;
}

View File

@@ -28,7 +28,7 @@
class RicWellPathFractureReportItem
{
public:
RicWellPathFractureReportItem(const QString& wellPathName, const QString& fractureName, const QString& fractureTemplateName);
RicWellPathFractureReportItem(const QString& wellPathName, const QString& fractureName, const QString& fractureTemplateName, double measuredDepth);
void setData(double trans, size_t connCount, double fcd, double area);
void setWidthAndConductivity(double width, double conductivity);
@@ -54,11 +54,14 @@ public:
double h() const;
double km() const;
bool operator < (const RicWellPathFractureReportItem& other) const;
private:
RiaEclipseUnitTools::UnitSystem m_unitSystem;
QString m_wellPathNameForExport;
QString m_wellPathFracture;
QString m_wellPathFractureTemplate;
double m_mesuredDepth;
double m_transmissibility;
size_t m_connectionCount;

View File

@@ -148,9 +148,16 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport(
std::vector<RimWellPathFracture*> wellPathFractures;
for (const auto& w : wellPaths)
{
std::set<std::pair<double, RimWellPathFracture*>> sortedFracturesByMd;
for (const auto& frac : w->fractureCollection()->activeFractures())
{
wellPathFractures.push_back(frac);
sortedFracturesByMd.insert(std::make_pair(frac->fractureMD(), frac));
}
for (const auto& mdAndFracture : sortedFracturesByMd)
{
wellPathFractures.push_back(mdAndFracture.second);
}
}