add write_data support for class2 impropers

This commit is contained in:
Axel Kohlmeyer
2013-07-12 13:39:40 +02:00
parent 45fa3a0ebd
commit 0e986deb50
2 changed files with 21 additions and 1 deletions

View File

@ -36,7 +36,10 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp) {}
ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp)
{
writedata = 1;
}
/* ---------------------------------------------------------------------- */
@ -835,3 +838,19 @@ double ImproperClass2::dot(double *a, double *b)
{
return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperClass2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g\n",i,k0[i],chi0[i]);
fprintf(fp,"\nAngleAngle Coeffs\n\n");
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g %g %g %g %g\n",i,aa_k1[i],aa_k2[i],aa_k3[i],
aa_theta0_1[i]*180.0/MY_PI,aa_theta0_2[i]*180.0/MY_PI,
aa_theta0_3[i]*180.0/MY_PI);
}

View File

@ -33,6 +33,7 @@ class ImproperClass2 : public Improper {
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
void write_data(FILE *);
protected:
double *k0,*chi0;