Commit 83da5d3b authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #323 from akohlmey/pppm-cg-triclinic

synchronize pppm/cg with changes in pppm and remove block on triclinic
parents ebbf60b1 634eb357
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -54,8 +54,6 @@ PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg),
  if ((narg < 1) || (narg > 2))
    error->all(FLERR,"Illegal kspace_style pppm/cg command");

  triclinic_support = 0;

  if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1]));
  else smallq = SMALLQ;

@@ -91,6 +89,17 @@ void PPPMCG::compute(int eflag, int vflag)
    cg_peratom->setup();
  }

  // if atom count has changed, update qsum and qsqsum

  if (atom->natoms != natoms_original) {
    qsum_qsq();
    natoms_original = atom->natoms;
  }

  // return if there are no charges

  if (qsqsum == 0.0) return;

  // convert atoms from box to lamda coords

  if (triclinic == 0) boxlo = domain->boxlo;
@@ -207,13 +216,6 @@ void PPPMCG::compute(int eflag, int vflag)

  if (evflag_atom) fieldforce_peratom();

  // update qsum and qsqsum, if atom count has changed and energy needed

  if ((eflag_global || eflag_atom) && atom->natoms != natoms_original) {
    qsum_qsq();
    natoms_original = atom->natoms;
  }

  // sum global energy across procs and add in volume-dependent term

  const double qscale = qqrd2e * scale;