From 738f9cb7aae3afef2877b709574056ec3b4c0240 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 22 Oct 2010 21:25:33 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5101 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/CLASS2/pair_lj_class2_coul_long.cpp | 3 ++- src/CLASS2/pair_lj_class2_coul_long.h | 2 +- src/COLLOID/pair_lubricate.cpp | 25 +++++------------------ src/COLLOID/pair_lubricate.h | 3 +-- src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp | 5 ++--- src/USER-CG-CMM/pair_cg_cmm_coul_long.h | 2 +- src/USER-EWALDN/ewald_n.cpp | 15 +++++++------- src/USER-EWALDN/pair_buck_coul.cpp | 10 ++++----- src/USER-EWALDN/pair_buck_coul.h | 2 +- src/USER-EWALDN/pair_lj_coul.cpp | 4 +++- src/USER-EWALDN/pair_lj_coul.h | 2 +- 11 files changed, 30 insertions(+), 43 deletions(-) diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index a7434e7b7a..1344dfb7e7 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -467,8 +467,9 @@ double PairLJClass2CoulLong::single(int i, int j, int itype, int jtype, /* ---------------------------------------------------------------------- */ -void *PairLJClass2CoulLong::extract(char *str) +void *PairLJClass2CoulLong::extract(char *str, int &dim) { + dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; return NULL; } diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h index 3ac90c5ad6..154d67412c 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.h +++ b/src/CLASS2/pair_lj_class2_coul_long.h @@ -38,7 +38,7 @@ class PairLJClass2CoulLong : public Pair { void write_restart_settings(FILE *); void read_restart_settings(FILE *); double single(int, int, int, int, double, double, double, double &); - void *extract(char *); + void *extract(char *, int &); private: double cut_lj_global; diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 69a207430b..b708794ded 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -534,26 +534,11 @@ void PairLubricate::read_restart_settings(FILE *fp) random = new RanMars(lmp,seed + comm->me); } -/* ---------------------------------------------------------------------- - check if name is recognized, return integer index for that name - if name not recognized, return -1 - if type pair setting, return -2 if no type pairs are set -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -int PairLubricate::pre_adapt(char *name, int ilo, int ihi, int jlo, int jhi) +void *PairLubricate::extract(char *str, int &dim) { - if (strcmp(name,"mu") == 0) return 0; - return -1; -} - -/* ---------------------------------------------------------------------- - adapt parameter indexed by which - change all pair variables affected by the reset parameter - if type pair setting, set I-J and J-I coeffs -------------------------------------------------------------------------- */ - -void PairLubricate::adapt(int which, int ilo, int ihi, int jlo, int jhi, - double value) -{ - mu = value; + dim = 0; + if (strcmp(str,"mu") == 0) return (void *) μ + return NULL; } diff --git a/src/COLLOID/pair_lubricate.h b/src/COLLOID/pair_lubricate.h index 5206c6d5fc..5f6f1ef6c6 100644 --- a/src/COLLOID/pair_lubricate.h +++ b/src/COLLOID/pair_lubricate.h @@ -37,8 +37,7 @@ class PairLubricate : public Pair { void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - int pre_adapt(char *, int, int, int, int); - void adapt(int, int, int, int, int, double); + void *extract(char *, int &); protected: double cut_inner_global,cut_global; diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp index 74a1b18725..b001981f7d 100644 --- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp +++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp @@ -446,10 +446,9 @@ double PairCGCMMCoulLong::single(int i, int j, int itype, int jtype, double rsq, /* ---------------------------------------------------------------------- */ -void *PairCGCMMCoulLong::extract(char *str) +void *PairCGCMMCoulLong::extract(char *str, int &dim) { + dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul_global; return NULL; } - -/* ---------------------------------------------------------------------- */ diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.h b/src/USER-CG-CMM/pair_cg_cmm_coul_long.h index a16b327a9c..d3fd0b453d 100644 --- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.h +++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.h @@ -43,7 +43,7 @@ namespace LAMMPS_NS { double memory_usage(); double single(int, int, int, int, double, double, double, double &); - void *extract(char *str); + void *extract(char *str, int &); protected: void allocate(); diff --git a/src/USER-EWALDN/ewald_n.cpp b/src/USER-EWALDN/ewald_n.cpp index c6e599c123..c0668944b3 100644 --- a/src/USER-EWALDN/ewald_n.cpp +++ b/src/USER-EWALDN/ewald_n.cpp @@ -88,6 +88,7 @@ void EwaldN::init() } qqrd2e = force->qqrd2e; // check pair_style + scale = 1.0; //mumurd2e = force->mumurd2e; //dielectric = force->dielectric; mumurd2e = dielectric = 1.0; @@ -366,8 +367,8 @@ void EwaldN::init_self() memset(energy_self, 0, EWALD_NFUNCS*sizeof(double)); // self energy memset(virial_self, 0, EWALD_NFUNCS*sizeof(double)); if (function[0]) { // 1/r - virial_self[0] = -0.5*M_PI*qqrd2e/(g2*volume)*sum[0].x*sum[0].x; - energy_self[0] = sum[0].x2*qqrd2e*g1/sqrt(M_PI)-virial_self[0]; + virial_self[0] = -0.5*M_PI*qqrd2e*scale/(g2*volume)*sum[0].x*sum[0].x; + energy_self[0] = sum[0].x2*qqrd2e*scale*g1/sqrt(M_PI)-virial_self[0]; } if (function[1]) { // geometric 1/r^6 virial_self[1] = M_PI*sqrt(M_PI)*g3/(6.0*volume)*sum[1].x*sum[1].x; @@ -481,7 +482,7 @@ void EwaldN::compute_force() double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = NULL; double *dipole = atom->dipole, *mu = atom->mu ? atom->mu[0] : NULL; double *ke, c[EWALD_NFUNCS] = { - 8.0*M_PI*qqrd2e/volume, 2.0*M_PI*sqrt(M_PI)/(12.0*volume), + 8.0*M_PI*qqrd2e*scale/volume, 2.0*M_PI*sqrt(M_PI)/(12.0*volume), 2.0*M_PI*sqrt(M_PI)/(192.0*volume), 8.0*M_PI*mumurd2e/volume}; double kt = 4.0*pow(g_ewald, 3.0)/3.0/sqrt(M_PI)/c[3]; int i, kx, ky, lbytes = (2*nbox+1)*sizeof(cvector), *type = atom->type; @@ -585,7 +586,7 @@ void EwaldN::compute_energy(int eflag) complex *cek = cek_global; double *ke = kenergy; double c[EWALD_NFUNCS] = { - 4.0*M_PI*qqrd2e/volume, 2.0*M_PI*sqrt(M_PI)/(24.0*volume), + 4.0*M_PI*qqrd2e*scale/volume, 2.0*M_PI*sqrt(M_PI)/(24.0*volume), 2.0*M_PI*sqrt(M_PI)/(192.0*volume), 4.0*M_PI*mumurd2e/volume}; double sum[EWALD_NFUNCS]; int func[EWALD_NFUNCS]; @@ -623,7 +624,7 @@ void EwaldN::compute_virial(int vflag) complex *cek = cek_global; double *kv = kvirial; double c[EWALD_NFUNCS] = { - 4.0*M_PI*qqrd2e/volume, 2.0*M_PI*sqrt(M_PI)/(24.0*volume), + 4.0*M_PI*qqrd2e*scale/volume, 2.0*M_PI*sqrt(M_PI)/(24.0*volume), 2.0*M_PI*sqrt(M_PI)/(192.0*volume), 4.0*M_PI*mumurd2e/volume}; shape sum[EWALD_NFUNCS]; int func[EWALD_NFUNCS]; @@ -683,13 +684,13 @@ void EwaldN::compute_slabcorr(int eflag) while ((x+=3)f[0]-1, *fn = f+3*atom->nlocal-3; q = atom->q; while ((f+=3)