Commit 79341ac5 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #516 from akohlmey/check-rigid-overlap

Implement check whether commands or styles try to change cached properties in rigid body integrators
parents 66945294 32b967ed
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -316,6 +316,9 @@ void ChangeBox::command(int narg, char **arg)

    } else if (ops[m].style == REMAP) {

      if (modify->check_rigid_group_overlap(groupbit))
        error->warning(FLERR,"Attempting to remap atoms in rigid bodies");

      // convert atoms to lamda coords, using last box state
      // convert atoms back to box coords, using current box state
      // save current box state
+15 −6
Original line number Diff line number Diff line
@@ -69,6 +69,15 @@ void DeleteAtoms::command(int narg, char **arg)
  else if (strcmp(arg[0],"porosity") == 0) delete_porosity(narg,arg);
  else error->all(FLERR,"Illegal delete_atoms command");

  if (allflag) {
    int igroup = group->find("all");
    if ((igroup >= 0) && modify->check_rigid_group_overlap(group->bitmask[igroup]))
      error->warning(FLERR,"Attempting to delete atoms in rigid bodies");
  } else {
    if (modify->check_rigid_list_overlap(dlist))
      error->warning(FLERR,"Attempting to delete atoms in rigid bodies");
  }

  // if allflag = 1, just reset atom->nlocal
  // else delete atoms one by one

+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ void DisplaceAtoms::command(int narg, char **arg)
  if (igroup == -1) error->all(FLERR,"Could not find displace_atoms group ID");
  groupbit = group->bitmask[igroup];

  if (modify->check_rigid_group_overlap(groupbit))
    error->warning(FLERR,"Attempting to displace atoms in rigid bodies");

  int style = -1;
  if (strcmp(arg[1],"move") == 0) style = MOVE;
  else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
+5 −1
Original line number Diff line number Diff line
@@ -126,6 +126,10 @@ void FixHeat::init()
    else error->all(FLERR,"Variable for fix heat is invalid style");
  }

  // check for rigid bodies in region (done here for performance reasons)
  if (modify->check_rigid_region_overlap(groupbit,domain->regions[iregion]))
    error->warning(FLERR,"Cannot apply fix heat to atoms in rigid bodies");

  // cannot have 0 atoms in group

  if (group->count(igroup) == 0)
+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ void FixTempBerendsen::init()
    error->all(FLERR,"Temperature ID for fix temp/berendsen does not exist");
  temperature = modify->compute[icompute];

  if (modify->check_rigid_group_overlap(groupbit))
    error->warning(FLERR,"Cannot thermostat atoms in rigid bodies");

  if (temperature->tempbias) which = BIAS;
  else which = NOBIAS;
}
Loading