Commit 80fad848 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add polyBoundaryMesh::nNonProcessor() method

- returns the number of non-processorPolyPatch patches, which is invariant
  across all processors.
parent 8716061a
......@@ -167,10 +167,6 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::polyBoundaryMesh::~polyBoundaryMesh()
{}
void Foam::polyBoundaryMesh::clearGeom()
{
forAll(*this, patchi)
......@@ -505,6 +501,28 @@ void Foam::polyBoundaryMesh::setGroup
}
Foam::label Foam::polyBoundaryMesh::nNonProcessor() const
{
const polyPatchList& patches = *this;
label nonProc = 0;
for (const polyPatch& p : patches)
{
if (isA<processorPolyPatch>(p))
{
break;
}
else
{
++nonProc;
}
}
return nonProc;
}
Foam::wordList Foam::polyBoundaryMesh::names() const
{
const polyPatchList& patches = *this;
......@@ -856,7 +874,6 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
return false;
}
const polyBoundaryMesh& bm = *this;
bool hasError = false;
......
......@@ -82,10 +82,10 @@ class polyBoundaryMesh
void calcGeometry();
//- Disallow construct as copy
polyBoundaryMesh(const polyBoundaryMesh&);
polyBoundaryMesh(const polyBoundaryMesh&) = delete;
//- Disallow assignment
void operator=(const polyBoundaryMesh&);
void operator=(const polyBoundaryMesh&) = delete;
public:
......@@ -126,7 +126,7 @@ public:
//- Destructor
~polyBoundaryMesh();
~polyBoundaryMesh() = default;
//- Clear geometry at this level and at patches
void clearGeom();
......@@ -151,6 +151,9 @@ public:
// Only valid for singly connected polyBoundaryMesh and not parallel
const List<labelPairList>& neighbourEdges() const;
//- Return the number of non-processor patches
label nNonProcessor() const;
//- Return a list of patch names
wordList names() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment