diff --git a/src/BPM/bond_bpm_rotational.cpp b/src/BPM/bond_bpm_rotational.cpp index 1abe3218c7..b1e6163d97 100644 --- a/src/BPM/bond_bpm_rotational.cpp +++ b/src/BPM/bond_bpm_rotational.cpp @@ -28,6 +28,7 @@ #include "memory.h" #include "modify.h" #include "neighbor.h" +#include "update.h" #include #include @@ -483,6 +484,7 @@ void BondBPMRotational::compute(int eflag, int vflag) int newton_bond = force->newton_bond; double **bondstore = fix_bond_history->bondstore; + const bool allow_breaks = (update->setupflag == 0) && break_flag; for (n = 0; n < nbondlist; n++) { @@ -527,7 +529,7 @@ void BondBPMRotational::compute(int eflag, int vflag) breaking = elastic_forces(i1, i2, type, r_mag, r0_mag, r_mag_inv, rhat, r, r0, force1on2, torque1on2, torque2on1); - if ((breaking >= 1.0) && break_flag) { + if ((breaking >= 1.0) && allow_breaks) { bondlist[n][2] = 0; process_broken(i1, i2); continue; diff --git a/src/BPM/bond_bpm_spring.cpp b/src/BPM/bond_bpm_spring.cpp index 873b5010b4..a5c31ea1b2 100644 --- a/src/BPM/bond_bpm_spring.cpp +++ b/src/BPM/bond_bpm_spring.cpp @@ -26,6 +26,7 @@ #include "memory.h" #include "modify.h" #include "neighbor.h" +#include "update.h" #include #include @@ -218,6 +219,7 @@ void BondBPMSpring::compute(int eflag, int vflag) double invdim = 1.0 / dim; double **bondstore = fix_bond_history->bondstore; + const bool allow_breaks = (update->setupflag == 0) && break_flag; for (n = 0; n < nbondlist; n++) { @@ -249,7 +251,7 @@ void BondBPMSpring::compute(int eflag, int vflag) r = sqrt(rsq); e = (r - r0) / r0; - if ((fabs(e) > ecrit[type]) && break_flag) { + if ((fabs(e) > ecrit[type]) && allow_breaks) { bondlist[n][2] = 0; process_broken(i1, i2); diff --git a/src/BPM/bond_bpm_spring_plastic.cpp b/src/BPM/bond_bpm_spring_plastic.cpp index 7059449f3b..21ef0f12fb 100644 --- a/src/BPM/bond_bpm_spring_plastic.cpp +++ b/src/BPM/bond_bpm_spring_plastic.cpp @@ -26,6 +26,7 @@ #include "force.h" #include "memory.h" #include "neighbor.h" +#include "update.h" #include #include @@ -185,6 +186,7 @@ void BondBPMSpringPlastic::compute(int eflag, int vflag) int newton_bond = force->newton_bond; double **bondstore = fix_bond_history->bondstore; + const bool allow_breaks = (update->setupflag == 0) && break_flag; for (n = 0; n < nbondlist; n++) { @@ -217,7 +219,7 @@ void BondBPMSpringPlastic::compute(int eflag, int vflag) r = sqrt(rsq); e = (r - r0) / r0; - if ((fabs(e) > ecrit[type]) && break_flag) { + if ((fabs(e) > ecrit[type]) && allow_breaks) { bondlist[n][2] = 0; process_broken(i1, i2); continue;