mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
riTRANXYZ: Paving the way: Renaming, Removing obsolete code, Store fault index for each cell face, Added prototype code for the calculation
This commit is contained in:
@@ -243,16 +243,20 @@ cvf::Vec3d RigCell::faceCenter(cvf::StructGridInterface::FaceType face) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// Returns an area vector for the cell face. The direction is the face normal, and the length is
|
||||
/// equal to the face area (projected to the plane represented by the diagonal in case of warp)
|
||||
/// The components of this area vector are equal to the area of the face projection onto
|
||||
/// the corresponding plane.
|
||||
/// See http://geomalgorithms.com/a01-_area.html
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RigCell::faceNormal(cvf::StructGridInterface::FaceType face) const
|
||||
cvf::Vec3d RigCell::faceNormalWithAreaLenght(cvf::StructGridInterface::FaceType face) const
|
||||
{
|
||||
cvf::ubyte faceVertexIndices[4];
|
||||
cvf::StructGridInterface::cellFaceVertexIndices(face, faceVertexIndices);
|
||||
const std::vector<cvf::Vec3d>& nodeCoords = m_hostGrid->mainGrid()->nodes();
|
||||
|
||||
return ( nodeCoords[m_cornerIndices[faceVertexIndices[2]]] - nodeCoords[m_cornerIndices[faceVertexIndices[0]]]) ^
|
||||
( nodeCoords[m_cornerIndices[faceVertexIndices[3]]] - nodeCoords[m_cornerIndices[faceVertexIndices[1]]]);
|
||||
return 0.5*( nodeCoords[m_cornerIndices[faceVertexIndices[2]]] - nodeCoords[m_cornerIndices[faceVertexIndices[0]]]) ^
|
||||
( nodeCoords[m_cornerIndices[faceVertexIndices[3]]] - nodeCoords[m_cornerIndices[faceVertexIndices[1]]]);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user