Commit 69d97fa6 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

fix enforce2d has to be defined after fixes with enforce2d_flag set

this check currently only applies to rigid fixes and is needed
so that their respective enforce2d function is called _after_
the post force functions. this is required in combination with
commit a9ff5937 to allow rigid
fixes use the langevin option correctly for 2d systems
parent a9ff5937
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -66,12 +66,21 @@ void FixEnforce2D::init()
    if (modify->fix[i]->enforce2d_flag) nfixlist++;

  if (nfixlist) {
    int myindex = -1;
    delete [] flist;
    flist = new Fix*[nfixlist];
    nfixlist = 0;
    for (int i = 0; i < modify->nfix; i++) {
      if (modify->fix[i]->enforce2d_flag) 
      if (modify->fix[i]->enforce2d_flag) {
        if (myindex < 0)
          flist[nfixlist++] = modify->fix[i];
        else {
          char msg[256];
          sprintf(msg,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
          error->all(FLERR,msg);
        }
      }
      if (modify->fix[i] == this) myindex = i;
    }
  }
}