ENH: mergePolyMesh: Added check for zero patches in the master mesh

Patch contributed by Jakub Benda
Resolves bug-report https://bugs.openfoam.org/view.php?id=2727
This commit is contained in:
Henry Weller 2017-10-18 16:24:08 +01:00 committed by Andrew Heather
parent b08e8e1904
commit 83026d2546

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -36,7 +36,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(mergePolyMesh, 1);
defineTypeNameAndDebug(mergePolyMesh, 1);
}
@ -442,7 +442,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
)
);
}
}
@ -474,7 +473,9 @@ void Foam::mergePolyMesh::merge()
Info<< "Adding new patches. " << endl;
label endOfLastPatch =
oldPatches[patchi - 1].start() + oldPatches[patchi - 1].size();
patchi == 0
? 0
: oldPatches[patchi - 1].start() + oldPatches[patchi - 1].size();
for (; patchi < patchNames_.size(); patchi++)
{