Updated compute hexorder/atom, added compute orientorder/atom

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14253 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
athomps 2015-11-16 22:37:40 +00:00
parent 9dc8102ac4
commit c28bd3c3ff
2 changed files with 13 additions and 14 deletions

View File

@ -140,7 +140,7 @@ void ComputeHexOrderAtom::init_list(int id, NeighList *ptr)
void ComputeHexOrderAtom::compute_peratom()
{
int i,j,m,ii,jj,inum,jnum;
int i,j,ii,jj,inum,jnum;
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *ilist,*jlist,*numneigh,**firstneigh;
@ -264,7 +264,6 @@ inline void ComputeHexOrderAtom::calc_qn_trig(double delx, double dely, double &
if(dely > 0.0) ntheta = nnn * MY_PI / 2.0;
else ntheta = nnn * 3.0 * MY_PI / 2.0;
} else ntheta = nnn * atan(dely / delx);
ntheta = nnn * atan(dely / delx);
u = cos(ntheta);
v = sin(ntheta);
}

View File

@ -172,7 +172,7 @@ void ComputeOrientOrderAtom::init_list(int id, NeighList *ptr)
void ComputeOrientOrderAtom::compute_peratom()
{
int i,j,m,ii,jj,inum,jnum;
int i,j,ii,jj,inum,jnum;
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *ilist,*jlist,*numneigh,**firstneigh;
@ -260,8 +260,14 @@ void ComputeOrientOrderAtom::compute_peratom()
if (nnn > 0) {
select3(nnn,ncount,distsq,nearest,rlist);
calc_boop(rlist, nnn, qn, qlist, nqlist);
} else
calc_boop(rlist, ncount, qn, qlist, nqlist);
} else { // nnn == 0
if (ncount > 0)
calc_boop(rlist, ncount, qn, qlist, nqlist);
else { // ncount == 0
for (int iw = 0; iw < nqlist; iw++)
qn[iw] = 0.0;
}
}
}
}
}
@ -376,14 +382,8 @@ void ComputeOrientOrderAtom::select3(int k, int n, double *arr, int *iarr, doubl
------------------------------------------------------------------------- */
void ComputeOrientOrderAtom::calc_boop(double **rlist,
int numNeighbors, double qn[],
int ncount, double qn[],
int qlist[], int nqlist) {
// DONE: Need to make this memory allocation dynamic,
// DONE: Add error handling
// DONE: Add to memory usage
// DONE: Add options for different nnn and qlist
for (int iw = 0; iw < nqlist; iw++) {
int n = qlist[iw];
@ -394,7 +394,7 @@ void ComputeOrientOrderAtom::calc_boop(double **rlist,
}
}
for(int ineigh = 0; ineigh < numNeighbors; ineigh++) {
for(int ineigh = 0; ineigh < ncount; ineigh++) {
const double * const r = rlist[ineigh];
double rmag = dist(r);
if(rmag <= MY_EPSILON) {
@ -442,7 +442,7 @@ void ComputeOrientOrderAtom::calc_boop(double **rlist,
}
}
double fac = sqrt(MY_4PI) / numNeighbors;
double fac = sqrt(MY_4PI) / ncount;
for (int iw = 0; iw < nqlist; iw++) {
int n = qlist[iw];
double qm_sum = 0.0;