Commit a849f35d authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

adjust compute cnp/atom to match the documentation. need to skip atoms not in compute group.

parent 2b3c124e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ around an atom and can be used to characterize whether the
atom is part of a perfect lattice, a local defect (e.g. a dislocation
or stacking fault), or at a surface.

The value of the CNP parameter will be 0.0 for atoms not
in the specified compute group.  Note that normally a CNP calculation should only be
performed on mono-component systems.
The value of the CNP parameter will be 0.0 for atoms not in the
specified compute group.  Note that normally a CNP calculation should
only be performed on single component systems.

This parameter is computed using the following formula from
"(Tsuzuki)"_#Tsuzuki2
+14 −10
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void ComputeCNPAtom::compute_peratom()
  int i,j,k,ii,jj,kk,m,n,inum,jnum,inear,jnear;
  int firstflag,ncommon;
  int *ilist,*jlist,*numneigh,**firstneigh;
  int cnp[MAXNEAR][4],onenearest[MAXNEAR];
  int onenearest[MAXNEAR];
  int common[MAXCOMMON];
  double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
  double xjtmp,yjtmp,zjtmp,rjkx,rjky,rjkz;
@@ -206,6 +206,10 @@ void ComputeCNPAtom::compute_peratom()
    // reset cnpv
    cnpv[i] = 0.0;

    // skip computation of cnpv for atoms outside the compute group

    if (!(mask[i] & groupbit)) continue;

    // loop over nearest neighbors of I to build cnp data structure
    //  cnp[k][NCOMMON] = # of common neighbors of I with each of its neighbors
    for (m = 0; m < nnearest[i]; m++) {