diff --git a/src/foam/meshes/meshTools/meshTools.C b/src/foam/meshes/meshTools/meshTools.C index c5f5d5cbc..8e7cde6fe 100644 --- a/src/foam/meshes/meshTools/meshTools.C +++ b/src/foam/meshes/meshTools/meshTools.C @@ -26,6 +26,7 @@ License #include "meshTools.H" #include "polyMesh.H" #include "hexMatcher.H" +#include "faceZone.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -897,4 +898,33 @@ Foam::label Foam::meshTools::cutDirToEdge } +void Foam::meshTools::setFaceInfo +( + const polyMesh& mesh, + const label faceI, + label& patchID, + label& zoneID, + label& zoneFlip +) +{ + patchID = -1; + + if (!mesh.isInternalFace(faceI)) + { + patchID = mesh.boundaryMesh().whichPatch(faceI); + } + + zoneID = mesh.faceZones().whichZone(faceI); + + zoneFlip = false; + + if (zoneID > -1) + { + const faceZone& fZone = mesh.faceZones()[zoneID]; + + zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; + } +} + + // ************************************************************************* // diff --git a/src/foam/meshes/meshTools/meshTools.H b/src/foam/meshes/meshTools/meshTools.H index b630cb0f0..6bd0f96cb 100644 --- a/src/foam/meshes/meshTools/meshTools.H +++ b/src/foam/meshes/meshTools/meshTools.H @@ -274,7 +274,7 @@ namespace meshTools ); - // Hex only functionality. + // Hex only functionality //- Given edge on hex find other 'parallel', non-connected edges. void getParallelEdges @@ -305,6 +305,19 @@ namespace meshTools const vector& cutDir ); + + // Face information + + //- Set face information: patch, zone and zone flip for a face + void setFaceInfo + ( + const polyMesh& mesh, + const label faceI, + label& patchID, + label& zoneID, + label& zoneFlip + ); + } // End namespace meshTools