Fixed a bug in neighbor.cpp to make special_flag consistent between amoeba and hippo (to be 2 instead of 0), that caused missing neighbors with hippo

This commit is contained in:
Trung Nguyen
2021-09-27 16:12:49 -05:00
parent c6148938e5
commit d27836952a
4 changed files with 7 additions and 46 deletions

View File

@ -430,8 +430,8 @@ int** HippoT::compute_multipole_real(const int ago, const int inum_full,
// leave the answers (forces, energies and virial) on the device,
// only copy them back in the last kernel (this one, or polar_real once done)
this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks);
this->device->add_ans_object(this->ans);
//this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks);
//this->device->add_ans_object(this->ans);
this->hd_balancer.stop_timer();

View File

@ -242,47 +242,6 @@ void PairAmoeba::compute(int eflag, int vflag)
time_induce = time_polar = time_qxfer = 0.0;
}
{ // DEBUGGING
double **x = atom->x;
int inum,jnum;
int *ilist,*jlist,*numneigh,**firstneigh;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
if (use_ewald) choose(MPOLE_LONG);
else choose(MPOLE);
int i,ii,j,jj;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
double xi = x[i][0];
double yi = x[i][1];
double zi = x[i][2];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
double factor_mpole = special_mpole[sbmask15(j)];
j &= NEIGHMASK15;
double xr = x[j][0] - xi;
double yr = x[j][1] - yi;
double zr = x[j][2] - zi;
double r2 = xr*xr + yr*yr + zr*zr;
//if (r2 > off2) continue;
double r = sqrt(r2);
if (i == 0) printf("j = %d: tag = %d; r = %f; factor_mpole = %f\n", j, r, atom->tag[j], factor_mpole);
}
}
} // DEBUGGING
double evdwl;
evdwl = 0.0;
@ -1014,8 +973,8 @@ void PairAmoeba::init_style()
int irequest = neighbor->request(this,instance_me);
// for DEBUGGING with GPU
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
//neighbor->requests[irequest]->half = 0;
//neighbor->requests[irequest]->full = 1;
// open debug output files
// names are hard-coded

View File

@ -138,7 +138,7 @@ PairHippoGPU::PairHippoGPU(LAMMPS *lmp) : PairAmoeba(lmp), gpu_mode(GPU_FORCE)
gpu_multipole_real_ready = true;
gpu_udirect2b_ready = false;
gpu_umutual2b_ready = false;
gpu_polar_real_ready = false;
gpu_polar_real_ready = true;
GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
}

View File

@ -527,6 +527,7 @@ void Neighbor::init()
int flag=0;
for (int isub=0; isub < ph->nstyles; ++isub) {
if (force->pair_match("amoeba",0,isub)
|| force->pair_match("hippo",0,isub)
|| force->pair_match("coul/wolf",0,isub)
|| force->pair_match("coul/dsf",0,isub)
|| force->pair_match("coul/exclude",0)
@ -537,6 +538,7 @@ void Neighbor::init()
special_flag[1] = special_flag[2] = special_flag[3] = 2;
} else {
if (force->pair_match("amoeba",0)
|| force->pair_match("hippo",0)
|| force->pair_match("coul/wolf",0)
|| force->pair_match("coul/dsf",0)
|| force->pair_match("coul/exclude",0)