Commit 64b08d3c authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add write_data() support to remaining improper styles.

with this commit, write_data() support should be complete.
parent c7edc663
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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);
}
+1 −0
Original line number Diff line number Diff line
@@ -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;
+10 −1
Original line number Diff line number Diff line
@@ -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]);
}
+1 −0
Original line number Diff line number Diff line
@@ -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;
+10 −0
Original line number Diff line number Diff line
@@ -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]);
}
Loading