From 639ea6c3964738b8b7c974f7b0d420453d64d9a5 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 10 Aug 2016 14:59:04 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15468 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/COLLOID/pair_lubricateU_poly.cpp | 6 ++++++ src/COLLOID/pair_lubricate_poly.cpp | 2 ++ src/COMPRESS/dump_custom_gz.cpp | 12 ++++++------ src/USER-OMP/pair_lubricate_poly_omp.cpp | 14 ++++++++++---- src/USER-QMMM/fix_qmmm.cpp | 4 ---- src/atom.cpp | 4 ++-- src/atom.h | 4 ++-- src/compute_temp_profile.cpp | 2 +- src/fix_nh.cpp | 6 ++++++ src/input.cpp | 2 +- src/min_hftn.cpp | 5 ++++- src/neighbor.cpp | 1 + src/thermo.cpp | 1 + 13 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 07c2d53b52..30ad42ea60 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -438,6 +438,8 @@ void PairLubricateUPoly::compute_Fh(double **x) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + j &= NEIGHMASK; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -709,6 +711,8 @@ void PairLubricateUPoly::compute_RU(double **x) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + j &= NEIGHMASK; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -947,6 +951,8 @@ void PairLubricateUPoly::compute_RE(double **x) // No contribution from isotropic terms due to E for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + j &= NEIGHMASK; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index 96f4e139e2..2561ca3637 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -226,6 +226,8 @@ void PairLubricatePoly::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + j &= NEIGHMASK; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index fb7802399b..1905577a12 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -101,9 +101,9 @@ void DumpCustomGZ::write_header(bigint ndump) gzprintf(gzFp,"ITEM: NUMBER OF ATOMS\n"); gzprintf(gzFp,BIGINT_FORMAT "\n",ndump); gzprintf(gzFp,"ITEM: BOX BOUNDS %s\n",boundstr); - gzprintf(gzFp,"%g %g\n",boxxlo,boxxhi); - gzprintf(gzFp,"%g %g\n",boxylo,boxyhi); - gzprintf(gzFp,"%g %g\n",boxzlo,boxzhi); + gzprintf(gzFp,"%-1.16g %-1.16g\n",boxxlo,boxxhi); + gzprintf(gzFp,"%-1.16g %-1.16g\n",boxylo,boxyhi); + gzprintf(gzFp,"%-1.16g %-1.16g\n",boxzlo,boxzhi); gzprintf(gzFp,"ITEM: ATOMS %s\n",columns); } else { gzprintf(gzFp,"ITEM: TIMESTEP\n"); @@ -111,9 +111,9 @@ void DumpCustomGZ::write_header(bigint ndump) gzprintf(gzFp,"ITEM: NUMBER OF ATOMS\n"); gzprintf(gzFp,BIGINT_FORMAT "\n",ndump); gzprintf(gzFp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - gzprintf(gzFp,"%g %g %g\n",boxxlo,boxxhi,boxxy); - gzprintf(gzFp,"%g %g %g\n",boxylo,boxyhi,boxxz); - gzprintf(gzFp,"%g %g %g\n",boxzlo,boxzhi,boxyz); + gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxxlo,boxxhi,boxxy); + gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxylo,boxyhi,boxxz); + gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxzlo,boxzhi,boxyz); gzprintf(gzFp,"ITEM: ATOMS %s\n",columns); } } diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp index f2e873ea45..2e7140e32b 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.cpp +++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp @@ -236,7 +236,7 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr) sync_threads(); } - // loop over neighbors of my atoms + // R0 adjustment has already been done in this->compute() for (ii = iifrom; ii < iito; ++ii) { i = ilist[ii]; @@ -364,9 +364,15 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr) 16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) * h_sep*log(1.0/h_sep); a_sh *= 6.0*MY_PI*mu*radi; - a_pu = beta0*(4.0+beta0)/10.0/beta1/beta1*log(1.0/h_sep); - a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 * - pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep); + // old invalid eq for pumping term + // changed 29Jul16 from eq 9.25 -> 9.27 in Kim and Karilla +// a_pu = beta0*(4.0+beta0)/10.0/beta1/beta1*log(1.0/h_sep); +// a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 * +// pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep); +// a_pu *= 8.0*MY_PI*mu*pow(radi,3.0); + a_pu = 2.0*beta0/5.0/beta1*log(1.0/h_sep); + a_pu += 2.0*(8.0+6.0*beta0+33.0*beta0*beta0)/125.0/beta1/beta1* + h_sep*log(1.0/h_sep); a_pu *= 8.0*MY_PI*mu*pow(radi,3.0); } else a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep); diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index 4ee472cfaa..7fae85f7df 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -40,10 +40,6 @@ enum {QMMM_TAG_OTHER=0, QMMM_TAG_SIZE=1, QMMM_TAG_COORD=2, using namespace LAMMPS_NS; using namespace FixConst; -// prototypes for local helper functions - -static int match_element(double mass, int search_isotopes, double &delta); - /****************************************************************************/ /* re-usable integer hash table code with static linkage. */ diff --git a/src/atom.cpp b/src/atom.cpp index acb3cbce7c..a6463259fd 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1966,7 +1966,7 @@ void Atom::update_callback(int ifix) return -1 if not found ------------------------------------------------------------------------- */ -int Atom::find_custom(char *name, int &flag) +int Atom::find_custom(const char *name, int &flag) { for (int i = 0; i < nivector; i++) if (iname[i] && strcmp(iname[i],name) == 0) { @@ -1989,7 +1989,7 @@ int Atom::find_custom(char *name, int &flag) return index in ivector or dvector of its location ------------------------------------------------------------------------- */ -int Atom::add_custom(char *name, int flag) +int Atom::add_custom(const char *name, int flag) { int index; diff --git a/src/atom.h b/src/atom.h index 5e6f257789..6d0b881b75 100644 --- a/src/atom.h +++ b/src/atom.h @@ -252,8 +252,8 @@ class Atom : protected Pointers { void delete_callback(const char *, int); void update_callback(int); - int find_custom(char *, int &); - int add_custom(char *, int); + int find_custom(const char *, int &); + int add_custom(const char *, int); void remove_custom(int, int); virtual void sync_modify(ExecutionSpace, unsigned int, unsigned int) {} diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index b800047175..654bea7ebe 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -497,7 +497,7 @@ void ComputeTempProfile::bin_assign() { // reallocate bin array if necessary - if (atom->nlocal > maxatom) { + if (atom->nmax > maxatom) { maxatom = atom->nmax; memory->destroy(bin); memory->create(bin,maxatom,"temp/profile:bin"); diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 725cb60d26..3ce7c4e302 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -1013,12 +1013,18 @@ void FixNH::couple() p_current[2] = tensor[2]; } + if (!ISFINITE(p_current[0]) || !ISFINITE(p_current[1]) || !ISFINITE(p_current[2])) + error->all(FLERR,"Non-numeric pressure - simulation unstable"); + // switch order from xy-xz-yz to Voigt if (pstyle == TRICLINIC) { p_current[3] = tensor[5]; p_current[4] = tensor[4]; p_current[5] = tensor[3]; + + if (!ISFINITE(p_current[3]) || !ISFINITE(p_current[4]) || !ISFINITE(p_current[5])) + error->all(FLERR,"Non-numeric pressure - simulation unstable"); } } diff --git a/src/input.cpp b/src/input.cpp index dda64856dc..4ab4a6b968 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -594,7 +594,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) int Input::expand_args(int narg, char **arg, int mode, char **&earg) { - int n,iarg,index,nlo,nhi,nmax,which,expandflag,icompute,ifix; + int n,iarg,index,nlo,nhi,nmax,expandflag,icompute,ifix; char *ptr1,*ptr2,*str; ptr1 = NULL; diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp index d08df65057..84793e33a4 100644 --- a/src/min_hftn.cpp +++ b/src/min_hftn.cpp @@ -138,8 +138,11 @@ void MinHFTN::setup_style() //---- ALLOCATE MEMORY FOR EXTRA GLOBAL DEGREES OF FREEDOM. //---- THE FIX MODULE TAKES CARE OF THE FIRST VECTOR, X0 (XK). if (nextra_global) { - for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) + for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { _daExtraGlobal[i] = new double[nextra_global]; + for (int j = 0; j < nextra_global; j++) + _daExtraGlobal[i][j] = 0.0; + } } //---- ALLOCATE MEMORY FOR EXTRA PER-ATOM DEGREES OF FREEDOM. diff --git a/src/neighbor.cpp b/src/neighbor.cpp index eb882d2e96..de6835da87 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -83,6 +83,7 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp) build_once = 0; cluster_check = 0; binatomflag = 1; + ago = -1; cutneighmax = 0.0; cutneighsq = NULL; diff --git a/src/thermo.cpp b/src/thermo.cpp index 3ef19c50a6..3d3a28cde8 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -994,6 +994,7 @@ void Thermo::parse_fields(char *str) void Thermo::addfield(const char *key, FnPtr func, int typeflag) { int n = strlen(key) + 1; + delete[] keyword[nfield]; keyword[nfield] = new char[n]; strcpy(keyword[nfield],key); vfunc[nfield] = func;