@ -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) <Wang2009>` and
|
||||
:ref:`(Wang and Mora) <Wang2009b>`.
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user