git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10525 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2013-08-02 15:06:58 +00:00
parent 7b1a0c4b1f
commit 76878bf97f
2 changed files with 17 additions and 2 deletions

View File

@ -35,7 +35,10 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
DihedralOPLS::DihedralOPLS(LAMMPS *lmp) : Dihedral(lmp) {} DihedralOPLS::DihedralOPLS(LAMMPS *lmp) : Dihedral(lmp)
{
writedata = 1;
}
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -339,3 +342,14 @@ void DihedralOPLS::read_restart(FILE *fp)
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1; for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
} }
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void DihedralOPLS::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %g %g %g\n",i,2.0*k1[i],2.0*k2[i],2.0*k3[i],2.0*k4[i]);
}

View File

@ -1,4 +1,4 @@
/* ---------------------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
@ -33,6 +33,7 @@ class DihedralOPLS : 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 *k1,*k2,*k3,*k4; double *k1,*k2,*k3,*k4;