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

Merge pull request #2273 from abhiShandy/pair-tests-aug4

Bunch of units tests for pair-style, angle-style, bond-style
parents 787d7d28 f895904d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ between two point particles, where (:math:`\sigma, -\epsilon`) is the
location of the (rightmost) minimum of the potential, as explained in
the syntax section above.

This potential was first used in (Cooke)_#CKD for a coarse-grained lipid
This potential was first used in :ref:`(Cooke) <CKD>` for a coarse-grained lipid
membrane model.  It is generally very useful as a non-specific
interaction potential because it is fully adjustable in depth and width
while joining the minimum at (sigma, -epsilon) and zero at (cutoff, 0)
@@ -63,7 +63,7 @@ energy calculations etc. This evidently requires *cutoff* to be larger
than *sigma*\ .

If the *wca* option is used then a Weeks-Chandler-Andersen potential
(Weeks)_#WCA is added to the above specified cosine-squared potential,
:ref:`(Weeks) <WCA>` is added to the above specified cosine-squared potential,
specifically the following:

.. math::
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ Examples
   pair_coeff * * 1.0 1.0
   pair_coeff 1 1 1.1 2.8 3.0 3.2

   pair_style buck 2.5 3.0
   pair_style buck/mdf 2.5 3.0
   pair_coeff * * 100.0 1.5 200.0
   pair_coeff * * 100.0 1.5 200.0 3.0 3.5

+6 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ void PairBuckMDF::write_restart(FILE *fp)
        fwrite(&rho[i][j],sizeof(double),1,fp);
        fwrite(&c[i][j],sizeof(double),1,fp);
        fwrite(&cut[i][j],sizeof(double),1,fp);
        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
      }
    }
}
@@ -311,11 +312,13 @@ void PairBuckMDF::read_restart(FILE *fp)
          utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error);
          utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error);
          utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error);
          utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error);
        }
        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
      }
    }
}
@@ -327,6 +330,7 @@ void PairBuckMDF::read_restart(FILE *fp)
void PairBuckMDF::write_restart_settings(FILE *fp)
{
  fwrite(&cut_global,sizeof(double),1,fp);
  fwrite(&cut_inner_global,sizeof(double),1,fp);
  fwrite(&offset_flag,sizeof(int),1,fp);
  fwrite(&mix_flag,sizeof(int),1,fp);
  fwrite(&tail_flag,sizeof(int),1,fp);
@@ -340,11 +344,13 @@ void PairBuckMDF::read_restart_settings(FILE *fp)
{
  if (comm->me == 0) {
    utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error);
    utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error);
    utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error);
    utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error);
  }
  MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world);
  MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
  MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
  MPI_Bcast(&tail_flag,1,MPI_INT,0,world);
+4 −4
Original line number Diff line number Diff line
@@ -323,8 +323,8 @@ void PairCosineSquared::read_restart_settings(FILE *fp)
void PairCosineSquared::write_data(FILE *fp)
{
  for (int i = 1; i <= atom->ntypes; i++)
    fprintf(fp, "%d %g %g %g %d\n", i, epsilon[i][i], sigma[i][i],
            cut[i][i], wcaflag[i][i]);
    fprintf(fp, "%d %g %g %g %s\n", i, epsilon[i][i], sigma[i][i], cut[i][i],
            (wcaflag[i][i] ? "wca" : ""));
}

/* ----------------------------------------------------------------------
@@ -335,8 +335,8 @@ void PairCosineSquared::write_data_all(FILE *fp)
{
  for (int i = 1; i <= atom->ntypes; i++)
    for (int j = i; j <= atom->ntypes; j++)
      fprintf(fp, "%d %d %g %g %g %d\n", i, j, epsilon[i][j], sigma[i][j],
              cut[i][j], wcaflag[i][j]);
      fprintf(fp, "%d %d %g %g %g %s\n", i, j, epsilon[i][j], sigma[i][j],
              cut[i][j], (wcaflag[i][j] ? "wca" : ""));
}

/* ---------------------------------------------------------------------- */
+2 −2
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ void EwaldOMP::compute(int eflag, int vflag)
      const double fac = qscale*q[i];
      f[i][0] += fac*ek[i][0];
      f[i][1] += fac*ek[i][1];
      f[i][2] += fac*ek[i][2];
      if (slabflag != 2) f[i][2] += fac*ek[i][2];
    }

    // global energy
@@ -222,7 +222,7 @@ void EwaldOMP::compute(int eflag, int vflag)
    virial[5] = v5 * qscale;
  }

  if (slabflag) slabcorr();
  if (slabflag == 1) slabcorr();
}

/* ---------------------------------------------------------------------- */
Loading