diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 588e97957a..eb84d1aaf2 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2017 OpenCFD Ltd. + Copyright (C) 2015-2017,2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -643,7 +643,6 @@ Foam::labelListList Foam::addPatchCellLayer::addedCells() const } -// Calculate global faces per pp edge. Foam::labelListList Foam::addPatchCellLayer::globalEdgeFaces ( const polyMesh& mesh, @@ -689,6 +688,404 @@ Foam::labelListList Foam::addPatchCellLayer::globalEdgeFaces } +void Foam::addPatchCellLayer::markPatchEdges +( + const polyMesh& mesh, + const indirectPrimitivePatch& pp, + const labelListList& edgeGlobalFaces, + const labelList& meshEdges, + + bitSet& isPatchEdge, + bitSet& isPatchBoundaryEdge +) +{ + // Mark (mesh) edges: + // - anywhere on extrusion + // - where the extrusion ends + + isPatchEdge.setSize(mesh.nEdges()); + isPatchEdge = false; + isPatchEdge.set(meshEdges); + // Synchronise across coupled edges + syncTools::syncEdgeList + ( + mesh, + isPatchEdge, + orEqOp(), + false // initial value + ); + + isPatchBoundaryEdge.setSize(mesh.nEdges()); + isPatchBoundaryEdge = false; + forAll(edgeGlobalFaces, edgei) + { + // Test that edge has single global extruded face. + // Mark on processor that holds the face (since edgeGlobalFaces + // only gets filled from pp faces so if there is only one this + // is it) + if (edgeGlobalFaces[edgei].size() == 1) + { + isPatchBoundaryEdge.set(meshEdges[edgei]); + } + } + // Synchronise across coupled edges + syncTools::syncEdgeList + ( + mesh, + isPatchBoundaryEdge, + orEqOp(), + false // initial value + ); +} + + +void Foam::addPatchCellLayer::globalEdgeInfo +( + const bool zoneFromAnyFace, + + const polyMesh& mesh, + const globalIndex& globalFaces, + const labelListList& edgeGlobalFaces, + const indirectPrimitivePatch& pp, + const labelList& meshEdges, + + labelList& patchEdgeToFace, // face (in globalFaces index) + labelList& patchEdgeToPatch, // patch on face (or -1 for internal faces) + labelList& patchEdgeToZone, // zone on face + bitSet& patchEdgeToFlip // flip orientation on face +) +{ + // For every edge on the outside of the patch return a potential patch/ + // faceZone to extrude into. + + // Mark (mesh) edges on pp. + bitSet isExtrudeEdge; + bitSet isBoundaryEdge; + markPatchEdges + ( + mesh, + pp, + edgeGlobalFaces, + meshEdges, + + isExtrudeEdge, + isBoundaryEdge + ); + + // Build map of pp edges (in mesh point indexing). Note that this + // is now also on processors that do not have pp (but do have the edge) + EdgeMap