///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2015- Statoil ASA // Copyright (C) 2015- Ceetron Solutions AS // // 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 "RigFemResultAddress.h" #include "cafTensor3.h" #include "cvfCollection.h" #include "cvfObject.h" #include #include #include #include #include class RifGeoMechReaderInterface; class RifElementPropertyReader; class RigFemScalarResultFrames; class RigFemPartResultsCollection; class RigFemPartResults; class RigStatisticsDataCache; class RigFemPartCollection; class RigFormationNames; class RigFemPartResultCalculator; namespace caf { class ProgressInfo; } class RigFemPartResultsCollection : public cvf::Object { public: static const std::string FIELD_NAME_COMPACTION; RigFemPartResultsCollection( RifGeoMechReaderInterface* readerInterface, RifElementPropertyReader* elementPropertyReader, const RigFemPartCollection* femPartCollection ); ~RigFemPartResultsCollection() override; void setActiveFormationNames( RigFormationNames* activeFormationNames ); std::vector formationNames() const; void addElementPropertyFiles( const std::vector& filenames ); std::vector removeElementPropertyFiles( const std::vector& filenames ); std::map addressesInElementPropertyFiles( const std::vector& filenames ); void setCalculationParameters( double cohesion, double frictionAngleRad ); double parameterCohesion() const { return m_cohesion; } double parameterFrictionAngleRad() const { return m_frictionAngleRad; } void setBiotCoefficientParameters( double fixedFactor, const QString& biotResultAddress ); double biotFixedFactor() const { return m_biotFixedFactor; } QString biotResultAddress() const { return m_biotResultAddress; } std::map> scalarFieldAndComponentNames( RigFemResultPosEnum resPos ); std::vector filteredStepNames() const; bool assertResultsLoaded( const RigFemResultAddress& resVarAddr ); void deleteResult( const RigFemResultAddress& resVarAddr ); void deleteResultFrame( const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex ); std::vector loadedResults() const; const std::vector& resultValues( const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex ); std::vector tensors( const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex ); const RigFemPartCollection* parts() const; int partCount() const; int frameCount(); void minMaxScalarValues( const RigFemResultAddress& resVarAddr, int frameIndex, double* localMin, double* localMax ); void minMaxScalarValues( const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax ); void posNegClosestToZero( const RigFemResultAddress& resVarAddr, int frameIndex, double* localPosClosestToZero, double* localNegClosestToZero ); void posNegClosestToZero( const RigFemResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero ); void meanScalarValue( const RigFemResultAddress& resVarAddr, double* meanValue ); void meanScalarValue( const RigFemResultAddress& resVarAddr, int frameIndex, double* meanValue ); void p10p90ScalarValues( const RigFemResultAddress& resVarAddr, double* p10, double* p90 ); void p10p90ScalarValues( const RigFemResultAddress& resVarAddr, int frameIndex, double* p10, double* p90 ); void sumScalarValue( const RigFemResultAddress& resVarAddr, double* sum ); void sumScalarValue( const RigFemResultAddress& resVarAddr, int frameIndex, double* sum ); const std::vector& scalarValuesHistogram( const RigFemResultAddress& resVarAddr ); const std::vector& scalarValuesHistogram( const RigFemResultAddress& resVarAddr, int frameIndex ); void minMaxScalarValuesOverAllTensorComponents( const RigFemResultAddress& resVarAddr, int frameIndex, double* localMin, double* localMax ); void minMaxScalarValuesOverAllTensorComponents( const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax ); void posNegClosestToZeroOverAllTensorComponents( const RigFemResultAddress& resVarAddr, int frameIndex, double* localPosClosestToZero, double* localNegClosestToZero ); void posNegClosestToZeroOverAllTensorComponents( const RigFemResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero ); static std::vector tensorComponentAddresses( const RigFemResultAddress& resVarAddr ); static std::vector tensorPrincipalComponentAdresses( const RigFemResultAddress& resVarAddr ); static std::set normalizedResults(); static bool isNormalizableResult( const RigFemResultAddress& result ); void setNormalizationAirGap( double normalizationAirGap ); double normalizationAirGap() const; RigFemScalarResultFrames* findOrLoadScalarResult( int partIndex, const RigFemResultAddress& resVarAddr ); RigFemScalarResultFrames* createScalarResult( int partIndex, const RigFemResultAddress& resVarAddr ); bool isValidBiotData( const std::vector& biotData, size_t elementCount ) const; static std::vector getStressComponentNames( bool includeShear = true ); static std::vector getStressGradientComponentNames( bool includeShear = true ); const RigFormationNames* activeFormationNames() const; private: RigFemScalarResultFrames* calculateDerivedResult( int partIndex, const RigFemResultAddress& resVarAddr ); private: cvf::Collection m_femPartResults; cvf::ref m_readerInterface; cvf::ref m_elementPropertyReader; cvf::cref m_femParts; cvf::cref m_activeFormationNamesData; double m_cohesion; double m_frictionAngleRad; double m_normalizationAirGap; double m_biotFixedFactor; QString m_biotResultAddress; std::vector> m_resultCalculators; RigStatisticsDataCache* statistics( const RigFemResultAddress& resVarAddr ); std::vector getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr ); std::map> m_resultStatistics; };