mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2564 Compaction. Set default reference layer to topmost layer having valid POR
This commit is contained in:
@@ -182,6 +182,28 @@ void RigFemPartGrid::generateStructGridData()
|
||||
cvf::Vec3i ijk = m_ijkPrElement[elmIdx];
|
||||
m_elmIdxPrIJK.at(ijk[0], ijk[1], ijk[2]) = elmIdx;
|
||||
}
|
||||
|
||||
// IJK bounding box
|
||||
m_reservoirIJKBoundingBox.first = cvf::Vec3st(INT_MAX, INT_MAX, INT_MAX);
|
||||
m_reservoirIJKBoundingBox.second = cvf::Vec3st(0, 0, 0);
|
||||
cvf::Vec3st& min = m_reservoirIJKBoundingBox.first;
|
||||
cvf::Vec3st& max = m_reservoirIJKBoundingBox.second;
|
||||
|
||||
for (int elmIdx = 0; elmIdx < m_femPart->elementCount(); ++elmIdx)
|
||||
{
|
||||
RigElementType elementType = m_femPart->elementType(elmIdx);
|
||||
size_t i, j, k;
|
||||
if (elementType == HEX8P && ijkFromCellIndex(elmIdx, &i, &j, &k))
|
||||
{
|
||||
if (i < min.x()) min.x() = i;
|
||||
if (j < min.y()) min.y() = j;
|
||||
if (k < min.z()) min.z() = k;
|
||||
if (i > max.x()) max.x() = i;
|
||||
if (j > max.y()) max.y() = j;
|
||||
if (k > max.z()) max.z() = k;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -287,6 +309,14 @@ cvf::Vec3i RigFemPartGrid::findMainIJKFaces(int elementIndex) const
|
||||
return ijkMainFaceIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<cvf::Vec3st, cvf::Vec3st> RigFemPartGrid::reservoirIJKBoundingBox() const
|
||||
{
|
||||
return m_reservoirIJKBoundingBox;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Find the face that is not perpFaceIdx or its opposite, and has normal closest to direction
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user