mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Refactor grid export and fault export
This commit is contained in:
@@ -87,6 +87,39 @@ const std::vector<size_t>& RigFault::connectionIndices() const
|
||||
return m_connectionIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Order FaultCellAndFace by i, j, face then k.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFault::faultOrdering(FaultCellAndFace first, FaultCellAndFace second)
|
||||
{
|
||||
size_t i1, i2, j1, j2, k1, k2;
|
||||
cvf::StructGridInterface::FaceType f1, f2;
|
||||
std::tie(i1, j1, k1, f1) = first;
|
||||
std::tie(i2, j2, k2, f2) = second;
|
||||
if (i1 == i2)
|
||||
{
|
||||
if (j1 == j2)
|
||||
{
|
||||
if (f1 == f2)
|
||||
{
|
||||
return k1 < k2;
|
||||
}
|
||||
else
|
||||
{
|
||||
return f1 < f2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return j1 < j2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return i1 < i2;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
@@ -75,7 +76,8 @@ private:
|
||||
class RigFault : public cvf::Object
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::tuple<size_t, size_t, size_t, cvf::StructGridInterface::FaceType> FaultCellAndFace;
|
||||
|
||||
struct FaultFace
|
||||
{
|
||||
FaultFace(size_t nativeReservoirCellIndex, cvf::StructGridInterface::FaceType nativeFace, size_t oppositeReservoirCellIndex) :
|
||||
@@ -106,6 +108,8 @@ public:
|
||||
std::vector<size_t>& connectionIndices();
|
||||
const std::vector<size_t>& connectionIndices() const;
|
||||
|
||||
static bool faultOrdering(RigFault::FaultCellAndFace first, RigFault::FaultCellAndFace second);
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user