From 5a3a5d1f36d0a3b0126e5236301570f3f012d3b7 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 10 Nov 2021 12:30:17 +0100 Subject: [PATCH] Ensemble Fracture Statistics: Fix calculation of occurrence fracture --- .../RimEnsembleFractureStatistics.cpp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index 903c723b28..ac145e7f2f 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -1189,18 +1189,26 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids( } std::map areaMapping; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::MIN] = areaHistogram.min; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::MAX] = areaHistogram.max; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::MEAN] = areaHistogram.mean; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::P50] = areaHistogram.mean; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::P10] = areaHistogram.p10; - areaMapping[RimEnsembleFractureStatistics::StatisticsType::P90] = areaHistogram.p90; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::MIN] = areaHistogram.min; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::MAX] = areaHistogram.max; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::MEAN] = areaHistogram.mean; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::P50] = areaHistogram.mean; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::P10] = areaHistogram.p10; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::P90] = areaHistogram.p90; + areaMapping[RimEnsembleFractureStatistics::StatisticsType::OCCURRENCE] = areaHistogram.max; // Post-process the resulting grids improve area representation for ( auto statisticsType : statisticsTypes ) { - statisticsGrids[statisticsType] = - setCellsToFillTargetArea( meanGrid, occurrenceGrid, *areaGrid, *distanceGrid, areaMapping[statisticsType] ); + if ( statisticsType != RimEnsembleFractureStatistics::StatisticsType::OCCURRENCE ) + statisticsGrids[statisticsType] = + setCellsToFillTargetArea( meanGrid, occurrenceGrid, *areaGrid, *distanceGrid, areaMapping[statisticsType] ); + else + statisticsGrids[statisticsType] = setCellsToFillTargetArea( occurrenceGrid, + occurrenceGrid, + *areaGrid, + *distanceGrid, + areaMapping[statisticsType] ); } }