mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1487 Add a "WELL" index space, to be used for well connections
This commit is contained in:
@@ -30,28 +30,37 @@ public:
|
||||
class CellAddress
|
||||
{
|
||||
public:
|
||||
enum CellType { ECLIPSE, STIMPLAN };
|
||||
enum CellIndexSpace { ECLIPSE, STIMPLAN, WELL};
|
||||
|
||||
CellAddress(): m_isExternal(false),
|
||||
m_cellType(STIMPLAN),
|
||||
m_globalCellIdx(-1) {}
|
||||
CellAddress(bool isExternal, CellType cellType, size_t globalCellIdx)
|
||||
: m_isExternal(isExternal),
|
||||
m_cellType(cellType),
|
||||
m_globalCellIdx(globalCellIdx) {}
|
||||
m_cellIndexSpace(STIMPLAN),
|
||||
m_globalCellIdx(-1)
|
||||
{}
|
||||
CellAddress(bool isExternal,
|
||||
CellIndexSpace cellType,
|
||||
size_t globalCellIdx)
|
||||
: m_isExternal(isExternal),
|
||||
m_cellIndexSpace(cellType),
|
||||
m_globalCellIdx(globalCellIdx)
|
||||
{}
|
||||
|
||||
bool m_isExternal;
|
||||
CellType m_cellType;
|
||||
size_t m_globalCellIdx;
|
||||
bool m_isExternal;
|
||||
CellIndexSpace m_cellIndexSpace;
|
||||
size_t m_globalCellIdx;
|
||||
|
||||
bool operator==(const CellAddress& o) { return (m_isExternal == o.m_isExternal) && (m_cellType == o.m_cellType) && (m_globalCellIdx == o.m_globalCellIdx); }
|
||||
|
||||
bool operator==(const CellAddress& o)
|
||||
{
|
||||
return (m_isExternal == o.m_isExternal) && (m_cellIndexSpace == o.m_cellIndexSpace) && (m_globalCellIdx == o.m_globalCellIdx);
|
||||
}
|
||||
|
||||
// Ordering external after internal is important for the matrix order internally
|
||||
|
||||
bool operator<(const CellAddress& other) const
|
||||
{
|
||||
if (m_isExternal != other.m_isExternal) return !m_isExternal; // Internal cells < External cells
|
||||
if (m_cellType != other.m_cellType) return m_cellType < other.m_cellType; // Eclipse < StimPlan
|
||||
if (m_globalCellIdx != other.m_globalCellIdx) return m_globalCellIdx < other.m_globalCellIdx;
|
||||
if (m_isExternal != other.m_isExternal) return !m_isExternal; // Internal cells < External cells
|
||||
if (m_cellIndexSpace != other.m_cellIndexSpace)return m_cellIndexSpace < other.m_cellIndexSpace; // Eclipse < StimPlan
|
||||
if (m_globalCellIdx != other.m_globalCellIdx) return m_globalCellIdx < other.m_globalCellIdx;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user