Commit 8214555b authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #244 from ketankhare/patch-2

Enable write_data for dihedral style fourier
parents f48b71f4 7f3f5e8c
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -38,7 +38,10 @@ using namespace MathConst;

/* ---------------------------------------------------------------------- */

DihedralFourier::DihedralFourier(LAMMPS *lmp) : Dihedral(lmp) {}
DihedralFourier::DihedralFourier(LAMMPS *lmp) : Dihedral(lmp) 
{
   writedata = 1;
}

/* ---------------------------------------------------------------------- */

@@ -401,3 +404,18 @@ void DihedralFourier::read_restart(FILE *fp)
  }
}

/* ----------------------------------------------------------------------
   proc 0 writes to data file
------------------------------------------------------------------------- */

void DihedralFourier::write_data(FILE *fp)
{
  for (int i = 1; i <= atom->ndihedraltypes; i++)
  {
    fprintf(fp,"%d %d",i,nterms[i]);
    for(int j = 0; j < nterms[i]; j++)
       fprintf(fp," %g %d %g",k[i][j],multiplicity[i][j],shift[i][j]);
    fprintf(fp,"\n");
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ class DihedralFourier : public Dihedral {
  void coeff(int, char **);
  void write_restart(FILE *);
  void read_restart(FILE *);
  void write_data(FILE *);

 protected:
  double **k,**cos_shift,**sin_shift,**shift;