diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 2b3ec0fcad..fcef67b985 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -351,7 +351,7 @@ double PairEAM::compute_atomic_energy(int i, NeighList *neighborList) double* coeff; double Ei = 0.0; double rhoi = 0.0; - + double xi = atom->x[i][0]; double yi = atom->x[i][1]; double zi = atom->x[i][2]; @@ -382,7 +382,7 @@ double PairEAM::compute_atomic_energy(int i, NeighList *neighborList) // sum pair energy ij // divide by 2 to avoid double counting energy - + coeff = z2r_spline[type2z2r[jtype][itype]][m]; double z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6]; Ei += 0.5*z2 / r; @@ -393,7 +393,7 @@ double PairEAM::compute_atomic_energy(int i, NeighList *neighborList) } // compute the change in embedding energy of atom i. - + p = rhoi * rdrho + 1.0; m = static_cast(p); m = MAX(1, MIN(m, nrho - 1)); diff --git a/src/MC/fix_sgcmc.cpp b/src/MC/fix_sgcmc.cpp index 4f2c48f45b..cc990f375a 100644 --- a/src/MC/fix_sgcmc.cpp +++ b/src/MC/fix_sgcmc.cpp @@ -195,12 +195,12 @@ FixSemiGrandCanonicalMC::FixSemiGrandCanonicalMC(LAMMPS *_lmp, int narg, char ** if (comm->nprocs != 1) error->all(FLERR, "Cannot use serial mode Monte Carlo in a parallel simulation."); - + } else if (strcmp(arg[iarg],"atomic/energy") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, fmt::format("fix {} atomic/energy", style), error); atomicenergyflag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; - + } else { error->all(FLERR, "Unknown fix sgcmc keyword: {}", arg[iarg]); } @@ -274,7 +274,7 @@ void FixSemiGrandCanonicalMC::init() compute_pe = modify->get_compute_by_id("thermo_pe"); } } - + interactionRadius = force->pair->cutforce; if (comm->me == 0) utils::logmesg(lmp, " SGC - Interaction radius: {}\n", interactionRadius); @@ -285,7 +285,6 @@ void FixSemiGrandCanonicalMC::init() neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_GHOST); else neighbor->add_request(this, NeighConst::REQ_FULL); - // Count local number of atoms from each species. const int *type = atom->type; @@ -403,7 +402,7 @@ void FixSemiGrandCanonicalMC::doMC() deltaN[newSpecies] = +1; // Compute the energy difference that swapping this atom would cost or gain. - + // Atomic energy method: if(atomicenergyflag) { deltaE = computeEnergyChangeEatom(selectedAtom, oldSpecies, newSpecies); @@ -416,7 +415,7 @@ void FixSemiGrandCanonicalMC::doMC() deltaE = computeEnergyChangeGeneric(selectedAtom, oldSpecies, newSpecies); } } - + // Perform inner MC acceptance test. double dm = 0.0; if (serialMode && kappa != 0.0) { @@ -1037,9 +1036,9 @@ double FixSemiGrandCanonicalMC::computeEnergyChangeEatom(int flipAtom, int oldSp // Calculate old atomic energy of selected atom Eold = force->pair->compute_atomic_energy(flipAtom, neighborList); - + // calculate the old per-atom energy of neighbors - + int* jlist = neighborList->firstneigh[flipAtom]; int jnum = neighborList->numneigh[flipAtom]; @@ -1053,14 +1052,14 @@ double FixSemiGrandCanonicalMC::computeEnergyChangeEatom(int flipAtom, int oldSp atom->type[flipAtom] = newSpecies; Enew = force->pair->compute_atomic_energy(flipAtom, neighborList); - + // calculate the new per-atom energy of neighbors - + for(int jj = 0; jj < jnum; jj++) { int j = jlist[jj]; Enew += force->pair->compute_atomic_energy(j, neighborList); } - + atom->type[flipAtom] = oldSpecies; deltaE = Enew - Eold; @@ -1071,8 +1070,8 @@ double FixSemiGrandCanonicalMC::computeEnergyChangeEatom(int flipAtom, int oldSp } /********************************************************************* - * - * + * Flips the type of one atom. + * This routine is for the per-atom energy case. *********************************************************************/ void FixSemiGrandCanonicalMC::flipAtomEatom(int flipAtom, int oldSpecies, int newSpecies) diff --git a/src/pair.cpp b/src/pair.cpp index 16cb5fb08f..78b2e13ee3 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -91,7 +91,7 @@ Pair::Pair(LAMMPS *lmp) : centroidstressflag = CENTROID_SAME; atomic_energy_enable = 0; - + // pair_modify settings compute_flag = 1; diff --git a/tools/coding_standard/README b/tools/coding_standard/README index b19d7241f4..da4552e081 100644 --- a/tools/coding_standard/README +++ b/tools/coding_standard/README @@ -6,3 +6,8 @@ whitespace.py detects TAB characters and trailing whitespace homepage.py detects outdated LAMMPS homepage URLs (pointing to sandia.gov instead of lammps.org) errordocs.py detects deprecated error docs in header files versiontags.py detects .. versionadded:: and .. versionchanged:: with pending version date + +Example usage: python3 versiontags.py + +where is the path of a LAMMPS directory containing subdirs src/, python/, doc/src/, etc. +