///////////////////////////////////////////////////////////////////////////////// // // 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 "cvfBase.h" #include "cvfObject.h" #include "cvfVector3.h" #include "cvfStructGrid.h" #include "cafFixedArray.h" #include // Needed for HUGE_VAL on Linux #include #include class RigMainGrid; class RigCell; class RigConnection { public: RigConnection( ) : m_c1GlobIdx(cvf::UNDEFINED_SIZE_T), m_c1Face(cvf::StructGridInterface::NO_FACE), m_c2GlobIdx(cvf::UNDEFINED_SIZE_T) {} bool hasCommonArea() const { return m_polygon.size() > 0; } size_t m_c1GlobIdx; cvf::StructGridInterface::FaceType m_c1Face; size_t m_c2GlobIdx; std::vector m_polygon; }; class RigNNCData : public cvf::Object { public: enum NNCResultType { NNC_DYNAMIC, NNC_STATIC, NNC_GENERATED }; static QString propertyNameFluxWat() { return "FLRWAT"; } static QString propertyNameFluxOil() { return "FLROIL"; } static QString propertyNameFluxGas() { return "FLRGAS"; } static QString propertyNameCombTrans() { return "TRAN"; } static QString propertyNameRiCombTrans() { return "riTRAN"; } static QString propertyNameRiCombTransByArea() { return "riTRANbyArea"; } static QString propertyNameRiCombMult() { return "riMULT"; } RigNNCData(); void processConnections(const RigMainGrid& mainGrid); static cvf::StructGridInterface::FaceType calculateCellFaceOverlap(const RigCell &c1, const RigCell &c2, const RigMainGrid &mainGrid, std::vector* connectionPolygon, std::vector* connectionIntersections); std::vector& connections() { return m_connections; } const std::vector& connections() const { return m_connections; } std::vector& makeStaticConnectionScalarResult(QString nncDataType); const std::vector* staticConnectionScalarResult(size_t scalarResultIndex) const; const std::vector* staticConnectionScalarResultByName(const QString& nncDataType) const; std::vector< std::vector >& makeDynamicConnectionScalarResult(QString nncDataType, size_t timeStepCount); const std::vector< std::vector >* dynamicConnectionScalarResult(size_t scalarResultIndex) const; const std::vector* dynamicConnectionScalarResult(size_t scalarResultIndex, size_t timeStep) const; const std::vector< std::vector >* dynamicConnectionScalarResultByName(const QString& nncDataType) const; const std::vector* dynamicConnectionScalarResultByName(const QString& nncDataType, size_t timeStep) const; std::vector< std::vector >& makeGeneratedConnectionScalarResult(QString nncDataType, size_t timeStepCount); const std::vector< std::vector >* generatedConnectionScalarResult(size_t scalarResultIndex) const; const std::vector* generatedConnectionScalarResult(size_t scalarResultIndex, size_t timeStep) const; std::vector< std::vector >* generatedConnectionScalarResult(size_t scalarResultIndex); std::vector* generatedConnectionScalarResult(size_t scalarResultIndex, size_t timeStep); const std::vector< std::vector >* generatedConnectionScalarResultByName(const QString& nncDataType) const; const std::vector* generatedConnectionScalarResultByName(const QString& nncDataType, size_t timeStep) const; std::vector< std::vector >* generatedConnectionScalarResultByName(const QString& nncDataType); std::vector* generatedConnectionScalarResultByName(const QString& nncDataType, size_t timeStep); std::vector availableProperties(NNCResultType resultType) const; void setScalarResultIndex(const QString& nncDataType, size_t scalarResultIndex); bool hasScalarValues(size_t scalarResultIndex); private: const QString getNNCDataTypeFromScalarResultIndex(size_t scalarResultIndex) const; bool isNative(QString nncDataType) const; private: std::vector m_connections; std::map > > m_connectionResults; std::map m_resultIndexToNNCDataType; };