diff --git a/doc/src/bond_bpm_rotational.rst b/doc/src/bond_bpm_rotational.rst index fb1db04b27..d9d0f160fb 100644 --- a/doc/src/bond_bpm_rotational.rst +++ b/doc/src/bond_bpm_rotational.rst @@ -69,7 +69,7 @@ which is proportional to the tangential shear displacement with a stiffness of :math:`k_s`. This tangential force also induces a torque. In addition, bending and twisting torques are also applied to particles which are proportional to angular bending and twisting -displacements with stiffnesses of :math`k_b` and :math:`k_t', +displacements with stiffnesses of :math:`k_b` and :math:`k_t`, respectively. Details on the calculations of shear displacements and angular displacements can be found in :ref:`(Wang) ` and :ref:`(Wang and Mora) `. diff --git a/src/fix_bond_history.cpp b/src/fix_bond_history.cpp index a2da9f8b6e..cae9dc744d 100644 --- a/src/fix_bond_history.cpp +++ b/src/fix_bond_history.cpp @@ -264,6 +264,9 @@ void FixBondHistory::write_restart(FILE *fp) double list[1]; list[n++] = stored_flag; + // Update stored values if needed + pre_exchange(); + if (comm->me == 0) { int size = n * sizeof(double); fwrite(&size, sizeof(int), 1, fp); diff --git a/src/fix_update_special_bonds.cpp b/src/fix_update_special_bonds.cpp index 46e7eac699..1c2f91f06b 100644 --- a/src/fix_update_special_bonds.cpp +++ b/src/fix_update_special_bonds.cpp @@ -15,6 +15,7 @@ #include "atom.h" #include "atom_vec.h" +#include "comm.h" #include "error.h" #include "force.h" #include "modify.h" @@ -34,6 +35,8 @@ FixUpdateSpecialBonds::FixUpdateSpecialBonds(LAMMPS *lmp, int narg, char **arg) Fix(lmp, narg, arg) { if (narg != 3) error->all(FLERR, "Illegal fix update/special/bonds command"); + + restart_global = 1; } /* ---------------------------------------------------------------------- */ @@ -69,12 +72,6 @@ void FixUpdateSpecialBonds::setup(int /*vflag*/) force->special_coul[3] != 1.0) error->all(FLERR, "Fix update/special/bonds requires special Coulomb weights = 1,1,1"); // Implies neighbor->special_flag = [X, 2, 1, 1] - - new_broken_pairs.clear(); - broken_pairs.clear(); - - new_created_pairs.clear(); - created_pairs.clear(); } /* ---------------------------------------------------------------------- @@ -246,3 +243,18 @@ void FixUpdateSpecialBonds::add_created_bond(int i, int j) new_created_pairs.push_back(tag_pair); created_pairs.push_back(tag_pair); } + +/* ---------------------------------------------------------------------- + Use write_restart to invoke pre_exchange +------------------------------------------------------------------------- */ + +void FixUpdateSpecialBonds::write_restart(FILE *fp) +{ + // Call pre-exchange to process any broken/created bonds + + pre_exchange(); + if (comm->me == 0) { + int size = 0; + fwrite(&size,sizeof(int),1,fp); + } +} diff --git a/src/fix_update_special_bonds.h b/src/fix_update_special_bonds.h index b211cbec64..30d0faeb4b 100644 --- a/src/fix_update_special_bonds.h +++ b/src/fix_update_special_bonds.h @@ -35,6 +35,7 @@ class FixUpdateSpecialBonds : public Fix { void pre_force(int) override; void add_broken_bond(int, int); void add_created_bond(int, int); + void write_restart(FILE *) override; protected: // Create two arrays to store bonds broken this timestep (new)