forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3247 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
191f7663d1
commit
7a60bdcb9a
|
@ -130,7 +130,7 @@ void PairCoulLong::compute(int eflag, int vflag)
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
@ -311,8 +311,8 @@ void PairCoulLong::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
@ -528,7 +528,7 @@ double PairCoulLong::single(int i, int j, int itype, int jtype,
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
|
|
@ -153,9 +153,9 @@ void PairLJCharmmCoulLong::compute(int eflag, int vflag)
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
||||
table = ftable[itable] + fraction*dftable[itable];
|
||||
|
@ -515,7 +515,7 @@ void PairLJCharmmCoulLong::compute_outer(int eflag, int vflag)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
@ -890,8 +890,8 @@ void PairLJCharmmCoulLong::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
@ -1146,7 +1146,7 @@ double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
|
|
@ -149,9 +149,9 @@ void PairLJCutCoulLong::compute(int eflag, int vflag)
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
||||
table = ftable[itable] + fraction*dftable[itable];
|
||||
|
@ -489,7 +489,7 @@ void PairLJCutCoulLong::compute_outer(int eflag, int vflag)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
@ -849,8 +849,8 @@ void PairLJCutCoulLong::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
@ -1099,7 +1099,7 @@ double PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
|
|||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup_single;
|
||||
union_int_float_t rsq_lookup_single;
|
||||
rsq_lookup_single.f = rsq;
|
||||
itable = rsq_lookup_single.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
|
|
@ -173,7 +173,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
|
|||
// test current rsq against cutoff and compute Coulombic force
|
||||
|
||||
if (rsq < cut_coulsq) {
|
||||
r2inv = 1 / rsq;
|
||||
r2inv = 1 / rsq;
|
||||
if (!ncoultablebits || rsq <= tabinnersq) {
|
||||
r = sqrt(rsq);
|
||||
grij = g_ewald * r;
|
||||
|
@ -186,7 +186,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
|
|||
forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Settings for libraries used by specific LAMMPS packages
|
||||
# this file is auto-edited when those packages are included/excluded
|
||||
|
||||
PKG_INC = -I../../lib/reax -I../../lib/poems -I../../lib/meam
|
||||
PKG_PATH = -L../../lib/reax -L../../lib/poems -L../../lib/meam
|
||||
PKG_LIB = -lreax -lpoems -lmeam
|
||||
PKG_INC = -I../../lib/atc -I../../lib/reax -I../../lib/poems -I../../lib/meam
|
||||
PKG_PATH = -L../../lib/atc -L../../lib/reax -L../../lib/poems -L../../lib/meam -L../../lib/gpu
|
||||
PKG_LIB = -latc -lreax -lpoems -lmeam -lgpu
|
||||
|
||||
PKG_SYSPATH = $(reax_SYSPATH) $(meam_SYSPATH)
|
||||
PKG_SYSLIB = $(reax_SYSLIB) $(meam_SYSLIB)
|
||||
PKG_SYSPATH = $(user-atc_SYSPATH) $(reax_SYSPATH) $(meam_SYSPATH) $(gpu_SYSPATH)
|
||||
PKG_SYSLIB = $(user-atc_SYSLIB) $(reax_SYSLIB) $(meam_SYSLIB) $(gpu_SYSLIB)
|
||||
|
|
|
@ -151,8 +151,8 @@ void PairLJCharmmCoulLongOpt::eval()
|
|||
prefactor = qqrd2e * tmp_coef3/r;
|
||||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
||||
|
@ -242,8 +242,8 @@ void PairLJCharmmCoulLongOpt::eval()
|
|||
forcecoul -= (1.0-factor_coul)*prefactor;
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
||||
|
|
|
@ -163,8 +163,8 @@ void PairCGCMMCoulLong::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
|
|
@ -272,7 +272,7 @@ namespace LAMMPS_NS {
|
|||
if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
int itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
@ -669,7 +669,7 @@ namespace LAMMPS_NS {
|
|||
if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
|
||||
}
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
int itable = rsq_lookup.i & ncoulmask;
|
||||
itable >>= ncoulshiftbits;
|
||||
|
|
|
@ -507,8 +507,8 @@ void PairBuckCoul::compute(int eflag, int vflag)
|
|||
}
|
||||
} // table real space
|
||||
else {
|
||||
register table_lookup_t t;
|
||||
t.f = rsq;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
|
||||
if (ni < 0) {
|
||||
|
@ -848,8 +848,8 @@ void PairBuckCoul::compute_outer(int eflag, int vflag)
|
|||
if (respa_flag) respa_coul = ni<0 ? // correct for respa
|
||||
frespa*qri*q[j]/r :
|
||||
frespa*qri*q[j]/r*special_coul[ni];
|
||||
register table_lookup_t t;
|
||||
t.f = rsq;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
|
||||
if (ni < 0) {
|
||||
|
@ -965,8 +965,8 @@ void PairBuckCoul::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
@ -1135,7 +1135,7 @@ double PairBuckCoul::single(int i, int j, int itype, int jtype,
|
|||
eng += t-f;
|
||||
}
|
||||
else { // table real space
|
||||
register table_lookup_t t;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = q[i]*q[j];
|
||||
|
|
|
@ -508,8 +508,8 @@ void PairLJCoul::compute(int eflag, int vflag)
|
|||
}
|
||||
} // table real space
|
||||
else {
|
||||
register table_lookup_t t;
|
||||
t.f = rsq;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask)>>ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
|
||||
if (ni < 0) {
|
||||
|
@ -842,8 +842,8 @@ void PairLJCoul::compute_outer(int eflag, int vflag)
|
|||
if (respa_flag) respa_coul = ni<0 ? // correct for respa
|
||||
frespa*qri*q[j]/sqrt(rsq) :
|
||||
frespa*qri*q[j]/sqrt(rsq)*special_coul[ni];
|
||||
register table_lookup_t t;
|
||||
t.f = rsq;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
|
||||
if (ni < 0) {
|
||||
|
@ -957,8 +957,8 @@ void PairLJCoul::init_tables()
|
|||
dptable = (double *) memory->smalloc(ntable*sizeof(double),"pair:dptable");
|
||||
}
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
int itablemin;
|
||||
minrsq_lookup.i = 0 << ncoulshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
@ -1126,7 +1126,7 @@ double PairLJCoul::single(int i, int j, int itype, int jtype,
|
|||
eng += t-r;
|
||||
}
|
||||
else { // table real space
|
||||
register table_lookup_t t;
|
||||
register union_int_float_t t;
|
||||
t.f = rsq;
|
||||
register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
|
||||
register double f = (rsq-rtable[k])*drtable[k], qiqj = q[i]*q[j];
|
||||
|
|
|
@ -899,7 +899,7 @@ void Pair::write_file(int narg, char **arg)
|
|||
}
|
||||
|
||||
double r,e,f,rsq;
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (style == R) {
|
||||
|
@ -980,7 +980,7 @@ void Pair::init_bitmap(double inner, double outer, int ntablebits,
|
|||
for (int j = 0; j < ntablebits+nshiftbits; j++) nmask *= 2;
|
||||
nmask -= 1;
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = outer*outer;
|
||||
maskhi = rsq_lookup.i & ~(nmask);
|
||||
rsq_lookup.f = inner*inner;
|
||||
|
|
|
@ -108,7 +108,7 @@ class Pair : protected Pointers {
|
|||
|
||||
// custom data type for accessing Coulomb tables
|
||||
|
||||
typedef union {int i; float f;} table_lookup_t;
|
||||
typedef union {int i; float f;} union_int_float_t;
|
||||
|
||||
double THIRD;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ void PairTable::compute(int eflag, int vflag)
|
|||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
Table *tb;
|
||||
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
|
||||
evdwl = 0.0;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
|
@ -394,7 +394,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
|
|||
|
||||
int itmp;
|
||||
double rtmp;
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
|
||||
fgets(line,MAXLINE,fp);
|
||||
for (int i = 0; i < tb->ninput; i++) {
|
||||
|
@ -677,7 +677,7 @@ void PairTable::compute_table(Table *tb)
|
|||
|
||||
if (tabstyle == BITMAP) {
|
||||
double r;
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
int masklo,maskhi;
|
||||
|
||||
// linear lookup tables of length ntable = 2^n
|
||||
|
@ -694,7 +694,7 @@ void PairTable::compute_table(Table *tb)
|
|||
tb->df = (double *) memory->smalloc(ntable*sizeof(double),"pair:df");
|
||||
tb->drsq = (double *) memory->smalloc(ntable*sizeof(double),"pair:drsq");
|
||||
|
||||
table_lookup_t minrsq_lookup;
|
||||
union_int_float_t minrsq_lookup;
|
||||
minrsq_lookup.i = 0 << tb->nshiftbits;
|
||||
minrsq_lookup.i |= maskhi;
|
||||
|
||||
|
@ -935,7 +935,7 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
|
|||
tb->deltasq6;
|
||||
fforce = factor_lj * value;
|
||||
} else {
|
||||
table_lookup_t rsq_lookup;
|
||||
union_int_float_t rsq_lookup;
|
||||
rsq_lookup.f = rsq;
|
||||
itable = rsq_lookup.i & tb->nmask;
|
||||
itable >>= tb->nshiftbits;
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef ComputeInclude
|
||||
#include "compute_ackland_atom.h"
|
||||
#endif
|
||||
|
||||
#ifdef ComputeClass
|
||||
ComputeStyle(ackland/atom,ComputeAcklandAtom)
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef KSpaceInclude
|
||||
#include "ewald_n.h"
|
||||
#endif
|
||||
|
||||
#ifdef KSpaceClass
|
||||
KSpaceStyle(ewald/n,EwaldN)
|
||||
#endif
|
||||
|
||||
#ifdef PairInclude
|
||||
#include "pair_buck_coul.h"
|
||||
#include "pair_lj_coul.h"
|
||||
#endif
|
||||
|
||||
#ifdef PairClass
|
||||
PairStyle(buck/coul,PairBuckCoul)
|
||||
PairStyle(lj/coul,PairLJCoul)
|
||||
#endif
|
Loading…
Reference in New Issue