Merge branch 'maintenance' into maintenance-2022-06-23
This commit is contained in:
21
SECURITY.md
21
SECURITY.md
@ -30,18 +30,19 @@ for unicode characters and only all-ASCII source code is accepted.
|
||||
|
||||
# Version Updates
|
||||
|
||||
LAMMPS follows continuous release development model. We aim to keep to
|
||||
keep the development version (develop branch) always fully functional
|
||||
and employ a variety of automatic testing procedures to detect failures
|
||||
LAMMPS follows a continuous release development model. We aim to keep
|
||||
the development version (`develop` branch) always fully functional and
|
||||
employ a variety of automatic testing procedures to detect failures
|
||||
of existing functionality from adding or modifying features. Most of
|
||||
those tests are run on pull requests *before* merging to the development
|
||||
branch. The develop branch is protected, so all changes *must* be
|
||||
those tests are run on pull requests *before* merging to the `develop`
|
||||
branch. The `develop` branch is protected, so all changes *must* be
|
||||
submitted as a pull request and thus cannot avoid the automated tests.
|
||||
|
||||
Additional tests are run *after* merging. Before releases are made
|
||||
*all* tests must have cleared. Then a release tag is applied and the
|
||||
release branch fast-forwarded to that tag. Bug fixes and updates are
|
||||
applied to the current development branch and thus will be available in
|
||||
the next (patch) release. For stable releases, selected bug fixes are
|
||||
back-ported and occasionally published as update releases. There are
|
||||
only updates to the latest stable release.
|
||||
`release` branch is fast-forwarded to that tag. This is often referred
|
||||
to as a patch release. Bug fixes and updates are
|
||||
applied first to the `develop` branch. Later, they appear in the `release`
|
||||
branch when the next patch release occurs.
|
||||
For stable releases, selected bug fixes, updates, and new functionality
|
||||
are pushed to the `stable` branch and a new stable tag is applied.
|
||||
|
||||
@ -314,7 +314,7 @@ Bibliography
|
||||
Espanol, Revenga, Physical Review E, 67, 026705 (2003).
|
||||
|
||||
**(Espanol1997)**
|
||||
Espanol, Europhys Lett, 40(6): 631-636 (1997). DOI: 10.1209/epl/i1997-00515-8
|
||||
Espanol, Europhys Lett, 40(6): 631-636 (1997). DOI:10.1209/epl/i1997-00515-8
|
||||
|
||||
**(Evans and Morriss)**
|
||||
Evans and Morriss, Phys Rev A, 30, 1528 (1984).
|
||||
@ -368,7 +368,7 @@ Bibliography
|
||||
Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002.
|
||||
|
||||
**(GLE4MD)**
|
||||
`http://gle4md.org/ <http://gle4md.org/>`_
|
||||
`https://gle4md.org/ <https://gle4md.org/>`_
|
||||
|
||||
**(Gao)**
|
||||
Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504.
|
||||
@ -401,13 +401,13 @@ Bibliography
|
||||
Hayre, and Farago, Comp Phys Comm, 185, 524 (2014)
|
||||
|
||||
**(Groot)**
|
||||
Groot and Warren, J Chem Phys, 107: 4423-4435 (1997). DOI: 10.1063/1.474784
|
||||
Groot and Warren, J Chem Phys, 107: 4423-4435 (1997). DOI:10.1063/1.474784
|
||||
|
||||
**(Guenole)**
|
||||
Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020).
|
||||
|
||||
**(Gullet)**
|
||||
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003).
|
||||
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003). DOI:10.2172/918395
|
||||
|
||||
**(Guo)**
|
||||
Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
|
||||
@ -461,7 +461,7 @@ Bibliography
|
||||
Hunt, Mol Simul, 42, 347 (2016).
|
||||
|
||||
**(IPI)**
|
||||
`http://epfl-cosmo.github.io/gle4md/index.html?page=ipi <http://epfl-cosmo.github.io/gle4md/index.html?page=ipi>`_
|
||||
`https://ipi-code.org/ <https://ipi-code.org/>`
|
||||
|
||||
**(IPI-CPC)**
|
||||
Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014).
|
||||
@ -605,16 +605,16 @@ Bibliography
|
||||
I.\ Leven et al, J. Chem.Theory Comput. 12, 2896-905 (2016).
|
||||
|
||||
**(Li2013_POF)**
|
||||
Li, Hu, Wang, Ma, Zhou, Phys Fluids, 25: 072103 (2013). DOI: 10.1063/1.4812366.
|
||||
Li, Hu, Wang, Ma, Zhou, Phys Fluids, 25: 072103 (2013). DOI:10.1063/1.4812366.
|
||||
|
||||
**(Li2014_JCP)**
|
||||
Li, Tang, Lei, Caswell, Karniadakis, J Comput Phys, 265: 113-127 (2014). DOI: 10.1016/j.jcp.2014.02.003.
|
||||
Li, Tang, Lei, Caswell, Karniadakis, J Comput Phys, 265: 113-127 (2014). DOI:10.1016/j.jcp.2014.02.003.
|
||||
|
||||
**(Li2015_CC)**
|
||||
Li, Tang, Li, Karniadakis, Chem Commun, 51: 11038-11040 (2015). DOI: 10.1039/C5CC01684C.
|
||||
Li, Tang, Li, Karniadakis, Chem Commun, 51: 11038-11040 (2015). DOI:10.1039/C5CC01684C.
|
||||
|
||||
**(Li2015_JCP)**
|
||||
Li, Yazdani, Tartakovsky, Karniadakis, J Chem Phys, 143: 014101 (2015). DOI: 10.1063/1.4923254.
|
||||
Li, Yazdani, Tartakovsky, Karniadakis, J Chem Phys, 143: 014101 (2015). DOI:10.1063/1.4923254.
|
||||
|
||||
**(Lisal)**
|
||||
M.\ Lisal, J.K. Brennan, J. Bonet Avalos, "Dissipative particle dynamics at isothermal, isobaric, isoenergetic, and isoenthalpic conditions using Shardlow-like splitting algorithms.",
|
||||
@ -733,8 +733,8 @@ Bibliography
|
||||
**(Mishin)**
|
||||
Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005).
|
||||
|
||||
**(Mitchell and Finchham)**
|
||||
Mitchell, Finchham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
||||
**(Mitchell and Fincham)**
|
||||
Mitchell, Fincham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
||||
|
||||
**(Mitchell2011)**
|
||||
Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011).
|
||||
@ -875,7 +875,7 @@ Bibliography
|
||||
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)
|
||||
|
||||
**(Paquay)**
|
||||
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <http://arxiv.org/abs/1411.3019/>`_.
|
||||
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.
|
||||
|
||||
**(Park)**
|
||||
Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004)
|
||||
@ -1373,7 +1373,7 @@ Bibliography
|
||||
Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002).
|
||||
|
||||
**(Ziegler)**
|
||||
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter," Volume 1, Pergamon, 1985.
|
||||
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter", Volume 1, Pergamon, 1985.
|
||||
|
||||
**(Zimmerman2004)**
|
||||
Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319.
|
||||
|
||||
@ -276,7 +276,7 @@ LAMMPS.
|
||||
|
||||
Parallel build (see ``src/MAKE/Makefile.mpi``):
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: make
|
||||
|
||||
CC = mpicxx
|
||||
CCFLAGS = -g -O3
|
||||
@ -296,7 +296,7 @@ LAMMPS.
|
||||
|
||||
If compilation stops with a message like the following:
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: output
|
||||
|
||||
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
|
||||
In file included from ../pointers.h:24:0,
|
||||
|
||||
@ -140,7 +140,7 @@ of the LAMMPS project on GitHub.
|
||||
The unit testing facility is integrated into the CMake build process
|
||||
of the LAMMPS source code distribution itself. It can be enabled by
|
||||
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
||||
It requires the `YAML <http://pyyaml.org/>`_ library and development
|
||||
It requires the `YAML <https://pyyaml.org/>`_ library and development
|
||||
headers (if those are not found locally a recent version will be
|
||||
downloaded and compiled along with LAMMPS and the test program) to
|
||||
compile and will download and compile a specific recent version of the
|
||||
@ -154,32 +154,48 @@ for implementing the tests.
|
||||
framework are more strict than for the main part of LAMMPS. For
|
||||
example the default GNU C++ and Fortran compilers of RHEL/CentOS 7.x
|
||||
(version 4.8.x) are not sufficient. The CMake configuration will try
|
||||
to detect compatible versions and either skip incompatible tests or
|
||||
stop with an error.
|
||||
to detect incompatible versions and either skip incompatible tests or
|
||||
stop with an error. Also the number of tests will depend on
|
||||
installed LAMMPS packages, development environment, operating system,
|
||||
and configuration settings.
|
||||
|
||||
After compilation is complete, the unit testing is started in the build
|
||||
folder using the ``ctest`` command, which is part of the CMake software.
|
||||
The output of this command will be looking something like this::
|
||||
The output of this command will be looking something like this:
|
||||
|
||||
[...]$ ctest
|
||||
Test project /home/akohlmey/compile/lammps/build-testing
|
||||
Start 1: MolPairStyle:hybrid-overlay
|
||||
1/109 Test #1: MolPairStyle:hybrid-overlay ......... Passed 0.02 sec
|
||||
Start 2: MolPairStyle:hybrid
|
||||
2/109 Test #2: MolPairStyle:hybrid ................. Passed 0.01 sec
|
||||
Start 3: MolPairStyle:lj_class2
|
||||
[...]
|
||||
Start 107: PotentialFileReader
|
||||
107/109 Test #107: PotentialFileReader ................ Passed 0.04 sec
|
||||
Start 108: EIMPotentialFileReader
|
||||
108/109 Test #108: EIMPotentialFileReader ............. Passed 0.03 sec
|
||||
Start 109: TestSimpleCommands
|
||||
109/109 Test #109: TestSimpleCommands ................. Passed 0.02 sec
|
||||
.. code-block:: console
|
||||
|
||||
100% tests passed, 0 tests failed out of 26
|
||||
$ ctest
|
||||
Test project /home/akohlmey/compile/lammps/build-testing
|
||||
Start 1: RunLammps
|
||||
1/563 Test #1: RunLammps .......................................... Passed 0.28 sec
|
||||
Start 2: HelpMessage
|
||||
2/563 Test #2: HelpMessage ........................................ Passed 0.06 sec
|
||||
Start 3: InvalidFlag
|
||||
3/563 Test #3: InvalidFlag ........................................ Passed 0.06 sec
|
||||
Start 4: Tokenizer
|
||||
4/563 Test #4: Tokenizer .......................................... Passed 0.05 sec
|
||||
Start 5: MemPool
|
||||
5/563 Test #5: MemPool ............................................ Passed 0.05 sec
|
||||
Start 6: ArgUtils
|
||||
6/563 Test #6: ArgUtils ........................................... Passed 0.05 sec
|
||||
[...]
|
||||
Start 561: ImproperStyle:zero
|
||||
561/563 Test #561: ImproperStyle:zero ................................. Passed 0.07 sec
|
||||
Start 562: TestMliapPyUnified
|
||||
562/563 Test #562: TestMliapPyUnified ................................. Passed 0.16 sec
|
||||
Start 563: TestPairList
|
||||
563/563 Test #563: TestPairList ....................................... Passed 0.06 sec
|
||||
|
||||
Total Test time (real) = 25.57 sec
|
||||
100% tests passed, 0 tests failed out of 563
|
||||
|
||||
Label Time Summary:
|
||||
generated = 0.85 sec*proc (3 tests)
|
||||
noWindows = 4.16 sec*proc (2 tests)
|
||||
slow = 78.33 sec*proc (67 tests)
|
||||
unstable = 28.23 sec*proc (34 tests)
|
||||
|
||||
Total Test time (real) = 132.34 sec
|
||||
|
||||
The ``ctest`` command has many options, the most important ones are:
|
||||
|
||||
@ -210,11 +226,13 @@ Fortran) and testing different aspects of the LAMMPS software and its features.
|
||||
The tests will adapt to the compilation settings of LAMMPS, so that tests
|
||||
will be skipped if prerequisite features are not available in LAMMPS.
|
||||
|
||||
.. note::
|
||||
.. admonition:: Work in Progress
|
||||
:class: note
|
||||
|
||||
The unit test framework was added in spring 2020 and is under active
|
||||
development. The coverage is not complete and will be expanded over
|
||||
time.
|
||||
time. Preference is given to parts of the code base that are easy to
|
||||
test or commonly used.
|
||||
|
||||
Tests for styles of the same kind of style (e.g. pair styles or bond
|
||||
styles) are performed with the same test executable using different
|
||||
@ -248,9 +266,9 @@ the CMake option ``-D BUILD_MPI=off`` can significantly speed up testing,
|
||||
since this will skip the MPI initialization for each test run.
|
||||
Below is an example command and output:
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: console
|
||||
|
||||
[tests]$ test_pair_style mol-pair-lj_cut.yaml
|
||||
$ test_pair_style mol-pair-lj_cut.yaml
|
||||
[==========] Running 6 tests from 1 test suite.
|
||||
[----------] Global test environment set-up.
|
||||
[----------] 6 tests from PairStyle
|
||||
@ -530,7 +548,7 @@ commands like the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ clang-format -i some_file.cpp
|
||||
clang-format -i some_file.cpp
|
||||
|
||||
|
||||
The following target are available for both, GNU make and CMake:
|
||||
@ -539,3 +557,19 @@ The following target are available for both, GNU make and CMake:
|
||||
|
||||
make format-src # apply clang-format to all files in src and the package folders
|
||||
make format-tests # apply clang-format to all files in the unittest tree
|
||||
|
||||
----------
|
||||
|
||||
.. _gh-cli:
|
||||
|
||||
GitHub command line interface
|
||||
-----------------------------
|
||||
|
||||
GitHub is developing a `tool for the command line
|
||||
<https://cli.github.com>`_ that interacts with the GitHub website via a
|
||||
command called ``gh``. This can be extremely convenient when working
|
||||
with a Git repository hosted on GitHub (like LAMMPS). It is thus highly
|
||||
recommended to install it when doing LAMMPS development.
|
||||
|
||||
The capabilities of the ``gh`` command is continually expanding, so
|
||||
please see the documentation at https://cli.github.com/manual/
|
||||
|
||||
@ -12,11 +12,11 @@ in addition to
|
||||
- Traditional make
|
||||
* - .. code-block:: bash
|
||||
|
||||
$ cmake -D PKG_NAME=yes
|
||||
cmake -D PKG_NAME=yes
|
||||
|
||||
- .. code-block:: bash
|
||||
- .. code-block:: console
|
||||
|
||||
$ make yes-name
|
||||
make yes-name
|
||||
|
||||
as described on the :doc:`Build_package <Build_package>` page.
|
||||
|
||||
@ -28,14 +28,16 @@ You may need to tell LAMMPS where it is found on your system.
|
||||
|
||||
This is the list of packages that may require additional steps.
|
||||
|
||||
.. this list must be kept in sync with its counterpart in Build_package.rst
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
|
||||
* :ref:`ADIOS <adios>`
|
||||
* :ref:`ATC <atc>`
|
||||
* :ref:`AWPMD <awpmd>`
|
||||
* :ref:`COLVARS <colvars>`
|
||||
* :ref:`COLVARS <colvar>`
|
||||
* :ref:`COMPRESS <compress>`
|
||||
* :ref:`ELECTRODE <electrode>`
|
||||
* :ref:`GPU <gpu>`
|
||||
* :ref:`H5MD <h5md>`
|
||||
* :ref:`INTEL <intel>`
|
||||
@ -148,7 +150,9 @@ CMake build
|
||||
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
|
||||
* sm_70 for Volta (supported since CUDA 9)
|
||||
* sm_75 for Turing (supported since CUDA 10)
|
||||
* sm_80 for Ampere (supported since CUDA 11)
|
||||
* sm_80 or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1)
|
||||
* sm_89 for Lovelace (supported since CUDA 11.8)
|
||||
* sm_90 for Hopper (supported since CUDA 12.0)
|
||||
|
||||
A more detailed list can be found, for example,
|
||||
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
|
||||
@ -221,10 +225,10 @@ script with the specified args:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-gpu # print help message
|
||||
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
||||
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
||||
make lib-gpu # print help message
|
||||
make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
||||
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
||||
|
||||
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
||||
specified by the "-m" switch. For your convenience, machine makefiles
|
||||
@ -337,13 +341,13 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-kim # print help message
|
||||
$ make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
||||
$ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||
$ make lib-kim args="-b -a everything" # install KIM API lib with all models
|
||||
$ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||
make lib-kim # print help message
|
||||
make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
||||
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||
make lib-kim args="-b -a everything" # install KIM API lib with all models
|
||||
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||
|
||||
When using the "-b " option, the KIM library is built using its native
|
||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||
@ -355,7 +359,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||
|
||||
Settings for debugging OpenKIM web queries discussed below need to
|
||||
be applied by adding them to the ``LMP_INC`` variable through
|
||||
@ -808,11 +812,11 @@ library.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-latte # print help message
|
||||
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
||||
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
||||
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
||||
# copy Makefile.lammps.gfortran to Makefile.lammps
|
||||
make lib-latte # print help message
|
||||
make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
||||
make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
||||
make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
||||
# copy Makefile.lammps.gfortran to Makefile.lammps
|
||||
|
||||
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||
and ``filelink.o``, are created in ``lib/latte`` to point to
|
||||
@ -911,12 +915,12 @@ more details.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-mscg # print help message
|
||||
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
||||
# with the settings compatible with "make serial"
|
||||
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
||||
# with the settings compatible with "make mpi"
|
||||
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
||||
make lib-mscg # print help message
|
||||
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
||||
# with the settings compatible with "make serial"
|
||||
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
||||
# with the settings compatible with "make mpi"
|
||||
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
||||
|
||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
|
||||
will be created in ``lib/mscg`` to point to the MS-CG
|
||||
@ -968,10 +972,10 @@ POEMS package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-poems # print help message
|
||||
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||
$ make lib-poems args="-m icc" # build with Intel icc compiler
|
||||
make lib-poems # print help message
|
||||
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||
make lib-poems args="-m icc" # build with Intel icc compiler
|
||||
|
||||
The build should produce two files: ``lib/poems/libpoems.a`` and
|
||||
``lib/poems/Makefile.lammps``. The latter is copied from an
|
||||
@ -1057,10 +1061,10 @@ binary package provided by your operating system.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-voronoi # print help message
|
||||
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
||||
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
||||
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
||||
make lib-voronoi # print help message
|
||||
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
||||
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
||||
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
||||
|
||||
Note that 2 symbolic (soft) links, ``includelink`` and
|
||||
``liblink``, are created in lib/voronoi to point to the Voro++
|
||||
@ -1101,13 +1105,13 @@ systems.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make yes-adios
|
||||
make yes-adios
|
||||
|
||||
otherwise, set ADIOS2_DIR environment variable when turning on the package:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
||||
ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
||||
|
||||
----------
|
||||
|
||||
@ -1136,10 +1140,10 @@ The ATC package requires the MANYBODY package also be installed.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-atc # print help message
|
||||
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
$ make lib-atc args="-m icc" # build with Intel icc compiler
|
||||
make lib-atc # print help message
|
||||
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
make lib-atc args="-m icc" # build with Intel icc compiler
|
||||
|
||||
The build should produce two files: ``lib/atc/libatc.a`` and
|
||||
``lib/atc/Makefile.lammps``. The latter is copied from an
|
||||
@ -1158,17 +1162,17 @@ The ATC package requires the MANYBODY package also be installed.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-linalg # print help message
|
||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
make lib-linalg # print help message
|
||||
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||
make lib-linalg args="-m g++" # build with GNU Fortran compiler
|
||||
|
||||
----------
|
||||
|
||||
.. _awpmd:
|
||||
|
||||
AWPMD package
|
||||
------------------
|
||||
-------------
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -1187,10 +1191,10 @@ AWPMD package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-awpmd # print help message
|
||||
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
$ make lib-awpmd args="-m icc" # build with Intel icc compiler
|
||||
make lib-awpmd # print help message
|
||||
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
make lib-awpmd args="-m icc" # build with Intel icc compiler
|
||||
|
||||
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
|
||||
``lib/awpmd/Makefile.lammps``. The latter is copied from an
|
||||
@ -1209,21 +1213,20 @@ AWPMD package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-linalg # print help message
|
||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
make lib-linalg # print help message
|
||||
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||
make lib-linalg args="-m g++" # build with GNU C++ compiler
|
||||
|
||||
----------
|
||||
|
||||
.. _colvars:
|
||||
.. _colvar:
|
||||
|
||||
COLVARS package
|
||||
---------------------------------------
|
||||
---------------
|
||||
|
||||
This package includes the `Colvars library
|
||||
<https://colvars.github.io/>`_ into the LAMMPS distribution, which can
|
||||
be built for the most part with all major versions of the C++ language.
|
||||
This package enables the use of the `Colvars <https://colvars.github.io/>`_
|
||||
module included in the LAMMPS source distribution.
|
||||
|
||||
|
||||
.. tabs::
|
||||
@ -1250,10 +1253,10 @@ be built for the most part with all major versions of the C++ language.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-colvars # print help message
|
||||
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
||||
make lib-colvars # print help message
|
||||
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
||||
|
||||
The "machine" argument of the "-m" flag is used to find a
|
||||
Makefile.machine to use as build recipe. If it does not already
|
||||
@ -1265,8 +1268,8 @@ be built for the most part with all major versions of the C++ language.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
||||
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
||||
COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
||||
COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
||||
|
||||
The build should produce two files: the library ``lib/colvars/libcolvars.a``
|
||||
(which also includes Lepton objects if enabled) and the specification file
|
||||
@ -1300,9 +1303,9 @@ This package depends on the KSPACE package.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-electrode # print help message
|
||||
$ make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
$ make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
make lib-electrode # print help message
|
||||
make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||
make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||
|
||||
|
||||
Note that the ``Makefile.lammps`` file has settings for the BLAS
|
||||
@ -1313,10 +1316,10 @@ This package depends on the KSPACE package.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-linalg # print help message
|
||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
make lib-linalg # print help message
|
||||
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
|
||||
The package itself is activated with ``make yes-KSPACE`` and
|
||||
``make yes-ELECTRODE``
|
||||
@ -1356,8 +1359,8 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-pace # print help message
|
||||
$ make lib-pace args="-b" # download and build the default version in lib/pace
|
||||
make lib-pace # print help message
|
||||
make lib-pace args="-b" # download and build the default version in lib/pace
|
||||
|
||||
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
||||
|
||||
@ -1456,10 +1459,10 @@ LAMMPS build.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-plumed # print help message
|
||||
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
||||
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
||||
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
||||
make lib-plumed # print help message
|
||||
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
||||
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
||||
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
||||
# /usr/local and use shared linkage mode
|
||||
|
||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||
@ -1472,8 +1475,8 @@ LAMMPS build.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make yes-plumed
|
||||
$ make machine
|
||||
make yes-plumed
|
||||
make machine
|
||||
|
||||
Once this compilation completes you should be able to run LAMMPS
|
||||
in the usual way. For shared linkage mode, libplumed.so must be
|
||||
@ -1525,8 +1528,8 @@ the HDF5 library.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-h5md # print help message
|
||||
$ make lib-h5md args="-m h5cc" # build with h5cc compiler
|
||||
make lib-h5md # print help message
|
||||
make lib-h5md args="-m h5cc" # build with h5cc compiler
|
||||
|
||||
The build should produce two files: ``lib/h5md/libch5md.a`` and
|
||||
``lib/h5md/Makefile.lammps``. The latter is copied from an
|
||||
@ -1580,10 +1583,10 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-hdnnp # print help message
|
||||
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
||||
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
||||
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
||||
make lib-hdnnp # print help message
|
||||
make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
||||
make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
||||
make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
||||
|
||||
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
||||
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
||||
@ -1683,8 +1686,8 @@ MDI package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python Install.py -m gcc # build using gcc compiler
|
||||
$ python Install.py -m icc # build using icc compiler
|
||||
python Install.py -m gcc # build using gcc compiler
|
||||
python Install.py -m icc # build using icc compiler
|
||||
|
||||
The build should produce two files: ``lib/mdi/includelink/mdi.h``
|
||||
and ``lib/mdi/liblink/libmdi.so``\ .
|
||||
@ -1718,9 +1721,9 @@ they will be downloaded the first time this package is installed.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-mesont # print help message
|
||||
$ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
||||
$ make lib-mesont args="-m ifort" # build with Intel icc compiler
|
||||
make lib-mesont # print help message
|
||||
make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
||||
make lib-mesont args="-m ifort" # build with Intel icc compiler
|
||||
|
||||
The build should produce two files: ``lib/mesont/libmesont.a`` and
|
||||
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
|
||||
@ -1833,6 +1836,22 @@ OPENMP package
|
||||
For other platforms and compilers, please consult the
|
||||
documentation about OpenMP support for your compiler.
|
||||
|
||||
.. admonition:: Adding OpenMP support on macOS
|
||||
:class: note
|
||||
|
||||
Apple offers the `Xcode package and IDE
|
||||
<https://developer.apple.com/xcode/>`_ for compiling software on
|
||||
macOS, so you have likely installed it to compile LAMMPS. Their
|
||||
compiler is based on `Clang <https://clang.llvm.org/>`, but while it
|
||||
is capable of processing OpenMP directives, the necessary header
|
||||
files and OpenMP runtime library are missing. The `R developers
|
||||
<https://www.r-project.org/>` have figured out a way to build those
|
||||
in a compatible fashion. One can download them from
|
||||
`https://mac.r-project.org/openmp/
|
||||
<https://mac.r-project.org/openmp/>`_. Simply adding those files as
|
||||
instructed enables the Xcode C++ compiler to compile LAMMPS with ``-D
|
||||
BUILD_OMP=yes``.
|
||||
|
||||
----------
|
||||
|
||||
.. _qmmm:
|
||||
@ -1887,10 +1906,10 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-qmmm # print help message
|
||||
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
||||
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
||||
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
||||
make lib-qmmm # print help message
|
||||
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
||||
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
||||
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
||||
|
||||
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
|
||||
``lib/qmmm/Makefile.lammps``. The latter is copied from an
|
||||
@ -2028,9 +2047,9 @@ Eigen3 is a template library, so you do not need to build it.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-smd # print help message
|
||||
$ make lib-smd args="-b" # download to lib/smd/eigen3
|
||||
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
||||
make lib-smd # print help message
|
||||
make lib-smd args="-b" # download to lib/smd/eigen3
|
||||
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
||||
|
||||
Note that a symbolic (soft) link named ``includelink`` is created
|
||||
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
|
||||
|
||||
@ -209,7 +209,7 @@ You can verify whether all required shared libraries are found with the
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
||||
LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
||||
linux-vdso.so.1 (0x00007ffe729e0000)
|
||||
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
||||
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
||||
@ -222,7 +222,7 @@ If a required library is missing, you would get a 'not found' entry:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ldd caller
|
||||
ldd caller
|
||||
linux-vdso.so.1 (0x00007ffd672fe000)
|
||||
liblammps.so => not found
|
||||
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
||||
|
||||
@ -48,18 +48,15 @@ Build using GNU make
|
||||
|
||||
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
||||
can be translated to different output format using the `Sphinx
|
||||
<sphinx_>`_ document generator tool. It also incorporates programmer
|
||||
documentation extracted from the LAMMPS C++ sources through the `Doxygen
|
||||
<https://doxygen.nl>`_ program. Currently the translation to HTML, PDF
|
||||
(via LaTeX), ePUB (for many e-book readers) and MOBI (for Amazon Kindle
|
||||
readers) are supported. For that to work a Python 3 interpreter, the
|
||||
``doxygen`` tools and internet access to download additional files and
|
||||
tools are required. This download is usually only required once or
|
||||
after the documentation folder is returned to a pristine state with
|
||||
``make clean-all``.
|
||||
|
||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
||||
.. _sphinx: https://www.sphinx-doc.org
|
||||
<https://sphinx-doc.org>`_ document generator tool. It also
|
||||
incorporates programmer documentation extracted from the LAMMPS C++
|
||||
sources through the `Doxygen <https://doxygen.nl>`_ program. Currently
|
||||
the translation to HTML, PDF (via LaTeX), ePUB (for many e-book readers)
|
||||
and MOBI (for Amazon Kindle readers) are supported. For that to work a
|
||||
Python 3 interpreter, the ``doxygen`` tools and internet access to
|
||||
download additional files and tools are required. This download is
|
||||
usually only required once or after the documentation folder is returned
|
||||
to a pristine state with ``make clean-all``.
|
||||
|
||||
For the documentation build a python virtual environment is set up in
|
||||
the folder ``doc/docenv`` and various python packages are installed into
|
||||
@ -128,38 +125,29 @@ common setups:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt-get install python-virtualenv git doxygen
|
||||
sudo apt-get install git doxygen
|
||||
|
||||
.. tab:: RHEL or CentOS (Version 7.x)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo yum install python3-virtualenv git doxygen
|
||||
sudo yum install git doxygen
|
||||
|
||||
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf install python3-virtualenv git doxygen
|
||||
sudo dnf install git doxygen
|
||||
|
||||
.. tab:: MacOS X
|
||||
.. tab:: macOS
|
||||
|
||||
*Python 3*
|
||||
|
||||
Download the latest Python 3 MacOS X package from
|
||||
If Python 3 is not available on your macOS system, you can
|
||||
download the latest Python 3 macOS package from
|
||||
`https://www.python.org <https://www.python.org>`_ and install it.
|
||||
This will install both Python 3 and pip3.
|
||||
|
||||
*virtualenv*
|
||||
|
||||
Once Python 3 is installed, open a Terminal and type
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip3 install virtualenv
|
||||
|
||||
This will install virtualenv from the Python Package Index.
|
||||
|
||||
Prerequisites for PDF
|
||||
---------------------
|
||||
|
||||
@ -179,7 +167,7 @@ math expressions transparently into embedded images.
|
||||
For converting the generated ePUB file to a MOBI format file (for e-book
|
||||
readers, like Kindle, that cannot read ePUB), you also need to have the
|
||||
``ebook-convert`` tool from the "calibre" software
|
||||
installed. `http://calibre-ebook.com/ <http://calibre-ebook.com/>`_
|
||||
installed. `https://calibre-ebook.com/ <https://calibre-ebook.com/>`_
|
||||
Typing ``make mobi`` will first create the ePUB file and then convert
|
||||
it. On the Kindle readers in particular, you also have support for PDF
|
||||
files, so you could download and view the PDF version as an alternative.
|
||||
@ -219,9 +207,20 @@ be multiple tests run automatically:
|
||||
- A test that only standard, printable ASCII text characters are used.
|
||||
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
||||
thus prints all offending lines with filename and line number
|
||||
prepended to the screen. Special characters like the Angstrom
|
||||
:math:`\mathrm{\mathring{A}}` should be typeset with embedded math
|
||||
(like this ``:math:`\mathrm{\mathring{A}}```\ ).
|
||||
prepended to the screen. Special characters like Greek letters
|
||||
(:math:`\alpha~~\sigma~~\epsilon`), super- or subscripts
|
||||
(:math:`x^2~~\mathrm{U}_{LJ}`), mathematical expressions
|
||||
(:math:`\frac{1}{2}\mathrm{N}~~x\to\infty`), or the Angstrom symbol
|
||||
(:math:`\AA`) should be typeset with embedded LaTeX (like this
|
||||
``:math:`\alpha \sigma \epsilon```, ``:math:`x^2 \mathrm{E}_{LJ}```,
|
||||
``:math:`\frac{1}{2}\mathrm{N} x\to\infty```, or ``:math:`\AA```\ ).
|
||||
|
||||
- Embedded LaTeX is rendered in HTML output with `MathJax
|
||||
<https://www.mathjax.org/>`_ and in PDF output by passing the embedded
|
||||
text to LaTeX. Some care has to be taken, though, since there are
|
||||
limitations which macros and features can be used in either mode, so
|
||||
it is recommended to always check whether any new or changed
|
||||
documentation does translate and render correctly with either output.
|
||||
|
||||
- A test whether all styles are documented and listed in their
|
||||
respective overview pages. A typical output with warnings looks like this:
|
||||
@ -252,6 +251,5 @@ manual with ``make spelling``. This requires `a library called enchant
|
||||
positives* (e.g. keywords, names, abbreviations) those can be added to
|
||||
the file ``lammps/doc/utils/sphinx-config/false_positives.txt``.
|
||||
|
||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
||||
|
||||
.. _lws: https://www.lammps.org
|
||||
.. _rst: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
|
||||
|
||||
@ -30,14 +30,16 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
|
||||
These links take you to the extra instructions for those select
|
||||
packages:
|
||||
|
||||
.. this list must be kept in sync with its counterpart in Build_extras.rst
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
|
||||
* :ref:`ADIOS <adios>`
|
||||
* :ref:`ATC <atc>`
|
||||
* :ref:`AWPMD <awpmd>`
|
||||
* :ref:`COLVARS <colvars>`
|
||||
* :ref:`COLVARS <colvar>`
|
||||
* :ref:`COMPRESS <compress>`
|
||||
* :ref:`ELECTRODE <electrode>`
|
||||
* :ref:`GPU <gpu>`
|
||||
* :ref:`H5MD <h5md>`
|
||||
* :ref:`INTEL <intel>`
|
||||
@ -45,7 +47,10 @@ packages:
|
||||
* :ref:`KOKKOS <kokkos>`
|
||||
* :ref:`LATTE <latte>`
|
||||
* :ref:`MACHDYN <machdyn>`
|
||||
* :ref:`MDI <mdi>`
|
||||
* :ref:`MESONT <mesont>`
|
||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||
* :ref:`ML-IAP <mliap>`
|
||||
* :ref:`ML-PACE <ml-pace>`
|
||||
* :ref:`ML-QUIP <ml-quip>`
|
||||
* :ref:`MOLFILE <molfile>`
|
||||
|
||||
@ -111,26 +111,25 @@ LAMMPS can use them if they are available on your system.
|
||||
files in its default search path. You must specify ``FFT_LIB``
|
||||
with the appropriate FFT libraries to include in the link.
|
||||
|
||||
The `KISS FFT library <http://kissfft.sf.net>`_ is included in the LAMMPS
|
||||
distribution. It is portable across all platforms. Depending on the size
|
||||
of the FFTs and the number of processors used, the other libraries listed
|
||||
here can be faster.
|
||||
The `KISS FFT library <https://github.com/mborgerding/kissfft>`_ is
|
||||
included in the LAMMPS distribution. It is portable across all
|
||||
platforms. Depending on the size of the FFTs and the number of
|
||||
processors used, the other libraries listed here can be faster.
|
||||
|
||||
However, note that long-range Coulombics are only a portion of the
|
||||
per-timestep CPU cost, FFTs are only a portion of long-range
|
||||
Coulombics, and 1d FFTs are only a portion of the FFT cost (parallel
|
||||
communication can be costly). A breakdown of these timings is printed
|
||||
to the screen at the end of a run when using the
|
||||
:doc:`kspace_style pppm <kspace_style>` command. The
|
||||
:doc:`Screen and logfile output <Run_output>`
|
||||
page gives more details. A more detailed (and time consuming)
|
||||
report of the FFT performance is generated with the
|
||||
per-timestep CPU cost, FFTs are only a portion of long-range Coulombics,
|
||||
and 1d FFTs are only a portion of the FFT cost (parallel communication
|
||||
can be costly). A breakdown of these timings is printed to the screen
|
||||
at the end of a run when using the :doc:`kspace_style pppm
|
||||
<kspace_style>` command. The :doc:`Screen and logfile output
|
||||
<Run_output>` page gives more details. A more detailed (and time
|
||||
consuming) report of the FFT performance is generated with the
|
||||
:doc:`kspace_modify fftbench yes <kspace_modify>` command.
|
||||
|
||||
FFTW is a fast, portable FFT library that should also work on any
|
||||
platform and can be faster than the KISS FFT library. You can
|
||||
download it from `www.fftw.org <http://www.fftw.org>`_. LAMMPS requires
|
||||
version 3.X; the legacy version 2.1.X is no longer supported.
|
||||
platform and can be faster than the KISS FFT library. You can download
|
||||
it from `www.fftw.org <https://www.fftw.org>`_. LAMMPS requires version
|
||||
3.X; the legacy version 2.1.X is no longer supported.
|
||||
|
||||
Building FFTW for your box should be as simple as ``./configure; make;
|
||||
make install``. The install command typically requires root privileges
|
||||
|
||||
@ -14,7 +14,9 @@
|
||||
General commands
|
||||
================
|
||||
|
||||
An alphabetic list of general LAMMPS commands.
|
||||
An alphabetic list of general LAMMPS commands. Note that style
|
||||
commands with many variants, can be more easily accessed via the small
|
||||
table above.
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 5
|
||||
|
||||
@ -40,9 +40,6 @@ OPT.
|
||||
* :doc:`ave/time <fix_ave_time>`
|
||||
* :doc:`aveforce <fix_aveforce>`
|
||||
* :doc:`balance <fix_balance>`
|
||||
* :doc:`brownian <fix_brownian>`
|
||||
* :doc:`brownian/asphere <fix_brownian>`
|
||||
* :doc:`brownian/sphere <fix_brownian>`
|
||||
* :doc:`bocs <fix_bocs>`
|
||||
* :doc:`bond/break <fix_bond_break>`
|
||||
* :doc:`bond/create <fix_bond_create>`
|
||||
@ -50,6 +47,9 @@ OPT.
|
||||
* :doc:`bond/react <fix_bond_react>`
|
||||
* :doc:`bond/swap <fix_bond_swap>`
|
||||
* :doc:`box/relax <fix_box_relax>`
|
||||
* :doc:`brownian <fix_brownian>`
|
||||
* :doc:`brownian/asphere <fix_brownian>`
|
||||
* :doc:`brownian/sphere <fix_brownian>`
|
||||
* :doc:`charge/regulation <fix_charge_regulation>`
|
||||
* :doc:`cmap <fix_cmap>`
|
||||
* :doc:`colvars <fix_colvars>`
|
||||
|
||||
@ -2,14 +2,17 @@ Removed commands and packages
|
||||
=============================
|
||||
|
||||
This page lists LAMMPS commands and packages that have been removed from
|
||||
the distribution and provides suggestions for alternatives or replacements.
|
||||
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
|
||||
print a suitable error message in most cases, when a style/command is used
|
||||
that has been removed.
|
||||
the distribution and provides suggestions for alternatives or
|
||||
replacements. LAMMPS has special dummy styles implemented, that will
|
||||
stop LAMMPS and print a suitable error message in most cases, when a
|
||||
style/command is used that has been removed or will replace the command
|
||||
with the direct alternative (if available) and print a warning.
|
||||
|
||||
Fix ave/spatial and fix ave/spatial/sphere
|
||||
------------------------------------------
|
||||
|
||||
.. deprecated:: 11Dec2015
|
||||
|
||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||
since they were superseded by the more general and extensible "chunk
|
||||
infrastructure". Here the system is partitioned in one of many possible
|
||||
@ -30,18 +33,21 @@ The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
||||
Fortran code of MEAM into C++, which removes several restrictions
|
||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||
for some optimizations leading to better performance. The pair style
|
||||
:doc:`meam <pair_meam>` has the exact same syntax.
|
||||
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||
coexist with the Fortran version.
|
||||
|
||||
REAX package
|
||||
------------
|
||||
|
||||
The REAX package has been removed since it was superseded by the
|
||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF
|
||||
package has been tested to yield equivalent results to the REAX package,
|
||||
offers better performance, supports OpenMP multi-threading via OPENMP,
|
||||
and GPU and threading parallelization through KOKKOS. The new pair styles
|
||||
are not syntax compatible with the removed reax pair style, so input
|
||||
files will have to be adapted.
|
||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||
to yield equivalent results to the REAX package, offers better
|
||||
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||
threading parallelization through KOKKOS. The new pair styles are not
|
||||
syntax compatible with the removed reax pair style, so input files will
|
||||
have to be adapted. The REAXFF package was originally called
|
||||
USER-REAXC.
|
||||
|
||||
USER-CUDA package
|
||||
-----------------
|
||||
@ -60,5 +66,6 @@ restart2data tool
|
||||
The functionality of the restart2data tool has been folded into the
|
||||
LAMMPS executable directly instead of having a separate tool. A
|
||||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For added
|
||||
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||
added convenience this conversion can also be triggered by
|
||||
:doc:`command line flags <Run_options>`
|
||||
|
||||
@ -17,6 +17,7 @@ of time and requests from the LAMMPS user community.
|
||||
Developer_flow
|
||||
Developer_write
|
||||
Developer_notes
|
||||
Developer_updating
|
||||
Developer_plugins
|
||||
Developer_unittest
|
||||
Classes
|
||||
|
||||
@ -50,7 +50,7 @@ parallel each MPI process creates such an instance. This can be seen
|
||||
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
||||
simulation are the following 3 lines of code:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||
lammps->input->file();
|
||||
@ -78,7 +78,7 @@ LAMMPS makes extensive use of the object oriented programming (OOP)
|
||||
principles of *compositing* and *inheritance*. Classes like the
|
||||
``LAMMPS`` class are a **composite** containing pointers to instances
|
||||
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||
``Modify``, and so on. Each of these classes implement certain
|
||||
``Modify``, and so on. Each of these classes implements certain
|
||||
functionality by storing and manipulating data related to the
|
||||
simulation and providing member functions that trigger certain
|
||||
actions. Some of those classes like ``Force`` are themselves
|
||||
@ -87,9 +87,9 @@ interactions. Similarly the ``Modify`` class contains a list of
|
||||
``Fix`` and ``Compute`` classes. If the input commands that
|
||||
correspond to these classes include the word *style*, then LAMMPS
|
||||
stores only a single instance of that class. E.g. *atom_style*,
|
||||
*comm_style*, *pair_style*, *bond_style*. It the input command does
|
||||
not include the word *style*, there can be many instances of that
|
||||
class defined. E.g. *region*, *fix*, *compute*, *dump*.
|
||||
*comm_style*, *pair_style*, *bond_style*. If the input command does
|
||||
**not** include the word *style*, then there may be many instances of
|
||||
that class defined, for example *region*, *fix*, *compute*, *dump*.
|
||||
|
||||
**Inheritance** enables creation of *derived* classes that can share
|
||||
common functionality in their base class while providing a consistent
|
||||
@ -232,7 +232,7 @@ macro ``PairStyle()`` will associate the style name "lj/cut"
|
||||
with a factory function creating an instance of the ``PairLJCut``
|
||||
class.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
// from force.h
|
||||
typedef Pair *(*PairCreator)(LAMMPS *);
|
||||
@ -360,7 +360,7 @@ characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
||||
argument type must be compatible or else the {fmt} formatting code will
|
||||
throw an exception. Some format string examples are given below:
|
||||
|
||||
.. code-block:: C
|
||||
.. code-block:: c++
|
||||
|
||||
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
||||
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
||||
|
||||
@ -105,7 +105,7 @@ list, where each pair of atoms is listed only once (except when the
|
||||
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
||||
Thus these are the default settings when a neighbor list request is created in:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
void Pair::init_style()
|
||||
{
|
||||
@ -129,7 +129,7 @@ neighbor list request to the specific needs of a style an additional
|
||||
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
||||
for example, needs a "full" neighbor list:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
void PairTersoff::init_style()
|
||||
{
|
||||
@ -141,7 +141,7 @@ When a pair style supports r-RESPA time integration with different cutoff region
|
||||
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
||||
from pair style lj/cut:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
void PairLJCut::init_style()
|
||||
{
|
||||
@ -160,7 +160,7 @@ Granular pair styles need neighbor lists based on particle sizes and not cutoff
|
||||
and also may require to have the list of previous neighbors available ("history").
|
||||
For example with:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
||||
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
||||
@ -170,7 +170,7 @@ settings each request can set an id which is then used in the corresponding
|
||||
``init_list()`` function to assign it to the suitable pointer variable. This is
|
||||
done for example by the :doc:`pair style meam <pair_meam>`:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
void PairMEAM::init_style()
|
||||
{
|
||||
@ -189,7 +189,7 @@ just once) and this can also be indicated by a flag. As an example here
|
||||
is the request from the ``FixPeriNeigh`` class which is created
|
||||
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||
|
||||
@ -198,7 +198,7 @@ than what is usually inferred from the pair style settings (largest cutoff of
|
||||
all pair styles plus neighbor list skin). The following is used in the
|
||||
:doc:`compute rdf <compute_rdf>` command implementation:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
if (cutflag)
|
||||
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
||||
@ -212,7 +212,7 @@ for printing the neighbor list summary the name of the requesting command
|
||||
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
||||
command:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ Parallel algorithms
|
||||
|
||||
LAMMPS is designed to enable running simulations in parallel using the
|
||||
MPI parallel communication standard with distributed data via domain
|
||||
decomposition. The parallelization aims to be efficient result in good
|
||||
strong scaling (= good speedup for the same system) and good weak
|
||||
scaling (= the computational cost of enlarging the system is
|
||||
decomposition. The parallelization aims to be efficient, and resulting
|
||||
in good strong scaling (= good speedup for the same system) and good
|
||||
weak scaling (= the computational cost of enlarging the system is
|
||||
proportional to the system size). Additional parallelization using GPUs
|
||||
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
||||
process. For clarity, most of the following illustrations show the 2d
|
||||
|
||||
@ -95,7 +95,7 @@ a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
||||
``pair_morse2.cpp`` with the factory function and initialization
|
||||
function would look like this:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
@ -141,7 +141,7 @@ list of argument strings), then the pointer type is ``lammpsplugin_factory2``
|
||||
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||
Below is an example for that:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
@ -176,7 +176,7 @@ demonstrated in the following example, which also shows that the
|
||||
implementation of the plugin class may be within the same source
|
||||
file as the plugin interface code:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
|
||||
|
||||
@ -194,7 +194,7 @@ macro. These tests operate by capturing the screen output when executing
|
||||
the failing command and then comparing that with a provided regular
|
||||
expression string pattern. Example:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
TEST_F(SimpleCommandsTest, UnknownCommand)
|
||||
{
|
||||
@ -249,7 +249,7 @@ MPI support. These include tests where LAMMPS is run in multi-partition
|
||||
mode or only on a subset of the MPI world communicator. The CMake
|
||||
script code for adding this kind of test looks like this:
|
||||
|
||||
.. code-block:: CMake
|
||||
.. code-block:: cmake
|
||||
|
||||
if (BUILD_MPI)
|
||||
add_executable(test_library_mpi test_library_mpi.cpp)
|
||||
@ -489,7 +489,7 @@ to update the YAML files. Running a command like
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
||||
test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
||||
|
||||
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
|
||||
the reference data and write a new file with to ``new.yaml``. If this step fails,
|
||||
@ -500,13 +500,13 @@ It is also possible to do an update in place with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ test_pair_style mol-pair-lennard_mdf.yaml -u
|
||||
test_pair_style mol-pair-lennard_mdf.yaml -u
|
||||
|
||||
And one can finally run the full set of tests with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ test_pair_style mol-pair-lennard_mdf.yaml
|
||||
test_pair_style mol-pair-lennard_mdf.yaml
|
||||
|
||||
This will just print a summary of the groups of tests. When using the "-v" flag
|
||||
the test will also keep any LAMMPS output and when using the "-s" flag, there
|
||||
|
||||
425
doc/src/Developer_updating.rst
Normal file
425
doc/src/Developer_updating.rst
Normal file
@ -0,0 +1,425 @@
|
||||
Notes for updating code written for older LAMMPS versions
|
||||
---------------------------------------------------------
|
||||
|
||||
This section documents how C++ source files that are available *outside
|
||||
of the LAMMPS source distribution* (e.g. in external USER packages or as
|
||||
source files provided as a supplement to a publication) that are written
|
||||
for an older version of LAMMPS and thus need to be updated to be
|
||||
compatible with the current version of LAMMPS. Due to the active
|
||||
development of LAMMPS it is likely to always be incomplete. Please
|
||||
contact developers@lammps.org in case you run across an issue that is not
|
||||
(yet) listed here. Please also review the latest information about the
|
||||
LAMMPS :doc:`programming style conventions <Modify_style>`, especially
|
||||
if you are considering to submit the updated version for inclusion into
|
||||
the LAMMPS distribution.
|
||||
|
||||
Available topics in mostly chronological order are:
|
||||
|
||||
- `Setting flags in the constructor`_
|
||||
- `Rename of pack/unpack_comm() to pack/unpack_forward_comm()`_
|
||||
- `Use ev_init() to initialize variables derived from eflag and vflag`_
|
||||
- `Use utils::numeric() functions instead of force->numeric()`_
|
||||
- `Use utils::open_potential() function to open potential files`_
|
||||
- `Simplify customized error messages`_
|
||||
- `Use of "override" instead of "virtual"`_
|
||||
- `Simplified and more compact neighbor list requests`_
|
||||
- `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_
|
||||
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
|
||||
|
||||
----
|
||||
|
||||
Setting flags in the constructor
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As LAMMPS gains additional functionality, new flags may need to be set
|
||||
in the constructor or a class to signal compatibility with such features.
|
||||
Most of the time the defaults are chosen conservatively, but sometimes
|
||||
the conservative choice is the uncommon choice, and then those settings
|
||||
need to be made when updating code.
|
||||
|
||||
Pair styles:
|
||||
|
||||
- ``manybody_flag``: set to 1 if your pair style is not pair-wise additive
|
||||
- ``restartinfo``: set to 0 if your pair style does not store data in restart files
|
||||
|
||||
|
||||
Rename of pack/unpack_comm() to pack/unpack_forward_comm()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 8Aug2014
|
||||
|
||||
In this change set the functions to pack data into communication buffers
|
||||
and to unpack data from communication buffers for :doc:`forward
|
||||
communications <Developer_comm_ops>` were renamed from ``pack_comm()``
|
||||
and ``unpack_comm()`` to ``pack_forward_comm()`` and
|
||||
``unpack_forward_comm()``, respectively. Also the meaning of the return
|
||||
value of these functions was changed: rather than returning the number
|
||||
of items per atom stored in the buffer, now the total number of items
|
||||
added (or unpacked) needs to be returned. Here is an example from the
|
||||
`PairEAM` class. Of course the member function declaration in corresponding
|
||||
header file needs to be updated accordingly.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||
{
|
||||
int m = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
int j = list[i];
|
||||
buf[m++] = fp[j];
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||
{
|
||||
int m = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
int j = list[i];
|
||||
buf[m++] = fp[j];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
.. note::
|
||||
|
||||
Because the various "pack" and "unpack" functions are defined in the
|
||||
respective base classes as dummy functions doing nothing, and because
|
||||
of the the name mismatch the custom versions in the derived class
|
||||
will no longer be called, there will be no compilation error when
|
||||
this change is not applied. Only calculations will suddenly produce
|
||||
incorrect results because the required forward communication calls
|
||||
will cease to function correctly.
|
||||
|
||||
Use ev_init() to initialize variables derived from eflag and vflag
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 29Mar2019
|
||||
|
||||
There are several variables that need to be initialized based on
|
||||
the values of the "eflag" and "vflag" variables and since sometimes
|
||||
there are new bits added and new variables need to be set to 1 or 0.
|
||||
To make this consistent, across all styles, there is now an inline
|
||||
function ``ev_init(eflag, vflag)`` that makes those settings
|
||||
consistently and calls either ``ev_setup()`` or ``ev_unset()``.
|
||||
Example from a pair style:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (eflag || vflag) ev_setup(eflag, vflag);
|
||||
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
ev_init(eflag, vflag);
|
||||
|
||||
Not applying this change will not cause a compilation error, but
|
||||
can lead to inconsistent behavior and incorrect tallying of
|
||||
energy or virial.
|
||||
|
||||
Use utils::numeric() functions instead of force->numeric()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 18Sep2020
|
||||
|
||||
The "numeric()" conversion functions (including "inumeric()",
|
||||
"bnumeric()", and "tnumeric()") have been moved from the Force class to
|
||||
the utils namespace. Also they take an additional argument that selects
|
||||
whether the ``Error::all()`` or ``Error::one()`` function should be
|
||||
called in case of an error. The former should be used when *all* MPI
|
||||
processes call the conversion function and the latter *must* be used
|
||||
when they are called from only one or a subset of the MPI processes.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
val = force->numeric(FLERR, arg[1]);
|
||||
num = force->inumeric(FLERR, arg[2]);
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
val = utils::numeric(FLERR, true, arg[1], lmp);
|
||||
num = utils::inumeric(FLERR, false, arg[2], lmp);
|
||||
|
||||
.. seealso::
|
||||
|
||||
:cpp:func:`utils::numeric() <LAMMPS_NS::utils::numeric>`,
|
||||
:cpp:func:`utils::inumeric() <LAMMPS_NS::utils::inumeric>`,
|
||||
:cpp:func:`utils::bnumeric() <LAMMPS_NS::utils::bnumeric>`,
|
||||
:cpp:func:`utils::tnumeric() <LAMMPS_NS::utils::tnumeric>`
|
||||
|
||||
Use utils::open_potential() function to open potential files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 18Sep2020
|
||||
|
||||
The :cpp:func:`utils::open_potential()
|
||||
<LAMMPS_NS::utils::open_potential>` function must be used to replace
|
||||
calls to ``force->open_potential()`` and should be used to replace
|
||||
``fopen()`` for opening potential files for reading. The custom
|
||||
function does three additional steps compared to ``fopen()``: 1) it will
|
||||
try to parse the ``UNITS:`` and ``DATE:`` metadata will stop with an
|
||||
error on a units mismatch and will print the date info, if present, in
|
||||
the log file; 2) for pair styles that support it, it will set up
|
||||
possible automatic unit conversions based on the embedded unit
|
||||
information and LAMMPS' current units setting; 3) it will not only try
|
||||
to open a potential file at the given path, but will also search in the
|
||||
folders listed in the ``LAMMPS_POTENTIALS`` environment variable. This
|
||||
allows to keep potential files in a common location instead of having to
|
||||
copy them around for simulations.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
fp = force->open_potential(filename);
|
||||
fp = fopen(filename, "r");
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
fp = utils::open_potential(filename, lmp);
|
||||
|
||||
Simplify customized error messages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 14May2021
|
||||
|
||||
Aided by features of the bundled {fmt} library, error messages now
|
||||
can have a variable number of arguments and the string will be interpreted
|
||||
as a {fmt} style format string so that custom error messages can be
|
||||
easily customized without having to use temporary buffers and ``sprintf()``.
|
||||
Example:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (fptr == NULL) {
|
||||
char str[128];
|
||||
sprintf(str,"Cannot open AEAM potential file %s",filename);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (fptr == nullptr)
|
||||
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
|
||||
|
||||
Use of "override" instead of "virtual"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 17Feb2022
|
||||
|
||||
Since LAMMPS requires C++11 we switched to use the "override" keyword
|
||||
instead of "virtual" to indicate polymorphism in derived classes. This
|
||||
allows the C++ compiler to better detect inconsistencies when an
|
||||
override is intended or not. Please note that "override" has to be
|
||||
added to **all** polymorph functions in derived classes and "virtual"
|
||||
*only* to the function in the base class (or the destructor). Here is
|
||||
an example from the ``FixWallReflect`` class:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
FixWallReflect(class LAMMPS *, int, char **);
|
||||
virtual ~FixWallReflect();
|
||||
int setmask();
|
||||
void init();
|
||||
void post_integrate();
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
FixWallReflect(class LAMMPS *, int, char **);
|
||||
~FixWallReflect() override;
|
||||
int setmask() override;
|
||||
void init() override;
|
||||
void post_integrate() override;
|
||||
|
||||
This change set will neither cause a compilation failure, nor will it
|
||||
change functionality, but if you plan to submit the updated code for
|
||||
inclusion into the LAMMPS distribution, it will be requested for achieve
|
||||
a consistent :doc:`programming style <Modify_style>`.
|
||||
|
||||
Simplified function names for forward and reverse communication
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 24Mar2022
|
||||
|
||||
Rather then using the function name to distinguish between the different
|
||||
forward and reverse communication functions for styles, LAMMPS now uses
|
||||
the type of the "this" pointer argument.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
comm->forward_comm_pair(this);
|
||||
comm->forward_comm_fix(this);
|
||||
comm->forward_comm_compute(this);
|
||||
comm->forward_comm_dump(this);
|
||||
comm->reverse_comm_pair(this);
|
||||
comm->reverse_comm_fix(this);
|
||||
comm->reverse_comm_compute(this);
|
||||
comm->reverse_comm_dump(this);
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
comm->forward_comm(this);
|
||||
comm->reverse_comm(this);
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
Simplified and more compact neighbor list requests
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 24Mar2022
|
||||
|
||||
This change set reduces the amount of code required to request a
|
||||
neighbor list. It enforces consistency and no longer requires to change
|
||||
internal data of the request. More information on neighbor list
|
||||
requests can be :doc:`found here <Developer_notes>`. Example from the
|
||||
``ComputeRDF`` class:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int irequest = neighbor->request(this,instance_me);
|
||||
neighbor->requests[irequest]->pair = 0;
|
||||
neighbor->requests[irequest]->compute = 1;
|
||||
neighbor->requests[irequest]->occasional = 1;
|
||||
if (cutflag) {
|
||||
neighbor->requests[irequest]->cut = 1;
|
||||
neighbor->requests[irequest]->cutoff = mycutneigh;
|
||||
}
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||
if (cutflag) req->set_cutoff(mycutneigh);
|
||||
|
||||
Public access to the ``NeighRequest`` class data members has been
|
||||
removed so this update is **required** to avoid compilation failure.
|
||||
|
||||
Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 15Sep2022
|
||||
|
||||
This change splits the GLOBAL and PERATOM modes of fix STORE into two
|
||||
separate fixes STORE/GLOBAL and STORE/PERATOM. There was very little
|
||||
shared code between the two fix STORE modes and the two different code
|
||||
paths had to be prefixed with if statements. Furthermore, some flags
|
||||
were used differently in the two modes leading to confusion. Splitting
|
||||
the code into two fix styles, makes it more easily maintainable. Since
|
||||
these are internal fixes, there is no user visible change.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#include "fix_store.h"
|
||||
|
||||
FixStore *fix = dynamic_cast<FixStore *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE peratom 1 13",id_pole,group->names[0]));
|
||||
|
||||
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_pole));
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#include "fix_store_peratom.h"
|
||||
|
||||
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 13",id_pole,group->names[0]));
|
||||
|
||||
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_pole));
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#include "fix_store.h"
|
||||
|
||||
FixStore *fix = dynamic_cast<FixStore *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE global 1 1",id_fix,group->names[igroup]));
|
||||
|
||||
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_fix));
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#include "fix_store_global.h"
|
||||
|
||||
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/GLOBAL 1 1",id_fix,group->names[igroup]));
|
||||
|
||||
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(modify->get_fix_by_id(id_fix));
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
Use Output::get_dump_by_id() instead of Output::find_dump()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 15Sep2022
|
||||
|
||||
The accessor function to individual dump style instances has been changed
|
||||
from ``Output::find_dump()`` returning the index of the dump instance in
|
||||
the list of dumps to ``Output::get_dump_by_id()`` returning a pointer to
|
||||
the dump directly. Example:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int idump = output->find_dump(arg[iarg+1]);
|
||||
if (idump < 0)
|
||||
error->all(FLERR,"Dump ID in hyper command does not exist");
|
||||
memory->grow(dumplist,ndump+1,"hyper:dumplist");
|
||||
dumplist[ndump++] = idump;
|
||||
|
||||
[...]
|
||||
|
||||
if (dumpflag)
|
||||
for (int idump = 0; idump < ndump; idump++)
|
||||
output->dump[dumplist[idump]]->write();
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||
dumplist.emplace_back(idump);
|
||||
|
||||
[...]
|
||||
|
||||
if (dumpflag) for (auto idump : dumplist) idump->write();
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
@ -305,7 +305,7 @@ are all "whitespace" characters, i.e. the space character, the tabulator
|
||||
character, the carriage return character, the linefeed character, and
|
||||
the form feed character.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
:caption: Tokenizer class example listing entries of the PATH environment variable
|
||||
|
||||
#include "tokenizer.h"
|
||||
@ -337,7 +337,7 @@ tokenizer into a ``try`` / ``catch`` block to handle errors. The
|
||||
when a (type of) number is requested as next token that is not
|
||||
compatible with the string representing the next word.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
:caption: ValueTokenizer class example with exception handling
|
||||
|
||||
#include "tokenizer.h"
|
||||
@ -415,7 +415,7 @@ one or two array indices "[<number>]" with numbers > 0.
|
||||
|
||||
A typical code segment would look like this:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
:caption: Usage example for ArgInfo class
|
||||
|
||||
int nvalues = 0;
|
||||
@ -464,7 +464,7 @@ open the file, and will call the :cpp:class:`LAMMPS_NS::Error` class in
|
||||
case of failures to read or to convert numbers, so that LAMMPS will be
|
||||
aborted.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
||||
|
||||
PotentialFileReader reader(lmp, file, "coul/streitz");
|
||||
@ -543,7 +543,7 @@ chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
|
||||
its size is registered later with :cpp:func:`MyPage::vgot()
|
||||
<LAMMPS_NS::MyPage::vgot>`.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
|
||||
|
||||
#include "my_page.h"
|
||||
|
||||
@ -26,7 +26,7 @@ constructor with the signature: ``FixPrintVel(class LAMMPS *, int, char **)``.
|
||||
Every fix must be registered in LAMMPS by writing the following lines
|
||||
of code in the header before include guards:
|
||||
|
||||
.. code-block:: c
|
||||
.. code-block:: c++
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
// clang-format off
|
||||
@ -47,7 +47,7 @@ keyword when it parses the input script.
|
||||
Let's write a simple fix which will print the average velocity at the end
|
||||
of each timestep. First of all, implement a constructor:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
|
||||
: Fix(lmp, narg, arg)
|
||||
@ -72,7 +72,7 @@ in the Fix class called ``nevery`` which specifies how often the method
|
||||
|
||||
The next method we need to implement is ``setmask()``:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
int FixPrintVel::setmask()
|
||||
{
|
||||
@ -87,7 +87,7 @@ during execution. The constant ``END_OF_STEP`` corresponds to the
|
||||
are called during a timestep and the order in which they are called
|
||||
are shown in the previous section.
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
void FixPrintVel::end_of_step()
|
||||
{
|
||||
@ -143,7 +143,7 @@ The group membership information of an atom is contained in the *mask*
|
||||
property of and atom and the bit corresponding to a given group is
|
||||
stored in the groupbit variable which is defined in Fix base class:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
for (int i = 0; i < nlocal; ++i) {
|
||||
if (atom->mask[i] & groupbit) {
|
||||
@ -174,7 +174,7 @@ to store positions of atoms from previous timestep, we need to add
|
||||
``double** xold`` to the header file. Than add allocation code
|
||||
to the constructor:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
|
||||
{
|
||||
@ -190,7 +190,7 @@ to the constructor:
|
||||
|
||||
Implement the aforementioned methods:
|
||||
|
||||
.. code-block:: C++
|
||||
.. code-block:: c++
|
||||
|
||||
double FixSavePos::memory_usage()
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@ We use it to show how to identify the origin of a segmentation fault.
|
||||
|
||||
After recompiling LAMMPS and running the input you should get something like this:
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
$ ./lmp -in in.melt
|
||||
LAMMPS (19 Mar 2020)
|
||||
@ -75,7 +75,7 @@ Using the GDB debugger to get a stack trace
|
||||
There are two options to use the GDB debugger for identifying the origin
|
||||
of the segmentation fault or similar crash. The GDB debugger has many
|
||||
more features and options, as can be seen for example its `online
|
||||
documentation <http://sourceware.org/gdb/current/onlinedocs/gdb/>`_.
|
||||
documentation <https://sourceware.org/gdb/current/onlinedocs/gdb/>`_.
|
||||
|
||||
Run LAMMPS from within the debugger
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -90,8 +90,9 @@ it. When it reaches the code causing the segmentation fault, it will
|
||||
stop with a message why it stopped, print the current line of code, and
|
||||
drop back to the GDB prompt.
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
(gdb) run
|
||||
[...]
|
||||
Setting up Verlet run ...
|
||||
Unit style : lj
|
||||
@ -106,7 +107,7 @@ drop back to the GDB prompt.
|
||||
Now typing the command "where" will show the stack of functions starting from
|
||||
the current function back to "main()".
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
(gdb) where
|
||||
#0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=<optimized out>) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139
|
||||
@ -124,7 +125,7 @@ You can also print the value of variables and see if there is anything
|
||||
unexpected. Segmentation faults, for example, commonly happen when a
|
||||
pointer variable is not assigned and still initialized to NULL.
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
(gdb) print x
|
||||
$1 = (double **) 0x7ffff7ca1010
|
||||
@ -153,7 +154,7 @@ utility to the current folder. Example: ``coredumpctl -o core dump lmp``.
|
||||
Now you can launch the debugger to load the executable, its debug info
|
||||
and the core dump and drop you to a prompt like before.
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
$ gdb lmp core
|
||||
Reading symbols from lmp...
|
||||
@ -186,7 +187,7 @@ recommended to redirect the valgrind output to a file (e.g. with
|
||||
process ID) so that the messages of the multiple valgrind instances to
|
||||
the console are not mixed.
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
$ valgrind ./lmp -in in.melt
|
||||
==1933642== Memcheck, a memory error detector
|
||||
|
||||
@ -1,32 +1,51 @@
|
||||
The ``LIBLAMMPS`` Fortran Module
|
||||
********************************
|
||||
The :f:mod:`LIBLAMMPS` Fortran Module
|
||||
*************************************
|
||||
|
||||
The ``LIBLAMMPS`` module provides an interface to call LAMMPS from a
|
||||
Fortran code. It is based on the LAMMPS C-library interface and
|
||||
requires a Fortran 2003 compatible compiler to be compiled.
|
||||
The :f:mod:`LIBLAMMPS` module provides an interface to call LAMMPS from
|
||||
Fortran. It is based on the LAMMPS C library interface and requires a
|
||||
fully Fortran 2003-compatible compiler to be compiled. It is designed
|
||||
to be self-contained and not require any support functions written in C,
|
||||
C++, or Fortran other than those in the C library interface and the
|
||||
LAMMPS Fortran module itself.
|
||||
|
||||
While C libraries have a defined binary interface (ABI) and can thus be
|
||||
used from multiple compiler versions from different vendors for as long
|
||||
as they are compatible with the hosting operating system, the same is
|
||||
not true for Fortran codes. Thus the LAMMPS Fortran module needs to be
|
||||
used from multiple compiler versions from different vendors as long as
|
||||
they are compatible with the hosting operating system, the same is not
|
||||
true for Fortran programs. Thus, the LAMMPS Fortran module needs to be
|
||||
compiled alongside the code using it from the source code in
|
||||
``fortran/lammps.f90``. When linking, you also need to
|
||||
:doc:`link to the LAMMPS library <Build_link>`. A typical command line
|
||||
for a simple program using the Fortran interface would be:
|
||||
``fortran/lammps.f90`` *and* with the same compiler used to build the
|
||||
rest of the Fortran code that interfaces to LAMMPS. When linking, you
|
||||
also need to :doc:`link to the LAMMPS library <Build_link>`. A typical
|
||||
command line for a simple program using the Fortran interface would be:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
||||
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
||||
|
||||
Please note, that the MPI compiler wrapper is only required when the
|
||||
calling the library from an MPI parallel code. Please also note the
|
||||
order of the source files: the ``lammps.f90`` file needs to be compiled
|
||||
first, since it provides the ``LIBLAMMPS`` module that is imported by
|
||||
the Fortran code using the interface. A working example code can be
|
||||
found together with equivalent examples in C and C++ in the
|
||||
``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||
Please note that the MPI compiler wrapper is only required when the
|
||||
calling the library *from* an MPI-parallelized program. Otherwise,
|
||||
using the plain Fortran compiler (gfortran, ifort, flang, etc.) will
|
||||
suffice, since there are no direct references to MPI library features,
|
||||
definitions and subroutine calls; MPI communicators are referred to by
|
||||
their integer index representation as required by the Fortran MPI
|
||||
interface. It may be necessary to link to additional libraries,
|
||||
depending on how LAMMPS was configured and whether the LAMMPS library
|
||||
:doc:`was compiled as a static or dynamic library <Build_link>`.
|
||||
|
||||
.. versionadded:: 9Oct2020
|
||||
If the LAMMPS library itself has been compiled with MPI support, the
|
||||
resulting executable will be able to run LAMMPS in parallel with
|
||||
``mpirun``, ``mpiexec``, or equivalent. This may be either on the
|
||||
"world" communicator or a sub-communicator created by the calling
|
||||
Fortran code. If, on the other hand, the LAMMPS library has been
|
||||
compiled **without** MPI support, each LAMMPS instance will run
|
||||
independently using just one processor.
|
||||
|
||||
Please also note that the order of the source files matters: the
|
||||
``lammps.f90`` file needs to be compiled first, since it provides the
|
||||
:f:mod:`LIBLAMMPS` module that would need to be imported by the calling
|
||||
Fortran code in order to uses the Fortran interface.
|
||||
A working example can be found together with equivalent examples in C and
|
||||
C++ in the ``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||
|
||||
.. admonition:: Work in Progress
|
||||
:class: note
|
||||
@ -49,61 +68,96 @@ found together with equivalent examples in C and C++ in the
|
||||
Creating or deleting a LAMMPS object
|
||||
************************************
|
||||
|
||||
With the Fortran interface the creation of a :cpp:class:`LAMMPS
|
||||
With the Fortran interface, the creation of a :cpp:class:`LAMMPS
|
||||
<LAMMPS_NS::LAMMPS>` instance is included in the constructor for
|
||||
creating the :f:func:`lammps` derived type. To import the definition of
|
||||
that type and its type bound procedures you need to add a ``USE
|
||||
LIBLAMMPS`` statement. Internally it will call either
|
||||
that type and its type-bound procedures, you need to add a ``USE LIBLAMMPS``
|
||||
statement. Internally, it will call either
|
||||
:cpp:func:`lammps_open_fortran` or :cpp:func:`lammps_open_no_mpi` from
|
||||
the C library API to create the class instance. All arguments are
|
||||
optional and :cpp:func:`lammps_mpi_init` will be called automatically,
|
||||
if it is needed. Similarly, a possible call to :cpp:func:`lammps_finalize`
|
||||
is integrated into the :f:func:`close` function and triggered with
|
||||
the optional logical argument set to ``.true.``. Here is a simple example:
|
||||
optional and :cpp:func:`lammps_mpi_init` will be called automatically
|
||||
if it is needed. Similarly, a possible call to
|
||||
:cpp:func:`lammps_mpi_finalize` is integrated into the :f:func:`close`
|
||||
function and triggered with the optional logical argument set to
|
||||
``.TRUE.``. Here is a simple example:
|
||||
|
||||
.. code-block:: fortran
|
||||
|
||||
PROGRAM testlib
|
||||
USE LIBLAMMPS ! include the LAMMPS library interface
|
||||
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = &
|
||||
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none' ]
|
||||
IMPLICIT NONE
|
||||
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
||||
CHARACTER(LEN=12), PARAMETER :: args(3) = &
|
||||
[ CHARACTER(LEN=12) :: 'liblammps', '-log', 'none' ]
|
||||
|
||||
! create a LAMMPS instance (and initialize MPI)
|
||||
lmp = lammps(args)
|
||||
! get and print numerical version code
|
||||
PRINT*, 'LAMMPS Version: ', lmp%version()
|
||||
! delete LAMMPS instance (and shuts down MPI)
|
||||
CALL lmp%close(.true.)
|
||||
|
||||
! delete LAMMPS instance (and shutdown MPI)
|
||||
CALL lmp%close(.TRUE.)
|
||||
END PROGRAM testlib
|
||||
|
||||
It is also possible to pass command line flags from Fortran to C/C++ and
|
||||
thus make the resulting executable behave similarly to the standalone
|
||||
executable (it will ignore the `-in/-i` flag, though). This allows
|
||||
using the command line to configure accelerator and suffix settings,
|
||||
configure screen and logfile output, or to set index style variables
|
||||
from the command line and more. Here is a correspondingly adapted
|
||||
version of the previous example:
|
||||
|
||||
.. code-block:: fortran
|
||||
|
||||
PROGRAM testlib2
|
||||
USE LIBLAMMPS ! include the LAMMPS library interface
|
||||
IMPLICIT NONE
|
||||
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
||||
CHARACTER(LEN=128), ALLOCATABLE :: command_args(:)
|
||||
INTEGER :: i, argc
|
||||
|
||||
! copy command line flags to `command_args()`
|
||||
argc = COMMAND_ARGUMENT_COUNT()
|
||||
ALLOCATE(command_args(0:argc))
|
||||
DO i=0, argc
|
||||
CALL GET_COMMAND_ARGUMENT(i, command_args(i))
|
||||
END DO
|
||||
|
||||
! create a LAMMPS instance (and initialize MPI)
|
||||
lmp = lammps(command_args)
|
||||
! get and print numerical version code
|
||||
PRINT*, 'Program name: ', command_args(0)
|
||||
PRINT*, 'LAMMPS Version: ', lmp%version()
|
||||
! delete LAMMPS instance (and shuts down MPI)
|
||||
CALL lmp%close(.TRUE.)
|
||||
DEALLOCATE(command_args)
|
||||
END PROGRAM testlib2
|
||||
|
||||
--------------------
|
||||
|
||||
Executing LAMMPS commands
|
||||
=========================
|
||||
*************************
|
||||
|
||||
Once a LAMMPS instance is created, it is possible to "drive" the LAMMPS
|
||||
simulation by telling LAMMPS to read commands from a file, or pass
|
||||
simulation by telling LAMMPS to read commands from a file or to pass
|
||||
individual or multiple commands from strings or lists of strings. This
|
||||
is done similar to how it is implemented in the `C-library
|
||||
<pg_lib_execute>` interface. Before handing off the calls to the
|
||||
C-library interface, the corresponding Fortran versions of the calls
|
||||
is done similarly to how it is implemented in the :doc:`C library
|
||||
interface <Library_execute>`. Before handing off the calls to the
|
||||
C library interface, the corresponding Fortran versions of the calls
|
||||
(:f:func:`file`, :f:func:`command`, :f:func:`commands_list`, and
|
||||
:f:func:`commands_string`) have to make a copy of the strings passed as
|
||||
:f:func:`commands_string`) have to make copies of the strings passed as
|
||||
arguments so that they can be modified to be compatible with the
|
||||
requirements of strings in C without affecting the original strings.
|
||||
Those copies are automatically deleted after the functions return.
|
||||
Below is a small demonstration of the uses of the different functions:
|
||||
Below is a small demonstration of the uses of the different functions.
|
||||
|
||||
.. code-block:: fortran
|
||||
|
||||
PROGRAM testcmd
|
||||
USE LIBLAMMPS
|
||||
TYPE(lammps) :: lmp
|
||||
CHARACTER(len=512) :: cmds
|
||||
CHARACTER(len=40),ALLOCATABLE :: cmdlist(:)
|
||||
CHARACTER(len=10) :: trimmed
|
||||
TYPE(lammps) :: lmp
|
||||
CHARACTER(LEN=512) :: cmds
|
||||
CHARACTER(LEN=40), ALLOCATABLE :: cmdlist(:)
|
||||
CHARACTER(LEN=10) :: trimmed
|
||||
INTEGER :: i
|
||||
|
||||
lmp = lammps()
|
||||
@ -111,10 +165,10 @@ Below is a small demonstration of the uses of the different functions:
|
||||
CALL lmp%command('variable zpos index 1.0')
|
||||
! define 10 groups of 10 atoms each
|
||||
ALLOCATE(cmdlist(10))
|
||||
DO i=1,10
|
||||
WRITE(trimmed,'(I10)') 10*i
|
||||
WRITE(cmdlist(i),'(A,I1,A,I10,A,A)') &
|
||||
'group g',i-1,' id ',10*(i-1)+1,':',ADJUSTL(trimmed)
|
||||
DO i=1, 10
|
||||
WRITE(trimmed,'(I10)') 10*i
|
||||
WRITE(cmdlist(i),'(A,I1,A,I10,A,A)') &
|
||||
'group g', i-1, ' id ', 10*(i-1)+1, ':', ADJUSTL(trimmed)
|
||||
END DO
|
||||
CALL lmp%commands_list(cmdlist)
|
||||
! run multiple commands from multi-line string
|
||||
@ -123,8 +177,7 @@ Below is a small demonstration of the uses of the different functions:
|
||||
'create_box 1 box' // NEW_LINE('A') // &
|
||||
'create_atoms 1 single 1.0 1.0 ${zpos}'
|
||||
CALL lmp%commands_string(cmds)
|
||||
CALL lmp%close()
|
||||
|
||||
CALL lmp%close(.TRUE.)
|
||||
END PROGRAM testcmd
|
||||
|
||||
---------------
|
||||
|
||||
@ -83,6 +83,7 @@ Packages howto
|
||||
Howto_coreshell
|
||||
Howto_drude
|
||||
Howto_drude2
|
||||
Howto_peri
|
||||
Howto_manifold
|
||||
Howto_spins
|
||||
|
||||
|
||||
@ -3,24 +3,20 @@ CHARMM, AMBER, COMPASS, and DREIDING force fields
|
||||
|
||||
A force field has 2 parts: the formulas that define it and the
|
||||
coefficients used for a particular system. Here we only discuss
|
||||
formulas implemented in LAMMPS that correspond to formulas commonly
|
||||
used in the CHARMM, AMBER, COMPASS, and DREIDING force fields. Setting
|
||||
formulas implemented in LAMMPS that correspond to formulas commonly used
|
||||
in the CHARMM, AMBER, COMPASS, and DREIDING force fields. Setting
|
||||
coefficients is done either from special sections in an input data file
|
||||
via the :doc:`read_data <read_data>` command or in the input script with
|
||||
commands like :doc:`pair_coeff <pair_coeff>` or
|
||||
:doc:`bond_coeff <bond_coeff>` and so on. See the :doc:`Tools <Tools>` doc
|
||||
page for additional tools that can use CHARMM, AMBER, or Materials
|
||||
Studio generated files to assign force field coefficients and convert
|
||||
their output into LAMMPS input.
|
||||
commands like :doc:`pair_coeff <pair_coeff>` or :doc:`bond_coeff
|
||||
<bond_coeff>` and so on. See the :doc:`Tools <Tools>` doc page for
|
||||
additional tools that can use CHARMM, AMBER, or Materials Studio
|
||||
generated files to assign force field coefficients and convert their
|
||||
output into LAMMPS input.
|
||||
|
||||
See :ref:`(MacKerell) <howto-MacKerell>` for a description of the CHARMM force
|
||||
field. See :ref:`(Cornell) <howto-Cornell>` for a description of the AMBER
|
||||
force field. See :ref:`(Sun) <howto-Sun>` for a description of the COMPASS
|
||||
force field.
|
||||
|
||||
.. _charmm: http://www.scripps.edu/brooks
|
||||
|
||||
.. _amber: http://amber.scripps.edu
|
||||
See :ref:`(MacKerell) <howto-MacKerell>` for a description of the CHARMM
|
||||
force field. See :ref:`(Cornell) <howto-Cornell>` for a description of
|
||||
the AMBER force field. See :ref:`(Sun) <howto-Sun>` for a description
|
||||
of the COMPASS force field.
|
||||
|
||||
The interaction styles listed below compute force field formulas that
|
||||
are consistent with common options in CHARMM or AMBER. See each
|
||||
@ -41,9 +37,10 @@ command's documentation for the formula it computes.
|
||||
|
||||
.. note::
|
||||
|
||||
For CHARMM, newer *charmmfsw* or *charmmfsh* styles were released
|
||||
in March 2017. We recommend they be used instead of the older *charmm*
|
||||
styles. See discussion of the differences on the :doc:`pair charmm <pair_charmm>` and :doc:`dihedral charmm <dihedral_charmm>` doc
|
||||
For CHARMM, newer *charmmfsw* or *charmmfsh* styles were released in
|
||||
March 2017. We recommend they be used instead of the older *charmm*
|
||||
styles. See discussion of the differences on the :doc:`pair charmm
|
||||
<pair_charmm>` and :doc:`dihedral charmm <dihedral_charmm>` doc
|
||||
pages.
|
||||
|
||||
COMPASS is a general force field for atomistic simulation of common
|
||||
|
||||
@ -46,7 +46,7 @@ This tutorial assumes that you are operating in a command-line environment
|
||||
using a shell like Bash.
|
||||
|
||||
- Linux: any Terminal window will work
|
||||
- MacOS X: launch the Terminal application.
|
||||
- macOS: launch the Terminal application.
|
||||
- Windows 10: install and run the :doc:`Windows Subsystem for Linux <Howto_wsl>`
|
||||
|
||||
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
|
||||
@ -56,7 +56,7 @@ You should change into the top level directory of the LAMMPS source tree all
|
||||
paths mentioned in the tutorial are relative to that. Immediately after downloading
|
||||
it should look like this:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ ls
|
||||
bench doc lib potentials README tools
|
||||
@ -104,7 +104,7 @@ the progress of the configuration printed to the screen followed by a
|
||||
summary of the enabled features, options and compiler settings. A typical
|
||||
summary screen will look like this:
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
$ cmake ../cmake/
|
||||
-- The CXX compiler identification is GNU 8.2.0
|
||||
|
||||
@ -10,7 +10,7 @@ changes or additions you have made to LAMMPS into the official LAMMPS
|
||||
distribution. It uses the process of updating this very tutorial as an
|
||||
example to describe the individual steps and options. You need to be
|
||||
familiar with git and you may want to have a look at the `git book
|
||||
<http://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||
<https://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||
more advanced git features used below.
|
||||
|
||||
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
||||
@ -78,13 +78,13 @@ machine via HTTPS:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone https://github.com/<your user name>/lammps.git <some name>
|
||||
git clone https://github.com/<your user name>/lammps.git <some name>
|
||||
|
||||
or, if you have set up your GitHub account for using SSH keys, via SSH:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone git@github.com:<your user name>/lammps.git
|
||||
git clone git@github.com:<your user name>/lammps.git
|
||||
|
||||
You can find the proper URL by clicking the "Clone or download"-button:
|
||||
|
||||
@ -103,21 +103,21 @@ and use git pull:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd mylammps
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
cd mylammps
|
||||
git checkout develop
|
||||
git pull https://github.com/lammps/lammps develop
|
||||
|
||||
You can also add this URL as a remote:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git remote add upstream https://www.github.com/lammps/lammps
|
||||
git remote add upstream https://www.github.com/lammps/lammps
|
||||
|
||||
From then on you can update your upstream branches with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
git fetch upstream
|
||||
|
||||
and then refer to the upstream repository branches with
|
||||
`upstream/develop` or `upstream/release` and so on.
|
||||
@ -129,8 +129,8 @@ workflow that updated this tutorial, and hence we will call the branch
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
$ git checkout -b github-tutorial-update upstream/develop
|
||||
git fetch upstream
|
||||
git checkout -b github-tutorial-update upstream/develop
|
||||
|
||||
Now that we have changed branches, we can make our changes to our local
|
||||
repository. Just remember that if you want to start working on another,
|
||||
@ -150,8 +150,8 @@ After everything is done, add the files to the branch and commit them:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git add doc/src/Howto_github.txt
|
||||
$ git add doc/src/JPG/tutorial*.png
|
||||
git add doc/src/Howto_github.txt
|
||||
git add doc/src/JPG/tutorial*.png
|
||||
|
||||
.. warning::
|
||||
|
||||
@ -174,13 +174,13 @@ useful message that explains the change.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git commit -m 'Finally updated the GitHub tutorial'
|
||||
git commit -m 'Finally updated the GitHub tutorial'
|
||||
|
||||
After the commit, the changes can be pushed to the same branch on GitHub:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git push
|
||||
git push
|
||||
|
||||
Git will ask you for your user name and password on GitHub if you have
|
||||
not configured anything. If your local branch is not present on GitHub yet,
|
||||
@ -188,7 +188,7 @@ it will ask you to add it by running
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git push --set-upstream origin github-tutorial-update
|
||||
git push --set-upstream origin github-tutorial-update
|
||||
|
||||
If you correctly type your user name and
|
||||
password, the feature branch should be added to your fork on GitHub.
|
||||
@ -198,13 +198,13 @@ If you want to make really sure you push to the right repository
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git push origin
|
||||
git push origin
|
||||
|
||||
or using an explicit URL:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git push git@github.com:Pakketeretet2/lammps.git
|
||||
git push git@github.com:Pakketeretet2/lammps.git
|
||||
|
||||
----------
|
||||
|
||||
@ -412,10 +412,10 @@ we need to pull Axel's change back into our branch, and merge them:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git add Howto_github.txt
|
||||
$ git add JPG/tutorial_reverse_pull_request*.png
|
||||
$ git commit -m "Updated text and images on reverse pull requests"
|
||||
$ git pull
|
||||
git add Howto_github.txt
|
||||
git add JPG/tutorial_reverse_pull_request*.png
|
||||
git commit -m "Updated text and images on reverse pull requests"
|
||||
git pull
|
||||
|
||||
In this case, the merge was painless because git could auto-merge:
|
||||
|
||||
@ -428,10 +428,10 @@ commit and push again:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git add Howto_github.txt
|
||||
$ git add JPG/tutorial_reverse_pull_request6.png
|
||||
$ git commit -m "Merged Axel's suggestions and updated text"
|
||||
$ git push git@github.com:Pakketeretet2/lammps
|
||||
git add Howto_github.txt
|
||||
git add JPG/tutorial_reverse_pull_request6.png
|
||||
git commit -m "Merged Axel's suggestions and updated text"
|
||||
git push git@github.com:Pakketeretet2/lammps
|
||||
|
||||
This merge also shows up on the lammps GitHub page:
|
||||
|
||||
@ -456,9 +456,9 @@ branch!
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
$ git branch -d github-tutorial-update
|
||||
git checkout develop
|
||||
git pull https://github.com/lammps/lammps develop
|
||||
git branch -d github-tutorial-update
|
||||
|
||||
If you do not pull first, it is not really a problem but git will warn
|
||||
you at the next statement that you are deleting a local branch that
|
||||
@ -472,7 +472,7 @@ to your remote(s) as well:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git push origin :github-tutorial-update
|
||||
git push origin :github-tutorial-update
|
||||
|
||||
**Recent changes in the workflow**
|
||||
|
||||
@ -486,5 +486,6 @@ simplify comparisons between releases. Finally, all patches and
|
||||
submissions are subject to automatic testing and code checks to make
|
||||
sure they at the very least compile.
|
||||
|
||||
A discussion of the LAMMPS developer GitHub workflow can be found in the file
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||
A discussion of the LAMMPS developer GitHub workflow can be found in the
|
||||
file `doc/github-development-workflow.md
|
||||
<https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||
|
||||
@ -47,4 +47,4 @@ to the relevant fixes.
|
||||
.. _Paquay1:
|
||||
|
||||
**(Paquay)** Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
||||
preprint available at `arXiv:1411.3019 <http://arxiv.org/abs/1411.3019/>`_.
|
||||
preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.
|
||||
|
||||
@ -22,10 +22,11 @@ commands you specify.
|
||||
As discussed below, LAMMPS gives you a variety of ways to determine
|
||||
what quantities are computed and printed when the thermodynamics,
|
||||
dump, or fix commands listed above perform output. Throughout this
|
||||
discussion, note that users can also :doc:`add their own computes and fixes to LAMMPS <Modify>` which can then generate values that can then be
|
||||
output with these commands.
|
||||
discussion, note that users can also :doc:`add their own computes and
|
||||
fixes to LAMMPS <Modify>` which can then generate values that can then
|
||||
be output with these commands.
|
||||
|
||||
The following sub-sections discuss different LAMMPS command related
|
||||
The following sub-sections discuss different LAMMPS commands related
|
||||
to output and the kind of data they operate on and produce:
|
||||
|
||||
* :ref:`Global/per-atom/local data <global>`
|
||||
@ -94,11 +95,11 @@ script references the data determines which style is meant. Example: if
|
||||
a compute provides both a global scalar and a per-atom vector, the
|
||||
former will be accessed by using ``c_ID`` in an equal-style variable,
|
||||
while the latter will be accessed by using ``c_ID`` in an atom-style
|
||||
variable. Note that atom-style variable formulas can also access global
|
||||
scalars, but in this case it is not possible to do directly because of
|
||||
the ambiguity. Instead, an equal-style variable can be defined which
|
||||
accesses the global scalar, and that variable used in the atom-style
|
||||
variable formula in place of ``c_ID``.
|
||||
variable. Note that atom-style variable formulas can also access
|
||||
global scalars, but in this case it is not possible to do this
|
||||
directly because of the ambiguity. Instead, an equal-style variable
|
||||
can be defined which accesses the global scalar, and that variable can
|
||||
be used in the atom-style variable formula in place of ``c_ID``.
|
||||
|
||||
.. _thermo:
|
||||
|
||||
@ -141,9 +142,10 @@ There is also a :doc:`dump custom <dump>` format where the user
|
||||
specifies what values are output with each atom. Pre-defined atom
|
||||
attributes can be specified (id, x, fx, etc). Three additional kinds
|
||||
of keywords can also be specified (c_ID, f_ID, v_name), where a
|
||||
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable <variable>`
|
||||
provides the values to be output. In each case, the compute, fix, or
|
||||
variable must generate per-atom values for input to the :doc:`dump custom <dump>` command.
|
||||
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable
|
||||
<variable>` provides the values to be output. In each case, the
|
||||
compute, fix, or variable must generate per-atom values for input to
|
||||
the :doc:`dump custom <dump>` command.
|
||||
|
||||
There is also a :doc:`dump local <dump>` format where the user specifies
|
||||
what local values to output. A pre-defined index keyword can be
|
||||
@ -160,12 +162,13 @@ Fixes that write output files
|
||||
-----------------------------
|
||||
|
||||
Several fixes take various quantities as input and can write output
|
||||
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk <fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`,
|
||||
:doc:`fix ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
|
||||
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk
|
||||
<fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`, :doc:`fix
|
||||
ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
|
||||
|
||||
The :doc:`fix ave/time <fix_ave_time>` command enables direct output to
|
||||
a file and/or time-averaging of global scalars or vectors. The user
|
||||
specifies one or more quantities as input. These can be global
|
||||
The :doc:`fix ave/time <fix_ave_time>` command enables direct output
|
||||
to a file and/or time-averaging of global scalars or vectors. The
|
||||
user specifies one or more quantities as input. These can be global
|
||||
:doc:`compute <compute>` values, global :doc:`fix <fix>` values, or
|
||||
:doc:`variables <variable>` of any style except the atom style which
|
||||
produces per-atom values. Since a variable can refer to keywords used
|
||||
@ -184,8 +187,8 @@ atoms, e.g. individual molecules. The per-atom quantities can be atom
|
||||
density (mass or number) or atom attributes such as position,
|
||||
velocity, force. They can also be per-atom quantities calculated by a
|
||||
:doc:`compute <compute>`, by a :doc:`fix <fix>`, or by an atom-style
|
||||
:doc:`variable <variable>`. The chunk-averaged output of this fix can
|
||||
also be used as input to other output commands.
|
||||
:doc:`variable <variable>`. The chunk-averaged output of this fix is
|
||||
global and can also be used as input to other output commands.
|
||||
|
||||
The :doc:`fix ave/histo <fix_ave_histo>` command enables direct output
|
||||
to a file of histogrammed quantities, which can be global or per-atom
|
||||
@ -202,32 +205,35 @@ written to the screen and log file or to a separate file, periodically
|
||||
during a running simulation. The line can contain one or more
|
||||
:doc:`variable <variable>` values for any style variable except the
|
||||
vector or atom styles). As explained above, variables themselves can
|
||||
contain references to global values generated by :doc:`thermodynamic keywords <thermo_style>`, :doc:`computes <compute>`,
|
||||
:doc:`fixes <fix>`, or other :doc:`variables <variable>`, or to per-atom
|
||||
values for a specific atom. Thus the :doc:`fix print <fix_print>`
|
||||
command is a means to output a wide variety of quantities separate
|
||||
from normal thermodynamic or dump file output.
|
||||
contain references to global values generated by :doc:`thermodynamic
|
||||
keywords <thermo_style>`, :doc:`computes <compute>`, :doc:`fixes
|
||||
<fix>`, or other :doc:`variables <variable>`, or to per-atom values
|
||||
for a specific atom. Thus the :doc:`fix print <fix_print>` command is
|
||||
a means to output a wide variety of quantities separate from normal
|
||||
thermodynamic or dump file output.
|
||||
|
||||
.. _computeoutput:
|
||||
|
||||
Computes that process output quantities
|
||||
---------------------------------------
|
||||
|
||||
The :doc:`compute reduce <compute_reduce>` and :doc:`compute reduce/region <compute_reduce>` commands take one or more per-atom
|
||||
or local vector quantities as inputs and "reduce" them (sum, min, max,
|
||||
The :doc:`compute reduce <compute_reduce>` and :doc:`compute
|
||||
reduce/region <compute_reduce>` commands take one or more per-atom or
|
||||
local vector quantities as inputs and "reduce" them (sum, min, max,
|
||||
ave) to scalar quantities. These are produced as output values which
|
||||
can be used as input to other output commands.
|
||||
|
||||
The :doc:`compute slice <compute_slice>` command take one or more global
|
||||
vector or array quantities as inputs and extracts a subset of their
|
||||
values to create a new vector or array. These are produced as output
|
||||
values which can be used as input to other output commands.
|
||||
The :doc:`compute slice <compute_slice>` command take one or more
|
||||
global vector or array quantities as inputs and extracts a subset of
|
||||
their values to create a new vector or array. These are produced as
|
||||
output values which can be used as input to other output commands.
|
||||
|
||||
The :doc:`compute property/atom <compute_property_atom>` command takes a
|
||||
list of one or more pre-defined atom attributes (id, x, fx, etc) and
|
||||
The :doc:`compute property/atom <compute_property_atom>` command takes
|
||||
a list of one or more pre-defined atom attributes (id, x, fx, etc) and
|
||||
stores the values in a per-atom vector or array. These are produced
|
||||
as output values which can be used as input to other output commands.
|
||||
The list of atom attributes is the same as for the :doc:`dump custom <dump>` command.
|
||||
The list of atom attributes is the same as for the :doc:`dump custom
|
||||
<dump>` command.
|
||||
|
||||
The :doc:`compute property/local <compute_property_local>` command takes
|
||||
a list of one or more pre-defined local attributes (bond info, angle
|
||||
|
||||
1078
doc/src/Howto_peri.rst
Normal file
1078
doc/src/Howto_peri.rst
Normal file
File diff suppressed because it is too large
Load Diff
@ -152,14 +152,14 @@ Creating a new instance of PyLammps
|
||||
To create a PyLammps object you need to first import the class from the lammps
|
||||
module. By using the default constructor, a new *lammps* instance is created.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import PyLammps
|
||||
L = PyLammps()
|
||||
|
||||
You can also initialize PyLammps on top of this existing *lammps* object:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps, PyLammps
|
||||
lmp = lammps()
|
||||
@ -180,14 +180,14 @@ For instance, let's take the following LAMMPS command:
|
||||
In the original interface this command can be executed with the following
|
||||
Python code if *L* was a lammps instance:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.command("region box block 0 10 0 5 -0.5 0.5")
|
||||
|
||||
With the PyLammps interface, any command can be split up into arbitrary parts
|
||||
separated by white-space, passed as individual arguments to a region method.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||
|
||||
@ -199,14 +199,14 @@ The benefit of this approach is avoiding redundant command calls and easier
|
||||
parameterization. In the original interface parameterization needed to be done
|
||||
manually by creating formatted strings.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||
|
||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||
them automatically to a final command string.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||
|
||||
@ -256,7 +256,7 @@ LAMMPS variables can be both defined and accessed via the PyLammps interface.
|
||||
|
||||
To define a variable you can use the :doc:`variable <variable>` command:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.variable("a index 2")
|
||||
|
||||
@ -265,14 +265,14 @@ A dictionary of all variables is returned by L.variables
|
||||
you can access an individual variable by retrieving a variable object from the
|
||||
L.variables dictionary by name
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
a = L.variables['a']
|
||||
|
||||
The variable value can then be easily read and written by accessing the value
|
||||
property of this object.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
print(a.value)
|
||||
a.value = 4
|
||||
@ -284,7 +284,7 @@ LAMMPS expressions can be immediately evaluated by using the eval method. The
|
||||
passed string parameter can be any expression containing global thermo values,
|
||||
variables, compute or fix data.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
result = L.eval("ke") # kinetic energy
|
||||
result = L.eval("pe") # potential energy
|
||||
@ -298,7 +298,7 @@ All atoms in the current simulation can be accessed by using the L.atoms list.
|
||||
Each element of this list is an object which exposes its properties (id, type,
|
||||
position, velocity, force, etc.).
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
# access first atom
|
||||
L.atoms[0].id
|
||||
@ -311,7 +311,7 @@ position, velocity, force, etc.).
|
||||
|
||||
Some properties can also be used to set:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
# set position in 2D simulation
|
||||
L.atoms[0].position = (1.0, 0.0)
|
||||
@ -328,7 +328,7 @@ after a run via the L.runs list. This list contains a growing list of run data.
|
||||
The first element is the output of the first run, the second element that of
|
||||
the second run.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.run(1000)
|
||||
L.runs[0] # data of first 1000 time steps
|
||||
@ -339,14 +339,14 @@ the second run.
|
||||
Each run contains a dictionary of all trajectories. Each trajectory is
|
||||
accessible through its thermo name:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
L.runs[0].thermo.Step # list of time steps in first run
|
||||
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
||||
|
||||
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
import matplotlib.plot as plt
|
||||
steps = L.runs[0].thermo.Step
|
||||
@ -406,7 +406,7 @@ Four atoms are placed in the simulation and the dihedral potential is applied on
|
||||
them using a datafile. Then one of the atoms is rotated along the central axis by
|
||||
setting its position from Python, which changes the dihedral angle.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
phi = [d \* math.pi / 180 for d in range(360)]
|
||||
|
||||
@ -439,7 +439,7 @@ Initially, a 2D system is created in a state with minimal energy.
|
||||
|
||||
It is then disordered by moving each atom by a random delta.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
random.seed(27848)
|
||||
deltaperturb = 0.2
|
||||
@ -458,7 +458,7 @@ It is then disordered by moving each atom by a random delta.
|
||||
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
||||
moves random atoms by a random delta and only accepts certain moves.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
estart = L.eval("pe")
|
||||
elast = estart
|
||||
@ -517,7 +517,7 @@ PyLammps can be run in parallel using mpi4py. This python package can be install
|
||||
The following is a short example which reads in an existing LAMMPS input file and
|
||||
executes it in parallel. You can find in.melt in the examples/melt folder.
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
from mpi4py import MPI
|
||||
from lammps import PyLammps
|
||||
|
||||
@ -38,7 +38,7 @@ the partial charge assignments change:
|
||||
See the :ref:`(Berendsen) <howto-Berendsen>` reference for more details on both
|
||||
the SPC and SPC/E models.
|
||||
|
||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
||||
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -30,9 +30,11 @@ can be coupled to another Langevin thermostat applied to the atoms
|
||||
using :doc:`fix langevin <fix_langevin>` in order to simulate
|
||||
thermostatted spin-lattice systems.
|
||||
|
||||
The magnetic Gilbert damping can also be applied using :doc:`fix langevin/spin <fix_langevin_spin>`. It allows to either dissipate
|
||||
the thermal energy of the Langevin thermostat, or to perform a
|
||||
relaxation of the magnetic configuration toward an equilibrium state.
|
||||
The magnetic damping can also be applied
|
||||
using :doc:`fix langevin/spin <fix_langevin_spin>`.
|
||||
It allows to either dissipate the thermal energy of the Langevin
|
||||
thermostat, or to perform a relaxation of the magnetic configuration
|
||||
toward an equilibrium state.
|
||||
|
||||
The command :doc:`fix setforce/spin <fix_setforce>` allows to set the
|
||||
components of the magnetic precession vectors (while erasing and
|
||||
@ -52,9 +54,11 @@ All the computed magnetic properties can be output by two main
|
||||
commands. The first one is :doc:`compute spin <compute_spin>`, that
|
||||
enables to evaluate magnetic averaged quantities, such as the total
|
||||
magnetization of the system along x, y, or z, the spin temperature, or
|
||||
the magnetic energy. The second command is :doc:`compute property/atom <compute_property_atom>`. It enables to output all the
|
||||
per atom magnetic quantities. Typically, the orientation of a given
|
||||
magnetic spin, or the magnetic force acting on this spin.
|
||||
the magnetic energy. The second command
|
||||
is :doc:`compute property/atom <compute_property_atom>`.
|
||||
It enables to output all the per atom magnetic quantities. Typically,
|
||||
the orientation of a given magnetic spin, or the magnetic force
|
||||
acting on this spin.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ JSON
|
||||
"ke": $(ke)
|
||||
}""" file current_state.json screen no
|
||||
|
||||
.. code-block:: JSON
|
||||
.. code-block:: json
|
||||
:caption: current_state.json
|
||||
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ details:
|
||||
| :math:`\theta` of HOH angle = 104.52\ :math:`^{\circ}`
|
||||
|
|
||||
|
||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
||||
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -8,18 +8,28 @@ This site M is located at a fixed distance away from the oxygen along
|
||||
the bisector of the HOH bond angle. A bond style of *harmonic* and an
|
||||
angle style of *harmonic* or *charmm* should also be used.
|
||||
|
||||
A TIP4P model is run with LAMMPS using either this command
|
||||
A TIP4P model is run with LAMMPS using either these commands
|
||||
for a cutoff model:
|
||||
|
||||
* :doc:`pair_style tip4p/cut <pair_lj_cut_tip4p>`
|
||||
* :doc:`pair_style lj/cut/tip4p/cut <pair_lj_cut_tip4p>`
|
||||
|
||||
or these two commands for a long-range model:
|
||||
or these commands for a long-range model:
|
||||
|
||||
* :doc:`pair_style tip4p/long <pair_coul>`
|
||||
* :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>`
|
||||
* :doc:`pair_style lj/long/tip4p/long <pair_lj_long>`
|
||||
* :doc:`pair_style tip4p/long/soft <pair_fep_soft>`
|
||||
* :doc:`pair_style lj/cut/tip4p/long/soft <pair_fep_soft>`
|
||||
* :doc:`kspace_style pppm/tip4p <kspace_style>`
|
||||
* :doc:`kspace_style pppm/disp/tip4p <kspace_style>`
|
||||
|
||||
For both models, the bond lengths and bond angles should be held fixed
|
||||
using the :doc:`fix shake <fix_shake>` command.
|
||||
The bond lengths and bond angles should be held fixed using the
|
||||
:doc:`fix shake <fix_shake>` or :doc:`fix rattle <fix_shake>` command,
|
||||
unless a parameterization for a flexible TIP4P model is used. The
|
||||
parameter sets listed below are all for rigid TIP4P model variants and
|
||||
thus the bond and angle force constants are not used and can be set to
|
||||
any legal value; only equilibrium length and angle are used.
|
||||
|
||||
These are the additional parameters (in real units) to set for O and H
|
||||
atoms and the water molecule to run a rigid TIP4P model with a cutoff
|
||||
@ -87,17 +97,18 @@ solver (e.g. Ewald or PPPM in LAMMPS):
|
||||
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
|
||||
|
|
||||
|
||||
Note that the when using the TIP4P pair style, the neighbor list
|
||||
cutoff for Coulomb interactions is effectively extended by a distance
|
||||
2 \* (OM distance), to account for the offset distance of the
|
||||
fictitious charges on O atoms in water molecules. Thus it is
|
||||
typically best in an efficiency sense to use a LJ cutoff >= Coulomb
|
||||
cutoff + 2\*(OM distance), to shrink the size of the neighbor list.
|
||||
This leads to slightly larger cost for the long-range calculation, so
|
||||
you can test the trade-off for your model. The OM distance and the LJ
|
||||
and Coulombic cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>` command.
|
||||
Note that the when using the TIP4P pair style, the neighbor list cutoff
|
||||
for Coulomb interactions is effectively extended by a distance 2 \* (OM
|
||||
distance), to account for the offset distance of the fictitious charges
|
||||
on O atoms in water molecules. Thus it is typically best in an
|
||||
efficiency sense to use a LJ cutoff >= Coulomb cutoff + 2\*(OM
|
||||
distance), to shrink the size of the neighbor list. This leads to
|
||||
slightly larger cost for the long-range calculation, so you can test the
|
||||
trade-off for your model. The OM distance and the LJ and Coulombic
|
||||
cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long
|
||||
<pair_lj_cut_tip4p>` command.
|
||||
|
||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
||||
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -17,9 +17,10 @@ formats. See the :doc:`Tools <Tools>` page for details.
|
||||
|
||||
A Python-based toolkit distributed by our group can read native LAMMPS
|
||||
dump files, including custom dump files with additional columns of
|
||||
user-specified atom information, and convert them to various formats
|
||||
or pipe them into visualization software directly. See the `Pizza.py WWW site <pizza_>`_ for details. Specifically, Pizza.py can convert
|
||||
LAMMPS dump files into PDB, XYZ, `EnSight <ensight_>`_, and VTK formats.
|
||||
user-specified atom information, and convert them to various formats or
|
||||
pipe them into visualization software directly. See the `Pizza.py WWW
|
||||
site <pizza_>`_ for details. Specifically, Pizza.py can convert LAMMPS
|
||||
dump files into PDB, XYZ, `EnSight <ensight_>`_, and VTK formats.
|
||||
Pizza.py can pipe LAMMPS dump files directly into the Raster3d and
|
||||
RasMol visualization programs. Pizza.py has tools that do interactive
|
||||
3d OpenGL visualization and one that creates SVG images of dump file
|
||||
|
||||
@ -3,10 +3,20 @@ Install LAMMPS
|
||||
|
||||
You can download LAMMPS as an executable or as source code.
|
||||
|
||||
With source code, you also have to :doc:`build LAMMPS <Build>`. But you
|
||||
have more flexibility as to what features to include or exclude in the
|
||||
build. If you plan to :doc:`modify or extend LAMMPS <Modify>`, then you
|
||||
need the source code.
|
||||
When downloading the LAMMPS source code, you also have to :doc:`build
|
||||
LAMMPS <Build>`. But you have more flexibility as to what features to
|
||||
include or exclude in the build. When you download and install
|
||||
pre-compiled LAMMPS executables, you are limited to install which
|
||||
version of LAMMPS is available and which features are included of these
|
||||
builds. If you plan to :doc:`modify or extend LAMMPS <Modify>`, then
|
||||
you **must** build LAMMPS from the source code.
|
||||
|
||||
.. note::
|
||||
|
||||
If you have questions about the pre-compiled LAMMPS executables, you
|
||||
need to contact the people preparing those executables. The LAMMPS
|
||||
developers have no control over their choices of how they configure
|
||||
and build their packages and when they update them.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
@ -1,24 +1,25 @@
|
||||
Download an executable for Linux or Mac via Conda
|
||||
-------------------------------------------------
|
||||
|
||||
Binaries are available for MacOS or Linux via `Conda <conda_>`_.
|
||||
Pre-compiled LAMMPS binaries are available for macOS or Linux via the
|
||||
`Conda <conda_>`_ package management system.
|
||||
|
||||
First, one must setup the Conda package manager on your system. Follow the
|
||||
instructions to install `Miniconda <mini_conda_install_>`_, then create a conda
|
||||
environment (named `my-lammps-env` or whatever you prefer) for your lammps
|
||||
environment (named `my-lammps-env` or whatever you prefer) for your LAMMPS
|
||||
install:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% conda config --add channels conda-forge
|
||||
% conda create -n my-lammps-env
|
||||
conda config --add channels conda-forge
|
||||
conda create -n my-lammps-env
|
||||
|
||||
Then, you can install lammps on your system with the following command:
|
||||
Then, you can install LAMMPS on your system with the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% conda activate my-lammps-env
|
||||
% conda install lammps
|
||||
conda activate my-lammps-env
|
||||
conda install lammps
|
||||
|
||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||
results in Conda also installing the `kim-api` binaries when LAMMPS is
|
||||
@ -27,7 +28,7 @@ install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% conda install openkim-models
|
||||
conda install openkim-models
|
||||
|
||||
If you have problems with the installation you can post issues to
|
||||
`this link <conda_forge_lammps_>`_.
|
||||
@ -38,3 +39,10 @@ up the Conda capability.
|
||||
.. _openkim: https://openkim.org
|
||||
.. _conda: https://docs.conda.io/en/latest/index.html
|
||||
.. _mini_conda_install: https://docs.conda.io/en/latest/miniconda.html
|
||||
|
||||
.. note::
|
||||
|
||||
If you have questions about these pre-compiled LAMMPS executables,
|
||||
you need to contact the people preparing those packages. The LAMMPS
|
||||
developers have no control over their choices of how they configure
|
||||
and build their packages and when they update them.
|
||||
|
||||
@ -41,7 +41,7 @@ create a local copy of the LAMMPS repository with a command like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||
git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||
|
||||
where "mylammps" is the name of the directory you wish to create on
|
||||
your machine and "release" is one of the 3 branches listed above.
|
||||
@ -78,10 +78,10 @@ from within the "mylammps" directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout release # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout develop # to choose the branch to follow
|
||||
$ git pull
|
||||
git checkout release # not needed if you always stay in this branch
|
||||
git checkout stable # use one of these 3 checkout commands
|
||||
git checkout develop # to choose the branch to follow
|
||||
git pull
|
||||
|
||||
Doing a "pull" will not change any files you have added to the LAMMPS
|
||||
directory structure. It will also not change any existing LAMMPS
|
||||
@ -97,7 +97,7 @@ this is as follows.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout tagID
|
||||
git checkout tagID
|
||||
|
||||
Stable versions and what tagID to use for a particular stable version
|
||||
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
||||
@ -138,13 +138,13 @@ changed. How to do this depends on the build system you are using.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make purge # remove any deprecated src files
|
||||
$ make package-update # sync package files with src files
|
||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||
make purge # remove any deprecated src files
|
||||
make package-update # sync package files with src files
|
||||
make foo # re-build for your machine (mpi, serial, etc)
|
||||
|
||||
to enforce consistency of the source between the src folder
|
||||
and package directories. This is OK to do even if you don't
|
||||
use any packages. The "make purge" command removes any deprecated
|
||||
use any packages. The ``make purge`` command removes any deprecated
|
||||
src files if they were removed by the patch from a package
|
||||
sub-directory.
|
||||
|
||||
@ -160,9 +160,9 @@ changed. How to do this depends on the build system you are using.
|
||||
:class: note
|
||||
|
||||
The servers at github.com support the "https://" access protocol for
|
||||
anonymous, read-only access. If you have a suitably configured GitHub
|
||||
account, you may also use SSH protocol with the
|
||||
URL "git@github.com:lammps/lammps.git".
|
||||
anonymous, read-only access. If you have a suitably configured
|
||||
GitHub account, you may also use SSH protocol with the URL
|
||||
"git@github.com:lammps/lammps.git".
|
||||
|
||||
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
||||
(Temple U, akohlmey at gmail.com).
|
||||
|
||||
@ -3,13 +3,19 @@ Download an executable for Linux
|
||||
|
||||
Binaries are available for different versions of Linux:
|
||||
|
||||
| :ref:`Pre-built Ubuntu Linux executables <ubuntu>`
|
||||
| :ref:`Pre-built Fedora Linux executables <fedora>`
|
||||
| :ref:`Pre-built EPEL Linux executables (RHEL, CentOS) <epel>`
|
||||
| :ref:`Pre-built OpenSuse Linux executables <opensuse>`
|
||||
| :ref:`Gentoo Linux executable <gentoo>`
|
||||
| :ref:`Arch Linux build-script <arch>`
|
||||
|
|
||||
- :ref:`Pre-built Ubuntu Linux executables <ubuntu>`
|
||||
- :ref:`Pre-built Fedora Linux executables <fedora>`
|
||||
- :ref:`Pre-built EPEL Linux executables (RHEL, CentOS) <epel>`
|
||||
- :ref:`Pre-built OpenSuse Linux executables <opensuse>`
|
||||
- :ref:`Gentoo Linux executable <gentoo>`
|
||||
- :ref:`Arch Linux build-script <arch>`
|
||||
|
||||
.. note::
|
||||
|
||||
If you have questions about these pre-compiled LAMMPS executables,
|
||||
you need to contact the people preparing those packages. The LAMMPS
|
||||
developers have no control over their choices of how they configure
|
||||
and build their packages and when they update them.
|
||||
|
||||
----------
|
||||
|
||||
@ -18,86 +24,53 @@ Binaries are available for different versions of Linux:
|
||||
Pre-built Ubuntu Linux executables
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A pre-built LAMMPS executable suitable for running on the latest
|
||||
Ubuntu Linux versions, can be downloaded as a Debian package. This
|
||||
allows you to install LAMMPS with a single command, and stay
|
||||
up-to-date with the current stable version of LAMMPS by simply updating
|
||||
your operating system. Please note, that the repository below offers
|
||||
two LAMMPS packages, ``lammps-daily`` and ``lammps-stable``. The
|
||||
LAMMPS developers recommend to use the ``lammps-stable`` package for
|
||||
any production simulations. The ``lammps-daily`` package is built
|
||||
from the LAMMPS development sources, and those versions may have known
|
||||
issues and bugs when new features are added and the software has not
|
||||
undergone full release testing.
|
||||
|
||||
To install the appropriate personal-package archives (PPAs), do the
|
||||
following once:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo add-apt-repository ppa:gladky-anton/lammps
|
||||
$ sudo add-apt-repository ppa:openkim/latest
|
||||
$ sudo apt-get update
|
||||
A pre-built LAMMPS executable suitable for running on the latest Ubuntu
|
||||
Linux versions, can be downloaded as a Debian package. This allows you
|
||||
to install LAMMPS with a single command, and stay (mostly) up-to-date
|
||||
with the current stable version of LAMMPS by simply updating your
|
||||
operating system.
|
||||
|
||||
To install LAMMPS do the following once:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install lammps-stable
|
||||
sudo apt-get install lammps
|
||||
|
||||
This downloads an executable named ``lmp_stable`` to your box, which
|
||||
can then be used in the usual way to run input scripts:
|
||||
This downloads an executable named ``lmp`` to your box and multiple
|
||||
packages with supporting data, examples and libraries as well as any
|
||||
missing dependencies. This executable can then be used in the usual way
|
||||
to run input scripts:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ lmp_stable -in in.lj
|
||||
lmp -in in.lj
|
||||
|
||||
To update LAMMPS to the most current stable version, do the following:
|
||||
To update LAMMPS to the latest packaged version, do the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get update
|
||||
sudo apt-get update
|
||||
|
||||
which will also update other packages on your system.
|
||||
|
||||
To get a copy of the current documentation and examples:
|
||||
The ``lmp`` binary is built with the :ref:`KIM package <kim>` included,
|
||||
which results in the above command also installing the ``kim-api``
|
||||
binaries when LAMMPS is installed. In order to use potentials from
|
||||
`openkim.org <openkim_>`_, you can also install the ``openkim-models``
|
||||
package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install lammps-stable-doc
|
||||
|
||||
which will download the doc files in
|
||||
``/usr/share/doc/lammps-stable-doc/doc`` and example problems in
|
||||
``/usr/share/doc/lammps-doc/examples``.
|
||||
|
||||
To get a copy of the current potentials files:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install lammps-stable-data
|
||||
|
||||
which will download the potentials files to
|
||||
``/usr/share/lammps-stable/potentials``. The ``lmp_stable`` binary is
|
||||
hard-coded to look for potential files in this directory (it does not
|
||||
use the ``LAMMPS_POTENTIALS`` environment variable, as described
|
||||
in :doc:`pair_coeff <pair_coeff>` command).
|
||||
|
||||
The ``lmp_stable`` binary is built with the :ref:`KIM package <kim>` which
|
||||
results in the above command also installing the ``kim-api`` binaries when LAMMPS
|
||||
is installed. In order to use potentials from `openkim.org <openkim_>`_, you
|
||||
can install the ``openkim-models`` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install openkim-models
|
||||
sudo apt-get install openkim-models
|
||||
|
||||
Or use the KIM-API commands to download and install individual models.
|
||||
To un-install LAMMPS, do the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get remove lammps-stable
|
||||
sudo apt-get remove lammps
|
||||
|
||||
Please use ``lmp_stable -help`` to see which compilation options, packages,
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this
|
||||
@ -110,29 +83,29 @@ Ubuntu package capability.
|
||||
Pre-built Fedora Linux executables
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Pre-built LAMMPS packages for stable releases are available
|
||||
in the Fedora Linux distribution as of version 28. The packages
|
||||
can be installed via the dnf package manager. There are 3 basic
|
||||
varieties (lammps = no MPI, lammps-mpich = MPICH MPI library,
|
||||
lammps-openmpi = OpenMPI MPI library) and for each support for
|
||||
linking to the C library interface (lammps-devel, lammps-mpich-devel,
|
||||
lammps-openmpi-devel), the header for compiling programs using
|
||||
the C library interface (lammps-headers), and the LAMMPS python
|
||||
module for Python 3. All packages can be installed at the same
|
||||
time and the name of the LAMMPS executable is ``lmp`` and ``lmp_openmpi``
|
||||
or ``lmp_mpich`` respectively. By default, ``lmp`` will refer to the
|
||||
serial executable, unless one of the MPI environment modules is loaded
|
||||
(``module load mpi/mpich-x86_64`` or ``module load mpi/openmpi-x86_64``).
|
||||
Then the corresponding parallel LAMMPS executable can be used.
|
||||
The same mechanism applies when loading the LAMMPS python module.
|
||||
Pre-built LAMMPS packages for stable releases are available in the
|
||||
Fedora Linux distribution as of Fedora version 28. The packages can be
|
||||
installed via the dnf package manager. There are 3 basic varieties
|
||||
(lammps = no MPI, lammps-mpich = MPICH MPI library, lammps-openmpi =
|
||||
OpenMPI MPI library) and for each support for linking to the C library
|
||||
interface (lammps-devel, lammps-mpich-devel, lammps-openmpi-devel), the
|
||||
header for compiling programs using the C library interface
|
||||
(lammps-headers), and the LAMMPS python module for Python 3. All
|
||||
packages can be installed at the same time and the name of the LAMMPS
|
||||
executable is ``lmp`` and ``lmp_openmpi`` or ``lmp_mpich`` respectively.
|
||||
By default, ``lmp`` will refer to the serial executable, unless one of
|
||||
the MPI environment modules is loaded (``module load mpi/mpich-x86_64``
|
||||
or ``module load mpi/openmpi-x86_64``). Then the corresponding parallel
|
||||
LAMMPS executable can be used. The same mechanism applies when loading
|
||||
the LAMMPS python module.
|
||||
|
||||
To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ dnf install lammps-openmpi
|
||||
$ module load mpi/openmpi-x86_64
|
||||
$ mpirun -np 2 lmp -in in.lj
|
||||
dnf install lammps-openmpi
|
||||
module load mpi/openmpi-x86_64
|
||||
mpirun -np 2 lmp -in in.lj
|
||||
|
||||
The ``dnf install`` command is needed only once. In case of a new LAMMPS
|
||||
stable release, ``dnf update`` will automatically update to the newer
|
||||
@ -148,7 +121,7 @@ can install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ dnf install openkim-models
|
||||
dnf install openkim-models
|
||||
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
@ -189,14 +162,14 @@ in OpenSuse as of Leap 15.0. You can install the package with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ zypper install lammps
|
||||
zypper install lammps
|
||||
|
||||
This includes support for OpenMPI. The name of the LAMMPS executable
|
||||
is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 2 lmp -in in.lj
|
||||
mpirun -np 2 lmp -in in.lj
|
||||
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
@ -208,7 +181,7 @@ can install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ zypper install openkim-models
|
||||
zypper install openkim-models
|
||||
|
||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse.
|
||||
|
||||
@ -224,7 +197,7 @@ typing:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% emerge --ask lammps
|
||||
emerge --ask lammps
|
||||
|
||||
Note that in Gentoo the LAMMPS source is downloaded and the package is
|
||||
built on the your machine.
|
||||
@ -233,7 +206,7 @@ Certain LAMMPS packages can be enable via USE flags, type
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% equery uses lammps
|
||||
equery uses lammps
|
||||
|
||||
for details.
|
||||
|
||||
@ -256,10 +229,10 @@ any of the above names in-place of lammps.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone https://aur.archlinux.org/lammps.git
|
||||
$ cd lammps
|
||||
$ makepkg -s
|
||||
$ makepkg -i
|
||||
git clone https://aur.archlinux.org/lammps.git
|
||||
cd lammps
|
||||
makepkg -s
|
||||
makepkg -i
|
||||
|
||||
To update, you may repeat the above, or change into the cloned directory,
|
||||
and execute the following, after which, if there are any changes, you may
|
||||
@ -267,9 +240,16 @@ use makepkg as above.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git pull
|
||||
git pull
|
||||
|
||||
Alternatively, you may use an AUR helper to install these packages.
|
||||
|
||||
Note that the AUR provides build-scripts that download the source and
|
||||
the build the package on your machine.
|
||||
|
||||
.. note::
|
||||
|
||||
It looks like the Arch Linux AUR repository build scripts for LAMMPS
|
||||
have not been updated since the 29 October 2020 version. You may want
|
||||
to consider installing a more current version of LAMMPS from source
|
||||
directly.
|
||||
|
||||
@ -12,7 +12,7 @@ the following commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% brew install lammps
|
||||
brew install lammps
|
||||
|
||||
This will install the executables "lammps_serial" and "lammps_mpi", as well as
|
||||
the LAMMPS "doc", "potentials", "tools", "bench", and "examples" directories.
|
||||
@ -22,7 +22,7 @@ Lennard-Jones benchmark file:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% brew test lammps -v
|
||||
brew test lammps -v
|
||||
|
||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||
results in Homebrew also installing the `kim-api` binaries when LAMMPS is
|
||||
@ -31,7 +31,7 @@ install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
% brew install openkim-models
|
||||
brew install openkim-models
|
||||
|
||||
If you have problems with the installation you can post issues to
|
||||
`this link <https://github.com/Homebrew/homebrew-core/issues>`_.
|
||||
|
||||
@ -26,7 +26,7 @@ command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ tar -xzvf lammps*.tar.gz
|
||||
tar -xzvf lammps*.tar.gz
|
||||
|
||||
This will create a LAMMPS directory with the version date
|
||||
in its name, e.g. lammps-23Jun18.
|
||||
@ -40,7 +40,7 @@ with the following command, to create a lammps-<version> dir:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ unzip lammps*.zip
|
||||
unzip lammps*.zip
|
||||
|
||||
This version corresponds to the selected LAMMPS patch or stable
|
||||
release.
|
||||
|
||||
@ -6,7 +6,7 @@ Windows system can be downloaded from this site:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
`http://packages.lammps.org/windows.html <http://packages.lammps.org/windows.html>`_
|
||||
`https://packages.lammps.org/windows.html <https://packages.lammps.org/windows.html>`_
|
||||
|
||||
Note that each installer package has a date in its name, which
|
||||
corresponds to the LAMMPS version of the same date. Installers for
|
||||
|
||||
@ -4,13 +4,13 @@ Authors of LAMMPS
|
||||
The primary LAMMPS developers are at Sandia National Labs and Temple
|
||||
University:
|
||||
|
||||
* `Steve Plimpton <sjp_>`_, sjplimp at sandia.gov
|
||||
* `Steve Plimpton <sjp_>`_, sjplimp at gmail.com
|
||||
* Aidan Thompson, athomps at sandia.gov
|
||||
* Stan Moore, stamoor at sandia.gov
|
||||
* Axel Kohlmeyer, akohlmey at gmail.com
|
||||
* Richard Berger, richard.berger at outlook.com
|
||||
|
||||
.. _sjp: http://www.cs.sandia.gov/~sjplimp
|
||||
.. _sjp: https://sjplimp.github.io
|
||||
.. _lws: https://www.lammps.org
|
||||
|
||||
Past developers include Paul Crozier and Mark Stevens, both at Sandia,
|
||||
|
||||
@ -27,7 +27,7 @@ namely https://www.lammps.org.
|
||||
The original publication describing the parallel algorithms used in the
|
||||
initial versions of LAMMPS is:
|
||||
|
||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
|
||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <https://doi.org/10.1006/jcph.1995.1039>`_
|
||||
|
||||
|
||||
DOI for the LAMMPS source code
|
||||
|
||||
@ -95,7 +95,7 @@ commands)
|
||||
* metal-organic framework potentials (QuickFF, MO-FF)
|
||||
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
|
||||
* access to the `OpenKIM Repository <https://openkim.org>`_ of potentials via the :doc:`kim command <kim_commands>`
|
||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||
* overlaid potentials: superposition of multiple pair potentials (including many-body) with optional scale factor
|
||||
|
||||
@ -205,7 +205,7 @@ Pre- and post-processing
|
||||
|
||||
.. _pizza: https://lammps.github.io/pizza
|
||||
|
||||
.. _python: http://www.python.org
|
||||
.. _python: https://www.python.org
|
||||
|
||||
.. _special:
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ Here are suggestions on how to perform these tasks:
|
||||
linear bead-spring polymer chains. The moltemplate program is a true
|
||||
molecular builder that will generate complex molecular models. See
|
||||
the :doc:`Tools <Tools>` page for details on tools packaged with
|
||||
LAMMPS. The `Pre/post processing page <http:/www.lammps.org/prepost.html>`_ of the LAMMPS website
|
||||
LAMMPS. The `Pre/post processing page <https:/www.lammps.org/prepost.html>`_ of the LAMMPS website
|
||||
describes a variety of third party tools for this task. Furthermore,
|
||||
some LAMMPS internal commands allow to reconstruct, or selectively add
|
||||
topology information, as well as provide the option to insert molecule
|
||||
@ -80,5 +80,5 @@ Here are suggestions on how to perform these tasks:
|
||||
`Pizza.py <https://lammps.github.io/pizza>`_ which can do certain kinds of
|
||||
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
|
||||
simulations. It thus provides some functionality for several of the
|
||||
above bullets. Pizza.py is written in `Python <http://www.python.org>`_
|
||||
and is available for download from `this page <http://www.cs.sandia.gov/~sjplimp/download.html>`_.
|
||||
above bullets. Pizza.py is written in `Python <https://www.python.org>`_
|
||||
and is available for download from `this page <https://sjplimp.github.io/download.html>`_.
|
||||
|
||||
@ -23,9 +23,9 @@ applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
||||
|
||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
.. _gnuorg: http://www.gnu.org
|
||||
.. _gnuorg: https://www.gnu.org
|
||||
|
||||
.. _opensource: http://www.opensource.org
|
||||
.. _opensource: https://www.opensource.org
|
||||
|
||||
Here is a more specific summary of what the GPL means for LAMMPS users:
|
||||
|
||||
|
||||
BIN
doc/src/JPG/dump.peri.2000.png
Normal file
BIN
doc/src/JPG/dump.peri.2000.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 200 KiB |
BIN
doc/src/JPG/dump.peri.300.png
Normal file
BIN
doc/src/JPG/dump.peri.300.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
BIN
doc/src/JPG/dump.peri.600.png
Normal file
BIN
doc/src/JPG/dump.peri.600.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
BIN
doc/src/JPG/ovito-peri-snap.png
Normal file
BIN
doc/src/JPG/ovito-peri-snap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 494 KiB |
BIN
doc/src/JPG/pdlammps_fig1.png
Normal file
BIN
doc/src/JPG/pdlammps_fig1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
BIN
doc/src/JPG/pdlammps_fig2.png
Normal file
BIN
doc/src/JPG/pdlammps_fig2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
@ -2,12 +2,13 @@ LAMMPS Library Interfaces
|
||||
*************************
|
||||
|
||||
As described on the :doc:`library interface to LAMMPS <Howto_library>`
|
||||
page, LAMMPS can be built as a library (static or shared), so that
|
||||
it can be called by another code, used in a :doc:`coupled manner
|
||||
page, LAMMPS can be built as a library (static or shared), so that it
|
||||
can be called by another code, used in a :doc:`coupled manner
|
||||
<Howto_couple>` with other codes, or driven through a :doc:`Python
|
||||
script <Python_head>`. Even the LAMMPS standalone executable is
|
||||
essentially a thin wrapper on top of the LAMMPS library, creating a
|
||||
LAMMPS instance, processing input and then existing.
|
||||
script <Python_head>`. The LAMMPS standalone executable itself is
|
||||
essentially a thin wrapper on top of the LAMMPS library, which creates a
|
||||
LAMMPS instance, passes the input for processing to that instance, and
|
||||
then exits.
|
||||
|
||||
Most of the APIs described below are based on C language wrapper
|
||||
functions in the files ``src/library.h`` and ``src/library.cpp``, but
|
||||
@ -87,6 +88,18 @@ run LAMMPS in serial mode.
|
||||
message retrieved <lammps_get_last_error_message>`. We thus
|
||||
recommend enabling C++ exceptions when using the library interface,
|
||||
|
||||
.. admonition:: Using the C library interface as a plugin
|
||||
:class: note
|
||||
|
||||
Rather than including the C library directly and link to the LAMMPS
|
||||
library at compile time, you can use the ``liblammpsplugin.h`` header
|
||||
file and the ``liblammpsplugin.c`` C code in the
|
||||
``examples/COUPLE/plugin`` folder for an interface to LAMMPS that is
|
||||
largely identical to the regular library interface, only that it will
|
||||
load a LAMMPS shared library file at runtime. This can be useful for
|
||||
applications where the interface to LAMMPS would be an optional
|
||||
feature.
|
||||
|
||||
.. warning::
|
||||
|
||||
No checks are made on the arguments of the function calls of the C
|
||||
@ -163,5 +176,3 @@ The following links provide some examples and references to the C++ API.
|
||||
:maxdepth: 1
|
||||
|
||||
Cplusplus
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ crashes within LAMMPS may be recovered from by enabling
|
||||
:ref:`exceptions <exceptions>`, avoiding them proactively is a safer
|
||||
approach.
|
||||
|
||||
.. code-block:: C
|
||||
.. code-block:: c
|
||||
:caption: Example for using configuration settings functions
|
||||
|
||||
#include "library.h"
|
||||
|
||||
@ -21,7 +21,7 @@ as the "handle" argument in subsequent function calls until that
|
||||
instance is destroyed by calling :cpp:func:`lammps_close`. Here is a
|
||||
simple example demonstrating its use:
|
||||
|
||||
.. code-block:: C
|
||||
.. code-block:: c
|
||||
|
||||
#include "library.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@ -30,7 +30,7 @@ be included in the file or strings, and expansion of variables with
|
||||
``${name}`` or ``$(expression)`` syntax is performed.
|
||||
Below is a short example using some of these functions.
|
||||
|
||||
.. code-block:: C
|
||||
.. code-block:: c
|
||||
|
||||
/* define to make the otherwise hidden prototype for "lammps_open()" visible */
|
||||
#define LAMMPS_LIB_MPI
|
||||
|
||||
@ -15,24 +15,24 @@ This section documents the following functions:
|
||||
|
||||
--------------------
|
||||
|
||||
The library interface allows extraction of different kinds of
|
||||
information about the active simulation instance and also
|
||||
modifications to it. This enables combining of a LAMMPS simulation
|
||||
with other processing and simulation methods computed by the calling
|
||||
code, or by another code that is coupled to LAMMPS via the library
|
||||
interface. In some cases the data returned is direct reference to the
|
||||
original data inside LAMMPS, cast to a void pointer. In that case the
|
||||
data needs to be cast to a suitable pointer for the calling program to
|
||||
access it, and you may need to know the correct dimensions and
|
||||
lengths. This also means you can directly change those value(s) from
|
||||
the calling program, e.g. to modify atom positions. Of course, this
|
||||
should be done with care. When accessing per-atom data, please note
|
||||
that this data is the per-processor **local** data and is indexed
|
||||
accordingly. Per-atom data can change sizes and ordering at every
|
||||
neighbor list rebuild or atom sort event as atoms migrate between
|
||||
The library interface allows the extraction of different kinds of
|
||||
information about the active simulation instance and also - in some
|
||||
cases - to apply modifications to it. This enables combining of a
|
||||
LAMMPS simulation with other processing and simulation methods computed
|
||||
by the calling code, or by another code that is coupled to LAMMPS via
|
||||
the library interface. In some cases the data returned is direct
|
||||
reference to the original data inside LAMMPS, cast to a void pointer.
|
||||
In that case the data needs to be cast to a suitable pointer for the
|
||||
calling program to access it, and you may need to know the correct
|
||||
dimensions and lengths. This also means you can directly change those
|
||||
value(s) from the calling program (e.g., to modify atom positions). Of
|
||||
course, changing values should be done with care. When accessing per-atom
|
||||
data, please note that these data are the per-processor **local** data and are
|
||||
indexed accordingly. Per-atom data can change sizes and ordering at
|
||||
every neighbor list rebuild or atom sort event as atoms migrate between
|
||||
sub-domains and processors.
|
||||
|
||||
.. code-block:: C
|
||||
.. code-block:: c
|
||||
|
||||
#include "library.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@ -42,7 +42,7 @@ descriptions of all commands included in the LAMMPS code.
|
||||
.. only:: html
|
||||
|
||||
Once you are familiar with LAMMPS, you may want to bookmark
|
||||
:doc:`this page <Commands_all>` since it gives quick access
|
||||
:doc:`this page <Commands_all>` since it gives quick access to
|
||||
the documentation for all LAMMPS commands.
|
||||
|
||||
.. _lws: https://www.lammps.org
|
||||
|
||||
@ -13,24 +13,65 @@ Here is a brief description of common methods you define in your
|
||||
new derived class. See bond.h, angle.h, dihedral.h, and improper.h
|
||||
for details and specific additional methods.
|
||||
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| init | check if all coefficients are set, calls *init_style* (optional) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| init_style | check if style specific conditions are met (optional) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| compute | compute the molecular interactions (required) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| settings | apply global settings for all types (optional) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one type (required) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| equilibrium_distance | length of bond, used by SHAKE (required, bond only) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| equilibrium_angle | opening of angle, used by SHAKE (required, angle only) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| write & read_restart | writes/reads coeffs to restart files (required) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| single | force (bond only) and energy of a single bond or angle (required, bond or angle only) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
| memory_usage | tally memory allocated by the style (optional) |
|
||||
+-----------------------+---------------------------------------------------------------------------------------+
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| Required | "pure" methods that *must* be overridden in a derived class |
|
||||
+=======================+=====================================================================+
|
||||
| compute | compute the molecular interactions for all listed items |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one type |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| equilibrium_distance | length of bond, used by SHAKE (bond styles only) |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| equilibrium_angle | opening of angle, used by SHAKE (angle styles only) |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| write & read_restart | writes/reads coeffs to restart files |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
| single | force/r (bond styles only) and energy of a single bond or angle |
|
||||
+-----------------------+---------------------------------------------------------------------+
|
||||
|
||||
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| Optional | methods that have a default or dummy implementation |
|
||||
+================================+======================================================================+
|
||||
| init | check if all coefficients are set, calls init_style() |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| init_style | check if style specific conditions are met |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| settings | apply global settings for all types |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| write & read_restart_settings | writes/reads global style settings to restart files |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| write_data | write corresponding Coeffs section(s) in data file |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| memory_usage | tally memory allocated by the style |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| extract | provide access to internal data (bond or angle styles only) |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| reinit | reset all type-based parameters, called by fix adapt (bonds only) |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| pack & unpack_forward_comm | copy data to and from buffer in forward communication (bonds only) |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
| pack & unpack_reverse_comm | copy data to and from buffer in reverse communication (bonds only) |
|
||||
+--------------------------------+----------------------------------------------------------------------+
|
||||
|
||||
Here is a list of flags or settings that should be set in the
|
||||
constructor of the derived class when they differ from the default
|
||||
setting.
|
||||
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| Name of flag | Description | default |
|
||||
+=================================+==============================================================================+=========+
|
||||
| writedata | 1 if write_data() is implemented | 1 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| single_extra | number of extra single values calculated (bond styles only) | 0 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| partial_flag | 1 if bond type can be set to 0 and deleted (bond styles only) | 0 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| reinitflag | 1 if style has reinit() and is compatible with fix adapt | 1 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| comm_forward | size of buffer (in doubles) for forward communication (bond styles only) | 0 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| comm_reverse | size of buffer (in doubles) for reverse communication (bond styles only) | 0 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
| comm_reverse_off | size of buffer for reverse communication with newton off (bond styles only) | 0 |
|
||||
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||
|
||||
@ -1,35 +1,121 @@
|
||||
Pair styles
|
||||
===========
|
||||
|
||||
Classes that compute pairwise interactions are derived from the Pair
|
||||
class. In LAMMPS, pairwise calculation include many-body potentials
|
||||
such as EAM or Tersoff where particles interact without a static bond
|
||||
topology. New styles can be created to add new pair potentials to
|
||||
LAMMPS.
|
||||
Classes that compute pairwise non-bonded interactions are derived from
|
||||
the Pair class. In LAMMPS, pairwise calculation include many-body
|
||||
potentials such as EAM, Tersoff, or ReaxFF where particles interact
|
||||
without an explicit bond topology but include interactions beyond
|
||||
pairwise non-bonded contributions. New styles can be created to add
|
||||
support for additional pair potentials to LAMMPS. When the
|
||||
modifications are small, sometimes it is more effective to derive from
|
||||
an existing pair style class. This latter approach is also used by
|
||||
:doc:`Accelerator packages <Speed_packages>` where the accelerated style
|
||||
names differ from their base classes by an appended suffix.
|
||||
|
||||
Pair_lj_cut.cpp is a simple example of a Pair class, though it
|
||||
includes some optional methods to enable its use with rRESPA.
|
||||
The file ``src/pair_lj_cut.cpp`` is an example of a Pair class with a
|
||||
very simple potential function. It includes several optional methods to
|
||||
enable its use with :doc:`run_style respa <run_style>` and :doc:`compute
|
||||
group/group <compute_group_group>`.
|
||||
|
||||
Here is a brief description of the class methods in pair.h:
|
||||
Here is a brief list of some the class methods in the Pair class that
|
||||
*must* be or *may* be overridden in a derived class.
|
||||
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| Required | "pure" methods that *must* be overridden in a derived class |
|
||||
+=================================+=====================================================================+
|
||||
| compute | workhorse routine that computes pairwise interactions |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| settings | reads the input script line with arguments you define |
|
||||
| settings | processes the arguments to the pair_style command |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one i,j type pair |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| init_one | perform initialization for one i,j type pair |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| init_style | initialization specific to this pair style |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| write & read_restart | write/read i,j pair coeffs to restart files |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| write & read_restart_settings | write/read global settings to restart files |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| single | force/r and energy of a single pairwise interaction between 2 atoms |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
||||
| coeff | set coefficients for one i,j type pair, called from pair_coeff |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
|
||||
The inner/middle/outer routines are optional.
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| Optional | methods that have a default or dummy implementation |
|
||||
+=================================+======================================================================+
|
||||
| init_one | perform initialization for one i,j type pair |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| init_style | style initialization: request neighbor list(s), error checks |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| init_list | Neighbor class callback function to pass neighbor list to pair style |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| single | force/r and energy of a single pairwise interaction between 2 atoms |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| memory_usage | return estimated amount of memory used by the pair style |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| modify_params | process arguments to pair_modify command |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| extract | provide access to internal scalar or per-type data like cutoffs |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| extract_peratom | provide access to internal per-atom data |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| setup | initialization at the beginning of a run |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| finish | called at the end of a run, e.g. to print |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| write & read_restart | write/read i,j pair coeffs to restart files |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| write & read_restart_settings | write/read global settings to restart files |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| write_data | write Pair Coeffs section to data file |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| write_data_all | write PairIJ Coeffs section to data file |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| pack & unpack_forward_comm | copy data to and from buffer if style uses forward communication |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| pack & unpack_reverse_comm | copy data to and from buffer if style uses reverse communication |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| reinit | reset all type-based parameters, called by fix adapt for example |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
| reset_dt | called when the time step is changed by timestep or fix reset/dt |
|
||||
+---------------------------------+----------------------------------------------------------------------+
|
||||
|
||||
Here is a list of flags or settings that should be set in the
|
||||
constructor of the derived pair class when they differ from the default
|
||||
setting.
|
||||
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| Name of flag | Description | default |
|
||||
+=================================+=============================================================+=========+
|
||||
| single_enable | 1 if single() method is implemented, 0 if missing | 1 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| respa_enable | 1 if pair style has compute_inner/middle/outer() | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| restartinfo | 1 if pair style writes its settings to a restart | 1 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| one_coeff | 1 if only a pair_coeff * * command is allowed | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| manybody_flag | 1 if pair style is a manybody potential | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| unit_convert_flag | value != 0 indicates support for unit conversion | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| no_virial_fdotr_compute | 1 if pair style does not call virial_fdotr_compute() | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| writedata | 1 if write_data() and write_data_all() are implemented | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| comm_forward | size of buffer (in doubles) for forward communication | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| comm_reverse | size of buffer (in doubles) for reverse communication | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| ghostneigh | 1 if cutghost is set and style uses neighbors of ghosts | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| finitecutflag | 1 if cutoff depends on diameter of atoms | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| reinitflag | 1 if style has reinit() and is compatible with fix adapt | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| ewaldflag | 1 if compatible with kspace_style ewald | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| pppmflag | 1 if compatible with kspace_style pppm | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| msmflag | 1 if compatible with kspace_style msm | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| dispersionflag | 1 if compatible with ewald/disp or pppm/disp | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| tip4pflag | 1 if compatible with kspace_style pppm/tip4p | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| dipoleflag | 1 if compatible with dipole kspace_style | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
| spinflag | 1 if compatible with spin kspace_style | 0 |
|
||||
+---------------------------------+-------------------------------------------------------------+---------+
|
||||
|
||||
@ -100,13 +100,14 @@ Documentation (strict)
|
||||
|
||||
Contributions that add new styles or commands or augment existing ones
|
||||
must include the corresponding new or modified documentation in
|
||||
`ReStructuredText format <rst>`_ (.rst files in the ``doc/src/`` folder). The
|
||||
documentation shall be written in American English and the .rst file
|
||||
must use only ASCII characters so it can be cleanly translated to PDF
|
||||
files (via `sphinx <sphinx>`_ and PDFLaTeX). Special characters may be included via
|
||||
embedded math expression typeset in a LaTeX subset.
|
||||
`ReStructuredText format <rst_>`_ (.rst files in the ``doc/src/``
|
||||
folder). The documentation shall be written in American English and the
|
||||
.rst file must use only ASCII characters so it can be cleanly translated
|
||||
to PDF files (via `sphinx <https://www.sphinx-doc.org>`_ and PDFLaTeX).
|
||||
Special characters may be included via embedded math expression typeset
|
||||
in a LaTeX subset.
|
||||
|
||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
||||
.. _rst: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
|
||||
|
||||
When adding new commands, they need to be integrated into the sphinx
|
||||
documentation system, and the corresponding command tables and lists
|
||||
@ -133,7 +134,7 @@ error free completion of the HTML and PDF build will be performed and
|
||||
also a spell check, a check for correct anchors and labels, and a check
|
||||
for completeness of references all styles in their corresponding tables
|
||||
and lists is run. In case the spell check reports false positives they
|
||||
can be added to the file doc/utils/sphinx-config/false_positives.txt
|
||||
can be added to the file ``doc/utils/sphinx-config/false_positives.txt``
|
||||
|
||||
Contributions that add or modify the library interface or "public" APIs
|
||||
from the C++ code or the Fortran module must include suitable doxygen
|
||||
@ -358,6 +359,12 @@ you are uncertain, please ask.
|
||||
|
||||
- I/O is done via the C-style stdio library and **not** iostreams.
|
||||
|
||||
- Do not use so-called "alternative tokens" like ``and``, ``or``,
|
||||
``not`` and similar, but rather use the corresponding operators
|
||||
``&&``, ``||``, and ``!``. The alternative tokens are not available
|
||||
by default on all compilers, and also we want to maintain a consistent
|
||||
programming style.
|
||||
|
||||
- Output to the screen and the logfile should be using the corresponding
|
||||
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
||||
convenience function where possible.
|
||||
|
||||
@ -133,6 +133,8 @@ commands to write and read data using the ADIOS library.
|
||||
|
||||
**Authors:** Norbert Podhorszki (ORNL) from the ADIOS developer team.
|
||||
|
||||
.. versionadded:: 28Feb2019
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <adios>` on the :doc:`Build extras <Build_extras>` page.
|
||||
@ -181,9 +183,10 @@ ATC package
|
||||
|
||||
**Contents:**
|
||||
|
||||
ATC stands for atoms-to-continuum. This package implements a :doc:`fix atc <fix_atc>` command to either couple molecular dynamics with
|
||||
continuum finite element equations or perform on-the-fly conversion of
|
||||
atomic information to continuum fields.
|
||||
ATC stands for atoms-to-continuum. This package implements a
|
||||
:doc:`fix atc <fix_atc>` command to either couple molecular dynamics
|
||||
with continuum finite element equations or perform on-the-fly
|
||||
conversion of atomic information to continuum fields.
|
||||
|
||||
**Authors:** Reese Jones, Jeremy Templeton, Jon Zimmerman (Sandia).
|
||||
|
||||
@ -242,7 +245,7 @@ the barostat as outlined in:
|
||||
|
||||
N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that
|
||||
accurately describe the structure, pressure, and compressibility of
|
||||
molecular liquids," J. Chem. Phys. 143, 243148 (2015).
|
||||
molecular liquids", J. Chem. Phys. 143, 243148 (2015).
|
||||
|
||||
**Authors:** Nicholas J. H. Dunn and Michael R. DeLyser (The
|
||||
Pennsylvania State University)
|
||||
@ -298,6 +301,8 @@ models for mesoscale simulations of solids and fracture. See the
|
||||
|
||||
**Authors:** Joel T. Clemmer (Sandia National Labs)
|
||||
|
||||
.. versionadded:: 4May2022
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/BPM filenames -> commands
|
||||
@ -328,6 +333,8 @@ and also support self-propelled particles.
|
||||
**Authors:** Sam Cameron (University of Bristol),
|
||||
Stefan Paquay (while at Brandeis University) (initial version of fix propel/self)
|
||||
|
||||
.. versionadded:: 14May2021
|
||||
|
||||
Example inputs are in the examples/PACKAGES/brownian folder.
|
||||
|
||||
----------
|
||||
@ -387,6 +394,7 @@ acids.
|
||||
* :doc:`angle_style sdk <angle_sdk>`
|
||||
* examples/PACKAGES/cgsdk
|
||||
* https://www.lammps.org/pictures.html#cg
|
||||
* https://www.spica-ff.org/
|
||||
|
||||
----------
|
||||
|
||||
@ -448,22 +456,21 @@ COLVARS package
|
||||
|
||||
**Contents:**
|
||||
|
||||
COLVARS stands for collective variables, which can be used to
|
||||
implement various enhanced sampling methods, including Adaptive
|
||||
Biasing Force, Metadynamics, Steered MD, Umbrella Sampling and
|
||||
Restraints. A :doc:`fix colvars <fix_colvars>` command is implemented
|
||||
which wraps a COLVARS library, which implements these methods.
|
||||
simulations.
|
||||
Colvars stands for collective variables, which can be used to implement
|
||||
various enhanced sampling methods, including Adaptive Biasing Force,
|
||||
Metadynamics, Steered MD, Umbrella Sampling and Restraints. A :doc:`fix
|
||||
colvars <fix_colvars>` command is implemented which wraps a COLVARS
|
||||
library, which implements these methods. simulations.
|
||||
|
||||
**Authors:** The COLVARS library is written and maintained by
|
||||
Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA)
|
||||
and Jerome Henin (LISM, CNRS, Marseille, France), originally for
|
||||
the NAMD MD code, but with portability in mind. Axel Kohlmeyer
|
||||
(Temple U) provided the interface to LAMMPS.
|
||||
**Authors:** The COLVARS library is written and maintained by Giacomo
|
||||
Fiorin (NIH, Bethesda, MD, USA) and Jerome Henin (CNRS, Paris, France),
|
||||
originally for the NAMD MD code, but with portability in mind. Axel
|
||||
Kohlmeyer (Temple U) provided the interface to LAMMPS.
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <colvars>` on the :doc:`Build extras <Build_extras>` page.
|
||||
This package has :ref:`specific installation instructions <colvar>` on
|
||||
the :doc:`Build extras <Build_extras>` page.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -472,6 +479,8 @@ This package has :ref:`specific installation instructions <colvars>` on the :doc
|
||||
* src/COLVARS/README
|
||||
* lib/colvars/README
|
||||
* :doc:`fix colvars <fix_colvars>`
|
||||
* :doc:`group2ndx <group2ndx>`
|
||||
* :doc:`ndx2group <group2ndx>`
|
||||
* examples/PACKAGES/colvars
|
||||
|
||||
----------
|
||||
@ -516,9 +525,10 @@ CORESHELL package
|
||||
|
||||
Compute and pair styles that implement the adiabatic core/shell model
|
||||
for polarizability. The pair styles augment Born, Buckingham, and
|
||||
Lennard-Jones styles with core/shell capabilities. The :doc:`compute temp/cs <compute_temp_cs>` command calculates the temperature of a
|
||||
system with core/shell particles. See the :doc:`Howto coreshell <Howto_coreshell>` page for an overview of how to use
|
||||
this package.
|
||||
Lennard-Jones styles with core/shell capabilities. The :doc:`compute
|
||||
temp/cs <compute_temp_cs>` command calculates the temperature of a
|
||||
system with core/shell particles. See the :doc:`Howto coreshell
|
||||
<Howto_coreshell>` page for an overview of how to use this package.
|
||||
|
||||
**Author:** Hendrik Heenen (Technical U of Munich).
|
||||
|
||||
@ -554,6 +564,8 @@ To use this package, also the :ref:`KSPACE <PKG-KSPACE>` and
|
||||
|
||||
**Author:** Trung Nguyen and Monica Olvera de la Cruz (Northwestern U)
|
||||
|
||||
.. versionadded:: 2Jul2021
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/DIELECTRIC: filenames -> commands
|
||||
@ -614,7 +626,7 @@ short-range or long-range interactions.
|
||||
* :doc:`pair_style lj/cut/dipole/cut <pair_dipole>`
|
||||
* :doc:`pair_style lj/cut/dipole/long <pair_dipole>`
|
||||
* :doc:`pair_style lj/long/dipole/long <pair_dipole>`
|
||||
* :doc: `angle_style dipole <angle_dipole>`
|
||||
* :doc:`angle_style dipole <angle_dipole>`
|
||||
* examples/dipole
|
||||
|
||||
----------
|
||||
@ -820,10 +832,12 @@ ELECTRODE package
|
||||
The ELECTRODE package allows the user to enforce a constant potential method for
|
||||
groups of atoms that interact with the remaining atoms as electrolyte.
|
||||
|
||||
**Authors:** The ELECTRODE library is written and maintained by Ludwig
|
||||
**Authors:** The ELECTRODE package is written and maintained by Ludwig
|
||||
Ahrens-Iwers (TUHH, Hamburg, Germany), Shern Tee (UQ, Brisbane, Australia) and
|
||||
Robert Meissner (TUHH, Hamburg, Germany).
|
||||
|
||||
.. versionadded:: 4May2022
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <electrode>` on the
|
||||
@ -832,6 +846,8 @@ This package has :ref:`specific installation instructions <electrode>` on the
|
||||
**Supporting info:**
|
||||
|
||||
* :doc:`fix electrode/conp <fix_electrode_conp>`
|
||||
* :doc:`fix electrode/conq <fix_electrode_conp>`
|
||||
* :doc:`fix electrode/thermo <fix_electrode_conp>`
|
||||
|
||||
----------
|
||||
|
||||
@ -892,6 +908,10 @@ EXTRA-MOLECULE package
|
||||
|
||||
Additional bond, angle, dihedral, and improper styles that are less commonly used.
|
||||
|
||||
**Install:**
|
||||
|
||||
To use this package, also the :ref:`MOLECULE <PKG-MOLECULE>` package needs to be installed.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/EXTRA-MOLECULE: filenames -> commands
|
||||
@ -922,10 +942,11 @@ FEP package
|
||||
|
||||
**Contents:**
|
||||
|
||||
FEP stands for free energy perturbation. This package provides
|
||||
methods for performing FEP simulations by using a :doc:`fix adapt/fep <fix_adapt_fep>` command with soft-core pair potentials,
|
||||
which have a "soft" in their style name. There are auxiliary tools
|
||||
for using this package in tools/fep; see its README file.
|
||||
FEP stands for free energy perturbation. This package provides methods
|
||||
for performing FEP simulations by using a :doc:`fix adapt/fep
|
||||
<fix_adapt_fep>` command with soft-core pair potentials, which have a
|
||||
"soft" in their style name. There are auxiliary tools for using this
|
||||
package in tools/fep; see its README file.
|
||||
|
||||
**Author:** Agilio Padua (ENS de Lyon)
|
||||
|
||||
@ -966,7 +987,8 @@ Kuznetsov, Vladimir Stegailov, and Vsevolod Nikolskiy (HSE University).
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <gpu>` on the :doc:`Build extras <Build_extras>` page.
|
||||
This package has :ref:`specific installation instructions <gpu>` on the
|
||||
:doc:`Build extras <Build_extras>` page.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -1027,7 +1049,7 @@ H5MD is a format for molecular simulations, built on top of HDF5.
|
||||
This package implements a :doc:`dump h5md <dump_h5md>` command to output
|
||||
LAMMPS snapshots in this format.
|
||||
|
||||
.. _HDF5: http://www.hdfgroup.org/HDF5
|
||||
.. _HDF5: https://www.hdfgroup.org/solutions/hdf5
|
||||
|
||||
To use this package you must have the HDF5 library available on your
|
||||
system.
|
||||
@ -1319,7 +1341,8 @@ Cawkwell, Anders Niklasson, and Christian Negre.
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <latte>` on the :doc:`Build extras <Build_extras>` page.
|
||||
This package has :ref:`specific installation instructions <latte>` on
|
||||
the :doc:`Build extras <Build_extras>` page.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -1364,7 +1387,7 @@ This package has :ref:`specific installation instructions <machdyn>` on the :doc
|
||||
|
||||
* src/MACHDYN: filenames -> commands
|
||||
* src/MACHDYN/README
|
||||
* doc/PDF/MACHDYN_LAMMPS_userguide.pdf
|
||||
* `doc/PDF/MACHDYN_LAMMPS_userguide.pdf <PDF/MACHDYN_LAMMPS_userguide.pdf>`_
|
||||
* examples/PACKAGES/machdyn
|
||||
* https://www.lammps.org/movies.html#smd
|
||||
|
||||
@ -1468,6 +1491,8 @@ workflows via the `MolSSI Driver Interface
|
||||
|
||||
**Author:** Taylor Barnes - MolSSI, taylor.a.barnes at gmail.com
|
||||
|
||||
.. versionadded:: 14May2021
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <mdi>` on
|
||||
@ -1543,6 +1568,8 @@ Maxim V. Shugaev (University of Virginia), Alexey N. Volkov (University of Alaba
|
||||
**Author of the *mesocnt* pair style:**
|
||||
Philipp Kloza (U Cambridge)
|
||||
|
||||
.. versionadded:: 15Jun2020
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/MESONT: filenames -> commands
|
||||
@ -1633,6 +1660,8 @@ compiled on your system.
|
||||
|
||||
**Author:** Andreas Singraber
|
||||
|
||||
.. versionadded:: 27May2021
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <ml-hdnnp>` on the
|
||||
@ -1667,6 +1696,8 @@ must be installed.
|
||||
|
||||
**Author:** Aidan Thompson (Sandia), Nicholas Lubbers (LANL).
|
||||
|
||||
.. versionadded:: 30Jun2020
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/ML-IAP: filenames -> commands
|
||||
@ -1711,6 +1742,8 @@ Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1.
|
||||
|
||||
^4: University of British Columbia, Vancouver, BC, Canada
|
||||
|
||||
.. versionadded:: 14May2021
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <ml-pace>` on the
|
||||
@ -1774,6 +1807,8 @@ of a neural network.
|
||||
This package was written by Christopher Barrett
|
||||
with contributions by Doyl Dickel, Mississippi State University.
|
||||
|
||||
.. versionadded:: 27May2021
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/ML-RANN: filenames -> commands
|
||||
@ -1897,7 +1932,7 @@ support for new file formats can be added to LAMMPS (or VMD or other
|
||||
programs that use them) without having to re-compile the application
|
||||
itself. More information about the VMD molfile plugins can be found
|
||||
at
|
||||
`http://www.ks.uiuc.edu/Research/vmd/plugins/molfile <http://www.ks.uiuc.edu/Research/vmd/plugins/molfile>`_.
|
||||
`https://www.ks.uiuc.edu/Research/vmd/plugins/molfile <https://www.ks.uiuc.edu/Research/vmd/plugins/molfile>`_.
|
||||
|
||||
**Author:** Axel Kohlmeyer (Temple U).
|
||||
|
||||
@ -1988,7 +2023,7 @@ NETCDF package
|
||||
Dump styles for writing NetCDF formatted dump files. NetCDF is a
|
||||
portable, binary, self-describing file format developed on top of
|
||||
HDF5. The file contents follow the AMBER NetCDF trajectory conventions
|
||||
(http://ambermd.org/netcdf/nctraj.xhtml), but include extensions.
|
||||
(https://ambermd.org/netcdf/nctraj.xhtml), but include extensions.
|
||||
|
||||
To use this package you must have the NetCDF library available on your
|
||||
system.
|
||||
@ -1999,7 +2034,7 @@ tools:
|
||||
* `Ovito <ovito_>`_ (Ovito supports the AMBER convention and the extensions mentioned above)
|
||||
* `VMD <vmd-home_>`_
|
||||
|
||||
.. _ovito: http://www.ovito.org
|
||||
.. _ovito: https://www.ovito.org
|
||||
|
||||
.. _vmd-home: https://www.ks.uiuc.edu/Research/vmd/
|
||||
|
||||
@ -2143,6 +2178,7 @@ Foster (UTSA).
|
||||
**Supporting info:**
|
||||
|
||||
* src/PERI: filenames -> commands
|
||||
* :doc:`Peridynamics Howto <Howto_peri>`
|
||||
* `doc/PDF/PDLammps_overview.pdf <PDF/PDLammps_overview.pdf>`_
|
||||
* `doc/PDF/PDLammps_EPS.pdf <PDF/PDLammps_EPS.pdf>`_
|
||||
* `doc/PDF/PDLammps_VES.pdf <PDF/PDLammps_VES.pdf>`_
|
||||
@ -2207,6 +2243,8 @@ try to load the contained plugins automatically at start-up.
|
||||
|
||||
**Authors:** Axel Kohlmeyer (Temple U)
|
||||
|
||||
.. versionadded:: 8Apr2021
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/PLUGIN: filenames -> commands
|
||||
@ -2360,7 +2398,7 @@ A :doc:`fix qmmm <fix_qmmm>` command which allows LAMMPS to be used as
|
||||
the MM code in a QM/MM simulation. This is currently only available
|
||||
in combination with the `Quantum ESPRESSO <espresso_>`_ package.
|
||||
|
||||
.. _espresso: http://www.quantum-espresso.org
|
||||
.. _espresso: https://www.quantum-espresso.org
|
||||
|
||||
To use this package you must have Quantum ESPRESSO (QE) available on
|
||||
your system and include its coupling library in the compilation and
|
||||
@ -2429,17 +2467,18 @@ REACTION package
|
||||
|
||||
**Contents:**
|
||||
|
||||
This package allows for complex bond topology changes (reactions)
|
||||
during a running MD simulation, when using classical force fields.
|
||||
Topology changes are defined in pre- and post-reaction molecule
|
||||
templates and can include creation and deletion of bonds, angles,
|
||||
dihedrals, impropers, atom types, bond types, angle types, dihedral
|
||||
types, improper types, and/or atomic charges. Other options currently
|
||||
available include reaction constraints (e.g. angle and Arrhenius
|
||||
constraints), deletion of reaction byproducts or other small
|
||||
molecules, and chiral-sensitive reactions.
|
||||
This package implements the REACTER protocol, which allows for complex
|
||||
bond topology changes (reactions) during a running MD simulation when
|
||||
using classical force fields. Topology changes are defined in pre- and
|
||||
post-reaction molecule templates and can include creation and deletion
|
||||
of bonds, angles, dihedrals, impropers, atom types, bond types, angle
|
||||
types, dihedral types, improper types, and/or atomic charges. Other
|
||||
options currently available include reaction constraints (e.g., angle
|
||||
and Arrhenius constraints), deletion of reaction byproducts or other
|
||||
small molecules, creation of new atoms or molecules bonded to existing
|
||||
atoms, and using LAMMPS variables for input parameters.
|
||||
|
||||
**Author:** Jacob R. Gissinger (CU Boulder) while at NASA Langley Research Center.
|
||||
**Author:** Jacob R. Gissinger (NASA Langley Research Center).
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -2449,7 +2488,8 @@ molecules, and chiral-sensitive reactions.
|
||||
* examples/PACKAGES/reaction
|
||||
* `2017 LAMMPS Workshop <https://www.lammps.org/workshops/Aug17/pdf/gissinger.pdf>`_
|
||||
* `2019 LAMMPS Workshop <https://www.lammps.org/workshops/Aug19/talk_gissinger.pdf>`_
|
||||
* reacter.org
|
||||
* `2021 LAMMPS Workshop <https://www.lammps.org/workshops/Aug21/talk/jacob-gissinger/>`_
|
||||
* `REACTER website (reacter.org) <https://www.reacter.org/>`_
|
||||
|
||||
----------
|
||||
|
||||
@ -2650,7 +2690,7 @@ Dynamics, Ernst Mach Institute, Germany).
|
||||
|
||||
* src/SPH: filenames -> commands
|
||||
* src/SPH/README
|
||||
* doc/PDF/SPH_LAMMPS_userguide.pdf
|
||||
* `doc/PDF/SPH_LAMMPS_userguide.pdf <PDF/SPH_LAMMPS_userguide.pdf>`_
|
||||
* examples/PACKAGES/sph
|
||||
* https://www.lammps.org/movies.html#sph
|
||||
|
||||
@ -2772,7 +2812,7 @@ collection of atoms by wrapping the `Voro++ library <voro-home_>`_. This
|
||||
can be used to calculate the local volume or each atoms or its near
|
||||
neighbors.
|
||||
|
||||
.. _voro-home: http://math.lbl.gov/voro++
|
||||
.. _voro-home: https://math.lbl.gov/voro++
|
||||
|
||||
To use this package you must have the Voro++ library available on your
|
||||
system.
|
||||
@ -2806,9 +2846,9 @@ A :doc:`dump vtk <dump_vtk>` command which outputs snapshot info in the
|
||||
`VTK format <vtk_>`_, enabling visualization by `Paraview <paraview_>`_ or
|
||||
other visualization packages.
|
||||
|
||||
.. _vtk: http://www.vtk.org
|
||||
.. _vtk: https://www.vtk.org
|
||||
|
||||
.. _paraview: http://www.paraview.org
|
||||
.. _paraview: https://www.paraview.org
|
||||
|
||||
To use this package you must have VTK library available on your
|
||||
system.
|
||||
@ -2845,11 +2885,13 @@ which discuss the `QuickFF <quickff_>`_ methodology.
|
||||
|
||||
.. _vanduyfhuys2015: https://doi.org/10.1002/jcc.23877
|
||||
.. _vanduyfhuys2018: https://doi.org/10.1002/jcc.25173
|
||||
.. _quickff: http://molmod.github.io/QuickFF
|
||||
.. _quickff: https://molmod.github.io/QuickFF
|
||||
.. _yaff: https://github.com/molmod/yaff
|
||||
|
||||
**Author:** Steven Vandenbrande.
|
||||
|
||||
.. versionadded:: 1Feb2019
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/YAFF/README
|
||||
|
||||
@ -8,10 +8,10 @@ Packages are supported by either the LAMMPS developers or the
|
||||
contributing authors and written in a syntax and style consistent with
|
||||
the rest of LAMMPS.
|
||||
|
||||
The "Example" column is a sub-directory in the examples directory of the
|
||||
distribution which has an input script that uses the package.
|
||||
The "Examples" column is a sub-directory in the examples directory of the
|
||||
distribution which has one or more input scripts that use the package.
|
||||
E.g. "peptide" refers to the examples/peptide directory; PACKAGES/atc refers
|
||||
to the examples/PACKAGES/atc directory. The "Library" column indicates
|
||||
to the examples/PACKAGES/atc directory. The "Lib" column indicates
|
||||
whether an extra library is needed to build and use the package:
|
||||
|
||||
* no = no library
|
||||
@ -26,8 +26,8 @@ whether an extra library is needed to build and use the package:
|
||||
* - Package
|
||||
- Description
|
||||
- Doc page
|
||||
- Example
|
||||
- Library
|
||||
- Examples
|
||||
- Lib
|
||||
* - :ref:`ADIOS <PKG-ADIOS>`
|
||||
- dump output via ADIOS
|
||||
- :doc:`dump adios <dump_adios>`
|
||||
@ -89,7 +89,7 @@ whether an extra library is needed to build and use the package:
|
||||
- colloid
|
||||
- no
|
||||
* - :ref:`COLVARS <PKG-COLVARS>`
|
||||
- collective variables library
|
||||
- `Colvars collective variables library <https://colvars.github.io/>`_
|
||||
- :doc:`fix colvars <fix_colvars>`
|
||||
- PACKAGES/colvars
|
||||
- int
|
||||
@ -120,7 +120,7 @@ whether an extra library is needed to build and use the package:
|
||||
- no
|
||||
* - :ref:`DPD-BASIC <PKG-DPD-BASIC>`
|
||||
- basic DPD models
|
||||
- :doc:`pair_styles dpd dpd/tstat <pair_dpd>` :doc:`dpd/ext dpd/ext/tstat <pair_dpd_ext>`
|
||||
- :doc:`pair_styles dpd <pair_dpd>` :doc:`dpd/ext <pair_dpd_ext>`
|
||||
- PACKAGES/dpd-basic
|
||||
- no
|
||||
* - :ref:`DPD-MESO <PKG-DPD-MESO>`
|
||||
@ -369,7 +369,7 @@ whether an extra library is needed to build and use the package:
|
||||
- plugins
|
||||
- no
|
||||
* - :ref:`PLUMED <PKG-PLUMED>`
|
||||
- :ref:`PLUMED <PLUMED>` free energy library
|
||||
- `PLUMED free energy library <https://www.plumed.org>`_
|
||||
- :doc:`fix plumed <fix_plumed>`
|
||||
- PACKAGES/plumed
|
||||
- ext
|
||||
@ -435,7 +435,7 @@ whether an extra library is needed to build and use the package:
|
||||
- no
|
||||
* - :ref:`SMTBQ <PKG-SMTBQ>`
|
||||
- second moment tight binding potentials
|
||||
- :doc:`pair_style smtbq <pair_smtbq>` :doc:`pair_style smatb <pair_smatb>`
|
||||
- pair styles :doc:`smtbq <pair_smtbq>`, :doc:`smatb <pair_smatb>`
|
||||
- PACKAGES/smtbq
|
||||
- no
|
||||
* - :ref:`SPH <PKG-SPH>`
|
||||
|
||||
@ -58,7 +58,7 @@ against invalid accesses.
|
||||
Each element of this list is a :py:class:`Atom <lammps.Atom>` or :py:class:`Atom2D <lammps.Atom2D>` object. The attributes of
|
||||
these objects provide access to their data (id, type, position, velocity, force, etc.):
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
# access first atom
|
||||
L.atoms[0].id
|
||||
@ -71,7 +71,7 @@ against invalid accesses.
|
||||
|
||||
Some attributes can be changed:
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
# set position in 2D simulation
|
||||
L.atoms[0].position = (1.0, 0.0)
|
||||
|
||||
@ -18,17 +18,17 @@ together.
|
||||
Python_error
|
||||
Python_trouble
|
||||
|
||||
If you are not familiar with `Python <http://www.python.org>`_, it is a
|
||||
If you are not familiar with `Python <https://www.python.org>`_, it is a
|
||||
powerful scripting and programming language which can do almost
|
||||
everything that compiled languages like C, C++, or Fortran can do in
|
||||
fewer lines of code. It also comes with a large collection of add-on
|
||||
modules for many purposes (either bundled or easily installed from
|
||||
Python code repositories). The major drawback is slower execution speed
|
||||
of the script code compared to compiled programming languages. But when
|
||||
the script code is interfaced to optimized compiled code, performance can
|
||||
be on par with a standalone executable, for as long as the scripting is
|
||||
restricted to high-level operations. Thus Python is also convenient to
|
||||
use as a "glue" language to "drive" a program through its library
|
||||
the script code is interfaced to optimized compiled code, performance
|
||||
can be on par with a standalone executable, for as long as the scripting
|
||||
is restricted to high-level operations. Thus Python is also convenient
|
||||
to use as a "glue" language to "drive" a program through its library
|
||||
interface, or to hook multiple pieces of software together, such as a
|
||||
simulation code and a visualization tool, or to run a coupled
|
||||
multi-scale or multi-physics model.
|
||||
|
||||
@ -54,7 +54,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
``-DBUILD_SHARED_LIBS=on``, ``-DLAMMPS_EXCEPTIONS=on`` and
|
||||
``-DPKG_PYTHON=on`` (The first option is required, the other two
|
||||
are optional by recommended). The exact file name of the shared
|
||||
library depends on the platform (Unix/Linux, MacOS, Windows) and
|
||||
library depends on the platform (Unix/Linux, macOS, Windows) and
|
||||
the build configuration being used. The installation base folder
|
||||
is already set by default to the ``$HOME/.local`` directory, but
|
||||
it can be changed to a custom location defined by the
|
||||
@ -121,7 +121,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
the folder containing the LAMMPS shared library is either included
|
||||
in a path searched by the shared linker (e.g. like
|
||||
``/usr/lib64/``) or part of the ``LD_LIBRARY_PATH`` environment
|
||||
variable (or ``DYLD_LIBRARY_PATH`` on MacOS). Otherwise you will
|
||||
variable (or ``DYLD_LIBRARY_PATH`` on macOS). Otherwise you will
|
||||
get an error when trying to create a LAMMPS object through the
|
||||
Python module.
|
||||
|
||||
@ -130,7 +130,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
# Unix/Linux
|
||||
export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH
|
||||
|
||||
# MacOS
|
||||
# macOS
|
||||
export DYLD_LIBRARY_PATH=$HOME/.local/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
If you plan to use the LAMMPS executable (e.g., ``lmp``), you may
|
||||
@ -214,7 +214,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python install.py -p <python package> -l <shared library> [-n]
|
||||
python install.py -p <python package> -l <shared library> [-n]
|
||||
|
||||
* The ``-p`` flag points to the ``lammps`` Python package folder to be installed,
|
||||
* the ``-l`` flag points to the LAMMPS shared library file to be installed,
|
||||
@ -294,7 +294,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
script in a similar fashion you need to update your
|
||||
``$HOME/.bashrc`` file to include the shared library and
|
||||
executable locations in ``LD_LIBRARY_PATH`` (or
|
||||
``DYLD_LIBRARY_PATH`` on MacOS) and ``PATH``, respectively.
|
||||
``DYLD_LIBRARY_PATH`` on macOS) and ``PATH``, respectively.
|
||||
|
||||
For example with:
|
||||
|
||||
@ -303,7 +303,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
# Unix/Linux
|
||||
echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH' >> $HOME/myenv/bin/activate
|
||||
|
||||
# MacOS
|
||||
# macOS
|
||||
echo 'export DYLD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$DYLD_LIBRARY_PATH' >> $HOME/myenv/bin/activate
|
||||
|
||||
.. tab:: In place usage
|
||||
@ -313,7 +313,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
package inside the source/compilation folders. Instead of
|
||||
copying the files where they can be found, you need to set the environment
|
||||
variables ``PYTHONPATH`` (for the Python package) and
|
||||
``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH`` on MacOS
|
||||
``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH`` on macOS
|
||||
|
||||
For Bourne shells (bash, ksh and similar) the commands are:
|
||||
|
||||
@ -329,7 +329,7 @@ folder that the dynamic loader searches or inside of the installed
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${HOME}/lammps/python
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HOME}/lammps/src
|
||||
|
||||
On MacOS you may also need to set ``DYLD_LIBRARY_PATH`` accordingly.
|
||||
On macOS you may also need to set ``DYLD_LIBRARY_PATH`` accordingly.
|
||||
You can make those changes permanent by editing your ``$HOME/.bashrc``
|
||||
or ``$HOME/.login`` files, respectively.
|
||||
|
||||
@ -343,7 +343,7 @@ Python interpreter, load the ``lammps`` Python module and create a
|
||||
LAMMPS instance. This should not generate an error message and produce
|
||||
output similar to the following:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ python
|
||||
Python 3.8.5 (default, Sep 5 2020, 10:50:12)
|
||||
@ -403,7 +403,7 @@ follows:
|
||||
|
||||
- Via ``pip`` into a virtual environment (see above):
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ source $HOME/myenv/activate
|
||||
(myenv)$ pip install mpi4py
|
||||
@ -449,7 +449,7 @@ on a simple test script
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 4 python3 test.py
|
||||
mpirun -np 4 python3 test.py
|
||||
|
||||
where ``test.py`` contains the lines
|
||||
|
||||
@ -459,11 +459,11 @@ where ``test.py`` contains the lines
|
||||
comm = MPI.COMM_WORLD
|
||||
print("Proc %d out of %d procs" % (comm.Get_rank(),comm.Get_size()))
|
||||
|
||||
and see one line of output for each processor you run on.
|
||||
and see one line of output for each processor you run on. Please note
|
||||
that the order of the lines is not deterministic
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
# NOTE: the line order is not deterministic
|
||||
$ mpirun -np 4 python3 test.py
|
||||
Proc 0 out of 4 procs
|
||||
Proc 1 out of 4 procs
|
||||
|
||||
@ -6,15 +6,15 @@ interactively from the ``bench`` directory:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
>>> from lammps import lammps
|
||||
>>> lmp = lammps()
|
||||
>>> lmp.file("in.lj")
|
||||
from lammps import lammps
|
||||
lmp = lammps()
|
||||
lmp.file("in.lj")
|
||||
|
||||
Or put the same lines in the file ``test.py`` and run it as
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python3 test.py
|
||||
python3 test.py
|
||||
|
||||
Either way, you should see the results of running the ``in.lj`` benchmark
|
||||
on a single processor appear on the screen, the same as if you had
|
||||
@ -46,17 +46,17 @@ You can run the script in parallel as:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 4 python3 test.py
|
||||
mpirun -np 4 python3 test.py
|
||||
|
||||
and you should see the same output as if you had typed
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 4 lmp_mpi -in in.lj
|
||||
mpirun -np 4 lmp_mpi -in in.lj
|
||||
|
||||
Note that without the mpi4py specific lines from ``test.py``
|
||||
|
||||
.. code-block:: Python
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps
|
||||
lmp = lammps()
|
||||
@ -82,9 +82,9 @@ one of several ways:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python script.py
|
||||
$ python -i script.py
|
||||
$ ./script.py
|
||||
python script.py
|
||||
python -i script.py
|
||||
./script.py
|
||||
|
||||
The last command requires that the first line of the script be
|
||||
something like this:
|
||||
@ -92,17 +92,23 @@ something like this:
|
||||
.. code-block:: bash
|
||||
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/python -i
|
||||
|
||||
where the path points to where you have Python installed, and that you
|
||||
have made the script file executable:
|
||||
or
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ chmod +x script.py
|
||||
#!/usr/bin/env python
|
||||
|
||||
where the path in the first case needs to point to where you have Python
|
||||
installed (the second option is workaround for when this may change),
|
||||
and that you have made the script file executable:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
chmod +x script.py
|
||||
|
||||
Without the ``-i`` flag, Python will exit when the script finishes.
|
||||
With the ``-i`` flag, you will be left in the Python interpreter when
|
||||
the script finishes, so you can type subsequent commands. As
|
||||
mentioned above, you can only run Python interactively when running
|
||||
Python on a single processor, not in parallel.
|
||||
the script finishes, so you can type subsequent commands. As mentioned
|
||||
above, you can only run Python interactively when running Python on a
|
||||
single processor, not in parallel.
|
||||
|
||||
@ -32,7 +32,7 @@ standard Python distribution since version 2.5. You can check which
|
||||
version of Python you have by simply typing "python" at a shell prompt.
|
||||
Below is an example output for Python version 3.8.5.
|
||||
|
||||
.. code-block::
|
||||
.. code-block:: console
|
||||
|
||||
$ python
|
||||
Python 3.8.5 (default, Aug 12 2020, 00:00:00)
|
||||
@ -43,12 +43,16 @@ Below is an example output for Python version 3.8.5.
|
||||
|
||||
.. warning::
|
||||
|
||||
The options described in this section of the manual for using Python with
|
||||
LAMMPS currently support either Python 2 or 3. Specifically version 2.7 or
|
||||
later and 3.6 or later. Since the Python community no longer maintains Python
|
||||
2 (see `this notice <https://www.python.org/doc/sunset-python-2/>`_), we
|
||||
recommend use of Python 3 with LAMMPS. While Python 2 code should continue to
|
||||
work, that is not something we can guarantee long-term.
|
||||
The options described in this section of the manual for using Python
|
||||
with LAMMPS currently support either Python 2 or 3. Specifically
|
||||
version 2.7 or later and 3.6 or later. Since the Python community no
|
||||
longer maintains Python 2 (see `this notice
|
||||
<https://www.python.org/doc/sunset-python-2/>`_), we recommend use of
|
||||
Python 3 with LAMMPS. While Python 2 code should continue to work,
|
||||
that is not something we can guarantee long-term. If you notice
|
||||
Python code in the LAMMPS distribution that is not compatible with
|
||||
Python 3, please contact the LAMMPS developers or submit `and issue
|
||||
on GitHub <https://github.com/lammps/lammps/issues>`_
|
||||
|
||||
---------
|
||||
|
||||
|
||||
@ -12,15 +12,15 @@ build LAMMPS:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ lmp_serial -in in.file
|
||||
$ lmp_serial < in.file
|
||||
$ lmp -in in.file
|
||||
$ lmp < in.file
|
||||
$ /path/to/lammps/src/lmp_serial -i in.file
|
||||
$ mpirun -np 4 lmp_mpi -in in.file
|
||||
$ mpiexec -np 4 lmp -in in.file
|
||||
$ mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file
|
||||
$ mpiexec -n 6 /usr/local/bin/lmp -in in.file
|
||||
lmp_serial -in in.file
|
||||
lmp_serial < in.file
|
||||
lmp -in in.file
|
||||
lmp < in.file
|
||||
/path/to/lammps/src/lmp_serial -i in.file
|
||||
mpirun -np 4 lmp_mpi -in in.file
|
||||
mpiexec -np 4 lmp -in in.file
|
||||
mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file
|
||||
mpiexec -n 6 /usr/local/bin/lmp -in in.file
|
||||
|
||||
You normally run the LAMMPS command in the directory where your input
|
||||
script is located. That is also where output files are produced by
|
||||
@ -30,12 +30,13 @@ executable itself can be placed elsewhere.
|
||||
|
||||
.. note::
|
||||
|
||||
The redirection operator "<" will not always work when running
|
||||
in parallel with mpirun or mpiexec; for those systems the -in form is required.
|
||||
The redirection operator "<" will not always work when running in
|
||||
parallel with ``mpirun`` or ``mpiexec``; for those systems the -in
|
||||
form is required.
|
||||
|
||||
As LAMMPS runs it prints info to the screen and a logfile named
|
||||
*log.lammps*\ . More info about output is given on the
|
||||
:doc:`screen and logfile output <Run_output>` page.
|
||||
*log.lammps*\ . More info about output is given on the :doc:`screen and
|
||||
logfile output <Run_output>` page.
|
||||
|
||||
If LAMMPS encounters errors in the input script or while running a
|
||||
simulation it will print an ERROR message and stop or a WARNING
|
||||
@ -77,8 +78,8 @@ variable OMP_NUM_THREADS, before you launch LAMMPS:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ export OMP_NUM_THREADS=2 # bash
|
||||
$ setenv OMP_NUM_THREADS 2 # csh or tcsh
|
||||
export OMP_NUM_THREADS=2 # bash
|
||||
setenv OMP_NUM_THREADS 2 # csh or tcsh
|
||||
|
||||
This can also be done via the :doc:`package <package>` command or via
|
||||
the :doc:`-pk command-line switch <Run_options>` which invokes the
|
||||
|
||||
@ -30,8 +30,8 @@ For example, the lmp_mpi executable might be launched as follows:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 16 lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy
|
||||
$ mpirun -np 16 lmp_mpi -var f tmp.out -log my.log -screen none -in in.alloy
|
||||
mpirun -np 16 lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy
|
||||
mpirun -np 16 lmp_mpi -var f tmp.out -log my.log -screen none -in in.alloy
|
||||
|
||||
----------
|
||||
|
||||
@ -92,13 +92,13 @@ switch is not set (the default), LAMMPS will operate as if the KOKKOS
|
||||
package were not installed; i.e. you can run standard LAMMPS or with
|
||||
the GPU or OPENMP packages, for testing or benchmarking purposes.
|
||||
|
||||
Additional optional keyword/value pairs can be specified which
|
||||
determine how Kokkos will use the underlying hardware on your
|
||||
platform. These settings apply to each MPI task you launch via the
|
||||
"mpirun" or "mpiexec" command. You may choose to run one or more MPI
|
||||
tasks per physical node. Note that if you are running on a desktop
|
||||
machine, you typically have one physical node. On a cluster or
|
||||
supercomputer there may be dozens or 1000s of physical nodes.
|
||||
Additional optional keyword/value pairs can be specified which determine
|
||||
how Kokkos will use the underlying hardware on your platform. These
|
||||
settings apply to each MPI task you launch via the ``mpirun`` or
|
||||
``mpiexec`` command. You may choose to run one or more MPI tasks per
|
||||
physical node. Note that if you are running on a desktop machine, you
|
||||
typically have one physical node. On a cluster or supercomputer there
|
||||
may be dozens or 1000s of physical nodes.
|
||||
|
||||
Either the full word or an abbreviation can be used for the keywords.
|
||||
Note that the keywords do not use a leading minus sign. I.e. the
|
||||
@ -147,9 +147,9 @@ one of these 4 environment variables
|
||||
MV2_COMM_WORLD_LOCAL_RANK (Mvapich)
|
||||
OMPI_COMM_WORLD_LOCAL_RANK (OpenMPI)
|
||||
|
||||
which are initialized by the "srun", "mpirun" or "mpiexec" commands.
|
||||
The environment variable setting for each MPI rank is used to assign a
|
||||
unique GPU ID to the MPI task.
|
||||
which are initialized by the ``srun``, ``mpirun``, or ``mpiexec``
|
||||
commands. The environment variable setting for each MPI rank is used to
|
||||
assign a unique GPU ID to the MPI task.
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -498,10 +498,10 @@ The syntax following restartfile (or remap), namely
|
||||
group-ID dumpstyle dumpfile arg1 arg2 ...
|
||||
|
||||
is identical to the arguments of the :doc:`write_dump <write_dump>`
|
||||
command. See its page for details. This includes what per-atom
|
||||
fields are written to the dump file and optional dump_modify settings,
|
||||
including ones that affect how parallel dump files are written, e.g.
|
||||
the *nfile* and *fileper* keywords. See the
|
||||
command. See its documentation page for details. This includes what
|
||||
per-atom fields are written to the dump file and optional dump_modify
|
||||
settings, including ones that affect how parallel dump files are written,
|
||||
e.g. the *nfile* and *fileper* keywords. See the
|
||||
:doc:`dump_modify <dump_modify>` page for details.
|
||||
|
||||
----------
|
||||
|
||||
@ -39,7 +39,7 @@ toolkit software on your system (this is only tested on Linux
|
||||
and unsupported on Windows):
|
||||
|
||||
* Check if you have an NVIDIA GPU: cat /proc/driver/nvidia/gpus/\*/information
|
||||
* Go to http://www.nvidia.com/object/cuda_get.html
|
||||
* Go to https://developer.nvidia.com/cuda-downloads
|
||||
* Install a driver and toolkit appropriate for your system (SDK is not necessary)
|
||||
* Run lammps/lib/gpu/nvc_get_devices (after building the GPU library, see below) to
|
||||
list supported devices and properties
|
||||
@ -76,10 +76,11 @@ instructions.
|
||||
|
||||
**Run with the GPU package from the command line:**
|
||||
|
||||
The mpirun or mpiexec command sets the total number of MPI tasks used
|
||||
by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||
tasks used per node. E.g. the mpirun command in MPICH does this via
|
||||
its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode.
|
||||
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
|
||||
used by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||
tasks used per node. E.g. the ``mpirun`` command in MPICH does this via
|
||||
its ``-np`` and ``-ppn`` switches. Ditto for OpenMPI via ``-np`` and
|
||||
``-npernode``.
|
||||
|
||||
When using the GPU package, you cannot assign more than one GPU to a
|
||||
single MPI task. However multiple MPI tasks can share the same GPU,
|
||||
@ -129,8 +130,8 @@ GPU package pair styles.
|
||||
|
||||
**Or run with the GPU package by editing an input script:**
|
||||
|
||||
The discussion above for the mpirun/mpiexec command, MPI tasks/node,
|
||||
and use of multiple MPI tasks/GPU is the same.
|
||||
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
|
||||
tasks/node, and use of multiple MPI tasks/GPU is the same.
|
||||
|
||||
Use the :doc:`suffix gpu <suffix>` command, or you can explicitly add an
|
||||
"gpu" suffix to individual styles in your input script, e.g.
|
||||
|
||||
@ -536,6 +536,6 @@ supported.
|
||||
References
|
||||
""""""""""
|
||||
|
||||
* Brown, W.M., Carrillo, J.-M.Y., Mishra, B., Gavhane, N., Thakkar, F.M., De Kraker, A.R., Yamada, M., Ang, J.A., Plimpton, S.J., "Optimizing Classical Molecular Dynamics in LAMMPS," in Intel Xeon Phi Processor High Performance Programming: Knights Landing Edition, J. Jeffers, J. Reinders, A. Sodani, Eds. Morgan Kaufmann.
|
||||
* Brown, W. M., Semin, A., Hebenstreit, M., Khvostov, S., Raman, K., Plimpton, S.J. `Increasing Molecular Dynamics Simulation Rates with an 8-Fold Increase in Electrical Power Efficiency. <http://dl.acm.org/citation.cfm?id=3014915>`_ 2016 High Performance Computing, Networking, Storage and Analysis, SC16: International Conference (pp. 82-95).
|
||||
* Brown, W.M., Carrillo, J.-M.Y., Mishra, B., Gavhane, N., Thakkar, F.M., De Kraker, A.R., Yamada, M., Ang, J.A., Plimpton, S.J., "Optimizing Classical Molecular Dynamics in LAMMPS", in Intel Xeon Phi Processor High Performance Programming: Knights Landing Edition, J. Jeffers, J. Reinders, A. Sodani, Eds. Morgan Kaufmann.
|
||||
* Brown, W. M., Semin, A., Hebenstreit, M., Khvostov, S., Raman, K., Plimpton, S.J. `Increasing Molecular Dynamics Simulation Rates with an 8-Fold Increase in Electrical Power Efficiency. <https://dl.acm.org/citation.cfm?id=3014915>`_ 2016 High Performance Computing, Networking, Storage and Analysis, SC16: International Conference (pp. 82-95).
|
||||
* Brown, W.M., Carrillo, J.-M.Y., Gavhane, N., Thakkar, F.M., Plimpton, S.J. Optimizing Legacy Molecular Dynamics Software with Directive-Based Offload. Computer Physics Communications. 2015. 195: p. 95-101.
|
||||
|
||||
@ -72,12 +72,12 @@ See the :ref:`Build extras <kokkos>` page for instructions.
|
||||
Running LAMMPS with the KOKKOS package
|
||||
""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
All Kokkos operations occur within the context of an individual MPI
|
||||
task running on a single node of the machine. The total number of MPI
|
||||
tasks used by LAMMPS (one or multiple per compute node) is set in the
|
||||
usual manner via the mpirun or mpiexec commands, and is independent of
|
||||
Kokkos. E.g. the mpirun command in OpenMPI does this via its -np and
|
||||
-npernode switches. Ditto for MPICH via -np and -ppn.
|
||||
All Kokkos operations occur within the context of an individual MPI task
|
||||
running on a single node of the machine. The total number of MPI tasks
|
||||
used by LAMMPS (one or multiple per compute node) is set in the usual
|
||||
manner via the ``mpirun`` or ``mpiexec`` commands, and is independent of
|
||||
Kokkos. E.g. the mpirun command in OpenMPI does this via its ``-np`` and
|
||||
``-npernode`` switches. Ditto for MPICH via ``-np`` and ``-ppn``.
|
||||
|
||||
Running on a multi-core CPU
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -168,7 +168,7 @@ for your MPI installation), binding can be forced with these flags:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
OpenMPI 1.8: mpirun -np 2 --bind-to socket --map-by socket ./lmp_openmpi ...
|
||||
OpenMPI 1.8: mpirun -np 2 --bind-to socket --map-by socket ./lmp_openmpi ...
|
||||
Mvapich2 2.0: mpiexec -np 2 --bind-to socket --map-by socket ./lmp_mvapich ...
|
||||
|
||||
For binding threads with KOKKOS OpenMP, use thread affinity environment
|
||||
@ -212,14 +212,15 @@ threads/task as Nt. The product of these two values should be N, i.e.
|
||||
.. note::
|
||||
|
||||
The default for the :doc:`package kokkos <package>` command when
|
||||
running on KNL is to use "half" neighbor lists and set the Newton flag
|
||||
to "on" for both pairwise and bonded interactions. This will typically
|
||||
be best for many-body potentials. For simpler pairwise potentials, it
|
||||
may be faster to use a "full" neighbor list with Newton flag to "off".
|
||||
Use the "-pk kokkos" :doc:`command-line switch <Run_options>` to change
|
||||
the default :doc:`package kokkos <package>` options. See its page for
|
||||
details and default settings. Experimenting with its options can provide
|
||||
a speed-up for specific calculations. For example:
|
||||
running on KNL is to use "half" neighbor lists and set the Newton
|
||||
flag to "on" for both pairwise and bonded interactions. This will
|
||||
typically be best for many-body potentials. For simpler pairwise
|
||||
potentials, it may be faster to use a "full" neighbor list with
|
||||
Newton flag to "off". Use the "-pk kokkos" :doc:`command-line switch
|
||||
<Run_options>` to change the default :doc:`package kokkos <package>`
|
||||
options. See its documentation page for details and default
|
||||
settings. Experimenting with its options can provide a speed-up for
|
||||
specific calculations. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -271,17 +272,18 @@ one or more nodes, each with two GPUs:
|
||||
.. note::
|
||||
|
||||
The default for the :doc:`package kokkos <package>` command when
|
||||
running on GPUs is to use "full" neighbor lists and set the Newton flag
|
||||
to "off" for both pairwise and bonded interactions, along with threaded
|
||||
communication. When running on Maxwell or Kepler GPUs, this will
|
||||
typically be best. For Pascal GPUs and beyond, using "half" neighbor lists and
|
||||
setting the Newton flag to "on" may be faster. For many pair styles,
|
||||
setting the neighbor binsize equal to twice the CPU default value will
|
||||
give speedup, which is the default when running on GPUs. Use the "-pk
|
||||
kokkos" :doc:`command-line switch <Run_options>` to change the default
|
||||
:doc:`package kokkos <package>` options. See its page for details and
|
||||
default settings. Experimenting with its options can provide a speed-up
|
||||
for specific calculations. For example:
|
||||
running on GPUs is to use "full" neighbor lists and set the Newton
|
||||
flag to "off" for both pairwise and bonded interactions, along with
|
||||
threaded communication. When running on Maxwell or Kepler GPUs, this
|
||||
will typically be best. For Pascal GPUs and beyond, using "half"
|
||||
neighbor lists and setting the Newton flag to "on" may be faster. For
|
||||
many pair styles, setting the neighbor binsize equal to twice the CPU
|
||||
default value will give speedup, which is the default when running on
|
||||
GPUs. Use the "-pk kokkos" :doc:`command-line switch <Run_options>`
|
||||
to change the default :doc:`package kokkos <package>` options. See
|
||||
its documentation page for details and default
|
||||
settings. Experimenting with its options can provide a speed-up for
|
||||
specific calculations. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -310,7 +312,8 @@ Alternatively the effect of the "-sf" or "-pk" switches can be
|
||||
duplicated by adding the :doc:`package kokkos <package>` or :doc:`suffix kk <suffix>` commands to your input script.
|
||||
|
||||
The discussion above for building LAMMPS with the KOKKOS package, the
|
||||
mpirun/mpiexec command, and setting appropriate thread are the same.
|
||||
``mpirun`` or ``mpiexec`` command, and setting appropriate thread
|
||||
properties are the same.
|
||||
|
||||
You must still use the "-k on" :doc:`command-line switch <Run_options>`
|
||||
to enable the KOKKOS package, and specify its additional arguments for
|
||||
|
||||
@ -33,8 +33,8 @@ These examples assume one or more 16-core nodes.
|
||||
mpirun -np 4 lmp_omp -sf omp -pk omp 4 -in in.script # 4 MPI tasks, 4 threads/task
|
||||
mpirun -np 32 -ppn 4 lmp_omp -sf omp -pk omp 4 -in in.script # 8 nodes, 4 MPI tasks/node, 4 threads/task
|
||||
|
||||
The mpirun or mpiexec command sets the total number of MPI tasks used
|
||||
by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
|
||||
used by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||
tasks used per node. E.g. the mpirun command in MPICH does this via
|
||||
its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode.
|
||||
|
||||
@ -58,8 +58,8 @@ OMP_NUM_THREADS environment variable.
|
||||
Or run with the OPENMP package by editing an input script
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The discussion above for the mpirun/mpiexec command, MPI tasks/node,
|
||||
and threads/MPI task is the same.
|
||||
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
|
||||
tasks/node, and threads/MPI task is the same.
|
||||
|
||||
Use the :doc:`suffix omp <suffix>` command, or you can explicitly add an
|
||||
"omp" suffix to individual styles in your input script, e.g.
|
||||
@ -97,7 +97,7 @@ sub-section.
|
||||
|
||||
A description of the multi-threading strategy used in the OPENMP
|
||||
package and some performance examples are
|
||||
`presented here <http://sites.google.com/site/akohlmey/software/lammps-icms/lammps-icms-tms2011-talk.pdf?attredirects=0&d=1>`_.
|
||||
`presented here <https://drive.google.com/file/d/1d1gLK6Ru6aPYB50Ld2tO10Li8zgPVNB8/view?usp=sharing>`_.
|
||||
|
||||
Guidelines for best performance
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
@ -117,33 +117,15 @@ script.
|
||||
with all its accelerator packages installed. Note however that the
|
||||
INTEL and KOKKOS packages require you to choose one of their
|
||||
hardware options when building for a specific platform. I.e. CPU or
|
||||
Phi option for the INTEL package. Or the OpenMP, Cuda, or Phi
|
||||
option for the KOKKOS package.
|
||||
Phi option for the INTEL package. Or the OpenMP, CUDA, HIP, SYCL,
|
||||
or Phi option for the KOKKOS package. Or the OpenCL, HIP, or CUDA
|
||||
option for the GPU package.
|
||||
|
||||
These are the exceptions. You cannot build a single executable with:
|
||||
|
||||
* both the INTEL Phi and KOKKOS Phi options
|
||||
* the INTEL Phi or Kokkos Phi option, and the GPU package
|
||||
|
||||
See the examples/accelerate/README and make.list files for sample
|
||||
Make.py commands that build LAMMPS with any or all of the accelerator
|
||||
packages. As an example, here is a command that builds with all the
|
||||
GPU related packages installed (GPU, KOKKOS with Cuda), including
|
||||
settings to build the needed auxiliary GPU libraries for Kepler GPUs:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
Make.py -j 16 -p omp gpu kokkos -cc nvcc wrap=mpi -gpu mode=double arch=35 -kokkos cuda arch=35 lib-all file mpi
|
||||
|
||||
The examples/accelerate directory also has input scripts that can be
|
||||
used with all of the accelerator packages. See its README file for
|
||||
details.
|
||||
|
||||
Likewise, the bench directory has FERMI and KEPLER and PHI
|
||||
sub-directories with Make.py commands and input scripts for using all
|
||||
the accelerator packages on various machines. See the README files in
|
||||
those directories.
|
||||
|
||||
As mentioned above, the `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS website gives
|
||||
performance results for the various accelerator packages for several
|
||||
of the standard LAMMPS benchmark problems, as a function of problem
|
||||
|
||||
@ -57,7 +57,7 @@ Pre-processing tools
|
||||
* :ref:`msi2lmp <msi>`
|
||||
* :ref:`polybond <polybond>`
|
||||
* :ref:`stl_bin2txt <stlconvert>`
|
||||
|
||||
* :ref:`tabulate <tabulate>`
|
||||
|
||||
Post-processing tools
|
||||
=====================
|
||||
@ -397,7 +397,7 @@ ipp tool
|
||||
------------------
|
||||
|
||||
The tools/ipp directory contains a Perl script ipp which can be used
|
||||
to facilitate the creation of a complicated file (say, a lammps input
|
||||
to facilitate the creation of a complicated file (say, a LAMMPS input
|
||||
script or tools/createatoms input file) using a template file.
|
||||
|
||||
ipp was created and is maintained by Reese Jones (Sandia), rjones at
|
||||
@ -512,8 +512,8 @@ with an ``.inputrc`` file in the home directory. For application
|
||||
specific customization, the LAMMPS shell uses the name "lammps-shell".
|
||||
For more information about using and customizing an application using
|
||||
readline, please see the available documentation at:
|
||||
`http://www.gnu.org/s/readline/#Documentation
|
||||
<http://www.gnu.org/s/readline/#Documentation>`_
|
||||
https://www.gnu.org/software/readline/
|
||||
|
||||
|
||||
Additional commands
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@ -682,7 +682,7 @@ or (as administrator) to ``/etc/magic`` (for a system-wide
|
||||
installation). Afterwards the ``file`` command should be able to
|
||||
detect most LAMMPS restarts, dump, data and log files. Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ file *.*
|
||||
dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian
|
||||
@ -715,7 +715,7 @@ See the README.pdf file for more information.
|
||||
These scripts were written by Arun Subramaniyan at Purdue Univ
|
||||
(asubrama at purdue.edu).
|
||||
|
||||
.. _matlabhome: http://www.mathworks.com
|
||||
.. _matlabhome: https://www.mathworks.com
|
||||
|
||||
----------
|
||||
|
||||
@ -1046,7 +1046,7 @@ the binary file. This usually is a so-called little endian hardware
|
||||
SWIG interface
|
||||
--------------
|
||||
|
||||
The `SWIG tool <http://swig.org>`_ offers a mostly automated way to
|
||||
The `SWIG tool <https://swig.org>`_ offers a mostly automated way to
|
||||
incorporate compiled code modules into scripting languages. It
|
||||
processes the function prototypes in C and generates wrappers for a wide
|
||||
variety of scripting languages from it. Thus it can also be applied to
|
||||
@ -1099,18 +1099,18 @@ for Tcl with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ swig -tcl -module tcllammps lammps.i
|
||||
$ gcc -fPIC -shared $(pkgconf --cflags tcl) -o tcllammps.so \
|
||||
swig -tcl -module tcllammps lammps.i
|
||||
gcc -fPIC -shared $(pkgconf --cflags tcl) -o tcllammps.so \
|
||||
lammps_wrap.c -L ../src/ -llammps
|
||||
$ tclsh
|
||||
tclsh
|
||||
|
||||
Or one can build an extended Tcl shell command with the wrapped
|
||||
functions included with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ swig -tcl -module tcllmps lammps_shell.i
|
||||
$ gcc -o tcllmpsh lammps_wrap.c -Xlinker -export-dynamic \
|
||||
swig -tcl -module tcllmps lammps_shell.i
|
||||
gcc -o tcllmpsh lammps_wrap.c -Xlinker -export-dynamic \
|
||||
-DHAVE_CONFIG_H $(pkgconf --cflags tcl) \
|
||||
$(pkgconf --libs tcl) -L ../src -llammps
|
||||
|
||||
@ -1126,7 +1126,7 @@ data passed or returned as pointers are included in the ``lammps.i``
|
||||
file. So most of the functionality of the library interface should be
|
||||
accessible. What works and what does not depends a bit on the
|
||||
individual language for which the wrappers are built and how well SWIG
|
||||
supports those. The `SWIG documentation <http://swig.org/doc.html>`_
|
||||
supports those. The `SWIG documentation <https://swig.org/doc.html>`_
|
||||
has very detailed instructions and recommendations.
|
||||
|
||||
Usage examples
|
||||
@ -1141,20 +1141,32 @@ For illustration purposes below is a part of the Tcl example script.
|
||||
|
||||
.. code-block:: tcl
|
||||
|
||||
% load ./tcllammps.so
|
||||
% set lmp [lammps_open_no_mpi 0 NULL NULL]
|
||||
% lammps_command $lmp "units real"
|
||||
% lammps_command $lmp "lattice fcc 2.5"
|
||||
% lammps_command $lmp "region box block -5 5 -5 5 -5 5"
|
||||
% lammps_command $lmp "create_box 1 box"
|
||||
% lammps_command $lmp "create_atoms 1 box"
|
||||
%
|
||||
% set dt [doublep_value [voidp_to_doublep [lammps_extract_global $lmp dt]]]
|
||||
% puts "LAMMPS version $ver"
|
||||
% puts [format "Number of created atoms: %g" [lammps_get_natoms $lmp]]
|
||||
% puts "Current size of timestep: $dt"
|
||||
% puts "LAMMPS version: [lammps_version $lmp]"
|
||||
% lammps_close $lmp
|
||||
load ./tcllammps.so
|
||||
set lmp [lammps_open_no_mpi 0 NULL NULL]
|
||||
lammps_command $lmp "units real"
|
||||
lammps_command $lmp "lattice fcc 2.5"
|
||||
lammps_command $lmp "region box block -5 5 -5 5 -5 5"
|
||||
lammps_command $lmp "create_box 1 box"
|
||||
lammps_command $lmp "create_atoms 1 box"
|
||||
|
||||
set dt [doublep_value [voidp_to_doublep [lammps_extract_global $lmp dt]]]
|
||||
puts "LAMMPS version $ver"
|
||||
puts [format "Number of created atoms: %g" [lammps_get_natoms $lmp]]
|
||||
puts "Current size of timestep: $dt"
|
||||
puts "LAMMPS version: [lammps_version $lmp]"
|
||||
lammps_close $lmp
|
||||
|
||||
----------
|
||||
|
||||
.. _tabulate:
|
||||
|
||||
tabulate tool
|
||||
--------------
|
||||
|
||||
The ``tabulate`` folder contains Python scripts scripts to generate tabulated
|
||||
potential files for LAMMPS. The bulk of the code is in the ``tabulate`` module
|
||||
in the ``tabulate.py`` file. Some example files demonstrating its use are
|
||||
included. See the README file for more information.
|
||||
|
||||
----------
|
||||
|
||||
@ -1163,8 +1175,8 @@ For illustration purposes below is a part of the Tcl example script.
|
||||
vim tool
|
||||
------------------
|
||||
|
||||
The files in the tools/vim directory are add-ons to the VIM editor
|
||||
that allow easier editing of LAMMPS input scripts. See the README.txt
|
||||
The files in the ``tools/vim`` directory are add-ons to the VIM editor
|
||||
that allow easier editing of LAMMPS input scripts. See the ``README.txt``
|
||||
file for details.
|
||||
|
||||
These files were provided by Gerolf Ziegenhain (gerolf at
|
||||
|
||||
@ -6,7 +6,7 @@ page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
These accelerated styles are part of the GPU, INTEL, KOKKOS,
|
||||
OPENMP and OPT packages, respectively. They are only enabled if
|
||||
OPENMP, and OPT packages, respectively. They are only enabled if
|
||||
LAMMPS was built with those packages. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
|
||||
@ -24,7 +24,7 @@ Examples
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style class2
|
||||
angle_coeff * 75.0
|
||||
angle_coeff * 75.0 25.0 0.3 0.002
|
||||
angle_coeff 1 bb 10.5872 1.0119 1.5228
|
||||
angle_coeff * ba 3.6551 24.895 1.0119 1.5228
|
||||
|
||||
|
||||
@ -25,23 +25,25 @@ The *gaussian* angle style uses the potential:
|
||||
|
||||
.. math::
|
||||
|
||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-(\theta-\theta_{i})^2}{w_i^2})\right) \right)
|
||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-2(\theta-\theta_{i})^2}{w_i^2}\right) \right)
|
||||
|
||||
This analytical form is a suitable potential for obtaining mesoscale
|
||||
effective force fields which can reproduce target atomistic
|
||||
distributions :ref:`(Milano) <Milano1>`.
|
||||
|
||||
This analytical form is a suitable potential for obtaining
|
||||
mesoscale effective force fields which can reproduce target atomistic distributions :ref:`(Milano) <Milano1>`
|
||||
The following coefficients must be defined for each angle type via the
|
||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
or :doc:`read_restart <read_restart>` commands:
|
||||
|
||||
* T temperature at which the potential was derived
|
||||
* :math:`T` temperature at which the potential was derived
|
||||
* :math:`n` (integer >=1)
|
||||
* :math:`A_1` (-)
|
||||
* :math:`w_1` (-)
|
||||
* :math:`A_1` (> 0, radians)
|
||||
* :math:`w_1` (> 0, radians)
|
||||
* :math:`\theta_1` (degrees)
|
||||
* ...
|
||||
* :math:`A_n` (-)
|
||||
* :math:`w_n` (-)
|
||||
* :math:`A_n` (> 0, radians)
|
||||
* :math:`w_n` (> 0, radians)
|
||||
* :math:`\theta_n` (degrees)
|
||||
|
||||
|
||||
|
||||
@ -59,6 +59,13 @@ format of this file is described below.
|
||||
|
||||
----------
|
||||
|
||||
Suitable tables for use with this angle style can be created by LAMMPS
|
||||
itself from existing angle styles using the :doc:`angle_write
|
||||
<angle_write>` command. This can be useful to have a template file for
|
||||
testing the angle style settings and to build a compatible custom file.
|
||||
Another option to generate tables is the Python code in the
|
||||
``tools/tabulate`` folder of the LAMMPS source code distribution.
|
||||
|
||||
The format of a tabulated file is as follows (without the
|
||||
parenthesized comments):
|
||||
|
||||
|
||||
@ -8,7 +8,10 @@ Syntax
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style zero *nocoeff*
|
||||
angle_style zero keyword
|
||||
|
||||
* zero or more keywords may be appended
|
||||
* keyword = *nocoeff*
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -6,7 +6,7 @@ balance command
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
balance thresh style args ... keyword args ...
|
||||
|
||||
|
||||
@ -25,33 +25,34 @@ The *gaussian* bond style uses the potential:
|
||||
|
||||
.. math::
|
||||
|
||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-(r-r_{i})^2}{w_i^2})\right) \right)
|
||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-2(r-r_{i})^2}{w_i^2}\right)\right)
|
||||
|
||||
This analytical form is a suitable potential for obtaining
|
||||
mesoscale effective force fields which can reproduce target atomistic distributions :ref:`(Milano) <Milano0>`
|
||||
This analytical form is a suitable potential for obtaining mesoscale
|
||||
effective force fields which can reproduce target atomistic
|
||||
distributions :ref:`(Milano) <Milano0>`
|
||||
|
||||
The following coefficients must be defined for each bond type via the
|
||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
or :doc:`read_restart <read_restart>` commands:
|
||||
|
||||
* T temperature at which the potential was derived
|
||||
* :math:`T` temperature at which the potential was derived
|
||||
* :math:`n` (integer >=1)
|
||||
* :math:`A_1` (-)
|
||||
* :math:`w_1` (-)
|
||||
* :math:`r_1` (length)
|
||||
* :math:`A_1` (> 0, distance)
|
||||
* :math:`w_1` (> 0, distance)
|
||||
* :math:`r_1` (>= 0, distance)
|
||||
* ...
|
||||
* :math:`A_n` (-)
|
||||
* :math:`w_n` (-)
|
||||
* :math:`r_n` (length)
|
||||
* :math:`A_n` (> 0, distance)
|
||||
* :math:`w_n` (> 0, distance)
|
||||
* :math:`r_n` (>= 0, distance)
|
||||
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This bond style can only be used if LAMMPS was built with the
|
||||
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
|
||||
page for more info.
|
||||
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
|
||||
doc page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -59,6 +59,13 @@ this file is described below.
|
||||
|
||||
----------
|
||||
|
||||
Suitable tables for use with this bond style can be created by LAMMPS
|
||||
itself from existing bond styles using the :doc:`bond_write
|
||||
<bond_write>` command. This can be useful to have a template file for
|
||||
testing the bond style settings and to build a compatible custom file.
|
||||
Another option to generate tables is the Python code in the
|
||||
``tools/tabulate`` folder of the LAMMPS source code distribution.
|
||||
|
||||
The format of a tabulated file is as follows (without the
|
||||
parenthesized comments):
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Syntax
|
||||
|
||||
bond_write btype N inner outer file keyword itype jtype
|
||||
|
||||
* btype = bond types
|
||||
* btype = bond type
|
||||
* N = # of values
|
||||
* inner,outer = inner and outer bond length (distance units)
|
||||
* file = name of file to write values to
|
||||
@ -29,31 +29,34 @@ Description
|
||||
"""""""""""
|
||||
|
||||
Write energy and force values to a file as a function of distance for
|
||||
the currently defined bond potential. This is useful for plotting the
|
||||
potential function or otherwise debugging its values. If the file
|
||||
already exists, the table of values is appended to the end of the file
|
||||
to allow multiple tables of energy and force to be included in one
|
||||
file.
|
||||
the currently defined :doc:`bond style <bond_style>` for a selected bond
|
||||
type. This is useful for plotting the potential function or otherwise
|
||||
debugging its values. The resulting file can also be used as input for
|
||||
use with :doc:`bond style table <bond_table>`.
|
||||
|
||||
The energy and force values are computed at distances from inner to
|
||||
outer for 2 interacting atoms forming a bond of type btype, using the
|
||||
appropriate :doc:`bond_coeff <bond_coeff>` coefficients. N evenly spaced
|
||||
distances are used.
|
||||
If the file already exists, the table of values is appended to the end
|
||||
of the file to allow multiple tables of energy and force to be included
|
||||
in one file. The individual sections may be identified by the *keyword*.
|
||||
|
||||
The energy and force values are computed at distances from *inner* to
|
||||
*outer* for 2 interacting atoms forming a bond of type *btype*, using
|
||||
the appropriate :doc:`bond_coeff <bond_coeff>` coefficients. N evenly
|
||||
spaced distances are used.
|
||||
|
||||
For example, for N = 7, inner = 1.0, and outer = 4.0,
|
||||
values are computed at r = 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0.
|
||||
|
||||
The file is written in the format used as input for the
|
||||
:doc:`bond_style <bond_style>` *table* option with *keyword* as the
|
||||
section name. Each line written to the file lists an index number
|
||||
(1-N), a distance (in distance units), an energy (in energy units),
|
||||
and a force (in force units). In case a new file is created, the first
|
||||
line will be a comment with a "DATE:" and "UNITS:" tag with the current
|
||||
date and :doc:`units <units>` settings. For subsequent invocations of
|
||||
the bond_write command for the same file, data will be appended and the
|
||||
current units settings will be compared to the data from the header, if
|
||||
present, and bond_write will refuse to add a table if the units are not
|
||||
the same.
|
||||
The file is written in the format used as input for the :doc:`bond_style
|
||||
table <bond_table>` option with *keyword* as the section name. Each
|
||||
line written to the file lists an index number (1-N), a distance (in
|
||||
distance units), an energy (in energy units), and a force (in force
|
||||
units). In case a new file is created, the first line will be a comment
|
||||
with a "DATE:" and "UNITS:" tag with the current date and :doc:`units
|
||||
<units>` settings. For subsequent invocations of the *bond_write*
|
||||
command for the same file, data will be appended and the current units
|
||||
settings will be compared to the data from the header, if present. The
|
||||
*bond_write* command will refuse to add a table to an existing file if
|
||||
the units are not the same.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -8,7 +8,10 @@ Syntax
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
bond_style zero [nocoeff]
|
||||
bond_style zero keyword
|
||||
|
||||
* zero or more keywords may be appended
|
||||
* keyword = *nocoeff*
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -6,7 +6,7 @@ boundary command
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
boundary x y z
|
||||
|
||||
|
||||
@ -6,32 +6,33 @@ clear command
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
clear
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
(commands for 1st simulation)
|
||||
# (commands for 1st simulation)
|
||||
clear
|
||||
(commands for 2nd simulation)
|
||||
# (commands for 2nd simulation)
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
This command deletes all atoms, restores all settings to their default
|
||||
values, and frees all memory allocated by LAMMPS. Once a clear
|
||||
command has been executed, it is almost as if LAMMPS were starting
|
||||
over, with only the exceptions noted below. This command enables
|
||||
multiple jobs to be run sequentially from one input script.
|
||||
values, and frees all memory allocated by LAMMPS. Once a clear command
|
||||
has been executed, it is almost as if LAMMPS were starting over, with
|
||||
only the exceptions noted below. This command enables multiple jobs to
|
||||
be run sequentially from one input script.
|
||||
|
||||
These settings are not affected by a clear command: the working
|
||||
directory (:doc:`shell <shell>` command), log file status
|
||||
(:doc:`log <log>` command), echo status (:doc:`echo <echo>` command), and
|
||||
input script variables (:doc:`variable <variable>` command).
|
||||
directory (:doc:`shell <shell>` command), log file status (:doc:`log
|
||||
<log>` command), echo status (:doc:`echo <echo>` command), and input
|
||||
script variables except for *atomfile* style variables (:doc:`variable
|
||||
<variable>` command).
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -32,10 +32,9 @@ The "damage" of a Peridynamics particles is based on the bond breakage
|
||||
between the particle and its neighbors. If all the bonds are broken
|
||||
the particle is considered to be fully damaged.
|
||||
|
||||
See the `PDLAMMPS user guide
|
||||
<https://download.lammps.org/pdfs/PDLAMMPS_user_guide.pdf>`_ for a
|
||||
formal definition of "damage" and more details about Peridynamics as it
|
||||
is implemented in LAMMPS.
|
||||
See the :doc:`Peridynamics Howto <Howto_peri>` for a formal definition
|
||||
of "damage" and more details about Peridynamics as it is implemented in
|
||||
LAMMPS.
|
||||
|
||||
This command can be used with all the Peridynamic pair styles.
|
||||
|
||||
@ -50,13 +49,14 @@ any command that uses per-atom values from a compute as input. See
|
||||
the :doc:`Howto output <Howto_output>` page for an overview of
|
||||
LAMMPS output options.
|
||||
|
||||
The per-atom vector values are unitless numbers (damage) >= 0.0.
|
||||
The per-atom vector values are unitless numbers (damage) :math:`\ge 0.0`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the PERI package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
This compute is part of the PERI package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -35,12 +35,12 @@ The dilatation :math:`\theta` for each peridynamic particle :math:`i` is
|
||||
calculated as a sum over its neighbors with unbroken bonds, where the
|
||||
contribution of the :math:`ij` pair is a function of the change in bond
|
||||
length (versus the initial length in the reference state), the volume
|
||||
fraction of the particles and an influence function. See the `PDLAMMPS
|
||||
user guide <https://download.lammps.org/pdfs/PDLAMMPS_user_guide.pdf>`_
|
||||
for a formal definition of dilatation.
|
||||
fraction of the particles and an influence function. See the
|
||||
:doc:`Peridynamics Howto <Howto_peri>` for a formal definition of
|
||||
dilatation.
|
||||
|
||||
This command can only be used with a subset of the Peridynamic
|
||||
:doc:`pair styles <pair_peri>`: peri/lps, peri/ves and peri/eps.
|
||||
:doc:`pair styles <pair_peri>`: *peri/lps*, *peri/ves*, and *peri/eps*.
|
||||
|
||||
The dilatation value will be 0.0 for atoms not in the specified
|
||||
compute group.
|
||||
@ -53,7 +53,7 @@ any command that uses per-atom values from a compute as input. See
|
||||
the :doc:`Howto output <Howto_output>` page for an overview of
|
||||
LAMMPS output options.
|
||||
|
||||
The per-atom vector values are unitless numbers (theta) >= 0.0.
|
||||
The per-atom vector values are unitless numbers :math:`(\theta \ge 0.0)`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -120,6 +120,13 @@ best effect:
|
||||
|
||||
----------
|
||||
|
||||
Suitable tables in the correct format for use with these pair styles can
|
||||
be created by LAMMPS itself using the :doc:`pair_write <pair_write>`
|
||||
command. In combination with the :doc:`pair style python <pair_python>`
|
||||
this can be a powerful mechanism to implement and test tables for use
|
||||
with LAMMPS. Another option to generate tables is the Python code in
|
||||
the ``tools/tabulate`` folder of the LAMMPS source code distribution.
|
||||
|
||||
The format of a tabulated file has an (optional) header followed by a
|
||||
series of one or more sections, defined as follows (without the
|
||||
parenthesized comments). The header must start with a `#` character
|
||||
|
||||
@ -12,7 +12,7 @@ from sphinx.locale import _
|
||||
from sphinx.util.logging import getLogger
|
||||
|
||||
|
||||
__version__ = '1.0.0'
|
||||
__version__ = '1.1.1'
|
||||
__version_full__ = __version__
|
||||
|
||||
logger = getLogger(__name__)
|
||||
@ -31,6 +31,12 @@ def config_initiated(app, config):
|
||||
_('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
|
||||
)
|
||||
|
||||
|
||||
def extend_html_context(app, pagename, templatename, context, doctree):
|
||||
# Add ``sphinx_version_info`` tuple for use in Jinja templates
|
||||
context['sphinx_version_info'] = sphinx_version
|
||||
|
||||
|
||||
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
|
||||
def setup(app):
|
||||
if python_version[0] < 3:
|
||||
@ -60,4 +66,7 @@ def setup(app):
|
||||
else:
|
||||
app.config.html_add_permalinks = "\uf0c1"
|
||||
|
||||
# Extend the default context when rendering the templates.
|
||||
app.connect("html-page-context", extend_html_context)
|
||||
|
||||
return {'parallel_read_safe': True, 'parallel_write_safe': True}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
{%- set readthedocs_web = '<a href="https://readthedocs.org">Read the Docs</a>' %}
|
||||
{#- Translators: the variable "sphinx_web" is a link to the Sphinx project documentation with the text "Sphinx" #}
|
||||
{%- trans sphinx_web=sphinx_web, readthedocs_web=readthedocs_web %}Built with {{ sphinx_web }} using a{% endtrans %}
|
||||
{#- Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documenation #}
|
||||
{#- Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documentation #}
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">{% trans %}theme{% endtrans %}</a>
|
||||
{#- Translators: this is always used as "provided by Read the Docs", and should not imply Read the Docs is an author of the generated documentation. #}
|
||||
{% trans %}provided by {{ readthedocs_web }}{% endtrans %}.
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%}
|
||||
|
||||
{# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
|
||||
{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
|
||||
{%- set sphinx_version_info = (_ver_major, _ver_minor, _ver_bugfix) -%}
|
||||
{%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%}
|
||||
{%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" >
|
||||
@ -64,10 +64,6 @@
|
||||
<!--[if lt IE 9]>
|
||||
<script src="{{ pathto('_static/js/html5shiv.min.js', 1) }}"></script>
|
||||
<![endif]-->
|
||||
|
||||
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
|
||||
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
|
||||
|
||||
{%- if not embedded %}
|
||||
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
|
||||
{%- if sphinx_version_info >= (1, 8) -%}
|
||||
|
||||
Binary file not shown.
@ -11,14 +11,14 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2021-09-13 13:35-0600\n"
|
||||
"POT-Creation-Date: 2022-11-04 12:02-0700\n"
|
||||
"PO-Revision-Date: 2019-07-16 21:44+0000\n"
|
||||
"Last-Translator: Tom Kunze <transifex.com@tomabrafix.de>, 2019\n"
|
||||
"Language-Team: German (https://www.transifex.com/readthedocs/teams/101354/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.8.0\n"
|
||||
"Generated-By: Babel 2.10.1\n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user