Initial version of lammps halfneighbor list

This commit is contained in:
Jan Eitzinger 2022-03-10 17:06:45 +01:00
parent ba3a0524f6
commit c2fcd50773
4 changed files with 4 additions and 3 deletions

View File

@ -132,7 +132,7 @@ double computeForceLJHalfNeigh(Parameter *param, Atom *atom, Neighbor *neighbor,
for(int i = 0; i < Nlocal; i++) { for(int i = 0; i < Nlocal; i++) {
neighs = &neighbor->neighbors[i * neighbor->maxneighs]; neighs = &neighbor->neighbors[i * neighbor->maxneighs];
int numneighs = neighbor.numneigh[i]; int numneighs = neighbor->numneigh[i];
MD_FLOAT xtmp = atom_x(i); MD_FLOAT xtmp = atom_x(i);
MD_FLOAT ytmp = atom_y(i); MD_FLOAT ytmp = atom_y(i);
MD_FLOAT ztmp = atom_z(i); MD_FLOAT ztmp = atom_z(i);

View File

@ -31,6 +31,7 @@ typedef struct {
int* neighbors; int* neighbors;
int maxneighs; int maxneighs;
int* numneigh; int* numneigh;
int halfneigh;
} Neighbor; } Neighbor;
extern void initNeighbor(Neighbor*, Parameter*); extern void initNeighbor(Neighbor*, Parameter*);

View File

@ -72,7 +72,7 @@ void init(Parameter *param)
param->dtforce = 0.5 * param->dt; param->dtforce = 0.5 * param->dt;
param->every = 20; param->every = 20;
param->proc_freq = 2.4; param->proc_freq = 2.4;
param->halfneigh = 0; param->halfneigh = 1;
} }
double setup( double setup(

View File

@ -232,7 +232,7 @@ void buildNeighbor(Atom *atom, Neighbor *neighbor)
for(int m = 0; m < bincount[jbin]; m++) { for(int m = 0; m < bincount[jbin]; m++) {
int j = loc_bin[m]; int j = loc_bin[m];
if ( j == i ){ if ( (j == i) || (neighbor->halfneigh && (j < i))) {
continue; continue;
} }