///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2021 Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaDefines.h" #include "RigHistogramData.h" #include "cvfObject.h" #include #include class RimEnsembleFractureStatistics; class RigFractureGrid; class RigStimPlanFractureDefinition; //================================================================================================== /// /// //================================================================================================== class RigEnsembleFractureStatisticsCalculator { public: enum class PropertyType { HEIGHT, AREA, WIDTH, XF, KFWF, PERMEABILITY, FORMATION_DIP }; static RigHistogramData createStatisticsData( const RimEnsembleFractureStatistics* esf, PropertyType propertyType, int numBins ); static RigHistogramData createStatisticsData( const std::vector>& fractureDefinitions, PropertyType propertyType, int numBins ); static std::vector> removeZeroWidthDefinitions( const std::vector>& fractureDefinitions ); static std::vector calculateProperty( const std::vector>& fractureDefinitions, PropertyType propertyType ); private: static std::vector calculateGridStatistics( const std::vector>& fractureDefinitions, double( func )( cvf::cref ) ); static std::vector calculateAreaWeightedStatistics( const std::vector>& fractureDefinitions, double( func )( cvf::cref, cvf::cref, RiaDefines::EclipseUnitSystem, const QString& ) ); static std::vector calculateFormationDip( const std::vector>& fractureDefinitions ); static double calculateHeight( cvf::cref fractureGrid ); static double calculateArea( cvf::cref fractureGrid ); static double calculateXf( cvf::cref fractureGrid ); static double calculateKfWf( cvf::cref fractureGrid ); static double calculateAreaWeightedWidth( cvf::cref conductivityGrid, cvf::cref widthGrid, RiaDefines::EclipseUnitSystem widthUnitSystem, const QString& widthUnit ); static double calculateAreaWeightedPermeability( cvf::cref conductivityGrid, cvf::cref widthGrid, RiaDefines::EclipseUnitSystem widthUnitSystem, const QString& widthUnit ); static double convertUnit( double value, RiaDefines::EclipseUnitSystem unitSystem, const QString& unitName ); };