diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index 15a4b0a61e..074c8bf15c 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -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; } + +/* ---------------------------------------------------------------------- + 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]); +} + diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h index 500a5927a1..238a67cf3c 100644 --- a/src/MOLECULE/dihedral_opls.h +++ b/src/MOLECULE/dihedral_opls.h @@ -1,4 +1,4 @@ -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov @@ -33,6 +33,7 @@ class DihedralOPLS : public Dihedral { void coeff(int, char **); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); protected: double *k1,*k2,*k3,*k4;