rigidBodyMeshMotion: Check for attempted assignment of patches to a merged body

This commit is contained in:
Henry Weller
2016-06-27 16:31:51 +01:00
parent 850013e732
commit 1ab64a0dd9

View File

@ -130,13 +130,24 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
if (bodyDict.found("patches")) if (bodyDict.found("patches"))
{ {
const label bodyID = model_.bodyID(iter().keyword());
if (bodyID == -1)
{
FatalErrorInFunction
<< "Body " << iter().keyword()
<< " has been merged with another body"
" and cannot be assigned a set of patches"
<< exit(FatalError);
}
bodyMeshes_.append bodyMeshes_.append
( (
new bodyMesh new bodyMesh
( (
mesh, mesh,
iter().keyword(), iter().keyword(),
model_.bodyID(iter().keyword()), bodyID,
bodyDict bodyDict
) )
); );