Non-rigid fixes with post-force() not allowed after fix poems

This commit is contained in:
Charlles Abreu
2017-08-27 20:03:28 -03:00
parent fa5ec0bae7
commit eed4815953

View File

@ -368,6 +368,24 @@ void FixPOEMS::init()
error->all(FLERR,"POEMS 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;