Commit fa5ec0ba authored by Charlles Abreu's avatar Charlles Abreu
Browse files

Fixes with post-force() not allowed after fix rigid or rigid/small

parent 7572dc63
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -680,6 +680,24 @@ void FixRigid::init()
        error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
  }

  // error if any non-rigid fix with post_force succeeds any fix rigid:
  int first_rigid = 0;
  while (!modify->fix[first_rigid]->rigid_flag)
    first_rigid++;
  count = 0;
  for (i = first_rigid + 1; i < modify->nfix; i++) {
    Fix *ifix = modify->fix[i];
    if ( (modify->fmask[i] & POST_FORCE) && (!ifix->rigid_flag) ) {
      count++;
      if (comm->me == 0) {
        if (screen) fprintf(screen,"> fix %s %s\n",ifix->id,ifix->style);
        if (logfile) fprintf(logfile,"> fix %s %s\n",ifix->id,ifix->style);
      }
    }
  }
  if (count > 0)
    error->all(FLERR,"the fixes listed above must preceed all rigid-body fixes");

  // timestep info

  dtv = update->dt;
+18 −0
Original line number Diff line number Diff line
@@ -516,6 +516,24 @@ void FixRigidSmall::init()
        error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
  }

  // error if any non-rigid fix with post_force succeeds any fix rigid:
  int first_rigid = 0;
  while (!modify->fix[first_rigid]->rigid_flag)
    first_rigid++;
  count = 0;
  for (i = first_rigid + 1; i < modify->nfix; i++) {
    Fix *ifix = modify->fix[i];
    if ( (modify->fmask[i] & POST_FORCE) && (!ifix->rigid_flag) ) {
      count++;
      if (comm->me == 0) {
        if (screen) fprintf(screen,"> fix %s %s\n",ifix->id,ifix->style);
        if (logfile) fprintf(logfile,"> fix %s %s\n",ifix->id,ifix->style);
      }
    }
  }
  if (count > 0)
    error->all(FLERR,"the fixes listed above must preceed all rigid-body fixes");

  // timestep info

  dtv = update->dt;