///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Statoil ASA // Copyright (C) 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 "RiaNncDefines.h" #include "RigNncConnection.h" #include "cvfObject.h" #include "cvfStructGrid.h" #include "cvfVector3.h" #include // Needed for HUGE_VAL on Linux #include #include #include class RigActiveCellInfo; class RigMainGrid; class RigCell; class RigEclipseResultAddress; class QStringList; class RigNNCData : public cvf::Object { public: enum NNCResultType { NNC_DYNAMIC, NNC_STATIC, NNC_GENERATED }; RigNNCData(); bool ensureConnectionDataIsProcecced(); void setSourceDataForProcessing( RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells ); void setNativeConnections( RigConnectionContainer& connections ); size_t nativeConnectionCount() const; RigConnectionContainer& connections(); std::vector& makeStaticConnectionScalarResult( QString nncDataType ); const std::vector* staticConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const; const std::vector* staticConnectionScalarResultByName( const QString& nncDataType ) const; void makeScalarResultAndSetValues( const QString& nncDataType, const std::vector& values ); std::vector>& makeDynamicConnectionScalarResult( QString nncDataType, size_t timeStepCount ); const std::vector>* dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const; const std::vector* dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const; const std::vector>* dynamicConnectionScalarResultByName( const QString& nncDataType ) const; const std::vector* dynamicConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const; std::vector>& makeGeneratedConnectionScalarResult( QString nncDataType, size_t timeStepCount ); const std::vector>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const; const std::vector* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const; std::vector>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ); std::vector* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ); const std::vector>* generatedConnectionScalarResultByName( const QString& nncDataType ) const; const std::vector* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const; std::vector>* generatedConnectionScalarResultByName( const QString& nncDataType ); std::vector* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ); std::vector availableProperties( NNCResultType resultType ) const; void setEclResultAddress( const QString& nncDataType, const RigEclipseResultAddress& resVarAddr ); bool hasScalarValues( const RigEclipseResultAddress& resVarAddr ); private: const QString getNNCDataTypeFromScalarResultIndex( const RigEclipseResultAddress& resVarAddr ) const; bool isNative( QString nncDataType ) const; void processNativeConnections( const RigMainGrid& mainGrid ); void computeCompleteSetOfNncs( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells ); size_t connectionsWithNoCommonArea( QStringList& connectionTextFirstItems, size_t maxItemCount ); private: RigConnectionContainer m_connections; size_t m_nativeConnectionCount; std::map>> m_connectionResults; std::map m_resultAddrToNNCDataType; bool m_connectionsAreProcessed; RigMainGrid* m_mainGrid; const RigActiveCellInfo* m_activeCellInfo; bool m_computeNncForInactiveCells; };