Compare commits

...

7 Commits

20 changed files with 122 additions and 88 deletions

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY --> <!-- HTML_ONLY -->
<HEAD> <HEAD>
<TITLE>LAMMPS Users Manual</TITLE> <TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="16 Dec 2016 version"> <META NAME="docnumber" CONTENT="21 Dec 2016 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories"> <META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License."> <META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD> </HEAD>
@ -21,7 +21,7 @@
<H1></H1> <H1></H1>
LAMMPS Documentation :c,h3 LAMMPS Documentation :c,h3
16 Dec 2016 version :c,h4 21 Dec 2016 version :c,h4
Version info: :h4 Version info: :h4

View File

@ -43,7 +43,7 @@ ComputeDpdAtom::ComputeDpdAtom(LAMMPS *lmp, int narg, char **arg) :
size_peratom_cols = 4; size_peratom_cols = 4;
nmax = 0; nmax = 0;
if (atom->dpd_flag != 1) error->all(FLERR,"compute dpd requires atom_style with internal temperature and energies (e.g. dpd)"); if (atom->dpd_flag != 1) error->all(FLERR,"compute dpd requires atom_style with internal temperature and energies (e.g. dpd)");
} }

View File

@ -34,7 +34,7 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), ntables(0), tables(NULL), Fix(lmp, narg, arg), ntables(0), tables(NULL),
tables2(NULL), dHf(NULL), eosSpecies(NULL) tables2(NULL), dHf(NULL), eosSpecies(NULL)
{ {
if (narg != 8) error->all(FLERR,"Illegal fix eos/table/rx command"); if (narg != 8) error->all(FLERR,"Illegal fix eos/table/rx command");

View File

@ -60,12 +60,12 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), mol2param(NULL), nreactions(0), Fix(lmp, narg, arg), mol2param(NULL), nreactions(0),
params(NULL), Arr(NULL), nArr(NULL), Ea(NULL), tempExp(NULL), params(NULL), Arr(NULL), nArr(NULL), Ea(NULL), tempExp(NULL),
stoich(NULL), stoichReactants(NULL), stoichProducts(NULL), kR(NULL), stoich(NULL), stoichReactants(NULL), stoichProducts(NULL), kR(NULL),
pairDPDE(NULL), dpdThetaLocal(NULL), sumWeights(NULL), sparseKinetics_nu(NULL), pairDPDE(NULL), dpdThetaLocal(NULL), sumWeights(NULL), sparseKinetics_nu(NULL),
sparseKinetics_nuk(NULL), sparseKinetics_inu(NULL), sparseKinetics_isIntegralReaction(NULL), sparseKinetics_nuk(NULL), sparseKinetics_inu(NULL), sparseKinetics_isIntegralReaction(NULL),
kineticsFile(NULL), id_fix_species(NULL), kineticsFile(NULL), id_fix_species(NULL),
id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL) id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL)
{ {
if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command"); if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command");
@ -656,7 +656,7 @@ void FixRX::setup_pre_force(int vflag)
memset(dpdThetaLocal, 0, sizeof(double)*count); memset(dpdThetaLocal, 0, sizeof(double)*count);
computeLocalTemperature(); computeLocalTemperature();
} }
for (int id = 0; id < nlocal; id++) for (int id = 0; id < nlocal; id++)
for (int ispecies=0; ispecies<nspecies; ispecies++){ for (int ispecies=0; ispecies<nspecies; ispecies++){
tmp = atom->dvector[ispecies][id]; tmp = atom->dvector[ispecies][id];
@ -667,14 +667,14 @@ void FixRX::setup_pre_force(int vflag)
// Set the reaction rate constants to zero: no reactions occur at step 0 // Set the reaction rate constants to zero: no reactions occur at step 0
for(int irxn=0;irxn<nreactions;irxn++) for(int irxn=0;irxn<nreactions;irxn++)
kR[irxn] = 0.0; kR[irxn] = 0.0;
if (odeIntegrationFlag == ODE_LAMMPS_RK4) if (odeIntegrationFlag == ODE_LAMMPS_RK4)
rk4(i,NULL); rk4(i,NULL);
else if (odeIntegrationFlag == ODE_LAMMPS_RKF45) else if (odeIntegrationFlag == ODE_LAMMPS_RKF45)
rkf45(i,NULL); rkf45(i,NULL);
} }
// Communicate the updated momenta and velocities to all nodes // Communicate the updated momenta and velocities to all nodes
comm->forward_comm_fix(this); comm->forward_comm_fix(this);
if(localTempFlag) delete [] dpdThetaLocal; if(localTempFlag) delete [] dpdThetaLocal;

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing authors: Contributing authors:
James Larentzos and Timothy I. Mattox (Engility Corporation) James Larentzos and Timothy I. Mattox (Engility Corporation)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -147,7 +147,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
// loop over all local atoms in other bins in "half" stencil // loop over all local atoms in other bins in "half" stencil
for (k = 0; k < nstencil_half; k++) { for (k = 0; k < nstencil_half; k++) {
for (j = binhead_ssa[ibin+stencil[k]]; j >= 0; for (j = binhead_ssa[ibin+stencil[k]]; j >= 0;
j = bins_ssa[j]) { j = bins_ssa[j]) {
jtype = type[j]; jtype = type[j];
@ -183,7 +183,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
// Note2: only non-pure locals can have ghosts as neighbors // Note2: only non-pure locals can have ghosts as neighbors
if (ssaAIR[i] == 1) for (k = 0; k < nstencil_full; k++) { if (ssaAIR[i] == 1) for (k = 0; k < nstencil_full; k++) {
for (j = gbinhead_ssa[ibin+stencil[k]]; j >= 0; for (j = gbinhead_ssa[ibin+stencil[k]]; j >= 0;
j = bins_ssa[j]) { j = bins_ssa[j]) {
jtype = type[j]; jtype = type[j];

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing authors: Contributing authors:
James Larentzos and Timothy I. Mattox (Engility Corporation) James Larentzos and Timothy I. Mattox (Engility Corporation)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -15,7 +15,7 @@
NPairStyle(halffull/newton/ssa, NPairStyle(halffull/newton/ssa,
NPairHalffullNewtonSSA, NPairHalffullNewtonSSA,
NP_HALFFULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_HALFFULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON |
NP_ORTHO | NP_TRI | NP_SSA) NP_ORTHO | NP_TRI | NP_SSA)
#else #else

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing authors: Contributing authors:
James Larentzos and Timothy I. Mattox (Engility Corporation) James Larentzos and Timothy I. Mattox (Engility Corporation)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -24,7 +24,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
NStencilHalfBin2dNewtonSSA::NStencilHalfBin2dNewtonSSA(LAMMPS *lmp) : NStencilHalfBin2dNewtonSSA::NStencilHalfBin2dNewtonSSA(LAMMPS *lmp) :
NStencilSSA(lmp) {} NStencilSSA(lmp) {}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Contributing authors: Contributing authors:
James Larentzos and Timothy I. Mattox (Engility Corporation) James Larentzos and Timothy I. Mattox (Engility Corporation)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -24,7 +24,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
NStencilHalfBin3dNewtonSSA::NStencilHalfBin3dNewtonSSA(LAMMPS *lmp) : NStencilHalfBin3dNewtonSSA::NStencilHalfBin3dNewtonSSA(LAMMPS *lmp) :
NStencilSSA(lmp) {} NStencilSSA(lmp) {}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -62,7 +62,7 @@ void NStencilHalfBin3dNewtonSSA::create()
// For k==0, make sure to skip already included bins // For k==0, make sure to skip already included bins
k = 0; k = 0;
for (j = -sy; j <= 0; j++) for (j = -sy; j <= 0; j++)
for (i = -sx; i <= sx; i++) { for (i = -sx; i <= sx; i++) {
if (j == 0 && i > 0) continue; if (j == 0 && i > 0) continue;

View File

@ -182,7 +182,7 @@ void PairDPDfdt::compute(int eflag, int vflag)
wr = 1.0 - r/cut[itype][jtype]; wr = 1.0 - r/cut[itype][jtype];
wd = wr*wr; wd = wr*wr;
randnum = random->gaussian(); randnum = random->gaussian();
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype] gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]
/ (2.0*force->boltz*temperature); / (2.0*force->boltz*temperature);
// conservative force = a0 * wd // conservative force = a0 * wd

View File

@ -206,7 +206,7 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
if (r < EPSILON) continue; // r can be 0.0 in DPD systems if (r < EPSILON) continue; // r can be 0.0 in DPD systems
rinv = 1.0/r; rinv = 1.0/r;
wr = 1.0 - r/cut[itype][jtype]; wr = 1.0 - r/cut[itype][jtype];
wd = wr*wr; wd = wr*wr;
delvx = vxtmp - v[j][0]; delvx = vxtmp - v[j][0];
delvy = vytmp - v[j][1]; delvy = vytmp - v[j][1];
@ -214,11 +214,11 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
dot = delx*delvx + dely*delvy + delz*delvz; dot = delx*delvx + dely*delvy + delz*delvz;
randnum = random->gaussian(); randnum = random->gaussian();
// Compute the current temperature // Compute the current temperature
theta_ij = 0.5*(1.0/dpdTheta[i] + 1.0/dpdTheta[j]); theta_ij = 0.5*(1.0/dpdTheta[i] + 1.0/dpdTheta[j]);
theta_ij = 1.0/theta_ij; theta_ij = 1.0/theta_ij;
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype] gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]
/ (2.0*force->boltz*theta_ij); / (2.0*force->boltz*theta_ij);
// conservative force = a0 * wr // conservative force = a0 * wr
@ -239,44 +239,44 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
f[j][2] -= delz*fpair; f[j][2] -= delz*fpair;
} }
if (rmass) { if (rmass) {
mass_i = rmass[i]; mass_i = rmass[i];
mass_j = rmass[j]; mass_j = rmass[j];
} else { } else {
mass_i = mass[itype]; mass_i = mass[itype];
mass_j = mass[jtype]; mass_j = mass[jtype];
} }
massinv_i = 1.0 / mass_i; massinv_i = 1.0 / mass_i;
massinv_j = 1.0 / mass_j; massinv_j = 1.0 / mass_j;
// Compute the mechanical and conductive energy, uMech and uCond // Compute the mechanical and conductive energy, uMech and uCond
mu_ij = massinv_i + massinv_j; mu_ij = massinv_i + massinv_j;
mu_ij *= force->ftm2v; mu_ij *= force->ftm2v;
uTmp = gamma_ij*wd*rinv*rinv*dot*dot uTmp = gamma_ij*wd*rinv*rinv*dot*dot
- 0.5*sigma[itype][jtype]*sigma[itype][jtype]*mu_ij*wd; - 0.5*sigma[itype][jtype]*sigma[itype][jtype]*mu_ij*wd;
uTmp -= sigma[itype][jtype]*wr*rinv*dot*randnum*dtinvsqrt; uTmp -= sigma[itype][jtype]*wr*rinv*dot*randnum*dtinvsqrt;
uTmp *= 0.5; uTmp *= 0.5;
duMech[i] += uTmp; duMech[i] += uTmp;
if (newton_pair || j < nlocal) { if (newton_pair || j < nlocal) {
duMech[j] += uTmp; duMech[j] += uTmp;
} }
// Compute uCond // Compute uCond
randnum = random->gaussian(); randnum = random->gaussian();
kappa_ij = kappa[itype][jtype]; kappa_ij = kappa[itype][jtype];
alpha_ij = sqrt(2.0*force->boltz*kappa_ij); alpha_ij = sqrt(2.0*force->boltz*kappa_ij);
randPair = alpha_ij*wr*randnum*dtinvsqrt; randPair = alpha_ij*wr*randnum*dtinvsqrt;
uTmp = kappa_ij*(1.0/dpdTheta[i] - 1.0/dpdTheta[j])*wd;
uTmp += randPair;
duCond[i] += uTmp;
if (newton_pair || j < nlocal) {
duCond[j] -= uTmp;
}
uTmp = kappa_ij*(1.0/dpdTheta[i] - 1.0/dpdTheta[j])*wd;
uTmp += randPair;
duCond[i] += uTmp;
if (newton_pair || j < nlocal) {
duCond[j] -= uTmp;
}
if (eflag) { if (eflag) {
// unshifted eng of conservative term: // unshifted eng of conservative term:
// evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]);

View File

@ -182,7 +182,7 @@ void PairMultiLucy::compute(int eflag, int vflag)
f[j][2] -= delz*fpair; f[j][2] -= delz*fpair;
} }
if (evflag) ev_tally(i,j,nlocal,newton_pair, if (evflag) ev_tally(i,j,nlocal,newton_pair,
0.0,0.0,fpair,delx,dely,delz); 0.0,0.0,fpair,delx,dely,delz);
} }
} }
@ -201,7 +201,7 @@ void PairMultiLucy::compute(int eflag, int vflag)
evdwl *=(pi*cutsq[itype][itype]*cutsq[itype][itype])/84.0; evdwl *=(pi*cutsq[itype][itype]*cutsq[itype][itype])/84.0;
if (evflag) ev_tally(0,0,nlocal,newton_pair, if (evflag) ev_tally(0,0,nlocal,newton_pair,
evdwl,0.0,0.0,0.0,0.0,0.0); evdwl,0.0,0.0,0.0,0.0,0.0);
} }
if (vflag_fdotr) virial_fdotr_compute(); if (vflag_fdotr) virial_fdotr_compute();

View File

@ -847,6 +847,7 @@ void AtomVecBody::unpack_border(int n, int first, double *buf)
inertia[2] = buf[m++]; inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i; bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i; bonus[j].ndouble = (int) ubuf(buf[m++]).i;
// corresponding put() calls are in clear_bonus()
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex); bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex); bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]); m += bptr->unpack_border_body(&bonus[j],&buf[m]);
@ -897,6 +898,7 @@ void AtomVecBody::unpack_border_vel(int n, int first, double *buf)
inertia[2] = buf[m++]; inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i; bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i; bonus[j].ndouble = (int) ubuf(buf[m++]).i;
// corresponding put() calls are in clear_bonus()
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex); bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex); bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]); m += bptr->unpack_border_body(&bonus[j],&buf[m]);
@ -946,6 +948,7 @@ int AtomVecBody::unpack_border_hybrid(int n, int first, double *buf)
inertia[2] = buf[m++]; inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i; bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i; bonus[j].ndouble = (int) ubuf(buf[m++]).i;
// corresponding put() calls are in clear_bonus()
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex); bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex); bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]); m += bptr->unpack_border_body(&bonus[j],&buf[m]);
@ -1050,6 +1053,7 @@ int AtomVecBody::unpack_exchange(double *buf)
inertia[2] = buf[m++]; inertia[2] = buf[m++];
bonus[nlocal_bonus].ninteger = (int) ubuf(buf[m++]).i; bonus[nlocal_bonus].ninteger = (int) ubuf(buf[m++]).i;
bonus[nlocal_bonus].ndouble = (int) ubuf(buf[m++]).i; bonus[nlocal_bonus].ndouble = (int) ubuf(buf[m++]).i;
// corresponding put() calls are in copy()
bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger, bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger,
bonus[nlocal_bonus].iindex); bonus[nlocal_bonus].iindex);
bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble, bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble,

View File

@ -57,10 +57,10 @@ namespace LAMMPS_NS {
template<class T> template<class T>
class MyPage { class MyPage {
public:
int ndatum; // total # of stored datums int ndatum; // total # of stored datums
int nchunk; // total # of stored chunks int nchunk; // total # of stored chunks
public:
MyPage() { MyPage() {
ndatum = nchunk = 0; ndatum = nchunk = 0;
pages = NULL; pages = NULL;

View File

@ -33,7 +33,7 @@ methods:
minchunk <= N <= maxchunk required minchunk <= N <= maxchunk required
put(index) = return indexed chunk to pool (same index returned by get) put(index) = return indexed chunk to pool (same index returned by get)
int size() = return total size of allocated pages in bytes int size() = return total size of allocated pages in bytes
public varaibles: public variables:
ndatum = total # of stored datums ndatum = total # of stored datums
nchunk = total # of stored chunks nchunk = total # of stored chunks
size = total size of all allocated pages in daums size = total size of all allocated pages in daums

View File

@ -192,6 +192,7 @@ void NeighList::setup_pages(int pgsize_caller, int oneatom_caller)
gran calls grow() in granhistory gran calls grow() in granhistory
respaouter calls grow() in respainner, respamiddle respaouter calls grow() in respainner, respamiddle
triggered by neighbor list build triggered by neighbor list build
not called if a copy list
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void NeighList::grow(int nlocal, int nall) void NeighList::grow(int nlocal, int nall)

View File

@ -1369,6 +1369,8 @@ int Neighbor::choose_pair(NeighRequest *rq)
"with ghost neighbors"); "with ghost neighbors");
// flags for settings the request + system requires of NPair class // flags for settings the request + system requires of NPair class
// some are set to 0/1, others are set to mask bit
// comparisons below in loop over classes reflect that
// copyflag = no/yes copy request // copyflag = no/yes copy request
// skipflag = no/yes skip request // skipflag = no/yes skip request
// halfflag = half request (gran and respa are also half lists) // halfflag = half request (gran and respa are also half lists)
@ -1402,7 +1404,7 @@ int Neighbor::choose_pair(NeighRequest *rq)
// NOTE: exactly one of these request flags is set (see neigh_request.h) // NOTE: exactly one of these request flags is set (see neigh_request.h)
// this requires gran/respaouter also set halfflag // this requires gran/respaouter also set halfflag
// can simplify this logic, if follow NOTE in neigh_request.h // can simplify this logic, if follow NOTE in neigh_request.h
// all why do size/off2on and size/off2on/oneside set NP_HALF // why do size/off2on and size/off2on/oneside set NP_HALF
// either should set both half & full, or half should be in file name // either should set both half & full, or half should be in file name
// to be consistent with how other NP classes use "half" // to be consistent with how other NP classes use "half"
@ -1433,9 +1435,8 @@ int Neighbor::choose_pair(NeighRequest *rq)
else if (rq->newton == 1) newtflag = 1; else if (rq->newton == 1) newtflag = 1;
else if (rq->newton == 2) newtflag = 0; else if (rq->newton == 2) newtflag = 0;
// use flags to match exactly one of NPair class masks, bit by bit // use flags to match exactly one of NPair class masks
// copyflag match returns with no further checks // sequence of checks is bit by bit in NeighConst
// exactly one of halfflag,fullflag,halffullflag is set and thus must match
int mask; int mask;
@ -1447,13 +1448,21 @@ int Neighbor::choose_pair(NeighRequest *rq)
for (int i = 0; i < npclass; i++) { for (int i = 0; i < npclass; i++) {
mask = pairmasks[i]; mask = pairmasks[i];
if (copyflag && (mask & NP_COPY)) { // if copyflag set, return or continue with no further checks
if (copyflag) {
if (!(mask & NP_COPY)) continue;
if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue; if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue;
if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue; if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue;
return i+1; return i+1;
} }
// skipflag must match along with other flags, so do not return
if (skipflag != (mask & NP_SKIP)) continue; if (skipflag != (mask & NP_SKIP)) continue;
// exactly one of halfflag,fullflag,halffullflag is set and must match
if (halfflag) { if (halfflag) {
if (!(mask & NP_HALF)) continue; if (!(mask & NP_HALF)) continue;
} else if (fullflag) { } else if (fullflag) {
@ -1470,19 +1479,38 @@ int Neighbor::choose_pair(NeighRequest *rq)
if (ssaflag != (mask & NP_SSA)) continue; if (ssaflag != (mask & NP_SSA)) continue;
if (ompflag != (mask & NP_OMP)) continue; if (ompflag != (mask & NP_OMP)) continue;
if (intelflag != (mask & NP_INTEL)) continue; if (intelflag != (mask & NP_INTEL)) continue;
// style is one of NSQ,BIN,MULTI and must match
if (style == NSQ) {
if (!(mask & NP_NSQ)) continue;
} else if (style == BIN) {
if (!(mask & NP_BIN)) continue;
} else if (style == MULTI) {
if (!(mask & NP_MULTI)) continue;
}
// newtflag is on or off and must match
if (newtflag) {
if (!(mask & NP_NEWTON)) continue;
} else if (!newtflag) {
if (!(mask & NP_NEWTOFF)) continue;
}
// triclinic flag is on or off and must match
if (triclinic) {
if (!(mask & NP_TRI)) continue;
} else if (!triclinic) {
if (!(mask & NP_ORTHO)) continue;
}
// Kokkos flags
if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue; if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue;
if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue; if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue;
if (style == NSQ && !(mask & NP_NSQ)) continue;
if (style == BIN && !(mask & NP_BIN)) continue;
if (style == MULTI && !(mask & NP_MULTI)) continue;
if (newtflag && !(mask & NP_NEWTON)) continue;
if (!newtflag && !(mask & NP_NEWTOFF)) continue;
if (!triclinic && !(mask & NP_ORTHO)) continue;
if (triclinic && !(mask & NP_TRI)) continue;
return i+1; return i+1;
} }
@ -1727,7 +1755,7 @@ void Neighbor::build(int topoflag)
for (i = 0; i < npair_perpetual; i++) { for (i = 0; i < npair_perpetual; i++) {
m = plist[i]; m = plist[i];
lists[m]->grow(nlocal,nall); if (!lists[m]->copy) lists[m]->grow(nlocal,nall);
neigh_pair[m]->build_setup(); neigh_pair[m]->build_setup();
neigh_pair[m]->build(lists[m]); neigh_pair[m]->build(lists[m]);
} }

View File

@ -15,7 +15,8 @@
NPairStyle(skip, NPairStyle(skip,
NPairSkip, NPairSkip,
NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_SKIP | NP_HALF | NP_FULL | NP_HALFFULL |
NP_NSQ | NP_BIN | NP_MULTI |
NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI)
#else #else

View File

@ -38,7 +38,7 @@ class Python {
void invoke_function(int, char *) {} void invoke_function(int, char *) {}
int find(char *) {return -1;} int find(char *) {return -1;}
int variable_match(char *, char *, int) {return -1;} int variable_match(char *, char *, int) {return -1;}
char *long_string(int) {return NULL;}
}; };
} }

View File

@ -1 +1 @@
#define LAMMPS_VERSION "16 Dec 2016" #define LAMMPS_VERSION "21 Dec 2016"