lammps-users Digest, Vol 68, Issue 1

Dear All, what is the purpose of the single(...) routin in the
pair_eam potential, as in this case the sum of single pairs are not
the full energy? I have added TBSMA scheme based on the pair_eam.cpp,
altough im not completely sure in the role of the variables (in the
source in the compute routin, code pasted below)
eng_vdwl , eatom, vdwl, ev_tally(...) and the corresponding flags, can
anyone explain?
thanks
David

  // fp = derivative of embedding energy at each atom
  // phi = embedding energy at each atom

  for (ii = 0; ii < inum; ii++) {
    i = ilist[ii];
    p = rho[i]*rdrho + 1.0;
    m = static_cast<int> (p);
    m = MAX(1,MIN(m,nrho-1));
    p -= m;
    p = MIN(p,1.0);
    coeff = frho_spline[type2frho[type[i]]][m];
    fp[i] = (coeff[0]*p + coeff[1])*p + coeff[2];
    if (eflag) {
      phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
      if (eflag_global) eng_vdwl += phi;
      if (eflag_atom) eatom[i] += phi;
    }
  }

Dear All, what is the purpose of the single(...) routin in the
pair_eam potential, as in this case the sum of single pairs are not

Pair::single() is used to compute pairwise energy and force contributions
for compute group/group and equivalent operations. it is *not* used by
Pair::compute()

the full energy? I have added TBSMA scheme based on the pair_eam.cpp,
altough im not completely sure in the role of the variables (in the
source in the compute routin, code pasted below)
eng_vdwl , eatom, vdwl, ev_tally(...) and the corresponding flags, can
anyone explain?

have a look at the headers, especially pair.h,
but also pair.cpp study the pair_lj_cut.h/cpp
code, and have a look at the developer guide.
i strongly recommend to have a careful look
at lj/cut pair style, as this is the easiest pair
style and you should know what it is supposed
to do and thus can derive what you want to know.

most of what you are asking about is
rather self explanatory; if you don't see
it right now, keep reading.

ev_tally() is provided in pair.cpp and is one
of a selection of functions that tally energy
and virial information into the corresponding
accumulator variables and arrays. for pair
wise calculations, there are two accumulators,
one for coulomb type interactions and one
for non-coulomb (vdwl).

axel.

As the doc page for pair_write states, the single routine
for pair eam just gives you the pairwise
portion of the energy. Not the manybody
(embedded) part.

Steve