Skip to content
Snippets Groups Projects
Commit c23f38ef authored by mattijs's avatar mattijs
Browse files

ENH: polyBoundaryMesh : added check for duplicate patch

parent 7a43ab40
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -673,6 +673,8 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const ...@@ -673,6 +673,8 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
bool hasError = false; bool hasError = false;
HashSet<word> patchNames(2*size());
forAll(bm, patchI) forAll(bm, patchI)
{ {
if (bm[patchI].start() != nextPatchStart && !hasError) if (bm[patchI].start() != nextPatchStart && !hasError)
...@@ -689,6 +691,17 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const ...@@ -689,6 +691,17 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
<< " Suppressing future warnings." << endl; << " Suppressing future warnings." << endl;
} }
if (!patchNames.insert(bm[patchI].name()) && !hasError)
{
hasError = true;
Info<< " ****Duplicate boundary patch " << patchI
<< " named " << bm[patchI].name()
<< " of type " << bm[patchI].type()
<< "." << endl
<< "Suppressing future warnings." << endl;
}
nextPatchStart += bm[patchI].size(); nextPatchStart += bm[patchI].size();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment