Hello everyone,
I have been spending some time recently studying the numerical routines in lammps. I am traditionally a fortran coder, and have had some issues fully understanding what is going on in the force routine say in pair_lj_cut.cpp. Specifically, in the inner loop there is something like
for(jj = 0; jj < num; j++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
…
}
I know that the factor_lj is meant to determine the scaling of the LJ and electrostatic force for 1-2 1-3 and 1-4 neighbors, but I can’t seem to figure out where the array sbmask is determined. I am assuming it is an array that is number of particles * max number of neighbors long, but I am not positive. Could somebody give me some information on this? I also noticed this is a different method than used in lammps 2001, does anyone know if this is significantly more efficient?
My last question is about the wolf electrostatic cut off method in lammps. I noticed that there is no specific lj_charmm_coul_dsf option only lj_cut_coul_dsf. Does this mean that the charmm potential is not compatable with the wolf method, or that it is just currently not an option in lammps?
thank you,
conor
Hello everyone,
I have been spending some time recently studying the numerical routines in
lammps. I am traditionally a fortran coder, and have had some issues fully
understanding what is going on in the force routine say in pair_lj_cut.cpp.
Specifically, in the inner loop there is something like
for(jj = 0; jj < num; j++) {
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
....
}
I know that the factor_lj is meant to determine the scaling of the LJ and
electrostatic force for 1-2 1-3 and 1-4 neighbors, but I can't seem to
figure out where the array sbmask is determined. I am assuming it is an
array that is number of particles * max number of neighbors long, but I am
no. sbmask is *not* an array. this is C++, not fortran! it is an
inline function defined in pair. h that returns an index indicating
whether a pair should be treated as 1-2, 1-3, or 1-4 neighbors. that
index is encoded into the upper bits of the neighbor list index (hence
the need to blank them out later).
not positive. Could somebody give me some information on this? I also
noticed this is a different method than used in lammps 2001, does anyone
know if this is significantly more efficient?
it used to be done explicitly, even in C++, but this approach is more
portable, readable and maintainable.
My last question is about the wolf electrostatic cut off method in lammps. I
noticed that there is no specific lj_charmm_coul_dsf option only
lj_cut_coul_dsf. Does this mean that the charmm potential is not compatable
with the wolf method, or that it is just currently not an option in lammps?
i don't understand that question. what has lj/cut/coul/dsf got to do
with wolf summation?
CHARMM doesn't do wolf summation but either a smoothed coulomb cutoff
or long-range electrostatics with a kspace solver. if you want
something like lj/charmm/coul/wolf, you will have to write it
yourself. please note, that you should also just implement lj/charmm
and then use hybrid/overlay. unless you are a stickler for perfect
reproduction, the charmm smoothing on LJ should not worry you too much
(but then wolf summation shouldn't be an option either) and you can
just use lj/cut with a reasonably large cutoff (say 14 \AA) and then
wolf summation. please keep in mind that wolf summation is only a good
choice for certain types of systems and can produce significant
artifacts elsewhere (like all short-range smoothed or cutoff coulomb
approaches).
axel.
Axel,
Thank you for your response. The sbmask makes a lot more sense now. Regarding the wolf summation, the webpage describing the LJ_CUT/COUL_DSF pair_style (http://lammps.sandia.gov/doc/pair_lj.html) says it implements the potential described in fennels paper, “is the ewald summation still necessary.Pairwise alternatives to the accepted standard for long range electrostatics.” This paper describes the potential used by wolf and its variants, along with how well the potentials perform. Thus, I was under the impression that it was kosher to say one is using a wolf summation for the electrostatics when using the DSF pair style. Is this not correct?
Axel,
Thank you for your response. The sbmask makes a lot more sense now.
Regarding the wolf summation, the webpage describing the LJ_CUT/COUL_DSF
pair_style (LAMMPS Molecular Dynamics Simulator) says it implements
the potential described in fennels paper, "is the ewald summation still
necessary.Pairwise alternatives to the accepted standard for long range
electrostatics." This paper describes the potential used by wolf and its
variants, along with how well the potentials perform. Thus, I was under the
impression that it was kosher to say one is using a wolf summation for the
electrostatics when using the DSF pair style. Is this not correct?
in the context of LAMMPS, i would definitely avoid such sloppy
wording, since there is a family of coul/wolf styles that implement
specifically the wolf summation. the coul/dsf style is similar, but
not exactly the same. good science requires attention to details...

axel.