From 36af9f615a0d257e5fb79d7d88944c914bd084ac Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 10 Oct 2019 20:54:37 +0100 Subject: [PATCH] ENH: Added utility functions to polyBoundaryMesh --- .../polyBoundaryMesh/polyBoundaryMesh.C | 22 +++++++++++++++++++ .../polyBoundaryMesh/polyBoundaryMesh.H | 6 +++++ 2 files changed, 28 insertions(+) diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 98723a3ffe..11341428b5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -612,6 +612,28 @@ Foam::wordList Foam::polyBoundaryMesh::physicalTypes() const } +Foam::labelList Foam::polyBoundaryMesh::patchStarts() const +{ + return + getMethodImpl + ( + *this, + [](const polyPatch& p) { return p.start(); } + ); +} + + +Foam::labelList Foam::polyBoundaryMesh::patchSizes() const +{ + return + getMethodImpl + ( + *this, + [](const polyPatch& p) { return p.size(); } + ); +} + + Foam::label Foam::polyBoundaryMesh::start() const { return mesh_.nInternalFaces(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index 5c2a5c0d91..b7b4227f2d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -167,6 +167,12 @@ public: //- Return a list of physical types wordList physicalTypes() const; + //- Return a list of patch start face indices + labelList patchStarts() const; + + //- Return a list of patch sizes + labelList patchSizes() const; + //- The start label of the boundary faces in the polyMesh face list // Same as mesh.nInternalFaces() label start() const;