Throw fatal error if face zones do not exist

This commit is contained in:
Henrik Rusche 2011-05-01 19:39:16 +02:00
parent 4a271dbf06
commit 9a2a744c37

View file

@ -102,19 +102,30 @@ int main(int argc, char *argv[])
faPatches[patchI].type_ =
word(curPatchDict.lookup("type"));
faPatches[patchI].ownPolyPatchID_ =
mesh.boundaryMesh().findPatchID
(
word(curPatchDict.lookup("ownerPolyPatch"))
);
word ownName = curPatchDict.lookup("ownerPolyPatch");
faPatches[patchI].ngbPolyPatchID_ =
mesh.boundaryMesh().findPatchID
(
word(curPatchDict.lookup("neighbourPolyPatch"))
);
faPatches[patchI].ownPolyPatchID_ =
mesh.boundaryMesh().findPatchID(ownName);
if ( faPatches[patchI].ownPolyPatchID_ < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "neighbourPolyPatch " << ownName << " does not exist"
<< exit(FatalError);
}
word neiName = curPatchDict.lookup("neighbourPolyPatch");
faPatches[patchI].ngbPolyPatchID_ =
mesh.boundaryMesh().findPatchID(neiName);
if ( faPatches[patchI].ngbPolyPatchID_ < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "neighbourPolyPatch " << neiName << " does not exist"
<< exit(FatalError);
}
}
// Setting faceLabels list size
label size = 0;
@ -126,6 +137,13 @@ int main(int argc, char *argv[])
patchIDs[patchI] =
mesh.boundaryMesh().findPatchID(polyMeshPatches[patchI]);
if ( patchIDs[patchI] < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "Patch " << polyMeshPatches[patchI] << " does not exist"
<< exit(FatalError);
}
size += mesh.boundaryMesh()[patchIDs[patchI]].size();
}