Refactored to use Cell::faceIndices

This commit is contained in:
Jacob Støren 2013-12-11 14:56:17 +01:00
parent e171aa66ac
commit e175a5c96f

View File

@ -370,27 +370,24 @@ void RigGridBase::computeFaults()
cvf::Vec3d currentCellFaceVertices[4]; cvf::Vec3d currentCellFaceVertices[4];
{ {
cvf::ubyte faceVertexIndices[4]; caf::SizeTArray4 faceVxIndices;
cellFaceVertexIndices(face, faceVertexIndices); currentCell.faceIndices(face, &faceVxIndices);
const caf::SizeTArray8& cornerIndices = currentCell.cornerIndices();
currentCellFaceVertices[0].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[0]]]); currentCellFaceVertices[0].set(m_mainGrid->nodes()[faceVxIndices[0]]);
currentCellFaceVertices[1].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[1]]]); currentCellFaceVertices[1].set(m_mainGrid->nodes()[faceVxIndices[1]]);
currentCellFaceVertices[2].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[2]]]); currentCellFaceVertices[2].set(m_mainGrid->nodes()[faceVxIndices[2]]);
currentCellFaceVertices[3].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[3]]]); currentCellFaceVertices[3].set(m_mainGrid->nodes()[faceVxIndices[3]]);
} }
cvf::Vec3d neighbourCellFaceVertices[4]; cvf::Vec3d neighbourCellFaceVertices[4];
{ {
cvf::ubyte faceVertexIndices[4]; caf::SizeTArray4 faceVxIndices;
StructGridInterface::FaceType opposite = StructGridInterface::oppositeFace(face); currentCell.faceIndices(StructGridInterface::oppositeFace(face), &faceVxIndices);
cellFaceVertexIndices(opposite, faceVertexIndices);
const caf::SizeTArray8& cornerIndices = neighbourCell.cornerIndices();
neighbourCellFaceVertices[0].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[0]]]); neighbourCellFaceVertices[0].set(m_mainGrid->nodes()[faceVxIndices[0]]);
neighbourCellFaceVertices[1].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[3]]]); neighbourCellFaceVertices[1].set(m_mainGrid->nodes()[faceVxIndices[3]]);
neighbourCellFaceVertices[2].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[2]]]); neighbourCellFaceVertices[2].set(m_mainGrid->nodes()[faceVxIndices[2]]);
neighbourCellFaceVertices[3].set(m_mainGrid->nodes()[cornerIndices[faceVertexIndices[1]]]); neighbourCellFaceVertices[3].set(m_mainGrid->nodes()[faceVxIndices[1]]);
} }
bool sharedFaceVertices = true; bool sharedFaceVertices = true;