From d8e258038c8a76e919c1257b41bb5d041c72d6cf Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Wed, 17 Jan 2018 10:49:54 +0100 Subject: [PATCH] Moved setFaceInfo into meshTools namespace --- src/foam/meshes/meshTools/meshTools.C | 30 +++++++++++++++++++++++++++ src/foam/meshes/meshTools/meshTools.H | 15 +++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) 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