Prevent BPM bonds breaking during setup
This commit is contained in:
@ -28,6 +28,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "neighbor.h"
|
#include "neighbor.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -483,6 +484,7 @@ void BondBPMRotational::compute(int eflag, int vflag)
|
|||||||
int newton_bond = force->newton_bond;
|
int newton_bond = force->newton_bond;
|
||||||
|
|
||||||
double **bondstore = fix_bond_history->bondstore;
|
double **bondstore = fix_bond_history->bondstore;
|
||||||
|
const bool allow_breaks = (update->setupflag == 0) && break_flag;
|
||||||
|
|
||||||
for (n = 0; n < nbondlist; n++) {
|
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,
|
breaking = elastic_forces(i1, i2, type, r_mag, r0_mag, r_mag_inv, rhat, r, r0, force1on2,
|
||||||
torque1on2, torque2on1);
|
torque1on2, torque2on1);
|
||||||
|
|
||||||
if ((breaking >= 1.0) && break_flag) {
|
if ((breaking >= 1.0) && allow_breaks) {
|
||||||
bondlist[n][2] = 0;
|
bondlist[n][2] = 0;
|
||||||
process_broken(i1, i2);
|
process_broken(i1, i2);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "neighbor.h"
|
#include "neighbor.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -218,6 +219,7 @@ void BondBPMSpring::compute(int eflag, int vflag)
|
|||||||
double invdim = 1.0 / dim;
|
double invdim = 1.0 / dim;
|
||||||
|
|
||||||
double **bondstore = fix_bond_history->bondstore;
|
double **bondstore = fix_bond_history->bondstore;
|
||||||
|
const bool allow_breaks = (update->setupflag == 0) && break_flag;
|
||||||
|
|
||||||
for (n = 0; n < nbondlist; n++) {
|
for (n = 0; n < nbondlist; n++) {
|
||||||
|
|
||||||
@ -249,7 +251,7 @@ void BondBPMSpring::compute(int eflag, int vflag)
|
|||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
e = (r - r0) / r0;
|
e = (r - r0) / r0;
|
||||||
|
|
||||||
if ((fabs(e) > ecrit[type]) && break_flag) {
|
if ((fabs(e) > ecrit[type]) && allow_breaks) {
|
||||||
bondlist[n][2] = 0;
|
bondlist[n][2] = 0;
|
||||||
process_broken(i1, i2);
|
process_broken(i1, i2);
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "neighbor.h"
|
#include "neighbor.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -185,6 +186,7 @@ void BondBPMSpringPlastic::compute(int eflag, int vflag)
|
|||||||
int newton_bond = force->newton_bond;
|
int newton_bond = force->newton_bond;
|
||||||
|
|
||||||
double **bondstore = fix_bond_history->bondstore;
|
double **bondstore = fix_bond_history->bondstore;
|
||||||
|
const bool allow_breaks = (update->setupflag == 0) && break_flag;
|
||||||
|
|
||||||
for (n = 0; n < nbondlist; n++) {
|
for (n = 0; n < nbondlist; n++) {
|
||||||
|
|
||||||
@ -217,7 +219,7 @@ void BondBPMSpringPlastic::compute(int eflag, int vflag)
|
|||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
e = (r - r0) / r0;
|
e = (r - r0) / r0;
|
||||||
|
|
||||||
if ((fabs(e) > ecrit[type]) && break_flag) {
|
if ((fabs(e) > ecrit[type]) && allow_breaks) {
|
||||||
bondlist[n][2] = 0;
|
bondlist[n][2] = 0;
|
||||||
process_broken(i1, i2);
|
process_broken(i1, i2);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user