git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14220 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -15,10 +15,10 @@
|
||||
Contributing authors: Stephen Foiles, Aidan Thompson (SNL)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "math.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "pair_zbl.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
@ -33,7 +33,7 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
// From J.F. Zeigler, J. P. Biersack and U. Littmark,
|
||||
// From J.F. Zeigler, J. P. Biersack and U. Littmark,
|
||||
// "The Stopping and Range of Ions in Matter" volume 1, Pergamon, 1985.
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -117,7 +117,7 @@ void PairZBL::compute(int eflag, int vflag)
|
||||
|
||||
if (rsq > cut_innersq) {
|
||||
t = r - cut_inner;
|
||||
fswitch = t*t *
|
||||
fswitch = t*t *
|
||||
(sw1[itype][jtype] + sw2[itype][jtype]*t);
|
||||
fpair += fswitch;
|
||||
}
|
||||
@ -136,7 +136,7 @@ void PairZBL::compute(int eflag, int vflag)
|
||||
evdwl = e_zbl(r, itype, jtype);
|
||||
evdwl += sw5[itype][jtype];
|
||||
if (rsq > cut_innersq) {
|
||||
eswitch = t*t*t *
|
||||
eswitch = t*t*t *
|
||||
(sw3[itype][jtype] + sw4[itype][jtype]*t);
|
||||
evdwl += eswitch;
|
||||
}
|
||||
@ -275,7 +275,7 @@ double PairZBL::single(int i, int j, int itype, int jtype, double rsq,
|
||||
fforce = dzbldr(r, itype, jtype);
|
||||
if (rsq > cut_innersq) {
|
||||
t = r - cut_inner;
|
||||
fswitch = t*t *
|
||||
fswitch = t*t *
|
||||
(sw1[itype][jtype] + sw2[itype][jtype]*t);
|
||||
fforce += fswitch;
|
||||
}
|
||||
@ -284,7 +284,7 @@ double PairZBL::single(int i, int j, int itype, int jtype, double rsq,
|
||||
phi = e_zbl(r, itype, jtype);
|
||||
phi += sw5[itype][jtype];
|
||||
if (rsq > cut_innersq) {
|
||||
eswitch = t*t*t *
|
||||
eswitch = t*t*t *
|
||||
(sw3[itype][jtype] + sw4[itype][jtype]*t);
|
||||
phi += eswitch;
|
||||
}
|
||||
@ -297,7 +297,7 @@ double PairZBL::single(int i, int j, int itype, int jtype, double rsq,
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairZBL::e_zbl(double r, int i, int j) {
|
||||
|
||||
|
||||
double d1aij = d1a[i][j];
|
||||
double d2aij = d2a[i][j];
|
||||
double d3aij = d3a[i][j];
|
||||
@ -343,9 +343,9 @@ double PairZBL::dzbldr(double r, int i, int j) {
|
||||
sum_p -= c2*d2aij*e2;
|
||||
sum_p -= c3*d3aij*e3;
|
||||
sum_p -= c4*d4aij*e4;
|
||||
|
||||
|
||||
double result = zzeij*(sum_p - sum*rinv)*rinv;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -381,15 +381,15 @@ double PairZBL::d2zbldr2(double r, int i, int j) {
|
||||
sum_pp += c2*e2*d2aij*d2aij;
|
||||
sum_pp += c3*e3*d3aij*d3aij;
|
||||
sum_pp += c4*e4*d4aij*d4aij;
|
||||
|
||||
double result = zzeij*(sum_pp + 2.0*sum_p*rinv +
|
||||
|
||||
double result = zzeij*(sum_pp + 2.0*sum_p*rinv +
|
||||
2.0*sum*rinv*rinv)*rinv;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
calculate the i,j entries in the various coeff arrays
|
||||
calculate the i,j entries in the various coeff arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairZBL::set_coeff(int i, int j, double zi, double zj)
|
||||
@ -400,51 +400,51 @@ void PairZBL::set_coeff(int i, int j, double zi, double zj)
|
||||
d3a[i][j] = d3*ainv;
|
||||
d4a[i][j] = d4*ainv;
|
||||
zze[i][j] = zi*zj*force->qqr2e*force->qelectron*force->qelectron;
|
||||
|
||||
|
||||
d1a[j][i] = d1a[i][j];
|
||||
d2a[j][i] = d2a[i][j];
|
||||
d3a[j][i] = d3a[i][j];
|
||||
d4a[j][i] = d4a[i][j];
|
||||
zze[j][i] = zze[i][j];
|
||||
|
||||
// e = t^3 (sw3 + sw4*t) + sw5
|
||||
|
||||
// e = t^3 (sw3 + sw4*t) + sw5
|
||||
// = A/3*t^3 + B/4*t^4 + C
|
||||
// sw3 = A/3
|
||||
// sw4 = B/4
|
||||
// sw3 = A/3
|
||||
// sw4 = B/4
|
||||
// sw5 = C
|
||||
|
||||
// dedr = t^2 (sw1 + sw2*t)
|
||||
|
||||
// dedr = t^2 (sw1 + sw2*t)
|
||||
// = A*t^2 + B*t^3
|
||||
// sw1 = A
|
||||
// sw2 = B
|
||||
|
||||
// sw1 = A
|
||||
// sw2 = B
|
||||
|
||||
// de2dr2 = 2*A*t + 3*B*t^2
|
||||
|
||||
|
||||
// Require that at t = tc:
|
||||
// e = -Fc
|
||||
// dedr = -Fc'
|
||||
// d2edr2 = -Fc''
|
||||
|
||||
// d2edr2 = -Fc''
|
||||
|
||||
// Hence:
|
||||
// A = (-3Fc' + tc*Fc'')/tc^2
|
||||
// B = ( 2Fc' - tc*Fc'')/tc^3
|
||||
// C = -Fc + tc/2*Fc' - tc^2/12*Fc''
|
||||
|
||||
|
||||
double tc = cut_global - cut_inner;
|
||||
double fc = e_zbl(cut_global, i, j);
|
||||
double fcp = dzbldr(cut_global, i, j);
|
||||
double fcpp = d2zbldr2(cut_global, i, j);
|
||||
|
||||
|
||||
double swa = (-3.0*fcp + tc*fcpp)/(tc*tc);
|
||||
double swb = ( 2.0*fcp - tc*fcpp)/(tc*tc*tc);
|
||||
double swc = -fc + (tc/2.0)*fcp - (tc*tc/12.0)*fcpp;
|
||||
|
||||
double swc = -fc + (tc/2.0)*fcp - (tc*tc/12.0)*fcpp;
|
||||
|
||||
sw1[i][j] = swa;
|
||||
sw2[i][j] = swb;
|
||||
sw3[i][j] = swa/3.0;
|
||||
sw4[i][j] = swb/4.0;
|
||||
sw5[i][j] = swc;
|
||||
|
||||
|
||||
sw1[j][i] = sw1[i][j];
|
||||
sw2[j][i] = sw2[i][j];
|
||||
sw3[j][i] = sw3[i][j];
|
||||
|
||||
Reference in New Issue
Block a user