From 7a593c2fc886cc598e1371c65f4c1244dc731953 Mon Sep 17 00:00:00 2001 From: Tim Mattox Date: Tue, 28 Feb 2017 14:25:03 -0500 Subject: [PATCH 1/4] USER-DPD: correct off-by-one errors in PairTableRX::coeff() --- src/USER-DPD/pair_table_rx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index 8498d752e3..2529d33f91 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -351,7 +351,7 @@ void PairTableRX::coeff(int narg, char **arg) nspecies = atom->nspecies_dpd; if(nspecies==0) error->all(FLERR,"There are no rx species specified."); int n; - n = strlen(arg[3]) + 1; + n = strlen(arg[4]) + 1; site1 = new char[n]; strcpy(site1,arg[4]); @@ -362,7 +362,7 @@ void PairTableRX::coeff(int narg, char **arg) if (ispecies == nspecies && strcmp(site1,"1fluid") != 0) error->all(FLERR,"Site1 name not recognized in pair coefficients"); - n = strlen(arg[4]) + 1; + n = strlen(arg[5]) + 1; site2 = new char[n]; strcpy(site2,arg[5]); From 1dc78a7e58c843321a402be4383d9b6477edce3a Mon Sep 17 00:00:00 2001 From: Tim Mattox Date: Tue, 28 Feb 2017 17:45:21 -0500 Subject: [PATCH 2/4] USER-DPD: correct off-by-one errors in PairMultiLucyRX::coeff() --- src/USER-DPD/pair_multi_lucy_rx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index 6e20f206d5..0a15796666 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -385,11 +385,11 @@ void PairMultiLucyRX::coeff(int narg, char **arg) nspecies = atom->nspecies_dpd; int n; - n = strlen(arg[3]) + 1; + n = strlen(arg[4]) + 1; site1 = new char[n]; strcpy(site1,arg[4]); - n = strlen(arg[4]) + 1; + n = strlen(arg[5]) + 1; site2 = new char[n]; strcpy(site2,arg[5]); From 9a560b90914cc840e07d68baeb22f36504ad9435 Mon Sep 17 00:00:00 2001 From: Tim Mattox Date: Wed, 1 Mar 2017 15:22:28 -0500 Subject: [PATCH 3/4] USER-DPD bugfix: make atom_vec_dpd work properly with atom_vec_hybrid. We were sending too much data during pack_comm_hybrid/unpack_comm_hybrid. --- src/USER-DPD/atom_vec_dpd.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/USER-DPD/atom_vec_dpd.cpp b/src/USER-DPD/atom_vec_dpd.cpp index 399383ec18..477ed05e3f 100644 --- a/src/USER-DPD/atom_vec_dpd.cpp +++ b/src/USER-DPD/atom_vec_dpd.cpp @@ -488,8 +488,6 @@ int AtomVecDPD::pack_comm_hybrid(int n, int *list, double *buf) buf[m++] = uCond[j]; buf[m++] = uMech[j]; buf[m++] = uChem[j]; - buf[m++] = uCG[j]; - buf[m++] = uCGnew[j]; } return m; } @@ -589,8 +587,6 @@ int AtomVecDPD::unpack_comm_hybrid(int n, int first, double *buf) uCond[i] = buf[m++]; uMech[i] = buf[m++]; uChem[i] = buf[m++]; - uCG[i] = buf[m++]; - uCGnew[i] = buf[m++]; } return m; } From 763a00e8b02e902afe8ccad7c81884b6b12cf387 Mon Sep 17 00:00:00 2001 From: Tim Mattox Date: Fri, 3 Mar 2017 09:29:17 -0500 Subject: [PATCH 4/4] USER-DPD: pair_multi_lucy_rx bugfix for systems with multiple atom types --- src/USER-DPD/pair_multi_lucy_rx.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index 0a15796666..43d4114741 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -923,15 +923,15 @@ void PairMultiLucyRX::computeLocalDensity() rho_i += factor; if (newton_pair || j < nlocal) rho[j] += factor; - } else if (rsq < cutsq[itype][jtype]) { - const double rcut = sqrt(cutsq[itype][jtype]); - const double tmpFactor = 1.0-sqrt(rsq)/rcut; - const double tmpFactor4 = tmpFactor*tmpFactor*tmpFactor*tmpFactor; - const double factor = (84.0/(5.0*pi*rcut*rcut*rcut))*(1.0+3.0*sqrt(rsq)/(2.0*rcut))*tmpFactor4; - rho_i += factor; - if (newton_pair || j < nlocal) - rho[j] += factor; } + } else if (rsq < cutsq[itype][jtype]) { + const double rcut = sqrt(cutsq[itype][jtype]); + const double tmpFactor = 1.0-sqrt(rsq)/rcut; + const double tmpFactor4 = tmpFactor*tmpFactor*tmpFactor*tmpFactor; + const double factor = (84.0/(5.0*pi*rcut*rcut*rcut))*(1.0+3.0*sqrt(rsq)/(2.0*rcut))*tmpFactor4; + rho_i += factor; + if (newton_pair || j < nlocal) + rho[j] += factor; } }