From afaf992ac2cb9e1bc2a92f21278a9a6c7a281aa1 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 21 May 2021 11:06:34 -0600 Subject: [PATCH] Second working of bits for neigh/history --- src/MISC/pair_tracker.cpp | 1 + src/fix_neigh_history.cpp | 19 +++++++++++++------ src/fix_neigh_history.h | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/MISC/pair_tracker.cpp b/src/MISC/pair_tracker.cpp index 7a7bb57f21..e3fd64d0d6 100644 --- a/src/MISC/pair_tracker.cpp +++ b/src/MISC/pair_tracker.cpp @@ -290,6 +290,7 @@ void PairTracker::init_style() int ifix = modify->find_fix("NEIGH_HISTORY_TRACK"); fix_history = (FixNeighHistory *) modify->fix[ifix]; fix_history->pair = this; + fix_history->use_bit_flag = 0; } if (finitecutflag) { diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index e0c49e7caa..2fad4ad200 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -44,6 +44,7 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : create_attribute = 1; maxexchange_dynamic = 1; + use_bit_flag = 1; newton_pair = force->newton_pair; @@ -623,15 +624,21 @@ void FixNeighHistory::post_neighbor() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; - rflag = sbmask(j) | pair->beyond_contact | (!pair->finitecutflag); - j &= NEIGHMASK; - jlist[jj] = j; + + if (use_bit_flag) { + rflag = sbmask(j) | pair->beyond_contact; + j &= NEIGHMASK; + jlist[jj] = j; + } else { + rflag = 1; + j &= NEIGHMASK; + } - // rflag = 1 if r < radsum in npair_size() method + // rflag = 1 if r < radsum in npair_size() method or if pair interactions extend further // preserve neigh history info if tag[j] is in old-neigh partner list // this test could be more geometrically precise for two sphere/line/tri - // for pair styles with interactions not set by finite sizes, always record data since - // npair classes do not apply a mask for history (those bits are used for special bonds) + // if use_bit_flag is turned off, always record data since not all npair classes + // apply a mask for history (and they could use the bits for special bonds) if (rflag) { jtag = tag[j]; diff --git a/src/fix_neigh_history.h b/src/fix_neigh_history.h index 57391cfa9a..f6dee02cb5 100644 --- a/src/fix_neigh_history.h +++ b/src/fix_neigh_history.h @@ -28,6 +28,7 @@ class FixNeighHistory : public Fix { public: int nlocal_neigh; // nlocal at last time neigh list was built int nall_neigh; // ditto for nlocal+nghost + int use_bit_flag; // flag whether fix neigh history uses extra bit in neighborlist int **firstflag; // ptr to each atom's neighbor flsg double **firstvalue; // ptr to each atom's values class Pair *pair; // ptr to pair style that uses neighbor history