Unverified Commit 93e4ed97 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2304 from akohlmey/collected-small-changes

Collected small changes for the next patch release
parents 7e1a3bd4 47a44732
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Syntax
* ID, group-ID are documented in :doc:`fix <fix>` command
* restrain = style name of this fix command
* one or more keyword/arg pairs may be appended
* keyword = *bond* or *angle* or *dihedral*
* keyword = *bond* or *lbound* or *angle* or *dihedral*

  .. parsed-literal::

@@ -23,7 +23,7 @@ Syntax
         r0start = equilibrium bond distance at start of run (distance units)
         r0stop = equilibrium bond distance at end of run (optional) (distance units). If not
           specified it is assumed to be equal to r0start
       *lbond* args = atom1 atom2 Kstart Kstop r0start (r0stop)
       *lbound* args = atom1 atom2 Kstart Kstop r0start (r0stop)
         atom1,atom2 = IDs of 2 atoms in bond
         Kstart,Kstop = restraint coefficients at start/end of run (energy units)
         r0start = equilibrium bond distance at start of run (distance units)
@@ -46,7 +46,7 @@ Examples
.. code-block:: LAMMPS

   fix holdem all restrain bond 45 48 2000.0 2000.0 2.75
   fix holdem all restrain lbond 45 48 2000.0 2000.0 2.75
   fix holdem all restrain lbound 45 48 2000.0 2000.0 2.75
   fix holdem all restrain dihedral 1 2 3 4 2000.0 2000.0 120.0
   fix holdem all restrain bond 45 48 2000.0 2000.0 2.75 dihedral 1 2 3 4 2000.0 2000.0 120.0
   fix texas_holdem all restrain dihedral 1 2 3 4 0.0 2000.0 120.0 dihedral 1 2 3 5 0.0 2000.0 -120.0 dihedral 1 2 3 6 0.0 2000.0 0.0
@@ -150,7 +150,7 @@ is included in :math:`K`.

----------

The *lbond* keyword applies a lower bound bond restraint to the specified atoms
The *lbound* keyword applies a lower bound bond restraint to the specified atoms
using the same functional form used by the :doc:`bond_style harmonic <bond_harmonic>` command if the distance between
the atoms is smaller than the equilibrium bond distance and 0 otherwise. The potential associated with
the restraint is
+12 −13
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ void PairBuckLongCoulLong::settings(int narg, char **arg)
    error->warning(FLERR,"Using largest cutoff for buck/long/coul/long");
  if (!*(++arg))
    error->all(FLERR,"Cutoffs missing in pair_style buck/long/coul/long");
  if (!((ewald_order^ewald_off) & (1<<6)))
    dispersionflag = 0;
  if (ewald_off & (1<<6))
    error->all(FLERR,"LJ6 off not supported in pair_style buck/long/coul/long");
  if (!((ewald_order^ewald_off) & (1<<1)))
@@ -387,6 +389,7 @@ void PairBuckLongCoulLong::write_restart_settings(FILE *fp)
  fwrite(&ncoultablebits,sizeof(int),1,fp);
  fwrite(&tabinner,sizeof(double),1,fp);
  fwrite(&ewald_order,sizeof(int),1,fp);
  fwrite(&dispersionflag,sizeof(int),1,fp);
}

/* ----------------------------------------------------------------------
@@ -403,6 +406,7 @@ void PairBuckLongCoulLong::read_restart_settings(FILE *fp)
    utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error);
    utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error);
  }
  MPI_Bcast(&cut_buck_global,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
@@ -411,6 +415,7 @@ void PairBuckLongCoulLong::read_restart_settings(FILE *fp)
  MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world);
  MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&ewald_order,1,MPI_INT,0,world);
  MPI_Bcast(&dispersionflag,1,MPI_INT,0,world);
}

/* ----------------------------------------------------------------------
@@ -529,8 +534,7 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag)
            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
          }
        }
      }
      else force_coul = ecoul = 0.0;
      } else force_coul = ecoul = 0.0;

      if (rsq < cut_bucksqi[typej]) {                        // buckingham
        double rn = r2inv*r2inv*r2inv,
@@ -543,16 +547,14 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag)
              force_buck =
                r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
              if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
            }
            else {                                        // special case
            } else {                                        // special case
              double f = special_lj[ni], t = rn*(1.0-f);
              force_buck = f*r*expr*buck1i[typej]-
                g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
              if (eflag) evdwl = f*expr*buckai[typej] -
                           g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
            }
          }
          else {                                              //table real space
          } else {                                              //table real space
            union_int_float_t disp_t;
            disp_t.f = rsq;
            const int disp_k = (disp_t.i & ndispmask)>>ndispshiftbits;
@@ -560,21 +562,18 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag)
            if (ni == 0) {
              force_buck = r*expr*buck1i[typej]-(fdisptable[disp_k]+f_disp*dfdisptable[disp_k])*buckci[typej];
              if (eflag) evdwl = expr*buckai[typej]-(edisptable[disp_k]+f_disp*dedisptable[disp_k])*buckci[typej];
            }
            else {                                             //speial case
            } else {                                             //special case
              double f = special_lj[ni], t = rn*(1.0-f);
              force_buck = f*r*expr*buck1i[typej] -(fdisptable[disp_k]+f_disp*dfdisptable[disp_k])*buckci[typej] +t*buck2i[typej];
              if (eflag) evdwl = f*expr*buckai[typej] -(edisptable[disp_k]+f_disp*dedisptable[disp_k])*buckci[typej]+t*buckci[typej];
            }
          }
        }
        else {                                                // cut
        } else {                                                // cut
          if (ni == 0) {
            force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
            if (eflag) evdwl = expr*buckai[typej] -
                         rn*buckci[typej]-offseti[typej];
          }
          else {                                        // special case
          } else {                                        // special case
            double f = special_lj[ni];
            force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
            if (eflag)
@@ -1018,7 +1017,7 @@ double PairBuckLongCoulLong::single(int i, int j, int itype, int jtype,
        g6*((a2+1.0)*a2+0.5)*x2+t*buck_c[itype][jtype];
    } else {                                                // cut
      force_buck =
        buck1[itype][jtype]*r*expr-factor_buck*buck_c[itype][jtype]*r6inv;
        factor_buck*(buck1[itype][jtype]*r*expr-buck2[itype][jtype]*r6inv);
      eng += buck_a[itype][jtype]*expr-
        factor_buck*(buck_c[itype][jtype]*r6inv-offset[itype][jtype]);
    }
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ void PairLJLongCoulLong::settings(int narg, char **arg)
    error->warning(FLERR,"Using largest cutoff for lj/long/coul/long");
  if (!*(++arg))
    error->all(FLERR,"Cutoffs missing in pair_style lj/long/coul/long");
  if (!((ewald_order^ewald_off) & (1<<6)))
    dispersionflag = 0;
  if (!((ewald_order^ewald_off) & (1<<1)))
    error->all(FLERR,
               "Coulomb cut not supported in pair_style lj/long/coul/long");
@@ -386,6 +388,7 @@ void PairLJLongCoulLong::write_restart_settings(FILE *fp)
  fwrite(&ncoultablebits,sizeof(int),1,fp);
  fwrite(&tabinner,sizeof(double),1,fp);
  fwrite(&ewald_order,sizeof(int),1,fp);
  fwrite(&dispersionflag,sizeof(int),1,fp);
}

/* ----------------------------------------------------------------------
@@ -402,6 +405,7 @@ void PairLJLongCoulLong::read_restart_settings(FILE *fp)
    utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error);
    utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error);
  }
  MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
@@ -410,6 +414,7 @@ void PairLJLongCoulLong::read_restart_settings(FILE *fp)
  MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world);
  MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&ewald_order,1,MPI_INT,0,world);
  MPI_Bcast(&dispersionflag,1,MPI_INT,0,world);
}

/* ----------------------------------------------------------------------
+5 −0
Original line number Diff line number Diff line
@@ -1440,6 +1440,8 @@ void PairLJLongTIP4PLong::settings(int narg, char **arg)
  if (!comm->me && ewald_order==((1<<1)|(1<<6)))
    error->warning(FLERR,
                   "Using largest cutoff for pair_style lj/long/tip4p/long");
  if (!((ewald_order^ewald_off) & (1<<6)))
    dispersionflag = 0;
  if (!((ewald_order^ewald_off)&(1<<1)))
    error->all(FLERR,
               "Coulomb cut not supported in pair_style lj/long/tip4p/long");
@@ -1532,6 +1534,7 @@ void PairLJLongTIP4PLong::write_restart_settings(FILE *fp)
  fwrite(&ncoultablebits,sizeof(int),1,fp);
  fwrite(&tabinner,sizeof(double),1,fp);
  fwrite(&ewald_order,sizeof(int),1,fp);
  fwrite(&dispersionflag,sizeof(int),1,fp);
}

/* ----------------------------------------------------------------------
@@ -1554,6 +1557,7 @@ void PairLJLongTIP4PLong::read_restart_settings(FILE *fp)
    utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error);
    utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error);
  }

  MPI_Bcast(&typeO,1,MPI_INT,0,world);
@@ -1569,6 +1573,7 @@ void PairLJLongTIP4PLong::read_restart_settings(FILE *fp)
  MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world);
  MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&ewald_order,1,MPI_INT,0,world);
  MPI_Bcast(&dispersionflag,1,MPI_INT,0,world);
}

/* ----------------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ void Image::draw_cylinder(double *x, double *y,
      double c = surface[0] * surface[0] + surface[1] * surface[1] - radsq;

      double partial = b*b - 4*a*c;
      if (partial < 0) continue;
      if ((partial < 0.0) || (a == 0.0)) continue;
      partial = sqrt (partial);

      double t = (-b + partial) / (2*a);
Loading