2023-05-02 19:20:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
#include "RimFaultReactivationEnums.h"
|
|
|
|
|
|
|
|
#include "cvfMatrix4.h"
|
2023-05-02 19:20:05 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
class RigMainGrid;
|
2023-09-27 08:15:17 -05:00
|
|
|
class RimFaultReactivationDataAccess;
|
|
|
|
|
2023-05-02 19:20:05 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RigGriddedPart3d : public cvf::Object
|
|
|
|
{
|
2023-10-18 02:10:08 -05:00
|
|
|
using ElementSets = RimFaultReactivation::ElementSets;
|
|
|
|
using Boundary = RimFaultReactivation::Boundary;
|
2023-08-28 05:04:07 -05:00
|
|
|
|
2023-05-02 19:20:05 -05:00
|
|
|
public:
|
2023-08-28 05:04:07 -05:00
|
|
|
RigGriddedPart3d( bool flipFrontBack );
|
2023-05-02 19:20:05 -05:00
|
|
|
~RigGriddedPart3d() override;
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
2023-08-23 11:46:05 -05:00
|
|
|
void generateGeometry( std::vector<cvf::Vec3d> inputPoints,
|
|
|
|
int nHorzCells,
|
|
|
|
int nVertCellsLower,
|
|
|
|
int nVertCellsMiddle,
|
|
|
|
int nVertCellsUpper,
|
|
|
|
double thickness );
|
2023-05-02 19:20:05 -05:00
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
void generateElementSets( const RimFaultReactivationDataAccess* dataAccess, const RigMainGrid* grid );
|
|
|
|
void generateLocalNodes( const cvf::Mat4d transform );
|
2023-09-27 08:15:17 -05:00
|
|
|
void extractModelData( RimFaultReactivationDataAccess* dataAccess, size_t outputTimeStep );
|
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
const std::vector<cvf::Vec3d>& nodes() const;
|
|
|
|
const std::vector<cvf::Vec3d>& globalNodes() const;
|
|
|
|
void setUseLocalCoordinates( bool useLocalCoordinates );
|
|
|
|
bool useLocalCoordinates() const;
|
|
|
|
|
|
|
|
const std::vector<std::vector<unsigned int>>& elementIndices() const;
|
|
|
|
const std::map<RimFaultReactivation::BorderSurface, std::vector<unsigned int>>& borderSurfaceElements() const;
|
|
|
|
|
|
|
|
const std::vector<std::vector<cvf::Vec3d>>& meshLines() const;
|
|
|
|
std::vector<cvf::Vec3d> elementCorners( size_t elementIndex ) const;
|
2023-05-02 19:20:05 -05:00
|
|
|
|
2023-08-28 05:04:07 -05:00
|
|
|
const std::map<Boundary, std::vector<unsigned int>>& boundaryElements() const;
|
|
|
|
const std::map<Boundary, std::vector<unsigned int>>& boundaryNodes() const;
|
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
const std::map<ElementSets, std::vector<unsigned int>>& elementSets() const;
|
|
|
|
|
2023-05-02 19:20:05 -05:00
|
|
|
protected:
|
|
|
|
cvf::Vec3d stepVector( cvf::Vec3d start, cvf::Vec3d stop, int nSteps );
|
2023-10-18 02:10:08 -05:00
|
|
|
void generateMeshlines( const std::vector<cvf::Vec3d>& cornerPoints, int numHorzCells, int numVertCells );
|
|
|
|
|
|
|
|
bool elementIsAboveReservoir( const std::vector<cvf::Vec3d>& cornerPoints, double threshold ) const;
|
|
|
|
bool elementIsBelowReservoir( const std::vector<cvf::Vec3d>& cornerPoints, double threshold ) const;
|
|
|
|
|
|
|
|
std::pair<int, int> reservoirZTopBottom( const RigMainGrid* grid ) const;
|
2023-05-02 19:20:05 -05:00
|
|
|
|
|
|
|
private:
|
2023-10-18 02:10:08 -05:00
|
|
|
bool m_useLocalCoordinates;
|
2023-08-28 05:04:07 -05:00
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
std::vector<cvf::Vec3d> m_nodes;
|
|
|
|
std::vector<cvf::Vec3d> m_localNodes;
|
|
|
|
std::vector<std::vector<unsigned int>> m_elementIndices;
|
|
|
|
std::map<RimFaultReactivation::BorderSurface, std::vector<unsigned int>> m_borderSurfaceElements;
|
|
|
|
std::vector<std::vector<cvf::Vec3d>> m_meshLines;
|
|
|
|
std::map<Boundary, std::vector<unsigned int>> m_boundaryElements;
|
|
|
|
std::map<Boundary, std::vector<unsigned int>> m_boundaryNodes;
|
|
|
|
std::map<ElementSets, std::vector<unsigned int>> m_elementSets;
|
2023-09-27 08:15:17 -05:00
|
|
|
|
2023-10-18 02:10:08 -05:00
|
|
|
std::vector<cvf::Vec3d> m_reservoirRect;
|
2023-05-02 19:20:05 -05:00
|
|
|
};
|