Compare commits

...

1225 Commits

Author SHA1 Message Date
01bbb28418 Merge pull request #3135 from akohlmey/next_patch_release
Step version strings for the next patch release
2022-02-17 15:05:43 -05:00
7fe194e59e Merge pull request #3136 from rbberger/collected-small-changes
Collected small changes
2022-02-17 13:20:51 -05:00
f3e14e7b00 Mark MolPairStyle:soft unstable 2022-02-17 12:58:30 -05:00
45b92e519d Merge pull request #3125 from oywg11/ilp-for-tmds
Anisotropic Interlayer potential for TMDs and Metal Surfaces
2022-02-17 11:42:15 -05:00
d95f0b3cd5 Adjust epsilon in force-style test 2022-02-16 17:43:16 -05:00
793d76c546 Adjust epsilon in force-style tests 2022-02-16 17:40:34 -05:00
12eeaee8a4 Correct bug in PairHybridScaled::single 2022-02-16 13:48:10 -05:00
8b627f92f0 address spelling and achor issues, and integrate into style overview tables 2022-02-16 08:10:29 -05:00
78b123fa4d apply new convention for virtual functions and disable single() functions (for now) 2022-02-16 06:50:26 -05:00
47bb5f5ccd use a local std::map with initializer to have variant specific strings 2022-02-16 06:36:17 -05:00
e541f006eb replace copies of files with symbolic links 2022-02-16 06:34:31 -05:00
08968cbdbf apply clang-format 2022-02-16 06:14:19 -05:00
32cde04000 Merge branch 'develop' into ilp-for-tmds 2022-02-16 06:04:34 -05:00
6d2f4343d9 Merge pull request #3133 from stanmoore1/kk_error
Add error if using multiple threads with Kokkos Serial backend
2022-02-15 22:25:04 -05:00
a7939b582a step version strings for the next patch release 2022-02-15 22:10:06 -05:00
2951eb32a4 Merge pull request #3134 from rbberger/collected-small-changes
Collected small changes
2022-02-15 22:05:48 -05:00
55703f9027 update class instantiation unit test for kokkos to adapt to thread availability 2022-02-15 21:54:21 -05:00
d4bbb31270 Improve error check 2022-02-15 16:04:23 -07:00
f53fbf09a6 Fix memory leak in FixBondReact 2022-02-15 15:51:48 -05:00
f3c055e637 Undo change that forces BUILD_SHARED_LIBS=off 2022-02-15 14:53:18 -05:00
d9e06e326a Merge branch 'develop' of github.com:lammps/lammps into kk_error 2022-02-15 12:11:52 -07:00
c2d59d5d5e Add error if using multiple threads with Kokkos Serial backend 2022-02-15 11:52:59 -07:00
e3222a4bd0 Merge pull request #3126 from Bibobu/EAM_alloy_python_script
Added Python version of Zhou04_create_v2.f in eam_database
2022-02-14 19:48:51 -05:00
618b3ec94f Merge pull request #3131 from akohlmey/lammps-cxx-style
More general LAMMPS code design info for the Programmer guide section of the manual
2022-02-14 18:13:32 -05:00
9a200c9b79 small tweaks 2022-02-14 18:07:29 -05:00
c46dd3675a add Cr parameters to python database file 2022-02-14 18:06:48 -05:00
b0c0251154 delete unwanted files 2022-02-14 18:06:24 -05:00
c65dbd338b change create_eam.py so it can be called as a function from another script 2022-02-14 17:44:33 -05:00
702a2dd3f6 Merge pull request #3130 from akohlmey/iwyu-update
Update list of include statements based on the IWYU utility
2022-02-14 17:25:32 -05:00
5f47ff770c Merge pull request #3127 from akohlmey/gpu-opencl-updates
Update compiling OpenCL loader lib
2022-02-14 16:10:53 -05:00
baf443766a fix a few typos or mistyped words and explain some details better 2022-02-14 16:09:52 -05:00
f84790ba62 add a more specific example to explain how values are rejected and how atoi() fails 2022-02-14 15:52:33 -05:00
8431d72d75 Added a test directory to tools/eam_database 2022-02-14 21:29:51 +01:00
5366621947 Merge pull request #3129 from ndtrung81/sw-hybrid-gpu
Fixed a bug with sw/gpu neigh no when used with pair hybrid for systems with multiple atom types
2022-02-14 14:21:52 -05:00
f4ce0f0b1c Merge pull request #3101 from rbberger/python_use_setuptools
Use setuptools instead of distutils in setup.py
2022-02-14 13:47:46 -05:00
37cd4ba2ea spelling 2022-02-14 11:55:09 -05:00
1a436c5aa9 fix some broken links 2022-02-14 11:55:04 -05:00
fbf95c2cbc add notes about file parsing 2022-02-14 11:54:50 -05:00
1a6b627fa0 add section about memory allocations 2022-02-14 11:54:37 -05:00
12f746046f finalize {fmt} lib info 2022-02-14 08:45:55 -05:00
3bc91386a0 apply include statement updates suggested by running IWYU 2022-02-13 19:39:15 -05:00
1307371942 update/correct iwyu additional mappings 2022-02-13 18:20:12 -05:00
b42aebc197 silence compiler warnings 2022-02-13 18:19:50 -05:00
83beffbb9f whitespace 2022-02-13 17:08:18 -05:00
810717bfe5 discuss stdio vs iostreams and fmtlib 2022-02-13 16:01:27 -05:00
1ab5b9d7fd re-sort list of false poisitives alphabetically with "sort" 2022-02-13 16:01:26 -05:00
1c7e1faeff add sections on inheritance, compositing, polymorphism 2022-02-13 16:01:14 -05:00
6887a16fa1 start add general code design doc. 2022-02-13 16:00:51 -05:00
193dea6327 Updated the comment to be precise on the case 2022-02-13 14:51:00 -06:00
159f107abd Corrected the added comment 2022-02-13 11:16:01 -06:00
bae4e45978 Added a comment to the added check while looping over the neighbors of ghost atoms 2022-02-13 09:17:05 -06:00
9d518ee1e2 must ensure that BUILD_SHARED_LIBS retains its original value 2022-02-13 10:00:19 -05:00
55a500cf8a Fixed bugs with in the kernel sw_three_end kernel 2022-02-13 00:42:26 -06:00
4eedfeb774 detect if LAMMPS library initialization failed and raise an exception 2022-02-12 22:43:18 -05:00
78d149f118 update to download improved loader sources that make installing optional 2022-02-12 13:21:10 -05:00
d85788305d update manual 2022-02-12 10:37:09 -05:00
4343e8194c update README file 2022-02-12 10:20:49 -05:00
096ea21dd9 correct potential file output header (must have 3 comment lines) 2022-02-12 10:14:09 -05:00
8808b11d26 must write out 3 lines of comment in fortran code. sync output style with python 2022-02-12 10:04:24 -05:00
2fdadcfeb6 include UNITS: metadata tag 2022-02-12 10:01:20 -05:00
0113346e54 apply some pylint recommendations 2022-02-12 10:01:01 -05:00
3cca41b72e print help without arguments. clarify help message and argument names text 2022-02-12 09:38:05 -05:00
69d3b1ebf3 output files are now named .eam.alloy 2022-02-12 09:37:23 -05:00
0f5fbf1c42 update citation info format 2022-02-12 09:36:53 -05:00
06d4bb3faf set date dynamically 2022-02-12 09:33:37 -05:00
e9b11e3673 Added Python version of Zhou04_create_v2.f: create_eam.py and eamDatabase.py in tools/eam_database 2022-02-12 12:42:54 +01:00
a77680ac7b Merge branch 'develop' into python_use_setuptools
# Conflicts:
#	cmake/CMakeLists.txt
2022-02-12 00:37:03 -05:00
99c1b935b5 convert OpenCL loader build from ExternalProject_add to ExternalCMakeProject 2022-02-11 23:49:08 -05:00
eb2fe7d982 correct inconsistent prototypes 2022-02-11 23:37:40 -05:00
75dc7125e6 Update doc of pair sw/mod 2022-02-12 06:12:12 +02:00
e5dec93a1e Update doc of pair ilp/graphene/hbn 2022-02-12 06:09:29 +02:00
922b240678 Interlayer Potential for TMDs and Metal Surfaces 2022-02-12 06:05:11 +02:00
a5fe8b0581 update OpenCL loader to latest OpenCL spec sources 2022-02-11 22:01:04 -05:00
a17bdf5652 silence compiler warnings and avoid infinite recursion in aspherical pair styles 2022-02-11 21:06:16 -05:00
81587527fe Merge pull request #3120 from rbberger/collected_small_changes
Collected small changes
2022-02-11 20:26:10 -05:00
de08307aba Merge pull request #3124 from akohlmey/hide-factory-symbols
Reduce number of visible symbols in LAMMPS library by removing factory function templates from class definition
2022-02-11 20:23:52 -05:00
54f975ff52 Merge pull request #3123 from stanmoore1/reax_error
Remove incorrect error check in ReaxFF
2022-02-11 19:34:53 -05:00
df02598fc1 convert one more factory template 2022-02-11 18:38:36 -05:00
6a0e93a18a convert more style_creators to use local static functions 2022-02-11 18:29:52 -05:00
5ab9b46b67 enable and apply clang-format 2022-02-11 18:04:46 -05:00
a4244eb7ff apply simplification suggested by @rbberger 2022-02-11 17:57:30 -05:00
04cff0b47b remove make factory function templates from class and make them static functions 2022-02-11 16:00:12 -05:00
a8dbb3a172 Remove incorrect error check in ReaxFF 2022-02-11 13:39:24 -07:00
ea94095bf6 Change email in docs 2022-02-11 12:51:47 -05:00
ecd072a286 address spelling issues 2022-02-11 09:03:59 -05:00
1f6c4089bd remove some more dead code in CG-DNA package 2022-02-11 07:41:09 -05:00
d750ef4890 simplify 2022-02-10 20:39:36 -05:00
c32dca2009 avoid failures with "most" presets 2022-02-10 20:11:27 -05:00
4ea4bee30c apply virtual and override keywords consistently 2022-02-10 16:55:35 -05:00
61ff5250ee add extra communication of special neighbors when using angle constraints 2022-02-10 16:17:56 -05:00
e94854d54f always initialize arrays with extra grid points for non-periodic to support switching with change_box 2022-02-10 15:57:41 -05:00
9b1a267d85 fix another memory grid deallocation bug. delete before number of levels changes 2022-02-10 15:32:07 -05:00
ab1e68eb42 fix memory access bug with changing box volume/grid 2022-02-10 14:41:25 -05:00
4d5bb08ead make searching for python interpreter and development version futureproof and more consistent 2022-02-10 14:41:25 -05:00
60d03f34cc update create.f with changes from NIST database
also add parameters for Cr and document in README file and change
the code to create output files with .eam.alloy extension
2022-02-10 14:41:25 -05:00
6366972ef4 remove dead code and reduce compiler warnings
# Conflicts:
#	src/RIGID/fix_rigid_small.cpp
2022-02-10 14:41:09 -05:00
44ded1c1fe Reorder fields init in IntelBuffer ctor 2022-02-10 14:19:51 -05:00
df00d2225a Remove unused variable 2022-02-10 14:13:55 -05:00
75f32a60a5 Add missing curly braces 2022-02-10 14:13:43 -05:00
c2ef4425c6 Update doc/utils/check-styles.py 2022-02-10 12:02:23 -05:00
08b16f1f23 Prevent GTest and GMock from being installed 2022-02-10 11:27:32 -05:00
a17a45c761 Fix large number of sign-compare warnings 2022-02-10 11:19:13 -05:00
ce83ca1efd Merge pull request #3117 from akohlmey/collected-small-changes
Collected small changes
2022-02-08 20:21:46 -05:00
861195130c incorporate suggested changes to github action from @rbberger 2022-02-08 12:08:28 -05:00
75727ed5af comment out minimal run test outside of CMake/CTest 2022-02-07 20:52:12 -05:00
8e2581042e remove unused local variables 2022-02-07 20:30:36 -05:00
b01716472b Merge branch 'develop' into collected-small-changes 2022-02-07 19:59:10 -05:00
b75c306543 Merge pull request #3035 from rbberger/kokkos_unittests
Add force style tests for Kokkos OpenMP
2022-02-07 19:57:09 -05:00
2445f85dde Merge branch 'develop' into collected-small-changes 2022-02-07 17:08:03 -05:00
044ada9f2b update googletest library to current snapshot 2022-02-07 16:46:32 -05:00
e4b5245f4d Merge pull request #3116 from akohlmey/build-kokkos-staticlib
Build KOKKOS package updates for Python module and Windows compatibility
2022-02-07 16:36:46 -05:00
35a4c0f501 skip tests that fail with Kokkos+OpenMP 2022-02-07 16:15:32 -05:00
2dfeb96fda Merge pull request #3115 from rbberger/pylammps_update
PyLammps update
2022-02-07 15:09:10 -05:00
093c54d8ed update to use settings from upstream 2022-02-07 14:42:07 -05:00
a7084c8fdb Merge remote-tracking branch 'origin/develop' into kokkos_unittests 2022-02-07 13:04:59 -05:00
2548c49876 use fmtlib for formatted output 2022-02-05 17:01:47 -05:00
8209ae9513 fix optional argument parsing bug 2022-02-05 17:01:13 -05:00
59def25eb6 tweak test epsilon for portability 2022-02-05 16:08:43 -05:00
d91c1ff1f0 Merge pull request #3110 from stanmoore1/dump_balance
Fix issue in new dump balance command
2022-02-05 15:56:17 -05:00
a2ff443838 Use utils::flush_buffers() in error.cpp and thermo.cpp 2022-02-04 18:00:47 -05:00
bae6526b5f Add missing doc entry 2022-02-04 17:55:37 -05:00
50a7d4e7fc Add utils::flush_buffers() 2022-02-04 17:53:36 -05:00
ea0f31c997 Update SWIG library interface 2022-02-04 17:43:17 -05:00
f45663bfc2 Simplify loop structure to fix issues 2022-02-04 11:45:28 -08:00
0ff3ee0227 Add and use lammps_flush_buffers() in Python interface 2022-02-04 10:42:22 -05:00
293d529ee9 Add lammps_flush_buffers() library function 2022-02-04 10:40:05 -05:00
c0bae49956 simplify with new API and address coverity scan warning 2022-02-04 07:28:59 -05:00
c0ee491f18 protect unconditional "#pragma GCC" with if defined(__GNUC__) 2022-02-03 19:47:52 -05:00
6edb50b405 Force Python version in GH MSVC test 2022-02-03 18:08:17 -05:00
9bfd6375eb avoid triggering bogus make file target errors 2022-02-03 18:00:34 -05:00
7d0b4cc131 make portable to cross-compiler 2022-02-03 18:00:12 -05:00
8fbaaffd3e remove incorrect scope 2022-02-03 17:16:20 -05:00
2137ad04fd remove non-portable custom (and unused) profiling support code 2022-02-03 17:13:10 -05:00
a56922edc9 include PYTHON package in windows test build 2022-02-03 16:55:26 -05:00
75f389f70c Enable PyLammps unit test, require NumPy 2022-02-03 16:24:43 -05:00
22efbaf977 Output Capture has to replace FD 1 to work properly in Jupyter 2022-02-03 16:24:43 -05:00
050ce421e9 PyLammps: alternative OutputCapture using tempfiles 2022-02-03 16:24:43 -05:00
f804ea89b9 skip force test requiring cp command 2022-02-03 16:13:07 -05:00
2a7823686d use introspection to check for Kokkos::OpenMP only when it is enabled 2022-02-03 16:08:00 -05:00
6bfb7a5521 require OpenMP 4 or later for KOKKOS with OpenMP enabled 2022-02-03 16:07:33 -05:00
f550460ecd Update CMakeSettings.json 2022-02-03 15:44:55 -05:00
36c1db820f Add command styles to PyLammps auto-completion 2022-02-03 15:44:55 -05:00
41da32d7de Use modernized LAMMPS Python interface instead of output parsing for Atom properties 2022-02-03 15:44:55 -05:00
3ba85bc68d replace VLA with explicit new/delete 2022-02-03 15:23:09 -05:00
2627e404b0 Add csforce field to numpy_wrapper detection 2022-02-03 15:14:22 -05:00
c6a17b900e just call exit() on windows instead forwarding the SEGV signal 2022-02-03 13:31:24 -05:00
b7b7a74c52 when building KOKKOS as part of the LAMMPS build, always build static libs 2022-02-03 12:23:25 -05:00
82ac7c9e12 Merge remote-tracking branch 'origin/develop' into python_use_setuptools 2022-02-02 11:47:13 -05:00
efcb402fdc Merge pull request #3111 from stanmoore1/kk_compile
Changes needed to compile LAMMPS with Kokkos upstream
2022-02-02 11:45:55 -05:00
d9c51ca124 Make sure LAMMPS and unit tests use same Python version 2022-02-02 11:44:25 -05:00
172f88a0d5 Merge pull request #3104 from ohenrich/cg-dna
CG-DNA unit test and performance enhancement
2022-02-01 18:30:13 -05:00
8f07289ed7 Changes needed to compile LAMMPS with latest Kokkos develop 2022-02-01 15:00:40 -07:00
e15ca1eeef Fix bug in dump balance 2022-02-01 10:23:25 -08:00
76c57d54c1 Merge pull request #3102 from akohlmey/mpi-stubs-simplify
Porting unit tests to run natively on Windows
2022-01-31 21:37:48 -05:00
705bfc10a1 Merge pull request #3100 from rbberger/kokkos_cleanup
Refactor some declarations in KOKKOS package
2022-01-31 19:35:55 -05:00
91614b64d2 Update from upstream 2022-01-31 15:42:05 -07:00
a6a2492282 Merge pull request #3082 from stanmoore1/reax_count
Improve PairReaxFFKokkos neigh list algorithm
2022-01-31 17:26:25 -05:00
b2916339a4 Add NeedDup_v and AtomicDup_v helpers to KOKKOS 2022-01-31 13:42:03 -05:00
a124ee4f44 Merge pull request #2233 from charlessievers/OptimizedDynamicalMatrix
Dynamical_matrix and third_order features+update
2022-01-31 12:57:28 -05:00
dd416f61b5 Rename function to avoid warning 2022-01-31 10:47:56 -07:00
cfd720e1fc Remove another volatile return type to avoid warning 2022-01-31 09:58:44 -07:00
5d28d06a3c Fix compiler warning 2022-01-31 09:47:32 -07:00
f537a31c19 Unify comment style 2022-01-31 09:25:25 -07:00
5142d8e968 Merge remote-tracking branch 'origin/develop' into kokkos_cleanup 2022-01-31 11:04:41 -05:00
9a81dc58a1 Merge remote-tracking branch 'origin/develop' into kokkos_unittests 2022-01-31 11:04:18 -05:00
d80ba0d57a Merge branch 'develop' into mpi-stubs-simplify 2022-01-30 17:19:26 -05:00
7ee7d0c570 apply clang-format 2022-01-30 17:18:40 -05:00
3707b327c0 improve portability of python result value string conversion 2022-01-30 16:52:38 -05:00
a8a76dbbe2 port python module and package tests to be windows compatible. refactor environment processing 2022-01-30 16:48:47 -05:00
2e39971cbc re-enable python module tests on windows 2022-01-30 16:48:11 -05:00
579ac61b5b refactor environment variable settings. make windows compatible 2022-01-30 16:47:52 -05:00
fea41d5458 make windows compatible 2022-01-30 16:47:17 -05:00
af8d1bd768 fix typo 2022-01-30 09:00:39 -05:00
65b198f986 Revert "temporarily switch repo and branch to run on"
This reverts commit 213259b732.
2022-01-30 08:48:52 -05:00
4b22962ec1 roll back MPI target alias change one more time. must wait until CMake 3.11 or later is minimum 2022-01-30 08:47:46 -05:00
f8a4006da7 must promote imported target to global scope in order to be able to alias it 2022-01-30 08:32:21 -05:00
dc0e013297 create alias target MPI::ANY_CXX to be used instead of MPI::MPI_CXX
With this alias it is possible to transparently refer to either the
real imported MPI library or to the MPI stub library. this further
reduced the need for if statements related to MPI. Some uses of
MPI::MPI_CXX remain but they are all in branches of the script code
where BUILD_MPI is enabled and thus the imported target will be present.
2022-01-30 07:48:16 -05:00
99cb494594 remove automatic generated tag 2022-01-30 07:08:15 -05:00
b17d8b4494 add building and running unit tests 2022-01-30 05:54:35 -05:00
213259b732 temporarily switch repo and branch to run on 2022-01-30 05:54:21 -05:00
4bb7457d6e add option to allow skipping tests by setting a no${CMAKE_SYSTEM_NAME} tag 2022-01-30 05:14:57 -05:00
923b0cfc46 allow to override the LAMMPS dll location on windows
this is to work around the situation that windows
has no equivalent to LD_LIBRARY_PATH (short of augmenting %PATH%,
which is tricky for CMake before 3.20)
2022-01-30 05:13:17 -05:00
a8632d5cb6 always have the lib prefix on the LAMMPS library (windows may drop it on the .dll file) 2022-01-30 05:11:32 -05:00
ebeb29adf6 skip python folder tests for now on windows 2022-01-29 21:34:51 -05:00
6ff157a099 use quoting to avoid issues with blanks and special characters 2022-01-29 21:05:19 -05:00
33be5ff0b4 allow that the include command may have quoted arguments with variables 2022-01-29 21:04:59 -05:00
cc0d91b222 re-add copies of linked files 2022-01-29 21:01:49 -05:00
571821694e remove links broken on windows 2022-01-29 21:01:35 -05:00
02cadf1b71 port to windows where text file reading may gobble up carriage returns 2022-01-29 20:53:17 -05:00
6c98915a9c port to windows 2022-01-29 20:52:37 -05:00
0bfc5269dd fix mismatches causing failures on windows 2022-01-29 20:52:25 -05:00
9014664c13 really fix unit test regexes for windows 2022-01-29 19:07:35 -05:00
c420f804d9 make multi-line regex checks compatible with googletests Windows regex syntax 2022-01-29 18:52:49 -05:00
a1d186b5fa Merge pull request #3105 from athomps/numdiff-stress
Add new numdiff/virial fix style
2022-01-29 18:37:57 -05:00
cd5d1f8a30 reformat 2022-01-29 18:13:01 -05:00
9323a09b39 reduce number of reported memory leaks with google test death tests 2022-01-29 18:12:53 -05:00
c464c40d67 avoid accessing uninitialized data and triggering bogus memcheck output 2022-01-29 18:12:15 -05:00
7b3adb3f1a must always initialize jtag 2022-01-29 17:09:40 -05:00
c9de8fca1d silence compiler warnings 2022-01-29 17:07:00 -05:00
75d0a5098f use -Og for Debug config for better warnings and debug experience 2022-01-29 17:06:30 -05:00
bd4814a51e don't cache OUTPUT_DIRECTORY variable settings but set them every time 2022-01-29 16:37:40 -05:00
845ab2dd71 On Windows the Regex matcher for '.' does not match '\n'
Thus we have to use ContainsRegex instead of MatchesRegex
2022-01-29 16:35:30 -05:00
d62e25decc don't specify default working directory for tests explicitly 2022-01-29 11:10:23 -05:00
dad72a612a correct statement (PPPM **does** support triclinic for a while already) 2022-01-29 08:18:08 -05:00
481bcfcd14 spelling 2022-01-29 08:12:28 -05:00
ee98f023b6 enable and apply clang-format 2022-01-29 08:02:59 -05:00
17960c8183 use constexpr instead of const 2022-01-29 07:56:11 -05:00
9427eb800f add missing "override" 2022-01-29 07:55:58 -05:00
c1185acad7 enable and apply clang-format 2022-01-29 07:52:06 -05:00
d6fa3a08cd roll back library aliasing changes as that negatively interferes with unit tests 2022-01-28 21:54:32 -05:00
8423ecb211 small tweaks to make things work with the new settings 2022-01-28 21:28:37 -05:00
7978bf671d use canonical syntax for adding tests 2022-01-28 21:12:13 -05:00
5c0c3df035 make use of CMAKE_(RUNTIME|LIBRARY)_OUTPUT_DIRECTORY 2022-01-28 21:10:30 -05:00
fbecf0051e Merge remote-tracking branch 'upstream/develop' into numdiff-stress 2022-01-28 18:36:27 -07:00
a9481733a0 Finished debugging, testing, documenting 2022-01-28 18:34:30 -07:00
c28b7c586a Residual Merge Conflict 2022-01-28 14:59:07 -08:00
6258cf1b9d Fixed merge conflict 2022-01-28 14:49:13 -08:00
e8ce01079d whitespace 2022-01-28 17:20:32 -05:00
f6d0be1257 avoid integer overflow due to precedence 2022-01-28 17:08:16 -05:00
96502ae49d whitespace 2022-01-28 17:07:03 -05:00
1d51f2d151 must not access invalid/uninitialized data 2022-01-28 16:57:58 -05:00
2a3a7c387b Merge pull request #3103 from tc387/CR-update
fixed ewald self-energy update and updated documentation
2022-01-28 16:37:11 -05:00
e5b129fe8d Grow exponentially to resize less 2022-01-28 13:35:09 -07:00
41c1c64be9 Merged with deveop branch 2022-01-28 20:27:38 +00:00
e76c8bbaa3 spelling 2022-01-28 14:52:31 -05:00
4225c6c288 whitespace 2022-01-28 14:48:34 -05:00
9feec51590 Merge branch 'develop' of https://github.com/lammps/lammps into reax_count 2022-01-28 12:32:37 -07:00
d6a6f64576 Merge pull request #3090 from rbberger/modernize_use_override
Modernize to C++11: use override
2022-01-28 14:10:45 -05:00
17cb137f3e Merge branch 'master' into OptimizedDynamicalMatrix 2022-01-28 11:08:31 -08:00
bb89347bac Fixed kspace issue and added suggested runtime check for intel accelerator 2022-01-28 11:06:29 -08:00
7aa17fbdf7 Merge branch 'develop' of github.com:lammps/lammps into reax_count 2022-01-28 11:58:50 -07:00
d3c45d3389 Removed whitespace 2022-01-28 17:58:00 +00:00
ef96b51a25 Merge branch 'deform-rebuild-rigid' into mpi-stubs-simplify 2022-01-28 05:44:43 -05:00
db4e69bf38 further simplification by making STUBS an interface and alias to MPI::MPI_CXX 2022-01-28 01:00:37 -05:00
ac815fdfba use improved accessors for fixes 2022-01-27 22:16:43 -05:00
e4fe0a37a1 fixed ewald self-energy update and updated documentation 2022-01-27 16:48:22 -06:00
cd8b674f4b expand path to include LAMMPS shared lib 2022-01-27 17:46:18 -05:00
0bf941219f silence compiler warnings 2022-01-27 17:21:50 -05:00
d391ae845b convert static class members with git info to functions to simplify auto-export on Windows 2022-01-27 17:20:05 -05:00
265588d480 Reduce differences between original pair hybrid and kokkos variant 2022-01-27 16:14:46 -05:00
62ff23abe7 simplify building serial executables by incorporating the STUBS/mpi.o object in LAMMPS library 2022-01-27 15:59:48 -05:00
735d6926a1 Update to KK tersoff styles for consistent nofdotr
Inspired by f82096c46c
2022-01-27 14:36:45 -05:00
b3647d8e94 Add missing override keywords 2022-01-26 16:16:53 -05:00
a6ef114bfb Ensure both Python Interpreter and Development header version match 2022-01-26 15:27:36 -05:00
293f4eb0ed Add Python 3.10 to detection 2022-01-26 15:21:57 -05:00
2ed8e5cf02 Use setuptools instead of distutils in setup.py
distutils will be removed soon (Python 3.12)
2022-01-26 14:58:28 -05:00
415476983d Merge branch 'develop' into cg-dna 2022-01-26 19:31:48 +00:00
9b6bb00d07 Added unit test for atom_style oxdna 2022-01-26 19:20:34 +00:00
d51017ff50 Merge pull request #3095 from akohlmey/collect-small-changes
Collected small changes and fixes
2022-01-26 12:04:44 -05:00
d861dbe8e0 Remove unused variable 2022-01-26 11:37:53 -05:00
71a373cadb reshuffle Body struct members and add dummy for better alignment 2022-01-26 10:46:19 -05:00
8ca1004c03 cosmetic. align with clang-format 2022-01-26 10:45:46 -05:00
120662c438 correct citation info 2022-01-26 10:45:30 -05:00
cdd23ac9c2 Merge pull request #3097 from stanmoore1/dump_balance
Add option to balance dump file output
2022-01-25 15:53:38 -05:00
3297ed7c5f Refactor some declarations in KOKKOS package
Adds C++11 template helpers to shrink larger declarations.
2022-01-25 14:29:00 -05:00
75a00f4d11 minor cleanup 2022-01-25 08:52:53 -07:00
64dbce26dc Cannot shrink buf 2022-01-25 08:45:13 -07:00
35dbabd471 alternate fix for tag caching issue in INTEL package 2022-01-25 07:39:37 -05:00
0b693e729d Whitespace 2022-01-24 17:33:36 -07:00
c914fc6baf Small doc tweak 2022-01-24 16:33:11 -07:00
67af170929 Sorting is not required for balancing 2022-01-24 16:22:55 -07:00
cb9ba8c0a3 Simplify code 2022-01-24 16:05:27 -07:00
a80f7ed11f Add error message to header file 2022-01-24 15:32:20 -07:00
aeb25b5a37 Tweak docs 2022-01-24 15:28:40 -07:00
1d60e4c463 Add docs 2022-01-24 15:16:49 -07:00
16810b84eb Add option to balance dump file output 2022-01-24 14:35:27 -07:00
f9a2006d73 reorder includes 2022-01-24 08:44:29 -05:00
88dadd0fff consistently refer to INTEL package in upper case 2022-01-23 21:12:22 -05:00
cd16556256 add missing break statements.
@GenieTim this bug may have tainted your results. you would always get the energy value for any of the dx, dy, dz keywords
2022-01-22 17:13:54 -05:00
81e7583a8d initialize pointers, use provided constant, reorder include statements 2022-01-22 17:07:12 -05:00
f814dc5ff9 add checks after reading data 2022-01-22 17:06:28 -05:00
458ae4e38a initialize pointers, remove unused class member 2022-01-22 17:06:13 -05:00
d854e58d00 add sanity check 2022-01-22 16:51:07 -05:00
c93fba5e2d make certain that offset is always initialized 2022-01-22 16:45:38 -05:00
900ff39403 make consistent 2022-01-22 16:33:44 -05:00
7aed8954a5 Add paragraphs in Modify_style.rst 2022-01-22 11:03:44 -05:00
ef2969dfbf use override keyword in plugin sources 2022-01-22 10:30:58 -05:00
79a9829e92 Apply override to remaining classes 2022-01-22 09:56:01 -05:00
3e3cd4c94d Added correct units for pressure, still getting wrong answer 2022-01-21 19:46:54 -07:00
3286fcb13a Added correct units for pressure, still getting wrong answer 2022-01-21 19:29:23 -07:00
c16caea13b Fixed bounds error 2022-01-21 19:17:12 -07:00
384b715d8c First pass at fix numdiff/stress 2022-01-21 18:53:06 -07:00
12d708b97c Apply override to more classes 2022-01-21 18:24:06 -05:00
44bc766060 Apply override to more classes 2022-01-21 16:58:32 -05:00
06beb28d7d Apply override to Pair classes 2022-01-21 16:13:49 -05:00
6506be9409 update programming style 2022-01-21 15:56:58 -05:00
ff3f762499 Apply override to Fix classes 2022-01-21 14:45:53 -05:00
f83271aa40 Apply override to Compute classes 2022-01-21 13:23:36 -05:00
0d4bbf60e6 Apply override to Dihedral classes 2022-01-21 12:48:11 -05:00
57def1a2d5 output reformatting and refactoring 2022-01-21 11:26:55 -05:00
75d20c40ed remove threebody tag caching altogether since it is not reliable 2022-01-21 11:26:26 -05:00
3311b1344c consolidate pair-wise vs pairwise spelling 2022-01-21 10:48:35 -05:00
3a6bd2e698 update comment about pair_write restrictions 2022-01-21 10:47:49 -05:00
67dec40afa make certain pointers are initialized 2022-01-21 06:55:20 -05:00
9c8431bf87 correct calls to memset() 2022-01-21 06:55:06 -05:00
557e25d6fb Apply override to Bond classes 2022-01-20 18:00:16 -05:00
4e89488f27 Apply override to Angle classes 2022-01-20 17:53:38 -05:00
d4ec931991 Apply override to FileReader classes 2022-01-20 17:49:23 -05:00
7387643b87 Apply override to Improper classes 2022-01-20 17:36:43 -05:00
5e37f9d5a7 Apply override to KSpace classes 2022-01-20 17:14:33 -05:00
586cf6c3bf Apply override to Dump classes 2022-01-20 16:58:23 -05:00
e73158bd7e whitespace/formatting 2022-01-20 16:56:12 -05:00
4104353d7a plug memory leak 2022-01-20 16:55:59 -05:00
49dca516ea simplify API of Force::store_style() 2022-01-20 16:48:44 -05:00
7c9b0c1e8e Apply override to more core classes 2022-01-20 16:43:04 -05:00
5c62dc0986 Apply override to Comm classes 2022-01-20 16:39:36 -05:00
c9776dad6f Apply override to Command classes 2022-01-20 16:35:59 -05:00
dbe267cb88 join lines, whitespace 2022-01-20 16:04:26 -05:00
0b24c5b498 workaround for segfaults due to NULL pointer dereference with hybrid styles 2022-01-20 16:04:07 -05:00
06cb86dfb9 Apply override to NTopo classes 2022-01-20 15:53:01 -05:00
7aaa85c3a1 Apply override to NBin classes 2022-01-20 15:44:16 -05:00
32a19d982a Apply override to NStencil classes 2022-01-20 15:37:15 -05:00
222ea31d8d Remove override = default destructor lines 2022-01-20 15:28:47 -05:00
7ee3171d16 Apply override to NPair classes 2022-01-19 21:51:21 -05:00
b45a6d7720 Apply override to AtomVec classes 2022-01-19 17:31:41 -05:00
a0e2a617e0 Merge pull request #3092 from stanmoore1/kk_makefiles
Small tweaks to Kokkos Files
2022-01-19 16:06:42 -05:00
9d8394fe63 Apply override to text_file_reader.h 2022-01-19 14:45:32 -05:00
c166549c74 Apply override to KOKKOS classes up to this point 2022-01-19 14:26:25 -05:00
b8d4030983 Update more core class destructors 2022-01-19 13:27:08 -05:00
e283bfa1fa Apply override to Minimize classes 2022-01-19 13:23:28 -05:00
b7dc1d9dd6 Merge pull request #3091 from akohlmey/more-parsing-refactor
More file parsing refactoring
2022-01-19 12:41:13 -05:00
6e8d9cb532 Port bugfix in Kokkos 2022-01-19 10:27:02 -07:00
0a8cbcef2b Add -DNDEBUG to Kokkos Makefiles 2022-01-19 10:19:50 -07:00
0a89e5bd24 Remove non-ASCII chars 2022-01-19 10:18:25 -07:00
4f0cde40fd White no longer exists 2022-01-19 10:16:53 -07:00
4cd5c40374 Merge pull request #3089 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-01-19 11:44:33 -05:00
7573e60a1e Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-01-19 10:21:12 -05:00
c85cdb2732 always fall back to using the .so extension if available in the LAMMPS module folder 2022-01-19 10:11:16 -05:00
7676f66674 modernize potential file parsing 2022-01-19 06:29:27 -05:00
f5ad91f9fe minor tweaks 2022-01-19 06:28:53 -05:00
0595e4d7cd refactor parsing of pair style list parameter file 2022-01-19 00:24:01 -05:00
c4c3b545b2 modernize fix gle matrix file reading 2022-01-18 19:55:50 -05:00
e22f62f6db add some metadata for fix gle matrix files 2022-01-18 19:55:30 -05:00
b890b564ca modernize electron stopping file reader 2022-01-18 16:48:26 -05:00
ef13455d6b add some metadata tags 2022-01-18 16:48:07 -05:00
0099d2584b Apply override to Integrator classes 2022-01-18 15:17:04 -05:00
778879a0eb Apply override to Body classes 2022-01-18 14:56:44 -05:00
1792b3b0cf Apply override to Reader classes 2022-01-18 14:39:31 -05:00
d19f799585 Apply override to Region classes 2022-01-18 14:31:29 -05:00
576f2266ae Mark virtual destructors in derived as override
Following C++ Core Guideline C.128
2022-01-18 14:28:25 -05:00
be7e6d0939 Avoid std::string copies 2022-01-18 13:22:55 -05:00
38bcc493b0 simplify and modernize CMAP file parser 2022-01-18 10:28:40 -05:00
389c35a2d3 use alternate method to create triclinic box for unit test 2022-01-18 09:09:37 -05:00
1c8f427e8a detect when MSM::setup() is called before proper initialization and error out 2022-01-18 09:09:19 -05:00
29b5c2659c source code formatting 2022-01-18 09:04:04 -05:00
c1f7685c98 Revert "before changing box settings, it must be initialized at least once"
Looking for alternate solution since this change has
too many unwanted side effects.

This reverts commit 2e85233b11.
2022-01-18 08:30:54 -05:00
2e85233b11 before changing box settings, it must be initialized at least once
otherwise change_box would not really be needed,
but commands like boundary can (still) be used
2022-01-18 07:20:28 -05:00
752552e0f8 remove duplicate code 2022-01-18 06:39:20 -05:00
a02e11040d whitespace 2022-01-18 06:34:57 -05:00
f0f4a8e6dc plug some memory leaks in MSM kspace style(s) 2022-01-18 06:01:32 -05:00
241a44f1af another workaround for rerun 2022-01-18 04:56:47 -05:00
e1d028ec88 Merge pull request #3087 from akohlmey/pair-harmonic
Add new pair styles harmonic/cut for repulsive-only harmonic interaction
2022-01-17 18:53:35 -05:00
5530927bd4 Merge pull request #3088 from stanmoore1/kk_hip_fixes
Fix Kokkos HIP compile issues
2022-01-17 18:07:29 -05:00
af231d5447 Fix comments in Makefiles 2022-01-17 08:54:17 -07:00
8b89be6061 Kokkos SNAP tuning for HIP 2022-01-17 08:49:00 -07:00
a93e5baa73 Add Kokkos HIP Makefiles 2022-01-17 08:44:49 -07:00
cb796e8b60 Fix HIP compile issues 2022-01-17 08:21:52 -07:00
dc6e558191 use Tokenizer class to parse bond colors 2022-01-16 20:20:07 -05:00
0eeb3b203c add tests for molecule command 2022-01-16 16:50:23 -05:00
943fe487b5 update whitespace and argument formats for longer source lines 2022-01-16 15:36:01 -05:00
1e7969c7b9 add new pair styles harmonic/cut and harmonic/cut/omp 2022-01-15 19:34:47 -05:00
aa71ea6c40 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-01-14 20:25:05 -05:00
e271a54802 re-enable using rerun after the changes from PR #3052 2022-01-14 20:25:00 -05:00
11cc8a6a59 whitespace 2022-01-14 15:59:05 -05:00
ed702b9309 don't allow exceptions to "escape" a destructor 2022-01-14 15:58:57 -05:00
dcb1ddb282 remove redundant code 2022-01-14 14:55:13 -05:00
2213eb8d3f use enum with symbolic constants instead of numbers 2022-01-14 14:45:12 -05:00
7afa22f045 check return values for errors 2022-01-14 13:02:15 -05:00
698256f4fe update fedora singularity image to Fedora 35 2022-01-12 08:17:54 -05:00
e0cde6270e Merge branch 'develop' into kokkos_unittests 2022-01-11 12:59:36 -05:00
240db21054 silence possible warnings about missing files on "make clean-all" 2022-01-11 11:46:08 -05:00
8aaae8e6ee Fix count issue 2022-01-07 15:22:53 -07:00
40c140e56e Improve PairReaxFFKokkos neigh list algorithm 2022-01-07 14:48:07 -07:00
878557dd48 Merge pull request #3079 from akohlmey/next_patch_release
Step version strings for the next patch release
2022-01-07 11:31:23 -05:00
1f81e2afad Added duplication of stdout into logfile 2022-01-07 13:45:54 +00:00
11d66f8f1d Merge branch 'lammps:develop' into cg-dna 2022-01-07 12:45:38 +00:00
e3dd2908d9 Step version strings for the next patch release 2022-01-06 19:42:45 -05:00
b300a93b67 Merge pull request #3073 from akohlmey/fmtlib-8.1-update
Update included fmtlib to version 8.1.1
2022-01-06 19:40:00 -05:00
1f924e9fc1 Merge pull request #3071 from akohlmey/collected-small-changes
Collected small changes and bug fixes
2022-01-06 19:22:30 -05:00
9c9bc4790b update to fmtlib-8.1.1 2022-01-06 18:31:15 -05:00
8e0622d523 Merge pull request #3046 from donatas-surblys/centroid-stress-constraint-rigid
Centroid atomic stress for shake, rattle and rigid/small
2022-01-05 12:36:27 -05:00
3ff2f53ead add citations to centroid/stress/atom 2022-01-05 18:45:35 +09:00
e5416a9fee update documentation for new centroid stress for shake and rigid/small 2022-01-05 19:02:25 +09:00
4aba9e9bb6 cosmetic and whitespace changes 2022-01-04 23:08:32 -05:00
40abc0886c adjust for double precision floating point 2022-01-04 23:02:17 -05:00
d0f203127d create missing de,df table elements from linear extrapolation 2022-01-04 23:01:38 -05:00
12420181e1 Merge pull request #3072 from akohlmey/refactor-data-file-parsing
Modernize parsing of topology data sections of data files
2022-01-04 13:21:14 -05:00
8ae68d71dd Merge pull request #3062 from Luthaf/netcdf-standard
Follow Amber NetCDF standard more closely
2022-01-04 13:02:50 -05:00
ede7787741 Refactor Atom::data_bodies() 2022-01-04 11:56:56 -05:00
f557bf6e20 implement suggestion by @rbberger 2022-01-04 11:37:32 -05:00
fd3884d705 disable centroid stress for non-small rigid fixes 2022-01-04 18:09:49 +09:00
1225b609d8 disable centroid stress for fix rigid/small/omp 2022-01-04 17:43:32 +09:00
6a73fc0472 refactor reading last line of potential file code to be more efficient 2022-01-03 21:35:26 -05:00
8439f87b76 make consistent with other reference 2022-01-03 18:26:56 -05:00
de404d1ed8 Merge branch 'update_doc_file' of github.com:jddietz/lammps into collected-small-changes 2022-01-03 18:26:01 -05:00
49412ce0f7 implement workaround windows from https://github.com/fmtlib/fmt/issues/2691
this also reverts commit c5a7f4c3ac
and thus results in consistent crt behavior on windows
2022-01-03 18:01:33 -05:00
a9a568aefa Updated references for pair_nm.rst 2022-01-03 11:50:04 -10:00
7e92809288 Merge pull request #3069 from Vsevak/fix-hip-ffast-math
Fix HIP Makefile under lib/gpu
2022-01-03 11:37:55 -05:00
b8ed590bde Merge pull request #3068 from ndtrung81/gpu-lib-makefiles
Updates to Makefiles under lib/gpu
2022-01-03 10:48:45 -05:00
90726ca088 explain that the computed force in python pair is force/r same as in Pair:single() 2022-01-03 10:12:51 -05:00
8c95a8db23 Incorporate bugfixes from issue #3074, a few additional cleanups 2022-01-03 10:11:03 -05:00
c5a7f4c3ac fmtlib now uses UCRT instead of MSVCRT. add library to avoid linker failure 2022-01-02 15:24:04 -05:00
bb1c12d22b import fmtlib v8.1.0 2022-01-02 13:42:27 -05:00
f3c5593c50 correct code example 2022-01-01 16:40:54 -05:00
e5c517c8d8 silence compiler warnings 2022-01-01 00:21:14 -05:00
9efa2369dd join wrapped strings 2021-12-31 14:34:24 -05:00
c17a183816 do error checking already in read_data code 2021-12-31 14:34:09 -05:00
863de683ee do not shadow "natoms" class member 2021-12-31 13:43:56 -05:00
6d9764e140 add missing advance of buffer pointer 2021-12-31 00:14:52 -05:00
ca3be99e77 correct function prototypes 2021-12-30 23:48:42 -05:00
e6e9aed385 modernize/correct parsing for Bonus and Bodies sections 2021-12-30 22:58:14 -05:00
8d53cd1e5d modernize parsing of Velocities section of data files 2021-12-30 19:14:09 -05:00
def1072f0f port data_atom() changes to KOKKOS 2021-12-30 18:42:15 -05:00
7f2b505df3 apply utils overloads 2021-12-30 11:14:48 -05:00
cf9429dc68 implement overloads so that utils::*numeric() functions can be safely used with std::string() 2021-12-30 11:03:37 -05:00
64d6a2fd1f modernize parsing of the Atoms section 2021-12-29 20:24:27 -05:00
c97483c46f modernize parsing of the Masses section in data files 2021-12-29 19:36:18 -05:00
78df5c2258 modernize parsing of Bonds/Angles/Dihedrals/Impropers section of data files 2021-12-29 19:18:42 -05:00
27a6c63aeb correct format string for Error::one() 2021-12-29 16:18:48 -05:00
88b42503f9 address segfault issue with fix nve/gpu when group is not "all" 2021-12-29 14:06:22 -05:00
14e5474174 restore obsolete compilation settings similar to parallel makefile 2021-12-27 20:31:42 -05:00
053d915fc4 drop -ffast-math for HIP also when compiling with CMake 2021-12-27 20:14:30 -05:00
b781410f92 Delete fast-math flag from Makefile.hip for AMD platforms 2021-12-28 03:11:02 +03:00
47b0c8b33e whitespace 2021-12-27 11:31:01 -05:00
5594a38bb7 replace explicit Makefile.mpi with symbolic link 2021-12-27 10:47:23 -05:00
3262140b65 more detailed unit tests. do not fail if ncdump is missing. 2021-12-27 10:35:38 -05:00
6357f19260 Added back Makefile.mpi in lib/gpu/ to be consistent with documentation; updated Makefile.*; and removed the unnecessary Makefile.turing 2021-12-27 00:14:04 -06:00
091f6164c8 add minimal unit test for netcdf dumps 2021-12-26 23:22:53 -05:00
30af0cb325 define and use LMP_MAX_VAR_DIMS instead of NC_MAX_VAR_DIMS to avoid stack overflows 2021-12-26 17:15:13 -05:00
84765f4b81 Merge branch 'develop' into netcdf-standard 2021-12-23 16:42:24 -05:00
b39d1993bb Merge pull request #3052 from lammps/time-dumps2
Time-dependent dumps for variable timestep (alternate implementation)
2021-12-23 16:34:12 -05:00
6af36075ba Merge pull request #3064 from rbberger/collected-small-changes
Collected small changes and fixes
2021-12-23 16:13:35 -05:00
a653ee6b2c recover failing unit tests and whitespace fixes 2021-12-23 15:22:58 -05:00
7018ba65be Merge branch 'time-dumps2' of github.com:lammps/lammps into time-dumps2
# Conflicts:
#	src/dump_xyz.cpp
2021-12-23 15:18:56 -05:00
d694b7cc1c recover compilation 2021-12-23 14:34:49 -05:00
b7dba37e2e Merge branch 'time-dumps2' of github.com:lammps/lammps into time-dumps2 2021-12-23 14:34:00 -05:00
23f1c9de60 Merge branch 'develop' into time-dumps2 2021-12-23 14:29:04 -05:00
1185591c76 add missing fclose() 2021-12-23 08:20:47 -05:00
b2adb4df47 have internal fix/compute ids include the fix id for fix reaxff/species
this allows using the fix multiple times
also remove code and warning that checks for multiple fix instances
2021-12-23 08:20:28 -05:00
3748a14582 warn about problems with the MPIIO package 2021-12-23 01:59:45 -05:00
93c7b6928f remove dead code, silence compiler warnings 2021-12-23 01:32:31 -05:00
3b183bafbb cosmetic changes (simplify, use constexpr, remove dead code, join wrapped lines) 2021-12-23 01:23:13 -05:00
b53cda778c Merge branch 'develop' into netcdf-standard 2021-12-22 22:54:30 -05:00
09944f5d7a Merge pull request #2996 from stanmoore1/compute_phase
Add compute ave/sphere/atom
2021-12-22 21:16:25 -05:00
3dcfc0dfc6 skip redundant KOKKOS host/device styles info/help lists 2021-12-22 20:13:30 -05:00
8f62cd79f4 add missing list entry 2021-12-22 19:55:06 -05:00
586824be1b Merge pull request #3021 from stanmoore1/big_dump_sort
Allow dump sort to work with more than 2 billion atoms
2021-12-22 19:23:39 -05:00
cde7dd34fd Doc update 2021-12-21 16:46:53 -07:00
2788bc666a Update .gitignore 2021-12-21 16:44:14 -07:00
9271323cc0 Add dependency 2021-12-21 16:33:14 -07:00
1bbf45784b Rename and relocate 2021-12-21 16:29:11 -07:00
6a442e1df4 use compute_time() func in xyz output 2021-12-21 14:05:16 -07:00
6f6b384c55 Merge branch 'time-dumps2' of github.com:lammps/lammps into time-dumps2
# Conflicts:
#	src/dump_xyz.cpp
2021-12-21 15:56:19 -05:00
2fec3eee6b Add overflow check to dump_h5md 2021-12-21 13:28:36 -07:00
5932a3f6f9 Merge branch 'develop' of github.com:lammps/lammps into big_dump_sort 2021-12-21 12:58:24 -07:00
cc4d7215f1 simplify. only output absolute time during MD. 2021-12-21 14:37:34 -05:00
cad9f6bf6e Merge branch 'time-dumps2' of github.com:lammps/lammps into time-dumps2 2021-12-21 12:18:38 -07:00
576e787839 make xyz dumps print out current simulation time 2021-12-21 12:18:26 -07:00
8ed35832f4 Merge branch 'develop' into time-dumps2 2021-12-21 14:16:23 -05:00
e06222099a Small tweak to docs 2021-12-21 11:51:30 -07:00
192aa7fedb Merge pull request #3065 from lammps/angle-class2-update
Angle class2 update and bugfix
2021-12-21 13:46:37 -05:00
c98f7b3e50 Clean up error message text 2021-12-21 11:40:04 -07:00
0576d525ad simplify and avoid redundant output 2021-12-21 13:39:00 -05:00
364d0be28c apply clang-format 2021-12-21 13:21:23 -05:00
c780768e91 put contents of netcdf_units into NetCDFUnits namespace 2021-12-21 13:16:23 -05:00
a2ab59b162 Fix cutoff logic 2021-12-21 11:07:03 -07:00
ded48cc031 more optimizations and extend to other dump styles 2021-12-21 10:57:42 -07:00
2533abb266 Add doc page 2021-12-21 10:46:23 -07:00
65204e5df0 Add error checks, tweak input 2021-12-21 10:46:00 -07:00
ecc0205436 reset force test references for Class2 angle styles 2021-12-21 11:28:26 -05:00
6187431399 Fix compile error in angle_class2_kokkos 2021-12-21 08:34:02 -07:00
4d31e300c6 change to checking timestep for time dumps at start of each step 2021-12-20 16:39:17 -07:00
f271d2180f Remove unused variable 2021-12-20 16:05:44 -07:00
8d34fb8e1f Merge branch 'develop' of https://github.com/lammps/lammps into compute_phase 2021-12-20 14:19:39 -08:00
4bc85f07e3 same changes in OPENMP and KOKKOS versions of angle class2 2021-12-20 14:29:17 -07:00
06c45fbe68 fix compiler errors 2021-12-20 14:26:22 -07:00
2ee88dab7e same change for angle class2/p6 2021-12-20 10:35:41 -07:00
97b5651633 minor correction to angle class2 2021-12-20 10:33:05 -07:00
8dd61144cb Merge branch 'develop' into kokkos_unittests 2021-12-20 10:54:27 -05:00
f1daa22cdf Merge branch 'lammps:develop' into cg-dna 2021-12-20 13:13:41 +00:00
461398bc0e join lines 2021-12-19 17:46:51 -05:00
88f8e41702 PHONON package is now only a soft dependency on KSPACE 2021-12-18 18:22:47 -05:00
3246fd62a7 size_t is unsigned, so can't be negative 2021-12-17 17:10:21 -05:00
a3a6077115 Use sfread and sfgets in reader_native.cpp 2021-12-17 17:03:58 -05:00
1c25c96aaa netcdf: deduplicate gettings units as strings 2021-12-17 17:13:29 +01:00
f8ee6dc680 netcf: define units for all variable where this is possible 2021-12-17 11:49:25 +01:00
dc9d539b6c netcdf: fix spatial, cell_spatial and cell_angular variable definitions
Dimension 0 refered to the frame dimension, but we need the spatial dimension instead
2021-12-17 11:49:25 +01:00
4bf065ed1c netcdf: use float values for scale factors instead of double 2021-12-17 10:55:54 +01:00
d04f428c1a netcdf: default to float variable for everything
The standard convention require all values to be stored as
float, users still have the ability to use double with
`dump_modify <id> double yes`
2021-12-17 10:54:43 +01:00
2d4f030f11 Merge pull request #3060 from rbberger/binary_dump_reader_bugfix
Bugfix for binary dump reader heap corruption
2021-12-15 17:20:12 -05:00
884dcbe4fa Refactor reader_native.cpp
- Use std::string instead of error-prone char buffers
- Limit reading files to known magic strings DUMPATOM and DUMPCUSTOM
2021-12-15 16:09:50 -05:00
902f9dd1fa Move allocation to correct location 2021-12-15 15:05:59 -05:00
9fbca5111d fix runtime error from lack of comm->setup() 2021-12-15 11:52:38 -08:00
3748ddb1ae Merge branch 'lammps:develop' into cg-dna 2021-12-15 09:02:57 +00:00
40c0925cb4 Updated and added third order kokkos 2021-12-14 14:25:49 -08:00
b3fcda3214 Merge pull request #3057 from akohlmey/next_patch_release
Step version strings for the next patch release
2021-12-14 17:08:29 -05:00
676c5a3666 Merge pull request #3059 from nw13slx/rerun_bin
[BUGFIX] Wrong block reading in ReaderNative::read_atoms when binary is True and natom > 1024
2021-12-14 16:09:35 -05:00
3efddc4fb6 whitespace 2021-12-14 14:50:38 -05:00
5051055c76 Remove dead code and move nchunk read to read_header 2021-12-14 14:33:17 -05:00
fd18403b0a Merge pull request #3056 from Ruyk/dpcpp-anon-struct-workaround
DPC++ Anonymous Struct Workaround
2021-12-14 11:32:52 -05:00
80819f3793 reverse skip_buf with chunk 2021-12-14 11:09:36 -05:00
4be0e0a4e5 Merge branch 'develop' of https://github.com/lammps/lammps into big_dump_sort 2021-12-14 08:00:14 -07:00
26ebf97630 Merge branch 'develop' of https://github.com/lammps/lammps into compute_phase 2021-12-14 07:56:41 -07:00
62cdf7ab2d update docs 2021-12-14 09:13:05 -05:00
1c38b7633f generalize and simplify support for accelerated commands with suffixes 2021-12-14 09:06:04 -05:00
dee995f918 consistent author attribution 2021-12-14 09:05:28 -05:00
d6048ba576 added copyright/license header and updated author attribution 2021-12-14 08:41:49 -05:00
5b57d662c3 Merge branch 'develop' into OptimizedDynamicalMatrix 2021-12-14 08:35:58 -05:00
813f756382 Merge branch 'develop' into dpcpp-anon-struct-workaround 2021-12-14 06:59:12 -05:00
91633a4460 make workaround easier to disable and to remove 2021-12-14 06:59:03 -05:00
7c3deaa04b limit the skip buf to MAXSMALLINT 2021-12-13 23:03:10 -05:00
b1d0dd65ea simply the while loop and add correct initial m value 2021-12-13 22:57:39 -05:00
d4cec8ebe7 handle block reading in ReaderNative::read_atoms when binary is True 2021-12-13 21:38:16 -05:00
5a39efff19 Merge pull request #3055 from akohlmey/collected-small-changes
Final changes for next patch release
2021-12-13 21:24:11 -05:00
ccdb939a40 Merge pull request #3054 from nw13slx/rerun_bin
Support binary native dump files with read_dump and rerun
2021-12-13 19:22:00 -05:00
a887d880c6 debugged kokkos support to dynamical_matrix command 2021-12-13 14:14:14 -08:00
72420bad3a Merge pull request #3058 from jtclemm/documentation_edits
Fixing some references to MISC package in documentation
2021-12-13 16:59:10 -05:00
ff41864cd9 remove redundant deletes 2021-12-13 15:28:27 -05:00
cdc831bb89 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:30 -08:00
f3543a839e Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:21 -08:00
3eae7b4200 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:14 -08:00
af2e295ac2 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:22:57 -08:00
bb6d581ef8 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:22:39 -08:00
1e73beca37 Merge pull request #2809 from rbberger/fmt_upgrade
Upgrades fmtlib to v8.0.1
2021-12-13 15:14:58 -05:00
2b85799729 Updating MISC to EXTRA-X in doc files 2021-12-13 12:27:00 -07:00
94ac1ad4a0 update version strings for the next patch release 2021-12-13 11:56:44 -05:00
9159b37e47 Merge branch 'develop' into fmt_upgrade 2021-12-13 10:03:38 -05:00
d33019d8e4 llvm anonymous struct workaround 2021-12-13 11:08:06 +00:00
94d5c75fdf small updates for docs and comments 2021-12-12 18:11:33 -05:00
33aea05080 adjust example for changes in when reset_timestep may be used 2021-12-12 10:01:52 -05:00
7db29112d8 replace read_buf to skip_buf in skip function 2021-12-12 00:26:55 -05:00
913b1536d4 whitespace 2021-12-11 21:18:33 -05:00
274b14618f fold match_fields() back into read_header() function 2021-12-11 21:17:41 -05:00
e23a2bfb55 Merge branch 'rerun_bin' of github.com:nw13slx/lammps into rerun_bin
# Conflicts:
#	src/reader_native_bin.cpp
2021-12-11 21:05:01 -05:00
87501347ad add minimal unit tests for reading binary dumps 2021-12-11 21:03:32 -05:00
0603dc6323 whitespace 2021-12-11 20:46:24 -05:00
86b696c78c Merge branch 'develop' into rerun_bin 2021-12-11 20:31:48 -05:00
56fd07d88e fold native binary reader class in to native reader class 2021-12-11 20:31:44 -05:00
565c8d6589 use fseek to skip bufs 2021-12-11 20:02:32 -05:00
8884acef24 Revert "add to compress read"
This reverts commit b22c409079.

# Conflicts:
#	src/platform.cpp
2021-12-11 19:40:21 -05:00
d7bb9b5f30 reverse clang-format on irrelevant lines 2021-12-11 17:49:29 -05:00
b22c409079 add to compress read 2021-12-11 17:44:41 -05:00
626889f534 move the rb mode to the overloaded open_file function 2021-12-11 17:36:29 -05:00
d59458fa37 clean up commands and documentation 2021-12-11 17:24:27 -05:00
8f99d8d1d9 fix skip bugs 2021-12-11 16:41:13 -05:00
6e05aff3bf Update CMake utility function get_lammps_version()
With the introduction of LAMMPS_UPDATE, version.h is no longer a single line
file. With this change the CMake utility will only process the LAMMPS_VERSION
line. Fixes issue #3038
2021-12-11 15:08:40 -05:00
250a5921a3 move match_field to protected method and format the docstring 2021-12-11 14:25:29 -05:00
2cdafb49a2 remove variable names from func declaration 2021-12-11 14:14:06 -05:00
e9f0351b67 reverse formatting on irrelevant files 2021-12-11 14:10:47 -05:00
eff26ba0b3 add read_buf method and fix bugs in inheritance 2021-12-11 14:02:58 -05:00
b1e7333348 remove wrong compression mode 2021-12-11 12:32:17 -05:00
7ab5d4edd4 add new ReaderNativeBin class 2021-12-11 11:54:21 -05:00
4f34c4374b Merge pull request #3053 from stanmoore1/kk_desul
Enable Kokkos Desul atomics in Makefile to match CMake settings
2021-12-11 06:12:50 -05:00
62f5f4d126 Merge remote-tracking branch 'github/develop' into fmt_upgrade 2021-12-10 23:04:58 -05:00
abd3df0c5a Merge pull request #3040 from akohlmey/collected-small-changes
Collected small changes and bugfixes
2021-12-10 15:51:13 -05:00
fc64fca3d9 Whitespace 2021-12-10 13:34:38 -07:00
6bd3ddf908 Don't use fetch variant of atomic if not needed 2021-12-10 13:27:57 -07:00
e49b7d0514 Remove atomics for error/warning flags since they are not needed 2021-12-10 13:14:12 -07:00
0ab0e2747c Update comment 2021-12-10 12:15:10 -07:00
7aeab56eb2 Enable Kokkos Desul atomics in Makefile to match CMake settings 2021-12-10 12:09:32 -07:00
fa8e2ccee8 Merge pull request #2958 from jddietz/nm_split_styles
nm split styles
2021-12-10 13:42:31 -05:00
5ead32f886 more debugging and features 2021-12-10 11:13:06 -07:00
6140503158 update local/density examples to follow conventions more closely 2021-12-10 08:50:58 -05:00
14fc42833f modernize potential file reader for local/density 2021-12-10 08:45:01 -05:00
3fc0ea3e80 correct names of the pack/unpack routines for forward communication 2021-12-09 18:30:54 -05:00
a975d0506a update examples for pair style local/density 2021-12-09 18:21:32 -05:00
e1e46b5322 Merge pull request #3033 from rbberger/unittest_tags
Add tags to force-style unit tests
2021-12-09 18:11:08 -05:00
146c6fe5ff remove check that is no longer needed 2021-12-09 18:08:43 -05:00
0e4e830c79 document "slow" and "unstable" labels for unit tests 2021-12-09 17:02:20 -05:00
0d44c56ccc use comma consistently 2021-12-09 15:50:57 -05:00
7d48324f51 tweak force test settings 2021-12-09 15:48:24 -05:00
facb49fc27 disallow reset_timestep for time averaging fixes 2021-12-09 15:09:42 -05:00
878dd746db reduce warnings and improve portability 2021-12-09 13:55:53 -05:00
e2969d09e1 bug fix for fix dt/reset freq of 1 2021-12-09 11:53:47 -07:00
754610b9ee Merge pull request #3041 from oywg11/modified-sw-potential
A modified Stillinger-Weber potential for transition metal dichalcogenide
2021-12-09 09:43:49 -05:00
d4149e9139 bug fixes to make a series of test inputs run correctly 2021-12-08 16:44:51 -07:00
8f0dea91c7 correct setting forward/reverse buffer size info 2021-12-08 13:54:47 -05:00
a5ee7ca73f make certain did_mix is initialized 2021-12-08 00:51:04 -05:00
bea273fc3a correct docs for pair style local/density 2021-12-08 00:22:37 -05:00
40c04a210b correct handling of data packing for forward and reverse communication 2021-12-08 00:22:36 -05:00
021f6832d5 adjust epsilon for -std=c++14 and add more unstable tags 2021-12-07 17:11:29 -05:00
26492b13d5 logic for dumps every steps and time delta 2021-12-07 13:46:36 -07:00
5cee58a9c8 Merge pull request #3049 from Ruyk/sycl-pinned-host
Use SYCL pinned host memory from Kokkos.
2021-12-07 14:07:58 -05:00
605d2b7ab2 Use SYCL pinned host memory from Kokkos.
Depends on this PR from Kokkos:
https://github.com/kokkos/kokkos/pull/4268/
2021-12-07 16:49:27 +00:00
1afdd3c011 new output vars for dumps 2021-12-07 09:16:19 -07:00
a323b00fef Merge branch 'develop' into unittest_tags 2021-12-07 10:24:46 -05:00
ac57c44552 update unit test for renamed bond style 2021-12-06 16:35:20 -05:00
6314290558 clarify docs for bond style fene/nm/split and rename to fene/nm 2021-12-06 16:21:12 -05:00
021a59965e convert to ASCII 2021-12-06 15:54:34 -05:00
f88009c626 correct comments 2021-12-06 15:50:16 -05:00
fa913c3e5b clarify r_0 versus sigma 2021-12-06 15:50:09 -05:00
a84c0a43bd address spelling issues 2021-12-06 15:35:32 -05:00
c48810c545 whitespace 2021-12-06 15:29:23 -05:00
ef186d9628 Updated pair_nm.rst 2021-12-06 15:09:45 -05:00
1238f1b273 correct multiple math typesetting errors, typos, and inconsistencies 2021-12-06 14:10:41 -05:00
274ffe1f48 Consolidate "Jiang" citations 2021-12-06 14:07:36 -05:00
b0305a09e9 whitespace 2021-12-06 13:49:13 -05:00
3d3b153b35 add proper symlink 2021-12-06 13:45:04 -05:00
d7c8cb3e48 fix documentation issues 2021-12-06 05:57:52 +02:00
e36029293a update documentation and examples 2021-12-04 17:38:29 +02:00
8aee8cc427 tweak documentation 2021-12-03 17:20:07 -05:00
8bc1f8b9ea whitespace 2021-12-03 17:16:54 -05:00
085de6f857 update test and add test using maxdelcs keyword with non-default values 2021-12-03 17:16:46 -05:00
c72771ae1d align with non-OpenMP version 2021-12-03 17:16:08 -05:00
6b28816c11 must set defaults for (optional) maxdelcs keyword, add consistency check 2021-12-03 17:15:44 -05:00
71edaca36c update unit test reference 2021-12-03 14:20:23 -05:00
2d6e4d4d79 Merge branch 'develop' into nm_split_styles 2021-12-03 14:18:07 -05:00
405fea44da convert from CR-LF to consistent line endings 2021-12-03 14:17:31 -05:00
859e0348ea fixed some issues 2021-12-03 17:45:31 +02:00
1dd4a67771 add keyword for userdefined maxdelcs 2021-12-03 17:32:08 +02:00
262c103aaa replacing hard-coded values with named constants 2021-12-03 15:46:00 +02:00
9a90803b23 Merge pull request #2984 from lammps/delete-atoms-porosity-group
Add new group arg for delete_atoms porosity
2021-12-02 16:07:49 -05:00
9307a376aa Merge pull request #3044 from ellio167/kim-lib-install-py
Adjustments to lib/kim/Install.py and docs
2021-12-02 15:43:03 -05:00
ef90089d8d Merge pull request #2867 from ndtrung81/gpu-newton-pair-on
Enabled newton pair on for gpu pair styles
2021-12-02 15:42:34 -05:00
2ba5aeec31 whitespace 2021-12-02 15:30:53 -05:00
4ecb894d9d simplify by using new API 2021-12-02 15:27:06 -05:00
637c6bf28a Merge branch 'develop' into delete-atoms-porosity-group 2021-12-02 15:15:47 -05:00
fc0aa0e844 Merge pull request #3043 from rbberger/container_updates
Container updates
2021-12-02 14:43:20 -05:00
42df189abd update .gitignore 2021-12-02 13:49:26 -05:00
2527eb5914 reorganize integration of sw/mod into the sw pair style docs 2021-12-02 12:47:18 -05:00
3dff9cf2c1 update false positives 2021-12-02 12:27:54 -05:00
8847f359ba integrate sw/mod pair style into documentation 2021-12-02 12:23:01 -05:00
7651be3e02 add force style test 2021-12-02 12:20:33 -05:00
ecd51ba4fe remove obsolete/redundant files 2021-12-02 12:20:10 -05:00
718a9e2bae whitespace 2021-12-02 12:13:12 -05:00
c33e6538bb simplification by deriving pair style sw/mod/omp from sw/omp instead of sw/mod 2021-12-02 12:12:57 -05:00
3bf171d753 move pair sw/mod/omp to correct location 2021-12-02 12:01:05 -05:00
30d3b2c209 merge rst files and add omp style 2021-12-02 15:46:00 +02:00
47f578bcca Fixup typos 2021-12-01 21:15:28 -06:00
65d31dfeb1 Adjustments to lib/kim/Install.py and docs 2021-12-01 16:49:00 -06:00
c03cdfdf60 Add libyaml-cpp dev package 2021-12-01 14:00:08 -05:00
195455faa8 Update GPU and NVIDIA container definitions 2021-12-01 13:48:54 -05:00
01ddfe95f0 prepare fix plumed to be compatible with version 2.8 2021-12-01 13:44:56 -05:00
e75312ddf6 Update ROCm containers to v4.5.0 2021-12-01 13:24:07 -05:00
ff919af3ef Update container bundled PLUMED to v2.7.3 2021-12-01 11:39:05 -05:00
4d4c04dd7c include support for building with plumed 2.7.3 and 2.6.5 2021-12-01 10:56:23 -05:00
e0770a2ac0 Add Ubuntu 20.04 OneAPI container definition 2021-12-01 10:41:01 -05:00
3bc36070a9 fix the invoking issue 2021-12-01 04:56:46 +02:00
8589ecd6c1 Merge pull request #3019 from stanmoore1/kk_update_3.5.0
Update Kokkos library in LAMMPS to v3.5.0
2021-11-30 16:58:38 -05:00
b3d7904120 Update docs 2021-11-30 11:12:30 -07:00
420c1097a9 Update Kokkos CMake file 2021-11-30 11:02:11 -07:00
b2410ee70b Update Kokkos library in LAMMPS to v3.5.0 2021-11-30 10:57:43 -07:00
c0b827e006 Merge branch 'kk_update_3.5.0' of github.com:stanmoore1/lammps into kk_update_3.5.0 2021-11-30 10:52:51 -07:00
b61fc38711 Merge branch 'develop' of github.com:lammps/lammps into kk_update_3.5.0 2021-11-30 10:52:21 -07:00
4a05628938 bug fixes from Doug Spearot 2021-11-30 08:22:38 -07:00
8556b71949 derived class of sw 2021-11-30 10:14:20 +02:00
f1c52ddb5c make documentation of a few pair styles more consistent with the rest 2021-11-29 15:57:11 -05:00
597054edf3 A modification to SW potential 2021-11-29 16:08:32 +02:00
ddf97fa8fc tweak error messages 2021-11-24 15:34:43 -05:00
2a68c6edba add (global) restart support to fix charge/regulation 2021-11-24 15:34:30 -05:00
ae0f4dcfc1 generate atom tags for newly created atoms, if tags are enabled. triclinic support. 2021-11-24 15:33:32 -05:00
4d19895a88 Merge branch 'master' into delete-atoms-porosity-group 2021-11-23 16:05:02 -07:00
2c5441257e Disable tersoff with shift flag tests for kokkos_omp 2021-11-23 15:03:48 -05:00
9517467113 Add missing KOKKOS suffix in PairTersoffZBLKokkos 2021-11-23 14:56:35 -05:00
0b87039fbb Skip MolPairStyle:hybrid-scaled test for kokkos_omp 2021-11-23 14:28:59 -05:00
2f6bf29adf Fixup kokkos_omp test for dpd 2021-11-23 14:06:02 -05:00
d365cc7dfc Add missing destroy_kokkos() calls in pair_lj_gromacs_kokkos.cpp 2021-11-23 13:57:53 -05:00
b603346a0d Skip kspace-pppm_ad test for kokkos_omp 2021-11-23 13:56:19 -05:00
51c627df76 Add SCOPED_TRACE for better test error messages 2021-11-23 12:22:01 -05:00
073b586eee Add EXPECT_POSITIONS() and EXPECT_VELOCITIES() test utils 2021-11-23 12:21:27 -05:00
32a53a1ae3 Use EXPECT_FORCES() in more testers 2021-11-23 11:46:33 -05:00
615b7ceca2 Simplify EXPECT_FORCES() utility function 2021-11-23 10:59:40 -05:00
946fd6fb55 Update CMake utility function get_lammps_version()
With the introduction of LAMMPS_UPDATE, version.h is no longer a single line
file. With this change the CMake utility will only process the LAMMPS_VERSION
line. Fixes issue #3038
2021-11-23 10:46:22 -05:00
68360b9335 Add test utility method EXPECT_FORCES() 2021-11-22 16:27:18 -05:00
1a4511bb8d Merge pull request #3034 from akohlmey/mixing-info
Provide information about pair_coeff mixing and improve hybrid docs
2021-11-22 16:22:24 -05:00
62b236a7cd Use platform::path_join in unittest tree and remove redundant code 2021-11-22 15:34:23 -05:00
3d650a6bf7 Add test utility method EXPECT_STRESS() 2021-11-22 15:24:41 -05:00
ef2e51b344 whitespace fixes 2021-11-22 14:58:41 -05:00
6b605e932b Merge branch 'develop' into mixing-info 2021-11-22 14:58:19 -05:00
a83329a1a7 Merge pull request #3032 from GenieTim/compute-pair-distance-vector
Add dx, dy and dz computes to compute bond/local and property/local
2021-11-22 14:50:15 -05:00
bb127603ff Use platform::unlink in unittests 2021-11-22 14:40:51 -05:00
a6ccdd72ec Move platform::rmdir docstring to right location 2021-11-22 11:49:09 -05:00
0931da9cad Cleaned up comments in fix_gpu.cpp 2021-11-20 08:38:13 -06:00
a06c4767a0 Merge branch 'upstream' into gpu-newton-pair-on 2021-11-20 08:30:39 -06:00
f135d8bb4e Fix issue where direction correction in compute bond/local might not have been correct 2021-11-20 14:34:24 +01:00
a354a763bb Fix output capture mismatch 2021-11-19 17:14:52 -05:00
780cf82bb0 First version of kokkos_omp test variant 2021-11-19 16:23:05 -05:00
2c8c33fb9a add slow tag to about 60 tests that take about as much time as the 430 others 2021-11-19 15:59:19 -05:00
b2dae36eb9 discuss mixing informational message 2021-11-19 14:36:00 -05:00
3d4b0121cb improve pair hybrid documentation with respect to mixing 2021-11-19 14:18:55 -05:00
23d40a1d61 report how many pair_coeff settings parameters were generated from mixing 2021-11-19 13:43:32 -05:00
b55ea05f3b Add some example tags for force style tests 2021-11-19 09:23:47 -05:00
4ac351eba6 Add tags to force-style tests
Adds an optional "tags" entry in the force style test YAML. This is a
comma-separated list of keywords, which are parsed by CMake and added as labels
for CTest.  This allows more fine-grained filtering of tests. Any
newly-generated YAML file automatically adds the "generated" tag.
2021-11-19 09:23:31 -05:00
74577fa584 Fix issue where direction correction in compute pair/local might not have been correct 2021-11-19 08:08:07 +01:00
7f17c55198 Merge branch 'develop' of https://github.com/lammps/lammps into compute_phase 2021-11-18 14:08:01 -08:00
4b6090a8cb Add direction consistency check to pair/local too 2021-11-18 19:28:51 +01:00
36e4e3e746 Add ddx, dy and dz computes to compute bond/local and property/local 2021-11-18 17:22:32 +01:00
15f1c2d960 Fix inaccurate error message 2021-11-18 08:50:09 -07:00
94b11964f8 Write dump header after sort to fix incorrect atom count for multiproc 2021-11-18 08:32:41 -07:00
5616336d5e Allow sorting with reorderflag for more than 2 billion atoms 2021-11-18 07:59:45 -07:00
29471bd425 Merge branch 'develop' of github.com:lammps/lammps into big_dump_sort 2021-11-17 14:09:51 -07:00
7544f1bcf8 Fixed comm setup bug and external forces bug, still must look into if package omp needs to set external force flag to zero 2021-11-17 11:48:35 -08:00
229ce0a61b Merge pull request #3027 from yihengwuKP/fix-reorder-remd
Fix the indent and ot bugs in reorder_remd_traj.py
2021-11-17 14:11:12 -05:00
377b5b4ab3 Merge pull request #3020 from akohlmey/collected-small-changes
Collected small changes and fixes
2021-11-17 14:00:13 -05:00
d178a5ffa3 Extended test script 2021-11-17 13:12:44 +00:00
ef30e3bd35 clarifications and corrections for the discussion of the main git branches 2021-11-17 06:58:44 -05:00
2b480f87f1 fix segfault when using atom style smd as part of a hybrid style
also remove redundant for clearing
2021-11-16 21:48:33 -05:00
d576b69dbc plug memory leaks 2021-11-16 21:41:08 -05:00
d0a4c4467f replace replicated functionality with shared code in base class 2021-11-16 13:53:52 -05:00
ed8c86d248 correct uninitialized data access bug due to shadowing of a base class member 2021-11-16 10:46:09 -05:00
1c1cd60baf Fix the indent and ot bugs in reorder_remd_traj.py 2021-11-15 18:21:17 -06:00
766f975b74 Removed the newton checks in the gpu pair styles; reverted to mixed precision in Makefile.cuda 2021-11-13 07:00:12 -06:00
906e78c198 Merge branch 'gpu-newton-pair-on' of https://github.com/ndtrung81/lammps into gpu-newton-pair-on 2021-11-13 06:39:23 -06:00
65fb78b6d5 Finally updated the nm_split_styles, removed hard-coded r0=2^1/6 cutoff 2021-11-12 14:44:18 -05:00
f733453f05 Intpos (#11)
* hbond comm added for rsq_hb

* lrefpos removed, extract scaled for oxDNA1

* Update pair_oxdna_hbond.cpp

* nxyz extract scaled across DNA2/RNA2

* oxDNA2/RNA2 updated to match oxDNA styling from upstream merge

* whitespace corrections

also removed unnecessary local unit vector from oxRNA2_xstk

* whitespace correction in oxdna_coaxstk
2021-11-10 09:25:13 +00:00
3b30fbb218 Merge branch 'lammps:develop' into intpos 2021-11-10 09:13:00 +00:00
367c9dff05 Compilable kokkos dynamical matrix command 2021-11-09 15:21:39 -08:00
25db8a21bc account for increased floating point errors when summing numbers to zero 2021-11-07 08:29:16 -05:00
ac6654cf0c skip MPI tests if they would be oversubscribing the available processors 2021-11-07 08:28:16 -05:00
16c50b3873 whitespace 2021-11-07 08:27:25 -05:00
7c5640c1c9 we may call ->set_molecule() only in MOLECULE mode 2021-11-05 16:27:58 -04:00
49258e9301 add missing assignment 2021-11-05 16:19:19 -04:00
03e3dfa94d Merge branch 'develop' of https://github.com/lammps/lammps into kk_update_3.5.0 2021-11-05 13:46:50 -04:00
d1403c62c8 update restrictions note for dump_modify 2021-11-05 10:56:54 -04:00
ebb3dcd9ff Remove error message 2021-11-04 20:20:07 -06:00
07a25144ee Remove error from dump.h 2021-11-04 20:06:30 -06:00
136c15a8ba Allow dump sort to work with more than 2 billion atoms 2021-11-04 19:59:48 -06:00
a4ceda9706 Merge pull request #2940 from akohlmey/multi-config-support
Support multi-config builds with CMake
2021-11-04 15:21:58 -07:00
5e7f2cf54f Changed tab spacing from 4 to 2, to be in line with lammps standards 2021-11-04 14:33:16 -07:00
18c78e1625 Merge branch 'master' into OptimizedDynamicalMatrix 2021-11-04 14:23:50 -07:00
b3c5f6a4fd whitespace 2021-11-04 16:48:29 -04:00
935c17f02e Document multi-configuration build support in CMake 2021-11-04 16:32:21 -04:00
1a940e052e add support for and apply clang-format to lammps-shell code 2021-11-04 15:55:28 -04:00
aab4f71019 Merge branch 'develop' into multi-config-support
# Conflicts:
#	unittest/force-styles/test_error_stats.cpp
2021-11-04 15:50:49 -04:00
2cd862e4a2 Update lebedeva potential file and docs based on email on mailing list
https://matsci.org/t/lammps-users-webpage-and-parameter-file-for-the-lebedeva-potential/39059
2021-11-04 15:24:41 -04:00
8e89c7c654 correct unit description of eta_n0 parameters. fixes #3016 2021-11-04 15:24:41 -04:00
825945f783 mention that dump sorting is limited to less than 2 billion atoms 2021-11-04 15:24:41 -04:00
461a7afc22 remove PYTHON from "most" cmake preset.
The PYTHON package cannot be compiled without the python development
support being installed, so it must not be in the "most" preset
2021-11-04 15:24:41 -04:00
3ec3085f39 Merge pull request #3017 from akohlmey/portability-improvements
Portability improvements
2021-11-04 12:21:11 -07:00
564098e629 Update Kokkos library in LAMMPS to v3.5.0 2021-11-04 12:45:59 -06:00
0909b4da92 Updated dynamical matrix command to work with intel potentials 2021-11-04 11:35:31 -07:00
7c80911f66 whitespace 2021-11-03 15:23:29 -04:00
439f997a10 skip test for file not readable due to permissions on windows 2021-11-03 14:54:38 -04:00
62fc7b6fa0 small tweaks to make replacing the CMakeLists.txt file work as expected 2021-11-03 14:44:16 -04:00
37dfc9e141 simplify by not trying to use fetchcontent but do all steps manually
as it turns out, fetchcontent is calling external_project internally at
some point which to avoid is why this function was started in the first place
2021-11-03 14:43:18 -04:00
b7bf60ea53 use the portable platform::unlink() instead of unlink() 2021-11-03 14:26:50 -04:00
b86a3a5d6b Added missing } 2021-11-03 10:24:22 -07:00
5241f93641 Update third order format 2021-11-03 10:12:17 -07:00
35ff47411b Merge branch 'multi-config-support' of github.com:akohlmey/lammps into multi-config-support 2021-11-03 12:35:40 -04:00
7f0b2334a5 update plugin loader test 2021-11-03 11:52:32 -04:00
b95e12bb6c add additional function argument where we can supply our own CMakeLists.txt file 2021-11-03 11:50:39 -04:00
eb3f928f31 tweak epsilon for portability with windows 2021-11-03 10:54:40 -04:00
1ad982aa85 improve portability of unit test code for windows compilers 2021-11-03 10:54:21 -04:00
50f39cd752 implement and use a platform neutral abstraction of unsetenv(3) 2021-11-03 10:53:45 -04:00
e8f6024eae Fixed more whitespace issues 2021-11-03 11:46:56 +00:00
fc4fdd09ef Fixed more whitespace issues 2021-11-03 11:44:29 +00:00
a37a113044 Merge branch 'lammps:develop' into intpos 2021-11-03 11:02:01 +00:00
b8970366e0 Fixed whitespace issues 2021-11-03 10:59:04 +00:00
7ba211a727 Update dynamical matrix format 2021-11-02 21:57:55 -07:00
a9c6f943e1 correct test comparisons 2021-11-02 23:07:44 -04:00
6479116419 Merge branch 'develop' into multi-config-support 2021-11-02 16:39:12 -04:00
515ef7bece Merge pull request #3015 from lammps/dump-image-doc
Move dump_modify options specific to image/movie to dump image doc page
2021-11-02 13:22:27 -07:00
80579593e0 Merge pull request #3014 from akohlmey/collected_small_changes
Collected small changes and bugfixes
2021-11-02 13:02:31 -07:00
b044a2f88b switch to https protocol for cloning MathJax
https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-11-02 15:26:45 -04:00
d3af16c1fd Merge branch 'develop' into collected_small_changes
# Conflicts:
#	src/fix_vector.cpp
2021-11-02 14:41:16 -04:00
71d48bc48a Merge branch 'cmake_fixes' of https://github.com/pzeiger/lammps into collected_small_changes 2021-11-02 14:36:59 -04:00
91e6586e05 reorder 2021-11-02 14:35:36 -04:00
817e38fe68 change references to git:// protocol for accessing github to https:// 2021-11-02 14:33:21 -04:00
278e531c14 fix typo 2021-11-02 14:33:00 -04:00
175f967051 change references to git:// protocol for accessing github to https:// 2021-11-02 14:25:57 -04:00
59c060cc0e switch to https protocol for cloning MathJax
https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-11-02 14:14:08 -04:00
0439671e86 Merge pull request #3001 from akohlmey/modify-fix-compute-accessors
Add accessor functions to `Modify` and `Domain` that do not require using class internal data structures
2021-11-02 11:02:01 -07:00
628091c510 add reference instead of replicating headline 2021-11-02 13:33:08 -04:00
a58242f24b couple last tweaks to make the pages easier to navigate 2021-11-02 09:27:27 -06:00
dfc68e3c75 add header for dump_modify command summary 2021-11-02 08:49:34 -04:00
cf968ef286 Intpos (#10)
* hbond comm added for rsq_hb

* lrefpos removed, extract scaled for oxDNA1

* Update pair_oxdna_hbond.cpp
2021-11-02 09:52:56 +00:00
bb176318fe Merge branch 'lammps:develop' into intpos 2021-11-02 09:48:24 +00:00
7a228eedd2 move dump_modify options specific to image/movie to dump image doc page 2021-11-01 15:16:39 -06:00
9caad2be4d update security statement 2021-11-01 09:59:38 -04:00
d5bfa09faa modernize argument parsing 2021-11-01 09:19:33 -04:00
0bc9f887ec fix index error 2021-10-31 19:46:37 -04:00
6b3ddb8a72 fix logic bug 2021-10-31 19:29:12 -04:00
2e72d6b5a5 Merge branch 'develop' into modify-fix-compute-accessors 2021-10-31 18:25:42 -04:00
bbbde3cc15 fix indexing bug 2021-10-31 18:10:32 -04:00
3887b08c1d update new LAMMPS paper citation info 2021-10-31 18:10:32 -04:00
64764cc7b0 clarify the difference between C++ and Fortran versions of MEAM 2021-10-31 18:10:31 -04:00
4f0f791417 use new API, join loops, modernize 2021-10-31 17:37:43 -04:00
c5d6a310d8 Fixed cmake build script for QUIP in cases where MATH_LINKOPTS variable not set 2021-10-29 11:32:03 +02:00
4395530756 bugfix 2021-10-28 23:38:32 -04:00
ac4f2b2a32 use updated APIs 2021-10-28 23:25:04 -04:00
212d699078 implement Domain::get_region_by_id() 2021-10-28 23:24:38 -04:00
b15c02e3cd Merge pull request #3012 from akohlmey/reserved_data_section_keywords
Check for reserved data section keywords - update fix processing for data files
2021-10-28 19:52:27 -04:00
ed5c0e74d4 Merge pull request #3011 from stanmoore1/kk_bug
Revert some changes in 7960a2d
2021-10-28 19:50:27 -04:00
9ae05facb8 Updating file locations to master locations 2021-10-28 16:32:04 -07:00
440a517a5e update fix rigid + property/atom example to avoid runtime failure 2021-10-28 17:01:12 -04:00
7dbbb9a0e6 refactor fix cmap to use current style and modernized parsing 2021-10-28 16:54:53 -04:00
adf1beea74 add mechanism to check for known data file section names
using this mechanism we can reject custom section names that will
conflict with existing section names and thus avoid misleading errors.
apply this also to fix property atom, where the section name is
determined by the fix ID.
in addition, allow to specify NULL as section name, which will use
the fix ID.
2021-10-28 14:23:27 -04:00
e734eb837f Revert some changes in 7960a2d7d2 2021-10-28 08:39:17 -06:00
608ad0bca0 Merge branch 'lammps:develop' into intpos 2021-10-28 09:48:17 +01:00
c8512249b7 Merge branch 'develop' into modify-fix-compute-accessors
# Conflicts:
#	src/PLUGIN/plugin.cpp
2021-10-27 21:14:05 -04:00
4a048e3f57 Merge pull request #3008 from akohlmey/next_patch_release
Update version strings for next patch release
2021-10-27 20:19:33 -04:00
f72b532f0f Merge pull request #3009 from rbberger/collected_small_changes
Collected small changes
2021-10-27 19:31:22 -04:00
95d08c6667 update all makefiles to use DYN_LIB variable from master makefile 2021-10-27 17:41:16 -04:00
18a7c15441 forward DYN_LIB variable to Makefile.mpi 2021-10-27 17:21:38 -04:00
9424571ce2 Use correct sizeof in memset 2021-10-27 17:01:03 -04:00
153e77864d Use LAMMPS_THIRDPARTY_URL variable for EIGEN3_URL 2021-10-27 16:45:08 -04:00
4ea848b4e9 Merge pull request #3002 from akohlmey/more-clang-tidy-refactoring
Third chunk of semi-automatic refactoring with clang-tidy
2021-10-27 16:38:28 -04:00
2e9cdfa6dc Merge remote-tracking branch 'origin/develop' into collected_small_changes 2021-10-27 16:38:01 -04:00
51bd05bb77 Make update_downloads.sh detect new URLs and report error 2021-10-27 16:33:21 -04:00
addb087aac Merge branch 'lammps:develop' into intpos 2021-10-27 21:29:56 +01:00
c9da75ef85 Merge pull request #2968 from yury-lysogorskiy/feature/ml-pace-multispecies
Add multi-species support to ML-PACE package
2021-10-27 16:04:15 -04:00
a329de81bf Update source URLs for offline compilation tool 2021-10-27 15:56:28 -04:00
28d86578a3 update version strings for next patch release 2021-10-27 15:26:58 -04:00
da3115be2c Merge branch 'develop' into more-clang-tidy-refactoring
# Conflicts:
#	src/MANIFOLD/manifold_thylakoid.cpp
2021-10-27 15:23:57 -04:00
bd053d6841 Merge pull request #3004 from akohlmey/collected_small_changes
Collected small changes and bugfixes for the next patch release
2021-10-27 14:24:37 -04:00
b5e3d69c82 change downloaded archive name to more closely follow the confvention 2021-10-27 14:23:53 -04:00
c0c45be357 bugfix Fedora CMake compilation 2021-10-27 17:19:18 +02:00
9895d8436a update/clean downloading the ML-PACE/v.2021.10.25.tar.gz 2021-10-27 16:03:44 +02:00
a063209b2b update URL and filename for offline scripts 2021-10-27 08:31:36 -04:00
c911cd52bb whitespace 2021-10-27 08:24:07 -04:00
11ee3759df use consistent formatting 2021-10-27 08:22:18 -04:00
4957c8e382 Merge branch 'develop' into collected_small_changes 2021-10-27 08:20:19 -04:00
cc3349728b Merge pull request #2997 from stanmoore1/kk_omp_target
Add preliminary support for Kokkos OpenMPTarget backend
2021-10-27 08:15:45 -04:00
45359847f2 Merge pull request #3007 from masterleinad/avoid_retrict_icpx
Don't use -restrict for icpx
2021-10-27 08:10:09 -04:00
1247f4d67b add function to print information about available compressions tools 2021-10-26 20:00:55 -04:00
f0318fb874 try to make changing LMP_INC settings less confusing to inexperienced people 2021-10-26 19:16:13 -04:00
3376f3daa8 Remove unused import 2021-10-26 16:48:57 -04:00
008013ddfb Explicitly check for None 2021-10-26 15:19:46 -04:00
fe9dfc6095 follow Python style guidelines 2021-10-26 14:17:31 -04:00
3d9e4638a7 Don't use -restrict for icpx 2021-10-26 13:08:03 -04:00
3044923cbf less ambiguous tests for arguments being not None 2021-10-26 12:12:21 -04:00
f783958e39 add test for create_atoms() 2021-10-26 12:11:28 -04:00
20fec49635 Intpos (#8)
* use the term 'website' consistently (and not also 'web site')

* update for clang-format

* clarify

* split off the programming/submission style guide to a separate file

* Updates to support ROCm 4.3 in GPU package

* update and reorder the description of the process for submitting contributions

* correct and clarify Python compatibility

* refactor style guide and integrate text from issue

* update contribution guidelines for github

* mention when testing may be added

* integrate file with description of include file conventions

* update github workflow doc

* adapt section about domain decomposition from paper

* use a more compact image

* add communication section

* update man page with missing flags and correct URLs

* improve the load imbalance viz

* add section about neighbor list construction

* break large file into multiple smaller files by section and add toctree

* fix typo

* add section about parallelization in the OPENMP package

* add -skipruin to help message

* add discussion of OpenMP parallelization

* spelling

* add section on PPPM

* use larger version of FFT grid comm image

* minor tweak

* Update compute angle doc page

* Update Singularity definitions to use ROCm 4.3

* Update CUDA container definitions to CUDA 11.4

* Update container definitions to include PLUMED 2.7.2

* Update more definition files

* RHEL8/CentOS8 PowerTools is now powertools

* Add Rocky Linux 8 container definition

* Add omega field to numpy_wrapper detection

* Return None in case of null pointer

* Add more atom fields in numpy_wrapper and correct csforce size

* must not clear force array. will segfault in hybrid atom styles

* update example for dynamically loading LAMMPS with current library API

* update example to use current library interface. No need to use the namespace.

* add note to README files about age of the example

* simplify building shared libs on windows

* detect a few more compilers

* Revert "simplify building shared libs on windows"

This reverts commit fa3429ab02.

* step version strings for next patch release

* fix mingw 32-bit vs 64-bit craziness

* detect C++20 standard

* build "fat" cuda binaries only with known toolkits

* spelling

* Try to improve the pair style hybrid docs

This specifically tries to avoid the ambiguous use of "mixing" and
clarify that similar is still different when pair styles are concerned.
See discussion here: https://matsci.org/t/confusion-about-mixing-and-pair-coeff-section/38317/3

* spelling

* use nullptr

* use symbolic constant

* small optimization

* use cmath header instead of math.h

* use explicit scoping when virtual dispatch is not available.

* cosmetic changes

* simplify/optimize code

* simplify

* Bugfix from Trung for crashes in pppm/gpu without local atoms

* fix typo

* refer to "XXX Coeffs" sections consistently

* small tweaks from static code analysis

* fix small bug

* small tweaks

* simplify and modernize code a little

* use correct data type for MPI calls

* simplify/modernize

* remove dead code

* about 1.5x speedup for pair style comb3 by using MathSpecial::powint()

* small performance optimization for pair style comb

* simplify

* modernize

* simplify

* removed dead code, reformat

* modernize

* use explicit scoping when virtual dispatch is not (yet) available

* reformat for increased readability

* move misplaced #endif and make code more readable

* make sure err_flag is initialized

* modernize

* remove redundant code: all struct members are initialized to defaults in the constructor

* enforce initialization and thus silence compiler warnings

* fix typo

* provide more comprehensive suggestions for GPU neighbor list errors

* add utils::logical() function to complement the *numeric() functions

* Add stable link in docs

* revert modernization change (for now)

* remove unused variable

* include EXTRA-DUMP in "most"

* small tweaks

* simplify

* Add log file printing of KIM search directories in 'kim init'

* use clang-format on kim_init.cpp

* Improve style in response to Axel's suggestions

* initialize all members

* format changes

* simplify. use utils::strdup() more.

* small corrections

* apply fix from balance command to fix balance

* dead code removal

* reformat strings

* implement utils::current_date() convenience function to reduce replicated code

* update list and order of include files from include-what-you-use analysis

* handle changes in GAP repo

* a few remaining updates to include statements

* expand mapping to handle "style_*.h" header files correctly.

* add support for compilation of OpenCL loader on FreeBSD

* more iwyu header updates

* small correction

* fix typo

* a few more (final?) IWYU updates

* expand tests for numeric values

* return int instead of bool to minimize code changes

* fix spelling issues

* some applications of the new function

* fix typo

* Change "offsite" to "external" to correct broken URLs to lammps.org

* improve error message

* insert missing atom-ID

* convert yes/no on/off flags in the package command(s)

* update version strings

* update death tests for change in error message

* correctly specify the destructor function name.

* apply utils::logical() to more commands

* apply utils::logical() in more places

* for consistency with utils::logical()

* only accept lower case to be consistent with the rest of the input

* a few more converted commands and updates for unit tests

* modernize and fix some memory leaks

* adjust for compatibility with C++20 compilers

* do not downgrade C++ standard when adding the KOKKOS package

* undo "risky" C++20 related changes

* mention how to set the path to the fftw3_omp library

* correct paths to downloaded PACE package sources in lib

* Update CMake variable descriptions

* possible workaround for some GPU package neighbor list issue

* final chunk of changes to apply utils::logical()

* update suffix command unit tests

* update citation info with new LAMMPS paper reference and acknowledge it

* update some formulations as suggested by @sjplimp

* add check and suitable error message when fp64 is required but not available

* do not call memset on a null pointer

* fix string formatting bugs in fix npt/cauchy

* must use a soft core potential to avoid a singularity

* in floating point math a*b may be zero even if both a>0 and b>0

* use proper integer type for atom IDs

* Building voro++ lib as part of LAMMPS requires the "patch" program

* silence output from hwloc when launching LAMMPS

* detect double precision support according to OpenCL specs (1.2 and later)

* Fix bug in Kokkos pair_eam_alloy

* calling fwrite() with a null pointer causes undefined behavior. avoid it.

* cosmetic

* apply current include file conventions

* include zstd libs in windows build

* update .gitignore for recent additions

* make check more obvious

* step version strings for stable release

* Adjust for kim-api bug

* cleaner variant of version check, add directory numbering

* hbond comm added for rsq_hb

* rsq_hb removed, exyz added (no MPI comm yet)

* Fix Colvars output files not written with "run 0"

See:
  https://github.com/Colvars/colvars/commit/ff2f0d39ee5
which fixes a bug introduced in:
  https://github.com/Colvars/colvars/commit/1e964a542b

The message applies to NAMD, but the logic used in LAMMPS when handling "run 0" is very similar.

The Colvars version string is also updated, however this commit does not
include other changes, such as the following:
  https://github.com/Colvars/colvars/pull/419
which were not fully completed before the LAMMPS Summer 2021 finalization.

* add -std=c++11 to a number of machine makefiles for traditional make build

* copy request to mention lammps.org form home page instructions for citing

* be more specific about what the name of the LAMMPS executable can be

also provide a few more examples without a machine suffix

* small tweak

* remove references to USER packages, have package lists alphabetically sorted

"make package-update" or "make pu" must be processed in the special order
because of inter-package dependencies

* make "make package-update" and "make package-overwrite" less verbose

* freeze versions of pip packages for processing the manual of the stable version

this way we avoid surprises in case one of the packages get updated
to an incompatible new version. these are know-to-work versions.

* make sure the one_coeff flag is applied to sub-styles

since the check for Pair::one_coeff was moved to the Input class (to
reduce redundant code), hybrid substyles could "escape" that requirement.
Thus checks have to be added to the hybrid coeff() methods.

* Prevent neigh list from copying "unique" stencil/bin

* compiling ML-HDNNP with downloaded n2p2 lib requires the sed command

* detect and error out if BLAS/LAPACK libraries variables are a list

This will cause external project compilation to fail since the semi-colons
are converted to blanks, but one cannot properly escape the variables.
So far the only viable solution seems to be to convert the scripts from
using ExternalProject_add() to FetchContent and add_subdirectory()

* portability improvement

* must have patch command available to compile ScaFaCoS

* only need Tcl not Tk to compile Tcl swig wrapper

* correctly handle Tcl stub library if available

* add missing keyword

* hbond_pos added, MPI and values ok, Pair time slow.

* make C library example work with strict C compilers

* silence compiler warnings

* make Nevery keyword per-reaction

* recover cross-compilation with mingw64

* reverted wrong approach from last commits

- now intpos flag
- hbond_pos added
- (a/b)xyz WiP

* lrefpos working in serial, MPI wrong

* attempt to merge doubles into n(xyz)[3]

* save

* Update pair_oxdna_hbond.cpp

* hbond now working for MPI, comming lrefpos

* extracting nxyz in excv/bond working

Co-authored-by: Axel Kohlmeyer <akohlmey@gmail.com>
Co-authored-by: Richard Berger <richard.berger@temple.edu>
Co-authored-by: Ryan S. Elliott <relliott@umn.edu>
Co-authored-by: Stan Gerald Moore <stamoor@sandia.gov>
Co-authored-by: Giacomo Fiorin <giacomo.fiorin@gmail.com>
Co-authored-by: Jacob Gissinger <jrgiss05@gmail.com>
Co-authored-by: Oliver Henrich <ohenrich@users.noreply.github.com>
2021-10-26 16:45:44 +01:00
2a9a8adfc0 apply clang-format 2021-10-26 06:41:00 -04:00
886d6702c4 remove dead code 2021-10-26 06:38:47 -04:00
5141a80142 remove useless logical 2021-10-26 06:38:35 -04:00
30001f2698 use preprocessor 2021-10-26 06:37:59 -04:00
4551bf4bc0 yaml-cpp-pace: bugfix in CMakeLists.txt 2021-10-26 10:19:11 +02:00
8bf016eaef use references when looping over fixes from list 2021-10-25 21:41:57 -04:00
52d99700ec Download and compile modified YAML-cpp 0.6.3 in namespace YAML_PACE 2021-10-25 17:34:08 +02:00
d0416757b7 simplify using new APIs 2021-10-24 18:00:15 -04:00
a782f8f8e0 more specific warning about atoms inability to move 2021-10-24 17:59:30 -04:00
29a44e7065 remove parser_error exception class ambiguity completely 2021-10-23 04:25:20 -04:00
71a24580b8 remove parser_error exception class ambiguity completely 2021-10-23 04:24:54 -04:00
8a9117d511 add configurations for intel compilers 2021-10-22 16:32:16 -04:00
6f14cbf167 Small adjustments for compiling within VS 2021-10-22 16:32:02 -04:00
7abcdc8c4c use anonymous namespace to manage visibility of multiple copies of parse_error class 2021-10-22 16:16:08 -04:00
47eab736bb use anonymous namespace to manage visibility of multiple copies of parse_error class 2021-10-22 16:14:06 -04:00
c08093f768 modernize, avoid static buffers, use utility functions, remove debug code 2021-10-22 16:00:01 -04:00
7960a2d7d2 Fix link error with fix_acks2_reaxff_kokkos 2021-10-22 19:13:31 +00:00
b6c610ada2 tweak epsilon for portability to MSVC compilers 2021-10-22 14:12:19 -04:00
89808266dd remove obsolete file 2021-10-22 13:46:13 -04:00
4edd5238b1 improve putenv() and unsetenv() implementation on windows by using _putenv_s() 2021-10-22 13:21:45 -04:00
0901540fda Remove deprecated Kokkos code 2021-10-22 16:41:26 +00:00
3cce6b46e2 Fix thread divergence issue when not using CUDA/HIP 2021-10-22 16:20:37 +00:00
7318aa49d8 set define for static linkage to avoid issues linking libyaml on windows 2021-10-22 12:12:20 -04:00
614b751f5f Add missing brace 2021-10-22 16:09:46 +00:00
228187978d Merge branch 'develop' of https://github.com/lammps/lammps into kk_omp_target 2021-10-22 16:08:00 +00:00
5c9a4f4be0 implement platform abstraction of unsetenv() 2021-10-22 11:05:32 -04:00
69f5e1feac Enable testing for Debug configurations in VS 2021-10-22 09:25:44 -05:00
bd9ad288b9 recover compilation of test on windows 2021-10-22 09:13:07 -05:00
d7d1c84b35 only build a custom YAML lib, if not installed 2021-10-22 08:56:00 -04:00
ced96441ef update hash after change in repo 2021-10-22 08:44:30 -04:00
ad81dd3960 recover original new style library target names through ALIAS library definitions 2021-10-22 08:23:49 -04:00
b57c8bda51 build yaml library using custom CMakeLists.txt file 2021-10-21 23:39:56 -04:00
8d6461ffcd whitespace 2021-10-21 23:39:14 -04:00
a796d6b824 fix logic bug 2021-10-21 21:04:15 -04:00
7cc5092547 make portable to MSVC++ 2021-10-21 21:01:59 -04:00
7d16078cf4 always use .so suffix for plugins 2021-10-21 19:35:48 -04:00
3869e3fce8 adjust for compiling on windows 2021-10-21 19:27:59 -04:00
6ad03498c3 make finding plugins for testing multi-config compatible 2021-10-21 19:22:01 -04:00
e75757007e always compile position independent code 2021-10-21 19:21:34 -04:00
6e3fcce9e1 move download and extract code into function 2021-10-21 17:35:49 -04:00
d8db9dd3ac Merge branch 'develop' into multi-config-support
# Conflicts:
#	cmake/Modules/GTest.cmake
2021-10-21 10:26:31 -04:00
ede188652b update a few GPU kernels so they can be compiled on GPUs without double precisions support 2021-10-21 07:33:00 -04:00
a0b25acf35 refactor loops using (auto var : container) syntax 2021-10-20 21:58:31 -04:00
85433e8bd1 use true/false instead of 1/0 detected and changed by clang-tidy 2021-10-20 12:41:02 -04:00
682f862f43 apply clang-format 2021-10-20 06:56:54 -04:00
2e362b1f3f use get_(fix|compute)_by_id() instead of find_(fix|compute)() 2021-10-20 06:56:46 -04:00
8cd4460c62 fix typo 2021-10-19 15:50:19 -04:00
89d70aeabf work around issue with skipping creation of fix RESPA for whichflag == 0 2021-10-19 15:50:09 -04:00
2857577dda replace find_region_by_style() with get_region_by_style() with same semantics as find_fix_by_style() 2021-10-19 12:38:00 -04:00
597ee207b1 remove now obsolete find_fix_by_style() and find_compute_by_style() members 2021-10-19 12:37:02 -04:00
3ae0aae018 update remaining uses of find_fix_by_style() 2021-10-19 12:36:31 -04:00
162789ad7f Merge branch 'develop' into modify-fix-compute-accessors 2021-10-19 12:00:43 -04:00
84666543d1 Merge pull request #2998 from akohlmey/collected_small_changes
Collected small changes and bugfixes
2021-10-19 10:33:51 -04:00
1cd0551197 more direct version of clearing out loaded plugins 2021-10-19 08:27:49 -04:00
81a5beb8cc must not have folders names differing only in case: "MC" versu "mc"
This is causing problems on MacOS and Windows with case preserving
but case insensitive file systems.
2021-10-18 18:13:21 -04:00
f9e99f1f4c wipe out all loaded plugins before destroying the LAMMPS instance 2021-10-18 18:04:04 -04:00
241c816ad3 adapt fix shake and pair style spin 2021-10-18 17:29:25 -04:00
0e369fb9b5 update example to represent recent style changes. 2021-10-18 13:47:29 -04:00
5e102e1bfe ML-PACE.cmake: find_package(yaml-cpp 0.6.3 EXACT QUITE) first, otherwise dowload from github/yaml-cpp tag 0.6.3 2021-10-18 18:43:38 +02:00
87b63f768f Only check for GPU double precision support if a GPU is present 2021-10-18 12:15:05 -04:00
fc0e6af7dd fix memory leaks 2021-10-18 07:11:55 -04:00
dd2ff737f1 port mdi/engine command to new fix accessor API 2021-10-18 06:50:28 -04:00
11a4920b30 refactor PERI package pair styles to use new accessors and to increase code sharing 2021-10-18 06:47:01 -04:00
f6fb392c4d convert some more styles to use the new APIs 2021-10-17 19:19:23 -04:00
26b368848b Add support for an "Update #" appendix to the version string
This is for informative output only, so that any code depending
on the LAMMPS_VERSION define will not have to be changed and no
warnings will be printed etc.
2021-10-17 18:06:29 -04:00
1e9da5a25b port dump vtk to correctly support custom per-atom arrays and fix some bugs 2021-10-17 10:58:33 -04:00
6145ef9cd2 fix bugs related to custom per-atom properties in dump style custom 2021-10-17 10:57:16 -04:00
702d861a58 update to use new accessor APIs 2021-10-16 22:31:23 -04:00
064e7fde2f must not dereference null pointer 2021-10-16 22:30:38 -04:00
f392b089a4 modernize 2021-10-16 21:40:17 -04:00
cfdf9cee5d modernize 2021-10-16 21:28:18 -04:00
e990a1cf61 remove ambiguity between "double_precision" class member variable and function 2021-10-16 21:07:04 -04:00
8cf030e476 small tweak for mixed precision GPU runs 2021-10-16 07:28:16 -04:00
59d79ce176 update googletest to version 1.11 2021-10-16 07:16:40 -04:00
5b40e4cb38 new accessor APIs for fixes and computes in Modify plus a few applications 2021-10-16 06:00:28 -04:00
ab30ed4ca9 modernize 2021-10-16 05:35:24 -04:00
83e58eadb7 correct expansion of fix/compute/variable arguments to avoid bogus thermo outpu 2021-10-15 20:23:31 -04:00
6827f71f26 pppm kspace styles also require -DFFT_SINGLE when using GPUs in single precision 2021-10-15 20:23:07 -04:00
47523da16b allow single precision FFT introspection 2021-10-15 20:03:39 -04:00
222063e5cf Add preliminary support for Kokkos OpenMPTarget backend 2021-10-15 17:32:37 -06:00
20cd742b4a whitespace & urls 2021-10-15 15:59:15 -06:00
fa412c13aa Add compute phase/atom 2021-10-15 15:43:26 -06:00
5140d26748 plug memory leaks 2021-10-15 16:59:53 -04:00
98cdfa1016 fix bug detected by coverity scan 2021-10-15 09:29:47 -04:00
ef04f6ca69 Merge pull request #2993 from akohlmey/collected_small_changes
Collected small changes and fixes
2021-10-14 15:32:42 -04:00
5a90bca49e Merge pull request #2994 from akohlmey/more-clang-tidy-refactor
Second chunk of semi-automatic refactoring with clang-tidy
2021-10-14 13:33:00 -04:00
64268de24b Merge branch 'master' into collected-small-changes 2021-10-14 13:31:30 -04:00
356dbab587 Merge pull request #2991 from mphowardlab/bugfix-brownian
Fix Brownian noise scale factor
2021-10-14 12:23:04 -04:00
cd526ad54c try to find system libyaml-cpp v.0.6.3 library, otherwise use downloaded one 2021-10-14 15:16:48 +02:00
267bc7ae2d avoid (unlikely) integer overflows with very large systems 2021-10-14 08:07:43 -04:00
d857685e74 use emplace_back() instead of push_back() 2021-10-14 01:31:48 -04:00
2106075320 use call-by-value with std::move() function 2021-10-14 01:30:18 -04:00
e56cc9be00 use initializer list instead of explicit constructor 2021-10-14 01:12:44 -04:00
27145d2789 catch up on refactoring default destructors that were missed previously 2021-10-14 01:12:04 -04:00
3ad75c40ec catch up on previous clang-tidy refactor for files that were skipped before 2021-10-13 23:59:43 -04:00
2fba6b44e4 use '= default' when default functions should be used 2021-10-13 23:59:05 -04:00
34d54247b6 Merge branch 'develop' into collected_small_changes 2021-10-13 22:55:21 -04:00
cc416b97f0 Merge pull request #2990 from akohlmey/clang-tidy-refactor
First chunk of semi-automated refactoring using clang-tidy
2021-10-13 22:51:25 -04:00
3f3d44bc25 add new files 2021-10-13 22:47:37 -04:00
a1572ce9a5 link with -ldl except on Windows for dlopen/dlclose/dlsym support 2021-10-13 22:47:25 -04:00
f4851e9103 change check for reset image flags to print messages only once per data file 2021-10-13 21:54:18 -04:00
a1fb6902d5 Merge pull request #2992 from lammps/molswap
Add a new fix mol/swap command
2021-10-13 21:33:52 -04:00
afad3f42d5 Report only compatible GPU, i.e. no GPU if mixed/double precision is requested by the hardware does not support it 2021-10-13 21:15:16 -04:00
c322064ff3 Merge pull request #2931 from stanmoore1/acks2_release
Add ACKS2 charge equilibration method to REAXFF and support for electric fields in qeq/reaxff
2021-10-13 20:27:57 -04:00
c5617dc006 fix spelling and make consistent 2021-10-13 19:25:09 -04:00
660bced187 whitespace, pointer initializer, and permission fixes 2021-10-13 19:17:42 -04:00
69a3b5b215 move common init() code into base class. warn when used with fix efield 2021-10-13 18:54:10 -04:00
a922c91c1a document restrictions to using ReaxFF charge equilibration with fix efield 2021-10-13 18:53:09 -04:00
06ef216e61 protect against using multiple fix efield instances. improve error messages. 2021-10-13 18:26:09 -04:00
c8dc6c5010 whitespace 2021-10-13 18:25:13 -04:00
547b9850b9 tiny optimization 2021-10-13 18:18:58 -04:00
56ce880b32 update force-style test data with corrected efield strength computation 2021-10-13 18:06:49 -04:00
f206eab338 mv examples/gcmc to mc, add 2 scripts for fix mol/swap 2021-10-13 15:02:33 -06:00
74219585f3 Update log files 2021-10-13 14:03:50 -06:00
5f7e56e1c2 Fix Brownian noise scale factor 2021-10-13 14:51:58 -05:00
9cfb822847 Merge branch 'master' of github.com:lammps/lammps into acks2_release 2021-10-13 13:37:04 -06:00
727a028a6f Add inputs with field 2021-10-13 13:08:08 -06:00
67673a6055 Fix negative sign in chi_field 2021-10-13 12:30:19 -06:00
552d960b39 Fix double space 2021-10-13 10:43:26 -06:00
87cc67778b Merge branch 'master' into feature/ml-pace-multispecies
# Conflicts:
#	src/ML-PACE/pair_pace.cpp
2021-10-13 17:34:29 +02:00
ac8cf33a51 Merge pull request #1 from srmnitc/master
Use only itype for scale variable in both forces and energy
2021-10-13 16:53:49 +02:00
1f9ce77c85 Use only itype for scale variable in both forces and energy 2021-10-13 16:34:33 +02:00
d207710b43 lrefpos (nx/y/z) now working in oxdna_hbond. Being comm'ed and MPI working (#7)
* use the term 'website' consistently (and not also 'web site')

* update for clang-format

* clarify

* split off the programming/submission style guide to a separate file

* Updates to support ROCm 4.3 in GPU package

* update and reorder the description of the process for submitting contributions

* correct and clarify Python compatibility

* refactor style guide and integrate text from issue

* update contribution guidelines for github

* mention when testing may be added

* integrate file with description of include file conventions

* update github workflow doc

* adapt section about domain decomposition from paper

* use a more compact image

* add communication section

* update man page with missing flags and correct URLs

* improve the load imbalance viz

* add section about neighbor list construction

* break large file into multiple smaller files by section and add toctree

* fix typo

* add section about parallelization in the OPENMP package

* add -skipruin to help message

* add discussion of OpenMP parallelization

* spelling

* add section on PPPM

* use larger version of FFT grid comm image

* minor tweak

* Update compute angle doc page

* Update Singularity definitions to use ROCm 4.3

* Update CUDA container definitions to CUDA 11.4

* Update container definitions to include PLUMED 2.7.2

* Update more definition files

* RHEL8/CentOS8 PowerTools is now powertools

* Add Rocky Linux 8 container definition

* Add omega field to numpy_wrapper detection

* Return None in case of null pointer

* Add more atom fields in numpy_wrapper and correct csforce size

* must not clear force array. will segfault in hybrid atom styles

* update example for dynamically loading LAMMPS with current library API

* update example to use current library interface. No need to use the namespace.

* add note to README files about age of the example

* simplify building shared libs on windows

* detect a few more compilers

* Revert "simplify building shared libs on windows"

This reverts commit fa3429ab02.

* step version strings for next patch release

* fix mingw 32-bit vs 64-bit craziness

* detect C++20 standard

* build "fat" cuda binaries only with known toolkits

* spelling

* Try to improve the pair style hybrid docs

This specifically tries to avoid the ambiguous use of "mixing" and
clarify that similar is still different when pair styles are concerned.
See discussion here: https://matsci.org/t/confusion-about-mixing-and-pair-coeff-section/38317/3

* spelling

* use nullptr

* use symbolic constant

* small optimization

* use cmath header instead of math.h

* use explicit scoping when virtual dispatch is not available.

* cosmetic changes

* simplify/optimize code

* simplify

* Bugfix from Trung for crashes in pppm/gpu without local atoms

* fix typo

* refer to "XXX Coeffs" sections consistently

* small tweaks from static code analysis

* fix small bug

* small tweaks

* simplify and modernize code a little

* use correct data type for MPI calls

* simplify/modernize

* remove dead code

* about 1.5x speedup for pair style comb3 by using MathSpecial::powint()

* small performance optimization for pair style comb

* simplify

* modernize

* simplify

* removed dead code, reformat

* modernize

* use explicit scoping when virtual dispatch is not (yet) available

* reformat for increased readability

* move misplaced #endif and make code more readable

* make sure err_flag is initialized

* modernize

* remove redundant code: all struct members are initialized to defaults in the constructor

* enforce initialization and thus silence compiler warnings

* fix typo

* provide more comprehensive suggestions for GPU neighbor list errors

* add utils::logical() function to complement the *numeric() functions

* Add stable link in docs

* revert modernization change (for now)

* remove unused variable

* include EXTRA-DUMP in "most"

* small tweaks

* simplify

* Add log file printing of KIM search directories in 'kim init'

* use clang-format on kim_init.cpp

* Improve style in response to Axel's suggestions

* initialize all members

* format changes

* simplify. use utils::strdup() more.

* small corrections

* apply fix from balance command to fix balance

* dead code removal

* reformat strings

* implement utils::current_date() convenience function to reduce replicated code

* update list and order of include files from include-what-you-use analysis

* handle changes in GAP repo

* a few remaining updates to include statements

* expand mapping to handle "style_*.h" header files correctly.

* add support for compilation of OpenCL loader on FreeBSD

* more iwyu header updates

* small correction

* fix typo

* a few more (final?) IWYU updates

* expand tests for numeric values

* return int instead of bool to minimize code changes

* fix spelling issues

* some applications of the new function

* fix typo

* Change "offsite" to "external" to correct broken URLs to lammps.org

* improve error message

* insert missing atom-ID

* convert yes/no on/off flags in the package command(s)

* update version strings

* update death tests for change in error message

* correctly specify the destructor function name.

* apply utils::logical() to more commands

* apply utils::logical() in more places

* for consistency with utils::logical()

* only accept lower case to be consistent with the rest of the input

* a few more converted commands and updates for unit tests

* modernize and fix some memory leaks

* adjust for compatibility with C++20 compilers

* do not downgrade C++ standard when adding the KOKKOS package

* undo "risky" C++20 related changes

* mention how to set the path to the fftw3_omp library

* correct paths to downloaded PACE package sources in lib

* Update CMake variable descriptions

* possible workaround for some GPU package neighbor list issue

* final chunk of changes to apply utils::logical()

* update suffix command unit tests

* update citation info with new LAMMPS paper reference and acknowledge it

* update some formulations as suggested by @sjplimp

* add check and suitable error message when fp64 is required but not available

* do not call memset on a null pointer

* fix string formatting bugs in fix npt/cauchy

* must use a soft core potential to avoid a singularity

* in floating point math a*b may be zero even if both a>0 and b>0

* use proper integer type for atom IDs

* Building voro++ lib as part of LAMMPS requires the "patch" program

* silence output from hwloc when launching LAMMPS

* detect double precision support according to OpenCL specs (1.2 and later)

* Fix bug in Kokkos pair_eam_alloy

* calling fwrite() with a null pointer causes undefined behavior. avoid it.

* cosmetic

* apply current include file conventions

* include zstd libs in windows build

* update .gitignore for recent additions

* make check more obvious

* step version strings for stable release

* Adjust for kim-api bug

* cleaner variant of version check, add directory numbering

* hbond comm added for rsq_hb

* rsq_hb removed, exyz added (no MPI comm yet)

* Fix Colvars output files not written with "run 0"

See:
  https://github.com/Colvars/colvars/commit/ff2f0d39ee5
which fixes a bug introduced in:
  https://github.com/Colvars/colvars/commit/1e964a542b

The message applies to NAMD, but the logic used in LAMMPS when handling "run 0" is very similar.

The Colvars version string is also updated, however this commit does not
include other changes, such as the following:
  https://github.com/Colvars/colvars/pull/419
which were not fully completed before the LAMMPS Summer 2021 finalization.

* add -std=c++11 to a number of machine makefiles for traditional make build

* copy request to mention lammps.org form home page instructions for citing

* be more specific about what the name of the LAMMPS executable can be

also provide a few more examples without a machine suffix

* small tweak

* remove references to USER packages, have package lists alphabetically sorted

"make package-update" or "make pu" must be processed in the special order
because of inter-package dependencies

* make "make package-update" and "make package-overwrite" less verbose

* freeze versions of pip packages for processing the manual of the stable version

this way we avoid surprises in case one of the packages get updated
to an incompatible new version. these are know-to-work versions.

* make sure the one_coeff flag is applied to sub-styles

since the check for Pair::one_coeff was moved to the Input class (to
reduce redundant code), hybrid substyles could "escape" that requirement.
Thus checks have to be added to the hybrid coeff() methods.

* Prevent neigh list from copying "unique" stencil/bin

* compiling ML-HDNNP with downloaded n2p2 lib requires the sed command

* detect and error out if BLAS/LAPACK libraries variables are a list

This will cause external project compilation to fail since the semi-colons
are converted to blanks, but one cannot properly escape the variables.
So far the only viable solution seems to be to convert the scripts from
using ExternalProject_add() to FetchContent and add_subdirectory()

* portability improvement

* must have patch command available to compile ScaFaCoS

* only need Tcl not Tk to compile Tcl swig wrapper

* correctly handle Tcl stub library if available

* add missing keyword

* hbond_pos added, MPI and values ok, Pair time slow.

* make C library example work with strict C compilers

* silence compiler warnings

* make Nevery keyword per-reaction

* recover cross-compilation with mingw64

* reverted wrong approach from last commits

- now intpos flag
- hbond_pos added
- (a/b)xyz WiP

* lrefpos working in serial, MPI wrong

* attempt to merge doubles into n(xyz)[3]

* save

* Update pair_oxdna_hbond.cpp

* hbond now working for MPI, comming lrefpos

Co-authored-by: Axel Kohlmeyer <akohlmey@gmail.com>
Co-authored-by: Richard Berger <richard.berger@temple.edu>
Co-authored-by: Ryan S. Elliott <relliott@umn.edu>
Co-authored-by: Stan Gerald Moore <stamoor@sandia.gov>
Co-authored-by: Giacomo Fiorin <giacomo.fiorin@gmail.com>
Co-authored-by: Jacob Gissinger <jrgiss05@gmail.com>
2021-10-13 10:47:41 +01:00
165708adeb use nullptr in unittest tree 2021-10-12 22:52:50 -04:00
643a7a1acb replace std::random_shuffle() with std::shuffle() to be compatible with C++17 and beyond 2021-10-12 22:39:30 -04:00
88631372ec use nullptr instead of NULL or 0 where applicable 2021-10-12 21:47:02 -04:00
dd6f49a753 use 'noexcept' instead of the deprecated 'throw()' 2021-10-12 21:29:33 -04:00
7b6a3c4307 remove redundant void arguments 2021-10-12 21:17:46 -04:00
1002763df3 remove default class members except for the assignment copy constructor 2021-10-12 21:17:00 -04:00
1d1573c5f2 Merge branch 'develop' into multi-config-support 2021-10-12 14:42:32 -04:00
26cd988672 Merge pull request #2989 from rbberger/unittest_bugfixes
Avoid file name collisions in dump unit tests
2021-10-12 14:41:25 -04:00
a8f42bd534 tweak to atom/swap doc page 2021-10-12 11:50:04 -06:00
c22dae8d2c add a new fix 2021-10-12 11:48:26 -06:00
113c53a5da doc page for new fix mol/swap 2021-10-12 11:45:50 -06:00
0bc6373386 Merge pull request #2983 from akohlmey/collected-small-changes
Collected small changes and bugfixes
2021-10-12 13:26:50 -04:00
77d830bf3a update YAML-CPP library target name to yaml-cpp-pace 2021-10-12 18:15:31 +02:00
a1ff9e35b7 Avoid file name collisions in dump unit tests 2021-10-12 12:15:19 -04:00
0a98ff3c38 add more features to mol/swap, sync with atom/swap 2021-10-12 09:56:51 -06:00
93d6e6dec9 update for new way of using googletest 2021-10-12 11:46:37 -04:00
2651e4650f use the new name of the main branch 2021-10-11 23:23:24 -04:00
9cf6b927cb Merge branch 'master' into collected-small-changes
# Conflicts:
#	src/REAXFF/fix_reaxff_species.cpp
2021-10-11 21:24:11 -04:00
96a45224de whitespace 2021-10-11 21:10:14 -04:00
27c9ba465b avoid duplication of Accelerator package info in additional doc pages 2021-10-11 16:49:59 -06:00
eedd953258 remove debug logic 2021-10-11 16:20:19 -06:00
cb77555fa6 update title in reference to accelerator section 2021-10-11 17:26:24 -04:00
510987dc80 Merge branch 'master' into multi-config-support
# Conflicts:
#	cmake/Modules/Packages/MSCG.cmake
#	examples/plugins/CMakeLists.txt
2021-10-11 17:03:41 -04:00
7bed85ef19 add debug statements 2021-10-11 15:00:20 -06:00
e79930dfb9 add check to prohibit using fix efield component in periodic direction with reaxff 2021-10-11 16:48:38 -04:00
4faca6531a fix typo 2021-10-11 16:35:54 -04:00
a45dbb6510 no need for static string buffers anymore 2021-10-11 16:35:42 -04:00
1f4c50037b Merge branch 'master' into acks2_release 2021-10-11 16:13:20 -04:00
a6cde11896 Merge pull request #2985 from stanmoore1/kk_issues
Fix issues with Kokkos package
2021-10-11 15:27:58 -04:00
2290ade2f2 ensure that fix efield is initialized before accessing its data. 2021-10-11 15:06:24 -04:00
6d2b32f0b2 move chi field calculation to fix qeq/reaxff 2021-10-11 14:35:23 -04:00
2ea4c71125 Merge pull request #2979 from akohlmey/platform-namespace
Implement a "platform" sub-namespace with platform specific functions and wrappers
2021-10-11 13:41:15 -04:00
70cbb72e42 Merge branch 'master' into acks2_release 2021-10-11 09:58:44 -04:00
a3e59082bf small adjustments and apply clang-format 2021-10-11 08:13:44 -04:00
124f7760d8 Merge branch 'master' into feature/ml-pace-multispecies 2021-10-11 07:30:22 -04:00
0c57267a85 update branch names 2021-10-10 04:44:45 -04:00
eb6b73c752 update documentation to refer to the new branch names (develop, release) 2021-10-10 04:39:16 -04:00
54e2e58aec update fmtlib to version 8.0.1 2021-10-09 23:57:35 -04:00
cf4e671474 Merge branch 'master' into fmt_upgrade 2021-10-09 23:42:17 -04:00
64b27fa28e only run windows compilation action on master branch in lammps repo 2021-10-09 20:54:18 -04:00
1bbed2579b try alternate approach to make MSVC++ happy linking STUBS 2021-10-09 20:32:39 -04:00
c3629b5f01 MS VC++ needs to have STUBS with PUBLIC linkage 2021-10-09 20:27:47 -04:00
5ad7e5a815 correct path to preset file and do two quick runs for checking the binary 2021-10-09 19:55:30 -04:00
2e122ff62b Add GitHub action compiling LAMMPS with Visual C++ 2021-10-09 19:46:52 -04:00
f558a5c06f update LAMMPS homepage URLs 2021-10-09 11:41:54 -04:00
5739621f5c make single() function consistent with compute() function 2021-10-09 11:33:02 -04:00
c8c3e8f661 use predefined constant and apply optimization for power function with integer argument 2021-10-09 11:27:35 -04:00
3a4b68a464 modernize code 2021-10-09 11:18:33 -04:00
ed23a3aa69 correct comments 2021-10-09 11:18:16 -04:00
018e37a2e9 add unit tests for bond style fene/nm/split and pair style nm/cut/split 2021-10-09 11:06:18 -04:00
7bdf52eac5 do not shadow members of the BondFENE base class and use the corresponding allocation/deallocation 2021-10-09 11:00:19 -04:00
ba44d6aba2 must set define to "see" the lammps_open() library function 2021-10-09 10:20:47 -04:00
dd6e3c1acc avoid variable length array and signed vs. unsigned warnings 2021-10-08 20:07:20 -04:00
241e01edba whitespace 2021-10-08 19:00:30 -04:00
c5205be071 update src/.gitignore 2021-10-08 16:25:55 -04:00
a0fc74f1a9 make class names, include guards and formatting consistent. apply clang-format 2021-10-08 16:25:44 -04:00
3313d3bfa3 make documentation consistent and properly integrate it 2021-10-08 16:24:57 -04:00
fc42992cdf Merge branch 'master' into nm_split_styles 2021-10-08 15:57:17 -04:00
09bcfc2116 document visual studio support 2021-10-08 15:33:49 -04:00
ae0fa17132 make consistent with include files 2021-10-08 15:33:26 -04:00
83bc70bf05 workaround for classic intel compiler on windows 2021-10-08 15:11:16 -04:00
fb137b26bf silence compiler warnings 2021-10-08 13:59:17 -04:00
46efae5998 needed for compilation on windows. not really used because of platform::walltime() 2021-10-08 13:58:08 -04:00
6e8da80148 adjustments for intel compilers on windows 2021-10-08 13:57:09 -04:00
cc11fa37b2 whitespace 2021-10-08 11:44:09 -04:00
392ebf7db7 revise automatic seed generation 2021-10-08 11:35:55 -04:00
b5061b69be add warning to fix reaxff/species to explain the impact of large averaging 2021-10-07 20:46:01 -04:00
30c146457a improve messages 2021-10-07 20:29:01 -04:00
4b86dbd200 add cmake configuration file for visual studio 2021-10-07 17:11:33 -04:00
e12fa57794 A few more tweaks 2021-10-07 17:11:04 -04:00
4fca127ea4 copy MSVC++ compiler hacks to plugin CMakeLists.txt file 2021-10-07 15:59:12 -04:00
d5b3ea263b awpmd requires blas, mgpt is not portable 2021-10-07 15:45:14 -04:00
5d5cc0ac55 preset with packages that build natively on windows with visual c++ 2021-10-07 15:31:26 -04:00
ef8aa4de90 silence warning 2021-10-07 15:29:46 -04:00
3a3f07d91a use portable logic operators 2021-10-07 15:05:32 -04:00
2b27af1572 fix a few more MSVC issues and reduce warnings 2021-10-07 14:37:37 -04:00
2c7b67203a recover unit test compile 2021-10-07 13:44:18 -04:00
0f442fddd9 correct use of utils function 2021-10-07 12:40:29 -04:00
6a9bb577cf rename "zip" functions to "compress" functions. update related docs 2021-10-07 12:38:11 -04:00
4f17082d74 use portable logic operators 2021-10-07 12:23:17 -04:00
3661b8cd50 optimize 2021-10-07 12:22:26 -04:00
a818be585d use portable functions from platform and utils namespaces 2021-10-07 12:22:16 -04:00
7372211d90 there is no more need to keep a copy of the arguments
this also eliminates buffer overflow bugs where the terminating 0 bytes
of copied strings are overwritten causing the fix to fail.
2021-10-07 07:42:13 -04:00
c8ff66e07f correct file extension for Zstd compressed files 2021-10-07 06:49:49 -04:00
059f450f1b add uppercase string utility function (for symmetry) 2021-10-07 00:00:33 -04:00
b8d6df6461 add missing platform scope 2021-10-06 20:44:42 -05:00
98d9b675f9 Use portable logical operators 2021-10-06 20:44:27 -05:00
5c34fe4d5d Replace strcasecmp() 2021-10-06 20:43:56 -05:00
b3ca238a61 silence warning 2021-10-06 17:44:57 -04:00
ef84435b7c replace non-portable strcasecmp() with comparing two strings converted to lowercase 2021-10-06 17:44:45 -04:00
a9bccee7b2 add utility to convert a string to lowercase 2021-10-06 17:43:41 -04:00
aab3e085a2 silence compiler warning on windows 2021-10-06 16:49:48 -04:00
f643c2b98f portability changes 2021-10-06 16:34:39 -04:00
50d997526c a few more MSVC++ tweaks for improved compatibility and fewer warnings 2021-10-06 16:18:21 -04:00
4260d31b85 whitespace 2021-10-06 15:57:33 -04:00
7a1cf322e5 more tweaks for Visual C++ compilation and portability 2021-10-06 15:57:26 -04:00
6c7b42a190 small tweaks and fixes for compiling with MSVC++ 2021-10-06 15:24:59 -04:00
ec1a55b35b use platform code for reading/writing of compressed text file via a pipe 2021-10-06 15:04:48 -04:00
a539c317b3 Revert changes to makefile 2021-10-06 11:43:40 -07:00
3d86a0f5f6 Fix two bugs in compute_orientorder_atom_kokkos 2021-10-06 11:15:34 -07:00
891d4c278f port dump movie to platform namespace 2021-10-06 14:08:45 -04:00
5059bfe32b add Stan to Modify class as co-codeowner 2021-10-06 12:09:20 -04:00
d9288ae7e9 whitespace 2021-10-06 08:33:02 -07:00
bbfb2d2712 Add missing code to modify_kokkos 2021-10-06 08:27:25 -07:00
4aae11f8fb port plugin loader to platform namespace 2021-10-06 08:59:56 -04:00
10a8a1b325 add dlerror() call wrapper 2021-10-06 08:59:51 -04:00
7801d112b3 enable building plugins for windows 2021-10-06 07:10:35 -04:00
9fc23a2bda make use of platform namespace functions 2021-10-06 07:10:04 -04:00
e3cb5a5e25 restore old version of MPI_Wtime(). we're not using it anyway. 2021-10-06 07:09:36 -04:00
81492533e6 recover serial compilation 2021-10-05 23:19:52 -04:00
8b36061db4 replace MPI_Wtime() with platform::walltime() 2021-10-05 22:53:39 -04:00
f17aeebbcd make compilable on windows 2021-10-05 22:31:39 -04:00
46eaa4888e simplify using platform function 2021-10-05 22:31:25 -04:00
cc2d23de21 use platform::cputtime() 2021-10-05 22:31:06 -04:00
087c1b3a65 revive skipped code to detect OS revisions 2021-10-05 22:30:45 -04:00
6f2076a9b8 update docs 2021-10-05 22:11:19 -04:00
b2c4f08bbc use C++11 functionality to determine wall time 2021-10-05 21:52:52 -04:00
fcdabe0002 implement a platform neutral usleep() using C++11 2021-10-05 17:58:27 -04:00
528050aa08 use platform namespace to delete file 2021-10-05 17:57:38 -04:00
0c6707bf0c Fix compile issue with bond_class2_kokkos and UVM-enabled 2021-10-05 14:49:30 -06:00
e3e82df995 port "embedded" shell commands to use platform functions 2021-10-05 16:36:06 -04:00
5128eb7b43 port read/write_restart to use the platform namespace 2021-10-05 16:35:37 -04:00
af070aa351 add support for seeking to the end of a file 2021-10-05 15:44:58 -04:00
fc5920812f new group arg for delete_atoms porosity 2021-10-05 13:07:34 -06:00
f0940104f5 first version of new fix mol/swap command 2021-10-05 11:06:32 -06:00
340207988c fix a couple more bugs like in 5246cedda6 2021-10-05 10:36:25 -04:00
741cf9c7d5 remove obsoleted include statements 2021-10-05 07:36:22 -04:00
9f2c5116fa make lammps and msi2lmp man pages use section 1 2021-10-05 07:35:26 -04:00
0bdc6d47e0 port molfile plugin reader to platform namespace 2021-10-04 22:56:23 -04:00
ee594a879b make use of platform::putenv() 2021-10-04 22:39:43 -04:00
40f683c1a7 use platform functions to handle piping help output to a pager when on a console 2021-10-04 18:14:21 -04:00
7cdd82dee2 use platform functions for averaging fixes 2021-10-04 18:13:46 -04:00
dd2b5b22d4 fix saed/vtk does not use the overwrite option anywhere 2021-10-04 17:22:58 -04:00
485796f387 Merge branch 'master' into platform-namespace 2021-10-04 15:19:12 -04:00
ab51c1bd3d Merge pull request #2977 from akohlmey/collected-small-changes
Collected small changes
2021-10-04 11:07:03 -07:00
c6a15064b3 Merge pull request #2976 from stanmoore1/update_gitignore
Update .gitignore file in /src
2021-10-04 10:10:23 -07:00
6e54295b38 pre-built singularity images have been removed due to lack of interest 2021-10-04 11:34:28 -04:00
9d96e10048 silence compiler warning 2021-10-04 07:32:25 -04:00
dc2453a22b silence some compiler warnings 2021-10-04 06:56:13 -04:00
5246cedda6 Fix misplaced MPI calls bug in pair style drip 2021-10-04 06:50:38 -04:00
203b779622 also update eigen download for traditional build 2021-10-02 23:17:08 -04:00
45ea2b0431 update eigen3 to the latest release and move download to our own server 2021-10-02 22:52:03 -04:00
03f7bf6649 update eigen3 to the latest release and move download to our own server 2021-10-02 22:44:29 -04:00
c341c2c6a9 correct platform call in kim query command 2021-10-02 20:00:53 -04:00
7110e1c15e small format tweaks
- brief description should not end in a dot as it becomes a title line
- add empty line to separate title from body of description
- revert order of file/path separator constants so that the Linux version shows up in doxygen
2021-10-02 18:28:33 -04:00
a6aa3fd3ee apply clang-format 2021-10-02 18:26:46 -04:00
69a8dfe4d9 whitespace 2021-10-02 18:12:32 -04:00
dcaed72b6d update embedded docs 2021-10-02 17:29:21 -04:00
c6bdab8b4c disable optimization of cputime function for MSVC++ to avoid bogus 0s reports 2021-10-02 17:29:05 -04:00
2dcaa47b0e unfreeze versions of python packages used to build the documentation 2021-10-02 16:55:19 -04:00
37bfe3d0ce integrate platform sub-namespace into source code and documentation
this updates function calls to functions that have been moved from
the utils namepsace or the Info class to platform::
2021-10-02 16:55:11 -04:00
373dbcd9ae fix typo 2021-10-02 16:40:05 -04:00
35bef7b1d3 unfreeze versions of python packages used to build the documentation 2021-10-02 16:32:58 -04:00
195fe81c60 correct test for loading shared objects and libraries 2021-10-01 23:52:02 -04:00
a8193f42b8 Merge branch 'master' into platform-namespace 2021-10-01 21:58:52 -04:00
0cbf70a385 make compatible with C 2021-10-01 15:24:59 -04:00
60c6669d68 Remove lammpsplugin.h from .gitignore 2021-10-01 13:21:42 -06:00
cf06620538 raise the C++ standard to be at least C++14 when Kokkos is enabled.
This still allows to request a later standard for as long as it is C++14 or later
2021-10-01 15:16:40 -04:00
139dfd89e2 for improved C++20 compatibility 2021-10-01 15:14:53 -04:00
cc2d08506e accelerator_*.h files should not be ignored 2021-10-01 12:55:39 -06:00
bed1ff9a95 Remove more files from .gitignore 2021-10-01 12:46:06 -06:00
61c465c6f3 simplify creation of computes in fix ipi and fix plumed 2021-10-01 14:32:19 -04:00
7e7b8acf4b Update .gitignore 2021-10-01 12:12:53 -06:00
05b368e1c6 Merge pull request #2971 from lammps/doc-thermostats
Clarify thermostat doc pages to mention applying the thermostat only to regions of atoms
2021-10-01 12:18:38 -04:00
912d55c46a Merge pull request #2975 from rbberger/external_kokkos_fix
Avoid assertions in PythonCapabilities check when using external KOKKOS
2021-10-01 11:56:43 -04:00
dcf4b75ca2 Merge pull request #2973 from akohlmey/32bit-pointer-bugfix
32-bit pointer bugfix in bond/angle style gaussian
2021-10-01 11:36:26 -04:00
211df8b7b0 Avoid assertions in PythonCapabilities check when using external KOKKOS 2021-10-01 11:08:02 -04:00
434c170097 apply clang-format 2021-10-01 00:58:38 -04:00
01fb33cb5d fix memory allocation bug causing memory corruption on 32-bit arches 2021-10-01 00:57:02 -04:00
b5b2f5c03c additional tweak 2021-09-30 17:11:49 -06:00
f20bd63edf clarify doc pages for thermostatting fixes to mention regions 2021-09-30 16:55:22 -06:00
277f7a7e51 reduce electric field strength 2021-09-30 08:29:55 -04:00
05d2002db6 add test for using fix acks2/reaxff with fix efield 2021-09-30 07:04:46 -04:00
f2755a8085 simplify 2021-09-30 00:40:30 -04:00
f6cb693d6b whitespace 2021-09-30 00:40:15 -04:00
1840c51960 fmt::format() is no longer needed for this explicitly 2021-09-30 00:32:34 -04:00
359aa1d805 Merge branch 'master' into acks2_release 2021-09-30 00:26:25 -04:00
4d84ceb822 Merge pull request #2951 from akohlmey/parse-logical-keyword
Add utility function to parse boolean parameters
2021-09-30 00:09:37 -04:00
56cd66a6c3 Merge branch 'master' into parse-logical-keyword
# Conflicts:
#	src/H5MD/dump_h5md.cpp
2021-09-29 23:05:59 -04:00
15b3e875d5 import files for platform namespace from standalone project w/o updating LAMMPS 2021-09-29 16:29:25 -04:00
32049c3484 adopt for new multispecies PACE implementation 2021-09-29 16:04:09 +02:00
be3468ae07 Trying to fix style error 2021-09-27 16:31:48 -04:00
d69cb9e847 Changed \n to n \m to m 2021-09-27 14:54:15 -04:00
1e574b3e8a updated pair_nm doc 2021-09-27 14:12:09 -04:00
6447bd822c fixed fene_nm 2021-09-27 11:23:53 -04:00
93cc1ae3bb Removed comments in fene_nm 2021-09-24 14:04:54 -04:00
5229a4e765 Removed comments in fene_nm 2021-09-24 13:41:18 -04:00
a83797091b Finally added Pair_nm_cut_split and bond_fene_nm_cut_split 2021-09-23 14:05:54 -04:00
5b02f704cc Finally added pair_nm_cut_split fene_nm_cut_split 2021-09-23 13:23:29 -04:00
422cab8878 update suffix command unit tests 2021-09-23 07:30:50 -04:00
f641b1c659 final chunk of changes to apply utils::logical() 2021-09-23 07:30:40 -04:00
342ca7ff1d add multi-config build support for MSCG package 2021-09-21 22:02:37 -04:00
914f035475 a few more converted commands and updates for unit tests 2021-09-21 17:23:41 -04:00
cbc5a2933a tweak epsilon 2021-09-21 15:44:42 -04:00
c9a8319a93 use more relealistic element ratio 2021-09-21 15:02:45 -04:00
0ddf63acc9 update ACKS2 unit test with potential parameters from example 2021-09-21 14:41:37 -04:00
9063466c03 move ACKS2 force field file to potentials folder and add LAMMPS-style metadata 2021-09-21 14:37:37 -04:00
c3d34e8656 only accept lower case to be consistent with the rest of the input 2021-09-21 14:18:23 -04:00
6227396afd for consistency with utils::logical() 2021-09-21 14:15:23 -04:00
1ba77e1629 apply utils::logical() in more places 2021-09-21 14:15:02 -04:00
41a3eccd1c apply utils::logical() to more commands 2021-09-21 07:48:50 -04:00
fe64649e49 Merge branch 'master' into multi-config-support 2021-09-20 20:42:03 -04:00
6adac6b637 Merge branch 'master' into parse-logical-keyword 2021-09-20 20:41:48 -04:00
6e8091470c update death tests for change in error message 2021-09-20 20:31:13 -04:00
100da95e3a convert yes/no on/off flags in the package command(s) 2021-09-20 16:15:24 -04:00
d79b1b3145 Tweak example and add reference logs 2021-09-20 13:01:57 -06:00
9feab449fb Add ACKS2 example 2021-09-20 12:23:19 -06:00
f80259dfae some applications of the new function 2021-09-19 19:05:40 -04:00
860a93aa8b fix spelling issues 2021-09-19 18:32:45 -04:00
61c71c6605 return int instead of bool to minimize code changes 2021-09-19 18:07:56 -04:00
bfa2ea1fba expand tests for numeric values 2021-09-19 16:38:01 -04:00
cef100991f add utils::logical() function to complement the *numeric() functions 2021-09-16 17:52:51 -04:00
1adbd5f667 Fix remaining issues 2021-09-15 14:32:00 -06:00
c858703156 Remove unused variables 2021-09-14 20:20:09 -06:00
b4acacf5cb add minimal example and a unit test input 2021-09-14 16:40:42 -04:00
19bc606a20 fix typo 2021-09-14 16:26:38 -04:00
254dcdf665 include formatting updates for the KOKKOS files as well 2021-09-14 16:23:48 -04:00
86578554bb apply latest formatting conventions (w/o clang format on the .cpp file) 2021-09-14 15:34:28 -04:00
dfe0e313d5 fully integrate acks2/reaxff fix into documentation build 2021-09-14 15:31:36 -04:00
51cfbaa2ef Remove tabs 2021-09-14 10:56:03 -06:00
3badb14b5a Whitespace 2021-09-14 10:49:04 -06:00
65a085c067 Improve docs 2021-09-14 10:45:45 -06:00
2b17796d73 Switch max 2021-09-14 10:23:57 -06:00
f9236fbb33 Remove unused variable 2021-09-14 10:06:51 -06:00
15c7792c33 Fix issues with Kokkos package when ranks have zero atoms 2021-09-14 10:02:29 -06:00
fa3c29dda6 Merge branch 'master' of github.com:lammps/lammps into acks2_release 2021-09-14 08:41:23 -06:00
0202b1169a Minor edits to the error message 2021-09-12 23:08:36 -05:00
daa39d680c simplify 2021-09-11 13:43:25 -04:00
c394df5658 simplify and remove unused command. more multi-config adjustments 2021-09-11 07:30:18 -04:00
30558c0cd6 convert plugin compilation to also use add_subdirectory() instead of external project 2021-09-11 07:01:48 -04:00
932b3cabda add missing include (since we not longer include GTest.cmake) 2021-09-11 06:05:29 -04:00
bf360ad50f explicitly specify build folder for out-of-source subdirectory 2021-09-11 05:59:50 -04:00
68ddab0341 Report multi-config and adjust paths for python unit tests 2021-09-11 05:36:43 -04:00
84c945f7fb Use multi-config compatible way to integrate googletest for unit testing 2021-09-11 04:50:04 -04:00
31214de51a Update name 2021-09-09 12:08:09 -06:00
214725d1ee Use full precision for 1/3 2021-09-09 09:20:24 -06:00
70cbc5e364 Add external field contribution to OPENMP QEq 2021-09-09 08:30:57 -06:00
ccbd24352e Remove const to work around GCC 7 compiler bug 2021-09-09 08:03:06 -06:00
4f825db5ab Add external field contribution to OPENMP QEq 2021-09-08 20:54:42 -06:00
826c4e1cd7 Allow fix acks2 to be backwards compatible with old reax name style 2021-09-08 20:40:57 -06:00
7c5a9841f7 more whitespace 2021-09-08 16:01:45 -06:00
165efcdb07 homepage 2021-09-08 15:50:53 -06:00
ede892c83f whitespace 2021-09-08 15:45:54 -06:00
8b9dd6b0c1 Add ACKS2 charge equilibration method to REAXFF and support for electric fields in QEq 2021-09-08 15:06:23 -06:00
92d9efa1af Merge branch 'master' into gpu-newton-pair-on 2021-08-19 23:25:49 -05:00
904a2ef910 Reverted the default setting of newton_pair off for FixGPU; newton_pair can be set to be on via command-line options of package gpu 2021-08-19 22:54:06 -05:00
0904ffa813 Enabled newton pair on for gpu pair styles 2021-08-06 01:11:31 -05:00
0867299adb Fixed format error bug in third order tensor print 2021-07-19 11:54:49 -07:00
b3fed4d1a9 update regex to match with updated fmtlib 2021-06-24 10:13:52 -04:00
79cbafd3c7 Reapply LAMMPS changes to fmtlib 2021-06-21 11:55:41 -04:00
f7752da97f Update fmtlib to 8.0.0 2021-06-21 11:50:57 -04:00
0423a3e537 Merge branch 'master' into OptimizedDynamicalMatrix 2021-04-27 13:36:34 -07:00
b982542ae6 update indentation to 2 blanks. avoid "hanging else" constructs. 2021-04-21 14:56:26 -04:00
598e82d236 small cosmetic changes 2021-04-21 12:16:43 -04:00
1ee8de42d9 minor cleanups and simplifications using fmtlib 2021-04-21 12:08:37 -04:00
cd236776de Merge branch 'master' into OptimizedDynamicalMatrix 2021-04-21 11:46:36 -04:00
0fc73c9d67 support for centroid virial stress in rigid/small 2021-04-19 16:18:06 +09:00
b904d256cd implement keeping track of geometric center in rigid/small 2021-04-20 14:06:53 +09:00
ac7c5592d7 add centroid virial tally function in preparation for rigid/small support 2021-12-06 17:45:49 +09:00
0ed44e0b81 Remove leftover merge conflict string 2021-04-16 18:05:20 -07:00
535384b235 Finish updating to current master 2021-04-16 17:14:55 -07:00
fed47b9ffc Merged 1/29/2021 master and fixed merge conflicts 2021-01-29 12:33:17 -08:00
3ff8d8bf41 update centroid/stress/atom compute to correctly handle fixes with CENTROID_AVAIL 2020-12-14 19:41:34 +09:00
8520a71646 centroid stress support in shake (and rattle) 2020-12-14 19:31:38 +09:00
abba1204a8 support for centroid stress in fixes 2021-12-06 17:12:39 +09:00
3a9796d9b3 add flags for centroid stress 2020-12-14 19:29:18 +09:00
e57b391d40 Add threading capability to both commands 2020-07-20 11:35:10 -07:00
5abddfe68d Fixed nitpicky details, updated output, moved mass out of folded check 2020-07-19 19:12:01 -07:00
9011cfaa96 Added neighbors of neighbors list indexed by tag and return tags. 2020-07-18 02:27:31 -07:00
dd6e5df356 Remove print statement 2020-07-16 14:16:12 -07:00
7133311d2d Change Allreduce to fit bigint 2020-07-16 14:13:45 -07:00
999dd13924 Draft of force calculation reduction through neighbor lists 2020-07-15 12:45:46 -07:00
4b656b3961 Check if atom is part of group before computing forces 2020-07-14 15:47:14 -07:00
35f3aeb15a Merge branch 'master' into OptimizedDynamicalMatrix 2020-07-13 19:48:16 -07:00
d368c46ea9 Merge remote-tracking branch 'origin' 2020-07-13 19:46:44 -07:00
57d674cc81 Merge branch 'master' into OptimizedDynamicalMatrix 2020-07-13 19:46:05 -07:00
3a4652613d Add folded option, change ballistico to eskm, add post force modifications 2020-07-13 19:43:24 -07:00
255cc85b32 Merge branch 'master' of https://github.com/charlessievers/lammps 2019-09-04 16:18:57 -07:00
65399a6193 Merge branch 'OptimizedDynamicalMatrix' of https://github.com/charlessievers/lammps 2019-02-01 20:51:08 -08:00
3159 changed files with 94782 additions and 42362 deletions

2
.github/CODEOWNERS vendored
View File

@ -83,7 +83,7 @@ src/library.* @sjplimp
src/main.cpp @sjplimp
src/min_*.* @sjplimp
src/memory.* @sjplimp
src/modify.* @sjplimp
src/modify.* @sjplimp @stanmoore1
src/molecule.* @sjplimp
src/my_page.h @sjplimp
src/my_pool_chunk.h @sjplimp

View File

@ -3,7 +3,7 @@ name: "CodeQL Code Analysis"
on:
push:
branches: [master]
branches: [develop]
jobs:
analyze:

46
.github/workflows/compile-msvc.yml vendored Normal file
View File

@ -0,0 +1,46 @@
# GitHub action to build LAMMPS on Windows with Visual C++
name: "Native Windows Compilation and Unit Tests"
on:
push:
branches: [develop]
jobs:
build:
name: Windows Compilation Test
if: ${{ github.repository == 'lammps/lammps' }}
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Select Python version
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Building LAMMPS via CMake
shell: bash
run: |
python3 -m pip install numpy
cmake -C cmake/presets/windows.cmake \
-D PKG_PYTHON=on \
-S cmake -B build \
-D BUILD_SHARED_LIBS=on \
-D LAMMPS_EXCEPTIONS=on \
-D ENABLE_TESTING=on
cmake --build build --config Release
- name: Run LAMMPS executable
shell: bash
run: |
./build/Release/lmp.exe -h
./build/Release/lmp.exe -in bench/in.lj
- name: Run Unit Tests
working-directory: build
shell: bash
run: ctest -V -C Release

View File

@ -3,7 +3,7 @@ name: "Unittest for MacOS"
on:
push:
branches: [master]
branches: [develop]
jobs:
build:

7
.gitignore vendored
View File

@ -37,8 +37,8 @@ vgcore.*
.Trashes
ehthumbs.db
Thumbs.db
.clang-format
.lammps_history
.vs
#cmake
/build*
@ -49,3 +49,8 @@ Thumbs.db
/Testing
/cmake_install.cmake
/lmp
out/Debug
out/RelWithDebInfo
out/Release
out/x86
out/x64

View File

@ -23,6 +23,10 @@ either a user mistake or a bug in the code. Bugs can be reported in
the LAMMPS project
[issue tracker on GitHub](https://github.com/lammps/lammps/issues).
To mitigate issues with using homoglyphs or bidirectional reordering in
unicode, which have been demonstrated as a vector to obfuscate and hide
malicious changes to the source code, all LAMMPS submissions are checked
for unicode characters and only all-ASCII source code is accepted.
# Version Updates

View File

@ -19,6 +19,9 @@ set(SOVERSION 0)
get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
# collect all executables and shared libs in the top level build folder
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src)
set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib)
@ -81,22 +84,40 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
include(CheckIncludeFileCXX)
# set required compiler flags and compiler/CPU arch specific optimizations
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
set(CMAKE_TUNE_DEFAULT "/QxCOMMON-AVX512")
else()
set(CMAKE_TUNE_DEFAULT "/QxHost")
endif()
else()
set(CMAKE_TUNE_DEFAULT "-xHost")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
else()
set(CMAKE_TUNE_DEFAULT "-xHost")
endif()
endif()
endif()
# we require C++11 without extensions
# we require C++11 without extensions. Kokkos requires at least C++14 (currently)
set(CMAKE_CXX_STANDARD 11)
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
# and prints lots of pointless warnings about "unsafe" functions
if(MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
# export all symbols when building a .dll file on windows
@ -115,10 +136,7 @@ endif()
set(LAMMPS_BINARY lmp${LAMMPS_MACHINE})
option(BUILD_SHARED_LIBS "Build shared library" OFF)
if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared libraries" ON)
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
@ -265,28 +283,19 @@ if(BUILD_MPI)
# We use a non-standard procedure to cross-compile with MPI on Windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
include(MPI4WIN)
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
else()
find_package(MPI REQUIRED)
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
if(LAMMPS_LONGLONG_TO_LONG)
target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG)
endif()
endif()
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
else()
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
add_library(mpi_stubs STATIC ${MPI_SOURCES})
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
if(BUILD_SHARED_LIBS)
target_link_libraries(lammps PRIVATE mpi_stubs)
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
target_compile_definitions(lammps INTERFACE $<INSTALL_INTERFACE:LAMMPS_LIB_NO_MPI>)
else()
target_link_libraries(lammps PUBLIC mpi_stubs)
endif()
add_library(MPI::MPI_CXX ALIAS mpi_stubs)
target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
add_library(mpi_stubs INTERFACE)
target_include_directories(mpi_stubs INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
target_link_libraries(lammps PUBLIC mpi_stubs)
endif()
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
@ -317,7 +326,6 @@ pkg_depends(ML-IAP ML-SNAP)
pkg_depends(MPIIO MPI)
pkg_depends(ATC MANYBODY)
pkg_depends(LATBOLTZ MPI)
pkg_depends(PHONON KSPACE)
pkg_depends(SCAFACOS MPI)
pkg_depends(DIELECTRIC KSPACE)
pkg_depends(DIELECTRIC EXTRA-PAIR)
@ -351,11 +359,13 @@ if(BUILD_OMP)
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
# Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe.
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=4)
set(LAMMPS_OMP_COMPAT_LEVEL 4)
else()
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=3)
set(LAMMPS_OMP_COMPAT_LEVEL 3)
endif()
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=${LAMMPS_OMP_COMPAT_LEVEL})
target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
endif()
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
@ -468,9 +478,12 @@ foreach(HEADER cmath)
endif(NOT FOUND_${HEADER})
endforeach(HEADER)
set(MATH_LIBRARIES "m" CACHE STRING "math library")
mark_as_advanced( MATH_LIBRARIES )
target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
# make the standard math library overrideable and autodetected (for systems that don't have it)
find_library(STANDARD_MATH_LIB m DOC "Standard Math library")
mark_as_advanced(STANDARD_MATH_LIB)
if(STANDARD_MATH_LIB)
target_link_libraries(lammps PRIVATE ${STANDARD_MATH_LIB})
endif()
######################################
# Generate Basic Style files
@ -566,11 +579,10 @@ if(PKG_ATC)
if(LAMMPS_SIZES STREQUAL "BIGBIG")
message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG")
endif()
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES})
if(BUILD_MPI)
target_link_libraries(atc PRIVATE MPI::MPI_CXX)
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX)
else()
target_link_libraries(atc PRIVATE mpi_stubs)
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs)
endif()
target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR})
target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES})
@ -584,22 +596,19 @@ endif()
# packages which selectively include variants based on enabled styles
# e.g. accelerator packages
######################################################################
foreach(PKG_WITH_INCL CORESHELL QEQ OPENMP DPD-SMOOTH KOKKOS OPT INTEL GPU)
foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH PHONON QEQ OPENMP KOKKOS OPT INTEL GPU)
if(PKG_${PKG_WITH_INCL})
include(Packages/${PKG_WITH_INCL})
endif()
endforeach()
if(PKG_PLUGIN)
if(BUILD_SHARED_LIBS)
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
else()
message(WARNING "Plugin loading will not work unless BUILD_SHARED_LIBS is enabled")
endif()
# link with -ldl or equivalent for plugin loading; except on Windows
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
endif()
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
endif()
# link with -ldl or equivalent for plugin loading; except on Windows
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
endif()
######################################################################
@ -608,7 +617,7 @@ endif()
# and after everything else that is compiled locally
######################################################################
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
target_link_libraries(lammps PRIVATE "wsock32;psapi")
endif()
######################################################
@ -669,6 +678,7 @@ endif()
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
set_target_properties(lammps PROPERTIES PREFIX "lib")
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
@ -688,6 +698,9 @@ foreach(_DEF ${LAMMPS_DEFINES})
endforeach()
if(BUILD_SHARED_LIBS)
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(NOT BUILD_MPI)
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
@ -727,7 +740,7 @@ install(
if(BUILD_SHARED_LIBS)
if(CMAKE_VERSION VERSION_LESS 3.12)
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5)
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
find_package(PythonInterp) # Deprecated since version 3.12
if(PYTHONINTERP_FOUND)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
@ -786,11 +799,17 @@ if(ClangFormat_FOUND)
endif()
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(BUILD_IS_MULTI_CONFIG)
set(LAMMPS_BUILD_TYPE "Multi-Config")
else()
set(LAMMPS_BUILD_TYPE ${CMAKE_BUILD_TYPE})
endif()
include(FeatureSummary)
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
message(STATUS "<<< Build configuration >>>
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
Build type: ${CMAKE_BUILD_TYPE}
Build type: ${LAMMPS_BUILD_TYPE}
Install path: ${CMAKE_INSTALL_PREFIX}
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
###############################################################################

204
cmake/CMakeSettings.json Normal file
View File

@ -0,0 +1,204 @@
{
"configurations": [
{
"name": "x64-Debug-MSVC",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "x64-Release-MSVC",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "x64-Debug-Clang",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64" ],
"variables": [
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "x64-Debug-OneAPI",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icx -DCMAKE_C_COMPILER=icx",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_MPI",
"value": "False",
"type": "BOOL"
}
]
},
{
"name": "x64-Debug-Intel",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icl -DCMAKE_C_COMPILER=icl -DCMAKE_Fortran_COMPILER=ifort",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "False",
"type": "BOOL"
},
{
"name": "BUILD_MPI",
"value": "False",
"type": "BOOL"
}
]
}
]
}

View File

@ -0,0 +1,33 @@
# Build a CMake based external library as subdirectory.
# The sources will be unpacked to ${CMAKE_BINARY_DIR}/_deps/${target}-src
# The binaries will be built in ${CMAKE_BINARY_DIR}/_deps/${target}-build
#
function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
# change settings locally
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
get_filename_component(archive ${url} NAME)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
message(STATUS "Downloading ${url}")
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
message(STATUS "Unpacking and configuring ${archive}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
file(GLOB TARGET_SOURCE "${CMAKE_BINARY_DIR}/_deps/src/${basedir}*")
list(LENGTH TARGET_SOURCE _num)
if(_num GREATER 1)
message(FATAL_ERROR "Inconsistent ${target} library sources. "
"Please delete ${CMAKE_BINARY_DIR}/_deps/src and re-run cmake")
endif()
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/${target}-src)
file(RENAME ${TARGET_SOURCE} ${CMAKE_BINARY_DIR}/_deps/${target}-src)
if(NOT (cmakefile STREQUAL ""))
file(COPY ${cmakefile} DESTINATION ${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/)
get_filename_component(_cmakefile ${cmakefile} NAME)
file(RENAME "${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/${_cmakefile}"
"${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/CMakeLists.txt")
endif()
add_subdirectory("${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}"
"${CMAKE_BINARY_DIR}/_deps/${target}-build")
endfunction(ExternalCMakeProject)

View File

@ -8,18 +8,19 @@
#=============================================================================
if(CMAKE_VERSION VERSION_LESS 3.12)
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
find_package(PythonInterp 3.6 QUIET) # Deprecated since version 3.12
if(PYTHONINTERP_FOUND)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
else()
find_package(Python3 3.6 COMPONENTS Interpreter QUIET)
find_package(Python 3.6 COMPONENTS Interpreter QUIET)
endif()
# Use the Cython executable that lives next to the Python executable
# if it is a local installation.
if(Python3_EXECUTABLE)
get_filename_component(_python_path ${Python3_EXECUTABLE} PATH)
if(Python_EXECUTABLE)
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
find_program(Cythonize_EXECUTABLE
NAMES cythonize3 cythonize cythonize.bat
HINTS ${_python_path})

View File

@ -1,81 +0,0 @@
message(STATUS "Downloading and building Google Test library")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(GTEST_LIB_POSTFIX d)
else()
set(GTEST_LIB_POSTFIX)
endif()
include(ExternalProject)
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
set(GTEST_MD5 "ecd1fa65e7de707cd5c00bdac56022cd" CACHE STRING "MD5 checksum of GTest tarball")
mark_as_advanced(GTEST_URL)
mark_as_advanced(GTEST_MD5)
ExternalProject_Add(googletest
URL ${GTEST_URL}
URL_MD5 ${GTEST_MD5}
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_BYPRODUCTS <BINARY_DIR>/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
INSTALL_COMMAND ""
TEST_COMMAND "")
ExternalProject_Get_Property(googletest SOURCE_DIR)
set(GTEST_INCLUDE_DIR ${SOURCE_DIR}/googletest/include)
set(GMOCK_INCLUDE_DIR ${SOURCE_DIR}/googlemock/include)
# workaround for CMake 3.10 on ubuntu 18.04
file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
ExternalProject_Get_Property(googletest BINARY_DIR)
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
find_package(Threads QUIET)
add_library(GTest::GTest UNKNOWN IMPORTED)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
add_dependencies(GTest::GTest googletest)
add_library(GTest::GMock UNKNOWN IMPORTED)
set_target_properties(GTest::GMock PROPERTIES
IMPORTED_LOCATION ${GMOCK_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
add_dependencies(GTest::GMock googletest)
add_library(GTest::GTestMain UNKNOWN IMPORTED)
set_target_properties(GTest::GTestMain PROPERTIES
IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
add_dependencies(GTest::GTestMain googletest)
add_library(GTest::GMockMain UNKNOWN IMPORTED)
set_target_properties(GTest::GMockMain PROPERTIES
IMPORTED_LOCATION ${GMOCK_MAIN_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
add_dependencies(GTest::GMockMain googletest)

View File

@ -25,7 +25,7 @@ function(validate_option name values)
endfunction(validate_option)
function(get_lammps_version version_header variable)
file(READ ${version_header} line)
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1" day "${line}")
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\2" month "${line}")
@ -85,7 +85,7 @@ endfunction(GenerateBinaryHeader)
# fetch missing potential files
function(FetchPotentials pkgfolder potfolder)
if (EXISTS "${pkgfolder}/potentials.txt")
if(EXISTS "${pkgfolder}/potentials.txt")
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
foreach(line ${linelist})
string(FIND ${line} " " blank)

View File

@ -1,50 +1,11 @@
message(STATUS "Downloading and building OpenCL loader library")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.09.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "3b3882627964bd02e5c3b02065daac3c" CACHE STRING "MD5 checksum of OpenCL loader tarball")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2022.01.04.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "8d3a801e87a2c6653bf0e27707063914" CACHE STRING "MD5 checksum of OpenCL loader tarball")
mark_as_advanced(OPENCL_LOADER_URL)
mark_as_advanced(OPENCL_LOADER_MD5)
include(ExternalProject)
ExternalProject_Add(opencl_loader
URL ${OPENCL_LOADER_URL}
URL_MD5 ${OPENCL_LOADER_MD5}
SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build"
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_BYPRODUCTS <BINARY_DIR>/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
INSTALL_COMMAND ""
TEST_COMMAND "")
ExternalProject_Get_Property(opencl_loader SOURCE_DIR)
set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc)
# workaround for CMake 3.10 on ubuntu 18.04
file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR})
ExternalProject_Get_Property(opencl_loader BINARY_DIR)
set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}")
find_package(Threads QUIET)
if(NOT WIN32)
set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}")
else()
set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject")
endif()
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
add_dependencies(OpenCL::OpenCL opencl_loader)
set_target_properties(OpenCL::OpenCL PROPERTIES
IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}")
set(INSTALL_LIBOPENCL OFF CACHE BOOL "" FORCE)
include(ExternalCMakeProject)
ExternalCMakeProject(opencl_loader ${OPENCL_LOADER_URL} ${OPENCL_LOADER_MD5} opencl-loader . "")
add_library(OpenCL::OpenCL ALIAS OpenCL)

View File

@ -1,10 +1,11 @@
find_package(ZLIB REQUIRED)
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
if(Zstd_FOUND)
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
if(Zstd_FOUND)
target_compile_definitions(lammps PRIVATE -DLAMMPS_ZSTD)
target_link_libraries(lammps PRIVATE PkgConfig::Zstd)
endif()
endif()

View File

@ -306,12 +306,12 @@ elseif(GPU_API STREQUAL "HIP")
if(HIP_COMPILER STREQUAL "clang")
add_custom_command(OUTPUT ${CUBIN_FILE}
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
DEPENDS ${CU_CPP_FILE}
COMMENT "Generating ${CU_NAME}.cubin")
else()
add_custom_command(OUTPUT ${CUBIN_FILE}
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
DEPENDS ${CU_CPP_FILE}
COMMENT "Generating ${CU_NAME}.cubin")
endif()
@ -422,13 +422,12 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h)
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
if(NOT BUILD_MPI)
# mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path
target_link_libraries(gpu PRIVATE mpi_stubs)
else()
if(BUILD_MPI)
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
else()
target_link_libraries(gpu PRIVATE mpi_stubs)
endif()
target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE})
target_sources(lammps PRIVATE ${GPU_SOURCES})

View File

@ -1,7 +1,7 @@
########################################################################
# As of version 3.3.0 Kokkos requires C++14
if(CMAKE_CXX_STANDARD LESS 14)
set(CMAKE_CXX_STANDARD 14)
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
endif()
########################################################################
# consistency checks and Kokkos options/settings required by LAMMPS
@ -11,8 +11,14 @@ if(Kokkos_ENABLE_CUDA)
endif()
# Adding OpenMP compiler flags without the checks done for
# BUILD_OMP can result in compile failures. Enforce consistency.
if(Kokkos_ENABLE_OPENMP AND NOT BUILD_OMP)
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
if(Kokkos_ENABLE_OPENMP)
if(NOT BUILD_OMP)
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
else()
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
endif()
endif()
endif()
########################################################################
@ -27,6 +33,8 @@ if(DOWNLOAD_KOKKOS)
endforeach()
message(STATUS "KOKKOS download requested - we will build our own")
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>")
# build KOKKOS downloaded libraries as static libraries but with PIC, if needed
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DBUILD_SHARED_LIBS=OFF")
if(CMAKE_REQUEST_PIC)
list(APPEND KOKKOS_LIB_BUILD_ARGS ${CMAKE_REQUEST_PIC})
endif()
@ -39,35 +47,48 @@ if(DOWNLOAD_KOKKOS)
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
include(ExternalProject)
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "4c84698917c93a18985b311bb6caf84f" CACHE STRING "MD5 checksum of KOKKOS tarball")
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.5.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "079323d973ae0e1c38c0a54a150c674e" CACHE STRING "MD5 checksum of KOKKOS tarball")
mark_as_advanced(KOKKOS_URL)
mark_as_advanced(KOKKOS_MD5)
ExternalProject_Add(kokkos_build
URL ${KOKKOS_URL}
URL_MD5 ${KOKKOS_MD5}
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
)
ExternalProject_get_property(kokkos_build INSTALL_DIR)
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
add_library(LAMMPS::KOKKOS UNKNOWN IMPORTED)
set_target_properties(LAMMPS::KOKKOS PROPERTIES
add_library(LAMMPS::KOKKOSCORE UNKNOWN IMPORTED)
add_library(LAMMPS::KOKKOSCONTAINERS UNKNOWN IMPORTED)
set_target_properties(LAMMPS::KOKKOSCORE PROPERTIES
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscore.a"
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOS)
add_dependencies(LAMMPS::KOKKOS kokkos_build)
set_target_properties(LAMMPS::KOKKOSCONTAINERS PROPERTIES
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscontainers.a")
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 3.4.01 REQUIRED CONFIG)
find_package(Kokkos 3.5.00 REQUIRED CONFIG)
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
else()
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
# build KOKKOS internal libraries as static libraries but with PIC, if needed
if(BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS_WAS_ON YES)
set(BUILD_SHARED_LIBS OFF)
endif()
if(CMAKE_REQUEST_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
@ -75,6 +96,9 @@ else()
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
target_link_libraries(lammps PRIVATE kokkos)
target_link_libraries(lmp PRIVATE kokkos)
if(BUILD_SHARED_LIBS_WAS_ON)
set(BUILD_SHARED_LIBS ON)
endif()
endif()
target_compile_definitions(lammps PUBLIC $<BUILD_INTERFACE:LMP_KOKKOS>)
@ -109,6 +133,12 @@ if(PKG_KSPACE)
endif()
endif()
if(PKG_PHONON)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/third_order_kokkos.cpp)
endif()
set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}")
# detects styles which have KOKKOS version

View File

@ -7,8 +7,9 @@ endif()
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
if(DOWNLOAD_EIGEN3)
message(STATUS "Eigen3 download requested - we will build our own")
set(EIGEN3_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz" CACHE STRING "URL for Eigen3 tarball")
set(EIGEN3_MD5 "609286804b0f79be622ccf7f9ff2b660" CACHE STRING "MD5 checksum of Eigen3 tarball")
set(EIGEN3_URL "${LAMMPS_THIRDPARTY_URL}/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
set(EIGEN3_MD5 "4c527a9171d71a72a9d4186e65bea559" CACHE STRING "MD5 checksum of Eigen3 tarball")
mark_as_advanced(EIGEN3_URL)
mark_as_advanced(EIGEN3_MD5)
include(ExternalProject)

View File

@ -46,12 +46,10 @@ if(DOWNLOAD_N2P2)
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
endif()
endif()
@ -64,8 +62,8 @@ if(DOWNLOAD_N2P2)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
set(N2P2_BUILD_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}} ${N2P2_CXX_STD}")
set(N2P2_BUILD_OPTIONS INTERFACES=LAMMPS COMP=${N2P2_COMP} "PROJECT_OPTIONS=${N2P2_PROJECT_OPTIONS}" "PROJECT_DEBUG="
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${MPI_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
"PROJECT_AR=${N2P2_AR}")
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${CMAKE_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
"PROJECT_AR=${N2P2_AR}" "APP_CORE=nnp-convert" "APP_TRAIN=nnp-train" "APP=nnp-convert")
# echo final flag for debugging
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")

View File

@ -1,11 +1,11 @@
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
set(PACELIB_MD5 "4db54962fbd6adcf8c18d46e1798ceb5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
mark_as_advanced(PACELIB_URL)
mark_as_advanced(PACELIB_MD5)
# download library sources to build folder
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5})
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
# uncompress downloaded sources
execute_process(
@ -14,12 +14,19 @@ execute_process(
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE)
file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp)
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR})
target_link_libraries(lammps PRIVATE pace)
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR})
target_link_libraries(pace PRIVATE yaml-cpp-pace)
target_link_libraries(lammps PRIVATE pace)

View File

@ -32,7 +32,8 @@ if(DOWNLOAD_QUIP)
foreach(flag ${LAPACK_LIBRARIES})
set(temp "${temp} ${flag}")
endforeach()
set(temp "${temp}\n")
# Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment
set(temp "${temp} -L/_DUMMY_PATH_\n")
set(temp "${temp}PYTHON=python\nPIP=pip\nEXTRA_LINKOPTS=\n")
set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n")
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")

View File

@ -12,41 +12,12 @@ if(DOWNLOAD_MSCG)
mark_as_advanced(MSCG_URL)
mark_as_advanced(MSCG_MD5)
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
message(FATAL_ERROR "Cannot compile downloaded MSCG library due to a technical limitation")
endif()
include(ExternalCMakeProject)
ExternalCMakeProject(mscg ${MSCG_URL} ${MSCG_MD5} MSCG-release src/CMake "")
include(ExternalProject)
ExternalProject_Add(mscg_build
URL ${MSCG_URL}
URL_MD5 ${MSCG_MD5}
SOURCE_SUBDIR src/CMake
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target mscg
INSTALL_COMMAND ""
BUILD_BYPRODUCTS <BINARY_DIR>/libmscg.a
)
ExternalProject_get_property(mscg_build BINARY_DIR)
ExternalProject_get_property(mscg_build SOURCE_DIR)
file(MAKE_DIRECTORY ${SOURCE_DIR}/src)
add_library(LAMMPS::MSCG UNKNOWN IMPORTED)
set_target_properties(LAMMPS::MSCG PROPERTIES
IMPORTED_LOCATION "${BINARY_DIR}/libmscg.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src"
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
add_dependencies(LAMMPS::MSCG mscg_build)
# set include and link library
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/mscg-src/src")
target_link_libraries(lammps PRIVATE mscg)
else()
find_package(MSCG)
if(NOT MSCG_FOUND)

View File

@ -0,0 +1,9 @@
# fix phonon may only be installed if also the FFT wrappers from KSPACE are installed
if(NOT PKG_KSPACE)
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.h)
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
get_target_property(LAMMPS_SOURCES lammps SOURCES)
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.cpp)
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
endif()

View File

@ -54,8 +54,8 @@ if(DOWNLOAD_PLUMED)
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
endif()
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.2/plumed-src-2.7.2.tgz" CACHE STRING "URL for PLUMED tarball")
set(PLUMED_MD5 "cfa0b4dd90a81c25d3302e8d97bfeaea" CACHE STRING "MD5 checksum of PLUMED tarball")
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.3/plumed-src-2.7.3.tgz" CACHE STRING "URL for PLUMED tarball")
set(PLUMED_MD5 "f00cc82edfefe6bb3df934911dbe32fb" CACHE STRING "MD5 checksum of PLUMED tarball")
mark_as_advanced(PLUMED_URL)
mark_as_advanced(PLUMED_MD5)

View File

@ -3,7 +3,7 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
else()
find_package(Python REQUIRED COMPONENTS Development)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
target_link_libraries(lammps PRIVATE Python::Python)
endif()
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)

View File

@ -25,7 +25,9 @@ if(BUILD_TOOLS)
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
add_executable(msi2lmp ${MSI2LMP_SOURCES})
target_link_libraries(msi2lmp PRIVATE ${MATH_LIBRARIES})
if(STANDARD_MATH_LIB)
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
endif()
install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()

View File

@ -1,47 +0,0 @@
message(STATUS "Downloading and building YAML library")
include(ExternalProject)
set(YAML_URL "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz" CACHE STRING "URL for libyaml tarball")
set(YAML_MD5 "bb15429d8fb787e7d3f1c83ae129a999" CACHE STRING "MD5 checksum of libyaml tarball")
mark_as_advanced(YAML_URL)
mark_as_advanced(YAML_MD5)
# support cross-compilation to windows
if(CMAKE_CROSSCOMPILING AND (CMAKE_SYSTEM_NAME STREQUAL "Windows"))
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
set(YAML_CROSS_HOST --host=i686-mingw64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(YAML_CROSS_HOST --host=x86_64-mingw64)
else()
message(FATAL_ERROR "Unsupported cross-compilation "
" for ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}"
" on ${CMAKE_HOST_SYSTEM}/${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()
endif()
ExternalProject_Add(libyaml
URL ${YAML_URL}
URL_MD5 ${YAML_MD5}
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build"
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${CONFIGURE_REQUEST_PIC}
CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}
--prefix=<INSTALL_DIR> --disable-shared ${YAML_CROSS_HOST}
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}
TEST_COMMAND "")
ExternalProject_Get_Property(libyaml INSTALL_DIR)
set(YAML_INCLUDE_DIR ${INSTALL_DIR}/include)
set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib)
# workaround for CMake 3.10 on ubuntu 18.04
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX})
add_library(Yaml::Yaml UNKNOWN IMPORTED)
set_target_properties(Yaml::Yaml PROPERTIES
IMPORTED_LOCATION ${YAML_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${YAML_INCLUDE_DIR})
add_dependencies(Yaml::Yaml libyaml)

View File

@ -24,10 +24,10 @@ if(GIT_FOUND AND EXISTS ${LAMMPS_DIR}/.git)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n")
set(temp "${temp}bool LAMMPS_NS::LAMMPS::has_git_info() { return ${temp_git_info}; }\n")
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_commit() { return \"${temp_git_commit}\"; }\n")
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_branch() { return \"${temp_git_branch}\"; }\n")
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${temp_git_describe}\"; }\n")
set(temp "${temp}#endif\n\n")
message(STATUS "Generating lmpgitversion.h...")

View File

@ -20,9 +20,14 @@
{ include: [ "@\"kspace_.*.h\"", public, "\"style_kspace.h\"", public ] },
{ include: [ "@\"nbin_.*.h\"", public, "\"style_nbin.h\"", public ] },
{ include: [ "@\"npair_.*.h\"", public, "\"style_npair.h\"", public ] },
{ include: [ "@\"nstenci_.*.h\"", public, "\"style_nstencil.h\"", public ] },
{ include: [ "@\"nstencil_.*.h\"", public, "\"style_nstencil.h\"", public ] },
{ include: [ "@\"ntopo_.*.h\"", public, "\"style_ntopo.h\"", public ] },
{ include: [ "\"fmt/core.h\"", private, "\"fmt/format.h\"", public ] },
{ include: [ "<float.h>", public, "<cfloat>", public ] },
{ include: [ "\"float.h\"", public, "<cfloat>", public ] },
{ include: [ "<limits.h>", public, "<climits>", public ] },
{ include: [ "\"limits.h\"", public, "<climits>", public ] },
{ include: [ "<stdio.h>", public, "<cstdio>", public ] },
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/types.h>", public ] },
{ include: [ "<bits/types/struct_tm.h>", private, "<ctime>", public ] },
]

View File

@ -3,19 +3,19 @@
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(MPI_CXX "g++" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
set(MPI_C "gcc" CACHE STRING "" FORCE)
set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)

View File

@ -48,7 +48,6 @@ set(ALL_PACKAGES
PHONON
PLUGIN
POEMS
PYTHON
QEQ
REACTION
REAXFF

View File

@ -0,0 +1,64 @@
set(WIN_PACKAGES
ASPHERE
BOCS
BODY
BROWNIAN
CG-DNA
CG-SDK
CLASS2
COLLOID
COLVARS
CORESHELL
DIELECTRIC
DIFFRACTION
DIPOLE
DPD-BASIC
DPD-MESO
DPD-REACT
DPD-SMOOTH
DRUDE
EFF
EXTRA-COMPUTE
EXTRA-DUMP
EXTRA-FIX
EXTRA-MOLECULE
EXTRA-PAIR
FEP
GRANULAR
INTERLAYER
KSPACE
MANIFOLD
MANYBODY
MC
MEAM
MISC
ML-IAP
ML-SNAP
MOFFF
MOLECULE
MOLFILE
OPENMP
ORIENT
PERI
PHONON
POEMS
PTM
QEQ
QTB
REACTION
REAXFF
REPLICA
RIGID
SHOCK
SMTBQ
SPH
SPIN
SRD
TALLY
UEF
YAFF)
foreach(PKG ${WIN_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

View File

@ -230,7 +230,7 @@ $(VENV):
)
$(MATHJAX):
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 git://github.com/mathjax/MathJax.git $@
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
$(ANCHORCHECK): $(VENV)
@( \

View File

@ -435,6 +435,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \
@LAMMPS_SOURCE_DIR@/math_eigen.h \
@LAMMPS_SOURCE_DIR@/platform.h \
@LAMMPS_SOURCE_DIR@/platform.cpp \
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -33,9 +33,9 @@ when necessary.
## Pull Requests
ALL changes to the LAMMPS code and documentation, however trivial, MUST
be submitted as a pull request to GitHub. All changes to the "master"
be submitted as a pull request to GitHub. All changes to the "develop"
branch must be made exclusively through merging pull requests. The
"unstable" and "stable" branches, respectively are only to be updated
"release" and "stable" branches, respectively are only to be updated
upon patch or stable releases with fast-forward merges based on the
associated tags. Pull requests may also be submitted to (long-running)
feature branches created by LAMMPS developers inside the LAMMPS project,
@ -123,16 +123,16 @@ and thus were this comment should be placed.
LAMMPS uses a continuous release development model with incremental
changes, i.e. significant effort is made - including automated pre-merge
testing - that the code in the branch "master" does not get easily
testing - that the code in the branch "develop" does not get easily
broken. These tests are run after every update to a pull request. More
extensive and time consuming tests (including regression testing) are
performed after code is merged to the "master" branch. There are patch
performed after code is merged to the "develop" branch. There are patch
releases of LAMMPS every 3-5 weeks at a point, when the LAMMPS
developers feel, that a sufficient amount of changes have happened, and
the post-merge testing has been successful. These patch releases are
marked with a `patch_<version date>` tag and the "unstable" branch
marked with a `patch_<version date>` tag and the "release" branch
follows only these versions (and thus is always supposed to be of
production quality, unlike "master", which may be temporary broken, in
production quality, unlike "develop", which may be temporary broken, in
the case of larger change sets or unexpected incompatibilities or side
effects.

View File

@ -1,4 +1,4 @@
.TH LAMMPS "29 September 2021" "2021-09-29"
.TH LAMMPS "1" "17 February 2022" "2022-2-17"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator.

View File

@ -1,4 +1,4 @@
.TH MSI2LMP "v3.9.9" "2018-11-05"
.TH MSI2LMP "1" "v3.9.9" "2018-11-05"
.SH NAME
.B MSI2LMP
\- Converter for Materials Studio files to LAMMPS

View File

@ -1123,9 +1123,12 @@ Bibliography
**(Sun)**
Sun, J. Phys. Chem. B, 102, 7338-7364 (1998).
**(Surblys)**
**(Surblys2019)**
Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
**(Surblys2021)**
Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
**(Sutmann)**
Sutmann, Arnold, Fahrenberger, et. al., Physical review / E 88(6), 063308 (2013)

View File

@ -150,6 +150,42 @@ for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the *-G*
command line flag. A list of available generator settings for your
specific CMake version is given when running ``cmake --help``.
.. _cmake_multiconfig:
Multi-configuration build systems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Throughout this manual it is mostly assumed that LAMMPS is being built
on a Unix-like operating system with "make" as the underlying "builder",
since this is the most common case. In this case the build "configuration"
is chose using ``-D CMAKE_BUILD_TYPE=<configuration>`` with ``<configuration>``
being one of "Release", "Debug", "RelWithDebInfo", or "MinSizeRel".
Some build tools, however, can also use or even require to have a so-called
multi-configuration build system setup. For those the built type (or
configuration) is chosen at compile time using the same build files. E.g.
with:
.. code-block:: bash
cmake --build build-multi --config Release
In that case the resulting binaries are not in the build folder directly
but in sub-directories corresponding to the build type (i.e. Release in
the example from above). Similarly, for running unit tests the
configuration is selected with the *-C* flag:
.. code-block:: bash
ctest -C Debug
The CMake scripts in LAMMPS have basic support for being compiled using a
multi-config build system, but not all of it has been ported. This is in
particular applicable to compiling packages that require additional libraries
that would be downloaded and compiled by CMake. The "windows" preset file
tries to keep track of which packages can be compiled natively with the
MSVC compilers out-of-the box. Not all of those external libraries are
portable to Windows either.
Installing CMake
^^^^^^^^^^^^^^^^

View File

@ -185,6 +185,10 @@ The ``ctest`` command has many options, the most important ones are:
- run subset of tests matching the regular expression <regex>
* - -E <regex>
- exclude subset of tests matching the regular expression <regex>
* - -L <regex>
- run subset of tests with a label matching the regular expression <regex>
* - -LE <regex>
- exclude subset of tests with a label matching the regular expression <regex>
* - -N
- dry-run: display list of tests without running them
* - -T memcheck
@ -299,6 +303,12 @@ will destroy the original file, if the generation run does not complete,
so using *-g* is recommended unless the YAML file is fully tested
and working.
Some of the force style tests are rather slow to run and some are very
sensitive to small differences like CPU architecture, compiler
toolchain, compiler optimization. Those tests are flagged with a "slow"
and/or "unstable" label, and thus those tests can be selectively
excluded with the ``-LE`` flag or selected with the ``-L`` flag.
.. admonition:: Recommendations and notes for YAML files
:class: note

View File

@ -14,7 +14,7 @@ environments with restricted disk space capacity it may be needed to
reduce the storage requirements. Here are some suggestions:
- Create a so-called shallow repository by cloning only the last commit
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=develop``.
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).

View File

@ -341,6 +341,18 @@ minutes to hours) to build. Of course you only need to do that once.)
$ 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
``CMAKE`` environment variable if the cmake executable is named other
than ``cmake`` on your system. Additional environment variables may be
provided on the command line for use by cmake. For example, to use the
``cmake3`` executable and tell it to use the gnu version 11 compilers
to build KIM, one could use the following command line.
.. 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
Settings for debugging OpenKIM web queries discussed below need to
be applied by adding them to the ``LMP_INC`` variable through
editing the ``Makefile.machine`` you are using. For example:
@ -560,11 +572,26 @@ They must be specified in uppercase.
* - VEGA908
- GPU
- AMD GPU MI100 GFX908
* - INTEL_GEN
* - VEGA90A
- GPU
- Intel GPUs Gen9+
- AMD GPU
* - INTEL_DG1
- GPU
- Intel Iris XeMAX GPU
* - INTEL_GEN9
- GPU
- Intel GPU Gen9
* - INTEL_GEN11
- GPU
- Intel GPU Gen11
* - INTEL_GEN12LP
- GPU
- Intel GPU Gen12LP
* - INTEL_XEHP
- GPU
- Intel GPUs Xe-HP
This list was last updated for version 3.4.1 of the Kokkos library.
This list was last updated for version 3.5.0 of the Kokkos library.
.. tabs::

View File

@ -33,12 +33,15 @@ various tools and files. Some of them have to be installed (see below). For
the rest the build process will attempt to download and install them into
a python virtual environment and local folders.
A current version of the manual (latest patch release, aka unstable
branch) is is available online at:
`https://docs.lammps.org/Manual.html <https://docs.lammps.org/Manual.html>`_.
A version of the manual corresponding to the ongoing development (aka master branch)
is available online at: `https://docs.lammps.org/latest/
<https://docs.lammps.org/latest/>`_
A current version of the manual (latest patch release, that is the state
of the *release* branch) is is available online at:
`https://docs.lammps.org/ <https://docs.lammps.org/>`_.
A version of the manual corresponding to the ongoing development (that is
the state of the *develop* branch) is available online at:
`https://docs.lammps.org/latest/ <https://docs.lammps.org/latest/>`_
A version of the manual corresponding to the latest stable LAMMPS release
(that is the state of the *stable* branch) is available online at:
`https://docs.lammps.org/stable/ <https://docs.lammps.org/stable/>`_
Build using GNU make
--------------------

View File

@ -321,9 +321,7 @@ following settings:
.. code-block:: make
LMP_INC = -DLAMMPS_JPEG
LMP_INC = -DLAMMPS_PNG
LMP_INC = -DLAMMPS_FFMPEG
LMP_INC = -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG <other LMP_INC settings>
JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
@ -354,8 +352,10 @@ Read or write compressed files
-----------------------------------------
If this option is enabled, large files can be read or written with
gzip compression by several LAMMPS commands, including
:doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and :doc:`dump <dump>`.
compression by ``gzip`` or similar tools by several LAMMPS commands,
including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
:doc:`dump <dump>`. Currently supported compression tools are:
``gzip``, ``bzip2``, ``zstd``, and ``lzma``.
.. tabs::
@ -364,23 +364,23 @@ gzip compression by several LAMMPS commands, including
.. code-block:: bash
-D WITH_GZIP=value # yes or no
# default is yes if CMake can find gzip, else no
-D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it
# default is yes if CMake can find the gzip program, else no
.. tab:: Traditional make
.. code-block:: make
LMP_INC = -DLAMMPS_GZIP
LMP_INC = -DLAMMPS_GZIP <other LMP_INC settings>
This option requires that your operating system fully supports the "popen()"
function in the standard runtime library and that a ``gzip`` executable can be
found by LAMMPS during a run.
This option requires that your operating system fully supports the
"popen()" function in the standard runtime library and that a ``gzip``
or other executable can be found by LAMMPS in the standard search path
during a run.
.. note::
On some clusters with high-speed networks, using the "fork()" library
call (required by "popen()") can interfere with the fast communication
On clusters with high-speed networks, using the "fork()" library call
(required by "popen()") can interfere with the fast communication
library and lead to simulations using compressed output or input to
hang or crash. For selected operations, compressed file I/O is also
available using a compression library instead, which is what the
@ -452,7 +452,7 @@ those systems:
.. code-block:: make
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG <other LMP_INC settings>
----------
@ -479,7 +479,7 @@ e.g. to Python. Of course, the calling code has to be set up to
.. code-block:: make
LMP_INC = -DLAMMPS_EXCEPTIONS
LMP_INC = -DLAMMPS_EXCEPTIONS <other LMP_INC settings>
.. note::
@ -520,7 +520,7 @@ executable, not the library.
.. code-block:: make
LMP_INC = -DLAMMPS_TRAP_FPE
LMP_INC = -DLAMMPS_TRAP_FPE <other LMP_INC settings>
After compilation with this flag set, the LAMMPS executable will stop
and produce a core dump when a division by zero, overflow, illegal math

View File

@ -4,6 +4,7 @@ Notes for building LAMMPS on Windows
* :ref:`General remarks <generic>`
* :ref:`Running Linux on Windows <linux>`
* :ref:`Using GNU GCC ported to Windows <gnu>`
* :ref:`Using Visual Studio <msvc>`
* :ref:`Using a cross-compiler <cross>`
----------
@ -31,13 +32,13 @@ pre-compiled Windows binary packages are sufficient for your needs. If
it is necessary for you to compile LAMMPS on a Windows machine
(e.g. because it is your main desktop), please also consider using a
virtual machine software and compile and run LAMMPS in a Linux virtual
machine, or - if you have a sufficiently up-to-date Windows 10
installation - consider using the Windows subsystem for Linux. This
optional Windows feature allows you to run the bash shell from Ubuntu
from within Windows and from there on, you can pretty much use that
shell like you are running on an Ubuntu Linux machine (e.g. installing
software via apt-get and more). For more details on that, please see
:doc:`this tutorial <Howto_wsl>`.
machine, or - if you have a sufficiently up-to-date Windows 10 or
Windows 11 installation - consider using the Windows subsystem for
Linux. This optional Windows feature allows you to run the bash shell
from Ubuntu from within Windows and from there on, you can pretty much
use that shell like you are running on an Ubuntu Linux machine
(e.g. installing software via apt-get and more). For more details on
that, please see :doc:`this tutorial <Howto_wsl>`.
.. _gnu:
@ -67,6 +68,40 @@ requiring changes to the LAMMPS source code, or figure out corrections
yourself, please report them on the lammps-users mailing list, or file
them as an issue or pull request on the LAMMPS GitHub project.
.. _msvc:
Using Microsoft Visual Studio
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Following the integration of the :doc:`platform namespace
<Developer_platform>` into the LAMMPS code base, portability of LAMMPS
to be compiled on Windows using Visual Studio has been significantly
improved. This has been tested with Visual Studio 2019 (aka version
16). Not all features and packages in LAMMPS are currently supported
out of the box, but a preset ``cmake/presets/windows.cmake`` is provided
that contains the packages that have been compiled successfully. You
must use the CMake based build procedure, and either use the integrated
CMake support of Visual Studio or use an external CMake installation to
create build files for the Visual Studio build system. Please note that
on launching Visual Studio it will scan the directory tree and likely
miss the correct master ``CMakeLists.txt``. Try to open the
``cmake/CMakeSettings.json`` and use those CMake configurations as a
starting point. It is also possible to configure and compile LAMMPS
from the command line with a CMake binary from `cmake.org <https://cmake.org>`_.
Please note, that for either approach CMake will create a so-called
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
the command lines for building and testing LAMMPS must be adjusted
accordingly.
To support running in parallel you can compile with OpenMP enabled using
the OPENMP package or install Microsoft MPI (including the SDK) and compile
LAMMPS with MPI enabled.
This is work in progress and you should contact the LAMMPS developers
via GitHub, the forum, or the mailing list, if you have questions or
LAMMPS specific problems.
.. _cross:
Using a cross-compiler

View File

@ -47,7 +47,7 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`displace_atoms <displace_atoms>`
* :doc:`dump <dump>`
* :doc:`dump_modify <dump_modify>`
* :doc:`dynamical_matrix <dynamical_matrix>`
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
* :doc:`echo <echo>`
* :doc:`fix <fix>`
* :doc:`fix_modify <fix_modify>`
@ -117,7 +117,7 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`thermo <thermo>`
* :doc:`thermo_modify <thermo_modify>`
* :doc:`thermo_style <thermo_style>`
* :doc:`third_order <third_order>`
* :doc:`third_order (k) <third_order>`
* :doc:`timer <timer>`
* :doc:`timestep <timestep>`
* :doc:`uncompute <uncompute>`

View File

@ -35,6 +35,7 @@ OPT.
* :doc:`class2 (ko) <bond_class2>`
* :doc:`fene (iko) <bond_fene>`
* :doc:`fene/expand (o) <bond_fene_expand>`
* :doc:`fene/nm <bond_fene>`
* :doc:`gaussian <bond_gaussian>`
* :doc:`gromos (o) <bond_gromos>`
* :doc:`harmonic (iko) <bond_harmonic>`

View File

@ -28,6 +28,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`angle <compute_angle>`
* :doc:`angle/local <compute_angle_local>`
* :doc:`angmom/chunk <compute_angmom_chunk>`
* :doc:`ave/sphere/atom (k) <compute_ave_sphere_atom>`
* :doc:`basal/atom <compute_basal_atom>`
* :doc:`body/local <compute_body_local>`
* :doc:`bond <compute_bond>`

View File

@ -23,6 +23,7 @@ OPT.
:columns: 5
* :doc:`accelerate/cos <fix_accelerate_cos>`
* :doc:`acks2/reaxff (k) <fix_acks2_reaxff>`
* :doc:`adapt <fix_adapt>`
* :doc:`adapt/fep <fix_adapt_fep>`
* :doc:`addforce <fix_addforce>`
@ -103,6 +104,7 @@ OPT.
* :doc:`manifoldforce <fix_manifoldforce>`
* :doc:`mdi/engine <fix_mdi_engine>`
* :doc:`meso/move <fix_meso_move>`
* :doc:`mol/swap <fix_mol_swap>`
* :doc:`momentum (k) <fix_momentum>`
* :doc:`momentum/chunk <fix_momentum>`
* :doc:`move <fix_move>`
@ -127,6 +129,7 @@ OPT.
* :doc:`npt/sphere (o) <fix_npt_sphere>`
* :doc:`npt/uef <fix_nh_uef>`
* :doc:`numdiff <fix_numdiff>`
* :doc:`numdiff/virial <fix_numdiff_virial>`
* :doc:`nve (giko) <fix_nve>`
* :doc:`nve/asphere (gi) <fix_nve_asphere>`
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`

View File

@ -119,10 +119,12 @@ OPT.
* :doc:`granular <pair_granular>`
* :doc:`gw <pair_gw>`
* :doc:`gw/zbl <pair_gw>`
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
* :doc:`hdnnp <pair_hdnnp>`
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
* :doc:`ilp/tmd <pair_ilp_tmd>`
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
* :doc:`lcbop <pair_lcbop>`
@ -210,6 +212,7 @@ OPT.
* :doc:`nm/cut (o) <pair_nm>`
* :doc:`nm/cut/coul/cut (o) <pair_nm>`
* :doc:`nm/cut/coul/long (o) <pair_nm>`
* :doc:`nm/cut/split <pair_nm>`
* :doc:`oxdna/coaxstk <pair_oxdna>`
* :doc:`oxdna/excv <pair_oxdna>`
* :doc:`oxdna/hbond <pair_oxdna>`
@ -239,6 +242,7 @@ OPT.
* :doc:`reaxff (ko) <pair_reaxff>`
* :doc:`rebo (io) <pair_airebo>`
* :doc:`resquared (go) <pair_resquared>`
* :doc:`saip/metal <pair_saip_metal>`
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
* :doc:`smd/hertz <pair_smd_hertz>`
* :doc:`smd/tlsph <pair_smd_tlsph>`
@ -262,6 +266,7 @@ OPT.
* :doc:`spin/neel <pair_spin_neel>`
* :doc:`srp <pair_srp>`
* :doc:`sw (giko) <pair_sw>`
* :doc:`sw/mod (o) <pair_sw>`
* :doc:`table (gko) <pair_table>`
* :doc:`table/rx (k) <pair_table_rx>`
* :doc:`tdpd <pair_mesodpd>`

View File

@ -11,6 +11,7 @@ of time and requests from the LAMMPS user community.
:maxdepth: 1
Developer_org
Developer_cxx_vs_c_style
Developer_parallel
Developer_flow
Developer_write
@ -18,4 +19,5 @@ of time and requests from the LAMMPS user community.
Developer_plugins
Developer_unittest
Classes
Developer_platform
Developer_utils

View File

@ -0,0 +1,384 @@
Code design
-----------
This section discusses some of the code design choices in LAMMPS and
overall strategy in order to assist developers to write new code that
will fit well with the remaining code. Please see the section on
:doc:`Requirements for contributed code <Modify_style>` for more
specific recommendations and guidelines. While that section is
organized more in the form of a checklist for code contributors, the
focus here is on overall code design strategy, choices made between
possible alternatives, and to discuss of some relevant C++ programming
language constructs.
Historically, the basic design philosophy of the LAMMPS C++ code was
that of a "C with classes" style. The was motivated by the desire to
make it easier to modify LAMMPS for people without significant training
in C++ programming and by trying to use data structures and code constructs
that somewhat resemble the previous implementation(s) in Fortran.
A contributing factor for this choice also was that at the time the
implementation of C++ compilers was not always very mature and some of
the advanced features contained bugs or were not functioning exactly
as the standard required; plus there was some disagreement between
compiler vendors about how to interpret the C++ standard documents.
However, C++ compilers have advanced a lot since then and with the
transition to requiring the C++11 standard in 2020 as the minimum C++ language
standard for LAMMPS, the decision was made to also replace some of the
C-style constructs with equivalent C++ functionality, either from the
C++ standard library or as custom classes or function, in order to
improve readability of the code and to increase code reuse through
abstraction of commonly used functionality.
.. note::
Please note that as of spring 2022 there is still a sizable chunk of
legacy code in LAMMPS that has not yet been refactored to reflect these
style conventions in full. LAMMPS has a large code base and many
different contributors and there also is a hierarchy of precedence
in which the code is adapted. Highest priority has the code in the
``src`` folder, followed by code in packages in order of their popularity
and complexity (simpler code is adapted sooner), followed by code
in the ``lib`` folder. Source code that is downloaded during compilation
is not subject to the conventions discussed here.
Object oriented code
^^^^^^^^^^^^^^^^^^^^
LAMMPS is designed to be an object oriented code, that is each
simulation is represented by an instance of the LAMMPS class. When
running in parallel, of course, each MPI process will create 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++
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
lammps->input->file();
delete lammps;
The first line creates a LAMMPS class instance and passes the command
line arguments and the global communicator to its constructor. The
second line tells the LAMMPS instance to process the input (either from
standard input or the provided input file) until the end. And the third
line deletes that instance again. The remainder of the main.cpp file
are for error handling, MPI configuration and other special features.
In the constructor of the LAMMPS class instance the basic LAMMPS class hierarchy
is created as shown in :ref:`class-topology`. While processing the input further
class instances are created, or deleted, or replaced and specific member functions
of specific classes are called to trigger actions like creating atoms, computing
forces, computing properties, propagating the system, or writing output.
Compositing and Inheritance
===========================
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
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 a composite again containing instances
of classes describing the force interactions or ``Modify`` containing
and calling fixes and computes. In most cases (e.g. ``AtomVec``, ``Comm``,
``Pair``, or ``Bond``) there is only one instance of those member classes
allowed, but in a few cases (e.g. ``Region``, ``Fix``, ``Compute``, or
``Dump``) there can be multiple instances and the parent class is
maintaining a list of the pointers of instantiated classes instead
of a single pointer.
Changing behavior or adjusting how LAMMPS handles a simulation is
implemented via **inheritance** where different variants of the
functionality are realized by creating *derived* classes that can share
common functionality in their base class and provide a consistent
interface where the derived classes replace (dummy or pure) functions in
the base class. The higher level classes can then call those methods of
the instantiated classes without having to know which specific derived
class variant was instantiated. In the LAMMPS documentation those
derived classes are usually referred to a "styles", e.g. pair styles,
fix styles, atom styles and so on.
This is the origin of the flexibility of LAMMPS and facilitates for
example to compute forces for very different non-bonded potential
functions by having different pair styles (implemented as different
classes derived from the ``Pair`` class) where the evaluation of the
potential function is confined to the implementation of the individual
classes. Whenever a new :doc:`pair_style` or :doc:`bond_style` or
:doc:`comm_style` or similar command is processed in the LAMMPS input
any existing class instance is deleted and a new instance created in
it place.
Classes derived from ``Fix`` or ``Compute`` represent a different facet
of LAMMPS' flexibility as there can be multiple instances of them an
their member functions will be called at different phases of the time
integration process (as explained in `Developer_flow`). This way
multiple manipulations of the entire or parts of the system can be
programmed (with fix styles) or different computations can be performed
and accessed and further processed or output through a common interface
(with compute styles).
Further code sharing is possible by creating derived classes from the
derived classes (for instance to implement an accelerated version of a
pair style) where then only a subset of the methods are replaced with
the accelerated versions.
Polymorphism
============
Polymorphism and dynamic dispatch are another OOP feature that play an
important part of how LAMMPS selects which code to execute. In a nutshell,
this is a mechanism where the decision of which member function to call
from a class is determined at runtime and not when the code is compiled.
To enable it, the function has to be declared as ``virtual`` and all
corresponding functions in derived classes should be using the ``override``
property. Below is a brief example.
.. code-block:: c++
class Base {
public:
virtual ~Base() = default;
void call();
void normal();
virtual void poly();
};
void Base::call() {
normal();
poly();
}
class Derived : public Base {
public:
~Derived() override = default;
void normal();
void poly() override;
};
// [....]
Base *base1 = new Base();
Base *base2 = new Derived();
base1->call();
base2->call();
The difference in behavior of the ``normal()`` and the ``poly()`` member
functions is in which of the two member functions is called when
executing `base1->call()` and `base2->call()`. Without polymorphism, a
function within the base class will call only member functions within
the same scope, that is ``Base::call()`` will always call
``Base::normal()``. But for the `base2->call()` the call for the
virtual member function will be dispatched to ``Derived::poly()``
instead. This mechanism allows to always call functions within the
scope of the class type that was used to create the class instance, even
if they are assigned to a pointer using the type of a base class. This
is the desired behavior, and thanks to dynamic dispatch, LAMMPS can even
use styles that are loaded at runtime from a shared object file with the
:doc:`plugin command <plugin>`.
A special case of virtual functions are so-called pure functions. These
are virtual functions that are initialized to 0 in the class declaration
(see example below).
.. code-block:: c++
class Base {
public:
virtual void pure() = 0;
};
This has the effect that it will no longer be possible to create an
instance of the base class and that derived classes **must** implement
these functions. Many of the functions listed with the various class
styles in the section :doc:`Modify` are such pure functions. The
motivation for this is to define the interface or API of the functions
but defer the implementation to the derived classes.
However, there are downsides to this. For example, calls to virtual
functions from within a constructor, will not be in the scope of the
derived class and thus it is good practice to either avoid calling them
or to provide an explicit scope like in ``Base::poly()``. Furthermore,
any destructors in classes containing virtual functions should be
declared virtual, too, so they are processed in the expected order
before types are removed from dynamic dispatch.
.. admonition:: Important Notes
In order to be able to detect incompatibilities and to avoid unexpected
behavior already at compile time, it is crucial that all member functions
that are intended to replace a virtual or pure function use the ``override``
property keyword. For the same reason it should be avoided to use overloads
or default arguments for virtual functions as they lead to confusion over
which function is supposed to override which and which arguments need to be
declared.
Style Factories
===============
In order to create class instances of the different styles, LAMMPS often
uses a programming pattern called `Factory`. Those are functions that create
an instance of a specific derived class, say ``PairLJCut`` and return a pointer
to the type of the common base class of that style, ``Pair`` in this case.
To associate the factory function with the style keyword, an ``std::map``
class is used in which function pointers are indexed by their keyword
(for example "lj/cut" for ``PairLJCut`` and "morse" ``PairMorse``).
A couple of typedefs help to keep the code readable and a template function
is used to implement the actual factory functions for the individual classes.
I/O and output formatting
^^^^^^^^^^^^^^^^^^^^^^^^^
C-style stdio versus C++ style iostreams
========================================
LAMMPS chooses to use the "stdio" library of the standard C library for
reading from and writing to files and console instead of C++
"iostreams". This is mainly motivated by the better performance, better
control over formatting, and less effort to achieve specific formatting.
Since mixing "stdio" and "iostreams" can lead to unexpected behavior using
the latter is strongly discouraged. Also output to the screen should not
use the predefined ``stdout`` FILE pointer, but rather the ``screen`` and
``logfile`` FILE pointers managed by the LAMMPS class. Furthermore, output
should only be done by MPI rank 0 (``comm->me == 0``) and output that is
send to both ``screen`` and ``logfile`` should use the
:cpp:func:`utils::logmesg() convenience function <LAMMPS_NS::utils::logmesg>`.
We also discourage the use for stringstreams as the bundled {fmt} library
and the customized tokenizer classes can provide the same functionality
in a cleaner way with better performance. This will also help to retain
a consistent programming style despite the many different contributors.
Formatting with the {fmt} library
===================================
The LAMMPS source code includes a copy of the `{fmt} library
<https://fmt.dev>`_ which is preferred over formatting with the
"printf()" family of functions. The primary reason is that it allows a
typesafe default format for any type of supported data. This is
particularly useful for formatting integers of a given size (32-bit or
64-bit) which may require different format strings depending on compile
time settings or compilers/operating systems. Furthermore, {fmt} gives
better performance, has more functionality, a familiar formatting syntax
that has similarities to ``format()`` in Python, and provides a facility
that can be used to integrate format strings and a variable number of
arguments into custom functions in a much simpler way that the varargs
mechanism of the C library. Finally, {fmt} has been included into the
C++20 language standard, so changes to adopt it are future proof.
Formatted strings are frequently created by calling the
``fmt::format()`` function which will return a string as ``std::string``
class instance. In contrast to the ``%`` placeholder in ``printf()``,
the {fmt} library uses ``{}`` to embed format descriptors. In the
simplest case, no additional characters are needed as {fmt} will choose
the default format based on the data type of the argument. Alternatively
The ``fmt::print()`` function may be used instead of ``printf()`` or
``fprintf()``. In addition, several LAMMPS output functions, that
originally accepted a single string as arguments have been overloaded to
accept a format string with optional arguments as well (e.g.
``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
Summary of the {fmt} format syntax
==================================
The syntax of the format string is "{[<argument id>][:<format spec>]}",
where either the argument id or the format spec (separated by a colon
':') is optional. The argument id is usually a number starting from 0
that is the index to the arguments following the format string. By
default these are assigned in order (i.e. 0, 1, 2, 3, 4 etc.). The most
common case for using argument id would be to use the same argument in
multiple places in the format string without having to provide it as an
argument multiple times. In LAMMPS the argument id is rarely used.
More common is the use of the format specifier, which starts with a
colon. This may optionally be followed by a fill character (default is
' '). If provided, the fill character **must** be followed by an
alignment character ('<', '^', '>' for left, centered, or right
alignment (default)). The alignment character may be used without a fill
character. The next important format parameter would be the minimum
width, which may be followed by a dot '.' and a precision for floating
point numbers. The final character in the format string would be an
indicator for the "presentation", i.e. 'd' for decimal presentation of
integers, 'x' for hexadecimal, 'o' for octal, 'c' for character
etc. This mostly follows the "printf()" scheme but without requiring an
additional length parameter to distinguish between different integer
widths. The {fmt} library will detect those and adapt the formatting
accordingly. For floating point numbers there are correspondingly, 'g'
for generic presentation, 'e' for exponential presentation, and 'f' for
fixed point presentation.
Thus "{:8}" would represent *any* type argument using at least 8
characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
"{:>8}" as right aligned. If a specific presentation is selected, the
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
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",
label, time_min, time, time_max, time_sq, tmp);
utils::logmesg(lmp,"{:>6} = max # of 1-2 neighbors\n",maxall);
utils::logmesg(lmp,"Lattice spacing in x,y,z = {:.8} {:.8} {:.8}\n",
xlattice,ylattice,zlattice);
which will create the following output lines:
.. parsed-literal::
CPU time: 0:02:16
Pair | 2.0133 | 2.0133 | 2.0133 | 0.0 | 84.21
4 = max # of 1-2 neighbors
Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962
A special feature of the {fmt} library is that format parameters like
the width or the precision may be also provided as arguments. In that
case a nested format is used where a pair of curly braces (with an
optional argument id) "{}" are used instead of the value, for example
"{:{}d}" will consume two integer arguments, the first will be the value
shown and the second the minimum width.
For more details and examples, please consult the `{fmt} syntax
documentation <https://fmt.dev/latest/syntax.html>`_ website.
Memory management
^^^^^^^^^^^^^^^^^
Dynamical allocation of data and objects should be done with either the
C++ commands "new" and "delete/delete[]" or using member functions of
the ``Memory`` class, most commonly, ``Memory::create()``,
``Memory::grow()``, and ``Memory::destroy()``. The use of ``malloc()``,
``calloc()``, ``realloc()`` and ``free()`` directly is strongly
discouraged. To simplify adapting legacy code into the LAMMPS code base
the member functions ``Memory::smalloc()``, ``Memory::srealloc()``, and
``Memory::sfree()`` are available.
Using those custom memory allocation functions is motivated by the
following considerations:
- memory allocation failures on *any* MPI rank during a parallel run
will trigger an immediate abort of the entire parallel calculation
instead of stalling it
- a failing "new" will trigger an exception which is also captured by
LAMMPS and triggers a global abort
- allocation of multi-dimensional arrays will be done in a C compatible
fashion but so that the storage of the actual data is stored in one
large consecutive block and thus when MPI communication is needed,
only this storage needs to be communicated (similar to Fortran arrays)
- the "destroy()" and "sfree()" functions may safely be called on NULL
pointers
- the "destroy()" functions will nullify the pointer variables making
"use after free" errors easy to detect
- it is possible to use a larger than default memory alignment (not on
all operating systems, since the allocated storage pointers must be
compatible with ``free()`` for technical reasons)
In the practical implementation of code this means that any pointer variables
that are class members should be initialized to a ``nullptr`` value in their
respective constructors. That way it would be safe to call ``Memory::destroy()``
or ``delete[]`` on them before *any* allocation outside the constructor.
This helps to prevent memory leaks.

View File

@ -7,6 +7,61 @@ typically document what a variable stores, what a small section of
code does, or what a function does and its input/outputs. The topics
on this page are intended to document code functionality at a higher level.
Reading and parsing of text and text files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is frequently required for a class in LAMMPS to read in additional
data from a file, most commonly potential parameters from a potential
file for manybody potentials. LAMMPS provides several custom classes
and convenience functions to simplify the process. This offers the
following benefits:
- better code reuse and fewer lines of code needed to implement reading
and parsing data from a file
- better detection of format errors, incompatible data, and better error messages
- exit with an error message instead of silently converting only part of the
text to a number or returning a 0 on unrecognized text and thus reading incorrect values
- re-entrant code through avoiding global static variables (as used by ``strtok()``)
- transparent support for translating unsupported UTF-8 characters to their ASCII equivalents
(the text to value conversion functions **only** accept ASCII characters)
In most cases (e.g. potential files) the same data is needed on all MPI
ranks. Then it is best to do the reading and parsing only on MPI rank
0, and communicate the data later with one or more ``MPI_Bcast()``
calls. For reading generic text and potential parameter files the
custom classes :cpp:class:`TextFileReader <LAMMPS_NS::TextFileReader>`
and :cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>`
are available. Those classes allow to read the file as individual lines
for which they can return a tokenizer class (see below) for parsing the
line, or they can return blocks of numbers as a vector directly. The
documentation on `File reader classes <file-reader-classes>`_ contains
an example for a typical case.
When reading per-atom data, the data in the file usually needs include
an atom ID so it can be associated with a particular atom. In that case
the data can be read in multi-line chunks and broadcast to all MPI ranks
with :cpp:func:`utils::read_lines_from_file()
<LAMMPS_NS::utils::read_lines_from_file>`. Those chunks are then
split into lines, parsed, and applied only to atoms the MPI rank
"owns".
For splitting a string (incrementally) into words and optionally
converting those to numbers, the :cpp:class:`Tokenizer
<LAMMPS_NS::Tokenizer>` and :cpp:class:`ValueTokenizer
<LAMMPS_NS::ValueTokenizer>` can be used. Those provide a superset of
the functionality of ``strtok()`` from the C-library and the latter also
includes conversion to different types. Any errors while processing the
string in those classes will result in an exception, which can be caught
and the error processed as needed. Unlike the C-library functions
``atoi()``, ``atof()``, ``strtol()``, or ``strtod()`` the conversion
will check if the converted text is a valid integer of floating point
number and will not silently return an unexpected or incorrect value.
For example, ``atoi()`` will return 12 when converting "12.5" while the
ValueTokenizer class will throw an :cpp:class:`InvalidIntegerException
<LAMMPS_NS::InvalidIntegerException>` if
:cpp:func:`ValueTokenizer::next_int()
<LAMMPS_NS::ValueTokenizer::next_int>` is called on the same string.
Fix contributions to instantaneous energy, virial, and cumulative energy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -225,7 +225,7 @@ follows:
commands in an input script.
- The Force class computes various forces between atoms. The Pair
parent class is for non-bonded or pair-wise forces, which in LAMMPS
parent class is for non-bonded or pairwise forces, which in LAMMPS
also includes many-body forces such as the Tersoff 3-body potential if
those are computed by walking pairwise neighbor lists. The Bond,
Angle, Dihedral, Improper parent classes are styles for bonded

View File

@ -0,0 +1,155 @@
Platform abstraction functions
------------------------------
The ``platform`` sub-namespace inside the ``LAMMPS_NS`` namespace
provides a collection of wrapper and convenience functions and utilities
that perform common tasks for which platform specific code would be
required or for which a more high-level abstraction would be convenient
and reduce duplicated code. This reduces redundant implementations and
encourages consistent behavior and thus has some overlap with the
:doc:`"utils" sub-namespace <Developer_utils>`.
Time functions
^^^^^^^^^^^^^^
.. doxygenfunction:: cputime
:project: progguide
.. doxygenfunction:: walltime
:project: progguide
.. doxygenfunction:: usleep
:project: progguide
Platform information functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: os_info
:project: progguide
.. doxygenfunction:: compiler_info
:project: progguide
.. doxygenfunction:: cxx_standard
:project: progguide
.. doxygenfunction:: openmp_standard
:project: progguide
.. doxygenfunction:: mpi_vendor
:project: progguide
.. doxygenfunction:: mpi_info
:project: progguide
.. doxygenfunction:: compress_info
:project: progguide
File and path functions and global constants
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenvariable:: filepathsep
:project: progguide
.. doxygenvariable:: pathvarsep
:project: progguide
.. doxygenfunction:: guesspath
:project: progguide
.. doxygenfunction:: path_basename
:project: progguide
.. doxygenfunction:: path_join
:project: progguide
.. doxygenfunction:: file_is_readable
:project: progguide
.. doxygenfunction:: is_console
:project: progguide
.. doxygenfunction:: path_is_directory
:project: progguide
.. doxygenfunction:: current_directory
:project: progguide
.. doxygenfunction:: list_directory
:project: progguide
.. doxygenfunction:: chdir
:project: progguide
.. doxygenfunction:: mkdir
:project: progguide
.. doxygenfunction:: rmdir
:project: progguide
.. doxygenfunction:: unlink
:project: progguide
Standard I/O function wrappers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenvariable:: END_OF_FILE
:project: progguide
.. doxygenfunction:: ftell
:project: progguide
.. doxygenfunction:: fseek
:project: progguide
.. doxygenfunction:: ftruncate
:project: progguide
.. doxygenfunction:: popen
:project: progguide
.. doxygenfunction:: pclose
:project: progguide
Environment variable functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: putenv
:project: progguide
.. doxygenfunction:: unsetenv
:project: progguide
.. doxygenfunction:: list_pathenv
:project: progguide
.. doxygenfunction:: find_exe_path
:project: progguide
Dynamically loaded object or library functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: dlopen
:project: progguide
.. doxygenfunction:: dlclose
:project: progguide
.. doxygenfunction:: dlsym
:project: progguide
.. doxygenfunction:: dlerror
:project: progguide
Compressed file I/O functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: has_compress_extension
:project: progguide
.. doxygenfunction:: compressed_read
:project: progguide
.. doxygenfunction:: compressed_write
:project: progguide

View File

@ -7,7 +7,9 @@ a collection of convenience functions and utilities that perform common
tasks that are required repeatedly throughout the LAMMPS code like
reading or writing to files with error checking or translation of
strings into specific types of numbers with checking for validity. This
reduces redundant implementations and encourages consistent behavior.
reduces redundant implementations and encourages consistent behavior and
thus has some overlap with the :doc:`"platform" sub-namespace
<Developer_platform>`.
I/O with status check and similar functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -19,18 +21,21 @@ In that case, the functions will stop with an error message, indicating
the name of the problematic file, if possible unless the *error* argument
is a NULL pointer.
The :cpp:func:`fgets_trunc` function will work similar for ``fgets()``
but it will read in a whole line (i.e. until the end of line or end
of file), but store only as many characters as will fit into the buffer
including a final newline character and the terminating NULL byte.
If the line in the file is longer it will thus be truncated in the buffer.
This function is used by :cpp:func:`read_lines_from_file` to read individual
lines but make certain they follow the size constraints.
The :cpp:func:`utils::fgets_trunc() <LAMMPS_NS::utils::fgets_trunc>`
function will work similar for ``fgets()`` but it will read in a whole
line (i.e. until the end of line or end of file), but store only as many
characters as will fit into the buffer including a final newline
character and the terminating NULL byte. If the line in the file is
longer it will thus be truncated in the buffer. This function is used
by :cpp:func:`utils::read_lines_from_file()
<LAMMPS_NS::utils::read_lines_from_file>` to read individual lines but
make certain they follow the size constraints.
The :cpp:func:`read_lines_from_file` function will read the requested
number of lines of a maximum length into a buffer and will return 0
if successful or 1 if not. It also guarantees that all lines are
terminated with a newline character and the entire buffer with a
The :cpp:func:`utils::read_lines_from_file()
<LAMMPS_NS::utils::read_lines_from_file>` function will read the
requested number of lines of a maximum length into a buffer and will
return 0 if successful or 1 if not. It also guarantees that all lines
are terminated with a newline character and the entire buffer with a
NULL character.
----------
@ -54,33 +59,54 @@ String to number conversions with validity check
These functions should be used to convert strings to numbers. They are
are strongly preferred over C library calls like ``atoi()`` or
``atof()`` since they check if the **entire** provided string is a valid
``atof()`` since they check if the **entire** string is a valid
(floating-point or integer) number, and will error out instead of
silently returning the result of a partial conversion or zero in cases
where the string is not a valid number. This behavior allows to more
easily detect typos or issues when processing input files.
where the string is not a valid number. This behavior improves
detecting typos or issues when processing input files.
Similarly the :cpp:func:`utils::logical() <LAMMPS_NS::utils::logical>` function
will convert a string into a boolean and will only accept certain words.
The *do_abort* flag should be set to ``true`` in case this function
is called only on a single MPI rank, as that will then trigger the
a call to ``Error::one()`` for errors instead of ``Error::all()``
and avoids a "hanging" calculation when run in parallel.
Please also see :cpp:func:`is_integer() <LAMMPS_NS::utils::is_integer>`
and :cpp:func:`is_double() <LAMMPS_NS::utils::is_double>` for testing
Please also see :cpp:func:`utils::is_integer() <LAMMPS_NS::utils::is_integer>`
and :cpp:func:`utils::is_double() <LAMMPS_NS::utils::is_double>` for testing
strings for compliance without conversion.
----------
.. doxygenfunction:: numeric
.. doxygenfunction:: numeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: inumeric
.. doxygenfunction:: numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: bnumeric
.. doxygenfunction:: inumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: tnumeric
.. doxygenfunction:: inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: bnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: tnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: logical(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: logical(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
:project: progguide
@ -95,6 +121,12 @@ and parsing files or arguments.
.. doxygenfunction:: strdup
:project: progguide
.. doxygenfunction:: lowercase
:project: progguide
.. doxygenfunction:: uppercase
:project: progguide
.. doxygenfunction:: trim
:project: progguide
@ -137,21 +169,6 @@ and parsing files or arguments.
.. doxygenfunction:: is_double
:project: progguide
File and path functions
^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: guesspath
:project: progguide
.. doxygenfunction:: path_basename
:project: progguide
.. doxygenfunction:: path_join
:project: progguide
.. doxygenfunction:: file_is_readable
:project: progguide
Potential file functions
^^^^^^^^^^^^^^^^^^^^^^^^
@ -191,6 +208,9 @@ Convenience functions
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
:project: progguide
.. doxygenfunction:: flush_buffers(LAMMPS *lmp)
:project: progguide
.. doxygenfunction:: getsyserror
:project: progguide
@ -323,11 +343,11 @@ This code example should produce the following output:
.. doxygenclass:: LAMMPS_NS::InvalidIntegerException
:project: progguide
:members: what
:members:
.. doxygenclass:: LAMMPS_NS::InvalidFloatException
:project: progguide
:members: what
:members:
----------
@ -376,21 +396,26 @@ A typical code segment would look like this:
----------
.. file-reader-classes:
File reader classes
-------------------
The purpose of the file reader classes is to simplify the recurring task
of reading and parsing files. They can use the
:cpp:class:`LAMMPS_NS::ValueTokenizer` class to process the read in
text. The :cpp:class:`LAMMPS_NS::TextFileReader` is a more general
version while :cpp:class:`LAMMPS_NS::PotentialFileReader` is specialized
to implement the behavior expected for looking up and reading/parsing
files with potential parameters in LAMMPS. The potential file reader
class requires a LAMMPS instance, requires to be run on MPI rank 0 only,
will use the :cpp:func:`LAMMPS_NS::utils::get_potential_file_path`
function to look up and 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.
:cpp:class:`ValueTokenizer <LAMMPS_NS::ValueTokenizer>` class to process
the read in text. The :cpp:class:`TextFileReader
<LAMMPS_NS::TextFileReader>` is a more general version while
:cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>` is
specialized to implement the behavior expected for looking up and
reading/parsing files with potential parameters in LAMMPS. The
potential file reader class requires a LAMMPS instance, requires to be
run on MPI rank 0 only, will use the
:cpp:func:`utils::get_potential_file_path
<LAMMPS_NS::utils::get_potential_file_path>` function to look up and
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++
:caption: Use of PotentialFileReader class in pair style coul/streitz
@ -465,10 +490,10 @@ provided, as that is used to determine whether a new page of memory
must be used.
The :cpp:class:`MyPage <LAMMPS_NS::MyPage>` class offers two ways to
reserve a chunk: 1) with :cpp:func:`get() <LAMMPS_NS::MyPage::get>` the
chunk size needs to be known in advance, 2) with :cpp:func:`vget()
reserve a chunk: 1) with :cpp:func:`MyPage::get() <LAMMPS_NS::MyPage::get>` the
chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
<LAMMPS_NS::MyPage::vget>` a pointer to the next chunk is returned, but
its size is registered later with :cpp:func:`vgot()
its size is registered later with :cpp:func:`MyPage::vgot()
<LAMMPS_NS::MyPage::vgot>`.
.. code-block:: C++
@ -571,4 +596,3 @@ the communication buffers.
.. doxygenunion:: LAMMPS_NS::ubuf
:project: progguide

View File

@ -29,7 +29,9 @@ of code in the header before include guards:
.. code-block:: c
#ifdef FIX_CLASS
FixStyle(print/vel,FixPrintVel)
// clang-format off
FixStyle(print/vel,FixPrintVel);
// clang-format on
#else
/* the definition of the FixPrintVel class comes here */
...
@ -53,7 +55,7 @@ of each timestep. First of all, implement a constructor:
if (narg < 4)
error->all(FLERR,"Illegal fix print/vel command");
nevery = force->inumeric(FLERR,arg[3]);
nevery = utils::inumeric(FLERR,arg[3],false,lmp);
if (nevery <= 0)
error->all(FLERR,"Illegal fix print/vel command");
}

View File

@ -1941,6 +1941,9 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
*Compute ID for fix numdiff does not exist*
Self-explanatory.
*Compute ID for fix numdiff/virial does not exist*
Self-explanatory.
*Compute ID for fix store/state does not exist*
Self-explanatory.
@ -3796,6 +3799,10 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
Self-explanatory. Efficient loop over all atoms for numerical
difference requires consecutive atom IDs.
*Fix numdiff/virial must use group all*
Virial contributions computed by this fix are
computed on all atoms.
*Fix nve/asphere requires extended particles*
This fix can only be used for particles with a shape setting.
@ -7772,9 +7779,6 @@ keyword to allow for additional bonds to be formed
The system size must fit in a 32-bit integer to use this dump
style.
*Too many atoms to dump sort*
Cannot sort when running with more than 2\^31 atoms.
*Too many elements extracted from MEAM library.*
Increase 'maxelt' in meam.h and recompile.

View File

@ -416,7 +416,7 @@ This will most likely cause errors in kinetic fluctuations.
not defined for the specified atom style.
*Molecule has bond topology but no special bond settings*
This means the bonded atoms will not be excluded in pair-wise
This means the bonded atoms will not be excluded in pairwise
interactions.
*Molecule template for create_atoms has multiple molecules*

View File

@ -80,7 +80,7 @@ Lowercase directories
+-------------+------------------------------------------------------------------+
| friction | frictional contact of spherical asperities between 2d surfaces |
+-------------+------------------------------------------------------------------+
| gcmc | Grand Canonical Monte Carlo (GCMC) via the fix gcmc command |
| mc | Monte Carlo features via fix gcmc, widom and other commands |
+-------------+------------------------------------------------------------------+
| granregion | use of fix wall/region/gran as boundary on granular particles |
+-------------+------------------------------------------------------------------+
@ -205,7 +205,7 @@ Uppercase directories
+------------+--------------------------------------------------------------------------------------------------+
| KAPPA | compute thermal conductivity via several methods |
+------------+--------------------------------------------------------------------------------------------------+
| MC | using LAMMPS in a Monte Carlo mode to relax the energy of a system |
| MC-LOOP | using LAMMPS in a Monte Carlo mode to relax the energy of a system in a input script loop |
+------------+--------------------------------------------------------------------------------------------------+
| PACKAGES | examples for specific packages and contributed commands |
+------------+--------------------------------------------------------------------------------------------------+

View File

@ -491,11 +491,6 @@ NPT ensemble using Nose-Hoover thermostat:
**(Schroeder)** Schroeder and Steinhauser, J Chem Phys, 133,
154511 (2010).
.. _Jiang2:
**(Jiang)** Jiang, Hardy, Phillips, MacKerell, Schulten, and Roux,
J Phys Chem Lett, 2, 87-92 (2011).
.. _Thole2:
**(Thole)** Chem Phys, 59, 341 (1981).

View File

@ -7,11 +7,11 @@ LAMMPS GitHub tutorial
This document describes the process of how to use GitHub to integrate
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 reacquaint yourself with some
of the more advanced git features used below.
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
more advanced git features used below.
As of fall 2016, submitting contributions to LAMMPS via pull requests
on GitHub is the preferred option for integrating contributed features
@ -37,15 +37,15 @@ username or e-mail address and password.
**Forking the repository**
To get changes into LAMMPS, you need to first fork the `lammps/lammps`
repository on GitHub. At the time of writing, *master* is the preferred
repository on GitHub. At the time of writing, *develop* is the preferred
target branch. Thus go to `LAMMPS on GitHub <https://github.com/lammps/lammps>`_
and make sure branch is set to "master", as shown in the figure below.
and make sure branch is set to "develop", as shown in the figure below.
.. image:: JPG/tutorial_branch.png
:align: center
If it is not, use the button to change it to *master*\ . Once it is, use the
fork button to create a fork.
If it is not, use the button to change it to *develop*. Once it is, use
the fork button to create a fork.
.. image:: JPG/tutorial_fork.png
:align: center
@ -64,11 +64,12 @@ LAMMPS development.
**Adding changes to your own fork**
Additions to the upstream version of LAMMPS are handled using *feature
branches*\ . For every new feature, a so-called feature branch is
branches*. For every new feature, a so-called feature branch is
created, which contains only those modification relevant to one specific
feature. For example, adding a single fix would consist of creating a
branch with only the fix header and source file and nothing else. It is
explained in more detail here: `feature branch workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
explained in more detail here: `feature branch workflow
<https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
**Feature branches**
@ -94,8 +95,8 @@ The above command copies ("clones") the git repository to your local
machine to a directory with the name you chose. If none is given, it will
default to "lammps". Typical names are "mylammps" or something similar.
You can use this local clone to make changes and
test them without interfering with the repository on GitHub.
You can use this local clone to make changes and test them without
interfering with the repository on GitHub.
To pull changes from upstream into this copy, you can go to the directory
and use git pull:
@ -103,28 +104,46 @@ and use git pull:
.. code-block:: bash
$ cd mylammps
$ git checkout master
$ git pull https://github.com/lammps/lammps
$ 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 lammps_upstream https://www.github.com/lammps/lammps
$ git remote add upstream https://www.github.com/lammps/lammps
At this point, you typically make a feature branch from the updated master
From then on you can update your upstream branches with:
.. code-block:: bash
$ git fetch upstream
and then refer to the upstream repository branches with
`upstream/develop` or `upstream/release` and so on.
At this point, you typically make a feature branch from the updated
branch for the feature you want to work on. This tutorial contains the
workflow that updated this tutorial, and hence we will call the branch
"github-tutorial-update":
.. code-block:: bash
$ git checkout -b github-tutorial-update master
$ 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,
unrelated feature, you should switch branches!
.. note::
Committing changes to the *develop*, *release*, or *stable* branches
is strongly discouraged. While it may be convenient initially, it
will create more work in the long run. Various texts and tutorials
on using git effectively discuss the motivation for using feature
branches instead.
**After changes are made**
After everything is done, add the files to the branch and commit them:
@ -287,28 +306,32 @@ After each push, the automated checks are run again.
LAMMPS developers may add labels to your pull request to assign it to
categories (mostly for bookkeeping purposes), but a few of them are
important: needs_work, work_in_progress, test-for-regression, and
full-regression-test. The first two indicate, that your pull request
is not considered to be complete. With "needs_work" the burden is on
exclusively on you; while "work_in_progress" can also mean, that a
LAMMPS developer may want to add changes. Please watch the comments
to the pull requests. The two "test" labels are used to trigger
extended tests before the code is merged. This is sometimes done by
LAMMPS developers, if they suspect that there may be some subtle
side effects from your changes. It is not done by default, because
those tests are very time consuming.
important: *needs_work*, *work_in_progress*, *run_tests*,
*test_for_regression*, and *ready_for_merge*. The first two indicate,
that your pull request is not considered to be complete. With
"needs_work" the burden is on exclusively on you; while
"work_in_progress" can also mean, that a LAMMPS developer may want to
add changes. Please watch the comments to the pull requests. The two
"test" labels are used to trigger extended tests before the code is
merged. This is sometimes done by LAMMPS developers, if they suspect
that there may be some subtle side effects from your changes. It is not
done by default, because those tests are very time consuming. The
*ready_for_merge* label is usually attached when the LAMMPS developer
assigned to the pull request considers this request complete and to
trigger a final full test evaluation.
**Reviews**
As of Summer 2018, a pull request needs at least 1 approving review
from a LAMMPS developer with write access to the repository.
In case your changes touch code that certain developers are associated
with, they are auto-requested by the GitHub software. Those associations
are set in the file
`.github/CODEOWNERS <https://github.com/lammps/lammps/blob/master/.github/CODEOWNERS>`_
Thus if you want to be automatically notified to review when anybody
changes files or packages, that you have contributed to LAMMPS, you can
add suitable patterns to that file, or a LAMMPS developer may add you.
As of Fall 2021, a pull request needs to pass all automatic tests and at
least 1 approving review from a LAMMPS developer with write access to
the repository before it is eligible for merging. In case your changes
touch code that certain developers are associated with, they are
auto-requested by the GitHub software. Those associations are set in
the file `.github/CODEOWNERS
<https://github.com/lammps/lammps/blob/develop/.github/CODEOWNERS>`_ Thus
if you want to be automatically notified to review when anybody changes
files or packages, that **you** have contributed to LAMMPS, you can add
suitable patterns to that file, or a LAMMPS developer may add you.
Otherwise, you can also manually request reviews from specific developers,
or LAMMPS developers - in their assessment of your pull request - may
@ -329,7 +352,7 @@ LAMMPS developer (including him/herself) or c) Axel Kohlmeyer (akohlmey).
After the review, the developer can choose to implement changes directly
or suggest them to you.
* Case c) means that the pull request has been assigned to the developer
overseeing the merging of pull requests into the master branch.
overseeing the merging of pull requests into the *develop* branch.
In this case, Axel assigned the tutorial to Steve:
@ -351,11 +374,11 @@ Sometimes, however, you might not feel comfortable having other people
push changes into your own branch, or maybe the maintainers are not sure
their idea was the right one. In such a case, they can make changes,
reassign you as the assignee, and file a "reverse pull request", i.e.
file a pull request in your GitHub repository to include changes in the
branch, that you have submitted as a pull request yourself. In that
case, you can choose to merge their changes back into your branch,
possibly make additional changes or corrections and proceed from there.
It looks something like this:
file a pull request in **your** forked GitHub repository to include
changes in the branch, that you have submitted as a pull request
yourself. In that case, you can choose to merge their changes back into
your branch, possibly make additional changes or corrections and proceed
from there. It looks something like this:
.. image:: JPG/tutorial_reverse_pull_request.png
:align: center
@ -419,7 +442,7 @@ This merge also shows up on the lammps GitHub page:
**After a merge**
When everything is fine, the feature branch is merged into the master branch:
When everything is fine, the feature branch is merged into the *develop* branch:
.. image:: JPG/tutorial_merged.png
:align: center
@ -433,8 +456,8 @@ branch!
.. code-block:: bash
$ git checkout master
$ git pull master
$ 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
@ -442,6 +465,7 @@ you at the next statement that you are deleting a local branch that
was not yet fully merged into HEAD. This is because git does not yet
know your branch just got merged into LAMMPS upstream. If you
first delete and then pull, everything should still be fine.
You can display all branches that are fully merged by:
Finally, if you delete the branch locally, you might want to push this
to your remote(s) as well:
@ -453,14 +477,14 @@ to your remote(s) as well:
**Recent changes in the workflow**
Some changes to the workflow are not captured in this tutorial. For
example, in addition to the master branch, to which all new features
should be submitted, there is now also an "unstable" and a "stable"
branch; these have the same content as "master", but are only updated
after a patch release or stable release was made.
Furthermore, the naming of the patches now follow the pattern
"patch_<Day><Month><Year>" to 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.
example, in addition to the *develop* branch, to which all new features
should be submitted, there is also a *release* and a *stable* branch;
these have the same content as *develop*, but are only updated after a
patch release or stable release was made. Furthermore, the naming of
the patches now follow the pattern "patch_<Day><Month><Year>" to
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/master/doc/github-development-workflow.md>`_
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_

View File

@ -545,6 +545,6 @@ Feedback and Contributing
-------------------------
If you find this Python interface useful, please feel free to provide feedback
and ideas on how to improve it to Richard Berger (richard.berger@temple.edu). We also
and ideas on how to improve it to Richard Berger (richard.berger@outlook.com). We also
want to encourage people to write tutorial style IPython notebooks showcasing LAMMPS usage
and maybe their latest research results.

View File

@ -2,8 +2,8 @@ Thermostats
===========
Thermostatting means controlling the temperature of particles in an MD
simulation. :doc:`Barostatting <Howto_barostat>` means controlling the
pressure. Since the pressure includes a kinetic component due to
simulation. :doc:`Barostatting <Howto_barostat>` means controlling
the pressure. Since the pressure includes a kinetic component due to
particle velocities, both these operations require calculation of the
temperature. Typically a target temperature (T) and/or pressure (P)
is specified by the user, and the thermostat or barostat attempts to
@ -26,11 +26,13 @@ can be invoked via the *dpd/tstat* pair style:
* :doc:`pair_style dpd/tstat <pair_dpd>`
:doc:`Fix nvt <fix_nh>` only thermostats the translational velocity of
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this, except
that it subtracts out a velocity bias due to a deforming box and
integrates the SLLOD equations of motion. See the :doc:`Howto nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere <fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>` thermostat not only translation
velocities but also rotational velocities for spherical and aspherical
particles.
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this,
except that it subtracts out a velocity bias due to a deforming box
and integrates the SLLOD equations of motion. See the :doc:`Howto
nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere
<fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>`
thermostat not only translation velocities but also rotational
velocities for spherical and aspherical particles.
.. note::
@ -40,25 +42,31 @@ particles.
e.g. molecular systems. The latter can be tricky to do correctly.
DPD thermostatting alters pairwise interactions in a manner analogous
to the per-particle thermostatting of :doc:`fix langevin <fix_langevin>`.
to the per-particle thermostatting of :doc:`fix langevin
<fix_langevin>`.
Any of the thermostatting fixes can be instructed to use custom temperature
computes that remove bias which has two effects: first, the current
calculated temperature, which is compared to the requested target temperature,
is calculated with the velocity bias removed; second, the thermostat adjusts
only the thermal temperature component of the particle's velocities, which are
the velocities with the bias removed. The removed bias is then added back
to the adjusted velocities. See the doc pages for the individual
fixes and for the :doc:`fix_modify <fix_modify>` command for
instructions on how to assign a temperature compute to a
thermostatting fix. For example, you can apply a thermostat to only
the x and z components of velocity by using it in conjunction with
:doc:`compute temp/partial <compute_temp_partial>`. Of you could
thermostat only the thermal temperature of a streaming flow of
particles without affecting the streaming velocity, by using
:doc:`compute temp/profile <compute_temp_profile>`.
Any of the thermostatting fixes can be instructed to use custom
temperature computes that remove bias which has two effects: first,
the current calculated temperature, which is compared to the requested
target temperature, is calculated with the velocity bias removed;
second, the thermostat adjusts only the thermal temperature component
of the particle's velocities, which are the velocities with the bias
removed. The removed bias is then added back to the adjusted
velocities. See the doc pages for the individual fixes and for the
:doc:`fix_modify <fix_modify>` command for instructions on how to
assign a temperature compute to a thermostatting fix.
Below is a list of some custom temperature computes that can be used like that:
For example, you can apply a thermostat only to atoms in a spatial
region by using it in conjunction with :doc:`compute temp/region
<compute_temp_region>`. Or you can apply a thermostat to only the x
and z components of velocity by using it with :doc:`compute
temp/partial <compute_temp_partial>`. Of you could thermostat only
the thermal temperature of a streaming flow of particles without
affecting the streaming velocity, by using :doc:`compute temp/profile
<compute_temp_profile>`.
Below is a list of custom temperature computes that can be used like
that:
* :doc:`compute_temp_asphere`
* :doc:`compute_temp_body`
@ -72,8 +80,6 @@ Below is a list of some custom temperature computes that can be used like that:
* :doc:`compute_temp_rotate`
* :doc:`compute_temp_sphere`
.. note::
Only the nvt fixes perform time integration, meaning they update
@ -86,17 +92,17 @@ Below is a list of some custom temperature computes that can be used like that:
* :doc:`fix nve/sphere <fix_nve_sphere>`
* :doc:`fix nve/asphere <fix_nve_asphere>`
Thermodynamic output, which can be setup via the
:doc:`thermo_style <thermo_style>` command, often includes temperature
values. As explained on the page for the
:doc:`thermo_style <thermo_style>` command, the default temperature is
setup by the thermo command itself. It is NOT the temperature
associated with any thermostatting fix you have defined or with any
compute you have defined that calculates a temperature. The doc pages
for the thermostatting fixes explain the ID of the temperature compute
they create. Thus if you want to view these temperatures, you need to
specify them explicitly via the :doc:`thermo_style custom <thermo_style>` command. Or you can use the
:doc:`thermo_modify <thermo_modify>` command to re-define what
Thermodynamic output, which can be setup via the :doc:`thermo_style
<thermo_style>` command, often includes temperature values. As
explained on the page for the :doc:`thermo_style <thermo_style>`
command, the default temperature is setup by the thermo command
itself. It is NOT the temperature associated with any thermostatting
fix you have defined or with any compute you have defined that
calculates a temperature. The doc pages for the thermostatting fixes
explain the ID of the temperature compute they create. Thus if you
want to view these temperatures, you need to specify them explicitly
via the :doc:`thermo_style custom <thermo_style>` command. Or you can
use the :doc:`thermo_modify <thermo_modify>` command to re-define what
temperature compute is used for default thermodynamic output.
----------

View File

@ -9,7 +9,8 @@ has several advantages:
command.
* You can create your own development branches to add code to LAMMPS.
* You can submit your new features back to GitHub for inclusion in
LAMMPS.
LAMMPS. For that you should first create your own :doc:`fork on
GitHub <Howto_github>`.
You must have `git <git_>`_ installed on your system to use the
commands explained below to communicate with the git servers on
@ -20,35 +21,56 @@ provides `limited support for subversion clients <svn_>`_.
As of October 2016, the official home of public LAMMPS development is
on GitHub. The previously advertised LAMMPS git repositories on
git.lammps.org and bitbucket.org are now deprecated or offline.
git.lammps.org and bitbucket.org are now offline or deprecated.
.. _git: https://git-scm.com
.. _svn: https://help.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github
You can follow LAMMPS development on 3 different git branches:
You can follow the LAMMPS development on 3 different git branches:
* **stable** : this branch is updated with every stable release
* **unstable** : this branch is updated with every patch release
* **master** : this branch continuously follows ongoing development
* **stable** : this branch is updated from the *release* branch with
every stable release version and also has selected bug fixes and updates
back-ported from the *develop* branch
* **release** : this branch is updated with every patch release;
updates are always "fast forward" merges from *develop*
* **develop** : this branch follows the ongoing development and
is updated with every merge commit of a pull request
To access the git repositories on your box, use the clone command to
create a local copy of the LAMMPS repository with a command like:
.. code-block:: bash
$ git clone -b unstable 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 "unstable" is one of the 3 branches listed above.
your machine and "release" is one of the 3 branches listed above.
(Note that you actually download all 3 branches; you can switch
between them at any time using "git checkout <branch name>".)
.. admonition:: Saving time and disk space when using ``git clone``
The complete git history of the LAMMPS project is quite large because
it contains the entire commit history of the project since fall 2006,
which includes the time when LAMMPS was managed with subversion.
This includes a few commits that have added and removed some large
files (mostly by accident). If you do not need access to the entire
commit history (most people don't), you can speed up the "cloning"
process and reduce local disk space requirements by using the
*--depth* git command line flag. That will create a "shallow clone"
of the repository containing only a subset of the git history. Using
a depth of 1000 is usually sufficient to include the head commits of
the *develop* and the *release* branches. To include the head commit
of the *stable* branch you may need a depth of up to 10000. If you
later need more of the git history, you can always convert the
shallow clone into a "full clone".
Once the command completes, your directory will contain the same files
as if you unpacked a current LAMMPS tarball, with the exception, that
the HTML documentation files are not included. They can be fetched
from the LAMMPS website by typing ``make fetch`` in the doc directory.
Or they can be generated from the content provided in doc/src by
typing ``make html`` from the doc directory.
Or they can be generated from the content provided in ``doc/src`` by
typing ``make html`` from the ``doc`` directory.
After initial cloning, as bug fixes and new features are added to
LAMMPS you can stay up-to-date by typing the following git commands
@ -56,9 +78,9 @@ from within the "mylammps" directory:
.. code-block:: bash
$ git checkout unstable # not needed if you always stay in this branch
$ git checkout stable # use one of these 3 checkout commands
$ git checkout master # to choose the branch to follow
$ 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
@ -81,7 +103,7 @@ Stable versions and what tagID to use for a particular stable version
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
Note that this command will print some warnings, because in order to get
back to the latest revision and to be able to update with ``git pull``
again, you will need to do ``git checkout unstable`` (or
again, you will need to do ``git checkout release`` (or
check out any other desired branch) first.
Once you have updated your local files with a ``git pull`` (or ``git
@ -137,9 +159,9 @@ changed. How to do this depends on the build system you are using.
.. admonition:: Git protocols
:class: note
The servers at github.com support the "git://" and "https://" access
protocols for anonymous, read-only access. If you have a suitably
configured GitHub account, you may also use SSH protocol with the
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".
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer

View File

@ -8,7 +8,7 @@ University:
* Aidan Thompson, athomps at sandia.gov
* Stan Moore, stamoor at sandia.gov
* Axel Kohlmeyer, akohlmey at gmail.com
* Richard Berger, richard.berger at temple.edu
* Richard Berger, richard.berger at outlook.com
.. _sjp: http://www.cs.sandia.gov/~sjplimp
.. _lws: https://www.lammps.org

View File

@ -16,7 +16,7 @@ source code design, the program structure, the spatial decomposition
approach, the neighbor finding, basic communications algorithms, and how
users and developers have contributed to LAMMPS is:
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. (accepted 09/2021), DOI:10.1016/j.cpc.2021.108171 <https://doi.org/10.1016/j.cpc.2021.108171>`_
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. 271, 108171 (2022) <https://doi.org/10.1016/j.cpc.2021.108171>`_
So a project using LAMMPS or a derivative application that uses LAMMPS
as a simulation engine should cite this paper. The paper is expected to

View File

@ -19,7 +19,7 @@ software and open-source distribution, see `www.gnu.org <gnuorg_>`_
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
.. _gpl: https://github.com/lammps/lammps/blob/develop/LICENSE
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

View File

@ -13,6 +13,7 @@ functions. They do not directly call the LAMMPS library.
- :cpp:func:`lammps_fix_external_set_virial_peratom`
- :cpp:func:`lammps_fix_external_set_vector_length`
- :cpp:func:`lammps_fix_external_set_vector`
- :cpp:func:`lammps_flush_buffers`
- :cpp:func:`lammps_free`
- :cpp:func:`lammps_is_running`
- :cpp:func:`lammps_force_timeout`
@ -72,6 +73,11 @@ where such memory buffers were allocated that require the use of
-----------------------
.. doxygenfunction:: lammps_flush_buffers
:project: progguide
-----------------------
.. doxygenfunction:: lammps_free
:project: progguide

View File

@ -7,26 +7,34 @@ correctly and reliably at all times. You can follow its development
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
Whenever we fix a bug or update or add a feature, it will be merged into
the `master` branch of the git repository. When a sufficient number of
the *develop* branch of the git repository. When a sufficient number of
changes have accumulated *and* the software passes a set of automated
tests, we release it in the next *patch* release, which are made every
few weeks. Info on patch releases are on `this website page
few weeks. The *release* branch of the git repository is updated with
every such release. Info on patch releases are on `this website page
<https://www.lammps.org/bug.html>`_.
Once or twice a year, only bug fixes and small, non-intrusive changes are
included for a period of time, and the code is subjected to more detailed
Once or twice a year, we apply only bug fixes and small, non-intrusive
changes to the *develop* branch and the code is subjected to more detailed
and thorough testing than the default automated testing. The latest
patch release after such a period is then labeled as a *stable* version.
patch release after such a period is then also labeled as a *stable* version
and the *stable* branch is updated with it. Between stable releases
we occasionally release some updates to the stable release containing
only bug fixes and updates back-ported from *develop* but no new features
and update the *stable* branch accordingly.
Each version of LAMMPS contains all the features and bug-fixes up to
and including its version date.
Each version of LAMMPS contains all the documented features up to and
including its version date.
The version date is printed to the screen and logfile every time you
run LAMMPS. It is also in the file src/version.h and in the LAMMPS
directory name created when you unpack a tarball. And it is on the
first page of the :doc:`manual <Manual>`.
* If you browse the HTML pages on the LAMMPS WWW site, they always
describe the most current patch release of LAMMPS.
* If you browse the HTML pages on the LAMMPS WWW site, they will by
default describe the most current patch release version of LAMMPS.
In the navigation bar on the bottom left, there is the option to
view instead the documentation for the most recent *stable* version
or the latest version from the current development branch.
* If you browse the HTML pages included in your tarball, they
describe the version you have, which may be older.

View File

@ -12,24 +12,24 @@ includes some optional methods to enable its use with rRESPA.
Here is a brief description of the class methods in pair.h:
+---------------------------------+-------------------------------------------------------------------+
| compute | workhorse routine that computes pairwise interactions |
+---------------------------------+-------------------------------------------------------------------+
| settings | reads the input script line with arguments you define |
+---------------------------------+-------------------------------------------------------------------+
| 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 and energy of a single pairwise interaction between 2 atoms |
+---------------------------------+-------------------------------------------------------------------+
| compute_inner/middle/outer | versions of compute used by rRESPA |
+---------------------------------+-------------------------------------------------------------------+
+---------------------------------+---------------------------------------------------------------------+
| compute | workhorse routine that computes pairwise interactions |
+---------------------------------+---------------------------------------------------------------------+
| settings | reads the input script line with arguments you define |
+---------------------------------+---------------------------------------------------------------------+
| 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 |
+---------------------------------+---------------------------------------------------------------------+
The inner/middle/outer routines are optional.

View File

@ -305,6 +305,40 @@ you are uncertain, please ask.
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
convenience function where possible.
- Usage of C++11 `virtual`, `override`, `final` keywords: Please follow the
`C++ Core Guideline C.128 <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override>`_.
That means, you should only use `virtual` to declare a new virtual
function, `override` to indicate you are overriding an existing virtual
function, and `final` to prevent any further overriding.
- Trivial destructors: Prefer not writing destructors when they are empty and `default`.
.. code-block:: c++
// don't write destructors for A or B like this
class A : protected Pointers {
public:
A();
~A() override {}
};
class B : protected Pointers {
public:
B();
~B() override = default;
};
// instead, let the compiler create the implicit default destructor by not writing it
class A : protected Pointers {
public:
A();
};
class B : protected Pointers {
public:
B();
};
- Header files, especially those defining a "style", should only use
the absolute minimum number of include files and **must not** contain
any ``using`` statements. Typically that would be only the header for

View File

@ -1880,6 +1880,12 @@ MPIIO library. It adds :doc:`dump styles <dump>` with a "mpiio" in
their style name. Restart files with an ".mpiio" suffix are also
written and read in parallel.
.. warning::
The MPIIO package is currently unmaintained and has become
unreliable. Use with caution.
**Install:**
The MPIIO package requires that LAMMPS is build in :ref:`MPI parallel mode <serial>`.

View File

@ -106,7 +106,7 @@ individual ranks. Here is an example output for this section:
----------
The third section above lists the number of owned atoms (Nlocal),
ghost atoms (Nghost), and pair-wise neighbors stored per processor.
ghost atoms (Nghost), and pairwise neighbors stored per processor.
The max and min values give the spread of these values across
processors with a 10-bin histogram showing the distribution. The total
number of histogram counts is equal to the number of processors.
@ -114,7 +114,7 @@ number of histogram counts is equal to the number of processors.
----------
The last section gives aggregate statistics (across all processors)
for pair-wise neighbors and special neighbors that LAMMPS keeps track
for pairwise neighbors and special neighbors that LAMMPS keeps track
of (see the :doc:`special_bonds <special_bonds>` command). The number
of times neighbor lists were rebuilt is tallied, as is the number of
potentially *dangerous* rebuilds. If atom movement triggered neighbor

View File

@ -14,7 +14,7 @@ Intel Xeon Phi co-processors.
The `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS
website gives performance results for the various accelerator
packages discussed on the :doc:`Speed packages <Speed_packages>` doc
packages discussed on the :doc:`Accelerator packages <Speed_packages>`
page, for several of the standard LAMMPS benchmark problems, as a
function of problem size and number of compute nodes, on different
hardware platforms.

View File

@ -214,7 +214,7 @@ threads/task as Nt. The product of these two values should be N, i.e.
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 pair-wise potentials, it
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

View File

@ -277,17 +277,34 @@ at ens-lyon.fr, alain.dequidt at uca.fr
eam database tool
-----------------------------
The tools/eam_database directory contains a Fortran program that will
generate EAM alloy setfl potential files for any combination of 16
elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti,
Zr. The files can then be used with the :doc:`pair_style eam/alloy <pair_eam>` command.
The tools/eam_database directory contains a Fortran and a Python program
that will generate EAM alloy setfl potential files for any combination
of the 17 elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg,
Co, Ti, Zr, Cr. The files can then be used with the :doc:`pair_style
eam/alloy <pair_eam>` command.
The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov,
and is based on his paper:
The Fortran version of the tool was authored by Xiaowang Zhou (Sandia),
xzhou at sandia.gov, with updates from Lucas Hale (NIST) lucas.hale at
nist.gov and is based on his paper:
X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69,
144113 (2004).
The parameters for Cr were taken from:
Lin Z B, Johnson R A and Zhigilei L V, Phys. Rev. B 77 214108 (2008).
The Python version of the tool was authored by Germain Clavier
(TU Eindhoven) g.m.g.c.clavier at tue.nl or germain.clavier at gmail.com
.. note::
The parameters in the database are only optimized for individual
elements. The mixed parameters for interactions between different
elements generated by this tool are derived from simple mixing rules
and are thus inferior to parameterizations that are specifically
optimized for specific mixtures and combinations of elements.
----------
.. _eamgn:

View File

@ -1,7 +1,7 @@
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
hardware, as discussed on the :doc:`Accelerator packages <Speed_packages>`
page. The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.
@ -13,5 +13,5 @@ You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
:doc:`suffix <suffix>` command in your input script.
See the :doc:`Speed packages <Speed_packages>` page for more
See the :doc:`Accelerator packages <Speed_packages>` page for more
instructions on how to use the accelerated styles effectively.

View File

@ -56,23 +56,7 @@ radian\^2.
----------
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
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
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
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
:doc:`suffix <suffix>` command in your input script.
See :doc:`Speed packages <Speed_packages>` page for more
instructions on how to use the accelerated styles effectively.
.. include:: accel_styles.rst
----------

View File

@ -64,34 +64,44 @@ These are the 4 coefficients for the :math:`E_a` formula:
radians internally; hence the various :math:`K` are effectively energy
per radian\^2 or radian\^3 or radian\^4.
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
command in the input script lists 4 coefficients, the first of which
is "bb" to indicate they are BondBond coefficients. In a data file,
these coefficients should be listed under a "BondBond Coeffs" heading
and you must leave out the "bb", i.e. only list 3 coefficients after
the angle type.
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff
<angle_coeff>` command in the input script lists 4 coefficients, the
first of which is "bb" to indicate they are BondBond coefficients. In
a data file, these coefficients should be listed under a "BondBond
Coeffs" heading and you must leave out the "bb", i.e. only list 3
coefficients after the angle type.
* bb
* :math:`M` (energy/distance\^2)
* :math:`r_1` (distance)
* :math:`r_2` (distance)
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
command in the input script lists 5 coefficients, the first of which
is "ba" to indicate they are BondAngle coefficients. In a data file,
these coefficients should be listed under a "BondAngle Coeffs" heading
and you must leave out the "ba", i.e. only list 4 coefficients after
the angle type.
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff
<angle_coeff>` command in the input script lists 5 coefficients, the
first of which is "ba" to indicate they are BondAngle coefficients.
In a data file, these coefficients should be listed under a "BondAngle
Coeffs" heading and you must leave out the "ba", i.e. only list 4
coefficients after the angle type.
* ba
* :math:`N_1` (energy/distance\^2)
* :math:`N_2` (energy/distance\^2)
* :math:`N_1` (energy/distance)
* :math:`N_2` (energy/distance)
* :math:`r_1` (distance)
* :math:`r_2` (distance)
The :math:`\theta_0` value in the :math:`E_{ba}` formula is not specified,
since it is the same value from the :math:`E_a` formula.
.. note::
It is important that the order of the I,J,K atoms in each angle
listed in the Angles section of the data file read by the
:doc:`read_data <read_data>` command be consistent with the order
of the :math:`r_1` and :math:`r_2` BondBond and BondAngle
coefficients. This is because the terms in the formulas for
:math:`E_{bb}` and :math:`E_{ba}` will use the I,J atoms to compute
:math:`r_{ij}` and the J,K atoms to compute :math:`r_{jk}`.
----------
.. include:: accel_styles.rst

View File

@ -319,28 +319,9 @@ styles; see the :doc:`Modify <Modify>` doc page.
----------
Styles with a *kk* suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in on
the :doc:`Speed packages <Speed_packages>` doc page. The accelerated
styles take the same arguments and should produce the same results,
except for round-off and precision issues.
.. include:: accel_styles.rst
Note that other acceleration packages in LAMMPS, specifically the GPU,
INTEL, OPENMP, and OPT packages do not use accelerated atom
styles.
The accelerated styles are part of the KOKKOS package. 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
by including their suffix, or you can use the :doc:`-suffix command-line
switch <Run_options>` when you invoke LAMMPS, or you can use the
:doc:`suffix <suffix>` command in your input script.
See the :doc:`Speed packages <Speed_packages>` page for more
instructions on how to use the accelerated styles effectively.
----------
Restrictions
""""""""""""

View File

@ -383,7 +383,7 @@ multiple groups, its weight is the product of the weight factors.
This weight style is useful in combination with pair style
:doc:`hybrid <pair_hybrid>`, e.g. when combining a more costly many-body
potential with a fast pair-wise potential. It is also useful when
potential with a fast pairwise potential. It is also useful when
using :doc:`run_style respa <run_style>` where some portions of the
system have many bonded interactions and others none. It assumes that
the computational cost for each group remains constant over time.

View File

@ -1,4 +1,5 @@
.. index:: bond_style fene
.. index:: bond_style fene/nm
.. index:: bond_style fene/intel
.. index:: bond_style fene/kk
.. index:: bond_style fene/omp
@ -8,12 +9,16 @@ bond_style fene command
Accelerator Variants: *fene/intel*, *fene/kk*, *fene/omp*
bond_style fene/nm command
==========================
Syntax
""""""
.. code-block:: LAMMPS
bond_style fene
bond_style fene/nm
Examples
""""""""
@ -23,6 +28,9 @@ Examples
bond_style fene
bond_coeff 1 30.0 1.5 1.0 1.0
bond_style fene/nm
bond_coeff 1 2.25344 1.5 1.0 1.12246 2 6
Description
"""""""""""
@ -38,16 +46,36 @@ term is attractive, the second Lennard-Jones term is repulsive. The
first term extends to :math:`R_0`, the maximum extent of the bond. The second
term is cutoff at :math:`2^\frac{1}{6} \sigma`, the minimum of the LJ potential.
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:
The *fene/nm* bond style substitutes the standard LJ potential with the generalized LJ potential
in the same form as in pair style :doc:`nm/cut <pair_nm>`. The bond energy is then given by
.. math::
E = -0.5 K r_0^2 \ln \left[ 1 - \left(\frac{r}{R_0}\right)^2\right] + \frac{E_0}{(n-m)} \left[ m \left(\frac{r_0}{r}\right)^n - n \left(\frac{r_0}{r}\right)^m \right]
Similar to the *fene* style, the generalized Lennard-Jones is cut off at
the potential minimum, :math:`r_0`, to be repulsive only. 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:
* :math:`K` (energy/distance\^2)
* :math:`R_0` (distance)
* :math:`\epsilon` (energy)
* :math:`\sigma` (distance)
For the *fene/nm* style, the following coefficients are used. Please
note, that the standard LJ potential and thus the regular FENE potential
is recovered for (n=12 m=6) and :math:`r_0 = 2^\frac{1}{6} \sigma`.
* :math:`K` (energy/distance\^2)
* :math:`R_0` (distance)
* :math:`E_0` (energy)
* :math:`r_0` (distance)
* :math:`n` (unitless)
* :math:`m` (unitless)
----------
.. include:: accel_styles.rst
@ -57,9 +85,10 @@ or :doc:`read_restart <read_restart>` commands:
Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the MOLECULE
package. See the :doc:`Build package <Build_package>` page for more
info.
The *fene* bond style can only be used if LAMMPS was built with the MOLECULE
package; the *fene/nm* bond style can only be used if LAMMPS was built
with the EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
page for more info.
You typically should specify :doc:`special_bonds fene <special_bonds>`
or :doc:`special_bonds lj/coul 0 1 1 <special_bonds>` to use this bond
@ -68,7 +97,8 @@ style. LAMMPS will issue a warning it that's not the case.
Related commands
""""""""""""""""
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`,
:doc:`pair style lj/cut <pair_lj>`, :doc:`pair style nm/cut <pair_nm>`.
Default
"""""""

View File

@ -87,6 +87,7 @@ accelerated styles exist.
* :doc:`class2 <bond_class2>` - COMPASS (class 2) bond
* :doc:`fene <bond_fene>` - FENE (finite-extensible non-linear elastic) bond
* :doc:`fene/expand <bond_fene_expand>` - FENE bonds with variable size particles
* :doc:`fene/nm <bond_fene>` - FENE bonds with a generalized Lennard-Jones potential
* :doc:`gaussian <bond_gaussian>` - multicentered Gaussian-based bond potential
* :doc:`gromos <bond_gromos>` - GROMOS force field bond
* :doc:`harmonic <bond_harmonic>` - harmonic bond

View File

@ -174,6 +174,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`angle <compute_angle>` - energy of each angle sub-style
* :doc:`angle/local <compute_angle_local>` - theta and energy of each angle
* :doc:`angmom/chunk <compute_angmom_chunk>` - angular momentum for each chunk
* :doc:`ave/sphere/atom <compute_ave_sphere_atom>` - compute local density and temperature around each atom
* :doc:`basal/atom <compute_basal_atom>` - calculates the hexagonal close-packed "c" lattice vector of each atom
* :doc:`body/local <compute_body_local>` - attributes of body sub-particles
* :doc:`bond <compute_bond>` - energy of each bond sub-style

View File

@ -0,0 +1,101 @@
.. index:: compute ave/sphere/atom
.. index:: compute ave/sphere/atom/kk
compute ave/sphere/atom command
================================
Accelerator Variants: *ave/sphere/atom/kk*
Syntax
""""""
.. parsed-literal::
compute ID group-ID ave/sphere/atom keyword values ...
* ID, group-ID are documented in :doc:`compute <compute>` command
* ave/sphere/atom = style name of this compute command
* one or more keyword/value pairs may be appended
.. parsed-literal::
keyword = *cutoff*
*cutoff* value = distance cutoff
Examples
""""""""
.. code-block:: LAMMPS
compute 1 all ave/sphere/atom
compute 1 all ave/sphere/atom cutoff 5.0
comm_modify cutoff 5.0
Description
"""""""""""
Define a computation that calculates the local density and temperature
for each atom and neighbors inside a spherical cutoff.
The optional keyword *cutoff* defines the distance cutoff
used when searching for neighbors. The default value is the cutoff
specified by the pair style. If no pair style is defined, then a cutoff
must be defined using this keyword. If the specified cutoff is larger than
that of the pair_style plus neighbor skin (or no pair style is defined),
the *comm_modify cutoff* option must also be set to match that of the
*cutoff* keyword.
The neighbor list needed to compute this quantity is constructed each
time the calculation is performed (i.e. each time a snapshot of atoms
is dumped). Thus it can be inefficient to compute/dump this quantity
too frequently.
.. note::
If you have a bonded system, then the settings of
:doc:`special_bonds <special_bonds>` command can remove pairwise
interactions between atoms in the same bond, angle, or dihedral. This
is the default setting for the :doc:`special_bonds <special_bonds>`
command, and means those pairwise interactions do not appear in the
neighbor list. Because this fix uses the neighbor list, it also means
those pairs will not be included in the order parameter. This
difficulty can be circumvented by writing a dump file, and using the
:doc:`rerun <rerun>` command to compute the order parameter for
snapshots in the dump file. The rerun script can use a
:doc:`special_bonds <special_bonds>` command that includes all pairs in
the neighbor list.
----------
.. include:: accel_styles.rst
----------
Output info
"""""""""""
This compute calculates a per-atom array with two columns: density and temperature.
These values can be accessed by any command that uses per-atom values
from a compute as input. See the :doc:`Howto output <Howto_output>` doc
page for an overview of LAMMPS output options.
Restrictions
""""""""""""
This compute is part of the EXTRA-COMPUTE 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
""""""""""""""""
:doc:`comm_modify <comm_modify>`
Default
"""""""
The option defaults are *cutoff* = pair style cutoff

View File

@ -13,7 +13,7 @@ Syntax
* ID, group-ID are documented in :doc:`compute <compute>` command
* bond/local = style name of this compute command
* one or more values may be appended
* value = *dist* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
* value = *dist* or *dx* or *dy* or *dz* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
.. parsed-literal::
@ -21,6 +21,7 @@ Syntax
*engpot* = bond potential energy
*force* = bond force
*dx*,\ *dy*,\ *dz* = components of pairwise distance
*fx*,\ *fy*,\ *fz* = components of bond force
*engvib* = bond kinetic energy of vibration
*engrot* = bond kinetic energy of rotation
@ -63,6 +64,9 @@ whether the 2 atoms represent a simple diatomic molecule, or are part
of some larger molecule.
The value *dist* is the current length of the bond.
The values *dx*, *dy*, and *dz* are the xyz components of the
*distance* between the pair of atoms. This value is always the
distance from the atom of lower to the one with the higher id.
The value *engpot* is the potential energy for the bond,
based on the current separation of the pair of atoms in the bond.

View File

@ -89,13 +89,20 @@ included in the calculation.
.. warning::
The compute *heat/flux* has been reported to produce unphysical
values for angle, dihedral and improper contributions
values for angle, dihedral, improper and constraint force contributions
when used with :doc:`compute stress/atom <compute_stress_atom>`,
as discussed in :ref:`(Surblys) <Surblys2>` and :ref:`(Boone) <Boone>`.
You are strongly advised to
as discussed in :ref:`(Surblys2019) <Surblys3>`, :ref:`(Boone) <Boone>`
and :ref:`(Surblys2021) <Surblys4>`. You are strongly advised to
use :doc:`compute centroid/stress/atom <compute_stress_atom>`,
which has been implemented specifically for such cases.
.. warning::
Due to an implementation detail, the :math:`y` and :math:`z`
components of heat flux from :doc:`fix rigid <fix_rigid>`
contribution when computed via :doc:`compute stress/atom <compute_stress_atom>`
are highly unphysical and should not be used.
The Green-Kubo formulas relate the ensemble average of the
auto-correlation of the heat flux :math:`\mathbf{J}`
to the thermal conductivity :math:`\kappa`:
@ -232,10 +239,14 @@ none
----------
.. _Surblys2:
.. _Surblys3:
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
.. _Boone:
**(Boone)** Boone, Babaei, Wilmer, J Chem Theory Comput, 15, 5579--5587 (2019).
.. _Surblys4:
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).

View File

@ -13,11 +13,12 @@ Syntax
* ID, group-ID are documented in :doc:`compute <compute>` command
* pair/local = style name of this compute command
* one or more values may be appended
* value = *dist* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
* value = *dist* or *dx* or *dy* or *dz* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
.. parsed-literal::
*dist* = pairwise distance
*dx*,\ *dy*,\ *dz* = components of pairwise distance
*eng* = pairwise energy
*force* = pairwise force
*fx*,\ *fy*,\ *fz* = components of pairwise force
@ -56,6 +57,9 @@ force cutoff distance for that interaction, as defined by the
commands.
The value *dist* is the distance between the pair of atoms.
The values *dx*, *dy*, and *dz* are the xyz components of the
*distance* between the pair of atoms. This value is always the
distance from the atom of lower to the one with the higher id.
The value *eng* is the interaction energy for the pair of atoms.
@ -89,10 +93,10 @@ from the second of the two sub-styles. If the referenced *pN*
is not computed for the specific pairwise interaction (based on
atom types), then the output will be 0.0.
The value *dist* will be in distance :doc:`units <units>`. The value
*eng* will be in energy :doc:`units <units>`. The values *force*, *fx*,
*fy*, and *fz* will be in force :doc:`units <units>`. The values *pN*
will be in whatever units the pair style defines.
The value *dist*, *dx*, *dy* and *dz* will be in distance :doc:`units <units>`.
The value *eng* will be in energy :doc:`units <units>`.
The values *force*, *fx*, *fy*, and *fz* will be in force :doc:`units <units>`.
The values *pN* will be in whatever units the pair style defines.
The optional *cutoff* keyword determines how the force cutoff distance
for an interaction is determined. For the default setting of *type*,

View File

@ -141,7 +141,7 @@ Related commands
""""""""""""""""
:doc:`compute temp <compute_temp>`, :doc:`compute stress/atom <compute_stress_atom>`,
:doc:`thermo_style <thermo_style>`,
:doc:`thermo_style <thermo_style>`, :doc:`fix numdiff/virial <fix_numdiff_virial>`,
Default
"""""""

View File

@ -61,7 +61,7 @@ Restrictions
This compute currently calculates the pressure tensor contributions
for pair styles only (i.e. no bond, angle, dihedral, etc. contributions
and in the presence of bonded interactions, the result will be incorrect
due to exclusions for special bonds) and requires pair-wise force
due to exclusions for special bonds) and requires pairwise force
calculations not available for most many-body pair styles. K-space
calculations are also excluded. Note that this pressure compute outputs
the configurational terms only; the kinetic contribution is not included

View File

@ -87,6 +87,10 @@ Tersoff 3-body interaction) is assigned in equal portions to each atom
in the set. E.g. 1/4 of the dihedral virial to each of the 4 atoms,
or 1/3 of the fix virial due to SHAKE constraints applied to atoms in
a water molecule via the :doc:`fix shake <fix_shake>` command.
As an exception, the virial contribution from
constraint forces in :doc:`fix rigid <fix_rigid>` on each atom
is computed from the constraint force acting on the corresponding atom
and its position, i.e. the total virial is not equally distributed.
In case of compute *centroid/stress/atom*, the virial contribution is:
@ -103,13 +107,25 @@ atom :math:`I` due to the interaction and the relative position
:math:`\mathbf{r}_{I0}` of the atom :math:`I` to the geometric center
of the interacting atoms, i.e. centroid, is used. As the geometric
center is different for each interaction, the :math:`\mathbf{r}_{I0}`
also differs. The sixth and seventh terms, Kspace and :doc:`fix
<fix>` contribution respectively, are computed identical to compute
*stress/atom*. Although the total system virial is the same as
also differs. The sixth term, Kspace contribution,
is computed identically to compute *stress/atom*.
The seventh term is handed differently depending on
if the constraint forces are due to :doc:`fix shake <fix_shake>`
or :doc:`fix rigid <fix_rigid>`.
In case of SHAKE constraints, each distance constraint is
handed as a pairwise interaction.
E.g. in case of a water molecule, two OH and one HH distance
constraints are treated as three pairwise interactions.
In case of :doc:`fix rigid <fix_rigid>`,
all constraint forces in the molecule are treated
as a single many-body interaction with a single centroid position.
In case of water molecule, the formula expression would become
identical to that of the three-body angle interaction.
Although the total system virial is the same as
compute *stress/atom*, compute *centroid/stress/atom* is know to
result in more consistent heat flux values for angle, dihedrals and
improper contributions when computed via :doc:`compute heat/flux
<compute_heat_flux>`.
result in more consistent heat flux values for angle, dihedrals,
improper and constraint force contributions
when computed via :doc:`compute heat/flux <compute_heat_flux>`.
If no extra keywords are listed, the kinetic contribution all of the
virial contribution terms are included in the per-atom stress tensor.
@ -134,7 +150,8 @@ contribution for the cluster interaction is divided evenly among those
atoms.
Details of how compute *centroid/stress/atom* obtains the virial for
individual atoms is given in :ref:`(Surblys) <Surblys1>`, where the
individual atoms are given in :ref:`(Surblys2019) <Surblys1>` and
:ref:`(Surblys2021) <Surblys2>`, where the
idea is that the virial of the atom :math:`I` is the result of only
the force :math:`\mathbf{F}_I` on the atom due to the interaction and
its positional vector :math:`\mathbf{r}_{I0}`, relative to the
@ -235,10 +252,10 @@ between the pair of particles. All bond styles are supported. All
angle, dihedral, improper styles are supported with the exception of
INTEL and KOKKOS variants of specific styles. It also does not
support models with long-range Coulombic or dispersion forces,
i.e. the kspace_style command in LAMMPS. It also does not support the
following fixes which add rigid-body constraints: :doc:`fix shake
<fix_shake>`, :doc:`fix rattle <fix_shake>`, :doc:`fix rigid
<fix_rigid>`, :doc:`fix rigid/small <fix_rigid>`.
i.e. the kspace_style command in LAMMPS. It also does not implement the
following fixes which add rigid-body constraints:
:doc:`fix rigid/* <fix_rigid>` and the OpenMP accelerated version of :doc:`fix rigid/small <fix_rigid>`,
while all other :doc:`fix rigid/*/small <fix_rigid>` are implemented.
LAMMPS will generate an error if one of these options is included in
your model. Extension of centroid stress calculations to these force
@ -270,4 +287,8 @@ none
.. _Surblys1:
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
.. _Surblys2:
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).

View File

@ -20,8 +20,10 @@ Syntax
cutoff = delete one atom from pairs of atoms within the cutoff (distance units)
group1-ID = one atom in pair must be in this group
group2-ID = other atom in pair must be in this group
*porosity* args = region-ID fraction seed
*porosity* args = group-ID region-ID fraction seed
group-ID = group within which to perform deletions
region-ID = region within which to perform deletions
or NULL to only impose the group criterion
fraction = delete this fraction of atoms
seed = random number seed (positive integer)
@ -43,7 +45,8 @@ Examples
delete_atoms region sphere compress no
delete_atoms overlap 0.3 all all
delete_atoms overlap 0.5 solvent colloid
delete_atoms porosity cube 0.1 482793 bond yes
delete_atoms porosity all cube 0.1 482793 bond yes
delete_atoms porosity polymer cube 0.1 482793 bond yes
Description
"""""""""""
@ -76,12 +79,17 @@ have occurred that no atom pairs within the cutoff will remain
minimum number of atoms will be deleted, or that the same atoms will
be deleted when running on different numbers of processors.
For style *porosity* a specified *fraction* of atoms are deleted
within the specified region. For example, if fraction is 0.1, then
10% of the atoms will be deleted. The atoms to delete are chosen
randomly. There is no guarantee that the exact fraction of atoms will
be deleted, or that the same atoms will be deleted when running on
different numbers of processors.
For style *porosity* a specified *fraction* of atoms are deleted which
are both in the specified group and within the specified region. The
region-ID can be specified as NULL to only impose the group criterion.
Likewise, specifying the group-ID as *all* will only impose the region
criterion.
For example, if fraction is 0.1, then 10% of the eligible atoms will
be deleted. The atoms to delete are chosen randomly. There is no
guarantee that the exact fraction of atoms will be deleted, or that
the same atoms will be deleted when running on different numbers of
processors.
If the *compress* keyword is set to *yes*, then after atoms are
deleted, then atom IDs are re-assigned so that they run from 1 to the
@ -89,8 +97,8 @@ number of atoms in the system. Note that this is not done for
molecular systems (see the :doc:`atom_style <atom_style>` command),
regardless of the *compress* setting, since it would foul up the bond
connectivity that has already been assigned. However, the
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this command to
accomplish the same thing.
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this
command to accomplish the same thing.
Note that the re-assignment of IDs is not really a compression, where
gaps in atom IDs are removed by decrementing atom IDs that are larger.
@ -100,15 +108,15 @@ the :doc:`create_atoms <create_atoms>` command explains.
A molecular system with fixed bonds, angles, dihedrals, or improper
interactions, is one where the topology of the interactions is
typically defined in the data file read by the
:doc:`read_data <read_data>` command, and where the interactions
themselves are defined with the :doc:`bond_style <bond_style>`,
:doc:`angle_style <angle_style>`, etc commands. If you delete atoms
from such a system, you must be careful not to end up with bonded
interactions that are stored by remaining atoms but which include
deleted atoms. This will cause LAMMPS to generate a "missing atoms"
error when the bonded interaction is computed. The *bond* and *mol*
keywords offer two ways to do that.
typically defined in the data file read by the :doc:`read_data
<read_data>` command, and where the interactions themselves are
defined with the :doc:`bond_style <bond_style>`, :doc:`angle_style
<angle_style>`, etc commands. If you delete atoms from such a system,
you must be careful not to end up with bonded interactions that are
stored by remaining atoms but which include deleted atoms. This will
cause LAMMPS to generate a "missing atoms" error when the bonded
interaction is computed. The *bond* and *mol* keywords offer two ways
to do that.
It the *bond* keyword is set to *yes* then any bond or angle or
dihedral or improper interaction that includes a deleted atom is also

View File

@ -137,7 +137,7 @@ Examples
dump myDump all atom/gz 100 dump.atom.gz
dump myDump all atom/zstd 100 dump.atom.zst
dump 2 subgroup atom 50 dump.run.bin
dump 2 subgroup atom 50 dump.run.mpiio.bin
dump 2 subgroup atom/mpiio 50 dump.run.mpiio.bin
dump 4a all custom 100 dump.myforce.* id type x y vx fx
dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke
@ -169,11 +169,12 @@ or multiple smaller files).
.. note::
Because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
written to a dump file may be slightly outside the simulation box.
Re-neighbor timesteps will not typically coincide with the timesteps
dump snapshots are written. See the :doc:`dump_modify pbc <dump_modify>` command if you with to force coordinates to be
Because periodic boundary conditions are enforced only on timesteps
when neighbor lists are rebuilt, the coordinates of an atom written
to a dump file may be slightly outside the simulation box.
Re-neighbor timesteps will not typically coincide with the
timesteps dump snapshots are written. See the :doc:`dump_modify
pbc <dump_modify>` command if you with to force coordinates to be
strictly inside the simulation box.
.. note::
@ -189,20 +190,21 @@ or multiple smaller files).
multiple processors, each of which owns a subset of the atoms.
For the *atom*, *custom*, *cfg*, and *local* styles, sorting is off by
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting by
atom ID is on by default. See the :doc:`dump_modify <dump_modify>` doc
page for details.
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting
by atom ID is on by default. See the :doc:`dump_modify <dump_modify>`
doc page for details.
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles are identical
in command syntax to the corresponding styles without "gz", however,
they generate compressed files using the zlib library. Thus the filename
suffix ".gz" is mandatory. This is an alternative approach to writing
compressed files via a pipe, as done by the regular dump styles, which
may be required on clusters where the interface to the high-speed network
disallows using the fork() library call (which is needed for a pipe).
For the remainder of this doc page, you should thus consider the *atom*
and *atom/gz* styles (etc) to be inter-changeable, with the exception
of the required filename suffix.
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles
are identical in command syntax to the corresponding styles without
"gz", however, they generate compressed files using the zlib
library. Thus the filename suffix ".gz" is mandatory. This is an
alternative approach to writing compressed files via a pipe, as done
by the regular dump styles, which may be required on clusters where
the interface to the high-speed network disallows using the fork()
library call (which is needed for a pipe). For the remainder of this
doc page, you should thus consider the *atom* and *atom/gz* styles
(etc) to be inter-changeable, with the exception of the required
filename suffix.
Similarly, the *atom/zstd*, *cfg/zstd*, *custom/zstd*, *local/zstd*,
and *xyz/zstd* styles are identical to the gz styles, but use the Zstd
@ -219,6 +221,11 @@ you should thus consider the *atom* and *atom/mpiio* styles (etc) to
be inter-changeable. The one exception is how the filename is
specified for the MPI-IO styles, as explained below.
.. warning::
The MPIIO package is currently unmaintained and has become
unreliable. Use with caution.
The precision of values output to text-based dump files can be
controlled by the :doc:`dump_modify format <dump_modify>` command and
its options.
@ -275,10 +282,11 @@ This bounding box is convenient for many visualization programs. The
meaning of the 6 character flags for "xx yy zz" is the same as above.
Note that the first two numbers on each line are now xlo_bound instead
of xlo, etc, since they represent a bounding box. See the :doc:`Howto triclinic <Howto_triclinic>` page for a geometric description
of triclinic boxes, as defined by LAMMPS, simple formulas for how the
6 bounding box extents (xlo_bound,xhi_bound,etc) are calculated from
the triclinic parameters, and how to transform those parameters to and
of xlo, etc, since they represent a bounding box. See the :doc:`Howto
triclinic <Howto_triclinic>` page for a geometric description of
triclinic boxes, as defined by LAMMPS, simple formulas for how the 6
bounding box extents (xlo_bound,xhi_bound,etc) are calculated from the
triclinic parameters, and how to transform those parameters to and
from other commonly used triclinic representations.
The "ITEM: ATOMS" line in each snapshot lists column descriptors for
@ -310,23 +318,24 @@ written to the dump file. This local data is typically calculated by
each processor based on the atoms it owns, but there may be zero or
more entities per atom, e.g. a list of bond distances. An explanation
of the possible dump local attributes is given below. Note that by
using input from the :doc:`compute property/local <compute_property_local>` command with dump local,
it is possible to generate information on bonds, angles, etc that can
be cut and pasted directly into a data file read by the
:doc:`read_data <read_data>` command.
using input from the :doc:`compute property/local
<compute_property_local>` command with dump local, it is possible to
generate information on bonds, angles, etc that can be cut and pasted
directly into a data file read by the :doc:`read_data <read_data>`
command.
Style *cfg* has the same command syntax as style *custom* and writes
extended CFG format files, as used by the
`AtomEye <http://li.mit.edu/Archive/Graphics/A/>`_ visualization
package. Since the extended CFG format uses a single snapshot of the
system per file, a wildcard "\*" must be included in the filename, as
discussed below. The list of atom attributes for style *cfg* must
begin with either "mass type xs ys zs" or "mass type xsu ysu zsu"
since these quantities are needed to write the CFG files in the
appropriate format (though the "mass" and "type" fields do not appear
explicitly in the file). Any remaining attributes will be stored as
"auxiliary properties" in the CFG files. Note that you will typically
want to use the :doc:`dump_modify element <dump_modify>` command with
extended CFG format files, as used by the `AtomEye
<http://li.mit.edu/Archive/Graphics/A/>`_ visualization package.
Since the extended CFG format uses a single snapshot of the system per
file, a wildcard "\*" must be included in the filename, as discussed
below. The list of atom attributes for style *cfg* must begin with
either "mass type xs ys zs" or "mass type xsu ysu zsu" since these
quantities are needed to write the CFG files in the appropriate format
(though the "mass" and "type" fields do not appear explicitly in the
file). Any remaining attributes will be stored as "auxiliary
properties" in the CFG files. Note that you will typically want to
use the :doc:`dump_modify element <dump_modify>` command with
CFG-formatted files, to associate element names with atom types, so
that AtomEye can render atoms appropriately. When unwrapped
coordinates *xsu*, *ysu*, and *zsu* are requested, the nominal AtomEye
@ -452,6 +461,11 @@ use the :doc:`read_dump <read_dump>` command or perform other
post-processing, just as if the dump file was not written using
MPI-IO.
.. warning::
The MPIIO package is currently unmaintained and has become
unreliable. Use with caution.
Note that MPI-IO dump files are one large file which all processors
write to. You thus cannot use the "%" wildcard character described
above in the filename since that specifies generation of multiple
@ -708,8 +722,9 @@ are part of the MPIIO package. They are only enabled if LAMMPS was
built with that package. See the :doc:`Build package <Build_package>`
doc page for more info.
The *xtc* style is part of the MISC package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
The *xtc* and *dcd* styles are part of the EXTRA-DUMP package. They
are only enabled if LAMMPS was built with that package. See the
:doc:`Build package <Build_package>` page for more info.
Related commands
""""""""""""""""

View File

@ -6,6 +6,8 @@ dump image command
dump movie command
==================
(see below for :ref:`dump_modify options <dump_modify_image>` specific to dump image/movie)
Syntax
""""""
@ -15,7 +17,7 @@ Syntax
* ID = user-assigned name for the dump
* group-ID = ID of the group of atoms to be imaged
* style = *image* or *movie* = style of dump command (other styles *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
* style = *image* or *movie* = style of dump command (other styles such as *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
* N = dump every this many timesteps
* file = name of file to write image to
* color = atom attribute that determines color of each atom
@ -79,6 +81,69 @@ Syntax
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0
.. _dump_modify_image:
dump_modify options for dump image/movie
========================================
Syntax
""""""
.. parsed-literal::
dump_modify dump-ID keyword values ...
* these keywords apply only to the *image* and *movie* styles and are documented on this page
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
* see the :doc:`dump modify <dump_modify>` doc page for more general keywords
.. parsed-literal::
*acolor* args = type color
type = atom type or range of types (see below)
color = name of color or color1/color2/...
*adiam* args = type diam
type = atom type or range of types (see below)
diam = diameter of atoms of that type (distance units)
*amap* args = lo hi style delta N entry1 entry2 ... entryN
lo = number or *min* = lower bound of range of color map
hi = number or *max* = upper bound of range of color map
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
"c" for continuous
"d" for discrete
"s" for sequential
"a" for absolute
"f" for fractional
delta = binsize (only used for style "s", otherwise ignored)
binsize = range is divided into bins of this width
N = # of subsequent entries
entry = value color (for continuous style)
value = number or *min* or *max* = single value within range
color = name of color used for that value
entry = lo hi color (for discrete style)
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
color = name of color used for that subset of values
entry = color (for sequential style)
color = name of color used for a bin of values
*backcolor* arg = color
color = name of color for background
*bcolor* args = type color
type = bond type or range of types (see below)
color = name of color or color1/color2/...
*bdiam* args = type diam
type = bond type or range of types (see below)
diam = diameter of bonds of that type (distance units)
*boxcolor* arg = color
color = name of color for simulation box lines and processor sub-domain lines
*color* args = name R G B
name = name of color
R,G,B = red/green/blue numeric values from 0.0 to 1.0
*bitrate* arg = rate
rate = target bitrate for movie in kbps
*framerate* arg = fps
fps = frames per second for movie
Examples
""""""""
@ -91,6 +156,8 @@ Examples
dump m1 all movie 1000 movie.avi type type size 640 480
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
Description
"""""""""""
@ -145,10 +212,10 @@ is used.
Similarly, the format of the resulting movie is chosen with the
*movie* dump style. This is handled by the underlying FFmpeg converter
and thus details have to be looked up in the `FFmpeg documentation
<http://ffmpeg.org/ffmpeg.html>`_.
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
Additional settings of the movie compression like bitrate and
framerate can be set using the :doc:`dump_modify <dump_modify>` command.
<http://ffmpeg.org/ffmpeg.html>`_. Typical examples are: .avi, .mpg,
.m4v, .mp4, .mkv, .flv, .mov, .gif Additional settings of the movie
compression like bitrate and framerate can be set using the
dump_modify command as described below.
To write out JPEG and PNG format files, you must build LAMMPS with
support for the corresponding JPEG or PNG library. To convert images
@ -210,19 +277,20 @@ to colors is as follows:
* type 6 = cyan
and repeats itself for types > 6. This mapping can be changed by the
:doc:`dump_modify acolor <dump_modify>` command.
"dump_modify acolor" command, as described below.
If *type* is specified for the *diameter* setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the :doc:`dump_modify adiam <dump_modify>` command.
diameter 1.0. This mapping can be changed by the "dump_modify adiam"
command, as described below.
If *element* is specified for the *color* and/or *diameter* setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the "dump_modify element" command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the `AtomEye <atomeye_>`_ visualization package.
mapping specified by the "dump_modify element" command, as described
below. By default every atom type is C (carbon). Every element has a
color and diameter associated with it, which is the same as the colors
and sizes used by the `AtomEye <atomeye_>`_ visualization package.
.. _atomeye: http://li.mit.edu/Archive/Graphics/A/
@ -232,13 +300,13 @@ settings, they are interpreted in the following way.
If "vx", for example, is used as the *color* setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a "color map", which can be specified via the
:doc:`dump_modify <dump_modify>` command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between "red" and "blue", or
discretely so that the value of -3.2 is "orange".
a "color map", which can be specified via the dump_modify command, as
described below. The basic idea is that the atom-attribute will be
within a range of values, and every value within the range is mapped
to a specific color. Depending on how the color map is defined, that
mapping can take place via interpolation so that a value of -3.2 is
halfway between "red" and "blue", or discretely so that the value of
-3.2 is "orange".
If "vx", for example, is used as the *diameter* setting, then the atom
will be rendered using the x-component of its velocity as the
@ -251,9 +319,10 @@ diameter, which can be used as the *diameter* setting.
The various keywords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The :doc:`dump modify <dump_modify>`
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.
will likely not need to change. As described below, the dump modify
command also has options specific to the dump image style,
particularly for assigning colors to atoms, bonds, and other image
features.
----------
@ -295,7 +364,7 @@ types to colors is as follows:
* type 6 = cyan
and repeats itself for bond types > 6. This mapping can be changed by
the :doc:`dump_modify bcolor <dump_modify>` command.
the "dump_modify bcolor" command, as described below.
The bond *width* value can be a numeric value or *atom* or *type* (or
*none* as indicated above).
@ -310,7 +379,8 @@ of the 2 atoms in the bond.
If *type* is specified for the *width* value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the :doc:`dump_modify bdiam <dump_modify>` command.
diameter 0.5. This mapping can be changed by the "dump_modify bdiam" command,
as described below.
----------
@ -330,7 +400,7 @@ mapping of types to colors is as follows:
* type 6 = cyan
and repeats itself for types > 6. There is not yet an option to
change this via the :doc:`dump_modify <dump_modify>` command.
change this via the dump_modify command.
The line *width* can only be a numeric value, which specifies that all
lines will be drawn as cylinders with that diameter, e.g. 1.0, which
@ -357,7 +427,7 @@ default the mapping of types to colors is as follows:
* type 6 = cyan
and repeats itself for types > 6. There is not yet an option to
change this via the :doc:`dump_modify <dump_modify>` command.
change this via the dump_modify command.
----------
@ -390,7 +460,7 @@ particle. By default the mapping of types to colors is as follows:
* type 6 = cyan
and repeats itself for types > 6. There is not yet an option to
change this via the :doc:`dump_modify <dump_modify>` command.
change this via the dump_modify command.
----------
@ -414,7 +484,7 @@ the mapping of types to colors is as follows:
* type 6 = cyan
and repeats itself for types > 6. There is not yet an option to
change this via the :doc:`dump_modify <dump_modify>` command.
change this via the dump_modify command.
----------
@ -488,7 +558,8 @@ are rendered as thin cylinders in the image. If *no* is set, then the
box boundaries are not drawn and the *diam* setting is ignored. If
*yes* is set, the 12 edges of the box are drawn, with a diameter that
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d). The color of the box boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
2d). The color of the box boundaries can be set with the "dump_modify
boxcolor" command.
The *axes* keyword determines if and how the coordinate axes are
rendered as thin cylinders in the image. If *no* is set, then the
@ -507,7 +578,8 @@ set (default), then the sub-domain boundaries are not drawn and the
*diam* setting is ignored. If *yes* is set, the 12 edges of each
processor sub-domain are drawn, with a diameter that is a fraction of
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
of the sub-domain boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
of the sub-domain boundaries can be set with the "dump_modify
boxcolor" command.
----------
@ -607,9 +679,272 @@ Play the movie:
----------
See the :doc:`Modify <Modify>` page for information on how to add
new compute and fix styles to LAMMPS to calculate per-atom quantities
which could then be output into dump files.
Dump_modify keywords for dump image and dump movie
""""""""""""""""""""""""""""""""""""""""""""""""""
The following dump_modify keywords apply only to the dump image and
dump movie styles. Any keyword that works with dump image also works
with dump movie, since the movie is simply a collection of images.
Some of the keywords only affect the dump movie style. The
descriptions give details.
----------
The *acolor* keyword can be used with the dump image command, when its
atom color setting is *type*, to set the color that atoms of each type
will be drawn in the image.
The specified *type* should be an integer from 1 to Ntypes = the
number of atom types. A wildcard asterisk can be used in place of or
in conjunction with the *type* argument to specify a range of atom
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
the number of atom types, then an asterisk with no numeric values
means all types from 1 to N. A leading asterisk means all types from
1 to n (inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
The specified *color* can be a single color which is any of the 140
pre-defined colors (see below) or a color name defined by the
"dump_modify color" command, as described below. Or it can be two or
more colors separated by a "/" character, e.g. red/green/blue. In the
former case, that color is assigned to all the specified atom types.
In the latter case, the list of colors are assigned in a round-robin
fashion to each of the specified atom types.
----------
The *adiam* keyword can be used with the dump image command, when its
atom diameter setting is *type*, to set the size that atoms of each
type will be drawn in the image. The specified *type* should be an
integer from 1 to Ntypes. As with the *acolor* keyword, a wildcard
asterisk can be used as part of the *type* argument to specify a range
of atom types. The specified *diam* is the size in whatever distance
:doc:`units <units>` the input script is using, e.g. Angstroms.
----------
The *amap* keyword can be used with the dump image command, with its
*atom* keyword, when its atom setting is an atom-attribute, to setup a
color map. The color map is used to assign a specific RGB
(red/green/blue) color value to an individual atom when it is drawn,
based on the atom's attribute, which is a numeric value, e.g. its
x-component of velocity if the atom-attribute "vx" was specified.
The basic idea of a color map is that the atom-attribute will be
within a range of values, and that range is associated with a series
of colors (e.g. red, blue, green). An atom's specific value (vx =
-3.2) can then mapped to the series of colors (e.g. halfway between
red and blue), and a specific color is determined via an interpolation
procedure.
There are many possible options for the color map, enabled by the
*amap* keyword. Here are the details.
The *lo* and *hi* settings determine the range of values allowed for
the atom attribute. If numeric values are used for *lo* and/or *hi*,
then values that are lower/higher than that value are set to the
value. I.e. the range is static. If *lo* is specified as *min* or
*hi* as *max* then the range is dynamic, and the lower and/or
upper bound will be calculated each time an image is drawn, based
on the set of atoms being visualized.
The *style* setting is two letters, such as "ca". The first letter is
either "c" for continuous, "d" for discrete, or "s" for sequential.
The second letter is either "a" for absolute, or "f" for fractional.
A continuous color map is one in which the color changes continuously
from value to value within the range. A discrete color map is one in
which discrete colors are assigned to sub-ranges of values within the
range. A sequential color map is one in which discrete colors are
assigned to a sequence of sub-ranges of values covering the entire
range.
An absolute color map is one in which the values to which colors are
assigned are specified explicitly as values within the range. A
fractional color map is one in which the values to which colors are
assigned are specified as a fractional portion of the range. For
example if the range is from -10.0 to 10.0, and the color red is to be
assigned to atoms with a value of 5.0, then for an absolute color map
the number 5.0 would be used. But for a fractional map, the number
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
The *delta* setting must be specified for all styles, but is only used
for the sequential style; otherwise the value is ignored. It
specifies the bin size to use within the range for assigning
consecutive colors to. For example, if the range is from -10.0 to
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
the range. The first will be from -10.0 <= color1 < -9.0, then second
from -9.0 <= color2 < -8.0, etc.
The *N* setting is how many entries follow. The format of the entries
depends on whether the color map style is continuous, discrete or
sequential. In all cases the *color* setting can be any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option.
For continuous color maps, each entry has a *value* and a *color*\ .
The *value* is either a number within the range of values or *min* or
*max*\ . The *value* of the first entry must be *min* and the *value*
of the last entry must be *max*\ . Any entries in between must have
increasing values. Note that numeric values can be specified either
as absolute numbers or as fractions (0.0 to 1.0) of the range,
depending on the "a" or "f" in the style setting for the color map.
Here is how the entries are used to determine the color of an
individual atom, given the value X of its atom attribute. X will fall
between 2 of the entry values. The color of the atom is linearly
interpolated (in each of the RGB values) between the 2 colors
associated with those entries. For example, if X = -5.0 and the 2
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
atom's color will be halfway between "red" and "blue", which happens
to be "purple".
For discrete color maps, each entry has a *lo* and *hi* value and a
*color*\ . The *lo* and *hi* settings are either numbers within the
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
and *hi* settings of the last entry must be *min* and *max*\ . Other
entries can have any *lo* and *hi* values and the sub-ranges of
different values can overlap. Note that numeric *lo* and *hi* values
can be specified either as absolute numbers or as fractions (0.0 to
1.0) of the range, depending on the "a" or "f" in the style setting
for the color map.
Here is how the entries are used to determine the color of an
individual atom, given the value X of its atom attribute. The entries
are scanned from first to last. The first time that *lo* <= X <=
*hi*, X is assigned the color associated with that entry. You can
think of the last entry as assigning a default color (since it will
always be matched by X), and the earlier entries as colors that
override the default. Also note that no interpolation of a color RGB
is done. All atoms will be drawn with one of the colors in the list
of entries.
For sequential color maps, each entry has only a *color*\ . Here is how
the entries are used to determine the color of an individual atom,
given the value X of its atom attribute. The range is partitioned
into N bins of width *binsize*\ . Thus X will fall in a specific bin
from 1 to N, say the Mth bin. If it falls on a boundary between 2
bins, it is considered to be in the higher of the 2 bins. Each bin is
assigned a color from the E entries. If E < N, then the colors are
repeated. For example if 2 entries with colors red and green are
specified, then the odd numbered bins will be red and the even bins
green. The color of the atom is the color of its bin. Note that the
sequential color map is really a shorthand way of defining a discrete
color map without having to specify where all the bin boundaries are.
Here is an example of using a sequential color map to color all the
atoms in individual molecules with a different color. See the
examples/pour/in.pour.2d.molecule input script for an example of how
this is used.
.. code-block:: LAMMPS
variable colors string &
"red green blue yellow white &
purple pink orange lime gray"
variable mol atom mol%10
dump 1 all image 250 image.*.jpg v_mol type &
zoom 1.6 adiam 1.5
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
In this case, 10 colors are defined, and molecule IDs are
mapped to one of the colors, even if there are 1000s of molecules.
----------
The *backcolor* sets the background color of the images. The color
name can be any of the 140 pre-defined colors (see below) or a color
name defined by the dump_modify color option.
----------
The *bcolor* keyword can be used with the dump image command, with its
*bond* keyword, when its color setting is *type*, to set the color
that bonds of each type will be drawn in the image.
The specified *type* should be an integer from 1 to Nbondtypes = the
number of bond types. A wildcard asterisk can be used in place of or
in conjunction with the *type* argument to specify a range of bond
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
the number of bond types, then an asterisk with no numeric values
means all types from 1 to N. A leading asterisk means all types from
1 to n (inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
The specified *color* can be a single color which is any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option. Or it can be two or more colors separated
by a "/" character, e.g. red/green/blue. In the former case, that
color is assigned to all the specified bond types. In the latter
case, the list of colors are assigned in a round-robin fashion to each
of the specified bond types.
----------
The *bdiam* keyword can be used with the dump image command, with its
*bond* keyword, when its diam setting is *type*, to set the diameter
that bonds of each type will be drawn in the image. The specified
*type* should be an integer from 1 to Nbondtypes. As with the
*bcolor* keyword, a wildcard asterisk can be used as part of the
*type* argument to specify a range of bond types. The specified
*diam* is the size in whatever distance :doc:`units <units>` you are
using, e.g. Angstroms.
----------
The *bitrate* keyword can be used with the :doc:`dump movie
<dump_image>` command to define the size of the resulting movie file
and its quality via setting how many kbits per second are to be used
for the movie file. Higher bitrates require less compression and will
result in higher quality movies. The quality is also determined by
the compression format and encoder. The default setting is 2000
kbit/s, which will result in average quality with older compression
formats.
.. note::
Not all movie file formats supported by dump movie allow the
bitrate to be set. If not, the setting is silently ignored.
----------
The *boxcolor* keyword sets the color of the simulation box drawn
around the atoms in each image as well as the color of processor
sub-domain boundaries. See the "dump image box" command for how to
specify that a box be drawn via the *box* keyword, and the sub-domain
boundaries via the *subbox* keyword. The color name can be any of the
140 pre-defined colors (see below) or a color name defined by the
dump_modify color option.
----------
The *color* keyword allows definition of a new color name, in addition
to the 140-predefined colors (see below), and associates 3
red/green/blue RGB values with that color name. The color name can
then be used with any other dump_modify keyword that takes a color
name as a value. The RGB values should each be floating point values
between 0.0 and 1.0 inclusive.
When a color name is converted to RGB values, the user-defined color
names are searched first, then the 140 pre-defined color names. This
means you can also use the *color* keyword to overwrite one of the
pre-defined color names with new RBG values.
----------
The *framerate* keyword can be used with the :doc:`dump movie
<dump_image>` command to define the duration of the resulting movie
file. Movie files written by the dump *movie* command have a default
frame rate of 24 frames per second and the images generated will be
converted at that rate. Thus a sequence of 1000 dump images will
result in a movie of about 42 seconds. To make a movie run longer you
can either generate images more frequently or lower the frame rate.
To speed a movie up, you can do the inverse. Using a frame rate
higher than 24 is not recommended, as it will result in simply
dropping the rendered images. It is more efficient to dump images less
frequently.
----------
@ -664,7 +999,7 @@ Related commands
Default
"""""""
The defaults for the keywords are as follows:
The defaults for the dump image and dump movie keywords are as follows:
* adiam = not specified (use diameter setting)
* atom = yes
@ -682,3 +1017,101 @@ The defaults for the keywords are as follows:
* subbox no 0.0
* shiny = 1.0
* ssao = no
----------
The defaults for the dump_modify keywords specific to dump image and dump movie are as follows:
* acolor = \* red/green/blue/yellow/aqua/cyan
* adiam = \* 1.0
* amap = min max cf 0.0 2 min blue max red
* backcolor = black
* bcolor = \* red/green/blue/yellow/aqua/cyan
* bdiam = \* 0.5
* bitrate = 2000
* boxcolor = yellow
* color = 140 color names are pre-defined as listed below
* framerate = 24
----------
These are the standard 109 element names that LAMMPS pre-defines for
use with the dump image and dump_modify commands.
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
----------
These are the 140 colors that LAMMPS pre-defines for use with the dump
image and dump_modify commands. Additional colors can be defined with
the dump_modify color command. The 3 numbers listed for each name are
the RGB (red/green/blue) values. Divide each value by 255 to get the
equivalent 0.0 to 1.0 value.
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+

View File

@ -3,6 +3,9 @@
dump_modify command
===================
:doc:`dump_modify <dump_image>` command for image/movie options
===============================================================
Syntax
""""""
@ -12,14 +15,16 @@ Syntax
* dump-ID = ID of dump to modify
* one or more keyword/value pairs may be appended
* these keywords apply to various dump styles
* keyword = *append* or *at* or *buffer* or *delay* or *element* or *every* or *fileper* or *first* or *flush* or *format* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
* keyword = *append* or *at* or *balance* or *buffer* or *delay* or *element* or *every* or *every/time* or *fileper* or *first* or *flush* or *format* or *header* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
.. parsed-literal::
*append* arg = *yes* or *no*
*at* arg = N
N = index of frame written upon first dump
*balance* arg = *yes* or *no*
*buffer* arg = *yes* or *no*
*delay* arg = Dstep
Dstep = delay output until this timestep
@ -28,6 +33,9 @@ Syntax
*every* arg = N
N = dump every this many timesteps
N can be a variable (see below)
*every/time* arg = Delta
Delta = dump every this interval in simulation time (time units)
Delta can be a variable (see below)
*fileper* arg = Np
Np = write one file for every this many processors
*first* arg = *yes* or *no*
@ -35,6 +43,9 @@ Syntax
*format* args = *line* string, *int* string, *float* string, M string, or *none*
string = C-style format string
M = integer from 1 to N, where N = # of per-atom quantities being output
*header* arg = *yes* or *no*
*yes* to write the header
*no* to not write the header
*image* arg = *yes* or *no*
*label* arg = string
string = character string (e.g. BONDS) to use in header of dump local file
@ -66,56 +77,11 @@ Syntax
*unwrap* arg = *yes* or *no*
* these keywords apply only to the *image* and *movie* :doc:`styles <dump_image>`
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate* or *header*
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
.. parsed-literal::
*acolor* args = type color
type = atom type or range of types (see below)
color = name of color or color1/color2/...
*adiam* args = type diam
type = atom type or range of types (see below)
diam = diameter of atoms of that type (distance units)
*amap* args = lo hi style delta N entry1 entry2 ... entryN
lo = number or *min* = lower bound of range of color map
hi = number or *max* = upper bound of range of color map
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
"c" for continuous
"d" for discrete
"s" for sequential
"a" for absolute
"f" for fractional
delta = binsize (only used for style "s", otherwise ignored)
binsize = range is divided into bins of this width
N = # of subsequent entries
entry = value color (for continuous style)
value = number or *min* or *max* = single value within range
color = name of color used for that value
entry = lo hi color (for discrete style)
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
color = name of color used for that subset of values
entry = color (for sequential style)
color = name of color used for a bin of values
*backcolor* arg = color
color = name of color for background
*bcolor* args = type color
type = bond type or range of types (see below)
color = name of color or color1/color2/...
*bdiam* args = type diam
type = bond type or range of types (see below)
diam = diameter of bonds of that type (distance units)
*boxcolor* arg = color
color = name of color for simulation box lines and processor sub-domain lines
*color* args = name R G B
name = name of color
R,G,B = red/green/blue numeric values from 0.0 to 1.0
*bitrate* arg = rate
rate = target bitrate for movie in kbps
*framerate* arg = fps
fps = frames per second for movie
*header* arg = *yes* or *no*
*yes* to write the header
*no* to not write the header
see the :doc:`dump image <dump_image>` doc page for details
* these keywords apply only to the */gz* and */zstd* dump styles
* keyword = *compression_level*
@ -126,7 +92,7 @@ Syntax
level = integer specifying the compression level that should be used (see below for supported levels)
* these keywords apply only to the */zstd* dump styles
* keyword = *compression_level*
* keyword = *checksum*
.. parsed-literal::
@ -144,7 +110,6 @@ Examples
dump_modify xtcdump precision 10000 sfactor 0.1
dump_modify 1 every 1000 nfile 20
dump_modify 1 every v_myVar
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
Description
"""""""""""
@ -163,8 +128,9 @@ which allow for use of MPI-IO.
----------
These keywords apply to various dump styles, including the :doc:`dump image <dump_image>` and :doc:`dump movie <dump_image>` styles. The
description gives details.
Unless otherwise noted, the following keywords apply to all the
various dump styles, including the :doc:`dump image <dump_image>` and
:doc:`dump movie <dump_image>` styles.
----------
@ -235,11 +201,19 @@ will be accepted.
----------
The *every* keyword changes the dump frequency originally specified by
the :doc:`dump <dump>` command to a new value. The every keyword can be
specified in one of two ways. It can be a numeric value in which case
it must be > 0. Or it can be an :doc:`equal-style variable <variable>`,
which should be specified as v_name, where name is the variable name.
The *every* keyword can be used with any dump style except the *dcd*
and *xtc* styles. It does two things. It specifies that the interval
between dump snapshots will be set in timesteps, which is the default
if the *every* or *every/time* keywords are not used. See the
*every/time* keyword for how to specify the interval in simulation
time, i.e. in time units of the :doc:`units <units>` command. The
*every* keyword also sets the interval value, which overrides the dump
frequency originally specified by the :doc:`dump <dump>` command.
The *every* keyword can be specified in one of two ways. It can be a
numeric value in which case it must be > 0. Or it can be an
:doc:`equal-style variable <variable>`, which should be specified as
v_name, where name is the variable name.
In this case, the variable is evaluated at the beginning of a run to
determine the next timestep at which a dump snapshot will be written
@ -248,11 +222,12 @@ determine the next timestep, etc. Thus the variable should return
timestep values. See the stagger() and logfreq() and stride() math
functions for :doc:`equal-style variables <variable>`, as examples of
useful functions to use in this context. Other similar math functions
could easily be added as options for :doc:`equal-style variables <variable>`. Also see the next() function, which allows
use of a file-style variable which reads successive values from a
file, each time the variable is evaluated. Used with the *every*
keyword, if the file contains a list of ascending timesteps, you can
output snapshots whenever you wish.
could easily be added as options for :doc:`equal-style variables
<variable>`. Also see the next() function, which allows use of a
file-style variable which reads successive values from a file, each
time the variable is evaluated. Used with the *every* keyword, if the
file contains a list of ascending timesteps, you can output snapshots
whenever you wish.
Note that when using the variable option with the *every* keyword, you
need to use the *first* option if you want an initial snapshot written
@ -293,14 +268,103 @@ in file tmp.times:
----------
The *every/time* keyword can be used with any dump style except the
*dcd* and *xtc* styles. It does two things. It specifies that the
interval between dump snapshots will be set in simulation time,
i.e. in time units of the :doc:`units <units>` command. This can be
useful when the timestep size varies during a simulation run, e.g. by
use of the :doc:`fix dt/reset <fix_dt_reset>` command. The default is
to specify the interval in timesteps; see the *every* keyword. The
*every/time* command also sets the interval value.
.. note::
If you wish dump styles *atom*, *custom*, *local*, or *xyz* to
include the simulation time as a field in the header portion of
each snapshot, you also need to use the dump_modify *time* keyword
with a setting of *yes*. See its documentation below.
Note that since snapshots are output on simulation steps, each
snapshot will be written on the first timestep whose associated
simulation time is >= the exact snapshot time value.
As with the *every* option, the *Delta* value can be specified in one
of two ways. It can be a numeric value in which case it must be >
0.0. Or it can be an :doc:`equal-style variable <variable>`, which
should be specified as v_name, where name is the variable name.
In this case, the variable is evaluated at the beginning of a run to
determine the next simulation time at which a dump snapshot will be
written out. On that timestep the variable will be evaluated again to
determine the next simulation time, etc. Thus the variable should
return values in time units. Note the current timestep or simulation
time can be used in an :doc:`equal-style variables <variable>` since
they are both thermodynamic keywords. Also see the next() function,
which allows use of a file-style variable which reads successive
values from a file, each time the variable is evaluated. Used with
the *every/time* keyword, if the file contains a list of ascending
simulation times, you can output snapshots whenever you wish.
Note that when using the variable option with the *every/time*
keyword, you need to use the *first* option if you want an initial
snapshot written to the dump file. The *every/time* keyword cannot be
used with the dump *dcd* style.
For example, the following commands will write snapshots at successive
simulation times which grow by a factor of 1.5 with each interval.
The dt value used in the variable is to avoid a zero result when the
initial simulation time is 0.0.
.. code-block:: LAMMPS
variable increase equal 1.5*(time+dt)
dump 1 all atom 100 tmp.dump
dump_modify 1 every/time v_increase first yes
The following commands would write snapshots at the times listed in
file tmp.times:
.. code-block:: LAMMPS
variable f file tmp.times
variable s equal next(f)
dump 1 all atom 100 tmp.dump
dump_modify 1 every/time v_s
.. note::
When using a file-style variable with the *every/time* keyword, the
file of timesteps must list a first time that is beyond the time
associated with the current timestep (e.g. it cannot be 0.0). And
it must list one or more times beyond the length of the run you
perform. This is because the dump command will generate an error
if the next time it reads from the file is not a value greater than
the current time. Thus if you wanted output at times 0,15,100 of a
run of length 100 in simulation time, the file should contain the
values 15,100,101 and you should also use the dump_modify first
command. Any final value > 100 could be used in place of 101.
----------
The *first* keyword determines whether a dump snapshot is written on
the very first timestep after the dump command is invoked. This will
always occur if the current timestep is a multiple of N, the frequency
specified in the :doc:`dump <dump>` command, including timestep 0. But
if this is not the case, a dump snapshot will only be written if the
setting of this keyword is *yes*\ . If it is *no*, which is the
always occur if the current timestep is a multiple of $N$, the
frequency specified in the :doc:`dump <dump>` command or
:doc:`dump_modify every <dump_modify>` command, including timestep 0.
It will also always occur if the current simulation time is a multiple
of *Delta*, the time interval specified in the doc:`dump_modify
every/time <dump_modify>` command.
But if this is not the case, a dump snapshot will only be written if
the setting of this keyword is *yes*\ . If it is *no*, which is the
default, then it will not be written.
Note that if the argument to the :doc:`dump_modify every
<dump_modify>` doc:`dump_modify every/time <dump_modify>` commands is
a variable and not a numeric value, then specifying *first yes* is the
only way to write a dump snapshot on the first timestep after the dump
command is invoked.
----------
The *flush* keyword determines whether a flush operation is invoked
@ -380,6 +444,13 @@ The *fileper* keyword is documented below with the *nfile* keyword.
----------
The *header* keyword toggles whether the dump file will include a
header. Excluding a header will reduce the size of the dump file for
fixes such as :doc:`fix pair/tracker <fix_pair_tracker>` which do not
require the information typically written to the header.
----------
The *image* keyword applies only to the dump *atom* style. If the
image value is *yes*, 3 flags are appended to each atom's coords which
are the absolute box image of the atom in each dimension. For
@ -592,9 +663,19 @@ The dump *local* style cannot be sorted by atom ID, since there are
typically multiple lines of output per atom. Some dump styles, such
as *dcd* and *xtc*, require sorting by atom ID to format the output
file correctly. If multiple processors are writing the dump file, via
the "%" wildcard in the dump filename, then sorting cannot be
the "%" wildcard in the dump filename and the *nfile* or *fileper*
keywords are set to non-default values (i.e. the number of dump file
pieces is not equal to the number of procs), then sorting cannot be
performed.
In a parallel run, the per-processor dump file pieces can have
significant imbalance in number of lines of per-atom info. The *balance*
keyword determines whether the number of lines in each processor
snapshot are balanced to be nearly the same. A balance value of *no*
means no balancing will be done, while *yes* means balancing will be
performed. This balancing preserves dump sorting order. For a serial
run, this option is ignored since the output is already balanced.
.. note::
Unless it is required by the dump style, sorting dump file
@ -670,16 +751,20 @@ threshold criterion is met. Otherwise it is not met.
----------
The *time* keyword only applies to the dump *atom*, *custom*, and
*local* styles (and their COMPRESS package versions *atom/gz*,
*custom/gz* and *local/gz*\ ). If set to *yes*, each frame will will
contain two extra lines before the "ITEM: TIMESTEP" entry:
The *time* keyword only applies to the dump *atom*, *custom*, *local*,
and *xyz* styles (and their COMPRESS package versions *atom/gz*,
*custom/gz* and *local/gz*\ ). For the first 3 styles, if set to
*yes*, each frame will will contain two extra lines before the "ITEM:
TIMESTEP" entry:
.. parsed-literal::
ITEM: TIME
\<elapsed time\>
For the *xyz* style, the simulation time is included on the same line
as the timestep value.
This will output the current elapsed simulation time in current
time units equivalent to the :doc:`thermo keyword <thermo_style>` *time*\ .
This is to simplify post-processing of trajectories using a variable time
@ -715,303 +800,35 @@ box size stored with the snapshot.
----------
These keywords apply only to the :doc:`dump image <dump_image>` and
:doc:`dump movie <dump_image>` styles. Any keyword that affects an
image, also affects a movie, since the movie is simply a collection of
images. Some of the keywords only affect the :doc:`dump movie <dump_image>` style. The descriptions give details.
The COMPRESS package offers both GZ and Zstd compression variants of
styles atom, custom, local, cfg, and xyz. When using these styles the
compression level can be controlled by the :code:`compression_level`
keyword. File names with these styles have to end in either
:code:`.gz` or :code:`.zst`.
----------
The *acolor* keyword can be used with the :doc:`dump image <dump_image>`
command, when its atom color setting is *type*, to set the color that
atoms of each type will be drawn in the image.
The specified *type* should be an integer from 1 to Ntypes = the
number of atom types. A wildcard asterisk can be used in place of or
in conjunction with the *type* argument to specify a range of atom
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
number of atom types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
The specified *color* can be a single color which is any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option. Or it can be two or more colors separated
by a "/" character, e.g. red/green/blue. In the former case, that
color is assigned to all the specified atom types. In the latter
case, the list of colors are assigned in a round-robin fashion to each
of the specified atom types.
----------
The *adiam* keyword can be used with the :doc:`dump image <dump_image>`
command, when its atom diameter setting is *type*, to set the size
that atoms of each type will be drawn in the image. The specified
*type* should be an integer from 1 to Ntypes. As with the *acolor*
keyword, a wildcard asterisk can be used as part of the *type*
argument to specify a range of atom types. The specified *diam* is
the size in whatever distance :doc:`units <units>` the input script is
using, e.g. Angstroms.
----------
The *amap* keyword can be used with the :doc:`dump image <dump_image>`
command, with its *atom* keyword, when its atom setting is an
atom-attribute, to setup a color map. The color map is used to assign
a specific RGB (red/green/blue) color value to an individual atom when
it is drawn, based on the atom's attribute, which is a numeric value,
e.g. its x-component of velocity if the atom-attribute "vx" was
specified.
The basic idea of a color map is that the atom-attribute will be
within a range of values, and that range is associated with a series
of colors (e.g. red, blue, green). An atom's specific value (vx =
-3.2) can then mapped to the series of colors (e.g. halfway between
red and blue), and a specific color is determined via an interpolation
procedure.
There are many possible options for the color map, enabled by the
*amap* keyword. Here are the details.
The *lo* and *hi* settings determine the range of values allowed for
the atom attribute. If numeric values are used for *lo* and/or *hi*,
then values that are lower/higher than that value are set to the
value. I.e. the range is static. If *lo* is specified as *min* or
*hi* as *max* then the range is dynamic, and the lower and/or
upper bound will be calculated each time an image is drawn, based
on the set of atoms being visualized.
The *style* setting is two letters, such as "ca". The first letter is
either "c" for continuous, "d" for discrete, or "s" for sequential.
The second letter is either "a" for absolute, or "f" for fractional.
A continuous color map is one in which the color changes continuously
from value to value within the range. A discrete color map is one in
which discrete colors are assigned to sub-ranges of values within the
range. A sequential color map is one in which discrete colors are
assigned to a sequence of sub-ranges of values covering the entire
range.
An absolute color map is one in which the values to which colors are
assigned are specified explicitly as values within the range. A
fractional color map is one in which the values to which colors are
assigned are specified as a fractional portion of the range. For
example if the range is from -10.0 to 10.0, and the color red is to be
assigned to atoms with a value of 5.0, then for an absolute color map
the number 5.0 would be used. But for a fractional map, the number
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
The *delta* setting must be specified for all styles, but is only used
for the sequential style; otherwise the value is ignored. It
specifies the bin size to use within the range for assigning
consecutive colors to. For example, if the range is from -10.0 to
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
the range. The first will be from -10.0 <= color1 < -9.0, then second
from -9.0 <= color2 < -8.0, etc.
The *N* setting is how many entries follow. The format of the entries
depends on whether the color map style is continuous, discrete or
sequential. In all cases the *color* setting can be any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option.
For continuous color maps, each entry has a *value* and a *color*\ .
The *value* is either a number within the range of values or *min* or
*max*\ . The *value* of the first entry must be *min* and the *value*
of the last entry must be *max*\ . Any entries in between must have
increasing values. Note that numeric values can be specified either
as absolute numbers or as fractions (0.0 to 1.0) of the range,
depending on the "a" or "f" in the style setting for the color map.
Here is how the entries are used to determine the color of an
individual atom, given the value X of its atom attribute. X will fall
between 2 of the entry values. The color of the atom is linearly
interpolated (in each of the RGB values) between the 2 colors
associated with those entries. For example, if X = -5.0 and the 2
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
atom's color will be halfway between "red" and "blue", which happens
to be "purple".
For discrete color maps, each entry has a *lo* and *hi* value and a
*color*\ . The *lo* and *hi* settings are either numbers within the
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
and *hi* settings of the last entry must be *min* and *max*\ . Other
entries can have any *lo* and *hi* values and the sub-ranges of
different values can overlap. Note that numeric *lo* and *hi* values
can be specified either as absolute numbers or as fractions (0.0 to
1.0) of the range, depending on the "a" or "f" in the style setting
for the color map.
Here is how the entries are used to determine the color of an
individual atom, given the value X of its atom attribute. The entries
are scanned from first to last. The first time that *lo* <= X <=
*hi*, X is assigned the color associated with that entry. You can
think of the last entry as assigning a default color (since it will
always be matched by X), and the earlier entries as colors that
override the default. Also note that no interpolation of a color RGB
is done. All atoms will be drawn with one of the colors in the list
of entries.
For sequential color maps, each entry has only a *color*\ . Here is how
the entries are used to determine the color of an individual atom,
given the value X of its atom attribute. The range is partitioned
into N bins of width *binsize*\ . Thus X will fall in a specific bin
from 1 to N, say the Mth bin. If it falls on a boundary between 2
bins, it is considered to be in the higher of the 2 bins. Each bin is
assigned a color from the E entries. If E < N, then the colors are
repeated. For example if 2 entries with colors red and green are
specified, then the odd numbered bins will be red and the even bins
green. The color of the atom is the color of its bin. Note that the
sequential color map is really a shorthand way of defining a discrete
color map without having to specify where all the bin boundaries are.
Here is an example of using a sequential color map to color all the
atoms in individual molecules with a different color. See the
examples/pour/in.pour.2d.molecule input script for an example of how
this is used.
.. code-block:: LAMMPS
variable colors string &
"red green blue yellow white &
purple pink orange lime gray"
variable mol atom mol%10
dump 1 all image 250 image.*.jpg v_mol type &
zoom 1.6 adiam 1.5
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
In this case, 10 colors are defined, and molecule IDs are
mapped to one of the colors, even if there are 1000s of molecules.
----------
The *backcolor* sets the background color of the images. The color
name can be any of the 140 pre-defined colors (see below) or a color
name defined by the dump_modify color option.
----------
The *bcolor* keyword can be used with the :doc:`dump image <dump_image>`
command, with its *bond* keyword, when its color setting is *type*, to
set the color that bonds of each type will be drawn in the image.
The specified *type* should be an integer from 1 to Nbondtypes = the
number of bond types. A wildcard asterisk can be used in place of or
in conjunction with the *type* argument to specify a range of bond
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
number of bond types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
The specified *color* can be a single color which is any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option. Or it can be two or more colors separated
by a "/" character, e.g. red/green/blue. In the former case, that
color is assigned to all the specified bond types. In the latter
case, the list of colors are assigned in a round-robin fashion to each
of the specified bond types.
----------
The *bdiam* keyword can be used with the :doc:`dump image <dump_image>`
command, with its *bond* keyword, when its diam setting is *type*, to
set the diameter that bonds of each type will be drawn in the image.
The specified *type* should be an integer from 1 to Nbondtypes. As
with the *bcolor* keyword, a wildcard asterisk can be used as part of
the *type* argument to specify a range of bond types. The specified
*diam* is the size in whatever distance :doc:`units <units>` you are
using, e.g. Angstroms.
----------
The *bitrate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the size of the resulting
movie file and its quality via setting how many kbits per second are
to be used for the movie file. Higher bitrates require less
compression and will result in higher quality movies. The quality is
also determined by the compression format and encoder. The default
setting is 2000 kbit/s, which will result in average quality with
older compression formats.
.. note::
Not all movie file formats supported by dump movie allow the
bitrate to be set. If not, the setting is silently ignored.
----------
The *boxcolor* keyword sets the color of the simulation box drawn
around the atoms in each image as well as the color of processor
sub-domain boundaries. See the "dump image box" command for how to
specify that a box be drawn via the *box* keyword, and the sub-domain
boundaries via the *subbox* keyword. The color name can be any of the
140 pre-defined colors (see below) or a color name defined by the
dump_modify color option.
----------
The *color* keyword allows definition of a new color name, in addition
to the 140-predefined colors (see below), and associates 3
red/green/blue RGB values with that color name. The color name can
then be used with any other dump_modify keyword that takes a color
name as a value. The RGB values should each be floating point values
between 0.0 and 1.0 inclusive.
When a color name is converted to RGB values, the user-defined color
names are searched first, then the 140 pre-defined color names. This
means you can also use the *color* keyword to overwrite one of the
pre-defined color names with new RBG values.
----------
The *framerate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the duration of the resulting
movie file. Movie files written by the dump *movie* command have a
default frame rate of 24 frames per second and the images generated
will be converted at that rate. Thus a sequence of 1000 dump images
will result in a movie of about 42 seconds. To make a movie run
longer you can either generate images more frequently or lower the
frame rate. To speed a movie up, you can do the inverse. Using a
frame rate higher than 24 is not recommended, as it will result in
simply dropping the rendered images. It is more efficient to dump
images less frequently.
----------
The *header* keyword toggles whether the dump file will include a header.
Excluding a header will reduce the size of the dump file for fixes such as
:doc:`fix pair/tracker <fix_pair_tracker>` which do not require the information
typically written to the header.
----------
The COMPRESS package offers both GZ and Zstd compression variants of styles
atom, custom, local, cfg, and xyz. When using these styles the compression
level can be controlled by the :code:`compression_level` parameter. File names
with these styles have to end in either :code:`.gz` or :code:`.zst`.
GZ supports compression levels from -1 (default), 0 (no compression), and 1 to
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9 as
default compression level.
GZ supports compression levels from -1 (default), 0 (no compression),
and 1 to
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9
as default compression level.
Zstd offers a wider range of compression levels, including negative
levels that sacrifice compression for performance. 0 is the
default, positive levels are 1 to 22, with 22 being the most expensive
levels that sacrifice compression for performance. 0 is the default,
positive levels are 1 to 22, with 22 being the most expensive
compression. Zstd promises higher compression/decompression speeds for
similar compression ratios. For more details see
`http://facebook.github.io/zstd/`.
In addition, Zstd compressed files can have a checksum of the entire
contents. The Zstd enabled dump styles enable this feature by default and it
can be disabled with the :code:`checksum` parameter.
In addition, Zstd compressed files can include a checksum of the
entire contents. The Zstd enabled dump styles enable this feature by
default and it can be disabled with the :code:`checksum` keyword.
----------
Restrictions
""""""""""""
none
Not all *dump_modify* options can be applied to all dump styles.
Details are in the discussions of the individual options.
Related commands
""""""""""""""""
@ -1024,6 +841,7 @@ Default
The option defaults are
* append = no
* balance = no
* buffer = yes for dump styles *atom*, *custom*, *loca*, and *xyz*
* element = "C" for every atom type
* every = whatever it was set to via the :doc:`dump <dump>` command
@ -1046,100 +864,7 @@ The option defaults are
* units = no
* unwrap = no
* acolor = \* red/green/blue/yellow/aqua/cyan
* adiam = \* 1.0
* amap = min max cf 0.0 2 min blue max red
* backcolor = black
* bcolor = \* red/green/blue/yellow/aqua/cyan
* bdiam = \* 0.5
* bitrate = 2000
* boxcolor = yellow
* color = 140 color names are pre-defined as listed below
* framerate = 24
* compression_level = 9 (gz variants)
* compression_level = 0 (zstd variants)
* checksum = yes (zstd variants)
----------
These are the standard 109 element names that LAMMPS pre-defines for
use with the :doc:`dump image <dump_image>` and dump_modify commands.
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
----------
These are the 140 colors that LAMMPS pre-defines for use with the
:doc:`dump image <dump_image>` and dump_modify commands. Additional
colors can be defined with the dump_modify color command. The 3
numbers listed for each name are the RGB (red/green/blue) values.
Divide each value by 255 to get the equivalent 0.0 to 1.0 value.
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+

View File

@ -1,8 +1,11 @@
.. index:: dynamical_matrix
.. index:: dynamical_matrix/kk
dynamical_matrix command
========================
Accelerator Variants: dynamical_matrix/kk
Syntax
""""""
@ -56,6 +59,12 @@ If the style eskm is selected, the dynamical matrix will be in units of
inverse squared femtoseconds. These units will then conveniently leave
frequencies in THz.
----------
.. include:: accel_styles.rst
----------
Restrictions
""""""""""""

View File

@ -166,6 +166,7 @@ page are followed by one or more of (g,i,k,o,t) to indicate which
accelerated styles exist.
* :doc:`accelerate/cos <fix_accelerate_cos>` - apply cosine-shaped acceleration to atoms
* :doc:`acks2/reaxff <fix_acks2_reaxff>` - apply ACKS2 charge equilibration
* :doc:`adapt <fix_adapt>` - change a simulation parameter over time
* :doc:`adapt/fep <fix_adapt_fep>` - enhanced version of fix adapt
* :doc:`addforce <fix_addforce>` - add a force to each atom
@ -246,6 +247,7 @@ accelerated styles exist.
* :doc:`manifoldforce <fix_manifoldforce>` - restrain atoms to a manifold during minimization
* :doc:`mdi/engine <fix_mdi_engine>` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI)
* :doc:`meso/move <fix_meso_move>` - move mesoscopic SPH/SDPD particles in a prescribed fashion
* :doc:`mol/swap <fix_mol_swap>` - Monte Carlo atom type swapping with a molecule
* :doc:`momentum <fix_momentum>` - zero the linear and/or angular momentum of a group of atoms
* :doc:`momentum/chunk <fix_momentum>` - zero the linear and/or angular momentum of a chunk of atoms
* :doc:`move <fix_move>` - move atoms in a prescribed fashion
@ -269,7 +271,8 @@ accelerated styles exist.
* :doc:`npt/eff <fix_nh_eff>` - NPT for nuclei and electrons in the electron force field model
* :doc:`npt/sphere <fix_npt_sphere>` - NPT for spherical particles
* :doc:`npt/uef <fix_nh_uef>` - NPT style time integration with diagonal flow
* :doc:`numdiff <fix_numdiff>` - compute derivatives of per-atom data from finite differences
* :doc:`numdiff <fix_numdiff>` - numerically approximate atomic forces using finite energy differences
* :doc:`numdiff/virial <fix_numdiff_virial>` - numerically approximate virial stress tensor using finite energy differences
* :doc:`nve <fix_nve>` - constant NVE time integration
* :doc:`nve/asphere <fix_nve_asphere>` - NVE for aspherical particles
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>` - NVE for aspherical particles without forces

View File

@ -0,0 +1,118 @@
.. index:: fix acks2/reaxff
.. index:: fix acks2/reaxff/kk
fix acks2/reaxff command
========================
Accelerator Variants: *acks2/reaxff/kk*
Syntax
""""""
.. parsed-literal::
fix ID group-ID acks2/reaxff Nevery cutlo cuthi tolerance params args
* ID, group-ID are documented in :doc:`fix <fix>` command
* acks2/reaxff = style name of this fix command
* Nevery = perform ACKS2 every this many steps
* cutlo,cuthi = lo and hi cutoff for Taper radius
* tolerance = precision to which charges will be equilibrated
* params = reaxff or a filename
Examples
""""""""
.. code-block:: LAMMPS
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 reaxff
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2
Description
"""""""""""
Perform the atom-condensed Kohn-Sham DFT to second order (ACKS2) charge
equilibration method as described in :ref:`(Verstraelen) <Verstraelen>`.
ACKS2 impedes unphysical long-range charge transfer sometimes seen with
QEq (e.g. for dissociation of molecules), at increased computational
cost. It is typically used in conjunction with the ReaxFF force field
model as implemented in the :doc:`pair_style reaxff <pair_reaxff>`
command, but it can be used with any potential in LAMMPS, so long as it
defines and uses charges on each atom. For more technical details about
the charge equilibration performed by fix acks2/reaxff, see the
:ref:`(O'Hearn) <O'Hearn>` paper.
The ACKS2 method minimizes the electrostatic energy of the system by
adjusting the partial charge on individual atoms based on interactions
with their neighbors. It requires some parameters for each atom type.
If the *params* setting above is the word "reaxff", then these are
extracted from the :doc:`pair_style reaxff <pair_reaxff>` command and
the ReaxFF force field file it reads in. If a file name is specified
for *params*\ , then the parameters are taken from the specified file
and the file must contain one line for each atom type. The latter form
must be used when performing QeQ with a non-ReaxFF potential. The lines
should be formatted as follows:
.. parsed-literal::
bond_softness
itype chi eta gamma bcut
where the first line is the global parameter *bond_softness*. The
remaining 1 to Ntypes lines include *itype*, the atom type from 1 to
Ntypes, *chi*, the electronegativity in eV, *eta*, the self-Coulomb
potential in eV, *gamma*, the valence orbital exponent, and *bcut*, the
bond cutoff distance. Note that these 4 quantities are also in the
ReaxFF potential file, except that eta is defined here as twice the eta
value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units
of this fix are hard-coded to be A, eV, and electronic charge.
**Restart, fix_modify, output, run start/stop, minimize info:**
No information about this fix is written to :doc:`binary restart files
<restart>`. No global scalar or vector or per-atom quantities are
stored by this fix for access by various :doc:`output commands
<Howto_output>`. No parameter of this fix can be used with the
*start/stop* keywords of the :doc:`run <run>` command.
This fix is invoked during :doc:`energy minimization <minimize>`.
----------
.. include:: accel_styles.rst
----------
Restrictions
""""""""""""
This fix is part of the REAXFF package. It is only enabled if LAMMPS
was built with that package. See the :doc:`Build package
<Build_package>` doc page for more info.
This fix does not correctly handle interactions involving multiple
periodic images of the same atom. Hence, it should not be used for
periodic cell dimensions less than 10 angstroms.
This fix may be used in combination with :doc:`fix efield <fix_efield>`
and will apply the external electric field during charge equilibration,
but there may be only one fix efield instance used, it may only use a
constant electric field, and the electric field vector may only have
components in non-periodic directions.
Related commands
""""""""""""""""
:doc:`pair_style reaxff <pair_reaxff>`, :doc:`fix qeq/reaxff <fix_qeq_reaxff>`
**Default:** none
----------
.. _O'Hearn:
**(O'Hearn)** O'Hearn, Alperen, Aktulga, SIAM J. Sci. Comput., 42(1), C1-C22 (2020).
.. _Verstraelen:
**(Verstraelen)** Verstraelen, Ayers, Speybroeck, Waroquier, J. Chem. Phys. 138, 074108 (2013).

View File

@ -99,7 +99,7 @@ invoked by the :doc:`minimize <minimize>` command.
Restrictions
""""""""""""
This fix is part of the MISC package. It is only enabled if
This fix is part of the EXTRA-FIX package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.

View File

@ -73,51 +73,51 @@ is the same after the swap as it was before the swap, even though the
atom masses have changed.
The *semi-grand* keyword can be set to *yes* to switch to the
semi-grand canonical ensemble as discussed in :ref:`(Sadigh) <Sadigh>`. This
means that the total number of each particle type does not need to be
conserved. The default is *no*, which means that the only kind of swap
allowed exchanges an atom of one type with an atom of a different
given type. In other words, the relative mole fractions of the swapped
atoms remains constant. Whereas in the semi-grand canonical ensemble,
the composition of the system can change. Note that when using
*semi-grand*, atoms in the fix group whose type is not listed
in the *types* keyword are ineligible for attempted
conversion. An attempt is made to switch
the selected atom (if eligible) to one of the other listed types
with equal probability. Acceptance of each attempt depends upon the Metropolis criterion.
semi-grand canonical ensemble as discussed in :ref:`(Sadigh)
<Sadigh>`. This means that the total number of each particle type does
not need to be conserved. The default is *no*, which means that the
only kind of swap allowed exchanges an atom of one type with an atom
of a different given type. In other words, the relative mole fractions
of the swapped atoms remains constant. Whereas in the semi-grand
canonical ensemble, the composition of the system can change. Note
that when using *semi-grand*, atoms in the fix group whose type is not
listed in the *types* keyword are ineligible for attempted
conversion. An attempt is made to switch the selected atom (if
eligible) to one of the other listed types with equal
probability. Acceptance of each attempt depends upon the Metropolis
criterion.
The *mu* keyword allows users to specify chemical
potentials. This is required and allowed only when using *semi-grand*\ .
All chemical potentials are absolute, so there is one for
each swap type listed following the *types* keyword.
In semi-grand canonical ensemble simulations the chemical composition
of the system is controlled by the difference in these values. So
shifting all values by a constant amount will have no effect
on the simulation.
The *mu* keyword allows users to specify chemical potentials. This is
required and allowed only when using *semi-grand*\ . All chemical
potentials are absolute, so there is one for each swap type listed
following the *types* keyword. In semi-grand canonical ensemble
simulations the chemical composition of the system is controlled by
the difference in these values. So shifting all values by a constant
amount will have no effect on the simulation.
This command may optionally use the *region* keyword to define swap
volume. The specified region must have been previously defined with a
:doc:`region <region>` command. It must be defined with side = *in*\ .
Swap attempts occur only between atoms that are both within the
:doc:`region <region>` command. It must be defined with side = *in*\
. Swap attempts occur only between atoms that are both within the
specified region. Swaps are not otherwise attempted.
You should ensure you do not swap atoms belonging to a molecule, or
LAMMPS will soon generate an error when it tries to find those atoms.
LAMMPS will warn you if any of the atoms eligible for swapping have a
non-zero molecule ID, but does not check for this at the time of
LAMMPS will eventually generate an error when it tries to find those
atoms. LAMMPS will warn you if any of the atoms eligible for swapping
have a non-zero molecule ID, but does not check for this at the time of
swapping.
If not using *semi-grand* this fix checks to ensure all atoms of the
given types have the same atomic charge. LAMMPS does not enforce this
in general, but it is needed for this fix to simplify the
swapping procedure. Successful swaps will swap the atom type and charge
of the swapped atoms. Conversely, when using *semi-grand*, it is assumed that all the atom
types involved in switches have the same charge. Otherwise, charge
would not be conserved. As a consequence, no checks on atomic charges are
performed, and successful switches update the atom type but not the
atom charge. While it is possible to use *semi-grand* with groups of
atoms that have different charges, these charges will not be changed when the
atom types change.
in general, but it is needed for this fix to simplify the swapping
procedure. Successful swaps will swap the atom type and charge of the
swapped atoms. Conversely, when using *semi-grand*, it is assumed that
all the atom types involved in switches have the same
charge. Otherwise, charge would not be conserved. As a consequence, no
checks on atomic charges are performed, and successful switches update
the atom type but not the atom charge. While it is possible to use
*semi-grand* with groups of atoms that have different charges, these
charges will not be changed when the atom types change.
Since this fix computes total potential energies before and after
proposed swaps, so even complicated potential energy calculations are
@ -133,23 +133,24 @@ OK, including the following:
Some fixes have an associated potential energy. Examples of such fixes
include: :doc:`efield <fix_efield>`, :doc:`gravity <fix_gravity>`,
:doc:`addforce <fix_addforce>`, :doc:`langevin <fix_langevin>`,
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen <fix_temp_berendsen>`,
:doc:`temp/rescale <fix_temp_rescale>`, and :doc:`wall fixes <fix_wall>`.
For that energy to be included in the total potential energy of the
system (the quantity used when performing GCMC moves),
you MUST enable the :doc:`fix_modify <fix_modify>` *energy* option for
that fix. The doc pages for individual :doc:`fix <fix>` commands
specify if this should be done.
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen
<fix_temp_berendsen>`, :doc:`temp/rescale <fix_temp_rescale>`, and
:doc:`wall fixes <fix_wall>`. For that energy to be included in the
total potential energy of the system (the quantity used when
performing GCMC moves), you MUST enable the :doc:`fix_modify
<fix_modify>` *energy* option for that fix. The doc pages for
individual :doc:`fix <fix>` commands specify if this should be done.
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
number generator seed, the next timestep for MC exchanges, the number
of exchange attempts and successes etc. See
the :doc:`read_restart <read_restart>` command for info on how to
re-specify a fix in an input script that reads a restart file, so that
the operation of the fix continues in an uninterrupted fashion.
This fix writes the state of the fix to :doc:`binary restart files
<restart>`. This includes information about the random number
generator seed, the next timestep for MC exchanges, the number of
exchange attempts and successes etc. See the :doc:`read_restart
<read_restart>` command for info on how to re-specify a fix in an
input script that reads a restart file, so that the operation of the
fix continues in an uninterrupted fashion.
.. note::
@ -165,12 +166,13 @@ by various :doc:`output commands <Howto_output>`. The vector values are
the following global cumulative quantities:
* 1 = swap attempts
* 2 = swap successes
* 2 = swap accepts
The vector values calculated by this fix are "extensive".
No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
the :doc:`run <run>` command. This fix is not invoked during
:doc:`energy minimization <minimize>`.
Restrictions
""""""""""""
@ -184,7 +186,8 @@ Related commands
:doc:`fix nvt <fix_nh>`, :doc:`neighbor <neighbor>`,
:doc:`fix deposit <fix_deposit>`, :doc:`fix evaporate <fix_evaporate>`,
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`,
:doc:`fix mol/swap <fix_mol_swap>`
Default
"""""""

Some files were not shown because too many files have changed in this diff Show More