///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2022 - 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 "cvfObject.h" #include "cvfVector3.h" #include #include #include class RigThermalFractureDefinition; class RigFractureGrid; class MinMaxAccumulator; class PosNegAccumulator; namespace cvf { class BoundingBox; }; // namespace cvf //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- class RigThermalFractureResultUtil { public: RigThermalFractureResultUtil(); ~RigThermalFractureResultUtil(); static std::vector> getDataAtTimeIndex( std::shared_ptr fractureDefinition, const QString& resultName, const QString& unitName, size_t timeStepIndex ); static void createFractureTriangleGeometry( std::shared_ptr fractureDefinition, int activeTimeStepIndex, double xScaleFactor, double yScaleFactor, double wellPathIntersectionAtFractureDepth, std::vector* vertices, std::vector* triangleIndices ); static std::vector fractureGridResults( std::shared_ptr fractureDefinition, const QString& resultName, const QString& unitName, size_t timeStepIndex ); static cvf::cref createFractureGrid( std::shared_ptr fractureDefinition, const QString& resultName, int activeTimeStepIndex, double xScaleFactor, double yScaleFactor, double wellPathIntersectionAtFractureDepth, RiaDefines::EclipseUnitSystem requiredUnitSet ); static void appendDataToResultStatistics( std::shared_ptr fractureDefinition, const QString& resultName, const QString& unit, MinMaxAccumulator& minMaxAccumulator, PosNegAccumulator& posNegAccumulator ); static std::pair minMaxDepth( std::shared_ptr fractureDefinition, int activeTimeStepIndex ); static std::pair computePositionAndRotation( std::shared_ptr fractureDefinition, size_t timeStepIndex ); private: static std::pair, std::vector> generateUniformMesh( const cvf::BoundingBox& bb, int numSamplesX, int numSamplesY ); static double linearSampling( double minValue, double maxValue, int numSamples, std::vector& samples ); static std::vector getRelativeCoordinates( std::shared_ptr fractureDefinition, size_t timeStepIndex ); static std::vector scaleVector( const std::vector& xs, double scaleFactor ); static std::vector adjustedYCoordsAroundWellPathPosition( const std::vector& ys, double offset ); static double interpolateProperty( const cvf::Vec3d& position, const std::vector& points, std::shared_ptr fractureDefinition, int propertyIndex, size_t timeStepIndex ); static const int NUM_SAMPLES_X = 50; static const int NUM_SAMPLES_Y = 40; };