#5915 improve performance of NNC computation and limit to active cells

This commit is contained in:
Gaute Lindkvist
2020-05-12 18:19:27 +02:00
committed by Magne Sjaastad
parent de4fafe744
commit ec2a924767
21 changed files with 463 additions and 278 deletions

View File

@@ -21,6 +21,7 @@
#include "cvfStructGrid.h"
#include "cvfVector3.h"
#include <deque>
#include <vector>
//--------------------------------------------------------------------------------------------------
@@ -30,12 +31,39 @@ class RigConnection
{
public:
RigConnection();
RigConnection( size_t c1GlobIdx,
size_t c2GlobIdx,
cvf::StructGridInterface::FaceType c1Face,
const std::vector<cvf::Vec3d>& polygon );
RigConnection( const RigConnection& rhs );
bool hasCommonArea() const;
RigConnection& operator=( RigConnection& rhs );
bool operator<( const RigConnection& other ) const;
bool hasCommonArea() const;
size_t m_c1GlobIdx;
cvf::StructGridInterface::FaceType m_c1Face;
size_t m_c2GlobIdx;
std::vector<cvf::Vec3d> m_polygon;
cvf::StructGridInterface::FaceType m_c1Face;
std::vector<cvf::Vec3d> m_polygon;
};
class RigConnectionContainer
{
public:
RigConnection operator[]( size_t i ) const;
std::pair<size_t, size_t>& indexPair( size_t i );
cvf::StructGridInterface::FaceType& face( size_t i );
std::vector<cvf::Vec3d>& polygon( size_t i );
void push_back( const RigConnection& connection );
void insert( const RigConnectionContainer& other );
size_t size() const;
void clear();
bool empty() const;
private:
std::vector<std::pair<size_t, size_t>> m_globalIndices;
std::vector<cvf::StructGridInterface::FaceType> m_faces;
std::vector<std::vector<cvf::Vec3d>> m_polygons;
};