///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2023 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 "RimFaultReactivationEnums.h" #include "cvfMatrix4.h" #include "cvfObject.h" #include "cvfVector3.h" #include #include #include //================================================================================================== /// /// //================================================================================================== class RigGriddedPart3d : public cvf::Object { using ElementSets = RimFaultReactivation::ElementSets; using Boundary = RimFaultReactivation::Boundary; public: RigGriddedPart3d(); ~RigGriddedPart3d() override; void reset(); void generateGeometry( const std::array& inputPoints, const std::vector& reservoirLayers, const std::vector& kLayers, double maxCellHeight, double cellSizeFactor, const std::vector& horizontalPartition, double modelThickness, double topHeight, cvf::Vec3d thicknessDirection, int nFaultZoneCells ); void generateLocalNodes( const cvf::Mat4d transform ); void setUseLocalCoordinates( bool useLocalCoordinates ); bool useLocalCoordinates() const; double topHeight() const; void setFaultSafetyDistance( double distance ); double faultSafetyDistance() const; const std::vector& nodes() const; const std::vector& globalNodes() const; const std::vector& dataNodes() const; const std::vector>& elementIndices() const; const std::map>& borderSurfaceElements() const; const std::vector>& meshLines() const; const std::map>& boundaryElements() const; const std::map>& boundaryNodes() const; const std::map>& elementSets() const; const std::vector elementKLayer() const; std::vector elementCorners( size_t elementIndex ) const; std::vector elementDataCorners( size_t elementIndex ) const; const std::vector> layers( ElementSets elementSet ) const; protected: static cvf::Vec3d stepVector( cvf::Vec3d start, cvf::Vec3d stop, int nSteps ); static std::vector generateConstantLayers( double zFrom, double zTo, double maxSize ); static std::vector generateGrowingLayers( double zFrom, double zTo, double maxSize, double growfactor ); static std::vector extractZValues( std::vector ); void generateVerticalMeshlines( const std::vector& cornerPoints, const std::vector& horzPartition ); void updateReservoirElementLayers( const std::vector& reservoirLayers, const std::vector& kLayers ); private: enum class Regions { LowerUnderburden = 0, // deepest region goes first UpperUnderburden, Reservoir, LowerOverburden, UpperOverburden }; static std::vector allRegions(); static std::vector extractCornersForElement( const std::vector>& elementIndices, const std::vector& nodes, size_t elementIndex ); private: bool m_useLocalCoordinates; double m_topHeight; double m_faultSafetyDistance; std::vector m_nodes; std::vector m_dataNodes; std::vector m_localNodes; std::vector> m_elementIndices; std::vector m_elementKLayer; std::map> m_borderSurfaceElements; std::vector> m_meshLines; std::map> m_boundaryElements; std::map> m_boundaryNodes; std::map> m_elementSets; std::map>> m_elementLayers; };