From 968de8548c1aca6782a465578c0297783a87d3ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 5 Jun 2017 13:06:53 -0400 Subject: [PATCH] apply test for overlap with rigid bodies to set and velocity command --- src/set.cpp | 22 ++++++++++++++++++++++ src/velocity.cpp | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/src/set.cpp b/src/set.cpp index 4ed07d423b..629f325d35 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -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 = diff --git a/src/velocity.cpp b/src/velocity.cpp index 82b6efbe1b..260a11bb4e 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -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;