label findPatchID(const polyBoundaryMesh& patches, const word& name) { const label patchID = patches.findPatchID(name); if (patchID == -1) { FatalErrorInFunction << "Cannot find patch " << name << " in the source mesh.\n" << "Valid patch names are " << patches.names() << exit(FatalError); } return patchID; }
// Checks whether patch present void checkPatch(const polyBoundaryMesh& bMesh, const word& name) { label patchI = bMesh.findPatchID(name); if (patchI == -1) { FatalErrorIn("checkPatch(const polyBoundaryMesh&, const word&)") << "Cannot find patch " << name << endl << "It should be present and of non-zero size" << endl << "Valid patches are " << bMesh.names() << exit(FatalError); } if (bMesh[patchI].empty()) { FatalErrorIn("checkPatch(const polyBoundaryMesh&, const word&)") << "Patch " << name << " is present but zero size" << exit(FatalError); } }