Second working of bits for neigh/history

This commit is contained in:
jtclemm
2021-05-21 11:06:34 -06:00
parent 83a15ef03f
commit afaf992ac2
3 changed files with 15 additions and 6 deletions

View File

@ -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) {

View File

@ -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];

View File

@ -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