Ensemble Fracture Statistics: Fix calculation of occurrence fracture

This commit is contained in:
Kristian Bendiksen 2021-11-10 12:30:17 +01:00
parent a3e54d5573
commit 5a3a5d1f36

View File

@ -1189,18 +1189,26 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids(
} }
std::map<RimEnsembleFractureStatistics::StatisticsType, double> areaMapping; std::map<RimEnsembleFractureStatistics::StatisticsType, double> areaMapping;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::MIN] = areaHistogram.min; areaMapping[RimEnsembleFractureStatistics::StatisticsType::MIN] = areaHistogram.min;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::MAX] = areaHistogram.max; areaMapping[RimEnsembleFractureStatistics::StatisticsType::MAX] = areaHistogram.max;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::MEAN] = areaHistogram.mean; areaMapping[RimEnsembleFractureStatistics::StatisticsType::MEAN] = areaHistogram.mean;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::P50] = areaHistogram.mean; areaMapping[RimEnsembleFractureStatistics::StatisticsType::P50] = areaHistogram.mean;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::P10] = areaHistogram.p10; areaMapping[RimEnsembleFractureStatistics::StatisticsType::P10] = areaHistogram.p10;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::P90] = areaHistogram.p90; areaMapping[RimEnsembleFractureStatistics::StatisticsType::P90] = areaHistogram.p90;
areaMapping[RimEnsembleFractureStatistics::StatisticsType::OCCURRENCE] = areaHistogram.max;
// Post-process the resulting grids improve area representation // Post-process the resulting grids improve area representation
for ( auto statisticsType : statisticsTypes ) for ( auto statisticsType : statisticsTypes )
{ {
statisticsGrids[statisticsType] = if ( statisticsType != RimEnsembleFractureStatistics::StatisticsType::OCCURRENCE )
setCellsToFillTargetArea( meanGrid, occurrenceGrid, *areaGrid, *distanceGrid, areaMapping[statisticsType] ); statisticsGrids[statisticsType] =
setCellsToFillTargetArea( meanGrid, occurrenceGrid, *areaGrid, *distanceGrid, areaMapping[statisticsType] );
else
statisticsGrids[statisticsType] = setCellsToFillTargetArea( occurrenceGrid,
occurrenceGrid,
*areaGrid,
*distanceGrid,
areaMapping[statisticsType] );
} }
} }