Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,10 @@ using namespace MathConst; ...@@ -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) ...@@ -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");
}
}
...@@ -33,6 +33,7 @@ class DihedralFourier : public Dihedral { ...@@ -33,6 +33,7 @@ class DihedralFourier : public Dihedral {
void coeff(int, char **); void coeff(int, char **);
void write_restart(FILE *); void write_restart(FILE *);
void read_restart(FILE *); void read_restart(FILE *);
void write_data(FILE *);
protected: protected:
double **k,**cos_shift,**sin_shift,**shift; double **k,**cos_shift,**sin_shift,**shift;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment