forked from lijiext/lammps
fix division by zero issue in pair style bop
This commit is contained in:
parent
9e8ce240a0
commit
98e2e34a36
|
@ -5183,12 +5183,14 @@ void _noopt PairBOP::read_table(char *filename)
|
||||||
if(rcut3[i]>rcutall)
|
if(rcut3[i]>rcutall)
|
||||||
rcutall=rcut3[i];
|
rcutall=rcut3[i];
|
||||||
rcutsq[i]=rcut[i]*rcut[i];
|
rcutsq[i]=rcut[i]*rcut[i];
|
||||||
rcutsq3[i]=rcut3[i]*rcut3[i];
|
|
||||||
dr[i]=rcut[i]/((double)nr-1.0);
|
dr[i]=rcut[i]/((double)nr-1.0);
|
||||||
rdr[i]=1.0/dr[i];
|
rdr[i]=1.0/dr[i];
|
||||||
|
if (nws==3) {
|
||||||
|
rcutsq3[i]=rcut3[i]*rcut3[i];
|
||||||
dr3[i]=rcut3[i]/((double)nr-1.0);
|
dr3[i]=rcut3[i]/((double)nr-1.0);
|
||||||
rdr3[i]=1.0/dr3[i];
|
rdr3[i]=1.0/dr3[i];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rctroot=rcutall;
|
rctroot=rcutall;
|
||||||
dtheta=2.0/((double)ntheta-1.0);
|
dtheta=2.0/((double)ntheta-1.0);
|
||||||
rdtheta=1.0/dtheta;
|
rdtheta=1.0/dtheta;
|
||||||
|
@ -5273,10 +5275,12 @@ void _noopt PairBOP::read_table(char *filename)
|
||||||
pRepul4[i][k]=pRepul1[i][k]/dr[i];
|
pRepul4[i][k]=pRepul1[i][k]/dr[i];
|
||||||
pRepul5[i][k]=2.0*pRepul2[i][k]/dr[i];
|
pRepul5[i][k]=2.0*pRepul2[i][k]/dr[i];
|
||||||
pRepul6[i][k]=3.0*pRepul3[i][k]/dr[i];
|
pRepul6[i][k]=3.0*pRepul3[i][k]/dr[i];
|
||||||
|
if (nws==3) {
|
||||||
pLong4[i][k]=pLong1[i][k]/dr3[i];
|
pLong4[i][k]=pLong1[i][k]/dr3[i];
|
||||||
pLong5[i][k]=2.0*pLong2[i][k]/dr3[i];
|
pLong5[i][k]=2.0*pLong2[i][k]/dr3[i];
|
||||||
pLong6[i][k]=3.0*pLong3[i][k]/dr3[i];
|
pLong6[i][k]=3.0*pLong3[i][k]/dr3[i];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for(k=0;k<nBOt;k++) {
|
for(k=0;k<nBOt;k++) {
|
||||||
FsigBO4[i][k]=FsigBO1[i][k]/dBO;
|
FsigBO4[i][k]=FsigBO1[i][k]/dBO;
|
||||||
FsigBO5[i][k]=2.0*FsigBO2[i][k]/dBO;
|
FsigBO5[i][k]=2.0*FsigBO2[i][k]/dBO;
|
||||||
|
|
Loading…
Reference in New Issue