ENH: add polyBoundaryMesh::nNonProcessorFaces()

- the number boundary faces before the first processor patch.
  This approximately equals the 'real' number of boundary faces
This commit is contained in:
Mark Olesen 2025-03-12 16:23:13 +01:00
parent 795bce4519
commit 51bb06764a
6 changed files with 53 additions and 6 deletions

View File

@ -0,0 +1 @@
#warning File removed - left for old dependency check only

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -656,6 +656,26 @@ Foam::label Foam::polyBoundaryMesh::nProcessorPatches() const
}
Foam::label Foam::polyBoundaryMesh::nNonProcessorFaces() const
{
const polyPatchList& patches = *this;
label count = 0;
for (const polyPatch& p : patches)
{
if (isA<processorPolyPatch>(p))
{
break;
}
count += p.nFaces();
}
return count;
}
Foam::wordList Foam::polyBoundaryMesh::names() const
{
return PtrListOps::get<word>(*this, nameOp<polyPatch>());

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,7 +33,7 @@ Description
SourceFiles
polyBoundaryMesh.C
polyBoundaryMeshTemplates.C
polyBoundaryMesh.txx
\*---------------------------------------------------------------------------*/
@ -212,6 +212,9 @@ public:
//- The number of processorPolyPatch patches
label nProcessorPatches() const;
//- The number of boundary faces before the first processor patch.
label nNonProcessorFaces() const;
//- Return a list of patch names
wordList names() const;
@ -427,7 +430,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "polyBoundaryMeshTemplates.C"
#include "polyBoundaryMesh.txx"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -422,6 +422,26 @@ Foam::label Foam::faBoundaryMesh::nProcessorPatches() const
}
Foam::label Foam::faBoundaryMesh::nNonProcessorEdges() const
{
const faPatchList& patches = *this;
label count = 0;
for (const faPatch& p : patches)
{
if (isA<processorFaPatch>(p))
{
break;
}
count += p.nEdges();
}
return count;
}
const Foam::HashTable<Foam::labelList>&
Foam::faBoundaryMesh::groupPatchIDs() const
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2018-2024 OpenCFD Ltd.
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -188,6 +188,9 @@ public:
//- The number of processorFaPatch patches
label nProcessorPatches() const;
//- The number of boundary edges before the first processor patch.
label nNonProcessorEdges() const;
//- Return a list of patch names
wordList names() const;