ResInsight/ApplicationLibCode/ReservoirDataModel/RigGriddedPart3d.h

98 lines
4.2 KiB
C
Raw Normal View History

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
#include "RimFaultReactivationEnums.h"
#include "cvfMatrix4.h"
2023-05-02 19:20:05 -05:00
#include "cvfObject.h"
#include "cvfVector3.h"
#include <map>
#include <vector>
class RigMainGrid;
class RimFaultReactivationDataAccess;
2023-05-02 19:20:05 -05:00
//==================================================================================================
///
///
//==================================================================================================
class RigGriddedPart3d : public cvf::Object
{
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();
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
void generateElementSets( const RimFaultReactivationDataAccess* dataAccess, const RigMainGrid* grid );
void generateLocalNodes( const cvf::Mat4d transform );
void extractModelData( RimFaultReactivationDataAccess* dataAccess, size_t outputTimeStep );
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;
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 );
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:
bool m_useLocalCoordinates;
2023-08-28 05:04:07 -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;
std::vector<cvf::Vec3d> m_reservoirRect;
2023-05-02 19:20:05 -05:00
};