apply test for overlap with rigid bodies to set and velocity command

This commit is contained in:
Axel Kohlmeyer
2017-06-05 13:06:53 -04:00
parent 95d6f05a76
commit 968de8548c
2 changed files with 28 additions and 0 deletions

View File

@ -585,6 +585,28 @@ void Set::set(int keyword)
}
}
// check if properties of atoms in rigid bodies are updated
// that are cached as per-body data.
switch (keyword) {
case X:
case Y:
case Z:
case MOLECULE:
case MASS:
case ANGMOM:
case SHAPE:
case DIAMETER:
case DENSITY:
case QUAT:
case IMAGE:
if (modify->check_rigid_list_overlap(select))
error->warning(FLERR,"Changing a property of atoms in rigid bodies "
"that has no effect unless rigid bodies are rebuild");
break;
default: // assume no conflict for all other properties
break;
}
// loop over selected atoms
AtomVecEllipsoid *avec_ellipsoid =

View File

@ -68,6 +68,12 @@ void Velocity::command(int narg, char **arg)
if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
groupbit = group->bitmask[igroup];
// check if velocities of atoms in rigid bodies are updated
if (modify->check_rigid_group_overlap(groupbit))
error->warning(FLERR,"Changing velocities of atoms in rigid bodies. "
"This has no effect unless rigid bodies are rebuild");
// identify style
if (strcmp(arg[1],"create") == 0) style = CREATE;