Skip to content
Snippets Groups Projects
Commit 1ab64a0d authored by Henry Weller's avatar Henry Weller
Browse files

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

parent 850013e7
No related branches found
No related tags found
No related merge requests found
...@@ -130,13 +130,24 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion ...@@ -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
) )
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment