add write_data() support to remaining improper styles.

with this commit, write_data() support should be complete.
This commit is contained in:
Axel Kohlmeyer 2018-04-26 16:39:31 -04:00
parent c7edc6636a
commit 64b08d3ca8
8 changed files with 44 additions and 1 deletions

View File

@ -312,3 +312,13 @@ void ImproperCossq::read_restart(FILE *fp)
for (int i = 1; i <= atom->nimpropertypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperCossq::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],chi[i]/MY_PI*180.0);
}

View File

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

View File

@ -223,7 +223,6 @@ void ImproperDistance::coeff(int narg, char **arg)
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
//chi[i] = chi_one/180.0 * PI;
chi[i] = chi_one;
setflag[i] = 1;
count++;
@ -259,3 +258,13 @@ void ImproperDistance::read_restart(FILE *fp)
for (int i = 1; i <= atom->nimpropertypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperDistance::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],chi[i]);
}

View File

@ -33,6 +33,7 @@ class ImproperDistance : public Improper {
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
void write_data(FILE *);
private:
double *k,*chi;

View File

@ -343,3 +343,13 @@ void ImproperFourier::read_restart(FILE *fp)
for (int i = 1; i <= atom->nimpropertypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperFourier::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g %g %g %d\n",i,k[i],C0[i],C1[i],C2[i],all[i]);
}

View File

@ -33,6 +33,7 @@ class ImproperFourier : public Improper {
void coeff(int, char **);
void write_restart(FILE *);
void read_restart(FILE *);
void write_data(FILE *);
protected:
double *k, *C0, *C1, *C2;

View File

@ -337,3 +337,13 @@ void ImproperRing::read_restart(FILE *fp)
for (int i = 1; i <= atom->nimpropertypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperRing::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],acos(chi[i])/MY_PI*180.0);
}

View File

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