From 871f90c68de4258250d19ea8352a1924decd0a1c Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 21 Sep 2012 16:08:57 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8814 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/GPU/Install.sh | 16 ++++------------ src/GPU/Package.sh | 6 ------ src/GPU/pair_born_coul_wolf_gpu.cpp | 17 +++++++++++------ src/GPU/pair_eam_alloy_gpu.cpp | 1 + src/GPU/pair_eam_fs_gpu.cpp | 1 + src/GPU/pair_eam_gpu.cpp | 12 ++++++------ 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh index 7f4d6530ae..3c918328ef 100644 --- a/src/GPU/Install.sh +++ b/src/GPU/Install.sh @@ -127,10 +127,8 @@ include ..\/..\/lib\/gpu\/Makefile.lammps cp pair_lj96_cut_gpu.cpp .. cp pair_lj_expand_gpu.cpp .. cp pair_lj_cut_coul_cut_gpu.cpp .. -# cp pair_lj_cut_coul_dsf.cpp .. -# cp pair_lj_cut_coul_dsf_gpu.cpp .. -# cp pair_coul_dsf.cpp .. -# cp pair_coul_dsf_gpu.cpp .. + cp pair_lj_cut_coul_dsf_gpu.cpp .. + cp pair_coul_dsf_gpu.cpp .. cp pair_lj_cut_coul_debye_gpu.cpp .. cp pair_born_gpu.cpp .. cp pair_born_coul_wolf_gpu.cpp .. @@ -144,10 +142,8 @@ include ..\/..\/lib\/gpu\/Makefile.lammps cp pair_lj96_cut_gpu.h .. cp pair_lj_expand_gpu.h .. cp pair_lj_cut_coul_cut_gpu.h .. -# cp pair_lj_cut_coul_dsf.h .. -# cp pair_lj_cut_coul_dsf_gpu.h .. -# cp pair_coul_dsf.h .. -# cp pair_coul_dsf_gpu.h .. + cp pair_lj_cut_coul_dsf_gpu.h .. + cp pair_coul_dsf_gpu.h .. cp pair_lj_cut_coul_debye_gpu.h .. cp pair_born_gpu.h .. cp pair_born_coul_wolf_gpu.h .. @@ -197,9 +193,7 @@ elif (test $1 = 0) then rm -f ../pair_yukawa_colloid_gpu.cpp rm -f ../pair_dipole_cut_gpu.cpp rm -f ../pair_dipole_sf_gpu.cpp - rm -f ../pair_lj_cut_coul_dsf.cpp rm -f ../pair_lj_cut_coul_dsf_gpu.cpp - rm -f ../pair_coul_dsf.cpp rm -f ../pair_coul_dsf_gpu.cpp rm -f ../pair_lj_cut_coul_debye_gpu.cpp rm -f ../pppm_gpu.cpp @@ -236,9 +230,7 @@ elif (test $1 = 0) then rm -f ../pair_yukawa_colloid_gpu.h rm -f ../pair_dipole_cut_gpu.h rm -f ../pair_dipole_sf_gpu.h - rm -f ../pair_lj_cut_coul_dsf.h rm -f ../pair_lj_cut_coul_dsf_gpu.h - rm -f ../pair_coul_dsf.h rm -f ../pair_coul_dsf_gpu.h rm -f ../pair_lj_cut_coul_debye_gpu.h rm -f ../pppm_gpu.h diff --git a/src/GPU/Package.sh b/src/GPU/Package.sh index 2cb045c1bd..3b4d4572f1 100644 --- a/src/GPU/Package.sh +++ b/src/GPU/Package.sh @@ -108,12 +108,6 @@ for file in *.cpp *.h; do if (test $file = pair_lj_charmm_coul_long_gpu.h -a ! -e ../pair_lj_charmm_coul_long.cpp) then continue fi - if (test $file = pair_lj_cut_coul_dsf_gpu.cpp -a ! -e ../pair_lj_cut_coul_dsf.cpp) then - continue - fi - if (test $file = pair_lj_cut_coul_dsf_gpu.h -a ! -e ../pair_lj_cut_coul_dsf.cpp) then - continue - fi if (test $file = pppm_gpu.cpp -a ! -e ../pppm.cpp) then continue fi diff --git a/src/GPU/pair_born_coul_wolf_gpu.cpp b/src/GPU/pair_born_coul_wolf_gpu.cpp index f2f8a120c3..6f8fb97348 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_gpu.cpp @@ -197,10 +197,10 @@ void PairBornCoulWolfGPU::cpu_compute(int start, int inum, int eflag, int vflag, int i,j,ii,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,qtmp,delx,dely,delz,evdwl,ecoul,fpair; double rsq,r2inv,r6inv,forcecoul,forceborn,factor_coul,factor_lj; + double erfcc,erfcd,v_sh,dvdrr,e_self,qisq; double prefactor; double r,rexp; int *jlist; - double erfcc,erfcd,v_sh,dvdrr,e_self,e_shift,f_shift,qisq; evdwl = ecoul = 0.0; @@ -213,9 +213,9 @@ void PairBornCoulWolfGPU::cpu_compute(int start, int inum, int eflag, int vflag, double *special_lj = force->special_lj; double qqrd2e = force->qqrd2e; - qisq = qtmp*qtmp; - e_self = -(e_shift/2.0 + alf/MY_PIS) * qisq*qqrd2e; - if (evflag) ev_tally(i,i,nlocal,0,0.0,e_self,0.0,0.0,0.0,0.0); + double e_shift = erfc(alf*cut_coul)/cut_coul; + double f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / + cut_coul; // loop over neighbors of my atoms @@ -229,6 +229,10 @@ void PairBornCoulWolfGPU::cpu_compute(int start, int inum, int eflag, int vflag, jlist = firstneigh[i]; jnum = numneigh[i]; + qisq = qtmp*qtmp; + e_self = -(e_shift/2.0 + alf/MY_PIS) * qisq*qqrd2e; + if (evflag) ev_tally(i,i,nlocal,0,0.0,e_self,0.0,0.0,0.0,0.0); + for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; factor_lj = special_lj[sbmask(j)]; @@ -270,9 +274,10 @@ void PairBornCoulWolfGPU::cpu_compute(int start, int inum, int eflag, int vflag, f[i][2] += delz*fpair; if (eflag) { - if (rsq < cut_coulsq) + if (rsq < cut_coulsq) { ecoul = v_sh; - else ecoul = 0.0; + if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor; + } else ecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype]; diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 2bf370e36f..48b3982107 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -219,6 +219,7 @@ void PairEAMAlloyGPU::file2array() nr = setfl->nr; drho = setfl->drho; dr = setfl->dr; + rhomax = (nrho-1) * drho; // ------------------------------------------------------------------ // setup frho arrays diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index efb5716088..f1600a9a2b 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -224,6 +224,7 @@ void PairEAMFSGPU::file2array() nr = fs->nr; drho = fs->drho; dr = fs->dr; + rhomax = (nrho-1) * drho; // ------------------------------------------------------------------ // setup frho arrays diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 25e6ba8140..102d74babd 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -41,11 +41,11 @@ int eam_gpu_init(const int ntypes, double host_cutforcesq, int **host_type2rhor, int **host_type2z2r, int *host_type2frho, double ***host_rhor_spline, double ***host_z2r_spline, double ***host_frho_spline, - double rdr, double rdrho, int nrhor, int nrho, int nz2r, - int nfrho, int nr, const int nlocal, const int nall, - const int max_nbors, const int maxspecial, - const double cell_size, int &gpu_mode, FILE *screen, - int &fp_size); + double rdr, double rdrho, double rhomax, + int nrhor, int nrho, int nz2r, int nfrho, int nr, + const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, int &gpu_mode, + FILE *screen, int &fp_size); void eam_gpu_clear(); int** eam_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, @@ -180,7 +180,7 @@ void PairEAMGPU::init_style() int fp_size; int success = eam_gpu_init(atom->ntypes+1, cutforcesq, type2rhor, type2z2r, type2frho, rhor_spline, z2r_spline, frho_spline, - rdr, rdrho, nrhor, nrho, nz2r, nfrho, nr, + rdr, rdrho, rhomax, nrhor, nrho, nz2r, nfrho, nr, atom->nlocal, atom->nlocal+atom->nghost, 300, maxspecial, cell_size, gpu_mode, screen, fp_size); GPU_EXTRA::check_flag(success,error,world);