diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index 9eec204523..c0f75dfdf6 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -195,6 +195,16 @@ void BondClass2::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondClass2::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g %g %g\n",i,r0[i],k2[i],k3[i],k4[i]); +} + /* ---------------------------------------------------------------------- */ double BondClass2::single(int type, double rsq, int i, int j, double &fforce) diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h index 6a92f1e226..53dfde5e63 100644 --- a/src/CLASS2/bond_class2.h +++ b/src/CLASS2/bond_class2.h @@ -34,6 +34,7 @@ class BondClass2 : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index 61efe5908c..4dc4f59708 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -29,7 +29,6 @@ using namespace LAMMPS_NS; BondFENE::BondFENE(LAMMPS *lmp) : Bond(lmp) { - writedata = 1; TWO_1_3 = pow(2.0,(1.0/3.0)); } diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index dc9bfa9763..4783e79876 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -240,6 +240,16 @@ void BondFENEExpand::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondFENEExpand::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g %g %g %g\n",i,k[i],r0[i],epsilon[i],sigma[i],shift[i]); +} + /* ---------------------------------------------------------------------- */ double BondFENEExpand::single(int type, double rsq, int i, int j, diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h index 9177f415c4..d25b0edfb0 100644 --- a/src/MOLECULE/bond_fene_expand.h +++ b/src/MOLECULE/bond_fene_expand.h @@ -35,6 +35,7 @@ class BondFENEExpand : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index 1de76d90b9..2eb85fa5d1 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -174,6 +174,16 @@ void BondHarmonic::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondHarmonic::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g\n",i,k[i],r0[i]); +} + /* ---------------------------------------------------------------------- */ double BondHarmonic::single(int type, double rsq, int i, int j, diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h index 173ca5edbc..b996161b2f 100644 --- a/src/MOLECULE/bond_harmonic.h +++ b/src/MOLECULE/bond_harmonic.h @@ -34,6 +34,7 @@ class BondHarmonic : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index d1e8ffe02d..883f4f2f09 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -184,6 +184,16 @@ void BondMorse::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondMorse::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g %g\n",i,d0[i],alpha[i],r0[i]); +} + /* ---------------------------------------------------------------------- */ double BondMorse::single(int type, double rsq, int i, int j, diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h index 8e24480eef..78329220ca 100644 --- a/src/MOLECULE/bond_morse.h +++ b/src/MOLECULE/bond_morse.h @@ -34,6 +34,7 @@ class BondMorse : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index b2c689fd5f..a3f4520c8d 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -179,6 +179,16 @@ void BondNonlinear::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondNonlinear::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g %g\n",i,epsilon[i],r0[i],lamda[i]); +} + /* ---------------------------------------------------------------------- */ double BondNonlinear::single(int type, double rsq, int i, int j, diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h index 0c8a99fc5b..447f7fee28 100644 --- a/src/MOLECULE/bond_nonlinear.h +++ b/src/MOLECULE/bond_nonlinear.h @@ -34,6 +34,7 @@ class BondNonlinear : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index 78e97d986b..e69ef5e6f2 100755 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -293,6 +293,15 @@ void BondQuartic::read_restart(FILE *fp) for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondQuartic::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp,"%d %g %g %g %g %g\n",i,k[i],b1[i],b2[i],rc[i],u0[i]); +} /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h index 1507b4cf98..ce478124e2 100644 --- a/src/MOLECULE/bond_quartic.h +++ b/src/MOLECULE/bond_quartic.h @@ -35,6 +35,7 @@ class BondQuartic : public Bond { double equilibrium_distance(int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); double single(int, double, int, int, double &); protected: diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index b5e7a6a8d3..0a61969106 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -37,6 +37,7 @@ enum{LINEAR,SPLINE}; BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) { + writedata = 0; ntables = 0; tables = NULL; } diff --git a/src/bond.cpp b/src/bond.cpp index 8889f4e78d..b375b6229b 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; Bond::Bond(LAMMPS *lmp) : Pointers(lmp) { energy = 0.0; - writedata = 0; + writedata = 1; allocated = 0; suffix_flag = Suffix::NONE; diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index 8a73a0e9d3..4545008611 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -31,6 +31,7 @@ using namespace LAMMPS_NS; BondHybrid::BondHybrid(LAMMPS *lmp) : Bond(lmp) { + writedata = 0; nstyles = 0; }