From dd2d454fc44200d4341988ce3cad53ec840fb841 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 29 Jan 2016 16:44:50 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14519 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MANYBODY/pair_polymorphic.cpp | 6 +++--- src/Purge.list | 8 ++++---- src/QEQ/fix_qeq_fire.cpp | 2 +- src/USER-SMTBQ/pair_smtbq.cpp | 11 +++++------ src/fix_store.cpp | 12 +++++++----- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index d7fdd0d787..d855ba7010 100755 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -696,7 +696,7 @@ void PairPolymorphic::read_file(char *file) p.P = new tabularFunction(nr,-cutmax,cutmax); (p.P)->set_values(nr,-cutmax,cutmax,singletable,epsilon); } - delete singletable; + delete[] singletable; singletable = new double[ng]; for (int i = 0; i < ntriple; i++) { // G TripletParameters & p = tripletParameters[i]; @@ -707,7 +707,7 @@ void PairPolymorphic::read_file(char *file) p.G = new tabularFunction(ng,-1.0,1.0); (p.G)->set_values(ng,-1.0,1.0,singletable,epsilon); } - delete singletable; + delete[] singletable; singletable = new double[nx]; for (int i = 0; i < npair; i++) { // F PairParameters & p = pairParameters[i]; @@ -718,7 +718,7 @@ void PairPolymorphic::read_file(char *file) p.F = new tabularFunction(nx,0.0,maxX); (p.F)->set_values(nx,0.0,maxX,singletable,epsilon); } - delete singletable; + delete[] singletable; if (comm->me == 0) { fclose(fp); } diff --git a/src/Purge.list b/src/Purge.list index b44df98794..8c6c7cdff0 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -14,10 +14,10 @@ style_minimize.h style_pair.h style_region.h # deleted on 15 Jan 2016 -pair_line_lj.cpp -pair_line_lj.h -pair_tri_lj.cpp -pair_tri_lj.h +pair_line_lj_omp.cpp +pair_line_lj_omp.h +pair_tri_lj_omp.cpp +pair_tri_lj_omp.h # deleted on 13 May 14 commgrid.cpp commgrid.h diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 8596731de6..af9ca65eef 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -314,7 +314,7 @@ double FixQEqFire::compute_eneg() int FixQEqFire::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) { - int m; + int m = 0; if( pack_flag == 1 ) for(m = 0; m < n; m++) buf[m] = atom->q[list[m]]; diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index f8097a78b4..4ccbc6da3a 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -1350,8 +1350,7 @@ void PairSMTBQ::tabqeq() // ofstream fichier("tabqeq.txt", ios::out | ios::trunc) ; // ------------------- - double pi,mu; - pi = 4.0*atan(1.0); + double mu; mu = erfc(alf*rc)/rc ; @@ -1366,10 +1365,10 @@ void PairSMTBQ::tabqeq() potqn[k] = 14.4*(erfc(alf*r)/r - mu) ; // $$$ Here is (1/r)*dE/dr - dpotqn[k] = -14.4*( (erfc(alf*r)/(r*r) + 2.0*alf/sqrt(pi)/r*exp(-alf*alf*r*r))/r ) ; + dpotqn[k] = -14.4*( (erfc(alf*r)/(r*r) + 2.0*alf/MY_PIS/r*exp(-alf*alf*r*r))/r ) ; } - Vself = -14.4*(alf/sqrt(pi) + mu*0.5) ; + Vself = -14.4*(alf/MY_PIS + mu*0.5) ; // -------------------- // default arrays to zero @@ -1424,7 +1423,7 @@ void PairSMTBQ::tabqeq() { gam = dgam = dza = dzb = d2zaa = d2zab = d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ; - dij = 0.0 ; + aCoeff = bCoeff = dij = 0.0 ; s = static_cast(k)*ds ; r = sqrt(s) ; if (k==0) r=10e-30; @@ -2316,7 +2315,7 @@ void PairSMTBQ::QForce_charge(int loop) double rsq; int *ilist,*jlist,*numneigh,**firstneigh; double iq,jq,fqi,fqj,fqij,fqij2,fqjj; - int eflag; + int eflag = 0; double **x = atom->x; diff --git a/src/fix_store.cpp b/src/fix_store.cpp index ed0586cba5..c627f1cc79 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -23,7 +23,7 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{GLOBAL,PERATOM}; +enum{UNKNOWN,GLOBAL,PERATOM}; /* ---------------------------------------------------------------------- */ @@ -35,9 +35,12 @@ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // syntax: id group style global nrow ncol // Nrow by Ncol array of global values // Ncol = 1 is vector, Nrow > 1 is array - // syntax: id group style peratom 0/1 nvalue + // syntax: id group style peratom 0/1 nvalues // 0/1 flag = not-store or store peratom values in restart file - // nvalue = # of peratom values, N = 1 is vector, N > 1 is array + // nvalues = # of peratom values, N = 1 is vector, N > 1 is array + + nvalues = vecflag = 0; + flavor = UNKNOWN; if (strcmp(arg[3],"global") == 0) flavor = GLOBAL; else if (strcmp(arg[3],"peratom") == 0) flavor = PERATOM; @@ -102,7 +105,6 @@ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) for (int j = 0; j < nvalues; j++) astore[i][j] = 0.0; } - } /* ---------------------------------------------------------------------- */ @@ -317,7 +319,7 @@ int FixStore::size_restart(int nlocal) double FixStore::memory_usage() { - double bytes; + double bytes = 0.0; if (flavor == GLOBAL) bytes += nrow*ncol * sizeof(double); if (flavor == PERATOM) bytes += atom->nmax*nvalues * sizeof(double); return bytes;