2006-09-22 00:22:34 +08:00
< HTML >
< CENTER > < A HREF = "http://lammps.sandia.gov" > LAMMPS WWW Site< / A > - < A HREF = "Manual.html" > LAMMPS Documentation< / A > - < A HREF = "Section_commands.html#comm" > LAMMPS Commands< / A >
< / CENTER >
< HR >
< H3 > kspace_style command
< / H3 >
< P > < B > Syntax:< / B >
< / P >
< PRE > kspace_style style value
< / PRE >
2012-10-03 08:31:31 +08:00
< UL > < LI > style = < I > none< / I > or < I > ewald< / I > or < I > ewald/disp< / I > or < I > ewald/omp< / I > or < I > pppm< / I > or < I > pppm/cg< / I > or < I > pppm/disp< / I > or < I > pppm/tip4p< / I > or < I > pppm/disp/tip4p< / I > or < I > pppm/gpu< / I > or < I > pppm/omp< / I > or < I > pppm/cg/omp< / I > or < I > pppm/tip4p/omp< / I > or < I > pppm/proxy< / I > or < I > pppm/tip4p/proxy< / I > or < I > msm< / I >
2006-09-22 00:22:34 +08:00
2012-10-03 08:31:31 +08:00
< PRE > < I > none< / I > value = none
2012-02-29 06:00:18 +08:00
< I > ewald< / I > value = accuracy
accuracy = desired relative error in forces
2012-10-03 07:38:15 +08:00
< I > ewald/disp< / I > value = accuracy
accuracy = desired relative error in forces
2012-08-07 05:20:08 +08:00
< I > ewald/omp< / I > value = accuracy
accuracy = desired relative error in forces
2012-02-29 06:00:18 +08:00
< I > pppm< / I > value = accuracy
accuracy = desired relative error in forces
< I > pppm/cg< / I > value = accuracy (smallq)
accuracy = desired relative error in forces
2011-08-09 03:49:47 +08:00
smallq = cutoff for charges to be considered (optional) (charge units)
2012-10-03 07:38:15 +08:00
< I > pppm/disp< / I > value = accuracy
accuracy = desired relative error in forces
2012-02-29 06:00:18 +08:00
< I > pppm/tip4p< / I > value = accuracy
accuracy = desired relative error in forces
2012-10-03 07:38:15 +08:00
< I > pppm/disp/tip4p< / I > value = accuracy
accuracy = desired relative error in forces
2012-02-29 06:00:18 +08:00
< I > pppm/gpu< / I > value = accuracy
accuracy = desired relative error in forces
< I > pppm/omp< / I > value = accuracy
accuracy = desired relative error in forces
2012-10-03 07:38:15 +08:00
< I > pppm/cg/omp< / I > value = accuracy
accuracy = desired relative error in forces
2012-03-02 23:44:23 +08:00
< I > pppm/tip4p/omp< / I > value = accuracy
accuracy = desired relative error in forces
2012-02-29 06:00:18 +08:00
< I > pppm/proxy< / I > value = accuracy
2012-08-07 05:20:08 +08:00
accuracy = desired relative error in forces
< I > pppm/tip4p/proxy< / I > value = accuracy
2012-09-14 03:50:50 +08:00
accuracy = desired relative error in forces
2012-10-03 08:31:31 +08:00
< I > msm< / I > value = accuracy
accuracy = desired relative error in forces
< / PRE >
2006-09-22 00:22:34 +08:00
< / UL >
< P > < B > Examples:< / B >
< / P >
< PRE > kspace_style pppm 1.0e-4
2011-08-09 03:49:47 +08:00
kspace_style pppm/cg 1.0e-5 1.0e-6
2012-09-14 03:50:50 +08:00
kspace style msm 1.0e-4
2006-09-22 00:22:34 +08:00
kspace_style none
< / PRE >
< P > < B > Description:< / B >
< / P >
2012-10-03 07:38:15 +08:00
< P > Define a long-range solver for LAMMPS to use each timestep to compute
long-range Coulombic interactions or long-range 1/r^6 interactions.
Most of the long-range solvers perform their computation in K-space,
hence the name of this command.
< / P >
< P > When such a solver is used in conjunction with an appropriate pair
style, the cutoff for Coulombic or 1/r^N interactions is effectively
infinite. If the Coulombic case, this means each charge in the system
interacts with charges in an infinite array of periodic images of the
simulation domain.
< / P >
< P > Note that using a long-range solver requires use of a matching < A HREF = "pair.html" > pair
style< / A > to perform consistent short-range pairwise
calculations. This means that the name of the pair style contains a
2012-10-03 23:42:45 +08:00
matching keyword to the name of the KSpace style, as in this table:
2012-10-03 07:38:15 +08:00
< / P >
< DIV ALIGN = center > < TABLE BORDER = 1 >
< TR ALIGN = "center" > < TD > Pair style < / TD > < TD > KSpace style < / TD > < / TR >
2012-10-03 23:42:45 +08:00
< TR ALIGN = "center" > < TD > coul/long < / TD > < TD > ewald or pppm< / TD > < / TR >
< TR ALIGN = "center" > < TD > coul/msm < / TD > < TD > msm< / TD > < / TR >
< TR ALIGN = "center" > < TD > lj/long or buck/long < / TD > < TD > disp (for dispersion)< / TD > < / TR >
< TR ALIGN = "center" > < TD > tip4p/long < / TD > < TD > tip4p< / TD > < / TR >
2012-10-03 07:38:15 +08:00
< TR ALIGN = "center" > < TD > proxy < / TD > < TD > proxy
< / TD > < / TR > < / TABLE > < / DIV >
2012-08-07 05:20:08 +08:00
< HR >
2006-09-22 00:22:34 +08:00
< P > The < I > ewald< / I > style performs a standard Ewald summation as described in
any solid-state physics text.
< / P >
2012-10-03 07:38:15 +08:00
< P > The < I > ewald/disp< / I > style adds a long-range dispersion sum option for
1/r^6 potentials and is useful for simulation of interfaces
< A HREF = "#Veld" > (Veld)< / A > . It also performs standard Coulombic Ewald summations,
but in a more efficient manner than the < I > ewald< / I > style. The 1/r^6
capability means that Lennard-Jones or Buckingham potentials can be
used without a cutoff, i.e. they become full long-range potentials.
2012-10-03 07:18:29 +08:00
< / P >
2012-10-03 07:38:15 +08:00
< P > The < I > ewald/disp< / I > style can also be used with non-orthogonal (triclinic
symmetry) simulation boxes. It is currently the only long-range
solver that has this capability.
2012-10-03 07:18:29 +08:00
< / P >
2012-08-07 05:20:08 +08:00
< HR >
2006-09-22 00:22:34 +08:00
< P > The < I > pppm< / I > style invokes a particle-particle particle-mesh solver
< A HREF = "#Hockney" > (Hockney)< / A > which maps atom charge to a 3d mesh, uses 3d FFTs
to solve Poisson's equation on the mesh, then interpolates electric
fields on the mesh points back to the atoms. It is closely related to
the particle-mesh Ewald technique (PME) < A HREF = "#Darden" > (Darden)< / A > used in
AMBER and CHARMM. The cost of traditional Ewald summation scales as
N^(3/2) where N is the number of atoms in the system. The PPPM solver
scales as Nlog(N) due to the FFTs, so it is almost always a faster
choice < A HREF = "#Pollock" > (Pollock)< / A > .
< / P >
2011-08-09 03:49:47 +08:00
< P > The < I > pppm/cg< / I > style is identical to the < I > pppm< / I > style except that it
has an optimization for systems where most particles are uncharged.
The optional < I > smallq< / I > argument defines the cutoff for the absolute
charge value which determines whether a particle is considered charged
or not. Its default value is 1.0e-5.
< / P >
2006-09-22 00:22:34 +08:00
< P > The < I > pppm/tip4p< / I > style is identical to the < I > pppm< / I > style except that it
adds a charge at the massless 4th site in each TIP4P water molecule.
It should be used with < A HREF = "pair_style.html" > pair styles< / A > with a
< I > long/tip4p< / I > in their style name.
< / P >
2012-10-03 07:38:15 +08:00
< P > The < I > pppm/disp< / I > and < I > pppm/disp/tip4p< / I > styles add a long-range
dispersion sum option for 1/r^6 potentials, similar to the
< I > ewald/disp< / I > style. The 1/r^6 capability means that Lennard-Jones or
Buckingham potentials can be used without a cutoff, i.e. they become
full long-range potentials.
< / P >
< P > The < I > pppm/proxy< / I > and < I > pppm/tip4p/proxy< / I > styles are special variants
for calculations in hybrid OpenMP/MPI parallel mode. They are
functionally equivalent to < I > pppm< / I > and < I > pppm/tip4p< / I > , but the force
computation is executed as a single thread concurrently with a
multi-threaded non-bonded calculation for a pair style with < I > pppm/omp< / I >
suffix. For calcuations across many multi-core nodes, this can have a
performance benefit over performing the real and reciprocal space part
separately, specifically when otherwise the time spent on the pair
style would slightly less than in < I > pppm< / I > without threading.
< / P >
< P > IMPORTANT NOTE: All of the PPPM styles can be used with
single-precision FFTs by using the compiler switch -DFFT_SINGLE for
the FFT_INC setting in your lo-level Makefile. This setting also
changes some of the PPPM operations (e.g. mapping charge to mesh and
interpolating electric fields to particles) to be performed in single
precision. This option can speed-up long-range calulations,
particularly in parallel or on GPUs. The use of the -DFFT_SINGLE flag
is discussed in < A HREF = "Section_start.html#start_2_4" > this section< / A > of the
manual.
2011-08-09 03:49:47 +08:00
< / P >
2011-05-02 23:01:49 +08:00
< HR >
2012-09-14 03:50:50 +08:00
< P > The < I > msm< / I > style invokes a multi-level summation method MSM solver
< A HREF = "#Hardy" > (Hardy)< / A > which maps atom charge to a 3d mesh, and uses a
multi-level hierarchy of coarser and coarser meshes on which direct
coulomb solves are done. This method does not use FFTs and scales
as N. It may therefore be faster than the other K-space solvers for
relatively large problems when running on large core counts.
< / P >
< P > MSM is most competitive versus Ewald and PPPM when only relatively
low accuracy forces, about 1% relative error or higher, are needed.
Note that MSM speed will be poor for large MSM meshes
(i.e. 64 x 64 x 64 or larger). Also note that use of a larger
coulomb cutoff (i.e. 15 angstroms instead of 10 angstroms) provides
better MSM accuracy for both the real space and grid computed forces.
Beware that the error estimation method for MSM is not very accurate,
so you should probably set your own mesh size and ensure that you are
getting adequate force accuracy by doing an energy conservation test
or comparison versus the Ewald method.
< / P >
< HR >
2012-02-29 06:00:18 +08:00
< P > The specified < I > accuracy< / I > determines the relative RMS error in per-atom
forces calculated by the long-range solver. It is set as a
dimensionless number, relative to the force that two unit point
charges (e.g. 2 monovalent ions) exert on each other at a distance of
1 Angstrom. This reference value was chosen as representative of the
magnitude of electrostatic forces in atomic systems. Thus an accuracy
value of 1.0e-4 means that the RMS error will be a factor of 10000
smaller than the reference force.
< / P >
< P > The accuracy setting is used in conjunction with the pairwise cutoff
to determine the number of K-space vectors for style < I > ewald< / I > or the
2012-09-14 03:50:50 +08:00
FFT grid size for style < I > pppm< / I > or < I > msm< / I > .
2006-09-22 00:22:34 +08:00
< / P >
2012-03-02 23:44:23 +08:00
< P > RMS force errors in real space for < I > ewald< / I > and < I > pppm< / I > are estimated
using equation 18 of < A HREF = "#Kolafa" > (Kolafa)< / A > , which is also referenced as
equation 9 of < A HREF = "#Petersen" > (Petersen)< / A > . RMS force errors in K-space for
< I > ewald< / I > are estimated using equation 11 of < A HREF = "#Petersen" > (Petersen)< / A > ,
which is similar to equation 32 of < A HREF = "#Kolafa" > (Kolafa)< / A > . RMS force
errors in K-space for < I > pppm< / I > are estimated using equation 38 of
2012-09-14 03:50:50 +08:00
< A HREF = "#Deserno" > (Deserno)< / A > . RMS force errors for < I > msm< / I > are estimated
following the procedure outlined in chapter 3 of < A HREF = "#Hardy" > (Hardy)< / A > ,
with equation 3.197 of particular note.
2012-03-02 03:23:14 +08:00
< / P >
2008-08-21 06:23:13 +08:00
< P > See the < A HREF = "kspace_modify.html" > kspace_modify< / A > command for additional
2012-02-29 06:00:18 +08:00
options of the K-space solvers that can be set, including a < I > force< / I >
option for setting an absoulte RMS error in forces, as opposed to a
relative RMS error.
2008-08-21 06:23:13 +08:00
< / P >
2011-05-02 23:01:49 +08:00
< HR >
2011-12-14 04:35:35 +08:00
< P > Styles with a < I > cuda< / I > , < I > gpu< / I > , < I > omp< / I > , or < I > opt< / I > suffix are functionally
the same as the corresponding style without the suffix. They have
been optimized to run faster, depending on your available hardware, as
discussed in < A HREF = "Section_accelerate.html" > Section_accelerate< / A > of the
manual. The accelerated styles take the same arguments and should
2011-06-09 05:26:06 +08:00
produce the same results, except for round-off and precision issues.
< / P >
2011-08-09 03:49:47 +08:00
< P > More specifically, the < I > pppm/gpu< / I > style performs charge assignment and
force interpolation calculations on the GPU. These processes are
performed either in single or double precision, depending on whether
the -DFFT_SINGLE setting was specified in your lo-level Makefile, as
discussed above. The FFTs themselves are still calculated on the CPU.
If < I > pppm/gpu< / I > is used with a GPU-enabled pair style, part of the PPPM
calculation can be performed concurrently on the GPU while other
2011-06-09 05:26:06 +08:00
calculations for non-bonded and bonded force calculation are performed
on the CPU.
< / P >
2011-12-01 23:35:32 +08:00
< P > These accelerated styles are part of the USER-CUDA, GPU, USER-OMP, and
OPT packages respectively. They are only enabled if LAMMPS was built
with those packages. See the < A HREF = "Section_start.html#start_3" > Making LAMMPS< / A >
2011-06-09 05:26:06 +08:00
section for more info.
< / P >
2011-12-14 04:35:35 +08:00
< P > See < A HREF = "Section_accelerate.html" > Section_accelerate< / A > of the manual for
more instructions on how to use the accelerated styles effectively.
2011-05-02 23:01:49 +08:00
< / P >
2006-09-22 00:22:34 +08:00
< P > < B > Restrictions:< / B >
< / P >
2012-10-03 07:38:15 +08:00
< P > All of the kspace styles are part of the KSPACE package. They are
only enabled if LAMMPS was built with that package. See the < A HREF = "Section_start.html#start_3" > Making
LAMMPS< / A > section for more info. Note that
the KSPACE package is installed by default.
< / P >
2006-09-22 00:22:34 +08:00
< P > A simulation must be 3d and periodic in all dimensions to use an Ewald
or PPPM solver. The only exception is if the slab option is set with
< A HREF = "kspace_modify.html" > kspace_modify< / A > , in which case the xy dimensions
must be periodic and the z dimension must be non-periodic.
< / P >
2012-09-14 03:50:50 +08:00
< P > The < I > msm< / I > style is fairly new, and still lacks some important features
2012-10-02 01:53:05 +08:00
and optimizations. The upper MSM levels (above the first level) are not
2012-09-14 03:50:50 +08:00
parallelized, so this MSM implementation may not yet scale very well
on large core counts.
< / P >
2006-09-22 00:22:34 +08:00
< P > < B > Related commands:< / B >
< / P >
2010-05-07 23:11:21 +08:00
< P > < A HREF = "kspace_modify.html" > kspace_modify< / A > , < A HREF = "pair_lj.html" > pair_style
lj/cut/coul/long< / A > , < A HREF = "pair_charmm.html" > pair_style
lj/charmm/coul/long< / A > , < A HREF = "pair_lj_coul.html" > pair_style
lj/coul< / A > , < A HREF = "pair_buck.html" > pair_style buck/coul/long< / A >
2006-09-22 00:22:34 +08:00
< / P >
< P > < B > Default:< / B >
< / P >
< PRE > kspace_style none
< / PRE >
< HR >
< A NAME = "Darden" > < / A >
< P > < B > (Darden)< / B > Darden, York, Pedersen, J Chem Phys, 98, 10089 (1993).
< / P >
2012-03-02 03:23:14 +08:00
< A NAME = "Deserno" > < / A >
< P > < B > (Deserno)< / B > Deserno and Holm, J Chem Phys, 109, 7694 (1998).
< / P >
2006-09-22 00:22:34 +08:00
< A NAME = "Hockney" > < / A >
< P > < B > (Hockney)< / B > Hockney and Eastwood, Computer Simulation Using Particles,
Adam Hilger, NY (1989).
< / P >
2012-03-02 03:23:14 +08:00
< A NAME = "Kolafa" > < / A >
< P > < B > (Kolafa)< / B > Kolafa and Perram, Molecular Simualtion, 9, 351 (1992).
< / P >
< A NAME = "Petersen" > < / A >
< P > < B > (Petersen)< / B > Petersen, J Chem Phys, 103, 3668 (1995).
< / P >
2006-09-22 00:22:34 +08:00
< A NAME = "Pollock" > < / A >
< P > < B > (Pollock)< / B > Pollock and Glosli, Comp Phys Comm, 95, 93 (1996).
< / P >
2007-10-04 01:27:50 +08:00
< A NAME = "Veld" > < / A >
< P > < B > (Veld)< / B > In 't Veld, Ismail, Grest, J Chem Phys, in press (2007).
< / P >
2012-09-14 03:50:50 +08:00
< A NAME = "Hardy" > < / A >
2012-10-03 08:31:31 +08:00
< P > < B > (Hardy)< / B > David, Thesis: Multilevel Summation for the Fast Evaluation
of Forces for the Simulation of Biomolecules, University of Illinois
2012-09-14 03:50:50 +08:00
at Urbana-Champaign, (2006).
< / P >
2006-09-22 00:22:34 +08:00
< / HTML >