Compare commits

...

1200 Commits

Author SHA1 Message Date
2a068b248a Merge pull request #4645 from akohlmey/improve-tests-for-set
Add or improve unit test programs to improve test coverage and specifically check recent additions
2025-07-16 20:13:37 -04:00
58948b71a9 add tests for run command 2025-07-16 17:50:15 -04:00
f80b015e27 output message of incorrect exceptions 2025-07-16 17:50:05 -04:00
d1d8a019f9 improve error messages for run command 2025-07-16 17:49:15 -04:00
ab6de4c384 test velocity command 2025-07-16 14:17:32 -04:00
13d3cfa2b6 more test coverage for utils::bounds() 2025-07-16 12:52:18 -04:00
3daa0c0726 add tests for utils::logical() and utils::*numeric() 2025-07-16 09:54:25 -04:00
b37ebc6b33 add tests for utils::check_packages_for_style() 2025-07-16 07:23:41 -04:00
d542651d60 consolidate redundant functionality into one function 2025-07-16 07:15:42 -04:00
a19cb93558 add test for utils::point_to_error() 2025-07-16 04:41:37 -04:00
88cb95f2ad add tests for utils::print() with/without file pointer and with/without format 2025-07-15 20:04:47 -04:00
8c564460e6 Merge branch 'develop' into improve-tests-for-set 2025-07-15 19:32:02 -04:00
351df5488f Merge pull request #4660 from akohlmey/remove-deprecation-warnings
Remove various deprecation and removal warnings for the stable release
2025-07-15 14:10:28 -04:00
2584db928d Merge pull request #4591 from VeeEM/fix-elstop-kokkos
Create kokkos version of fix electron stopping
2025-07-15 13:48:41 -04:00
d555b88cb1 Merge pull request #4573 from ndtrung81/kokkos-vector-size
Support setting threads per atom with neigh/thread on with the KOKKOS package
2025-07-15 12:21:30 -04:00
a1f21f9ea5 Update GNU Makefile build 2025-07-15 09:09:53 -06:00
41987dd20f Merge branch 'develop' of github.com:lammps/lammps into fix-elstop-kokkos 2025-07-15 09:07:22 -06:00
7335aa7046 Add error checks to prevent unexpected behavior 2025-07-15 09:03:28 -06:00
90e59e8484 Merge branch 'develop' of github.com:lammps/lammps into kokkos-vector-size 2025-07-15 08:54:12 -06:00
da148ac331 Remove various deprecation and removal warnings for the stable release 2025-07-15 07:12:42 -04:00
f79dd13c9b Merge pull request #4655 from jmgoff/mliap_indexing
updated indexing for mliap ace and other small fixes
2025-07-15 02:28:40 -04:00
4bc3edc94d Merge pull request #4601 from weinbe2/feature/batch-snap-ilp
SNAP/Kokkos work batching and instruction-level parallelism optimizations
2025-07-15 00:53:23 -04:00
e6ca347b5c Merge branch 'feature/batch-snap-ilp' of github.com:weinbe2/lammps into feature/batch-snap-ilp 2025-07-14 22:20:03 -06:00
151b713a60 whitespace 2025-07-14 22:19:55 -06:00
73eaa41af0 Merge pull request #4659 from stanmoore1/kk_update_4.6.2
Update Kokkos library in LAMMPS to v4.6.2
2025-07-14 23:46:54 -04:00
4995cd372d Merge pull request #4657 from yotamfe/bosonic-pimd-doc
Documentation for fix pimd/*/bosonic
2025-07-14 22:38:19 -04:00
8d5c50db1f Merge branch 'develop' into feature/batch-snap-ilp 2025-07-14 21:40:47 -04:00
929bc35133 Added various documentation about the *_batch values to pair_snap_kokkos.h 2025-07-14 21:34:13 -04:00
af1d4b7bf9 Added self to contributors list (a few years late) 2025-07-14 21:25:02 -04:00
65f8f8695f Added documentation on initializing ulist_wrapper in evaluate_ui_jbend 2025-07-14 21:24:17 -04:00
dcdd57c130 Merge pull request #4658 from evoyiatzis/patch-1
Improve text in compute stress/mop rst file
2025-07-14 21:15:22 -04:00
625811cc11 Clean up an intermediate comment in compute_sna_grid_kokkos.h 2025-07-14 21:09:22 -04:00
f8124ebe4c Merge pull request #4615 from akohlmey/roll-back-neighbor-swap
Roll back neighbor swap changes and flag items that need fixing
2025-07-14 20:43:13 -04:00
587be04ebc Tuning for AMD GPUs 2025-07-14 15:05:29 -07:00
a6653a2097 Update docs 2025-07-14 14:16:21 -06:00
e2a1e6459f Revert changes to Makefile 2025-07-14 14:11:40 -06:00
51383ede3d Update cmake 2025-07-14 13:59:57 -06:00
1a7fdf0ab2 Update Kokkos library in LAMMPS to v4.6.2 2025-07-14 13:53:42 -06:00
37253a21e3 Merge branch 'develop' of github.com:lammps/lammps into feature/batch-snap-ilp 2025-07-14 13:40:37 -06:00
b0ae7f8112 Fix warning by removing parentheses 2025-07-14 13:40:29 -06:00
4ff44d2a2f remove whitespace 2025-07-13 21:38:39 +02:00
4112954399 Improve text and use consistent symbols for the local stress 2025-07-13 21:33:37 +02:00
c6f788df01 missing whitespace 2025-07-13 20:37:11 +03:00
58b367dcdd trailing whitespace 2025-07-13 20:35:53 +03:00
6296d5bab6 typo 2025-07-13 19:56:28 +03:00
5382f9c645 integrate bosonic pimd documentation removed at fcb2eee686 2025-07-13 19:12:11 +03:00
919ef6d369 Merge branch 'develop' into mliap_indexing 2025-07-12 06:39:13 -04:00
88b56e0668 Remove statement without effect 2025-07-12 06:38:21 -04:00
d863b4c55f Merge branch 'develop' into roll-back-neighbor-swap 2025-07-11 21:03:03 -04:00
d34d6b79e3 Merge pull request #4653 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-07-11 21:01:40 -04:00
e58290ee08 small doc update 2025-07-11 19:43:35 -04:00
906e3fd070 port support for per-type masses over from fix neighbor/swap 2025-07-11 19:18:28 -04:00
2a87321554 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2025-07-11 18:47:53 -04:00
47a0fe90ec make Atom::set_mass() as called from pair styles compatible with per-atom masses 2025-07-11 18:47:07 -04:00
363ad54383 make fix neighbor/swap compatible with per-atom masses 2025-07-11 18:45:53 -04:00
7a739d03f6 Merge pull request #4651 from akohlmey/lammps-gui-improvements
LAMMPS-GUI Improvements
2025-07-11 17:41:12 -04:00
0e6991659f Merge branch 'develop' of github.com:lammps/lammps into feature/batch-snap-ilp 2025-07-11 13:09:16 -07:00
9d15c19387 Merge pull request #4642 from evoyiatzis/patch-1
Fix parallel execution of bonds for compute stress/mop and stress/mop/profile
2025-07-11 13:34:11 -04:00
6152906deb Revert "Handle per-atom masses"
This reverts commit 29dc28c615.
2025-07-11 13:01:08 -04:00
29dc28c615 Handle per-atom masses 2025-07-11 10:44:19 -06:00
6d335fb5a6 Fixed assignment of local i in pick_i_swap_atom. i, j should both be owned not ghost atoms on swapping procs 2025-07-11 10:26:36 -06:00
8d4615f96f Fix issues in GNU Makefile build system with KOKKOS package 2025-07-11 09:00:01 -06:00
4a1a932df6 Merge branch 'develop' into patch-1 2025-07-11 15:43:07 +02:00
9b42419446 fix logic bug 2025-07-11 07:09:28 -04:00
1b3ebcc857 account for all large memory allocations 2025-07-11 06:44:55 -04:00
3efdf22850 use memory->create() and memory->destroy() consistently
memory->smalloc() and memory->sfree() are not type-safe
2025-07-11 06:35:53 -04:00
1ff281dd3c make sure i is initialized, use comm->me instead of calling MPI_Comm_rank() 2025-07-11 06:34:47 -04:00
491f5d96b8 id_center should be of type tagint 2025-07-11 06:33:46 -04:00
bc3c85b6a4 re-add fix neighbor/swap doc page 2025-07-11 06:20:57 -04:00
efd0510873 update example outputs 2025-07-11 06:00:34 -04:00
5eb61491f0 Merge branch 'develop' into roll-back-neighbor-swap 2025-07-11 05:54:47 -04:00
192901f6d0 add sanity check to error out when the index picking fails. 2025-07-11 05:54:36 -04:00
4ed5e585c1 silence some warnings, either by changing the code or adding // NOLINT comments 2025-07-11 04:56:13 -04:00
72b5f21c57 correct implementation of restart for fix sprint/chunk 2025-07-11 04:42:38 -04:00
57d4c472a0 Updated pick_i_swap_atom for MPI_Bcast to avoid memory access leak 2025-07-11 02:39:57 -06:00
3e8807bee0 Merge branch 'develop' into collected-small-changes 2025-07-11 00:10:01 -04:00
b751add30b Merge remote-tracking branch 'github/develop' into lammps-gui-improvements 2025-07-11 00:06:52 -04:00
5fc24a8ba3 Merge pull request #4654 from akohlmey/clang-tidy-updates
Apply code modernization suggestions from clang-tidy
2025-07-11 00:06:18 -04:00
fd410779ac silence compiler warnings and apply small corrections 2025-07-11 00:02:53 -04:00
597346413e add 'make upgrade' target to doc makefile to update python packages in docenv 2025-07-10 23:00:16 -04:00
dcd073f8bd add small tweaks to the LAMMPS-GUI banner and how it is shown 2025-07-10 22:42:24 -04:00
440dae924d only restore old paths, if they exist, i.e. we are called from within LAMMPS-GUI 2025-07-10 20:26:02 -04:00
36e6469c9e fully restore original script code 2025-07-10 20:25:22 -04:00
f211c9dae0 comment and jnum variable 2025-07-10 17:48:03 -06:00
acfe419de2 updated ij indexing for mliap ace 2025-07-10 17:04:47 -06:00
74fe512c67 Merge remote-tracking branch 'github/develop' into roll-back-neighbor-swap 2025-07-10 18:29:54 -04:00
3515c5c6be try to suppres clang-tidy warnings 2025-07-10 18:29:28 -04:00
02e60884a3 disable clang-tidy on some code 2025-07-10 17:48:05 -04:00
6ced05927f use using instead of typedef 2025-07-10 17:40:05 -04:00
8807f6aafc disable clang-tidy 2025-07-10 17:32:43 -04:00
216d2b692f define lattice_t with using =, and move definition into the MEAM class scope 2025-07-10 17:25:55 -04:00
0b6444b9e5 replace #define and typedef with using = 2025-07-10 17:20:33 -04:00
8b4c6f7f98 exclude typedef struct from clang-tidy processing 2025-07-10 17:20:13 -04:00
3dba42f62e should use utils::inumeric for integer arguments 2025-07-10 17:08:34 -04:00
93efb0fcb7 disable clang-tidy checking 2025-07-10 17:03:15 -04:00
4f7777cc10 remove most standard C++ class functions, the struct is C-style. 2025-07-10 16:35:24 -04:00
445d10ae5a modernize by replacing C-style typedefs with C++ style using = 2025-07-10 15:58:45 -04:00
cde0d3dcdc another const cast to make the IBM LLVM compiler happy 2025-07-10 15:16:56 -04:00
05c044a712 whitespace 2025-07-10 13:00:45 -06:00
ff58d0319e Fix more issues with compute sna/grid/kk 2025-07-10 12:58:06 -06:00
1aabe28858 use qualified auto and using 2025-07-10 05:54:27 -04:00
90ad9e44f1 cosmetic suggestions from GitHub Copilot 2025-07-10 05:05:37 -04:00
fed5564520 add ticks to range sliders 2025-07-10 04:33:31 -04:00
d5b137c4e3 enable option to open the tutorial webpage for tutorial 8 2025-07-10 04:05:58 -04:00
1c8cf634db fix halt may only reset the timer timeout, if it trigged the timeout itself 2025-07-10 04:05:34 -04:00
61c6d32861 minor doc tweaks for readability 2025-07-10 01:01:41 -04:00
bd4c07772b update docs and screen shot 2025-07-10 00:50:19 -04:00
c70bda0cd2 add a couple horizontal separator lines 2025-07-10 00:44:05 -04:00
e517ee25d5 avoid uninitialized access to normflag 2025-07-10 00:43:39 -04:00
cfae257f8f fix typo 2025-07-10 00:12:48 -04:00
8a8a3228f3 avoid crashes when switching to a new file or a new empty document and close all windows 2025-07-10 00:10:18 -04:00
23343d5e5c add tooltips 2025-07-10 00:09:27 -04:00
2a25ce9d6e spelling a re-wrap 2025-07-10 00:09:10 -04:00
31ede566e9 intergrate the rest of simon's suggestions 2025-07-10 00:08:52 -04:00
35fcf5775c hack trying to appease macOS 2025-07-09 23:16:34 -04:00
054939bb23 Merge remote-tracking branch 'github/develop' into lammps-gui-improvements 2025-07-09 22:22:42 -04:00
a2971c5e42 Merge pull request #4650 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-07-09 22:21:58 -04:00
ecfe7046e3 add rangeslider to chart window to plot subsets of data 2025-07-09 22:17:50 -04:00
9f11057b47 Revert "add stop button to chart display"
This reverts commit 1bb746aa87.
2025-07-09 21:29:31 -04:00
1bb746aa87 add stop button to chart display 2025-07-09 21:18:40 -04:00
7a98929a67 add rangeslider custom widget 2025-07-09 21:18:27 -04:00
a0b5e8ff73 refactor chart viewer title line. Now has two rows. display units and thermo norm 2025-07-09 20:08:24 -04:00
e09a87d121 remove rubberband feature since undoing the zoom doesn't work properly 2025-07-09 16:40:05 -04:00
0c8ac043e6 Merge branch 'develop' into collected-small-changes 2025-07-09 10:43:32 -04:00
6fef2326d6 Merge pull request #4649 from akohlmey/use-qualified-auto
Use qualified auto for improved readability
2025-07-09 10:42:00 -04:00
dec1fd2b92 apply and edit some changes suggested by @simongravelle 2025-07-09 10:41:08 -04:00
8f50f4fc96 Merge pull request #4638 from stanmoore1/backport_bugfixes
Backport bugfixes from #4608
2025-07-09 09:07:51 -04:00
c5c409062c Remove unused vars 2025-07-08 17:26:28 -06:00
a9c3eb5206 whitespace 2025-07-08 16:40:50 -06:00
cfe813c963 Fix bugs in Kokkos compute sna/grid 2025-07-08 16:16:47 -06:00
7ac03b6c9e fix crash on trying to free a NULL communicator 2025-07-08 16:17:48 -04:00
0cd2dac112 set LAMMPS-GUI version number to 1.7 2025-07-08 08:42:50 -04:00
711886034a to update the time stamp on the app bundle purge it during configure 2025-07-08 08:19:01 -04:00
6387689979 redesign the General settings preference tab and add defaults for tutorial buttons 2025-07-08 06:41:11 -04:00
b500c879f5 must use recursive delete on app bundle folder 2025-07-08 04:50:25 -04:00
4d9861e6a2 automatically quit the entire application when closing the editor window
avoid crashes and segfaults when simulation is still running
2025-07-08 04:40:44 -04:00
8aaf77c271 there is not much meaning in completing capture in the destructor.
the user should have already called EndCapture() if needed.
calling it in the destructor just causes memory corruption.
2025-07-08 04:34:41 -04:00
ace1b8026c must use a platform specific copy command 2025-07-08 03:01:16 -04:00
2b8b84788b fix grammar and reformat 2025-07-08 02:09:30 -04:00
7a2c051b69 delete app bundle folder. It will be recreated by macdeplotqt. 2025-07-07 21:35:54 -04:00
5ec4a6bd2e prevent using Restart LAMMPS while running and rename to Relaunch LAMMPS 2025-07-07 21:24:32 -04:00
4b2a04aab8 document Relaunch LAMMPS Instance 2025-07-07 21:21:16 -04:00
fd98ef2a59 fix typo 2025-07-07 20:22:06 -04:00
892c969ee6 save and restore PATH and LD_LIBRARY_PATH, so that xdg-open can launch a native executable 2025-07-07 20:21:54 -04:00
fd86feae7f Merge branch 'develop' into backport_bugfixes 2025-07-07 13:45:51 -06:00
a2439038c6 Fix issue with Kokkos SNAP on GPUs 2025-07-07 12:44:01 -06:00
0502d421b0 must use error->one() since only rank 0 is active at this point 2025-07-07 12:36:01 -04:00
1dc8c2d9a2 add a timeout option to the geturl command and set a default of 5 mins
the library default is to wait forever. Also the limit for connecting
was reduced to 30 seconds from 300.
2025-07-07 11:24:14 -04:00
5a158d59b4 small tweaks to error message boxes 2025-07-07 11:00:17 -04:00
25556a1bc1 add unit tests for additional conditions for splitting strings 2025-07-07 07:10:22 -04:00
adc202bd71 simplify 2025-07-07 06:39:15 -04:00
e4f9874974 simplify 2025-07-07 06:37:55 -04:00
adead22aef align with common conventions for pages documenting multiple similar styles 2025-07-07 05:46:25 -04:00
40b510c2c2 avoid crash when splitting line with incomplete quoting into words 2025-07-07 05:45:48 -04:00
ea939f6355 update changelog 2025-07-07 05:44:23 -04:00
477c3524b9 must clear variables before starting a new run since "clear" does not delete them 2025-07-07 05:38:57 -04:00
806000c9ee avoid crash from out-of-range access to string for partially quoted text 2025-07-07 05:18:01 -04:00
ddfc3f2d0b fix typo 2025-07-07 03:50:47 -04:00
9f0551104a display new LAMMPS-GUI banner image in docs and empty editor windows 2025-07-07 03:38:19 -04:00
a239e2b900 make sure these variables are always initialized 2025-07-06 14:03:50 -04:00
916655e382 use using 2025-07-06 13:57:28 -04:00
8ba1b9b122 use bool literals instead of integer constants 2025-07-06 13:57:19 -04:00
eaa3159c7f reorder initializer 2025-07-06 13:57:04 -04:00
fbf8856978 Mention LAMMPS-GUI as an example application for liblammpsplugin.h/.c 2025-07-06 13:41:16 -04:00
8e75c387ec modernize 2025-07-06 13:40:33 -04:00
72d73c4c45 remove unused class member and dead code 2025-07-06 13:05:36 -04:00
cdded2d51c improve error message 2025-07-06 05:25:03 -04:00
0d973d5a80 remove dead code and apply changes for clean compilation w/o OpenMP 2025-07-06 05:18:40 -04:00
449c59cf49 implement suggestion from GitHub CoPilot to make code consistent and simpler 2025-07-06 04:51:18 -04:00
1bf8f51664 add missing screenshot 2025-07-06 03:57:24 -04:00
50d15cded3 make precedence explicit 2025-07-06 03:18:46 -04:00
6722e55d5e should include C-math header since we use round() 2025-07-06 03:12:05 -04:00
44922cea16 show warning dialog at end of run, if I/O buffer usage was very high 2025-07-06 03:07:35 -04:00
da8ce40ffd track buffer usage and add API to query the maximum buffer use ratio 2025-07-06 03:05:46 -04:00
64080dce3e reduce overhead and avoid stalling by increasing the pipe buffer from 1k to the maximum of 64k 2025-07-06 01:25:08 -04:00
2d9f244c6c update LAMMPS-GUI documentation for most recent changes 2025-07-06 00:01:42 -04:00
01aa952968 update help index 2025-07-05 23:13:17 -04:00
7a74cad978 Merge remote-tracking branch 'github/develop' into lammps-gui-improvements 2025-07-05 23:11:32 -04:00
dd484cbde5 small improvements suggested by GitHub Copilot 2025-07-05 23:10:43 -04:00
1d377a1f26 add a CPU usage percentage indicator to the status bar 2025-07-05 19:49:32 -04:00
38d4c58115 support setting intel precision and gpu neigh and pair/only from preferences 2025-07-05 18:42:45 -04:00
ddc10064a2 set LAMMPS-GUI version to 1.6.15 2025-07-05 18:41:18 -04:00
e40d9c0eb2 resolve hotkey conflict for selecting GPU accelerator package 2025-07-05 14:08:42 -04:00
7863df8a76 update nthreads text field when accelerator is selected
the text is reset to 1 and editing disabled for None and Opt
2025-07-05 13:25:46 -04:00
2d8f3aaede document short-circuiting for ternary() variable function 2025-07-05 12:27:09 -04:00
b3eaf7e7f4 cache spcpu and tpcpu values so these thermo keywords can be used multiple times 2025-07-05 11:57:59 -04:00
7505ae3628 make handling of threads and accelerator selection more consistent, also buffer length 2025-07-05 10:49:22 -04:00
cbfedda573 only reset cached thermo data if first run or thermo style changed
this preserves last data from previous run for properties that are zero on the first step
2025-07-05 08:32:56 -04:00
8fbaf43319 make sphinx happy 2025-07-04 19:50:01 -04:00
1bf9fac5bb Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-07-04 19:49:10 -04:00
276a6dcaa3 Merge remote-tracking branch 'github/develop' into patch-1 2025-07-04 19:44:25 -04:00
d20ef0d734 modify processing of ternary() so that only the first and one of the other arguments are evaluated 2025-07-04 19:09:52 -04:00
a85906236c fix typo 2025-07-04 18:14:08 -04:00
7ce7990bf9 Merge remote-tracking branch 'github/develop' into roll-back-neighbor-swap 2025-07-04 18:11:34 -04:00
b11c549dbd remove "fixed" comments, small stype updates 2025-07-04 18:09:57 -04:00
3dc92f8cc4 update handling of threads. make nthreads and LammpsGui class member 2025-07-04 17:46:51 -04:00
80b41eea9d Fixed cleanup TODO and tested functionality. MPI memory leak remains. 2025-07-04 15:39:22 -06:00
6795a2a066 Merge pull request #4019 from draneyj/develop
add hybrid monte carlo fix
2025-07-04 17:27:19 -04:00
70ba11e6bc small performance optimization by using std::move() 2025-07-04 17:12:48 -04:00
5fa2b88011 fix unlikely memory leaks 2025-07-04 17:12:27 -04:00
d34fc34e7b small optimization by using std::move() 2025-07-04 17:05:10 -04:00
553f2e0507 use move semantics 2025-07-04 17:00:28 -04:00
3218ad7c2a try to optimize by using emplace back 2025-07-04 17:00:18 -04:00
da0de5b81c guarantee that class members are not accessed uninitialized 2025-07-04 16:59:50 -04:00
a96d1f6363 tweak message to remain compatible with derived classes calling the same function 2025-07-04 16:30:13 -04:00
459bce40ad move constants from header to implementation, replace defines, and remove unused ones 2025-07-04 16:29:54 -04:00
602dd3b81b improve errors. add warning if non-nve time integration is used w/o rigid 2025-07-04 16:17:22 -04:00
479f7b9c1e spelling and add missing reference declarations to citations 2025-07-04 16:12:59 -04:00
d01478b2b1 remove one too many static added 2025-07-04 11:36:07 -04:00
d587e49403 add further guidance to documentation 2025-07-04 10:16:23 -04:00
3b6dbe6344 use qualified auto 2025-07-04 07:09:51 -04:00
ff3159cc76 use qualified auto 2025-07-04 07:02:07 -04:00
0ac62fdb28 flag statements and sections of code that we don't want to modernize 2025-07-04 06:58:37 -04:00
1462165b36 using macro instead of c++ function for nested min() 2025-07-04 06:46:05 -04:00
9b90b68e35 use using instead of typedef 2025-07-04 06:44:56 -04:00
fc6a643e53 make local functions static so their symbols are not exported 2025-07-04 06:26:12 -04:00
437e19c968 remove unused "using" statements 2025-07-04 06:08:25 -04:00
b0757e71ef Merge branch 'lammps:develop' into patch-1 2025-07-04 11:21:29 +02:00
03345a5999 improve errors 2025-07-04 05:10:45 -04:00
9a7c08c7e9 delete is safe for null pointers 2025-07-04 05:10:30 -04:00
c6c7131088 make constexpr and static 2025-07-04 05:09:44 -04:00
0e03822d59 hide global variables in anonymous namespace 2025-07-04 05:09:25 -04:00
68c2085f7a improve errors 2025-07-04 05:09:00 -04:00
281483bb25 don't truncate bigint to int 2025-07-04 05:08:44 -04:00
86731f99f6 new thermo keyword cpuuse for %CPU utilization 2025-07-04 04:40:28 -04:00
fedf0949db make some thermo settings accessible 2025-07-04 04:12:26 -04:00
d93002af6c improve error messages 2025-07-03 19:47:29 -04:00
31f1438a04 whitespace 2025-07-03 18:08:16 -04:00
d5f15d9151 Merge branch 'develop' into draneyj/develop 2025-07-03 18:07:18 -04:00
eb2600e05d clarify documentation 2025-07-03 17:23:24 -04:00
49bac65477 Merge branch 'develop' into improve-tests-for-set 2025-07-03 17:01:31 -04:00
78809d8f16 Merge pull request #4646 from akohlmey/lammps-gui-avoid-plot-slowdown
Reduce Impact of LAMMPS-GUI ChartViewer Performance Regression and Apply clang-tidy Fixes
2025-07-03 16:56:56 -04:00
acb2cbaaee update example log files 2025-07-03 14:38:46 -06:00
c69d95fd31 Merge branch 'develop' into patch-1 2025-07-03 23:07:12 +03:00
4bf7191833 whitespace 2025-07-03 15:48:01 -04:00
2cc7e0d1a4 fix handling cases with flags enabled but no potentials defined 2025-07-03 22:46:11 +03:00
df20f1f3fd update and relax epsilon ARM64 2025-07-03 15:45:04 -04:00
7ccaa18543 Merge branch 'develop' into lammps-gui-avoid-plot-slowdown 2025-07-03 15:40:28 -04:00
65f822ce72 plug memory leaks 2025-07-03 15:25:37 -04:00
a4e536e584 Merge pull request #4637 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-07-03 15:12:38 -04:00
ac182284dd memory management matching comm classes 2025-07-03 14:09:07 -04:00
07567a6cc6 change defaults 2025-07-03 10:46:21 -04:00
9fd39a0657 add OpenMP parallelization to smoothing loop 2025-07-03 10:29:37 -04:00
466ffd82a3 add missing weblink 2025-07-03 09:17:39 -04:00
2c8c2bf278 rewrite based on suggestions from @simongravelle 2025-07-03 09:17:24 -04:00
04b5f042d2 Merge branch 'develop' into improve-tests-for-set 2025-07-03 05:42:23 -04:00
e999aaf4f3 Merge remote-tracking branch 'github/develop' into lammps-gui-avoid-plot-slowdown 2025-07-03 05:40:14 -04:00
c5e153ae29 update help index for recently added commands 2025-07-03 05:30:14 -04:00
c1f505f15f apply fixes suggested by GitHub Copilot 2025-07-03 05:24:02 -04:00
5118e38418 update changelog 2025-07-03 04:42:35 -04:00
6c709043b2 fix a couple bugs in processing special bonds JSON data for molecules 2025-07-03 04:27:44 -04:00
5ccbedb3c9 recover compilation when loading LAMMPS library dynamically 2025-07-03 03:46:17 -04:00
b45b6a74d1 improve and modernize using clang-tidy 2025-07-03 03:38:48 -04:00
436af21334 use qualified auto 2025-07-02 23:19:30 -04:00
b19e84541a update change log 2025-07-02 23:00:00 -04:00
4316267cc8 modernize calc_sgsmooth() and related functions and classes 2025-07-02 22:57:39 -04:00
705fc2aaf7 improve formatting of "about" text when LAMMPS is running. 2025-07-02 22:42:36 -04:00
98fd8e5f56 small performance tweak and make compatible with QT 5.12.x on Ubuntu 20.04LTS 2025-07-02 22:36:27 -04:00
a17aeca1ee discuss slowdown of simulations with too frequent thermo output and enabled smoothing 2025-07-02 22:11:24 -04:00
dfdac70dc6 speed up smoothed data series updates by avoiding append. 2025-07-02 22:10:47 -04:00
9994608532 we get better multi-thread performance without processor affinity 2025-07-02 22:05:58 -04:00
3334267265 fix example 2025-07-02 20:47:19 -04:00
875ac608a6 Only plot raw data in chartviewer by default.
Smoothing can slow down simulations with frequent thermo output or long runs.
One can always switch to smoothed or both outputs after the run (and back).
2025-07-02 20:27:48 -04:00
87a5898696 add domain calls 2025-07-02 19:54:05 -04:00
76d6117c6f add tests for fix set to tests for changing types and charges 2025-07-02 18:38:37 -04:00
f0620006f0 add explicit comm exchange 2025-07-02 18:03:02 -04:00
ba5d1b80d7 fix valgrind complaints 2025-07-02 17:51:38 -04:00
9741952ad5 ensure that flags are initialized across classes. use more C++ style variable declarations 2025-07-02 17:22:22 -04:00
a49c747519 simplify and make compatible with larger systems. 2025-07-02 17:09:05 -04:00
2f5d51e7cd cosmetic tweaks and generate log files 2025-07-02 15:02:32 -06:00
d9d5a4d8ec must use Error::one() when only on one MPI rank 2025-07-02 07:33:35 -04:00
e7a124206a add example command line for using install.py manually 2025-07-02 07:32:26 -04:00
3f92bad7f5 update description of using install.py to be more specific. mention -w flag 2025-07-01 09:29:07 -04:00
a1261a54c3 randomize solvent velocities as well when fix rigid enabled 2025-07-01 09:28:33 -04:00
74ed5134b3 no longer need to check for tags 2025-07-01 09:27:52 -04:00
004267c6ec fixed documentation 2025-07-01 09:26:52 -04:00
f7b911181e fix for parallel angle and dihedral stress calculation 2025-07-01 14:13:30 +02:00
acbdceb087 replace typedef with using 2025-06-30 23:32:58 -04:00
42e7b801d4 update code for default destructors 2025-06-30 23:32:32 -04:00
a79b945128 add explicit scope when calling virtual functions inside constructor or destructor
virtual dispatch is not available in those cases
2025-06-30 22:55:22 -04:00
b972821896 Merge branch 'develop' of github.com:lammps/lammps into backport_bugfixes 2025-06-30 20:51:38 -06:00
cb52abd965 no need for std::move on a const reference. used auto 2025-06-30 22:36:22 -04:00
d4eb800739 remove redundant static qualifiers 2025-06-30 22:32:21 -04:00
60b9fdf897 improve error messages 2025-06-30 22:17:51 -04:00
a2054657c7 determine argument offset value to be used with error pointers 2025-06-30 22:14:24 -04:00
3cf9b018a7 make certain that variables are initialized before used 2025-06-30 21:06:36 -04:00
f5c31f9df2 remove erroneous comm_forward = 12 2025-06-30 18:24:54 -04:00
5143423e92 remove old log files 2025-06-30 18:17:57 -04:00
97653e2626 fix examples 2025-06-30 18:16:30 -04:00
57fda06ecd ensure fix_rigid images are correct after false exchange 2025-06-30 17:09:34 -04:00
fff0b62aad track KE when momenta aren't resampled 2025-06-30 17:06:06 -04:00
de41dd53b2 make enum use consistent by moving it to the header 2025-06-30 16:31:53 -04:00
de97c8acdd correct function names 2025-06-30 16:09:34 -04:00
f547ddd2e9 fix a couple more cut-n-paste bugs 2025-06-30 15:55:56 -04:00
e6673ca64d remove redundant comparison 2025-06-30 15:37:19 -04:00
3e7f52ea91 fix bug detected by static code analysis 2025-06-30 15:27:33 -04:00
792d0e4d84 use anonymous namespace 2025-06-30 15:20:17 -04:00
e5374ce8e5 refactor/modernize handling of internal fixes in pair styles srp and srp/react 2025-06-30 14:42:08 -04:00
58a911c6a0 update use of const for known keywords 2025-06-30 10:07:27 -04:00
e74aeafbfb remove whitespace from compute_stress_mop_profile.cpp 2025-06-30 16:01:32 +02:00
1d3030023f use qualified auto and improve errors 2025-06-30 09:52:11 -04:00
f1215e904a replace typedef with using 2025-06-30 09:46:22 -04:00
85f1eebd73 modernize by using anonymous namespace 2025-06-30 09:45:15 -04:00
0f5d18917c Fix bond contributions to compute stress/mop/profile 2025-06-30 15:35:03 +02:00
23f941e0bb Fix parallel execution of bonds for compute stress/mop 2025-06-30 15:27:15 +02:00
22ec573638 avoid uninitialized access, remove commented out code 2025-06-30 09:00:06 -04:00
7c35e8407c avoid uninitialized access 2025-06-29 23:14:55 -04:00
4680fa669c relax epsilon to pass tests on macOS 2025-06-29 22:40:52 -04:00
3ae21e0bfb Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-06-29 22:32:43 -04:00
63fcdb6e52 Merge pull request #4634 from akohlmey/static-analysis-updates
Updates for LAMMPS from static code analysis
2025-06-29 22:25:15 -04:00
cd44539429 modernize by using anonymous namespace 2025-06-29 19:56:42 -04:00
47332f8e46 no need to make member const 2025-06-29 19:28:00 -04:00
fee96bc777 make double to bool/int/tagint conversions explicit 2025-06-29 19:10:29 -04:00
b279ba9a40 follow one definition rule by moving functions into class definition 2025-06-29 18:47:40 -04:00
087b9a3b6e bugfix for improper style class2/kk taken from PR 4593
passes unit test for Kokkos/OpenMP
2025-06-29 18:18:24 -04:00
5a468fc05c Merge branch 'develop' into backport_bugfixes 2025-06-29 18:11:13 -04:00
9b378fadf4 Merge branch 'develop' into collected-small-changes 2025-06-29 02:41:19 -04:00
ed712e053f recognize a couple more Windows build numbers 2025-06-28 09:55:20 -04:00
0c68c4d493 Merge pull request #4636 from wapisani/fix_bond_create_inter_intra
Add support for inter-/intra-molecular bonding to fix bond/create
2025-06-28 09:43:54 -04:00
3e12c3f773 flag move constructor and swap operator as noexcept for performance 2025-06-28 05:21:25 -04:00
7bc86899b3 type fixes and error message updates 2025-06-28 05:20:49 -04:00
ac7013432b don't use double as boolean, use qualified auto 2025-06-28 04:48:47 -04:00
039fb94faa improve errors and apply clang-format 2025-06-28 04:45:02 -04:00
8c64b2090f process tilt parameters correctly and consistent with FixNH class 2025-06-28 04:38:10 -04:00
77417e2223 use correct type 2025-06-28 04:37:24 -04:00
2e4f29c900 use correct type and converions function 2025-06-28 04:24:46 -04:00
8dae514e03 use correct types 2025-06-28 04:06:36 -04:00
22a42446d3 tap_flag is integer and thus we should use utils::inumeric() 2025-06-28 03:58:27 -04:00
2968bfa8d9 nsvector_total should be an int 2025-06-28 03:53:34 -04:00
669f60b692 use qualified auto and avoid redundant types 2025-06-28 03:51:09 -04:00
1bdf30103f used correct type parser and make conversions explicit 2025-06-28 03:50:51 -04:00
4992caed95 more modernization of DIFFRACTION package 2025-06-28 03:37:42 -04:00
f425f2ab26 modernize 2025-06-28 03:30:10 -04:00
309e374867 use utils::inumeric() for parsing integers, using qualified auto 2025-06-28 03:19:17 -04:00
d5a344a5c8 modernize 2025-06-28 03:18:52 -04:00
481749dc35 modernize argument processing and error messages 2025-06-28 03:07:17 -04:00
14b1241db2 use utils::inumeric() for reading integer arguments 2025-06-28 03:05:03 -04:00
4d26bd5fd5 ndouble is an int 2025-06-28 03:04:44 -04:00
5fe4c9149f use qualified auto 2025-06-28 03:04:33 -04:00
a24aeb3fc6 icut, jcut should be doubles 2025-06-28 03:04:23 -04:00
0cd4ea4d04 don't use doubles as boolean 2025-06-28 02:34:58 -04:00
8726deb9b6 newton_bond is int not double 2025-06-28 02:34:39 -04:00
46561f57bd use utils::inumeric() to parse integers 2025-06-28 02:34:22 -04:00
aacc30c4d7 no benefit from declaring _tid const 2025-06-28 02:33:55 -04:00
2833b7adbd make cast to double explicit 2025-06-28 02:33:38 -04:00
11c4a8b49c use math.h function without std:: prefix 2025-06-28 02:22:25 -04:00
c28869124b don't truncate cuberoot to single precision 2025-06-28 02:22:09 -04:00
bd98354691 make cast to double precision explicit 2025-06-28 02:17:25 -04:00
109aec74ea remove one more implicit truncation of precision. update unit test again. 2025-06-28 02:06:49 -04:00
588ed11e85 avoid comparison with different signedness 2025-06-28 02:01:48 -04:00
be5602c44f apply clang-format 2025-06-28 02:01:32 -04:00
e78d85725b convert to internal linkage with anonymous namespace 2025-06-28 02:01:23 -04:00
1b36451f6a modernize. turn static inline into just inline 2025-06-27 23:58:11 -04:00
d168de00db silence compiler warnings 2025-06-27 23:57:37 -04:00
0c6ce8f23c fix typo 2025-06-27 23:27:44 -04:00
3ffe858a8b remove dead code and protect from neighbor list with special neighbors
this addresses most of issue #4639
2025-06-27 23:25:15 -04:00
c279d194dc be paranoid about invalid molecule templates 2025-06-27 22:47:50 -04:00
6b58058bca memory is accumulated in doubles not ints 2025-06-27 22:38:48 -04:00
0b73966a23 avoid unneeded copies by using const references where allowed 2025-06-27 22:36:23 -04:00
5cecfb5c4d use explicit type cast 2025-06-27 22:20:41 -04:00
d2d613c8b4 bugfix: incorrect application of abs() to doubles
@jtclemm this looks like a real bug.
Can you please check how much of an impact this change has?
2025-06-27 22:20:32 -04:00
8ddd474145 use qualified auto, make implicit type casts explicit 2025-06-27 22:13:44 -04:00
a8fe7e9252 modernize 2025-06-27 22:13:16 -04:00
3dd0971aeb update unit test reference 2025-06-27 22:06:09 -04:00
888543ce6d improve loopup accuracy 2025-06-27 22:05:40 -04:00
58e67e95f8 Merge remote-tracking branch 'github/develop' into static-analysis-updates 2025-06-27 21:48:40 -04:00
e41fb67903 update unit tests for changes to tabulated coulomb 2025-06-27 21:48:03 -04:00
a8d4666233 more accurate processing of coulomb tables through explicit type casts 2025-06-27 21:47:53 -04:00
4397a62be9 Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-06-27 18:59:45 -04:00
575411c92c Merge pull request #4580 from stanmoore1/kk_update_4.6.1
Update Kokkos library in LAMMPS to v4.6.1
2025-06-27 15:05:16 -04:00
e139d935ab missed one conversion to general fix style 2025-06-27 14:26:16 -04:00
786f113d3e whitespace 2025-06-27 14:24:11 -04:00
6052744175 modernize error messages 2025-06-27 14:21:42 -04:00
d1ea7fa678 Small tweak from @cjknight for Aurora performance 2025-06-27 10:11:09 -06:00
bfb26e7ee0 Merge branch 'develop' of github.com:lammps/lammps into feature/batch-snap-ilp 2025-06-27 10:06:28 -06:00
bfd027e806 Fix compile error 2025-06-27 10:01:23 -06:00
f1d19c96cb Merge branch 'develop' of github.com:lammps/lammps into kk_update_4.6.1 2025-06-27 09:50:48 -06:00
afb427a94d Fix GPU/CPU data transfer issues 2025-06-27 09:37:31 -06:00
f090a63536 Fix more data issues 2025-06-27 09:31:18 -06:00
339c570b3e Fix Kokkos MLIAP data transfer issues on GPUs 2025-06-27 09:30:03 -06:00
07eeb6c5f9 add note about compile failure 2025-06-27 09:41:46 -04:00
a02eff6e40 document removal of Error::message() 2025-06-26 18:47:39 -04:00
77ea2b3af0 update unit tests for missing error->message() 2025-06-26 18:37:44 -04:00
7d7327e706 recommend to install the release version of gcovr 2025-06-26 18:29:17 -04:00
2bf03dbcdf apply clang-format 2025-06-26 18:28:59 -04:00
82c2bfe47c remove message() from Error class as it is superseded by utils::logmesg()
Also fix the few remaining cases to used utils::logmesg()
2025-06-26 18:27:09 -04:00
7b79382fa7 Update fix_bond_create.rst with inter/intra-molecular bonding info 2025-06-26 15:24:31 -05:00
a4121d44a2 Added molecule_keyword
Associated with the inter/intra-molecular bonding change
2025-06-26 15:12:10 -05:00
d5e938f949 Added support for inter/intra-molecular bonding
Copy over inter/intra-molecular bonding from fix bond/react
2025-06-26 15:10:19 -05:00
8095b9eec0 use qualified auto 2025-06-26 14:49:56 -04:00
bf1ad04555 don't use floating point as boolean 2025-06-26 14:49:47 -04:00
4a58be05fa simplify 2025-06-26 14:42:13 -04:00
f763420c53 use qualified auto 2025-06-26 01:06:27 -04:00
fe7bdf5941 make destructor virtual 2025-06-26 01:06:16 -04:00
ed279cb9f9 fix up more cases where floating point numbers were used as boolean 2025-06-26 00:59:02 -04:00
5ad24fc733 restore old version and add comment why it cannot be modernized 2025-06-26 00:22:59 -04:00
4309666fa2 remove exception qualifier 2025-06-26 00:11:29 -04:00
3c13eebcb2 must use override instead of virtual 2025-06-25 23:56:25 -04:00
e24b329e1b avoid unnecessary string copies as parameters 2025-06-25 23:51:22 -04:00
3e9560190c don't use floating point numbers as booleans 2025-06-25 23:48:06 -04:00
7597a227f4 modernize: replace typedef with using, use = default for default members 2025-06-25 23:39:38 -04:00
2a3afae3ff modernize: use range based loop and .data() of containers 2025-06-25 23:39:03 -04:00
ad8d722c68 use C++11 style initializer 2025-06-25 23:19:08 -04:00
1906444a1d use utils::inumeric() for integers and use qualified auto 2025-06-25 23:16:17 -04:00
de46b3b8bf modernize in colvars package 2025-06-25 23:11:26 -04:00
e9b5e55f18 used .data() to access underlying raw data of container 2025-06-25 20:22:30 -04:00
96d1704b8e need another epsilon relaxation 2025-06-25 20:21:23 -04:00
9cc2638c91 modernize code 2025-06-25 20:02:41 -04:00
b093094d5e avoid copying vectors as arguments and pass a const reference instead 2025-06-25 19:57:05 -04:00
7d86d7f89a use 'const int' instead of 'int const' to be consistent with the rest of LAMMPS 2025-06-25 19:56:59 -04:00
202aeaf1a5 remove redundant return statements at the end of functions returning void 2025-06-25 19:46:46 -04:00
fce4006fda address minor memory management issues 2025-06-25 19:46:15 -04:00
6934a31878 relax epsilon again to pass test on macOS 2025-06-25 19:30:19 -04:00
cb9b0cdaf2 update unit test and its epsilon due to removal of single precision math in pair style 2025-06-25 19:01:18 -04:00
c1665cd378 convert to double directly 2025-06-25 18:50:08 -04:00
03067d0059 promote constants to double to avoid float/double conversions 2025-06-25 18:47:23 -04:00
f6befb18ae follow LAMMPS programming style more closely 2025-06-25 18:41:26 -04:00
5711acc9ef avoid float/double conversions but convert directly to double 2025-06-25 18:41:08 -04:00
dcd521e9c6 fix static code analysis issues in Info class 2025-06-25 12:43:05 -04:00
80758cef2d make Param args const 2025-06-25 12:12:53 -04:00
4bd0258bfd add more casts to double for table lookup 2025-06-25 12:12:07 -04:00
5d3a080db7 Merge remote-tracking branch 'github/develop' into static-analysis-updates 2025-06-25 11:20:44 -04:00
b7be53f3fc Merge pull request #4633 from jtclemm/rheo
Fixes to RHEO package
2025-06-25 11:18:27 -04:00
7e3c61b831 use explicit typecase in coulomb table lookup in a few more cases 2025-06-25 07:28:05 -04:00
4e28af6219 move typecast to the proper position to avoid implicit type conversion 2025-06-25 07:14:46 -04:00
dba24555d1 fully unroll loop 2025-06-25 06:58:15 -04:00
fdc3f50298 correct API leading to undesired int/double conversions, remove dead code 2025-06-25 06:54:13 -04:00
af81f944d7 must revert changes due to broken GCC in Rocky/CentOS/RHEL 8.x 2025-06-25 06:48:16 -04:00
5b10e2f653 make exception settings consistent 2025-06-25 06:27:49 -04:00
a03d2a66c9 recover compilation of INTEL package 2025-06-25 01:00:35 -04:00
9fbb49f401 use qualified auto 2025-06-25 00:46:11 -04:00
d4ba431117 use nullptr instead of NULL 2025-06-25 00:31:44 -04:00
b0dd929b6d add missing overrides 2025-06-25 00:31:33 -04:00
3b1f639ddf add default constructor and default virtual destructor 2025-06-25 00:17:52 -04:00
a92fa56a3e formatting 2025-06-25 00:17:30 -04:00
8ca9aafff2 remove prototype of non-existing member function 2025-06-25 00:17:18 -04:00
e84c6743d9 must use utils::inumeric() for integers 2025-06-25 00:16:55 -04:00
8a04b9c498 remove redundant typecast 2025-06-25 00:16:14 -04:00
7edf4e567f remove redundant void function argument 2025-06-24 23:53:23 -04:00
656ea3569e use qualified auto 2025-06-24 23:53:09 -04:00
b672c30428 add missing overrides and format them consistently 2025-06-24 23:52:59 -04:00
337fca1305 use using instead of typedef 2025-06-24 23:51:59 -04:00
29651c4bb1 we're parsing an integer here 2025-06-24 23:29:19 -04:00
54eed8af02 .c_str() is not needed here 2025-06-24 23:28:53 -04:00
92ccbd13a5 correctly apply override 2025-06-24 23:28:32 -04:00
766a07c5d4 use explicit cast to double when promoting float lookup value from coulomb table 2025-06-24 23:24:32 -04:00
278cc0a039 replace implicit bool on floating point number with explicit comparison
also re-indent for consistency
2025-06-24 23:20:49 -04:00
33cc2117c6 use qualified auto 2025-06-24 23:19:57 -04:00
57ec008a66 use qualified auto 2025-06-24 22:52:29 -04:00
230121c2c7 make use of override consistent 2025-06-24 22:48:44 -04:00
f5d54a825f use qualified auto 2025-06-24 22:48:31 -04:00
61bfc38961 use explicit scope since virtual tables are not active yet 2025-06-24 22:48:01 -04:00
0cd6c5c3ec remove dead code 2025-06-24 22:36:51 -04:00
c242294227 use auto for redundant type specification 2025-06-24 22:36:39 -04:00
bf90e9b03e must used override 2025-06-24 22:35:43 -04:00
af9a3d933b make consistent for both branches 2025-06-24 22:15:04 -04:00
687e1ddb53 consolidate procs2grid2d implementation and initialization before call 2025-06-24 22:02:52 -04:00
03611c95ae improve error messages 2025-06-24 20:38:29 -04:00
db244166ca Merge branch 'develop' into rheo 2025-06-24 20:29:18 -04:00
8dad9a0f68 Merge pull request #4630 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-06-24 20:17:41 -04:00
08d81a5ac2 Correcting simple variable type mistake 2025-06-24 12:08:54 -06:00
938f7fa0ef remove clang-tidy support from CMake since we now run this automatically 2025-06-24 07:49:57 -04:00
63c9987ec8 make scope explicit since virtual tables are not set up in constructor 2025-06-24 06:13:13 -04:00
d0c460e7f7 flag move constructor and swap function as noexcept for improved performance 2025-06-24 06:12:49 -04:00
e8780449d8 remove redundant part from logical expressions 2025-06-24 05:47:36 -04:00
df04fc943d make implicit boolean conversions explicit 2025-06-24 05:47:05 -04:00
264750e47c no need to run sphinx-build twice after updating sphinxfortran extension from upstream 2025-06-24 00:41:10 -04:00
b61410bde0 some additional explanations for neighbor boost single error 2025-06-24 00:16:00 -04:00
80fbdceff2 reformate for improved readability and make some updates due to changes in the code 2025-06-24 00:09:46 -04:00
24b15f7e46 add false positives 2025-06-24 00:09:18 -04:00
e45299f620 must load numpy into docenv to correctly process python numpy wrapper docs 2025-06-24 00:09:09 -04:00
179cce90bc use C++11 style of disabling constructors 2025-06-23 23:20:26 -04:00
8c12ab5db0 update a few more rounding cases with std::lround() 2025-06-23 23:17:14 -04:00
f7f5a3e3e4 replace static_cast<int>(val + 0.5) with C++11's std::lround() 2025-06-23 23:07:13 -04:00
7e3d6026d4 Restoring rheo options to set 2025-06-23 20:53:51 -06:00
d5d8887eb9 improve error messages 2025-06-23 22:49:17 -04:00
56f839f2e1 replace custom nint() function with C++11's std::lround() 2025-06-23 22:49:06 -04:00
a7b7be26dc improve errors 2025-06-23 22:42:48 -04:00
50ba0e577e cast to double before printing 2025-06-23 22:37:27 -04:00
727c0b251a Clarifying exception in fix deform doc 2025-06-23 20:35:53 -06:00
b94c41c05a Fixing some static code analysis issues in RHEO 2025-06-23 20:35:36 -06:00
e9a578a212 t status
Merge branch 'develop' into rheo
2025-06-23 19:50:29 -06:00
750e663be8 try to suppress false positive from static code analysis (natom is always > 0) 2025-06-23 19:21:00 -04:00
8305c97b69 address some issues flagged by static code analysis 2025-06-23 19:20:32 -04:00
8cf24edc21 improve error messages and suppress static code analysis warnings 2025-06-23 19:20:00 -04:00
249c6d6de9 add emacs local variable tweaks and add some missing docstrings 2025-06-23 16:51:33 -04:00
bfa19f678d future-proof iarray() and darray() conversions and document them 2025-06-23 16:29:12 -04:00
8401b6aee8 use utils::inumeric() instead of utils::numeric() for integers 2025-06-23 06:57:51 -04:00
9d6758f269 merge two if statements with the same condition following each other 2025-06-23 06:43:59 -04:00
70d36b1b4c when finalizing from the fortran module we should also free the external fix storage 2025-06-22 21:48:57 -04:00
4a9fa1ba87 restore compilation without -DNDEBUG 2025-06-22 18:40:58 -04:00
b3c403f464 run KOKKOS force style unit tests with serial when OpenMP is not available 2025-06-22 18:29:45 -04:00
12dcaa2d03 eliminate compiler warnings 2025-06-22 18:12:20 -04:00
1e6eeda958 remove dead code and address warnings from static code analysis 2025-06-22 17:49:47 -04:00
c6478e245a fix up emitterutils source file in bundled yaml-cpp in ML-PACE for GCC 15+ 2025-06-22 17:22:41 -04:00
cfe87f928d update email address 2025-06-22 16:36:50 -04:00
469846e73c correct broken doc line 2025-06-22 07:22:36 -04:00
9b382dac41 apply more pylint recommendations 2025-06-21 23:22:34 -04:00
679806206d detect header keywords and section titles from data files and print suitable error 2025-06-21 17:59:54 -04:00
c118af34e0 small doc update 2025-06-21 17:58:49 -04:00
46fc4b21a5 make fix deposit and fix pour compatible with body particles from molecule templates 2025-06-21 17:17:39 -04:00
2b3af7b371 silence compiler warnings 2025-06-21 17:05:36 -04:00
aecc85e3d5 avoid out-of-bounds memory access when registering fix external callbacks 2025-06-21 16:42:39 -04:00
e3b1d27e0a whitespace 2025-06-21 14:34:01 -04:00
06d47f7279 didn't count if atom-id was used 2025-06-21 14:32:18 -04:00
fc9efa1586 update documentation for the recently added sections in JSON format molecule files 2025-06-21 13:48:11 -04:00
0310959053 use consistent formatting of error messages and comments 2025-06-21 12:59:40 -04:00
9360038013 implement the processing for special bonds in JSON 2025-06-21 12:59:15 -04:00
0caaca8a05 honor atom-ids in Special Bonds section 2025-06-21 12:36:31 -04:00
9d38652033 consistently quote JSON fields with double quotes 2025-06-21 12:34:17 -04:00
c08ee92801 correctly honor atom-id in Special Bond Counts section 2025-06-20 23:05:58 -04:00
95fb6c75d2 support special:counts section for JSON data, only special:bonds missing 2025-06-20 23:05:38 -04:00
67582ebf14 some error hint updates based on recent discussions on MatSci.org 2025-06-20 17:45:37 -04:00
8dff25296b restore pylammps.py 2025-06-20 14:42:52 -04:00
b036c911e7 fix copy-n-paste bug 2025-06-20 14:23:22 -04:00
6f72a56b4c stricter matching of header items and skip comments right away 2025-06-20 14:12:25 -04:00
fb088cdc57 require .json extension for JSON format molecule files 2025-06-20 14:12:00 -04:00
c98ebb669e trigger warning on the correct fix style name 2025-06-20 10:08:14 -04:00
bb0bd289b7 update unit tests 2025-06-20 08:38:09 -04:00
b909a782b6 revert double adding of body info in create_atoms 2025-06-20 08:07:17 -04:00
6fff591c0d more checks 2025-06-20 07:51:58 -04:00
c6057f3780 support creating body particles from molecule templates in create_atoms 2025-06-20 07:31:58 -04:00
765b3ad487 need fewer checks with JSON data 2025-06-20 07:30:59 -04:00
9615cb466c support processing "bodies" sections from JSON data 2025-06-20 07:30:43 -04:00
500373d72b correct error message 2025-06-20 07:24:35 -04:00
25fecf7b7d update format 2025-06-20 07:24:21 -04:00
18455d07fe list possible pair styles with SPC Howto. Add comment about cutof vs. long-range coulomb 2025-06-20 04:24:13 -04:00
c8ce2a0390 minor tweaks and modernizations, apply clang-format 2025-06-18 20:09:44 -04:00
7601a217b7 modernize and improve error messages 2025-06-18 20:02:47 -04:00
af3b1c5423 store fix rigid/small id and check if it still exists during init() 2025-06-18 20:02:24 -04:00
fc3d971119 replace outdated inputs with new versions 2025-06-18 20:00:51 -04:00
b864116719 spelling edits 2025-06-18 15:46:58 -06:00
d022f1cf48 whitespace changes 2025-06-18 15:26:34 -06:00
4fa97ee0dd changes to doc page and cosmetic changes to src files 2025-06-18 14:47:01 -06:00
97d7e9e4a1 correct cut-n-paste errors 2025-06-18 10:16:19 -04:00
8c0894fa84 fix issues causing failed tests 2025-06-18 07:49:15 -04:00
004816a4ba update tests for changed argument names 2025-06-18 07:09:03 -04:00
6934932383 document function 2025-06-18 06:55:30 -04:00
3f6dfa27bd apply pylint and refactor accordingly 2025-06-18 06:51:17 -04:00
40d88e9bda revert incorrect additions 2025-06-18 03:35:28 -04:00
210fdb8b98 process "shake:atoms" and "shake:types" sections in JSON data 2025-06-18 00:08:28 -04:00
ad722310b1 reformatted code and doc page 2025-06-17 15:28:21 -06:00
e01640c4f5 fix out-of-bounds initialization for cvatom array 2025-06-17 17:02:00 -04:00
07c91f396e fix out-of-bounds access bug reported in issue #4632 2025-06-17 16:43:07 -04:00
c5628e5ccd Merge branch 'develop' into hmc 2025-06-17 14:27:03 -06:00
ec2ef5b14c fix more issues with reading Shake sections in native file format 2025-06-17 13:55:16 -04:00
03a418809d implement general shake flags checking and partial JSON processing 2025-06-17 10:32:36 -04:00
2f088749ad add shake entries to schema 2025-06-17 10:31:49 -04:00
635719a2ec Correct implementation to actually follow the documentation. 2025-06-17 10:31:17 -04:00
72ea12b0f9 fixed compilation error due to a typo 2025-06-17 08:42:22 -05:00
632bc8f20d Removed line apparently copied from compute displace/atom 2025-06-17 14:56:43 +02:00
9a81c95104 document unchanging group size restriction in compute msd 2025-06-17 06:02:43 -04:00
624c7a5ab8 improve errors in compute msd 2025-06-17 05:57:24 -04:00
eeaca93974 the number of atoms in the compute msd group must not change 2025-06-17 05:51:03 -04:00
515ccac51c avoid copies of C++ strings 2025-06-16 20:19:53 -04:00
53fec5563c Merge pull request #4543 from d-immel/apip
adaptive-precision interatomic potentials (APIP)
2025-06-16 15:56:12 -04:00
47fae6b786 Merge pull request #4628 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-06-16 13:41:25 -04:00
0538518dbd add missing entries to .gitignore 2025-06-16 12:43:12 -04:00
a5e4123606 Merge branch 'develop' into feature/batch-snap-ilp 2025-06-16 12:31:50 -04:00
0a1ade0bce Merge branch 'develop' into roll-back-neighbor-swap 2025-06-15 17:45:13 -04:00
8f31b62e15 make flow of control more obvious 2025-06-15 17:39:06 -04:00
d640543185 fix whitespace 2025-06-15 15:29:35 -05:00
b5809aff67 updated the doc page for the new parameters 2025-06-15 15:20:56 -05:00
b3423e9b7a allow nbor build and bond block sizes to be specified from the command line 2025-06-15 15:04:42 -05:00
d38f97e465 remove dead code 2025-06-15 05:40:39 -04:00
bb1b854b47 check for empty molecule to avoid division by zero 2025-06-15 05:40:16 -04:00
d95d97db28 remove dead code, avoid uninitialized access 2025-06-15 05:25:19 -04:00
a6b30c35ac use more obvious flow of control that does not confuse static code analysis 2025-06-15 05:24:37 -04:00
7fb930daed start adding tests for JSON format molecule files 2025-06-15 00:00:59 -04:00
72538fbb84 warn about inconsistent units only during the first pass reading the file 2025-06-14 23:36:20 -04:00
d775aa1566 Update MC.cmake
add missing `set_property()` call
2025-06-14 19:23:36 -04:00
1fc6d4d3b6 Update MC.cmake
add missing `endif()`
2025-06-14 19:22:14 -04:00
97d09c2ec4 update changelog 2025-06-14 19:14:01 -04:00
4bc5bc3d18 update label only when needed 2025-06-14 19:09:53 -04:00
c5c1f47c20 move redundant code to find pointer to main widget to helper function 2025-06-14 19:04:43 -04:00
fdc199e7cc Merge branch 'develop' into develop 2025-06-14 18:15:12 -04:00
0ea4ba28bf Merge remote-tracking branch 'github/develop' into apip 2025-06-14 18:00:41 -04:00
6004a58ab4 fix spelling issues 2025-06-14 17:59:01 -04:00
90df96b16f fix bugs detected by GitHub Copilot 2025-06-14 17:33:06 -04:00
7dc4e17e0c fix compilation with MPI STUBS 2025-06-14 12:59:07 -04:00
2d5f02a398 add lammps_add_molecule API to the C-library interface and python/fortran module 2025-06-14 12:46:36 -04:00
faa1dbc19d add missing type check and setting of ntypes for json data molecules 2025-06-14 11:48:11 -04:00
ea23af48d3 only perform size check if section is present 2025-06-14 11:47:24 -04:00
e2cd2a1a17 make error handling for checking the handle and its state more consistent 2025-06-14 11:18:12 -04:00
88f5ad160a use "const std::string &" instead of "const char *" it will be converted anyway 2025-06-14 11:16:06 -04:00
81bfcb80e7 add missing prototype 2025-06-14 11:15:05 -04:00
df1d70bf99 move up re-initialization one level to avoid uninitialized access 2025-06-14 09:05:29 -04:00
ced0d350f0 handling parsing exceptions and check for error creating a backup 2025-06-14 09:02:00 -04:00
4b32e58f90 make sure that all molecule members are initialized 2025-06-14 08:48:25 -04:00
1475111f7f use different ccache storage keys for gcc and clang 2025-06-14 06:10:47 -04:00
848ef74459 download sphinx_toolbox extension and enable "collaps" directive 2025-06-14 06:04:54 -04:00
5013b80434 Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-06-14 05:20:05 -04:00
08d2856558 Merge pull request #4627 from Saric-Group/bugfix/bond-react-peratom-mass
Fix segfault when masses are missing in post-reaction template in per-atom systems
2025-06-14 05:18:47 -04:00
2c9dac5505 Merge branch 'develop' into bugfix/bond-react-peratom-mass 2025-06-13 16:39:44 +02:00
4d6a085361 make include guard consistent with file name 2025-06-13 08:58:48 -04:00
88f777226e restore example 2025-06-13 08:57:37 -04:00
22082854ad restore documentation files 2025-06-13 08:55:10 -04:00
ca6558fea4 Merge branch 'develop' into roll-back-neighbor-swap 2025-06-13 08:48:50 -04:00
1ba1b7111d Merge branch 'develop' into apip 2025-06-13 08:42:29 -04:00
ee165e72de minor changes of APIP doc page 2025-06-13 12:15:03 +02:00
3a628ce4b1 simplify by returning new variable index in creator function and avoid calling finder 2025-06-13 04:37:09 -04:00
c5920eeb8d stop installing components from the downloaded pace library 2025-06-13 03:30:33 -04:00
5b8c505c2d only strip debug info 2025-06-13 02:19:01 -04:00
c79a1a6bed flag as development version 2025-06-13 02:18:35 -04:00
0d2f47ddd4 Merge pull request #4613 from akohlmey/next_release
Set version date for next feature release
2025-06-13 02:08:04 -04:00
336bb4622d add a few missing version tags 2025-06-13 00:08:05 -04:00
380ad17cf3 Merge branch 'develop' into next_release 2025-06-13 00:01:50 -04:00
949bac6b4a Merge pull request #4614 from akohlmey/collected-small-fixes
Collected small changes and fixes
2025-06-12 23:59:06 -04:00
4865235998 small doc tweaks and update for the simplified installation 2025-06-12 22:49:38 -04:00
dcf604875c cosmetic 2025-06-12 22:34:56 -04:00
3052bc7f4c make added comments consistent and consistently formatted 2025-06-12 22:31:33 -04:00
6df845a8d8 Merge remote-tracking branch 'github/develop' into apip 2025-06-12 22:27:03 -04:00
fa59b1c6f2 correct and simplify install script for legacy build system 2025-06-12 22:25:55 -04:00
66684deb9f Merge pull request #4600 from akohlmey/molecule-refactor-for-json
Refactor Molecule class to add support for JSON format molecule files
2025-06-12 22:22:39 -04:00
550048f458 Merge branch 'develop' into molecule-refactor-for-json 2025-06-12 21:21:38 -04:00
37b02a27fa improve error messages 2025-06-12 21:21:14 -04:00
f389b6676b make inconsistent units an error; special case: "real" and "metal" are compatible 2025-06-12 21:20:52 -04:00
f9de296ed1 make "coords" optional and infer natoms from "types" instead 2025-06-12 21:19:32 -04:00
a9c5d095e4 Merge pull request #4621 from akohlmey/plugin-add-run-min-style
Add support for run and minimize style plugins and refactor plugin handling to become global
2025-06-12 20:35:15 -04:00
2d10754930 Merge pull request #4624 from ethan-puyaubreau/cuda-preset-fix
Fix GPU architecture in CUDA preset for Kokkos
2025-06-12 19:41:21 -04:00
97b85d34f2 Fix GPU architecture in CUDA preset for Kokkos 2025-06-12 16:02:38 -04:00
f84bbf9326 Update logs of APIP examples. 2025-06-12 20:30:45 +02:00
9b195d2109 Merge branch 'develop' into molecule-refactor-for-json 2025-06-12 14:23:32 -04:00
db835d1ec5 add false positive 2025-06-12 14:23:25 -04:00
285fffa98e Merge pull request #4619 from lammps/python-wrapper-doc
clarify python and variable doc pages
2025-06-12 13:29:31 -04:00
00ffebc929 Remove not required variable from PairLambdaZoneAPIP. 2025-06-12 19:24:43 +02:00
ed1d49cc16 Merge branch 'python-wrapper-doc' of github.com:lammps/lammps into python-wrapper-doc 2025-06-12 11:48:45 -04:00
db22bdc7b9 rewrap doc source 2025-06-12 11:48:37 -04:00
349def92d2 remove superfluous test 2025-06-12 11:26:08 -04:00
674500781f add minimal documentation for the JSON molecule file format 2025-06-12 11:20:02 -04:00
4097733b52 small tweaks 2025-06-12 11:19:42 -04:00
dd30b5a258 add tool to regularize/reformat/reindent JSON files 2025-06-12 11:19:16 -04:00
2eed658d85 Corrected what I think is a typo
There is no way to evaluate a variable with iv_ prefix.
2025-06-12 15:57:59 +02:00
1db87d827d documentation updates for JSON format in general and molecule files in particular 2025-06-12 07:49:20 -04:00
766ef241d9 update date 2025-06-12 07:48:31 -04:00
b21ce964e1 more meaningful error message if a file is in JSON format but has a parse error 2025-06-12 07:48:02 -04:00
b15f4e5d63 add updated example using json molecule files 2025-06-12 00:34:01 -04:00
125389bf23 safer memory management for checking format 2025-06-12 00:32:53 -04:00
5868aa095d add dihedrals and impropers 2025-06-11 23:31:37 -04:00
d4be195d81 make code more consistent by always using "item" for topology data entry 2025-06-11 23:31:21 -04:00
5e948b1450 add support for bonds and angles 2025-06-11 22:32:23 -04:00
72533c8276 check that dipole z-component is zero for 2d systems 2025-06-11 22:32:06 -04:00
cac7606470 use explicit type when clearning memory 2025-06-11 22:31:29 -04:00
b0694e4e73 add support for dipoles section 2025-06-11 18:09:40 -04:00
3d7f7af8c7 parse charges, diameters, and masses 2025-06-11 17:54:41 -04:00
9df30404db try alternate initialized for Windows 2025-06-11 17:05:05 -04:00
e7cf0701a8 add support for molecule and fragments sections 2025-06-11 16:45:40 -04:00
d3691dce98 better checking 2025-06-11 16:44:17 -04:00
d7cd2795c5 add error to CreateAtoms for per-atom systems 2025-06-11 17:28:42 +02:00
768d5bb9c1 address small PDF formatting issue 2025-06-11 10:56:04 -04:00
e44e2e27cc reuse variable 2025-06-11 10:31:30 -04:00
dad1f02716 process "coords" and "types" sections in JSON format 2025-06-11 10:17:32 -04:00
c4e062f2d8 Merge branch 'develop' into molecule-refactor-for-json 2025-06-11 08:40:48 -04:00
2d8ef50e49 address output issue reported by GitHub Copilot (but properly and in both locations) 2025-06-11 04:33:25 -04:00
6ccb1b745c remove debug code, move to toplevel dir and document kspace style zero 2025-06-11 04:24:35 -04:00
75c341543a add missing comment 2025-06-11 04:05:41 -04:00
67128a00b9 Merge branch 'kspace_zero' into plugin-add-run-min-style 2025-06-11 04:05:32 -04:00
0fd7a40d92 update documentation for writing plugins 2025-06-11 03:40:33 -04:00
30cc2570ad Merge branch 'develop' into plugin-add-run-min-style 2025-06-11 03:24:04 -04:00
df08818fef refactor handling of plugin loading to make plugin a global property 2025-06-11 02:52:28 -04:00
3ab3663659 updated the doc page for the pair/team/size and nbin/atoms/per/bin keywords 2025-06-10 23:37:34 -05:00
464b9f4b03 add support for loading run and min styles 2025-06-11 00:33:44 -04:00
8d11f16e16 Insert pre-titlepage text asking about removal of PDF version. 2025-06-10 19:27:01 -04:00
91896bc444 initialized atoms_per_bin 2025-06-10 17:32:56 -05:00
8ae5b16d66 use consistent markup 2025-06-10 18:18:50 -04:00
f77be0a373 Merge branch 'python-wrapper-doc' of github.com:lammps/lammps into python-wrapper-doc 2025-06-10 15:25:22 -06:00
c8cd692bbd more doc page tweaks 2025-06-10 15:25:15 -06:00
c309d6e99e allow atoms_per_bin used for neighbor builds to be specified from the command line 2025-06-10 15:21:54 -05:00
a45561ab41 Bufix for memory leak fix from Stan. Forgot to clear the new per-atom storage 2025-06-10 15:19:50 -04:00
319037caf6 fix typo 2025-06-09 20:37:30 -04:00
1f57be8255 another tweak 2025-06-09 16:50:43 -06:00
7a7ec8083f edits of 2 doc pages 2025-06-09 16:38:42 -06:00
e9146a6467 using teamsize_max if specified from the command line 2025-06-09 11:51:05 -05:00
c7fd0817e2 Merge branch 'develop' into collected-small-fixes 2025-06-09 00:14:23 -04:00
2567a3d802 Merge pull request #4581 from lammps/atom-style-var-with-python
Enable equal- and atom-style variables to invoke Python functions more directly with args
2025-06-09 00:13:39 -04:00
962f791700 Merge pull request #4616 from jrgissing/another_reaction_count_fix
bond/react: another reaction-count bug fix
2025-06-08 23:43:15 -04:00
72080d78a7 hide repetitive code use a macro 2025-06-08 08:52:45 -04:00
1e59400ef3 update help table for new commands 2025-06-07 21:41:17 -04:00
e41d485377 record changes to LAMMPS-GUI for flatpak build 2025-06-07 21:36:41 -04:00
43dbb0c089 add special case for setting locale on macOS based on suggestion from OVITO developers 2025-06-07 21:13:21 -04:00
8305e27835 allow to set pair team size with neigh/thread on from -pk kokkos 2025-06-07 16:07:36 -05:00
3f685e9a44 fix several spelling and formatting issues in added/modified documentation 2025-06-06 12:13:02 -04:00
23b185a625 add overload to utils::print() so it can be used without FILE pointer 2025-06-06 11:29:12 -04:00
ccc078f036 Add apip to documentation of read_dump and compute property/atom. 2025-06-06 14:41:52 +02:00
9a65ab2c4d Merge branch 'develop' into apip_devel and solve merge conflict in set. 2025-06-06 13:32:00 +02:00
84f20fe516 must initialize pyindex[ivar] in equalstyle check 2025-06-06 05:59:03 -04:00
4cb936c3c6 no need to allocate since we use the space of the python style variable, which is required 2025-06-06 02:17:39 -04:00
65debaf191 resolve NOTES and add option to print return value to log with python invoke 2025-06-06 02:02:04 -04:00
001fa6a024 corrections from GitHub copilot 2025-06-06 00:28:18 -04:00
f69d28fbab Merge branch 'develop' into atom-style-var-with-python 2025-06-06 00:20:06 -04:00
1b12f3b47e improve error messages for python command 2025-06-06 00:19:56 -04:00
e1aa3cf7ec move throwing Python variable errors to PythonImpl class and change API accordingly. 2025-06-06 00:19:33 -04:00
f6f3eb1c31 bug-fix bug fix 2025-06-06 00:15:30 -04:00
1e7dc5126e Flag code that needs improving with TODO comments 2025-06-05 23:06:55 -04:00
654cd0fe00 improve argument parsing and error messages 2025-06-05 22:52:40 -04:00
e5f0e23a11 clang-format apip package. 2025-06-05 20:46:32 +02:00
6c798f1847 Update APIP naming in documentation. 2025-06-05 20:05:37 +02:00
20f123ddd1 Update notation in APIP examples. 2025-06-05 17:22:19 +02:00
bc93311309 Fix typos. 2025-06-05 17:21:03 +02:00
19a108bd21 Add apip suffix in pair_styles lambda/input and lambda/input/csp. 2025-06-05 15:38:38 +02:00
4fcbdbe3a1 pair_style lambda/zone -> pair_style lambda/zone/apip 2025-06-05 15:15:06 +02:00
1086db672c Capitalise apip in PACE class names. 2025-06-05 15:01:51 +02:00
f34284fca0 Capitalise apip in EAM class names. 2025-06-05 14:40:21 +02:00
94d39239b5 fix lambda -> fix lambda/apip 2025-06-05 14:29:43 +02:00
dd4afb16ad fix lambda_thermostat -> fix lambda_thermostat/apip 2025-06-05 14:06:17 +02:00
1d5efd05bd fix apip_atom_weight -> fix atom_weight/apip 2025-06-05 13:22:13 +02:00
964605f25a remove commented out code 2025-06-05 06:50:28 -04:00
74e8ed7a49 follow LAMMPS' conventions for initializing class members more closely 2025-06-05 06:46:43 -04:00
b6a57c2480 Add apip prefix to internal variable names. 2025-06-05 12:44:01 +02:00
21d3f68939 modernize looking up voronoi compute and check for it in init(), too 2025-06-05 06:42:08 -04:00
78e538c9fc store inv_r_0 instead of r_0 to replace division by faster multiplication 2025-06-05 06:32:50 -04:00
e31f864620 correct offset for parsing optional arguments 2025-06-05 06:25:27 -04:00
3f1944cace more accurate detection of known keywords 2025-06-05 06:23:58 -04:00
cf79cf8e72 simplify use of MathSpecial::square() 2025-06-05 06:18:29 -04:00
4b56fd4cd2 replace redundant get_distance() with sqrt(MathExtra::distsqr())
Also avoid repetitive computation of distance.
2025-06-05 06:15:48 -04:00
8abd42ed2f complete embedded citation handling 2025-06-05 06:02:03 -04:00
467cbbc188 Revert "refactor fix neighbor/swap"
This reverts commit 594953ed0b.
2025-06-05 05:54:13 -04:00
9d37f28a86 Revert "Cleaned options reading index error"
This reverts commit ef6cdbf00e.
2025-06-05 05:54:10 -04:00
7bf5d5899f Revert "update error message"
This reverts commit df3467a114.
2025-06-05 05:54:04 -04:00
61f9cb66e2 Revert "remove dead code and redundant implementation."
This reverts commit 3dadcab047.
2025-06-05 05:54:02 -04:00
99e8085cda Revert "make fix neighbor/swap valgrind clean"
This reverts commit 6a2e796538.
2025-06-05 05:53:56 -04:00
41bd3437f6 Revert "make attempt_swap valgrind clean. now fails in pair->compute()."
This reverts commit deef742897.
2025-06-05 05:53:46 -04:00
bf97cc470f Temporarily remove fix neighbor/swap until implementation issues are fixed 2025-06-05 05:19:35 -04:00
bd26d7a742 Add apip names in read_dump. 2025-06-05 11:09:35 +02:00
d3f00eeff4 Add apip names in set. 2025-06-05 10:59:32 +02:00
67d668cb62 Add apip names in compute property/atom. 2025-06-05 10:54:06 +02:00
9d4aad2588 Remove APIP from dump_custom, fix store/state and variable. 2025-06-05 10:45:36 +02:00
f5b64118cc accept denormal floating point numbers in tokenizer class and utils::numeric() 2025-06-04 21:07:18 -04:00
acf8a51b01 Merge branch 'develop' into molecule-refactor-for-json 2025-06-04 19:42:03 -04:00
b3f160c118 Merge pull request #4567 from lammps/fix-set-command
New fix set command
2025-06-04 19:40:29 -04:00
ece4939708 Merge branch 'develop' into fix-set-command 2025-06-04 16:22:45 -04:00
0fb02af020 Merge pull request #4599 from akohlmey/collected-small-fixes
Collected small fixes and updates
2025-06-04 14:42:06 -04:00
3f58927829 one more correction 2025-06-04 12:22:43 -04:00
b73f78ea88 update libvoro++ patch 2025-06-04 12:20:29 -04:00
ba8dd4d380 only build the voro++ library when downloading 2025-06-04 12:10:58 -04:00
45ba47e0d0 Set version date for next feature release 2025-06-04 10:14:07 -04:00
ddb6bb2cfb adjust to include new build of gcc/musl cross-compiler 2025-06-04 09:57:14 -04:00
b509c53003 small improvement 2025-06-04 09:56:53 -04:00
9941d9132c reformulate 2025-06-04 00:30:10 -04:00
11bf72c4aa Merge branch 'develop' into molecule-refactor-for-json 2025-06-03 22:02:48 -04:00
ba093790fc remove tabs 2025-06-03 21:57:41 -04:00
5386dce0cf Update molecule.rst 2025-06-03 20:45:02 -04:00
4da7fad87e Merge branch 'develop' into feature/batch-snap-ilp 2025-06-03 11:17:55 -04:00
87cf0f964e use common container for Linux release tasks 2025-06-03 02:35:23 -04:00
f9003e6a16 revert to single defition of LAMMPS integer sizes to be applied to GPU library 2025-06-02 23:47:08 -04:00
deef742897 make attempt_swap valgrind clean. now fails in pair->compute(). 2025-06-02 22:19:09 -04:00
6a2e796538 make fix neighbor/swap valgrind clean 2025-06-02 21:30:56 -04:00
3086e6e0ec Merge branch 'develop' into collected-small-fixes 2025-06-02 20:50:45 -04:00
117a451b15 Merge pull request #4597 from akohlmey/cmake-adjustments
Small CMake  updates
2025-06-02 20:47:40 -04:00
8a8fc2f1d8 apply -DLAMMPS_${LAMMPS_SIZES} consistently across all platforms 2025-06-02 20:29:00 -04:00
688800038a force skip MPI for C++ setting into cache 2025-06-02 20:14:11 -04:00
07f650a982 try to work around compilation issues 2025-06-02 17:02:38 -04:00
60c33bfb95 correct typos 2025-06-02 16:37:21 -04:00
23694ee4f5 Merge branch 'develop' into cmake-adjustments 2025-06-02 16:06:53 -04:00
1fc8e05642 roll back changes switching from MPI::MPI_CXX to MPI::MPI_C 2025-06-02 15:48:40 -04:00
1fae7e3f98 remove support for obsolete MPICH library binaries for Windows 2025-06-02 15:47:35 -04:00
f7ae20358c improve error message 2025-06-01 11:42:19 -04:00
07acf912c9 Merge branch 'develop' into molecule-refactor-for-json 2025-06-01 11:42:03 -04:00
52f8d1d5a1 Merge branch 'develop' into collected-small-fixes 2025-06-01 11:41:11 -04:00
b5cf8eb9ed Merge pull request #4610 from akohlmey/minimum_image_flerr
Improve minimum image error messages
2025-06-01 11:38:34 -04:00
7aac770631 consolidate checking and determining sizes. use macro to reduce redundancy 2025-06-01 03:43:34 -04:00
17ed72f99b show use of Domain::minimum_image_big() in second example block 2025-05-31 23:36:36 -04:00
ed535e5301 fix minimum image bug detected by GitHub Copilot 2025-05-31 23:34:41 -04:00
04c642905f make "format" and "data" required object sections 2025-05-31 22:28:54 -04:00
7780309fae Merge branch 'develop' into molecule-refactor-for-json 2025-05-31 22:03:07 -04:00
c663a5ac1c undo substitution in comment 2025-05-31 17:06:14 -04:00
5ea7bec083 update ATC library for minimum image API change 2025-05-31 03:18:42 -04:00
b05f5f8e3a add info about updating old source packages for minimum image API change 2025-05-31 02:56:25 -04:00
2599f9ddb0 spelling 2025-05-31 02:55:46 -04:00
2cc7c71ebc add info about updating old source packages for minimum image API change 2025-05-31 02:54:42 -04:00
d7cee3e71d remove undesired "generated" tag 2025-05-31 02:31:25 -04:00
9d81246761 add FLERR as first argument to Domain::minimum_image() and Domain::minimum_image_big() 2025-05-31 02:28:53 -04:00
290f409cf8 improve / modernize more error messages in the read_data command 2025-05-30 16:44:33 -04:00
7bed09c25a Bugfix from Trung for running EAM on GPUs with OpenCL. 2025-05-30 16:41:44 -04:00
68ce9c8a6f modify C++23 compilation workflow to test both GCC and Clang 2025-05-30 06:12:12 -04:00
e43acf24ea small optimization 2025-05-30 01:20:32 -04:00
765701b924 Merge remote-tracking branch 'github/develop' into collected-small-fixes 2025-05-30 01:15:48 -04:00
5b65c4938f avoid problems with consteval 2025-05-29 23:43:02 -04:00
8f56874d07 Merge pull request #4527 from martok/fix-gauss
Add fix ave/moments
2025-05-29 15:22:10 -04:00
06af3b8c4a Fix typo in doc/src/fix_ave_moments.rst
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-29 14:39:39 -04:00
a6d7f015a2 synchronize units checking with data file and native format molecule file 2025-05-29 09:37:04 -04:00
5e9f00f1eb fix typo 2025-05-29 09:36:25 -04:00
66c2e4f324 improve documentation of moment corrections 2025-05-29 14:27:16 +02:00
8f9806ec72 remove / comment-out unused parameters 2025-05-29 06:36:03 -04:00
13304707aa add missing override 2025-05-29 06:30:24 -04:00
cea8d22a87 remove undocumented and unused define and related unused array 2025-05-29 06:30:15 -04:00
f839532cf6 silence compiler warnings 2025-05-29 05:37:01 -04:00
f12d1d3c5b we only need the MPI C library support for loading liblammps.so dynamically 2025-05-29 05:34:51 -04:00
0af41a211d add false positive 2025-05-29 05:27:41 -04:00
26def4a3cf we only need the MPI C library support for loading liblammps.so dynamically 2025-05-29 05:25:40 -04:00
f584d7219a correct incorrect reference to command 2025-05-29 05:24:00 -04:00
129a3a83e5 Merge branch 'develop' into fix-set-command 2025-05-29 05:21:46 -04:00
3dadcab047 remove dead code and redundant implementation. 2025-05-29 05:04:20 -04:00
f5cc752648 update magic file and point to origin 2025-05-28 23:18:16 -04:00
a246619ecf whitespace 2025-05-28 21:54:17 -04:00
de98aa0fb1 Merge branch 'develop' into atom-style-var-with-python 2025-05-28 21:54:03 -04:00
be59eb6a70 fix up two more inconsistent definitions 2025-05-28 21:38:14 -04:00
8f07b44dce Merge branch 'cmake-adjustments' of github.com:akohlmey/lammps into cmake-adjustments 2025-05-28 21:35:42 -04:00
3552847957 consistent use of definitions to avoid CMake adding spurious '-D' prefixes 2025-05-28 21:35:33 -04:00
ce074d475f additional small changes to doc page and code comment 2025-05-29 01:03:28 +02:00
8254107095 remove unused variable "quoteflag" 2025-05-28 17:43:06 -04:00
1ddc64b885 eliminate warning (doesn't change results since we don't compute pair forces) 2025-05-28 16:47:55 -04:00
46b0e48ef3 clarify use of pair-wise additive pair style requirement as go-between for many-body potentials. 2025-05-28 11:22:39 -04:00
1668bcffcf fix 2 bugs caught in review 2025-05-28 08:53:55 -06:00
747ed4244f documentation updates based on review 2025-05-28 13:04:27 +02:00
ce44faddcf correct discuss FFT benchmark timing for PPPM 2025-05-27 23:40:52 -04:00
5ff0f05933 more details in serial performance summary 2025-05-27 18:07:48 -04:00
6843424dad add version tag, rewrap, minor tweaks to doc page. 2025-05-27 10:38:41 -04:00
d59f7d3381 Merge branch 'develop' into fix-gauss 2025-05-27 10:34:07 -04:00
d6a0d3bacf small update 2025-05-27 07:37:42 -04:00
df3467a114 update error message 2025-05-27 07:36:14 -04:00
f5c51af9bc demonstrate how serial and parallel performance can change 2025-05-27 01:15:18 -04:00
6a5ed2af4b add renieigbor option to fix set 2025-05-26 16:22:52 -06:00
06b06fd991 only use prototype for PIMPL struct in KOKKOS classes 2025-05-26 17:57:15 -04:00
6ea16aead1 we only need the MPI C library support for loading liblammps.so dynamically 2025-05-26 17:56:26 -04:00
2e775034f9 clarify and improve formatting 2025-05-26 03:03:37 -04:00
1f758bcf8e more discussion of items that affect LAMMPS serial and parallel performance 2025-05-26 02:35:30 -04:00
f8665fdf4e add a more explicit warning about using hybrid for many-body potentials
this summarizes advice that has to be given recurringly in the LAMMPS forum
2025-05-26 01:49:01 -04:00
8181224bca discuss in more details factors that affect performance (WIP) 2025-05-25 05:04:59 -04:00
2436bd4411 provide some more talking points for comparison of KOKKOS and GPU package 2025-05-25 05:04:37 -04:00
94f44e3644 add new header, json_fwd.h with forward declarations for using headers 2025-05-24 22:17:34 -04:00
730cf8bcf5 add false positive 2025-05-24 02:42:27 -04:00
8d09e440c5 start documentation for JSON format 2025-05-24 02:36:46 -04:00
1d8d8b6445 add title and version info to JSON schema file 2025-05-23 23:31:14 -04:00
442e50bb17 simplify 2025-05-23 23:12:07 -04:00
018342afc8 update schema with stricter checks. no need to bond-ids, angle-ids etc. 2025-05-23 23:00:50 -04:00
61d3759d6b fix typo 2025-05-23 22:59:44 -04:00
0975207ba4 Add more fields to molecule schema
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23 22:01:31 -04:00
534373bef3 flag required properties 2025-05-23 22:00:05 -04:00
f979d503d9 fix minor issues 2025-05-23 21:59:33 -04:00
cf7011bf64 nvc++ compiler workaround 2025-05-23 13:48:42 -07:00
ae8542a020 Fixed up whitespace 2025-05-23 10:57:38 -07:00
76ef41a901 overload Atom::add_molecule() with function accepting a JSON object 2025-05-23 00:08:58 -04:00
2fe88a1e9e further refactor molecule class
- make constructor only do basis init, processing of command args to function
- add function to process json object (either directly or from command processing)
- distribute json object across processes as binary serialization
2025-05-22 23:27:10 -04:00
30b555d7dc add units keyword 2025-05-22 23:23:22 -04:00
0df77ef7ca start a tools/json folder with molecule schema and README 2025-05-22 21:42:33 -04:00
446630e3ba Added compile-time support for running the legacy codepaths on the GPU; misc cleanup and fixes 2025-05-22 14:14:13 -07:00
8c314c7bda Reduced template parameters, improved code reuse between ComputeFusedDeidrj paths 2025-05-22 14:06:26 -07:00
13500710ce Added register tiling to ComputeBi 2025-05-22 13:57:09 -07:00
c787ce60a7 Added directional fusion to ComputeFusedDeidrj 2025-05-22 13:50:41 -07:00
103c44e3c1 Added register tiling to ComputeUi 2025-05-22 13:28:33 -07:00
c1fe6c9109 Added register tiling to ComputeYi/Zi/YiWithZlist 2025-05-22 13:14:44 -07:00
c03e19d2dd Added support for extra padding to data structures to simplify extra vectorization 2025-05-22 13:01:35 -07:00
e9dc43c2da move and rename example folder for fix neighbor/swap. update inputs. add logs. 2025-05-22 14:27:37 -04:00
d70409181c Examples for accelerated diffusion using KMC-MD method 2025-05-22 14:27:23 -04:00
ef6cdbf00e Cleaned options reading index error 2025-05-22 11:49:15 -04:00
7b5b6f19b7 continued refactoring of Molecule class to include support for JSON 2025-05-21 16:24:41 -04:00
a46d32e4d4 improve error messages 2025-05-21 12:20:00 -04:00
7328dedb7b add JSON file detection by trying to parse it and catch exception
this also stores the file title and checks for compatible
application, format, and revision entries
2025-05-21 12:14:16 -04:00
30010a8929 small updates 2025-05-21 12:12:34 -04:00
6800e8bb39 step LAMMPS-GUI version number 2025-05-21 08:01:28 -04:00
594953ed0b refactor fix neighbor/swap
- plug memory leak
- modernize access to computes
- tighten checks
- modernize and improve error messages
- better check for known keywords when processing atom types
- support for typelabels
2025-05-21 07:29:34 -04:00
b92414349d update expand_args() unit tester with new error message 2025-05-20 21:49:28 -04:00
bc07696ce9 small correction for wildcard expansion 2025-05-20 21:18:07 -04:00
21394574ed stop with error, if trying to use wildcard for vector-style variable without upper bound 2025-05-20 18:11:28 -04:00
a443e6ea5e properly forward file and line number for grid ID parsing 2025-05-20 18:10:40 -04:00
37a344a2ad add example for Python with vector-style variable 2025-05-20 13:33:36 -06:00
271bdc1af7 alternate way to specify defines for MPI tests 2025-05-20 13:56:36 -04:00
2351418c94 made collapse_tree() method work correctly in Variable class for Python function wrappers, also added support for vector-style variables to use Python function wrappers 2025-05-19 21:42:08 -06:00
adce5bef84 explicitly skip MPI C++ in GPU package library 2025-05-19 22:20:50 -04:00
380c878e5f Merge remote-tracking branch 'github/develop' into cmake-adjustments 2025-05-19 22:15:51 -04:00
2744647c75 Merge pull request #4594 from akohlmey/collected-small-changes
Collected small changes
2025-05-19 22:13:37 -04:00
2cc1356384 skip MPI C++ support also for libraries 2025-05-19 22:09:38 -04:00
510563f5f3 explicitly skip MPI C++ interface in colvars 2025-05-19 21:51:53 -04:00
70e1bb50f1 add skip C++ defines for LAMMPS library instead 2025-05-19 21:40:44 -04:00
186a6431f7 directly disable C++ support when compiling main.cpp 2025-05-19 21:27:57 -04:00
09b174d129 turn off C++ support 2025-05-19 21:15:00 -04:00
5a8da735f2 explicitly use the MPI::C imported target on the main executable 2025-05-19 21:14:33 -04:00
ad63eb8bf7 Merge branch 'develop' into cmake-adjustments 2025-05-19 21:03:07 -04:00
b3402eaae8 Merge pull request #4424 from jtavenner-dev/kmc
add fix neighbor/swap
2025-05-19 20:57:00 -04:00
8fa4c0974c remove blank line 2025-05-19 16:41:00 -06:00
ac059a15b0 added a NOTE 2025-05-19 14:39:30 -06:00
c3b25c8c27 updated doc pages and code 2025-05-19 14:34:22 -06:00
b9b59bd23c small clarifications and corrections. Sync with current state of affairs 2025-05-19 11:31:42 -04:00
a821654ef5 correct error message 2025-05-19 11:30:51 -04:00
2968a62937 continue refactoring for bio force field and water moldel discussions 2025-05-17 23:30:18 -04:00
e393b9803b add information about the OPC model to the TIP4P howto 2025-05-17 22:41:42 -04:00
63ee449dc1 reformulate description of force components 2025-05-17 21:15:48 -04:00
031fab210f update unittest for change in compute pair/local 2025-05-15 23:28:46 -04:00
629ec2eabe update for consistency with docs 2025-05-15 23:16:31 -04:00
5fd4d6bb87 remove directionCorrection and update docs for compute pair/local and compute bond/local 2025-05-15 23:15:59 -04:00
ebfb94a717 fix whitespace 2025-05-15 17:04:18 -06:00
06616c5ff3 change how internal vars are defined by various commands, enable Python class to return a numeric value directly (for speed) 2025-05-15 16:37:41 -06:00
c3c0180649 correctly check for 32bit integer overflow 2025-05-15 08:15:35 -04:00
19cfd08eb8 correctly enable GPU package and make fix imd wait in background for bucky+cnt example 2025-05-15 08:15:01 -04:00
fd8fb74a88 cannot use Kokkos-OpenMP with recent hipcc 2025-05-15 07:47:19 -04:00
35f08232ba update for Fedora 41/42 2025-05-15 07:46:48 -04:00
2b7c05c057 properly select linker for modern clang compilers 2025-05-15 04:02:44 -04:00
179d4f0148 work around C++ error 2025-05-15 02:53:51 -04:00
32588f075e remove assignments of variables to themselves 2025-05-15 02:53:12 -04:00
9abb171d05 more CMake scripting updates to use C style MPI libraries not C++ 2025-05-15 02:49:02 -04:00
b3e7121535 modernize project() command and create project version string with dots 2025-05-15 02:14:35 -04:00
85f0853910 Merge branch 'develop' into cmake-adjustments 2025-05-14 20:11:01 -04:00
01bde55e9a match all argument types for powint() 2025-05-13 12:53:03 -04:00
68d2414b59 Merge branch 'fix-kokkos-log2' of https://github.com/Luthaf/lammps into collected-small-changes 2025-05-13 12:52:15 -04:00
9ba50df9d8 Select one overload of log2 for the kokkos build 2025-05-13 16:09:13 +02:00
83fa2cbc93 enable PotentialFileReader class to change line buffer size 2025-05-13 06:02:10 -04:00
fdd91e597e add a few more tests for extracted global properties 2025-05-13 02:44:05 -04:00
75907ccf91 add support to extract eflag/vflag_atom/global as global properties 2025-05-13 02:32:27 -04:00
2bcac9efba fix spelling issue 2025-05-12 12:13:05 -04:00
24149fc793 Create kokkos version of fix electron stopping 2025-05-11 09:25:15 +03:00
ef89edc4c6 Additional edits 2025-05-09 14:53:27 -06:00
bb62f46404 Merge branch 'kmc' of https://github.com/jtavenner-dev/lammps into kmc 2025-05-09 14:27:05 -06:00
17da04f07b Cleaned up language errors 2025-05-09 14:25:08 -06:00
6436cc87b7 Corrected inconsistent voro-ID compute references and examples 2025-05-09 14:23:03 -06:00
3215141d9e Merge pull request #4584 from navlalli/update-docs
Update fix qtpie/reaxff and fix qeq/rel/reaxff docs
2025-05-08 01:59:10 -04:00
3be9a40bf8 Merge branch 'develop' into update-docs 2025-05-08 01:09:17 -04:00
b69e8fff1f Merge pull request #4587 from akohlmey/collected-small-changes
Collected small changes and fixes
2025-05-08 01:07:29 -04:00
458c0844a8 fix typo 2025-05-07 17:44:38 -04:00
acd53ebd7c update flag to accommodate changes in clang 2025-05-07 17:13:36 -04:00
ac556104c1 link to MPI C interface instead of C++ 2025-05-07 17:12:57 -04:00
22cddeee78 fix spelling in comments 2025-05-07 16:49:43 -04:00
60fe08c328 clarify and rewrap 2025-05-07 15:47:35 -04:00
38dffe2283 Properly processing >1 fix set force 2025-05-07 15:42:57 -04:00
45944c4dc9 Fixing passed arg from type to index 2025-05-07 15:42:40 -04:00
6c2f11ce75 Merge branch 'develop' into update-docs 2025-05-07 13:21:39 -06:00
011f05f9ff Update docs 2025-05-07 13:06:07 -06:00
955d5da09c Update CMake 2025-05-07 12:58:33 -06:00
b5cac76937 Restore default value 2025-05-07 12:55:54 -06:00
9f0c87cf81 Merge branch 'develop' of github.com:lammps/lammps into kk_update_4.6.1 2025-05-07 12:42:07 -06:00
9c8e03c4f4 Port changes from Kokkos develop branch to Makefile.kokkos 2025-05-07 12:41:53 -06:00
7c2c9ea286 add missing versionadded tag 2025-05-07 02:00:40 -04:00
3751fe6be7 Merge branch 'atom-style-var-with-python' of github.com:lammps/lammps into atom-style-var-with-python 2025-05-06 16:28:20 -06:00
1f85dd4093 update comment in variable.cpp 2025-05-06 16:28:10 -06:00
615dd589dd replace slow pow() function with faster and more accurate alternatives 2025-05-06 15:21:06 -04:00
c0a41bd638 Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-05-06 15:06:43 -04:00
c1e9adbd80 Merge pull request #4574 from talinke/develop
New Fix for GJF Langevin Dynamics
2025-05-06 13:24:06 -04:00
48df0448df spelling 2025-05-06 12:05:12 -04:00
2d22092078 additional info for pair style lj/smooth from Aidan 2025-05-06 12:00:55 -04:00
afcb97aaf2 address spelling issues 2025-05-05 20:22:00 -04:00
fbfe1e6a7c Merge remote-tracking branch 'github/develop' into collected-small-changes 2025-05-05 20:13:42 -04:00
a528b88d8a Merge branch 'update-docs' of github.com:navlalli/lammps-qtpie into collected-small-changes 2025-05-05 20:13:23 -04:00
750cfbedd3 Merge pull request #4579 from gsalkuin/bpm-fix-rigid
Update atom->quat in rigid fixes for bpm/rotational compatibility
2025-05-05 20:09:53 -04:00
a1cd18e4cf Merge pull request #4522 from willzunker/mdr-dev
MDR contact model updates: radius update and damping
2025-05-05 20:07:36 -04:00
3b17ea5363 Merge pull request #4556 from Colvars/colvars-update
Update Colvars library to version 2025-04-18
2025-05-05 20:03:27 -04:00
dc07a1471e Properly processing >1 fix set force 2025-05-05 12:45:35 -06:00
7c30111fa0 Fixing passed arg from type to index 2025-05-05 11:50:59 -06:00
0d7e07b9be export bond topology related per-atom data via library interface 2025-05-05 06:25:22 -04:00
7ec7745640 make neighbor list settings, status, and bond/angle/dihedral/improper lists available to library interface 2025-05-05 05:21:18 -04:00
8d38ec4f18 Merge branch 'mliap-torch-load-fix' of https://github.com/fglines-nv/lammps into collected-small-changes 2025-05-03 21:22:53 -04:00
228cf1e871 Correct leftover references to vector inputs in docs 2025-05-03 19:07:01 +02:00
6c8e758e2b Fix subscript range checking typo 2025-05-03 19:00:53 +02:00
f3adda8d3e clean-up code and doc page 2025-05-02 16:21:41 -06:00
af840176e7 doc page tweak 2025-05-02 16:14:55 -06:00
79f6867d7e new doc page for fix set command with example 2025-05-02 16:13:01 -06:00
3fafec9cba do not try to suppress nvcc warning with LLVM based compilers. those fail when configuring MPI. 2025-05-02 16:02:42 -04:00
10077b057c Update fix_ave_moments.rst
Emphasized the difference in behavior between this fix and other fix ave/* commands with regards to Nevery, Nrepeat and Nfreq.
2025-05-02 21:42:33 +02:00
37221c080b Add self-citation 2025-05-02 13:52:17 +01:00
55a13efad0 small update 2025-05-02 00:30:22 -04:00
a388bd38ee add LAMMPS-GUI screenshot image 2025-05-02 00:21:41 -04:00
edb060ccf5 Add examples and expected output for ave/moments 2025-05-02 01:20:37 +02:00
565e7b2c2b Add documentation for ave/moments 2025-05-02 01:20:36 +02:00
b2001e999c Implement moments calculation fix ave/moments 2025-05-02 01:20:36 +02:00
f8a0ff011b Skeleton implementation of fix ave/moments 2025-05-02 01:20:36 +02:00
1f5b64bca4 torch.load fix for torch>=2.6 in ML-IAP 2025-05-01 15:22:05 -07:00
e474bfeece Merge remote-tracking branch 'github/develop' into atom-style-var-with-python 2025-05-01 16:03:27 -04:00
9b36c58eb2 fix spelling and docbuild issues 2025-05-01 16:03:11 -04:00
1fc13c491c change PYFUNCTION to PYWRAPPER in code 2025-05-01 13:16:50 -06:00
a2a2c541b5 tweaks to code and doc page 2025-05-01 12:57:27 -06:00
76d0ead245 doc pages for new Python function wrappers 2025-05-01 12:41:48 -06:00
165f34bc12 Merge pull request #4571 from akohlmey/collected-small-fixes
Collected small fixes
2025-05-01 11:43:50 -04:00
19d25a3654 initial implementation of python functions in variable formulas, including for atom-style vars 2025-05-01 07:59:41 -06:00
597a841f40 Update Kokkos library in LAMMPS to v4.6.1 2025-04-30 17:21:22 -06:00
2ab7eda64a improve warning and explanation about too short communication cutoff 2025-04-30 16:46:22 -04:00
cba479bf6e Update Colvars library to version 2025-04-18
The following is a list of pull requests relevant to LAMMPS in the Colvars repository since 2024-08-06:

- 752 New tool poisson_integrator_conv
  https://github.com/Colvars/colvars/pull/752 (@jhenin)

- 733 Custom grids for all biases
  https://github.com/Colvars/colvars/pull/733 (@giacomofiorin, @jhenin)

- 776 Avoid error in acos and asin with fast-math
  https://github.com/Colvars/colvars/pull/776 (@jhenin)

- 773 fix: fix the clang build test failure of OPES
  https://github.com/Colvars/colvars/pull/773 (@HanatoK)

- 768 fix: clamp the input values of asin and acos in case of fast math on aarch64
  https://github.com/Colvars/colvars/pull/768 (@HanatoK)

- 761 Add debug code for the Jacobi failure
  https://github.com/Colvars/colvars/pull/761 (@HanatoK)

- 759 min_image fix; Saves long runs from crashes;
  https://github.com/Colvars/colvars/pull/759 (@PolyachenkoYA)

- 757 Fix MSVC OpenMP issue
  https://github.com/Colvars/colvars/pull/757 (@HanatoK)

- 755 Fix indentation of 'Init CVC' message in standard output
  https://github.com/Colvars/colvars/pull/755 (@jhenin)

- 750 Optimize and simplify the calculation of dihedral gradients
  https://github.com/Colvars/colvars/pull/750 (@HanatoK)

- 749 Add references to new Colvars paper
  https://github.com/Colvars/colvars/pull/749 (@jhenin, @giacomofiorin)

- 740 Report the specific C++ standard at init time, stop warning about C++97/03
  https://github.com/Colvars/colvars/pull/740 (@giacomofiorin)

- 731 Improve detection of hard/mathematical boundaries
  https://github.com/Colvars/colvars/pull/731 (@giacomofiorin)

- 729 Optimize the fit gradients
  https://github.com/Colvars/colvars/pull/729 (@HanatoK, @jhenin)

- 728 Fix undefined behavior when getting the current working directory from std::filesystem
  https://github.com/Colvars/colvars/pull/728 (@giacomofiorin)

- 727 Add patchversion scripting command
  https://github.com/Colvars/colvars/pull/727 (@giacomofiorin)

- 724 Fix gradients and metric functions of distanceDir
  https://github.com/Colvars/colvars/pull/724 (@giacomofiorin)

- 715 Add missing rotation in orientation component
  https://github.com/Colvars/colvars/pull/715 (@giacomofiorin)

- 713 fix: try to solve #87 for non-scala components
  https://github.com/Colvars/colvars/pull/713 (@HanatoK)

- 709 Implementation of OPES in Colvars
  https://github.com/Colvars/colvars/pull/709 (@HanatoK, @giacomofiorin, @jhenin)

- 706 BUGFIX for Segmentation fault in colvarbias_meta::calc_energy() with useGrids off
  https://github.com/Colvars/colvars/pull/706 (@alphataubio)

- 570 enable use of CVs defined by PyTorch neural network models
  https://github.com/Colvars/colvars/pull/570 (@zwpku, @giacomofiorin, @HanatoK, @jhenin)

Authors: @alphataubio, @EzryStIago, @giacomofiorin, @HanatoK, @jhenin, @PolyachenkoYA, @zwpku
2025-04-30 15:32:30 -04:00
f9ba063c4a add citation reminder 2025-04-30 12:17:31 -04:00
def38bf0f3 Updated fix langevin algorithm citation 2025-04-29 15:03:49 -07:00
2fa9cc7ae1 correct 2025-04-29 17:52:48 -04:00
0ce5d68455 Merge branch 'develop' into talinke/develop 2025-04-29 17:20:15 -04:00
1062a8fb3a add deprecation warning to fix langevin and document it 2025-04-29 17:20:04 -04:00
332006923d Name change: langevin/gjf to gjf 2025-04-29 12:00:06 -07:00
169f8ffd73 Merge branch 'lammps:develop' into bpm-fix-rigid 2025-04-29 13:23:36 -04:00
f9a55c0f49 update reference data in test which was updated in KIM database 2025-04-29 08:40:47 -04:00
053792ed47 fix typo detected by copilot 2025-04-28 23:14:54 -04:00
2fc7d287d4 Merge branch 'develop' into collected-small-fixes 2025-04-28 22:27:32 -04:00
d4867ab55e add false positives 2025-04-28 22:22:47 -04:00
2927b08792 correct reference 2025-04-28 22:20:57 -04:00
4a3c08576f small formal updates 2025-04-28 22:19:14 -04:00
e5854ced41 backward compatibility not needed here 2025-04-28 18:56:32 -04:00
0768aac1fd update Qt platform version for flatpak build to latest 5.15 branch 2025-04-28 18:45:57 -04:00
75d3d79fca open available error URLs with double click or from context menu 2025-04-28 18:25:40 -04:00
fc0788f61c Styling 2025-04-28 13:18:33 -07:00
b5f3660101 Merge branch 'lammps:develop' into develop 2025-04-28 13:16:24 -07:00
11f6b3483b Updated documentation, updated log files 2025-04-28 13:02:47 -07:00
db3d93210d highlight error URLs in logwindow 2025-04-28 10:56:37 -04:00
e62f45b2b5 fixed whitespace 2025-04-28 09:21:14 -05:00
7151f261a0 address sphinx formatting issue due to added paragraph 2025-04-27 10:04:41 -04:00
31b18ad24e update help index table 2025-04-27 10:03:35 -04:00
f7e53b06e4 updated doc page for threads/per/atom 2025-04-27 08:56:53 -05:00
bef695f70b fix copy-n-paste error 2025-04-27 07:39:58 -04:00
c74e7292c0 allow to set vectorsize (threads per atom) with neigh/thread from -pk kokkos 2025-04-26 17:44:24 -05:00
5169a633e5 make sure cut_respa is initialized 2025-04-26 17:04:14 -04:00
f8bf6d1ad6 correct a few more issues with unit tests 2025-04-26 02:42:09 -04:00
d89ae3d15d fix 64-bit integer compilation issue 2025-04-26 02:28:43 -04:00
6030c68ba3 correct reference 2025-04-26 02:18:57 -04:00
9442218b36 spelling 2025-04-26 02:18:45 -04:00
1a1f4b1a82 correct reference 2025-04-26 02:17:54 -04:00
3221c53b14 whitespace 2025-04-26 02:14:42 -04:00
161776b2c7 recover AtomStyle and SetProperty unit tests 2025-04-26 02:14:10 -04:00
78c5e9c00b reformat according to revised programming style and partial clang-format 2025-04-26 01:33:17 -04:00
36ad6ebe52 apply clang-format 2025-04-26 01:24:23 -04:00
85bac7665a add missing override attribute 2025-04-26 01:24:06 -04:00
12c72593f7 more fixes to recover compilation 2025-04-26 01:17:45 -04:00
ad6b674798 Merge branch 'develop' into fix-set-command 2025-04-26 01:13:58 -04:00
3b2f794398 fix issue breaking compilation 2025-04-26 01:03:46 -04:00
092df8ed8f add copyright header 2025-04-26 00:56:47 -04:00
4897fbb210 Merge branch 'develop' into collected-small-fixes 2025-04-26 00:50:58 -04:00
7102cc2588 use bold font for column titles 2025-04-25 20:31:16 -04:00
f1edc7f222 whitespace 2025-04-25 20:15:36 -04:00
706aa19710 Use type/ratio instead of type/fraction to select charged types 2025-04-25 20:05:09 -04:00
67c6dc492b update to ScaFaCoS version 1.0.4 2025-04-25 20:03:06 -04:00
d406289a7a propagate changes from library.cpp/library.h to swig and plugin interface 2025-04-25 17:04:32 -04:00
1969c28e0c delete unused variables 2025-04-25 16:35:54 -04:00
ad086f26a5 Update version added 2025-04-24 10:42:42 +01:00
130033ec75 first working version of fix set with refactored set command 2025-04-23 13:04:54 -06:00
648cd3f0c6 Temperature bias capability 2025-04-22 17:43:21 -07:00
946e885209 Merge branch 'develop' into fix-set-command 2025-04-22 14:21:02 -06:00
5d9a7d154d address spelling and formatting issues 2025-04-15 22:48:25 -04:00
49d5e02c11 Variable name change, fixing some spacing/typos 2025-04-15 17:34:46 -06:00
0c29a0a0c9 changed damp_type to be a mdr damping coefficent 2025-04-15 13:55:38 -04:00
4bfdd3eb34 Remove trailing whitespace 2025-04-14 16:22:11 -06:00
51de62ce05 Reconcile version changes to documentation and polish 2025-04-14 15:58:19 -06:00
703750f4c8 Merge branch 'kmc' of https://github.com/jtavenner-dev/lammps into kmc 2025-04-14 15:57:16 -06:00
a3bc1a6c0b Merge branch 'lammps:develop' into kmc 2025-04-14 15:52:23 -06:00
ca246a50f1 Merge branch 'develop' of https://www.github.com/lammps/lammps into kmc 2025-04-14 15:37:47 -06:00
3a6ea0808d Merged changes to documentation for further user clarity 2025-04-14 15:36:33 -06:00
e4c3b0c05e New example and log files 2025-04-14 11:33:02 -07:00
09d3ac0a1b Updated GJ-VII, GJ-VIII 2025-04-11 20:07:25 -07:00
a30daec348 Addition of GJ-VII 2025-04-11 13:40:35 -07:00
7c0fd42ab4 Move atom_vec_apip to src/APIP. 2025-04-11 10:21:18 +02:00
2bb9454190 Correct style 2025-04-10 13:15:30 -07:00
43a7b14b7c New example structure 2025-04-10 12:01:02 -07:00
4dd8c66390 Updated documentation 2025-04-10 10:33:08 -07:00
8c1aada9cb Support constant lambda in APIP. 2025-04-10 16:05:16 +02:00
bd6bb3ce10 Updated integrator, streamlined variables 2025-04-08 17:35:09 -07:00
585565edb9 corrected initialization of damp_type, error checks, doc changes, example script updates 2025-04-08 20:33:28 -04:00
210cddd94e working on adding damping types to mdr damping 2025-04-08 18:32:45 -04:00
d6e9a6a44a Update atom->quat in fix_rigid_small.cpp 2025-04-08 10:03:36 -04:00
139ecd0e90 Merge branch 'lammps:develop' into develop_ap 2025-04-08 16:03:25 +02:00
535d08895a Add APIP package. 2025-04-08 15:26:45 +02:00
586d24f5ef whitespace 2025-04-07 23:02:00 -04:00
7643c901eb cleaned mdr damping and updated velocity damping for mdr use 2025-04-07 22:57:29 -04:00
641d496d4b Refined keyword options 2025-04-07 17:36:48 -07:00
319e14c8e3 Update atom->quat in fix_rigid.cpp 2025-04-07 18:28:33 -04:00
ea76dc99e9 Adding damp coeff back in 2025-04-04 15:20:55 -06:00
3d4b57d7fd Removing old variable 2025-04-04 14:40:01 -06:00
30bbbafd9d Cleaning up MDR files 2025-04-04 09:57:43 -06:00
384d7f446b updated damping in mdr example sims 2025-04-03 11:56:16 -04:00
b8aaa8d60f modified doc to include mdr damping model 2025-03-31 22:55:42 -04:00
3c1ed34753 removed csv_writer.h 2025-03-31 22:16:09 -04:00
eeaf0694ad white space and comment removal 2025-03-31 22:13:29 -04:00
8ee8cb1aa3 code clean-up 2025-03-31 20:13:24 -04:00
3aafe2831b added MDR damping method 2025-03-31 20:13:24 -04:00
9d01ac2caf Stablized radius update, added WFM, added outputs 2025-03-31 20:13:24 -04:00
6dacf5d52c Update fix_neighbor_swap.rst
I fixed some typos and shortened the text a bit.
2025-03-15 11:36:20 -06:00
94885186b8 Updated doc with description of kMC algorithm 2025-02-27 16:12:06 -07:00
e3dd2790f9 add KSpace style zero to KSPACE and zero2 as plugin demo 2025-01-29 15:39:53 -05:00
c4d11a7871 follow LAMMPS programming conventions more closely 2025-01-29 15:38:18 -05:00
ea6e702184 Merge branch 'develop' of https://www.github.com/lammps/lammps into kmc 2025-01-28 19:00:08 -07:00
a678a3b474 Initial update of doc file 2025-01-28 18:51:52 -07:00
e6986cbc06 Removed unused local RNG and restructured reading of command options 2025-01-28 18:51:07 -07:00
60e1e52ec1 add whitespace to end of file 2025-01-19 12:21:41 -05:00
cba09fc0f5 improved error handling for user specifying rigid fix 2025-01-18 17:40:07 -05:00
be7d3a5f4b moved body struct inside class 2025-01-18 17:34:07 -05:00
5436411178 Merge branch 'develop' into develop 2025-01-18 17:05:57 -05:00
fbbeba5912 removed friend class status for fixHMC 2025-01-18 14:35:10 -05:00
d34a8a4807 moved body momentum randomization into fix rigid small 2025-01-18 14:29:34 -05:00
dbc930c756 correct permissions 2024-12-20 19:44:28 -05:00
60b0ef68a6 enable and apply clang-format 2024-12-20 19:39:19 -05:00
42b6308e26 remove commented out debug code, replace pow(x,2.0) with MathSpecial::square() 2024-12-20 19:37:22 -05:00
3c0d4c8e14 add versionadded tag 2024-12-20 19:36:36 -05:00
8a89d2fcf6 no more error lists in headers 2024-12-20 19:22:02 -05:00
b05172fe96 spelling fixes and documentation formatting corrections 2024-12-20 19:21:35 -05:00
49b2b978e6 build system updates to skip fix neighbor/swap if VORONOI package is not installed 2024-12-20 19:20:51 -05:00
c847ac1fd4 Removed trailing whitespace 2024-12-19 13:37:30 -07:00
0bd65d3489 Merge branch 'kmc' of https://github.com/jtavenner-dev/lammps into kmc 2024-12-19 13:05:33 -07:00
4004d26304 Spelling check fix 2024-12-19 12:57:17 -07:00
acb107af5e Merge branch 'develop' of https://www.github.com/lammps/lammps into kmc 2024-12-19 11:29:52 -07:00
82569f4448 Added documentation files 2024-12-19 11:29:19 -07:00
92aae586d4 Merge branch 'develop' into kmc 2024-12-19 10:19:02 -07:00
f980e8babf Integrated MD-KMC code to current development branch 2024-12-19 09:52:05 -07:00
2e57a2ee23 remove exchange and borders on restored state. Causes atoms to be lost. 2024-12-14 17:26:24 -05:00
875ad66afc add exchange and borders on restored state 2024-12-14 16:44:26 -05:00
9a4361336d update documentation 2024-12-14 16:40:54 -05:00
6cb46bc7f0 update documentation 2024-12-14 16:40:24 -05:00
b953dbd856 use a larger timestep with fix rigid example 2024-12-14 16:06:10 -05:00
ea664476d3 change ra keyword to resample 2024-12-14 15:59:09 -05:00
e0253e1058 cleanup 2024-09-21 11:41:25 -04:00
ee50ee2a9b working with exchange 2024-09-13 21:19:48 -04:00
0d151b948f remove commented code in store 2024-09-02 12:27:57 -04:00
36d6f1f95c forgot to hit save 2024-09-02 12:24:39 -04:00
0aa4118e89 implement exchange store and restore 2024-09-02 12:24:13 -04:00
a6ac272e7e fix negation operator and arg starting number 2024-01-29 12:29:27 -05:00
e374b073bc pass integrator as arg for rigid, typo fix 2024-01-25 14:53:40 -05:00
846e365e94 added flags for single execution to init and setup 2024-01-25 14:25:59 -05:00
64fe4c171c added checks for seed, temp ge 0.0 2024-01-24 14:35:46 -05:00
33c52c2a4a Merge branch 'develop' into draneyj/develop 2024-01-04 21:12:46 -05:00
aa1382b2ac Merge branch 'develop' into fix-set-command 2024-01-04 15:11:49 -07:00
e83f0d3f26 update fix hmc examples and add reference log files 2023-12-19 17:53:48 -05:00
2f692b9bff silence compiler warnings about unused variables 2023-12-19 17:28:00 -05:00
33bfc1d1ca changed vector output 2023-12-19 15:28:01 -05:00
b0205dbe07 add examples for hmc 2023-12-19 15:02:53 -05:00
8968cbf49d setup fix_rigid before saving state 2023-12-19 14:07:24 -05:00
08f78f8060 properly force reneighbor on next timestep 2023-12-19 09:57:57 -05:00
64dc621027 check for rigid flag before fix_rigid 2023-12-18 19:34:13 -05:00
acdc4244ec initialize stored_body 2023-12-18 19:32:00 -05:00
c18de5dbd8 change how check for additional virial fixes is done 2023-12-18 18:48:20 -05:00
c13455bfa3 removed redundant acc_frac calculation in compute_vector 2023-12-18 18:00:41 -05:00
19be6d5f94 remove access to internal members of modify in loops 2023-12-18 17:59:30 -05:00
66411317cb check for tags and compatible neighbor list settings 2023-12-17 15:37:09 -05:00
b895b52fc1 small programming style update 2023-12-17 15:36:43 -05:00
17ddf26121 plug some more memory leaks 2023-12-17 12:07:53 -05:00
a65e85a12e avoid memory leaks and uninitialized data 2023-12-17 12:01:48 -05:00
2da1800357 must move function to Fix::init() since queried info may not be current during constructor 2023-12-17 12:01:33 -05:00
d392b17ff1 some more simplification and cleanup 2023-12-17 11:49:19 -05:00
623f2c4ea0 simplify creation of internal fixes and computes, use unique ID 2023-12-17 11:38:33 -05:00
7761b6022b small doc fix 2023-12-17 11:37:12 -05:00
1b9e33a17f initialized all class member pointer to NULL 2023-12-17 11:00:32 -05:00
f67b045f02 explain dependency on RIGID package 2023-12-17 10:52:31 -05:00
e91c72a0d2 replace non-ASCII characters so that PDF builds won't fail 2023-12-15 19:41:52 -05:00
dc17dc3f84 update for coding convention compliance 2023-12-15 18:53:46 -05:00
81a4da5da3 build system integration and handling of dependency on fix rigid/small 2023-12-15 18:50:42 -05:00
5506f42005 documentation intergration and fixes 2023-12-15 18:48:27 -05:00
51b38c5b24 make the Body struct standalone so we can use a forward declaration 2023-12-15 18:14:28 -05:00
06a445fd4c revert protection settings and add FixHMC as friend class instead 2023-12-15 17:46:51 -05:00
4a7f543036 change my email 2023-12-15 13:49:09 -05:00
f4e9523152 exclude .git-blame-ignore 2023-12-15 13:44:12 -05:00
c37ba54d27 rename git blame ignore file 2023-12-15 13:30:44 -05:00
a307d5ca7e add set_v back to public 2023-12-15 13:27:33 -05:00
e9ed0ec9cb add line at eof 2023-12-15 13:06:16 -05:00
a8df05939c merge upstream 2023-12-15 13:04:33 -05:00
5bd14e1b0f Added MC pkg to CI files 2023-12-14 14:49:39 -05:00
c8756f7f55 fixing merge issues 2023-12-14 13:34:55 -05:00
8f338f785e fixing merge issues 2023-12-14 13:33:28 -05:00
1033e727b8 reallocation conflict resolved 2023-12-14 13:26:48 -05:00
063e966ec3 Merge branch 'norealloc' into develop 2023-12-14 13:19:56 -05:00
473ccd98dc only copying ntotal in save peratom 2023-12-14 13:19:32 -05:00
52e14995fc removed realloc to test 2023-12-14 13:12:30 -05:00
c9a14ad8fb faster by not reallocating peratom vector 2023-12-14 12:38:45 -05:00
bd69063088 trying to increase speed by minimizing reallocations 2023-12-14 12:08:24 -05:00
c78e2a5dd3 touch up docs 2023-12-14 11:47:08 -05:00
8d252d75cf Added ra (resampling upon acceptance) to hmc doc). 2023-12-14 11:30:51 -05:00
dbf716edd0 moving hmc to MC package 2023-12-14 11:08:01 -05:00
19235f072f add contributing authors 2023-12-14 11:03:23 -05:00
940778b2ec more formatting 2023-12-14 10:55:09 -05:00
8115785673 formatting 2023-12-14 10:53:37 -05:00
129b63ac54 added memory usage calculation 2023-12-14 10:46:53 -05:00
c6417581bc minor edit to reset atom_map 2023-12-14 09:13:27 -05:00
31f753c7d0 current_peratom updated every time 2023-12-14 09:09:52 -05:00
95c6a9c25b make resample on accept default no 2023-12-13 12:07:34 -05:00
0461caf23e make resample on accept an option 2023-12-13 12:05:54 -05:00
57554c48b9 check for nullptr at source before copying or allocating 2023-12-13 12:03:48 -05:00
24e408b463 uncomment reverse_comm 2023-12-13 11:59:17 -05:00
539385afff remove unnecessary code and comments 2023-12-13 11:53:10 -05:00
63d6f1a1e2 removed random p when move accepted 2023-12-13 11:11:50 -05:00
37ba666309 remove tuning 2023-12-13 10:56:28 -05:00
1fc6a0e6dd Clarified the hmc algorithm in the doc file fix_hmc.rst 2023-12-12 15:18:11 -05:00
be22c63659 Added the default to the docs file fix_hmc.rst 2023-12-12 15:11:59 -05:00
3be9cc0a4f Touched up the docs file fix_hmc.rst 2023-12-12 14:56:05 -05:00
7d8ec9f8be temporarily removing parameter tuning 2023-12-10 17:18:57 -05:00
31869a5d6b adding more stored vectors just in case 2023-12-10 16:34:11 -05:00
1a908b2edd Merge branch 'develop' of github.com:draneyj/lammps_hmc into develop 2023-12-10 15:14:31 -05:00
c3fe7d4b58 added xcmimage to restoration, fixed lost atoms 2023-12-10 15:11:49 -05:00
f42f861328 Updated GA CI files to work on draneyj/lammps_hmc repo. 2023-12-10 14:58:53 -05:00
d4c0b24eac added atom tag storage 2023-12-10 10:57:55 -05:00
d155ac70f1 comment out rot keyword 2023-12-09 18:47:28 -05:00
83bbdd71f3 initialize map flag 2023-12-09 18:46:43 -05:00
cf68591184 remove erroneous line 2023-12-09 18:38:09 -05:00
8171741ccb trying to accept chaning number of atoms 2023-12-09 18:24:13 -05:00
5120af1aba added more keywords to the documentation 2023-12-01 16:26:23 -05:00
1356cb54a9 Documentation description modified, related commands, default and references added. 2023-12-01 14:17:58 -05:00
fa71278070 Syntax, Examples and Description added to fix_hmc.rst 2023-12-01 13:51:06 -05:00
5a91f3d51a Added fix_hmc.rst 2023-12-01 12:13:21 -05:00
1d64be30d9 finished initial refactoring Set class 2023-11-30 10:42:59 -07:00
b0550648bf Added group filter to body random velocities 2023-11-29 16:00:57 -05:00
8339cdc76a properly weight vcm for rigid bodies 2023-11-29 15:33:00 -05:00
6c9c537ab1 more refactoring 2023-11-29 10:29:40 -07:00
04a7c6e920 modernize arg parse syntax 2023-11-29 00:35:59 -05:00
e1c1cc34bb random velocities for bodies and mom arg for zero vcm 2023-11-29 00:31:33 -05:00
c583a52402 more refactoring 2023-11-28 16:44:07 -07:00
d1290dc6cc add body copy for rigid bodies 2023-11-27 14:22:40 -05:00
bbed056c73 Merge branch 'develop' into fix-set-command 2023-11-27 10:26:40 -07:00
a1fc55b479 more refactoring 2023-11-27 10:23:50 -07:00
ee0a050f65 alphabetize methods 2023-11-25 15:46:15 -07:00
36afc91dfa draft version of refactored set command as set2 2023-11-25 15:20:28 -07:00
966398d470 missed a line I needed to remove 2023-11-20 09:15:12 -05:00
3588fddef2 Merge pull request #1 from draneyj/pr_practice
added templates to class, allowing error
2023-11-20 07:40:48 -05:00
e7313515c1 added templates to class, allowing error 2023-11-19 16:35:45 -05:00
040b23ab27 removed warning aboout rigid support 2023-11-19 16:20:11 -05:00
496802c908 remove comments in restore_saved_state 2023-11-19 16:18:17 -05:00
920b49d5a8 peratom copy working (for x at least) 2023-11-18 18:56:30 -05:00
7692824bcf runs with new atom copy 2023-11-17 15:52:51 -05:00
aab3773a90 restored accidentally deleted code 2023-11-17 14:16:47 -05:00
e5f4d60888 re-added restoration function 2023-11-17 12:46:58 -05:00
d20b4c4c94 added restoration function 2023-11-17 12:19:49 -05:00
ebe287555c trying to store peratom data 2023-11-16 11:06:51 -05:00
645541bcc7 properly initialize vector output 2023-11-14 15:37:17 -05:00
e865df16a8 now runs without error 2023-11-14 14:33:44 -05:00
18583434b1 hacked away at the outdated code until it compiled 2023-11-11 18:03:48 -05:00
2413da64a4 adding source files from original implementation 2023-11-08 14:24:44 -05:00
1319 changed files with 146191 additions and 15720 deletions

View File

@ -104,13 +104,13 @@ with a future release) from the `lammps-static` folder.
rm -rf release-packages
mkdir release-packages
cd release-packages
wget https://download.lammps.org/static/fedora41_musl.sif
apptainer shell fedora41_musl.sif
wget https://download.lammps.org/static/fedora41_musl_mingw.sif
apptainer shell fedora41_musl_mingw.sif
git clone -b release --depth 10 https://github.com/lammps/lammps.git lammps-release
cmake -S lammps-release/cmake -B build-release -G Ninja -D CMAKE_INSTALL_PREFIX=$PWD/lammps-static -D CMAKE_TOOLCHAIN_FILE=/usr/musl/share/cmake/linux-musl.cmake -C lammps-release/cmake/presets/most.cmake -C lammps-release/cmake/presets/kokkos-openmp.cmake -D DOWNLOAD_POTENTIALS=OFF -D BUILD_MPI=OFF -D BUILD_TESTING=OFF -D CMAKE_BUILD_TYPE=Release -D PKG_ATC=ON -D PKG_AWPMD=ON -D PKG_MANIFOLD=ON -D PKG_MESONT=ON -D PKG_MGPT=ON -D PKG_ML-PACE=ON -D PKG_ML-RANN=ON -D PKG_MOLFILE=ON -D PKG_PTM=ON -D PKG_QTB=ON -D PKG_SMTBQ=ON
cmake --build build-release --target all
cmake --build build-release --target install
/usr/musl/bin/x86_64-linux-musl-strip lammps-static/bin/*
/usr/musl/bin/x86_64-linux-musl-strip -g lammps-static/bin/*
tar -czvvf ../lammps-linux-x86_64-4Feb2025.tar.gz lammps-static
exit # fedora 41 container
cd ..
@ -204,7 +204,7 @@ cd ..
rm -r release-packages
```
#### Build Multi-arch App-bundle for macOS
#### Build Multi-arch App-bundle with GUI for macOS
Building app-bundles for macOS is not as easily automated and portable
as some of the other steps. It requires a machine actually running
@ -251,7 +251,7 @@ attached to the GitHub release page.
We are currently building the application images on macOS 12 (aka Monterey).
#### Build Linux x86_64 binary tarball on Ubuntu 20.04LTS
#### Build Linux x86_64 binary tarball with GUI on Ubuntu 20.04LTS
While the flatpak Linux version uses portable runtime libraries provided
by the flatpak environment, we also build regular Linux executables that

View File

@ -1,4 +1,4 @@
# GitHub action to build LAMMPS on Linux with gcc and C++23
# GitHub action to build LAMMPS on Linux with gcc or clang and C++23
name: "Check for C++23 Compatibility"
on:
@ -11,11 +11,19 @@ on:
workflow_dispatch:
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
build:
name: Build with C++23 support enabled
if: ${{ github.repository == 'lammps/lammps' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
idx: [ gcc, clang ]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
@ -29,8 +37,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y ccache \
libeigen3-dev \
clang \
libcurl4-openssl-dev \
libeigen3-dev \
libfftw3-dev \
libomp-dev \
mold \
mpi-default-bin \
mpi-default-dev \
@ -44,8 +55,8 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: linux-cpp23-ccache-${{ github.sha }}
restore-keys: linux-cpp23-ccache-
key: linux-cpp23-ccache-${{ matrix.idx }}-${{ github.sha }}
restore-keys: linux-cpp23-ccache-${{ matrix.idx }}
- name: Building LAMMPS via CMake
shell: bash
@ -58,14 +69,14 @@ jobs:
cmake -S cmake -B build \
-C cmake/presets/most.cmake \
-C cmake/presets/kokkos-openmp.cmake \
-C cmake/presets/${{ matrix.idx }}.cmake \
-D CMAKE_CXX_STANDARD=23 \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_FLAGS_DEBUG="-Og -g" \
-D DOWNLOAD_POTENTIALS=off \
-D FFT=KISS \
-D BUILD_MPI=on \
-D BUILD_SHARED_LIBS=on \
-D BUILD_TOOLS=off \

View File

@ -3,10 +3,11 @@
# CMake build system
# This file is part of LAMMPS
cmake_minimum_required(VERSION 3.16)
if(CMAKE_VERSION VERSION_LESS 3.20)
message(WARNING "LAMMPS is planning to require at least CMake version 3.20 by Summer 2025. Please upgrade!")
endif()
########################################
# initialize version variables with project command
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
@ -27,7 +28,10 @@ endif()
########################################
project(lammps CXX)
project(lammps
DESCRIPTION "The LAMMPS Molecular Dynamics Simulator"
HOMEPAGE_URL "https://www.lammps.org"
LANGUAGES CXX C)
set(SOVERSION 0)
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@ -131,7 +135,9 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "
endif()
# silence nvcc warnings
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xcudafe --diag_suppress=unrecognized_pragma,--diag_suppress=128")
endif()
@ -147,9 +153,6 @@ endif()
if(CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "C++ standard must be set to at least 11")
endif()
if(CMAKE_CXX_STANDARD LESS 17)
message(WARNING "Selecting C++17 standard is preferred over C++${CMAKE_CXX_STANDARD}")
endif()
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
set(CMAKE_CXX_STANDARD 17)
endif()
@ -194,6 +197,10 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
# do not include the (obsolete) MPI C++ bindings which makes for leaner object files
# and avoids namespace conflicts. Put this early to increase its visbility.
set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "Skip MPI C++ Bindings" FORCE)
########################################################################
# User input options #
########################################################################
@ -231,15 +238,6 @@ option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared lib
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
option(BUILD_LAMMPS_GUI "Build and install the LAMMPS GUI" OFF)
# Support using clang-tidy for C++ files with selected options
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling")
if(ENABLE_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=-*,performance-trivially-destructible,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-qualified-auto,misc-unused-parameters,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-shrink-to-fit,modernize-use-auto,modernize-use-using,modernize-use-override,modernize-use-bool-literals,modernize-use-emplace,modernize-return-braced-init-list,modernize-use-equals-default,modernize-use-equals-delete,modernize-replace-random-shuffle,modernize-deprecated-headers,modernize-use-nullptr,modernize-use-noexcept,modernize-redundant-void-arg;-fix;-header-filter=.*,header-filter=library.h,header-filter=fmt/*.h" CACHE STRING "clang-tidy settings")
else()
unset(CMAKE_CXX_CLANG_TIDY CACHE)
endif()
file(GLOB ALL_SOURCES CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
file(GLOB MAIN_SOURCES CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/main.cpp)
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
@ -264,6 +262,7 @@ option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
set(STANDARD_PACKAGES
ADIOS
AMOEBA
APIP
ASPHERE
ATC
AWPMD
@ -356,17 +355,6 @@ foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES})
option(PKG_${PKG} "Build ${PKG} Package" OFF)
endforeach()
set(DEPRECATED_PACKAGES AWPMD ATC POEMS)
foreach(PKG ${DEPRECATED_PACKAGES})
if(PKG_${PKG})
message(WARNING
"The ${PKG} package will be removed from LAMMPS in Summer 2025 due to lack of "
"maintenance and use of code constructs that conflict with modern C++ compilers "
"and standards. Please contact developers@lammps.org if you have any concerns "
"about this step.")
endif()
endforeach()
######################################################
# packages with special compiler needs or external libs
######################################################
@ -377,7 +365,6 @@ if(PKG_ADIOS)
# The search for ADIOS2 must come before MPI because
# it includes its own MPI search with the latest FindMPI.cmake
# script that defines the MPI::MPI_C target
enable_language(C)
find_package(ADIOS2 REQUIRED)
if(BUILD_MPI)
if(NOT ADIOS2_HAVE_MPI)
@ -392,21 +379,18 @@ if(PKG_ADIOS)
endif()
if(NOT CMAKE_CROSSCOMPILING)
find_package(MPI QUIET)
find_package(MPI QUIET COMPONENTS CXX)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
else()
option(BUILD_MPI "Build MPI version" OFF)
endif()
if(BUILD_MPI)
# do not include the (obsolete) MPI C++ bindings which makes
# for leaner object files and avoids namespace conflicts
set(MPI_CXX_SKIP_MPICXX TRUE)
# We use a non-standard procedure to cross-compile with MPI on Windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
include(MPI4WIN)
else()
find_package(MPI REQUIRED)
find_package(MPI REQUIRED COMPONENTS 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)
@ -467,6 +451,7 @@ pkg_depends(ELECTRODE KSPACE)
pkg_depends(EXTRA-MOLECULE MOLECULE)
pkg_depends(MESONT MOLECULE)
pkg_depends(RHEO BPM)
pkg_depends(APIP ML-PACE)
# detect if we may enable OpenMP support by default
set(BUILD_OMP_DEFAULT OFF)
@ -533,7 +518,6 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUA
endif()
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
enable_language(C)
if (NOT USE_INTERNAL_LINALG)
find_package(LAPACK)
find_package(BLAS)

View File

@ -62,6 +62,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
# skip over obsolete MPI-2 C++ bindings
set(MPI_CXX_SKIP_MPICXX TRUE)
#######
# helper functions from LAMMPSUtils.cmake
function(validate_option name values)
@ -128,8 +131,7 @@ endif()
################################################################################
# MPI configuration
if(NOT CMAKE_CROSSCOMPILING)
set(MPI_CXX_SKIP_MPICXX TRUE)
find_package(MPI QUIET)
find_package(MPI QUIET COMPONENTS CXX)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
else()
option(BUILD_MPI "Build MPI version" OFF)
@ -141,78 +143,38 @@ if(BUILD_MPI)
set(MPI_CXX_SKIP_MPICXX TRUE)
# We use a non-standard procedure to cross-compile with MPI on Windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
# Download and configure MinGW compatible MPICH development files for Windows
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
if(USE_MSMPI)
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
# Download and configure custom MPICH files for Windows
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX=1")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX=1")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
else()
find_package(MPI REQUIRED)
find_package(MPI REQUIRED COMPONENTS 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 INTERFACE -DLAMMPS_LONGLONG_TO_LONG)

View File

@ -75,13 +75,25 @@ function(get_lammps_version version_header variable)
list(FIND MONTHS "${month}" month)
string(LENGTH ${day} day_length)
string(LENGTH ${month} month_length)
if(day_length EQUAL 1)
set(day "0${day}")
# no leading zero needed for new version string with dots
# if(day_length EQUAL 1)
# set(day "0${day}")
# endif()
# if(month_length EQUAL 1)
# set(month "0${month}")
#endif()
file(STRINGS ${version_header} line REGEX LAMMPS_UPDATE)
string(REGEX REPLACE "#define LAMMPS_UPDATE \"Update ([0-9]+)\"" "\\1" tweak "${line}")
if (line MATCHES "#define LAMMPS_UPDATE \"(Maintenance|Development)\"")
set(tweak "99")
endif()
if(month_length EQUAL 1)
set(month "0${month}")
if(NOT tweak)
set(tweak "0")
endif()
set(${variable} "${year}${month}${day}" PARENT_SCOPE)
# new version string with dots
set(${variable} "${year}.${month}.${day}.${tweak}" PARENT_SCOPE)
# old version string without dots
# set(${variable} "${year}${month}${day}" PARENT_SCOPE)
endfunction()
function(check_for_autogen_files source_dir)

View File

@ -1,74 +1,31 @@
# Download and configure MinGW compatible MPICH development files for Windows
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
# set-up MS-MPI library for Windows with MinGW compatibility
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
if(USE_MSMPI)
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
message(STATUS "Downloading and configuring MPICH2-1.4.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX=1")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX=1")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")

View File

@ -26,6 +26,10 @@ if(BUILD_OMP)
target_link_libraries(colvars PRIVATE OpenMP::OpenMP_CXX)
endif()
if(BUILD_MPI)
target_link_libraries(colvars PUBLIC MPI::MPI_CXX)
endif()
if(COLVARS_DEBUG)
# Need to export the define publicly to be valid in interface code
target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG)

View File

@ -189,7 +189,7 @@ if(GPU_API STREQUAL "CUDA")
endif()
add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR)
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR -DLAMMPS_${LAMMPS_SIZES})
target_link_libraries(nvc_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
@ -489,7 +489,7 @@ 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_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
target_sources(lammps PRIVATE ${GPU_SOURCES})
target_include_directories(lammps PRIVATE ${GPU_SOURCES_DIR})

View File

@ -57,8 +57,8 @@ 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/4.6.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "61b2b69ae50d83eedcc7d47a3fa3d6cb" CACHE STRING "MD5 checksum of KOKKOS tarball")
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.6.02.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "14c02fac07bfcec48a1654f88ddee9c6" CACHE STRING "MD5 checksum of KOKKOS tarball")
mark_as_advanced(KOKKOS_URL)
mark_as_advanced(KOKKOS_MD5)
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
@ -83,7 +83,7 @@ if(DOWNLOAD_KOKKOS)
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 4.6.00 REQUIRED CONFIG)
find_package(Kokkos 4.6.02 REQUIRED CONFIG)
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
else()
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)

View File

@ -7,3 +7,23 @@ if(NOT PKG_MANYBODY)
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_sgcmc.cpp)
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
endif()
# fix hmc may only be installed if also fix rigid/small from RIGID is installed
if(NOT PKG_RIGID)
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/MC/fix_hmc.h)
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
get_target_property(LAMMPS_SOURCES lammps SOURCES)
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_hmc.cpp)
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
endif()
# fix neighbor/swap may only be installed if also the VORONOI package is installed
if(NOT PKG_VORONOI)
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/MC/fix_neighbor_swap.h)
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
get_target_property(LAMMPS_SOURCES lammps SOURCES)
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_neighbor_swap.cpp)
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
endif()

View File

@ -53,7 +53,13 @@ else()
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
endif()
add_subdirectory(${lib-pace} build-pace)
# fixup yaml-cpp/emitterutils.cpp for GCC 15+ until patch is applied
file(READ ${lib-pace}/yaml-cpp/src/emitterutils.cpp yaml_emitterutils)
string(REPLACE "#include <sstream>" "#include <sstream>\n#include <cinttypes>" yaml_tmp_emitterutils "${yaml_emitterutils}")
string(REPLACE "#include <cinttypes>\n#include <cinttypes>" "#include <cinttypes>" yaml_emitterutils "${yaml_tmp_emitterutils}")
file(WRITE ${lib-pace}/yaml-cpp/src/emitterutils.cpp "${yaml_emitterutils}")
add_subdirectory(${lib-pace} build-pace EXCLUDE_FROM_ALL)
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
if(CMAKE_PROJECT_NAME STREQUAL "lammps")

View File

@ -14,27 +14,16 @@ endif()
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
if(DOWNLOAD_SCAFACOS)
message(STATUS "ScaFaCoS download requested - we will build our own")
set(SCAFACOS_URL "https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz" CACHE STRING "URL for SCAFACOS tarball")
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
set(SCAFACOS_URL "https://github.com/scafacos/scafacos/releases/download/v1.0.4/scafacos-1.0.4.tar.gz" CACHE STRING "URL for SCAFACOS tarball")
set(SCAFACOS_MD5 "23867540ec32e63ce71d6ecc105278d2" CACHE STRING "MD5 checksum of SCAFACOS tarball")
mark_as_advanced(SCAFACOS_URL)
mark_as_advanced(SCAFACOS_MD5)
GetFallbackURL(SCAFACOS_URL SCAFACOS_FALLBACK)
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
find_program(HAVE_PATCH patch)
if(NOT HAVE_PATCH)
message(FATAL_ERROR "The 'patch' program is required to build the ScaFaCoS library")
endif()
include(ExternalProject)
ExternalProject_Add(scafacos_build
URL ${SCAFACOS_URL} ${SCAFACOS_FALLBACK}
URL_MD5 ${SCAFACOS_MD5}
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
--with-internal-fftw --with-internal-pfft

View File

@ -21,11 +21,11 @@ if(ENABLE_TESTING)
# also only verified with Fedora Linux > 30 and Ubuntu 18.04 or 22.04+(Ubuntu 20.04 fails)
if((CMAKE_SYSTEM_NAME STREQUAL "Linux")
AND ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
if(((CMAKE_LINUX_DISTRO STREQUAL "Ubuntu") AND
((CMAKE_DISTRO_VERSION VERSION_LESS_EQUAL 18.04) OR (CMAKE_DISTRO_VERSION VERSION_GREATER_EQUAL 22.04)))
if(((CMAKE_LINUX_DISTRO STREQUAL "Ubuntu") AND (CMAKE_DISTRO_VERSION VERSION_GREATER_EQUAL 22.04))
OR ((CMAKE_LINUX_DISTRO STREQUAL "Fedora") AND (CMAKE_DISTRO_VERSION VERSION_GREATER 30)))
include(CheckCXXCompilerFlag)
set(CMAKE_CUSTOM_LINKER_DEFAULT default)
check_cxx_compiler_flag(--ld-path=${CMAKE_LINKER} HAVE_LD_PATH_FLAG)
check_cxx_compiler_flag(-fuse-ld=mold HAVE_MOLD_LINKER_FLAG)
check_cxx_compiler_flag(-fuse-ld=lld HAVE_LLD_LINKER_FLAG)
check_cxx_compiler_flag(-fuse-ld=gold HAVE_GOLD_LINKER_FLAG)
@ -50,6 +50,17 @@ if(ENABLE_TESTING)
if(NOT "${CMAKE_CUSTOM_LINKER}" STREQUAL "default")
target_link_options(lammps PUBLIC -fuse-ld=${CMAKE_CUSTOM_LINKER})
endif()
if(HAVE_LD_PATH_FLAG)
if("${CMAKE_CUSTOM_LINKER}" STREQUAL "mold")
target_link_options(lammps PUBLIC --ld-path=${HAVE_MOLD_LINKER_BIN})
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "lld")
target_link_options(lammps PUBLIC --ld-path=${HAVE_LLD_LINKER_BIN})
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "gold")
target_link_options(lammps PUBLIC --ld-path=${HAVE_GOLD_LINKER_BIN})
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "bfd")
target_link_options(lammps PUBLIC --ld-path=${HAVE_BFD_LINKER_BIN})
endif()
endif()
endif()
endif()

View File

@ -6,6 +6,10 @@ if(BUILD_TOOLS)
add_executable(stl_bin2txt ${LAMMPS_TOOLS_DIR}/stl_bin2txt.cpp)
install(TARGETS stl_bin2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
add_executable(reformat-json ${LAMMPS_TOOLS_DIR}/json/reformat-json.cpp)
target_include_directories(reformat-json PRIVATE ${LAMMPS_SOURCE_DIR})
install(TARGETS reformat-json DESTINATION ${CMAKE_INSTALL_BINDIR})
include(CheckGeneratorSupport)
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
include(CheckLanguage)

View File

@ -7,6 +7,11 @@ export LC_ALL=C
BASEDIR="$(dirname "$0")"
EXENAME="$(basename "$0")"
# save old settings (for restoring them later)
OLDPATH="${PATH}"
OLDLDLIB="${LD_LIBRARY_PATH}"
# prepend path to find our custom executables
PATH="${BASEDIR}/bin:${PATH}"
# append to LD_LIBRARY_PATH to prefer local (newer) libs
@ -15,6 +20,8 @@ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BASEDIR}/lib"
# set some environment variables for LAMMPS etc.
LAMMPS_POTENTIALS="${BASEDIR}/share/lammps/potentials"
MSI2LMP_LIBRARY="${BASEDIR}/share/lammps/frc_files"
export LD_LIBRARY_PATH LAMMPS_POTENTIALS MSI2LMP_LIBRARY PATH
# export everything
export LD_LIBRARY_PATH LAMMPS_POTENTIALS MSI2LMP_LIBRARY PATH OLDPATH OLDLDLIB
exec "${BASEDIR}/bin/${EXENAME}" "$@"

View File

@ -33,6 +33,14 @@
#
#---------------------------------------------
# restore previously saved environment variables, if available
if [ -n "${OLDPATH}" ]
then
PATH="${OLDPATH}"
LD_LIBRARY_PATH="${OLDLDLIB}"
export PATH LD_LIBRARY_PATH
fi
NEW_LIBRARY_PATH="/usr/local/lib64"
for s in $(echo $LD_LIBRARY_PATH | sed -e 's/:/ /g')
do \

View File

@ -4,6 +4,7 @@
set(ALL_PACKAGES
ADIOS
AMOEBA
APIP
ASPHERE
ATC
AWPMD

View File

@ -6,6 +6,7 @@
set(ALL_PACKAGES
ADIOS
AMOEBA
APIP
ASPHERE
ATC
AWPMD

View File

@ -19,12 +19,19 @@ set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(MPI_CXX "hipcc" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
set(MPI_C "hipcc" CACHE STRING "" FORCE)
set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE)
# change as needed. This is for Fedora Linux 41 and 42
set(_libomp_root "/usr/lib/clang/18")
# we need to explicitly specify the include dir, since hipcc will
# compile each file twice and doesn't find omp.h the second time
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "hipcc" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp=libomp -I${_libomp_root}/include" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp=libomp -I${_libomp_root}/include" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)

View File

@ -1,9 +1,8 @@
# preset that enables KOKKOS and selects CUDA compilation with OpenMP
# enabled as well. The GPU architecture *must* match your hardware
# enabled as well. The GPU architecture *must* match your hardware (If not manually set, Kokkos will try to autodetect it).
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)
set(Kokkos_ARCH_PASCAL60 ON CACHE BOOL "" FORCE)
set(BUILD_OMP ON CACHE BOOL "" FORCE)
get_filename_component(NVCC_WRAPPER_CMD ${CMAKE_CURRENT_SOURCE_DIR}/../lib/kokkos/bin/nvcc_wrapper ABSOLUTE)
set(CMAKE_CXX_COMPILER ${NVCC_WRAPPER_CMD} CACHE FILEPATH "" FORCE)

View File

@ -1,8 +1,8 @@
# preset that enables KOKKOS and selects HIP compilation with OpenMP
# enabled as well. Also sets some performance related compiler flags.
# preset that enables KOKKOS and selects HIP compilation withOUT OpenMP.
# Kokkos OpenMP is not compatible with the second pass of hipcc.
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_HIP ON CACHE BOOL "" FORCE)
set(Kokkos_ARCH_VEGA90A on CACHE BOOL "" FORCE)
@ -11,11 +11,11 @@ set(BUILD_OMP ON CACHE BOOL "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -munsafe-fp-atomics" CACHE STRING "" FORCE)
# If KSPACE is also enabled, use CUFFT for FFTs
# If KSPACE is also enabled, use HIPFFT for FFTs
set(FFT_KOKKOS "HIPFFT" CACHE STRING "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
#set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
# these flags are needed to build with Cray MPICH on OLCF Crusher
#-D CMAKE_CXX_FLAGS="-I/${MPICH_DIR}/include"

View File

@ -3,6 +3,7 @@
set(PACKAGES_WITH_LIB
ADIOS
APIP
ATC
AWPMD
COMPRESS

View File

@ -99,8 +99,6 @@ html: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJ
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
ln -sf Manual.html html/index.html;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
@ -162,8 +160,6 @@ epub: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
deactivate ;\
)
@ -183,8 +179,6 @@ pdf: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
rst_anchor_check src/*.rst ;\
@ -256,6 +250,15 @@ link_check : $(VENV) html
deactivate ;\
)
upgrade: $(VENV)
@(\
. $(VENV)/bin/activate; \
pip $(PIP_OPTIONS) install --upgrade pip; \
pip $(PIP_OPTIONS) install --upgrade wheel; \
pip $(PIP_OPTIONS) install --upgrade -r $(BUILDDIR)/utils/requirements.txt; \
deactivate;\
)
xmlgen : doxygen/xml/index.xml
doxygen/Doxyfile: doxygen/Doxyfile.in

View File

@ -5,13 +5,13 @@ digraph releases {
github -> develop [label="Merge commits"];
{
rank = "same";
work [shape="none" label="Development branches:"]
work [shape="none" label="Development branches:" fontname="bold"]
develop [label="'develop' branch" height=0.75];
maintenance [label="'maintenance' branch" height=0.75];
};
{
rank = "same";
upload [shape="none" label="Release branches:"]
upload [shape="none" label="Release branches:" fontname="bold"]
release [label="'release' branch" height=0.75];
stable [label="'stable' branch" height=0.75];
};
@ -22,7 +22,7 @@ digraph releases {
maintenance -> stable [label="Updates to stable release"];
{
rank = "same";
tag [shape="none" label="Applied tags:"];
tag [shape="none" label="Applied tags:" fontname="bold"];
patchtag [shape="box" label="patch_<date>"];
stabletag [shape="box" label="stable_<date>"];
updatetag [shape="box" label="stable_<date>_update<num>"];

View File

@ -1,7 +1,7 @@
.TH LAMMPS "1" "2 April 2025" "2025-04-02"
.TH LAMMPS "1" "12 June 2025" "2025-06-12"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator. Version 2 April 2025
\- Molecular Dynamics Simulator. Version 12 June 2025
.SH SYNOPSIS
.B lmp

View File

@ -14,32 +14,10 @@ As an alternative, you can download a package with pre-built executables
or automated build trees, as described in the :doc:`Install <Install>`
section of the manual.
Prerequisites
-------------
Which software you need to compile and use LAMMPS strongly depends on
which :doc:`features and settings <Build_settings>` and which
:doc:`optional packages <Packages_list>` you are trying to include.
Common to all is that you need a C++ and C compiler, where the C++
compiler has to support at least the C++11 standard (note that some
compilers require command-line flag to activate C++11 support).
Furthermore, if you are building with CMake, you need at least CMake
version 3.20 and a compatible build tool (make or ninja-build); if you
are building the the legacy GNU make based build system you need GNU
make (other make variants are not going to work since the build system
uses features unique to GNU make) and a Unix-like build environment with
a Bourne shell, and shell tools like "sed", "grep", "touch", "test",
"tr", "cp", "mv", "rm", "ln", "diff" and so on. Parts of LAMMPS
interface with or use Python version 3.6 or later.
The LAMMPS developers aim to keep LAMMPS very portable and usable -
at least in parts - on most operating systems commonly used for
running MD simulations. Please see the :doc:`section on portablility
<Intro_portability>` for more details.
.. toctree::
:maxdepth: 1
Build_prerequisites
Build_cmake
Build_make
Build_link

View File

@ -28,28 +28,6 @@ variable VERBOSE set to 1:
----------
.. _clang-tidy:
Enable static code analysis with clang-tidy (CMake only)
--------------------------------------------------------
The `clang-tidy tool <https://clang.llvm.org/extra/clang-tidy/>`_ is a
static code analysis tool to diagnose (and potentially fix) typical
programming errors or coding style violations. It has a modular framework
of tests that can be adjusted to help identifying problems before they
become bugs and also assist in modernizing large code bases (like LAMMPS).
It can be enabled for all C++ code with the following CMake flag
.. code-block:: bash
-D ENABLE_CLANG_TIDY=value # value = no (default) or yes
With this flag enabled all source files will be processed twice, first to
be compiled and then to be analyzed. Please note that the analysis can be
significantly more time-consuming than the compilation itself.
----------
.. _iwyu_processing:
Report missing and unneeded '#include' statements (CMake only)
@ -523,7 +501,7 @@ to do this to install it via pip:
.. code-block:: bash
pip install git+https://github.com/gcovr/gcovr.git
python3 -m pip install gcovr
After post-processing with ``gen_coverage_html`` the results are in
a folder ``coverage_html`` and can be viewed with a web browser.

View File

@ -35,6 +35,7 @@ This is the list of packages that may require additional steps.
:columns: 6
* :ref:`ADIOS <adios>`
* :ref:`APIP <apip>`
* :ref:`ATC <atc>`
* :ref:`AWPMD <awpmd>`
* :ref:`COLVARS <colvar>`
@ -614,6 +615,9 @@ They must be specified in uppercase.
* - ZEN4
- HOST
- AMD Zen4 architecture
* - ZEN5
- HOST
- AMD Zen5 architecture
* - RISCV_SG2042
- HOST
- SG2042 (RISC-V) CPUs
@ -668,6 +672,12 @@ They must be specified in uppercase.
* - HOPPER90
- GPU
- NVIDIA Hopper generation CC 9.0
* - BLACKWELL100
- GPU
- NVIDIA Blackwell generation CC 10.0
* - BLACKWELL120
- GPU
- NVIDIA Blackwell generation CC 12.0
* - AMD_GFX906
- GPU
- AMD GPU MI50/60
@ -716,8 +726,11 @@ They must be specified in uppercase.
* - INTEL_PVC
- GPU
- Intel GPU Ponte Vecchio
* - INTEL_DG2
- GPU
- Intel GPU DG2
This list was last updated for version 4.6.0 of the Kokkos library.
This list was last updated for version 4.6.2 of the Kokkos library.
.. tabs::
@ -1272,6 +1285,34 @@ systems.
----------
.. _apip:
APIP package
-----------------------------
The APIP package depends on the library of the
:ref:`ML-PACE <ml-pace>` package.
The code for the library can be found
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
.. tabs::
.. tab:: CMake build
No additional settings are needed besides ``-D PKG_APIP=yes``
and ``-D PKG_ML-PACE=yes``.
One can use a local version of the ML-PACE library instead of
automatically downloading the library as described :ref:`here <ml-pace>`.
.. tab:: Traditional make
You need to install the ML-PACE package *first* and follow
the instructions :ref:`here <ml-pace>` before installing
the APIP package.
----------
.. _atc:
ATC package

View File

@ -57,6 +57,8 @@ Python interpreter version 3.8 or later, the ``doxygen`` tools and
internet access to download additional files and tools are required.
This download is usually only required once or after the documentation
folder is returned to a pristine state with ``make clean-all``.
You can also upgrade those packages to their latest available versions
with ``make upgrade``.
For the documentation build a python virtual environment is set up in
the folder ``doc/docenv`` and various python packages are installed into
@ -82,6 +84,7 @@ folder. The following ``make`` commands are available:
make clean # remove intermediate RST files created by HTML build
make clean-all # remove entire build folder and any cached data
make upgrade # upgrade the python packages in the virtual environment
make anchor_check # check for duplicate anchor labels
make style_check # check for complete and consistent style lists

View File

@ -0,0 +1,22 @@
Prerequisites
-------------
Which software you need to compile and use LAMMPS strongly depends on
which :doc:`features and settings <Build_settings>` and which
:doc:`optional packages <Packages_list>` you are trying to include.
Common to all is that you need a C++ and C compiler, where the C++
compiler has to support at least the C++11 standard (note that some
compilers require command-line flag to activate C++11 support).
Furthermore, if you are building with CMake, you need at least CMake
version 3.20 and a compatible build tool (make or ninja-build); if you
are building the the legacy GNU make based build system you need GNU
make (other make variants are not going to work since the build system
uses features unique to GNU make) and a Unix-like build environment with
a Bourne shell, and shell tools like "sed", "grep", "touch", "test",
"tr", "cp", "mv", "rm", "ln", "diff" and so on. Parts of LAMMPS
interface with or use Python version 3.6 or later.
The LAMMPS developers aim to keep LAMMPS very portable and usable -
at least in parts - on most operating systems commonly used for
running MD simulations. Please see the :doc:`section on portablility
<Intro_portability>` for more details.

View File

@ -22,6 +22,7 @@ OPT.
* :doc:`append/atoms <fix_append_atoms>`
* :doc:`atc <fix_atc>`
* :doc:`atom/swap <fix_atom_swap>`
* :doc:`atom_weight/apip <fix_atom_weight_apip>`
* :doc:`ave/atom <fix_ave_atom>`
* :doc:`ave/chunk <fix_ave_chunk>`
* :doc:`ave/correlate <fix_ave_correlate>`
@ -29,6 +30,7 @@ OPT.
* :doc:`ave/grid <fix_ave_grid>`
* :doc:`ave/histo <fix_ave_histo>`
* :doc:`ave/histo/weight <fix_ave_histo>`
* :doc:`ave/moments <fix_ave_moments>`
* :doc:`ave/time <fix_ave_time>`
* :doc:`aveforce <fix_aveforce>`
* :doc:`balance <fix_balance>`
@ -64,7 +66,7 @@ OPT.
* :doc:`electrode/conp (i) <fix_electrode>`
* :doc:`electrode/conq (i) <fix_electrode>`
* :doc:`electrode/thermo (i) <fix_electrode>`
* :doc:`electron/stopping <fix_electron_stopping>`
* :doc:`electron/stopping (k) <fix_electron_stopping>`
* :doc:`electron/stopping/fit <fix_electron_stopping>`
* :doc:`enforce2d (k) <fix_enforce2d>`
* :doc:`eos/cv <fix_eos_cv>`
@ -77,6 +79,7 @@ OPT.
* :doc:`flow/gauss <fix_flow_gauss>`
* :doc:`freeze (k) <fix_freeze>`
* :doc:`gcmc <fix_gcmc>`
* :doc:`gjf <fix_gjf>`
* :doc:`gld <fix_gld>`
* :doc:`gle <fix_gle>`
* :doc:`gravity (ko) <fix_gravity>`
@ -84,11 +87,14 @@ OPT.
* :doc:`halt <fix_halt>`
* :doc:`heat <fix_heat>`
* :doc:`heat/flow <fix_heat_flow>`
* :doc:`hmc <fix_hmc>`
* :doc:`hyper/global <fix_hyper_global>`
* :doc:`hyper/local <fix_hyper_local>`
* :doc:`imd <fix_imd>`
* :doc:`indent <fix_indent>`
* :doc:`ipi <fix_ipi>`
* :doc:`lambda/apip <fix_lambda_apip>`
* :doc:`lambda_thermostat/apip <fix_lambda_thermostat_apip>`
* :doc:`langevin (k) <fix_langevin>`
* :doc:`langevin/drude <fix_langevin_drude>`
* :doc:`langevin/eff <fix_langevin_eff>`
@ -111,6 +117,7 @@ OPT.
* :doc:`mvv/tdpd <fix_mvv_dpd>`
* :doc:`neb <fix_neb>`
* :doc:`neb/spin <fix_neb_spin>`
* :doc:`neighbor/swap <fix_neighbor_swap>`
* :doc:`nonaffine/displacement <fix_nonaffine_displacement>`
* :doc:`nph (ko) <fix_nh>`
* :doc:`nph/asphere (o) <fix_nph_asphere>`
@ -216,6 +223,7 @@ OPT.
* :doc:`rigid/small (o) <fix_rigid>`
* :doc:`rx (k) <fix_rx>`
* :doc:`saed/vtk <fix_saed_vtk>`
* :doc:`set <fix_set>`
* :doc:`setforce (k) <fix_setforce>`
* :doc:`setforce/spin <fix_setforce>`
* :doc:`sgcmc <fix_sgcmc>`

View File

@ -31,3 +31,5 @@ OPT.
* :doc:`pppm/dielectric <kspace_style>`
* :doc:`pppm/electrode (i) <kspace_style>`
* :doc:`scafacos <kspace_style>`
* :doc:`zero <kspace_style>`

View File

@ -96,7 +96,9 @@ OPT.
* :doc:`eam/cd <pair_eam>`
* :doc:`eam/cd/old <pair_eam>`
* :doc:`eam/fs (gikot) <pair_eam>`
* :doc:`eam/fs/apip <pair_eam_apip>`
* :doc:`eam/he <pair_eam>`
* :doc:`eam/apip <pair_eam_apip>`
* :doc:`edip (o) <pair_edip>`
* :doc:`edip/multi <pair_edip>`
* :doc:`edpd (g) <pair_mesodpd>`
@ -124,6 +126,9 @@ OPT.
* :doc:`ilp/tmd (t) <pair_ilp_tmd>`
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
* :doc:`lambda/input/apip <pair_lambda_input_apip>`
* :doc:`lambda/input/csp/apip <pair_lambda_input_apip>`
* :doc:`lambda/zone/apip <pair_lambda_zone_apip>`
* :doc:`lcbop <pair_lcbop>`
* :doc:`lebedeva/z <pair_lebedeva_z>`
* :doc:`lennard/mdf <pair_mdf>`
@ -237,6 +242,9 @@ OPT.
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
* :doc:`pace (k) <pair_pace>`
* :doc:`pace/extrapolation (k) <pair_pace>`
* :doc:`pace/apip <pair_pace_apip>`
* :doc:`pace/fast/apip <pair_pace_apip>`
* :doc:`pace/precise/apip <pair_pace_apip>`
* :doc:`pedone (o) <pair_pedone>`
* :doc:`pod (k) <pair_pod>`
* :doc:`peri/eps <pair_peri>`

View File

@ -1,7 +1,7 @@
Removed commands and packages
=============================
.. contents:: \
.. contents::
------
@ -12,10 +12,21 @@ stop LAMMPS and print a suitable error message in most cases, when a
style/command is used that has been removed or will replace the command
with the direct alternative (if available) and print a warning.
GJF formulation in fix langevin
-------------------------------
.. deprecated:: 12Jun2025
The *gjf* keyword in fix langevin is deprecated and will be removed
soon. The GJF functionality has been moved to its own fix style
:doc:`fix gjf <fix_gjf>` and it is strongly recommended to use that
fix instead.
LAMMPS shell
------------
.. versionchanged:: 29Aug2024
.. deprecated:: 29Aug2024
The LAMMPS shell has been removed from the LAMMPS distribution. Users
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
@ -23,7 +34,7 @@ are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
i-PI tool
---------
.. versionchanged:: 27Jun2024
.. deprecated:: 27Jun2024
The i-PI tool has been removed from the LAMMPS distribution. Instead,
instructions to install i-PI from PyPI via pip are provided.

View File

@ -68,24 +68,25 @@ Members of ``lammpsplugin_t``
* - author
- String with the name and email of the author
* - creator.v1
- Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, or command styles
- Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, command, or minimize styles
* - creator.v2
- Pointer to factory function for compute, fix, or region styles
- Pointer to factory function for compute, fix, region, or run styles
* - handle
- Pointer to the open DSO file handle
Only one of the two alternate creator entries can be used at a time and
which of those is determined by the style of plugin. The "creator.v1"
element is for factory functions of supported styles computing forces
(i.e. pair, bond, angle, dihedral, or improper styles) or command styles
and the function takes as single argument the pointer to the LAMMPS
instance. The factory function is cast to the ``lammpsplugin_factory1``
type before assignment. The "creator.v2" element is for factory
functions creating an instance of a fix, compute, or region style and
takes three arguments: a pointer to the LAMMPS instance, an integer with
the length of the argument list and a ``char **`` pointer to the list of
arguments. The factory function pointer needs to be cast to the
``lammpsplugin_factory2`` type before assignment.
(i.e. pair, bond, angle, dihedral, or improper styles), command styles,
or minimize styles and the function takes as single argument the pointer
to the LAMMPS instance. The factory function is cast to the
``lammpsplugin_factory1`` type before assignment. The "creator.v2"
element is for factory functions creating an instance of a fix, compute,
region, or run style and takes three arguments: a pointer to the LAMMPS
instance, an integer with the length of the argument list and a ``char
**`` pointer to the list of arguments. The factory function pointer
needs to be cast to the ``lammpsplugin_factory2`` type before
assignment.
Pair style example
^^^^^^^^^^^^^^^^^^
@ -247,8 +248,8 @@ DSO handle. The registration function is called with a pointer to the address
of this struct and the pointer of the LAMMPS class. The registration function
will then add the factory function of the plugin style to the respective
style map under the provided name. It will also make a copy of the struct
in a list of all loaded plugins and update the reference counter for loaded
plugins from this specific DSO file.
in a global list of all loaded plugins and update the reference counter for
loaded plugins from this specific DSO file.
The pair style itself (i.e. the PairMorse2 class in this example) can be
written just like any other pair style that is included in LAMMPS. For
@ -263,6 +264,21 @@ the plugin will override the existing code. This can be used to modify
the behavior of existing styles or to debug new versions of them without
having to re-compile or re-install all of LAMMPS.
.. versionchanged:: 12Jun2025
When using the :doc:`clear <clear>` command, plugins are not unloaded
but restored to their respective style maps. This also applies when
multiple LAMMPS instances are created and deleted through the library
interface. The :doc:`plugin load <plugin>` load command may be issued
again, but for existing plugins they will be skipped. To replace
plugins they must be explicitly unloaded with :doc:`plugin unload
<plugin>`. When multiple LAMMPS instances are created concurrently, any
loaded plugins will be added to the global list of plugins, but are not
immediately available to any LAMMPS instance that was created before
loading the plugin. To "import" such plugins, the :doc:`plugin restore
<plugin>` may be used. Plugins are only removed when they are explicitly
unloaded or the LAMMPS interface is "finalized".
Compiling plugins
^^^^^^^^^^^^^^^^^

View File

@ -29,6 +29,8 @@ Available topics in mostly chronological order are:
- `Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments`_
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
- `Refactored grid communication using Grid3d/Grid2d classes instead of GridComm`_
- `FLERR as first argument to minimum image functions in Domain class`_
- `Use utils::logmesg() instead of error->warning()`_
----
@ -610,3 +612,71 @@ KSpace solvers which use distributed FFT grids:
- ``src/KSPACE/pppm.cpp``
This change is **required** or else the code will not compile.
FLERR as first argument to minimum image functions in Domain class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionchanged:: 12Jun2025
The ``Domain::minimum_image()`` and ``Domain::minimum_image_big()``
functions were changed to take the ``FLERR`` macros as first argument.
This way the error message indicates *where* the function was called
instead of pointing to the implementation of the function. Example:
Old:
.. code-block:: c++
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image_big(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
New:
.. code-block:: c++
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(FLERR, delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image_big(FLERR, delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
This change is **required** or else the code will not compile.
Use utils::logmesg() instead of error->warning()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionchanged:: TBD
The ``Error::message()`` method has been removed since its functionality
has been superseded by the :cpp:func:`utils::logmesg` function.
Old:
.. code-block:: c++
if (comm->me == 0) {
error->message(FLERR, "INFO: About to read data file: {}", filename);
}
New:
.. code-block:: c++
if (comm->me == 0) utils::logmesg(lmp, "INFO: About to read data file: {}\n", filename);
This change is **required** or else the code will not compile.

View File

@ -1,124 +1,149 @@
Common problems
===============
Common issues that are often regarded as bugs
=============================================
If two LAMMPS runs do not produce the exact same answer on different
machines or different numbers of processors, this is typically not a
bug. In theory you should get identical answers on any number of
processors and on any machine. In practice, numerical round-off can
cause slight differences and eventual divergence of molecular dynamics
phase space trajectories within a few 100s or few 1000s of timesteps.
However, the statistical properties of the two runs (e.g. average
energy or temperature) should still be the same.
The list below are some random notes on behavior of LAMMPS that is
sometimes unexpected or even considered a bug. Most of the time, these
are just issues of understanding how LAMMPS is implemented and
parallelized. Please also have a look at the :doc:`Error details
discussions page <Errors_details>` that contains recommendations for
tracking down issues and explanations for error messages that may
sometimes be confusing or need additional explanations.
If the :doc:`velocity <velocity>` command is used to set initial atom
velocities, a particular atom can be assigned a different velocity
when the problem is run on a different number of processors or on
different machines. If this happens, the phase space trajectories of
the two simulations will rapidly diverge. See the discussion of the
*loop* option in the :doc:`velocity <velocity>` command for details and
options that avoid this issue.
- A LAMMPS simulation typically has two stages, 1) issuing commands
and 2) run or minimize. Most LAMMPS errors are detected in stage 1),
others at the beginning of stage 2), and finally others like a bond
stretching too far may or lost atoms or bonds may not occur until the
middle of a run.
Similarly, the :doc:`create_atoms <create_atoms>` command generates a
lattice of atoms. For the same physical system, the ordering and
numbering of atoms by atom ID may be different depending on the number
of processors.
- If two LAMMPS runs do not produce the exact same answer on different
machines or different numbers of processors, this is typically not a
bug. In theory you should get identical answers on any number of
processors and on any machine. In practice, numerical round-off can
cause slight differences and eventual divergence of molecular dynamics
phase space trajectories within a few 100s or few 1000s of timesteps.
This can be triggered by different ordering of atoms due to different
domain decompositions, but also through different CPU architectures,
different operating systems, different compilers or compiler versions,
different compiler optimization levels, different FFT libraries.
However, the statistical properties of the two runs (e.g. average
energy or temperature) should still be the same.
Some commands use random number generators which may be setup to
produce different random number streams on each processor and hence
will produce different effects when run on different numbers of
processors. A commonly-used example is the :doc:`fix langevin <fix_langevin>` command for thermostatting.
- If the :doc:`velocity <velocity>` command is used to set initial atom
velocities, a particular atom can be assigned a different velocity
when the problem is run on a different number of processors or on
different machines. If this happens, the phase space trajectories of
the two simulations will rapidly diverge. See the discussion of the
*loop* option in the :doc:`velocity <velocity>` command for details
and options that avoid this issue.
A LAMMPS simulation typically has two stages, setup and run. Most
LAMMPS errors are detected at setup time; others like a bond
stretching too far may not occur until the middle of a run.
- Similarly, the :doc:`create_atoms <create_atoms>` command generates a
lattice of atoms. For the same physical system, the ordering and
numbering of atoms by atom ID may be different depending on the number
of processors.
LAMMPS tries to flag errors and print informative error messages so
you can fix the problem. For most errors it will also print the last
input script command that it was processing. Of course, LAMMPS cannot
figure out your physics or numerical mistakes, like choosing too big a
timestep, specifying erroneous force field coefficients, or putting 2
atoms on top of each other! If you run into errors that LAMMPS
does not catch that you think it should flag, please send an email to
the `developers <https://www.lammps.org/authors.html>`_ or create an new
topic on the dedicated `MatSci forum section <https://matsci.org/lammps/>`_.
- Some commands use random number generators which may be setup to
produce different random number streams on each processor and hence
will produce different effects when run on different numbers of
processors. A commonly-used example is the :doc:`fix langevin
<fix_langevin>` command for thermostatting.
If you get an error message about an invalid command in your input
script, you can determine what command is causing the problem by
looking in the log.lammps file or using the :doc:`echo command <echo>`
to see it on the screen. If you get an error like "Invalid ...
style", with ... being fix, compute, pair, etc, it means that you
mistyped the style name or that the command is part of an optional
package which was not compiled into your executable. The list of
available styles in your executable can be listed by using
:doc:`the -h command-line switch <Run_options>`. The installation and
compilation of optional packages is explained on the
:doc:`Build packages <Build_package>` doc page.
- LAMMPS tries to flag errors and print informative error messages so
you can fix the problem. For most errors it will also print the last
input script command that it was processing or even point to the
keyword that is causing troubles. Of course, LAMMPS cannot figure out
your physics or numerical mistakes, like choosing too big a timestep,
specifying erroneous force field coefficients, or putting 2 atoms on
top of each other! Also, LAMMPS does not know what you *intend* to
do, but very strictly applies the syntax as described in the
documentation. If you run into errors that LAMMPS does not catch that
you think it should flag, please send an email to the `developers
<https://www.lammps.org/authors.html>`_ or create an new topic on the
dedicated `MatSci forum section <https://matsci.org/lammps/>`_.
For a given command, LAMMPS expects certain arguments in a specified
order. If you mess this up, LAMMPS will often flag the error, but it
may also simply read a bogus argument and assign a value that is
valid, but not what you wanted. E.g. trying to read the string "abc"
as an integer value of 0. Careful reading of the associated doc page
for the command should allow you to fix these problems. In most cases,
where LAMMPS expects to read a number, either integer or floating point,
it performs a stringent test on whether the provided input actually
is an integer or floating-point number, respectively, and reject the
input with an error message (for instance, when an integer is required,
but a floating-point number 1.0 is provided):
- If you get an error message about an invalid command in your input
script, you can determine what command is causing the problem by
looking in the log.lammps file or using the :doc:`echo command <echo>`
to see it on the screen. If you get an error like "Invalid ...
style", with ... being fix, compute, pair, etc, it means that you
mistyped the style name or that the command is part of an optional
package which was not compiled into your executable. The list of
available styles in your executable can be listed by using
:doc:`the -h command-line switch <Run_options>`. The installation and
compilation of optional packages is explained on the :doc:`Build
packages <Build_package>` doc page.
.. parsed-literal::
- For a given command, LAMMPS expects certain arguments in a specified
order. If you mess this up, LAMMPS will often flag the error, but it
may also simply read a bogus argument and assign a value that is
valid, but not what you wanted. E.g. trying to read the string "abc"
as an integer value of 0. Careful reading of the associated doc page
for the command should allow you to fix these problems. In most cases,
where LAMMPS expects to read a number, either integer or floating
point, it performs a stringent test on whether the provided input
actually is an integer or floating-point number, respectively, and
reject the input with an error message (for instance, when an integer
is required, but a floating-point number 1.0 is provided):
ERROR: Expected integer parameter instead of '1.0' in input script or data file
.. parsed-literal::
Some commands allow for using variable references in place of numeric
constants so that the value can be evaluated and may change over the
course of a run. This is typically done with the syntax *v_name* for a
parameter, where name is the name of the variable. On the other hand,
immediate variable expansion with the syntax ${name} is performed while
reading the input and before parsing commands,
ERROR: Expected integer parameter instead of '1.0' in input script or data file
.. note::
- Some commands allow for using variable references in place of numeric
constants so that the value can be evaluated and may change over the
course of a run. This is typically done with the syntax *v_name* for
a parameter, where name is the name of the variable. On the other
hand, immediate variable expansion with the syntax ${name} is
performed while reading the input and before parsing commands,
Using a variable reference (i.e. *v_name*) is only allowed if
the documentation of the corresponding command explicitly says it is.
Otherwise, you will receive an error message of this kind:
.. note::
.. parsed-literal::
Using a variable reference (i.e. *v_name*) is only allowed if
the documentation of the corresponding command explicitly says it is.
Otherwise, you will receive an error message of this kind:
ERROR: Expected floating point parameter instead of 'v_name' in input script or data file
.. parsed-literal::
Generally, LAMMPS will print a message to the screen and logfile and
exit gracefully when it encounters a fatal error. Sometimes it will
print a WARNING to the screen and logfile and continue on; you can
decide if the WARNING is important or not. A WARNING message that is
generated in the middle of a run is only printed to the screen, not to
the logfile, to avoid cluttering up thermodynamic output. If LAMMPS
crashes or hangs without spitting out an error message first then it
could be a bug (see :doc:`this section <Errors_bugs>`) or one of the following
cases:
ERROR: Expected floating point parameter instead of 'v_name' in input script or data file
LAMMPS runs in the available memory a processor allows to be
allocated. Most reasonable MD runs are compute limited, not memory
limited, so this should not be a bottleneck on most platforms. Almost
all large memory allocations in the code are done via C-style malloc's
which will generate an error message if you run out of memory.
Smaller chunks of memory are allocated via C++ "new" statements. If
you are unlucky you could run out of memory just when one of these
small requests is made, in which case the code will crash or hang (in
parallel), since LAMMPS does not trap on those errors.
- Generally, LAMMPS will print a message to the screen and logfile and
exit gracefully when it encounters a fatal error. When running in
parallel this message may be stuck in an I/O buffer and LAMMPS will be
terminated before that buffer is printed. In that case you can try
adding the ``-nonblock`` or ``-nb`` command-line flag to turn off that
buffering. Please note that this should not be used for production
runs, since turning off buffering usually has a significant negative
impact on performance (even worse than :doc:`thermo_modify flush yes
<thermo_modify>`). Sometimes LAMMPS will print a WARNING to the
screen and logfile and continue on; you can decide if the WARNING is
important or not, but as a general rule do not ignore warnings that
you not understand. A WARNING message that is generated in the middle
of a run is only printed to the screen, not to the logfile, to avoid
cluttering up thermodynamic output. If LAMMPS crashes or hangs
without generating an error message first then it could be a bug
(see :doc:`this section <Errors_bugs>`).
Illegal arithmetic can cause LAMMPS to run slow or crash. This is
typically due to invalid physics and numerics that your simulation is
computing. If you see wild thermodynamic values or NaN values in your
LAMMPS output, something is wrong with your simulation. If you
suspect this is happening, it is a good idea to print out
thermodynamic info frequently (e.g. every timestep) via the
:doc:`thermo <thermo>` so you can monitor what is happening.
Visualizing the atom movement is also a good idea to ensure your model
is behaving as you expect.
- LAMMPS runs in the available memory a processor allows to be
allocated. Most reasonable MD runs are compute limited, not memory
limited, so this should not be a bottleneck on most platforms. Almost
all large memory allocations in the code are done via C-style malloc's
which will generate an error message if you run out of memory.
Smaller chunks of memory are allocated via C++ "new" statements. If
you are unlucky you could run out of memory just when one of these
small requests is made, in which case the code will crash or hang (in
parallel).
In parallel, one way LAMMPS can hang is due to how different MPI
implementations handle buffering of messages. If the code hangs
without an error message, it may be that you need to specify an MPI
setting or two (usually via an environment variable) to enable
buffering or boost the sizes of messages that can be buffered.
- Illegal arithmetic can cause LAMMPS to run slow or crash. This is
typically due to invalid physics and numerics that your simulation is
computing. If you see wild thermodynamic values or NaN values in your
LAMMPS output, something is wrong with your simulation. If you
suspect this is happening, it is a good idea to print out
thermodynamic info frequently (e.g. every timestep) via the
:doc:`thermo <thermo>` so you can monitor what is happening.
Visualizing the atom movement is also a good idea to ensure your model
is behaving as you expect.
- When running in parallel with MPI, one way LAMMPS can hang is because
LAMMPS has come across an error condition, but only on one or a few
MPI processes and not all of them. LAMMPS has two different "stop
with an error message" functions and the correct one has to be called
or else it will hang.

View File

@ -51,8 +51,11 @@ Parallel versus serial
^^^^^^^^^^^^^^^^^^^^^^
Issues where something is "lost" or "missing" often exhibit that issue
only when running in parallel. That doesn't mean there is no problem,
only the symptoms are not triggering an error quickly. Correspondingly,
*only* when running in parallel. That doesn't mean there is no problem
when running in serial, only the symptoms are not triggering an error.
This may be because there is no domain decomposition with just one
processor and thus all atoms are accessible, or it may be because the
problem will manifest faster with smaller subdomains. Correspondingly,
errors may be triggered faster with more processors and thus smaller
sub-domains.
@ -159,13 +162,17 @@ angle, dihedral, or improper with just one atom in the actual
sub-domain. Typically, this cutoff is set to the largest cutoff from
the :doc:`pair style(s) <pair_style>` plus the :doc:`neighbor list skin
distance <neighbor>` and will typically be sufficient for all bonded
interactions. But if the pair style cutoff is small, this may not be
enough. LAMMPS will print a warning in this case using some heuristic
based on the equilibrium bond length, but that still may not be
sufficient for cases where the force constants are small and thus bonds
may be stretched very far. The communication cutoff can be adjusted
with :doc:`comm_modify cutoff \<value\> <comm_modify>`, but setting this
too large will waste CPU time and memory.
interactions. But if the pair style cutoff is small (e.g. with a
repulsive-only Lennard-Jones potential) this may not be enough. It is
even worse if there is no pair style defined (or the pair style is set
to "none"), since then there will be no ghost atoms created at all.
The communication cutoff can be set or adjusted with :doc:`comm_modify
cutoff \<value\> <comm_modify>`, but setting this too large will waste
CPU time and memory. LAMMPS will print warnings in these cases. For
bonds it uses some heuristic based on the equilibrium bond length, but
that still may not be sufficient for cases where the force constants are
small and thus bonds may be stretched very far.
.. _hint09:
@ -240,6 +247,25 @@ equal style (or similar) variables can only be expanded before the box
is defined if they do not reference anything that cannot be defined
before the box (e.g. a compute or fix reference or a thermo keyword).
.. _hint13:
Illegal ... command
^^^^^^^^^^^^^^^^^^^
These are a catchall error messages that used to be used a lot in LAMMPS
(also programmers are sometimes lazy). They usually include the name of
the source file and the line where the error happened. This can be used
to track down what caused the error (most often some form of syntax error)
by looking at the source code. However, this has two disadvantages: 1. one
has to check the source file from the exact same LAMMPS version, or else
the line number would be different or the core may have been rewritten and
that specific error does not exist anymore.
The LAMMPS developers are committed to replace these too generic error
messages with more descriptive errors, e.g. listing *which* keyword was
causing the error, so that it will be much simpler to look up the
correct syntax in the manual (and without referring to the source code).
------
.. _err0001:
@ -1025,13 +1051,15 @@ Even though the LAMMPS error message recommends to increase the "one"
parameter, this may not always be the correct solution. The neighbor
list overflow can also be a symptom for some other error that cannot be
easily detected. For example, a frequent reason for an (unexpected)
high density are incorrect box boundaries (since LAMMPS wraps atoms back
high density are incorrect box dimensions (since LAMMPS wraps atoms back
into the principal box with periodic boundaries) or coordinates provided
as fractional coordinates. In both cases, LAMMPS cannot easily know
whether the input geometry has such a high density (and thus requiring
more neighbor list storage per atom) by intention. Rather than blindly
increasing the "one" parameter, it is thus worth checking if this is
justified by the combination of density and cutoff.
as fractional coordinates (LAMMPS does not support this for data files).
In both cases, LAMMPS cannot easily know whether the input geometry has
such a high density (and thus requiring more neighbor list storage per
atom) on purpose or by accident. Rather than blindly increasing the
"one" parameter, it is thus worth checking if this is justified by the
combination of density and cutoff. This is particularly recommended
when using some tool(s) to convert input or data files.
When boosting (= increasing) the "one" parameter, it is recommended to
also increase the value for the "page" parameter to maintain the ratio

View File

@ -69,10 +69,11 @@ statement. Internally, it will call either
:cpp:func:`lammps_open_fortran` or :cpp:func:`lammps_open_no_mpi` from
the C library API to create the class instance. All arguments are
optional and :cpp:func:`lammps_mpi_init` will be called automatically
if it is needed. Similarly, a possible call to
:cpp:func:`lammps_mpi_finalize` is integrated into the :f:func:`close`
function and triggered with the optional logical argument set to
``.TRUE.``. Here is a simple example:
if it is needed. Similarly, optional calls to
:cpp:func:`lammps_mpi_finalize`, :cpp:func:`lammps_kokkos_finalize`,
:cpp:func:`lammps_python_finalize`, and :cpp:func:`lammps_plugin_finalize`
are integrated into the :f:func:`close` function and triggered with the
optional logical argument set to ``.TRUE.``. Here is a simple example:
.. code-block:: fortran
@ -521,8 +522,8 @@ Procedures Bound to the :f:type:`lammps` Derived Type
This method will close down the LAMMPS instance through calling
:cpp:func:`lammps_close`. If the *finalize* argument is present and
has a value of ``.TRUE.``, then this subroutine also calls
:cpp:func:`lammps_kokkos_finalize` and
:cpp:func:`lammps_mpi_finalize`.
:cpp:func:`lammps_kokkos_finalize`, :cpp:func:`lammps_mpi_finalize`,
:cpp:func:`lammps_python_finalize`, and :cpp:func:`lammps_plugin_finalize`.
:o finalize: shut down the MPI environment of the LAMMPS
library if ``.TRUE.``.
@ -530,6 +531,8 @@ Procedures Bound to the :f:type:`lammps` Derived Type
:to: :cpp:func:`lammps_close`
:to: :cpp:func:`lammps_mpi_finalize`
:to: :cpp:func:`lammps_kokkos_finalize`
:to: :cpp:func:`lammps_python_finalize`
:to: :cpp:func:`lammps_plugin_finalize`
--------
@ -2096,7 +2099,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
--------
.. f:subroutine:: create_atoms([id,] type, x, [v,] [image,] [bexpand])
.. f:function:: create_atoms([id,] type, x, [v,] [image,] [bexpand])
This method calls :cpp:func:`lammps_create_atoms` to create additional atoms
from a given list of coordinates and a list of atom types. Additionally,
@ -2125,6 +2128,8 @@ Procedures Bound to the :f:type:`lammps` Derived Type
will be created, not dropped, and the box dimensions will be extended.
Default is ``.FALSE.``
:otype bexpand: logical,optional
:r atoms: number of created atoms
:rtype atoms: integer(c_int)
:to: :cpp:func:`lammps_create_atoms`
.. note::
@ -2149,6 +2154,18 @@ Procedures Bound to the :f:type:`lammps` Derived Type
--------
.. f:subroutine:: create_molecule(id, jsonstr)
Add molecule template from string with JSON data
.. versionadded:: TBD
:p character(len=\*) id: desired molecule-ID
:p character(len=\*) jsonstr: string with JSON data defining the molecule template
:to: :cpp:func:`lammps_create_molecule`
--------
.. f:function:: find_pair_neighlist(style[, exact][, nsub][, reqid])
Find index of a neighbor list requested by a pair style.

View File

@ -66,6 +66,7 @@ Force fields howto
:name: force_howto
:maxdepth: 1
Howto_FFgeneral
Howto_bioFF
Howto_amoeba
Howto_tip3p
@ -92,6 +93,7 @@ Packages howto
Howto_manifold
Howto_rheo
Howto_spins
Howto_apip
Tutorials howto
===============

View File

@ -0,0 +1,55 @@
Some general force field considerations
=======================================
A compact summary of the concepts, definitions, and properties of force
fields with explicit bonded interactions (like the ones discussed in
this HowTo) is given in :ref:`(Gissinger) <Typelabel2>`.
A force field has 2 parts: the formulas that define its potential
functions and the coefficients used for a particular system. To assign
parameters it is first required to assign atom types. Those are not
only based on the elements, but also on the chemical environment due to
the atoms bound to them. This often follows the chemical concept of
*functional groups*. Example: a carbon atom bound with a single bond to
a single OH-group (alcohol) would be a different atom type than a carbon
atom bound to a methyl CH3 group (aliphatic carbon). The atom types
usually then determine the non-bonded Lennard-Jones parameters and the
parameters for bonds, angles, dihedrals, and impropers. On top of that,
partial charges have to be applied. Those are usually independent of
the atom types and are determined either for groups of atoms called
residues with some fitting procedure based on quantum mechanical
calculations, or based on some increment system that add or subtract
increments from the partial charge of an atom based on the types of
the neighboring atoms.
Force fields differ in the strategies they employ to determine the
parameters and charge distribution in how generic or specific they are
which in turn has an impact on the accuracy (compare for example
CGenFF to CHARMM and GAFF to Amber). Because of the different
strategies, it is not a good idea to use a mix of parameters from
different force field *families* (like CHARMM, Amber, or GROMOS)
and that extends to the parameters for the solvent, especially
water. The publication describing the parameterization of a force
field will describe which water model to use. Changing the water
model usually leads to overall worse results (even if it may improve
on the water itself).
In addition, one has to consider that *families* of force fields like
CHARMM, Amber, OPLS, or GROMOS have evolved over time and thus provide
different *revisions* of the force field parameters. These often
corresponds to changes in the functional form or the parameterization
strategies. This may also result in changes required for simulation
settings like the preferred cutoff or how Coulomb interactions are
computed (cutoff, smoothed/shifted cutoff, or long-range with Ewald
summation or equivalent). Unless explicitly stated in the publication
describing the force field, the Coulomb interaction cannot be chosen at
will but must match the revision of the force field. That said,
liberties may be taken during the initial equilibration of a system to
speed up the process, but not for production simulations.
----------
.. _Typelabel2:
**(Gissinger)** J. R. Gissinger, I. Nikiforov, Y. Afshar, B. Waters, M. Choi, D. S. Karls, A. Stukowski, W. Im, H. Heinz, A. Kohlmeyer, and E. B. Tadmor, J Phys Chem B, 128, 3282-3297 (2024).

225
doc/src/Howto_apip.rst Normal file
View File

@ -0,0 +1,225 @@
Adaptive-precision interatomic potentials (APIP)
================================================
The :ref:`PKG-APIP <PKG-APIP>` enables use of adaptive-precision potentials
as described in :ref:`(Immel) <Immel2025_1>`.
In the context of this package, precision refers to the accuracy of an interatomic
potential.
Modern machine-learning (ML) potentials translate the accuracy of DFT
simulations into MD simulations, i.e., ML potentials are more accurate
compared to traditional empirical potentials.
However, this accuracy comes at a cost: there is a considerable performance
gap between the evaluation of classical and ML potentials, e.g., the force
calculation of a classical EAM potential is 100-1000 times faster compared
to the ML-based ACE method.
The evaluation time difference results in a conflict between large time and
length scales on the one hand and accuracy on the other.
This conflict is resolved by an APIP model for simulations, in which the highest precision
is required only locally but not globally.
An APIP model uses a precise but
expensive ML potential only for a subset of atoms, while a fast
potential is used for the remaining atoms.
Whether the precise or the fast potential is used is determined
by a continuous switching parameter :math:`\lambda_i` that can be defined for each
atom :math:`i`.
The switching parameter can be adjusted dynamically during a simulation or
kept constant as explained below.
The potential energy :math:`E_i` of an atom :math:`i` described by an
adaptive-precision
interatomic potential is given by :ref:`(Immel) <Immel2025_1>`
.. math::
E_i = \lambda_i E_i^\text{(fast)} + (1-\lambda_i) E_i^\text{(precise)},
whereas :math:`E_i^\text{(fast)}` is the potential energy of atom :math:`i`
according to a fast interatomic potential,
:math:`E_i^\text{(precise)}` is the potential energy according to a precise
interatomic potential and :math:`\lambda_i\in[0,1]` is the
switching parameter that decides how the potential energies are weighted.
Adaptive-precision saves computation time when the computation of the
precise potential is not required for many atoms, i.e., when
:math:`\lambda_i=1` applies for many atoms.
The currently implemented potentials are:
.. list-table::
:header-rows: 1
* - Fast potential
- Precise potential
* - :doc:`ACE <pair_pace_apip>`
- :doc:`ACE <pair_pace_apip>`
* - :doc:`EAM <pair_eam_apip>`
-
In theory, any short-range potential can be used for an adaptive-precision
interatomic potential. How to implement a new (fast or precise)
adaptive-precision
potential is explained in :ref:`here <implementing_new_apip_styles>`.
The switching parameter :math:`\lambda_i` that combines the two potentials
can be dynamically calculated during a
simulation.
Alternatively, one can set a constant switching parameter before the start
of a simulation.
To run a simulation with an adaptive-precision potential, one needs the
following components:
.. tabs::
.. tab:: dynamic switching parameter
#. :doc:`atom_style apip <atom_style>` so that the switching parameter :math:`\lambda_i` can be stored.
#. A fast potential: :doc:`eam/apip <pair_eam_apip>` or :doc:`pace/fast/apip <pair_pace_apip>`.
#. A precise potential: :doc:`pace/precise/apip <pair_pace_apip>`.
#. :doc:`pair_style lambda/input/apip <pair_lambda_input_apip>` to calculate :math:`\lambda_i^\text{input}`, from which :math:`\lambda_i` is calculated.
#. :doc:`fix lambda/apip <fix_lambda_apip>` to calculate the switching parameter :math:`\lambda_i`.
#. :doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>` to calculate the spatial transition zone of the switching parameter.
#. :doc:`pair_style hybrid/overlay <pair_hybrid>` to combine the previously mentioned pair_styles.
#. :doc:`fix lambda_thermostat/apip <fix_lambda_thermostat_apip>` to conserve the energy when switching parameters change.
#. :doc:`fix atom_weight/apip <fix_atom_weight_apip>` to approximate the load caused by every atom, as the computations of the pair_styles are only required for a subset of atoms.
#. :doc:`fix balance <fix_balance>` to perform dynamic load balancing with the calculated load.
.. tab:: constant switching parameter
#. :doc:`atom_style apip <atom_style>` so that the switching parameter :math:`\lambda_i` can be stored.
#. A fast potential: :doc:`eam/apip <pair_eam_apip>` or :doc:`pace/fast/apip <pair_pace_apip>`.
#. A precise potential: :doc:`pace/precise/apip <pair_pace_apip>`.
#. :doc:`set <set>` command to set the switching parameter :math:`\lambda_i`.
#. :doc:`pair_style hybrid/overlay <pair_hybrid>` to combine the previously mentioned pair_styles.
#. :doc:`fix atom_weight/apip <fix_atom_weight_apip>` to approximate the load caused by every atom, as the computations of the pair_styles are only required for a subset of atoms.
#. :doc:`fix balance <fix_balance>` to perform dynamic load balancing with the calculated load.
----------
Example
"""""""
.. note::
How to select the values of the parameters of an adaptive-precision
interatomic potential is discussed in detail in :ref:`(Immel) <Immel2025_1>`.
.. tabs::
.. tab:: dynamic switching parameter
Lines like these would appear in the input script:
.. code-block:: LAMMPS
atom_style apip
comm_style tiled
pair_style hybrid/overlay eam/fs/apip pace/precise/apip lambda/input/csp/apip fcc cutoff 5.0 lambda/zone/apip 12.0
pair_coeff * * eam/fs/apip Cu.eam.fs Cu
pair_coeff * * pace/precise/apip Cu.yace Cu
pair_coeff * * lambda/input/csp/apip
pair_coeff * * lambda/zone/apip
fix 2 all lambda/apip 2.5 3.0 time_averaged_zone 4.0 12.0 110 110 min_delta_lambda 0.01
fix 3 all lambda_thermostat/apip N_rescaling 200
fix 4 all atom_weight/apip 100 eam ace lambda/input lambda/zone all
variable myweight atom f_4
fix 5 all balance 100 1.1 rcb weight var myweight
First, the :doc:`atom_style apip <atom_style>` and the communication style are set.
.. note::
Note, that :doc:`comm_style <comm_style>` *tiled* is required for the style *rcb* of
:doc:`fix balance <fix_balance>`, but not for APIP.
However, the flexibility offered by the balancing style *rcb*, compared to the
balancing style *shift*, is advantageous for APIP.
An adaptive-precision EAM-ACE potential, for which the switching parameter
:math:`\lambda` is calculated from the CSP, is defined via
:doc:`pair_style hybrid/overlay <pair_hybrid>`.
The fixes ensure that the switching parameter is calculated, the energy conserved,
the weight for the load balancing calculated and the load-balancing itself is done.
.. tab:: constant switching parameter
Lines like these would appear in the input script:
.. code-block:: LAMMPS
atom_style apip
comm_style tiled
pair_style hybrid/overlay eam/fs/apip pace/precise/apip
pair_coeff * * eam/fs/apip Cu.eam.fs Cu
pair_coeff * * pace/precise/apip Cu.yace Cu
# calculate lambda somehow
variable lambda atom ...
set group all apip/lambda v_lambda
fix 4 all atom_weight/apip 100 eam ace lambda/input lambda/zone all
variable myweight atom f_4
fix 5 all balance 100 1.1 rcb weight var myweight
First, the :doc:`atom_style apip <atom_style>` and the communication style are set.
.. note::
Note, that :doc:`comm_style <comm_style>` *tiled* is required for the style *rcb* of
:doc:`fix balance <fix_balance>`, but not for APIP.
However, the flexibility offered by the balancing style *rcb*, compared to the
balancing style *shift*, is advantageous for APIP.
An adaptive-precision EAM-ACE potential is defined via
:doc:`pair_style hybrid/overlay <pair_hybrid>`.
The switching parameter :math:`\lambda_i` of the adaptive-precision
EAM-ACE potential is set via the :doc:`set command <set>`.
The parameter is not updated during the simulation.
Therefore, the potential is conservative.
The fixes ensure that the weight for the load balancing is calculated
and the load-balancing itself is done.
----------
.. _implementing_new_apip_styles:
Implementing new APIP pair styles
"""""""""""""""""""""""""""""""""
One can introduce adaptive-precision to an existing pair style by modifying
the original pair style.
One should calculate the force
:math:`F_i = - \nabla_i \sum_j E_j^\text{original}` for a fast potential or
:math:`F_i = - (1-\nabla_i) \sum_j E_j^\text{original}` for a precise
potential from the original potential
energy :math:`E_j^\text{original}` to see where the switching parameter
:math:`\lambda_i` needs to be introduced in the force calculation.
The switching parameter :math:`\lambda_i` is known for all atoms :math:`i`
in force calculation routine.
One needs to introduce an abortion criterion based on :math:`\lambda_i` to
ensure that all not required calculations are skipped and compute time can
be saved.
Furthermore, one needs to provide the number of calculations and measure the
computation time.
Communication within the force calculation needs to be prevented to allow
effective load-balancing.
With communication, the load balancer cannot balance few calculations of the
precise potential on one processor with many computations of the fast
potential on another processor.
All changes in the pair_style pace/apip compared to the pair_style pace
are annotated and commented.
Thus, the pair_style pace/apip can serve as an example for the implementation
of new adaptive-precision potentials.
----------
.. _Immel2025_1:
**(Immel)** Immel, Drautz and Sutmann, J Chem Phys, 162, 114119 (2025)

View File

@ -1,22 +1,16 @@
CHARMM, AMBER, COMPASS, DREIDING, and OPLS force fields
=======================================================
A compact summary of the concepts, definitions, and properties of
force fields with explicit bonded interactions (like the ones discussed
in this HowTo) is given in :ref:`(Gissinger) <Typelabel2>`.
A force field has 2 parts: the formulas that define it and the
coefficients used for a particular system. Here we only discuss
formulas implemented in LAMMPS that correspond to formulas commonly used
in the CHARMM, AMBER, COMPASS, and DREIDING force fields. Setting
coefficients is done either from special sections in an input data file
via the :doc:`read_data <read_data>` command or in the input script with
commands like :doc:`pair_coeff <pair_coeff>` or :doc:`bond_coeff
<bond_coeff>` and so on. See the :doc:`Tools <Tools>` doc page for
additional tools that can use CHARMM, AMBER, or Materials Studio
generated files to assign force field coefficients and convert their
output into LAMMPS input. LAMMPS input scripts can also be generated by
`charmm-gui.org <https://charmm-gui.org/>`_.
Here we only discuss formulas implemented in LAMMPS that correspond to
formulas commonly used in the CHARMM, AMBER, COMPASS, and DREIDING force
fields. Setting coefficients is done either from special sections in an
input data file via the :doc:`read_data <read_data>` command or in the
input script with commands like :doc:`pair_coeff <pair_coeff>` or
:doc:`bond_coeff <bond_coeff>` and so on. See the :doc:`Tools <Tools>`
doc page for additional tools that can use CHARMM, AMBER, or Materials
Studio generated files to assign force field coefficients and convert
their output into LAMMPS input. LAMMPS input scripts can also be
generated by `charmm-gui.org <https://charmm-gui.org/>`_.
CHARMM and AMBER
----------------
@ -203,9 +197,11 @@ rather than individual force constants and geometric parameters that
depend on the particular combinations of atoms involved in the bond,
angle, or torsion terms. DREIDING has an :doc:`explicit hydrogen bond
term <pair_hbond_dreiding>` to describe interactions involving a
hydrogen atom on very electronegative atoms (N, O, F). Unlike CHARMM
or AMBER, the DREIDING force field has not been parameterized for
considering solvents (like water).
hydrogen atom on very electronegative atoms (N, O, F). Unlike CHARMM or
AMBER, the DREIDING force field has not been parameterized for
considering solvents (like water) and has no rules for assigning
(partial) charges. That will seriously limit its accuracy when used for
simulating systems where those matter.
See :ref:`(Mayo) <howto-Mayo>` for a description of the DREIDING force field
@ -272,10 +268,6 @@ compatible with a subset of OPLS interactions.
----------
.. _Typelabel2:
**(Gissinger)** J. R. Gissinger, I. Nikiforov, Y. Afshar, B. Waters, M. Choi, D. S. Karls, A. Stukowski, W. Im, H. Heinz, A. Kohlmeyer, and E. B. Tadmor, J Phys Chem B, 128, 3282-3297 (2024).
.. _howto-MacKerell:
**(MacKerell)** MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field, Fischer, Gao, Guo, Ha, et al (1998). J Phys Chem, 102, 3586 . https://doi.org/10.1021/jp973084f

View File

@ -1,10 +1,15 @@
Using LAMMPS-GUI
================
.. image:: JPG/lammps-gui-banner.png
:align: center
:scale: 75%
LAMMPS-GUI is a graphical text editor programmed using the `Qt Framework
<https://www.qt.io/>`_ and customized for editing LAMMPS input files. It
is linked to the :ref:`LAMMPS library <lammps_c_api>` and thus can run
LAMMPS directly using the contents of the editor's text buffer as input.
<https://www.qt.io/>`_ and customized for editing and running LAMMPS
input files. It is linked to the :ref:`LAMMPS library <lammps_c_api>`
and thus can run LAMMPS directly using the contents of the editor's text
buffer as input and without having to launch the LAMMPS executable.
It *differs* from other known interfaces to LAMMPS in that it can
retrieve and display information from LAMMPS *while it is running*,
@ -13,7 +18,7 @@ display visualizations created with the :doc:`dump image command
LAMMPS commands and styles, and directly integrates with a collection
of LAMMPS tutorials (:ref:`Gravelle1 <Gravelle1>`).
This document describes **LAMMPS-GUI version 1.6**.
This document describes **LAMMPS-GUI version 1.7**.
-----
@ -21,17 +26,20 @@ This document describes **LAMMPS-GUI version 1.6**.
----
LAMMPS-GUI tries to provide an experience similar to what people
traditionally would have running LAMMPS using a command-line window and
the console LAMMPS executable but just rolled into a single executable:
LAMMPS-GUI aims to provide the traditional experience of running LAMMPS
using a text editor, a command-line window, and launching the LAMMPS
text-mode executable printing output to the screen, but just integrated
into a single application:
- writing & editing LAMMPS input files with a text editor
- run LAMMPS on those input file with selected command-line flags
- extract data from the created files and visualize it with and
external software
- Write and edit LAMMPS input files using the built-in text editor.
- Run LAMMPS on those input file with command-line flags to enable a
specific accelerator package (or none).
- Extract data from the created files (like trajectory files, log files
with thermodynamic data, or images) and visualize it using external
software.
That procedure is quite effective for people proficient in using the
command-line, as that allows them to use tools for the individual steps
That traditional procedure is effective for people proficient in using the
command-line, as it allows them to use the tools for the individual steps
that they are most comfortable with. In fact, it is often *required* to
adopt this workflow when running LAMMPS simulations on high-performance
computing facilities.
@ -42,35 +50,46 @@ window or using external programs, let alone writing scripts to extract
data from the generated output. It also integrates well with graphical
desktop environments where the `.lmp` filename extension can be
registered with LAMMPS-GUI as the executable to launch when double
clicking on such files. Also, LAMMPS-GUI has support for drag-n-drop,
i.e. an input file can be selected and then moved and dropped on the
LAMMPS-GUI executable, and LAMMPS-GUI will launch and read the file into
its buffer. In many cases LAMMPS-GUI will be integrated into the
graphical desktop environment and can be launched like other
applications.
clicking on such files using a file manager. LAMMPS-GUI also has
support for 'drag and drop' for opening inputs: an input file can
be selected and then moved and dropped on the LAMMPS-GUI executable;
LAMMPS-GUI will launch and read the file into its buffer. Input files
also can be dropped into the editor window of the running LAMMPS-GUI
application, which will close the current file and open the new file.
In many cases LAMMPS-GUI will be integrated into the graphical desktop
environment and can be launched just like any other applications from
the graphical interface.
LAMMPS-GUI thus makes it easier for beginners to get started running
simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS
since you only need to learn how to use a single program for most tasks
and thus time can be saved and people can focus on learning LAMMPS.
The tutorials at https://lammpstutorials.github.io/ are specifically
updated for use with LAMMPS-GUI and their tutorial materials can
be downloaded and edited directly from the GUI.
LAMMPS and is well-suited for LAMMPS tutorials, since you only need to
work with a single, ready-to-use program for most of the tasks. Plus it
is available for download as pre-compiled package for popular operating
systems (Linux, macOS, Windows). This saves time and allows users to
focus on learning LAMMPS itself, without the need to learn how to
compile LAMMPS, learn how to use the command line, or learn how to use a
separate text editor.
Another design goal is to keep the barrier low when replacing part of
the functionality of LAMMPS-GUI with external tools. That said, LAMMPS-GUI
has some unique functionality that is not found elsewhere:
The tutorials at https://lammpstutorials.github.io/ are specifically
updated for use with LAMMPS-GUI and their tutorial materials can be
downloaded and edited directly from within the GUI while automatically
loading the matching tutorial instructions into a webbrowser.
Yet the basic control flow remains similar to running LAMMPS from the
command line, so the barrier for replacing parts of the functionality of
LAMMPS-GUI with external tools is low. That said, LAMMPS-GUI offer some
unique features that are not easily found elsewhere:
- auto-adapting to features available in the integrated LAMMPS library
- auto-completion for LAMMPS commands and options
- context-sensitive online help
- auto-completion for available LAMMPS commands and options only
- context-sensitive online help for known LAMMPS commands
- start and stop of simulations via mouse or keyboard
- monitoring of simulation progress
- interactive visualization using the :doc:`dump image <dump_image>`
- monitoring of simulation progress and CPU use
- interactive visualization using the LAMMPS :doc:`dump image feature <dump_image>`
command with the option to copy-paste the resulting settings
- automatic slide show generation from dump image output at runtime
- automatic plotting of thermodynamic data at runtime
- inspection of binary restart files
- integration will a set of LAMMPS tutorials
.. admonition:: Download LAMMPS-GUI for your platform
:class: Hint
@ -93,7 +112,7 @@ has some unique functionality that is not found elsewhere:
-----
The following text provides a detailed tour of the features and
The following text provides a documentation of the features and
functionality of LAMMPS-GUI. Suggestions for new features and
reports of bugs are always welcome. You can use the :doc:`the same
channels as for LAMMPS itself <Errors_bugs>` for that purpose.
@ -230,8 +249,8 @@ editor buffer, which may contain multiple :doc:`run <run>` or
LAMMPS runs in a separate thread, so the GUI stays responsive and is
able to interact with the running calculation and access data it
produces. It is important to note that running LAMMPS this way is
using the contents of the input buffer for the run (via the
produces. It is important to note that running LAMMPS this way is using
the contents of the input buffer for the run (via the
:cpp:func:`lammps_commands_string()` function of the LAMMPS C-library
interface), and **not** the original file it was read from. Thus, if
there are unsaved changes in the buffer, they *will* be used. As an
@ -240,28 +259,55 @@ of a file from the *Run LAMMPS from File* menu entry or with
`Ctrl-Shift-Enter`. This option may be required in some rare cases
where the input uses some functionality that is not compatible with
running LAMMPS from a string buffer. For consistency, any unsaved
changes in the buffer must be either saved to the file or undone
before LAMMPS can be run from a file.
changes in the buffer must be either saved to the file or undone before
LAMMPS can be run from a file.
The line number of the currently executed command is highlighted in
green in the line number display for the *Editor* Window.
.. image:: JPG/lammps-gui-running.png
:align: center
:scale: 75%
While LAMMPS is running, the contents of the status bar change. On
the left side there is a text indicating that LAMMPS is running, which
also indicates the number of active threads, when thread-parallel
acceleration was selected in the *Preferences* dialog. On the right
While LAMMPS is running, the contents of the status bar change. The
text fields that normally show "Ready." and the current working
directory, change into an area showing the CPU utilization in percent.
Nest to it is a text indicating that LAMMPS is running, which also
indicates the number of active threads (in case thread-parallel
acceleration was selected in the *Preferences* dialog). On the right
side, a progress bar is shown that displays the estimated progress for
the current :doc:`run <run>` or :doc:`minimize <minimize>` command.
Also, the line number of the currently executed command is highlighted
in green.
.. admonition:: CPU Utilization
:class: note
The CPU Utilization should ideally be close to 100% times the number
of threads like in the screenshot image above. Since the GUI is
running as a separate thread, the CPU utilization can be higher, for
example when the GUI needs to work hard to keep up with the
simulation. This can be caused by having frequent thermo output or
running a simulation of a small system. In the *Preferences* dialog,
the polling interval for updating the the *Output* and *Charts*
windows can be set. The intervals may need to be lowered to not miss
data between *Charts* data updates or to avoid stalling when the
thermo output is not transferred to the *Output* window fast enough.
It is also possible to reduce the amount of data by increasing the
:doc:`thermo interval <thermo>`. LAMMPS-GUI detects, if the
associated I/O buffer is by a significant percentage and will print a
warning after the run with suggested adjustments. The utilization
can also be lower, e.g. when the simulation is slowed down by the
GUI or other processes also running on the host computer and
competing with LAMMPS-GUI for GPU resources.
.. image:: JPG/lammps-gui-buffer-warn.png
:align: center
:scale: 75%
If an error occurs (in the example below the command :doc:`label
<label>` was incorrectly capitalized as "Label"), an error message
dialog is shown and the line of the input which triggered the error is
highlighted. The state of LAMMPS in the status bar is set to "Failed."
instead of "Ready."
highlighted in red. The state of LAMMPS in the status bar is set to
"Failed." instead of "Ready."
.. image:: JPG/lammps-gui-run-error.png
:align: center
@ -308,7 +354,10 @@ of the *Output* window showing how many warnings and errors were
detected and how many lines the entire output has. By clicking on the
button on the right with the warning symbol or by using the keyboard
shortcut `Ctrl-N` (`Command-N` on macOS), you can jump to the next
line with a warning or error.
line with a warning or error. If there is a URL pointing to additional
explanations in the online manual, that URL will be highlighted and
double-clicking on it shall open the corresponding manual page in
the web browser. The option is also available from the context menu.
By default, the *Output* window is replaced each time a run is started.
The runs are counted and the run number for the current run is displayed
@ -348,33 +397,29 @@ plot of thermodynamic output of the LAMMPS calculation as shown below.
:align: center
:scale: 33%
The drop down menu on the top right allows selection of different
properties that are computed and written to thermo output. Only one
property can be shown at a time. The plots are updated regularly with
new data as the run progresses, so they can be used to visually monitor
the evolution of available properties. The update interval can be set
in the *Preferences* dialog. By default, the raw data for the selected
property is plotted as a blue graph. As soon as there are a sufficient
number of data points, there will be a second graph shown in red with a
smoothed version of the data. From the drop down menu on the top left,
you can select whether to plot only the raw data, only the smoothed
data or both. The smoothing uses a `Savitzky-Golay convolution filter
<https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter>`_ The
window width (left) and order (right) parameters can be set in the boxes
next to the drop down menu. Default settings are 10 and 4 which means
that the smoothing window includes 10 points each to the left and the
right of the current data point for a total of 21 points and a fourth
order polynomial is fitted to the data in the window.
The "Data:" drop down menu on the top right allows selection of
different properties that are computed and written as thermodynamic
output to the output window. Only one property can be shown at a time.
The plots are updated regularly with new data as the run progresses, so
they can be used to visually monitor the evolution of available
properties. The update interval can be set in the *Preferences* dialog.
By default, the raw data for the selected property is plotted as a blue
graph. From the "Plot:" drop menu on the second row and on the left,
you can select whether to plot only raw data graph, only a smoothed data
graph, or both graphs on top of each other. The smoothing process uses
a `Savitzky-Golay convolution filter
<https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter>`_. The
convolution window width (left) and order (right) parameters can be set
in the boxes next to the drop down menu. Default settings are 10 and 4
which means that the smoothing window includes 10 points each to the
left and the right of the current data point for a total of 21 points
and a fourth order polynomial is fitted to the data in the window.
The "Title:" and "Y:" input boxes allow to edit the text shown as the
plot title and the y-axis label, respectively. The text entered in the
"Title:" box is applied to *all* charts, while the "Y:" text changes
only the y-axis label of the currently *selected* plot.
You can use the mouse to zoom into the graph (hold the left button and
drag to mark an area) or zoom out (right click) and you can reset the
view with a click to the "lens" button next to the data drop down menu.
The window title shows the current run number that this chart window
corresponds to. Same as for the *Output* window, the chart window is
replaced on each new run, but the behavior can be changed in the
@ -406,6 +451,35 @@ multiple chart-related settings, like the default title, colors for the
graphs, default choice of the raw / smooth graph selection, and the
default chart graph size.
.. admonition:: Slowdown of Simulations from Charts Data Processing
:class: warning
Using frequent thermo output during long simulations can result in a
significant slowdown of that simulation since it is accumulating many
data points for each of the thermo properties in the chart window to
be redrawn with every update. The updates are consuming additional
CPU time when smoothing enabled. This slowdown can be confirmed when
an increasing percentage of the total run time is spent in the
"Output" or "Other" sections of the :doc:`MPI task timing breakdown
<Run_output>`. It is thus recommended to use a large enough value as
argument `N` for the :doc:`thermo command <thermo>` and to select
plotting only the "Raw" data in the *Charts Window* during such
simulations. It is always possible to switch between the different
display styles for charts during the simulation and after it has
finished.
.. versionchanged:: 1.7
As of LAMMPS-GUI version 1.7 the chart data processing is
significantly optimized compared to older versions of LAMMPS-GUI.
The general problem of accumulating excessive amounts of data
and the overhead of too frequently polling LAMMPS for new data
cannot be optimized away, though. If necessary, the command
line LAMMPS executable needs to be used and the output accumulated
of a very fast disk (e.g. a high-performance SSD).
Image Slide Show
----------------
@ -637,13 +711,27 @@ generated with a :doc:`write_data command <write_data>`. The third
window is a :ref:`Snapshot Image Viewer <snapshot_viewer>` containing a
visualization of the system in the restart.
If the restart file is larger than 250 MBytes, a dialog will ask
for confirmation before continuing, since large restart files
may require large amounts of RAM since the entire system must
be read into RAM. Thus restart file for large simulations that
have been run on an HPC cluster may overload a laptop or local
workstation. The *Show Details...* button will display a rough
estimate of the additional memory required.
.. |inspect1| image:: JPG/lammps-gui-inspect-data.png
:width: 32%
.. |inspect2| image:: JPG/lammps-gui-inspect-info.png
:width: 32%
.. |inspect3| image:: JPG/lammps-gui-inspect-image.png
:width: 32%
|inspect1| |inspect2| |inspect3|
.. admonition:: Large Restart Files
:class: warning
If the restart file is larger than 250 MBytes, a dialog will ask for
confirmation before continuing, since large restart files may require
large amounts of RAM since the entire system must be read into RAM.
Thus restart file for large simulations that have been run on an HPC
cluster may overload a laptop or local workstation. The *Show
Details...* button will display a rough estimate of the additional
memory required.
Menu
----
@ -715,6 +803,12 @@ timestep. The *Stop LAMMPS* entry will do this by calling the
:cpp:func:`lammps_force_timeout` library function, which is equivalent
to a :doc:`timer timeout 0 <timer>` command.
The *Relaunch LAMMPS Instance* will destroy the current LAMMPS thread
and free its data and then create a new thread with a new LAMMPS
instance. This is usually not needed, since LAMMPS-GUI tries to detect
when this is needed and does it automatically. This is available
in case it missed something and LAMMPS behaves in unexpected ways.
The *Set Variables...* entry opens a dialog box where
:doc:`index style variables <variable>` can be set. Those variables
are passed to the LAMMPS instance when it is created and are thus
@ -769,6 +863,10 @@ then start downloading the files requested (download progress is
reported in the status line) and load the first input file for the
selected session into LAMMPS-GUI.
.. image:: JPG/lammps-gui-tutorials.png
:align: center
:scale: 50%
About
^^^^^
@ -875,13 +973,12 @@ General Settings:
- *Replace image window on new render:* when checked, an existing
chart window will be replaced when a new snapshot image is requested,
otherwise each command will create a new image window.
- *Path to LAMMPS Shared Library File:* this option is only visible
when LAMMPS-GUI was compiled to load the LAMMPS library at run time
instead of being linked to it directly. With the *Browse..* button
or by changing the text, a different shared library file with a
different compilation of LAMMPS with different settings or from a
different version can be loaded. After this setting was changed,
LAMMPS-GUI needs to be re-launched.
- *Download tutorial solutions enabled* this controls whether the
"Download solutions" option is enabled by default when setting up
a tutorial.
- *Open tutorial webpage enabled* this controls whether the "Open
tutorial webpage in web browser" option is enabled by default when
setting up a tutorial.
- *Select Default Font:* Opens a font selection dialog where the type
and size for the default font (used for everything but the editor and
log) of the application can be set.
@ -905,16 +1002,31 @@ General Settings:
or for downloading tutorial files from the *Tutorials* menu. If the
``https_proxy`` environment variable was set externally, its value is
displayed but cannot be changed.
- *Path to LAMMPS Shared Library File:* this option is only visible
when LAMMPS-GUI was compiled to load the LAMMPS library at run time
instead of being linked to it directly. With the *Browse..* button
or by changing the text, a different shared library file with a
different compilation of LAMMPS with different settings or from a
different version can be loaded. After this setting was changed,
LAMMPS-GUI needs to be re-launched.
Accelerators:
^^^^^^^^^^^^^
This tab enables selection of an accelerator package for LAMMPS to use
and is equivalent to using the `-suffix` and `-package` flags on the
command-line. Only settings supported by the LAMMPS library and local
hardware are available. The `Number of threads` field allows setting
the maximum number of threads for the accelerator packages that use
threads.
This tab enables selection of an accelerator package and modify some of
its settings to use for running LAMMPS and is equivalent to using the
:doc:`-sf <suffix>` and :doc:`-pk <package>` flags :doc:`on the
command-line <Run_options>`. Only settings supported by the LAMMPS
library and local hardware are available. The `Number of threads` field
allows setting the number of threads for the accelerator packages that
support using threads (OPENMP, INTEL, KOKKOS, and GPU). Furthermore,
the choice of precision mode (double, mixed, or single) for the INTEL
package can be selected and for the GPU package, whether the neighbor
lists are built on the GPU or the host (required for :doc:`pair style
hybrid <pair_hybrid>`) and whether only pair styles should be
accelerated (i.e. run PPPM entirely on the CPU, which sometimes leads
to better overall performance). Whether settings can be changed depends
on which accelerator package is chosen (or "None").
Snapshot Image:
^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
SPC water model
===============
SPC and SPC/E water model
=========================
The SPC water model specifies a 3-site rigid water molecule with
charges and Lennard-Jones parameters assigned to each of the three atoms.
@ -8,6 +8,18 @@ the two O-H bonds and the H-O-H angle rigid. A bond style of
*harmonic* and an angle style of *harmonic* or *charmm* should also be
used.
One suitable pair style with cutoff Coulomb would for instance be:
* :doc:`pair_style lj/cut/coul/cut <pair_lj_cut_coul>`
These commands are examples for a long-range Coulomb model:
* :doc:`pair_style lj/cut/coul/long <pair_lj_cut_coul>`
* :doc:`pair_style lj/cut/coul/long/soft <pair_fep_soft>`
* :doc:`kspace_style pppm <kspace_style>`
* :doc:`pair_style lj/long/coul/long <pair_lj_long>`
* :doc:`kspace_style pppm/disp <kspace_style>`
These are the additional parameters (in real units) to set for O and H
atoms and the water molecule to run a rigid SPC model.
@ -39,7 +51,9 @@ the SPC and SPC/E models.
Below is the code for a LAMMPS input file and a molecule file
(``spce.mol``) of SPC/E water for use with the :doc:`molecule command
<molecule>` demonstrating how to set up a small bulk water system for
SPC/E with rigid bonds.
SPC/E with rigid bonds. For simplicity and speed the example uses a
cutoff Coulomb. Most production simulations require long-range Coulomb
instead.
.. code-block:: LAMMPS

View File

@ -21,9 +21,14 @@ can be invoked via the *dpd/tstat* pair style:
* :doc:`fix nvt/sllod <fix_nvt_sllod>`
* :doc:`fix temp/berendsen <fix_temp_berendsen>`
* :doc:`fix temp/csvr <fix_temp_csvr>`
* :doc:`fix ffl <fix_ffl>`
* :doc:`fix gjf <fix_gjf>`
* :doc:`fix gld <fix_gld>`
* :doc:`fix gle <fix_gle>`
* :doc:`fix langevin <fix_langevin>`
* :doc:`fix temp/rescale <fix_temp_rescale>`
* :doc:`pair_style dpd/tstat <pair_dpd>`
* :doc:`pair_style dpd/ext/tstat <pair_dpd_ext>`
:doc:`Fix nvt <fix_nh>` only thermostats the translational velocity of
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this,
@ -82,10 +87,10 @@ that:
.. note::
Only the nvt fixes perform time integration, meaning they update
Not all thermostat fixes perform time integration, meaning they update
the velocities and positions of particles due to forces and velocities
respectively. The other thermostat fixes only adjust velocities; they
do NOT perform time integration updates. Thus they should be used in
do NOT perform time integration updates. Thus, they should be used in
conjunction with a constant NVE integration fix such as these:
* :doc:`fix nve <fix_nve>`

View File

@ -5,17 +5,24 @@ The TIP3P water model as implemented in CHARMM :ref:`(MacKerell)
<howto-tip3p>` specifies a 3-site rigid water molecule with charges and
Lennard-Jones parameters assigned to each of the three atoms.
A suitable pair style with cutoff Coulomb would be:
One suitable pair style with cutoff Coulomb would for instance be:
* :doc:`pair_style lj/cut/coul/cut <pair_lj_cut_coul>`
or these commands for a long-range Coulomb model:
These commands are examples for a long-range Coulomb model:
* :doc:`pair_style lj/cut/coul/long <pair_lj_cut_coul>`
* :doc:`pair_style lj/cut/coul/long/soft <pair_fep_soft>`
* :doc:`kspace_style pppm <kspace_style>`
* :doc:`pair_style lj/long/coul/long <pair_lj_long>`
* :doc:`kspace_style pppm/disp <kspace_style>`
And these pair styles are compatible with the CHARMM force field:
* :doc:`pair_style lj/charmm/coul/charmm <pair_charmm>`
* :doc:`pair_style lj/charmm/coul/long <pair_charmm>`
* :doc:`pair_style lj/charmmfsw/coul/long <pair_charmm>`
In LAMMPS the :doc:`fix shake or fix rattle <fix_shake>` command can be
used to hold the two O-H bonds and the H-O-H angle rigid. A bond style
of :doc:`harmonic <bond_harmonic>` and an angle style of :doc:`harmonic
@ -100,7 +107,9 @@ ignored.
Below is the code for a LAMMPS input file and a molecule file
(``tip3p.mol``) of TIP3P water for use with the :doc:`molecule command
<molecule>` demonstrating how to set up a small bulk water system for
TIP3P with rigid bonds.
TIP3P with rigid bonds. For simplicity and speed the example uses a
cutoff Coulomb. Most production simulations require long-range Coulomb
instead.
.. code-block:: LAMMPS

View File

@ -1,5 +1,5 @@
TIP4P water model
=================
TIP4P and OPC water models
==========================
The four-point TIP4P rigid water model extends the traditional
:doc:`three-point TIP3P <Howto_tip3p>` model by adding an additional
@ -9,9 +9,11 @@ the oxygen along the bisector of the HOH bond angle. A bond style of
:doc:`harmonic <bond_harmonic>` and an angle style of :doc:`harmonic
<angle_harmonic>` or :doc:`charmm <angle_charmm>` should also be used.
In case of rigid bonds also bond style :doc:`zero <bond_zero>` and angle
style :doc:`zero <angle_zero>` can be used.
style :doc:`zero <angle_zero>` can be used. Very similar to the TIP4P
model is the OPC water model. It can be realized the same way as TIP4P
but has different geometry and force field parameters.
There are two ways to implement TIP4P water in LAMMPS:
There are two ways to implement TIP4P-like water in LAMMPS:
#. Use a specially written pair style that uses the :ref:`TIP3P geometry
<tip3p_molecule>` without the point M. The point M location is then
@ -21,7 +23,10 @@ There are two ways to implement TIP4P water in LAMMPS:
computationally very efficient, but the charge distribution in space
is only correct within the tip4p labeled styles. So all other
computations using charges will "see" the negative charge incorrectly
on the oxygen atom.
located on the oxygen atom unless they are specially written for using
the TIP4P geometry internally as well, e.g. :doc:`compute dipole/tip4p
<compute_dipole>`, :doc:`fix efield/tip4p <fix_efield>`, or
:doc:`kspace_style pppm/tip4p <kspace_style>`.
This can be done with the following pair styles for Coulomb with a cutoff:
@ -68,77 +73,90 @@ TIP4P/2005 model :ref:`(Abascal2) <Abascal2>` and a version of TIP4P
parameters adjusted for use with a long-range Coulombic solver
(e.g. Ewald or PPPM in LAMMPS). Note that for implicit TIP4P models the
OM distance is specified in the :doc:`pair_style <pair_style>` command,
not as part of the pair coefficients.
not as part of the pair coefficients. Also parameters for the OPC
model (:ref:`Izadi <Izadi>`) are provided.
.. list-table::
:header-rows: 1
:widths: 36 19 13 15 17
:widths: 40 12 12 14 11 11
* - Parameter
- TIP4P (original)
- TIP4P/Ice
- TIP4P/2005
- TIP4P (Ewald)
- OPC
* - O mass (amu)
- 15.9994
- 15.9994
- 15.9994
- 15.9994
- 15.9994
* - H mass (amu)
- 1.008
- 1.008
- 1.008
- 1.008
- 1.008
* - O or M charge (:math:`e`)
- -1.040
- -1.1794
- -1.1128
- -1.04844
- -1.3582
* - H charge (:math:`e`)
- 0.520
- 0.5897
- 0.5564
- 0.52422
- 0.6791
* - LJ :math:`\epsilon` of OO (kcal/mole)
- 0.1550
- 0.21084
- 0.1852
- 0.16275
- 0.21280
* - LJ :math:`\sigma` of OO (:math:`\AA`)
- 3.1536
- 3.1668
- 3.1589
- 3.16435
- 3.1660
* - LJ :math:`\epsilon` of HH, MM, OH, OM, HM (kcal/mole)
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
* - LJ :math:`\sigma` of HH, MM, OH, OM, HM (:math:`\AA`)
- 1.0
- 1.0
- 1.0
- 1.0
- 1.0
* - :math:`r_0` of OH bond (:math:`\AA`)
- 0.9572
- 0.9572
- 0.9572
- 0.9572
- 0.8724
* - :math:`\theta_0` of HOH angle
- 104.52\ :math:`^{\circ}`
- 104.52\ :math:`^{\circ}`
- 104.52\ :math:`^{\circ}`
- 104.52\ :math:`^{\circ}`
- 103.60\ :math:`^{\circ}`
* - OM distance (:math:`\AA`)
- 0.15
- 0.1577
- 0.1546
- 0.1250
- 0.1594
Note that the when using the TIP4P pair style, the neighbor list cutoff
Note that the when using a TIP4P pair style, the neighbor list cutoff
for Coulomb interactions is effectively extended by a distance 2 \* (OM
distance), to account for the offset distance of the fictitious charges
on O atoms in water molecules. Thus it is typically best in an
on O atoms in water molecules. Thus, it is typically best in an
efficiency sense to use a LJ cutoff >= Coulomb cutoff + 2\*(OM
distance), to shrink the size of the neighbor list. This leads to
slightly larger cost for the long-range calculation, so you can test the
@ -149,7 +167,9 @@ cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long
Below is the code for a LAMMPS input file using the implicit method and
the :ref:`TIP3P molecule file <tip3p_molecule>`. Because the TIP4P
charges are different from TIP3P they need to be reset (or the molecule
file changed):
file changed). For simplicity and speed the example uses a cutoff
Coulomb. Most production simulations require long-range Coulomb
instead.
.. code-block:: LAMMPS
@ -192,6 +212,94 @@ file changed):
run 20000
write_data tip4p-implicit.data nocoeff
When constructing an OPC model, we cannot use the ``tip3p.mol`` file due
to the different geometry. Below is a molecule file providing the 3
sites of an implicit OPC geometry for use with TIP4P styles. Note, that
the "Shake" and "Special" sections are missing here. Those will be
auto-generated by LAMMPS when the molecule file is loaded *after* the
simulation box has been created. These sections are required only when
the molecule file is loaded *before*.
.. _opc3p_molecule:
.. code-block::
# Water molecule. 3 point geometry for OPC model
3 atoms
2 bonds
1 angles
Coords
1 0.00000 -0.06037 0.00000
2 0.68558 0.50250 0.00000
3 -0.68558 0.50250 0.00000
Types
1 1 # O
2 2 # H
3 2 # H
Charges
1 -1.3582
2 0.6791
3 0.6791
Bonds
1 1 1 2
2 1 1 3
Angles
1 1 2 1 3
Below is a LAMMPS input file using the implicit method to implement
the OPC model using the molecule file from above and including the
PPPM long-range Coulomb solver.
.. code-block:: LAMMPS
units real
atom_style full
region box block -5 5 -5 5 -5 5
create_box 2 box bond/types 1 angle/types 1 &
extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2
mass 1 15.9994
mass 2 1.008
pair_style lj/cut/tip4p/long 1 2 1 1 0.1594 12.0
pair_coeff 1 1 0.2128 3.166
pair_coeff 2 2 0.0 1.0
bond_style zero
bond_coeff 1 0.8724
angle_style zero
angle_coeff 1 103.6
kspace_style pppm/tip4p 1.0e-5
molecule water opc3p.mol # this file has the OPC geometry but is without M
create_atoms 0 random 33 34564 NULL mol water 25367 overlap 1.33
fix rigid all shake 0.001 10 10000 b 1 a 1
minimize 0.0 0.0 1000 10000
reset_timestep 0
timestep 1.0
velocity all create 300.0 5463576
fix integrate all nvt temp 300 300 100.0
thermo_style custom step temp press etotal pe
thermo 1000
run 20000
write_data opc-implicit.data nocoeff
Below is the code for a LAMMPS input file using the explicit method and
a TIP4P molecule file. Because of using :doc:`fix rigid/small
<fix_rigid>` no bonds need to be defined and thus no extra storage needs
@ -279,3 +387,8 @@ Phys, 79, 926 (1983).
**(Abascal2)** Abascal, J Chem Phys, 123, 234505 (2005)
https://doi.org/10.1063/1.2121687
.. _Izadi:
**(Izadi)** Izadi, Anandakrishnan, Onufriev, J. Phys. Chem. Lett., 5, 21, 3863 (2014)
https://doi.org/10.1021/jz501780a

View File

@ -87,7 +87,9 @@ atom style full or use :doc:`fix property/atom mol <fix_property_atom>`
so that fix rigid/small can identify rigid bodies by their molecule ID.
Also a :doc:`neigh_modify exclude <neigh_modify>` command is added to
exclude computing intramolecular non-bonded interactions, since those
are removed by the rigid fix anyway:
are removed by the rigid fix anyway. For simplicity and speed the
example uses a cutoff Coulomb. Most production simulations require
long-range Coulomb instead.
.. code-block:: LAMMPS

View File

@ -21,8 +21,8 @@ You can follow the LAMMPS development on 4 different git branches:
* **develop** : this branch follows the ongoing development and is
updated with every merge commit of a pull request
* **release** : this branch is updated with every "feature release";
updates are always "fast-forward" merges from *develop*
* **release** : this branch is updated with every "feature release"
and updates are always "fast-forward" merges from *develop*
* **maintenance** : this branch collects back-ported bug fixes from the
*develop* branch to the *stable* branch. It is used to update the
*stable* branch for "stable update releases".

View File

@ -84,8 +84,9 @@ lammps.org". General questions about LAMMPS should be posted in the
\normalsize
Past developers include Paul Crozier and Mark Stevens, both at SNL,
and Ray Shan, now at Materials Design.
Past core developers include Paul Crozier and Mark Stevens, both at SNL,
and Ray Shan while at SNL and later at Materials Design, now at Thermo
Fisher Scientific.
----------

View File

@ -28,8 +28,9 @@ Build systems
LAMMPS can be compiled from source code using a (traditional) build
system based on shell scripts, a few shell utilities (grep, sed, cat,
tr) and the GNU make program. This requires running within a Bourne
shell (``/bin/sh``). Alternatively, a build system with different back
ends can be created using CMake. CMake must be at least version 3.16.
shell (``/bin/sh`` or ``/bin/bash``). Alternatively, a build system
with different back ends can be created using CMake. CMake must be
at least version 3.16.
Operating systems
^^^^^^^^^^^^^^^^^
@ -40,11 +41,18 @@ Also, compilation and correct execution on macOS and Windows (using
Microsoft Visual C++) is checked automatically for the largest part of
the source code. Some (optional) features are not compatible with all
operating systems, either through limitations of the corresponding
LAMMPS source code or through incompatibilities of source code or
build system of required external libraries or packages.
LAMMPS source code or through incompatibilities or build system
limitations of required external libraries or packages.
Executables for Windows may be created natively using either Cygwin or
Visual Studio or with a Linux to Windows MinGW cross-compiler.
Executables for Windows may be created either natively using Cygwin,
MinGW, Intel, Clang, or Microsoft Visual C++ compilers, or with a Linux
to Windows MinGW cross-compiler. Native compilation is supported using
Microsoft Visual Studio or a terminal window (using the CMake build
system).
Executables for macOS may be created either using Xcode or GNU compilers
installed with Homebrew. In the latter case, building of LAMMPS through
Homebrew instead of a manual compile is also possible.
Additionally, FreeBSD and Solaris have been tested successfully to
run LAMMPS and produce results consistent with those on Linux.
@ -61,8 +69,9 @@ CPU architectures
^^^^^^^^^^^^^^^^^
The primary CPU architecture for running LAMMPS is 64-bit x86, but also
32-bit x86, and 64-bit ARM and PowerPC (64-bit, Little Endian) are
regularly tested.
64-bit ARM and PowerPC (64-bit, Little Endian) are currently regularly
tested. Further architectures are tested by Linux distributions that
bundle LAMMPS.
Portability compliance
^^^^^^^^^^^^^^^^^^^^^^

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -93,14 +93,19 @@ run LAMMPS in serial mode.
.. admonition:: Using the C library interface as a plugin
:class: note
Rather than including the C library directly and link to the LAMMPS
Rather than including the C library interface directly using the
``library.h`` header file and link to the LAMMPS (static or shared)
library at compile time, you can use the ``liblammpsplugin.h`` header
file and the ``liblammpsplugin.c`` C code in the
``examples/COUPLE/plugin`` folder for an interface to LAMMPS that is
largely identical to the regular library interface, only that it will
load a LAMMPS shared library file at runtime. This can be useful for
applications where the interface to LAMMPS would be an optional
feature.
feature or where you would like to load different version of the
LAMMPS library (e.g. an updated one) without replacing the executable.
The :ref:`LAMMPS-GUI <lammps_gui>` is an example for such a program.
It has its own wrapper that supports both modes and they can be
changed at compile time.
.. warning::

View File

@ -11,6 +11,7 @@ This section documents the following functions:
- :cpp:func:`lammps_mpi_finalize`
- :cpp:func:`lammps_kokkos_finalize`
- :cpp:func:`lammps_python_finalize`
- :cpp:func:`lammps_plugin_finalize`
- :cpp:func:`lammps_error`
--------------------
@ -119,5 +120,10 @@ calling program.
-----------------------
.. doxygenfunction:: lammps_plugin_finalize
:project: progguide
-----------------------
.. doxygenfunction:: lammps_error
:project: progguide

View File

@ -27,6 +27,7 @@ It documents the following functions:
- :cpp:func:`lammps_scatter`
- :cpp:func:`lammps_scatter_subset`
- :cpp:func:`lammps_create_atoms`
- :cpp:func:`lammps_create_molecule`
-----------------------
@ -103,4 +104,8 @@ It documents the following functions:
.. doxygenfunction:: lammps_create_atoms(void *handle, int n, const int *id, const int *type, const double *x, const double *v, const int *image, int bexpand)
:project: progguide
-----------------------
.. doxygenfunction:: lammps_create_molecule
:project: progguide

View File

@ -28,6 +28,7 @@ gives those details.
* :ref:`ADIOS <PKG-ADIOS>`
* :ref:`AMOEBA <PKG-AMOEBA>`
* :ref:`APIP <PKG-APIP>`
* :ref:`ASPHERE <PKG-ASPHERE>`
* :ref:`ATC <PKG-ATC>`
* :ref:`AWPMD <PKG-AWPMD>`
@ -186,6 +187,60 @@ provided by the Ponder group in their
----------
.. _PKG-APIP:
APIP package
------------
**Contents:**
This package provides adaptive-precision interatomic potentials (APIP) as
described in:
D. Immel, R. Drautz and G. Sutmann, "Adaptive-precision potentials for
large-scale atomistic simulations", J. Chem. Phys. 162, 114119 (2025)
`link <immel2025_doi_>`_
Adaptive-precision means, that a fast interatomic potential, such as EAM,
is coupled to a precise interatomic potential, such as ACE.
This package provides the required pair_styles and fixes to run an efficient,
energy-conserving adaptive-precision simulation.
In the context of this package, precision refers to the accuracy of an interatomic
potential.
.. _immel2025_doi: https://doi.org/10.1063/5.0245877
**Authors:**
This package was written by David Immel^1,
Ralf Drautz^2 and Godehard Sutmann^1^2.
^1: Forschungszentrum Juelich, Juelich, Germany
^2: Ruhr-University Bochum, Bochum, Germany
**Install:**
The APIP package requires also the installation of ML-PACE, which has
:ref:`specific installation instructions <ml-pace>` on the
:doc:`Build extras <Build_extras>` page.
**Supporting info:**
* ``src/APIP``: filenames -> commands
* :doc:`Howto APIP <Howto_apip>`
* ``examples/PACKAGES/apip``
* :doc:`fix atom_weight/apip <fix_atom_weight_apip>`
* :doc:`fix lambda/apip <fix_lambda_apip>`
* :doc:`fix lambda_thermostat/apip <fix_lambda_thermostat_apip>`
* :doc:`pair_style eam/apip <pair_eam_apip>`
* :doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`
* :doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`
* :doc:`pair_style pace/apip <pair_pace_apip>`
----------
.. _PKG-ASPHERE:
ASPHERE package

View File

@ -38,6 +38,11 @@ whether an extra library is needed to build and use the package:
- :doc:`AMOEBA and HIPPO howto <Howto_amoeba>`
- amoeba
- no
* - :ref:`APIP <PKG-APIP>`
- adaptive-precision interatomic potentials
- :doc:`Howto APIP <Howto_apip>`
- ``PACKAGES/apip``
- ext
* - :ref:`ASPHERE <PKG-ASPHERE>`
- aspherical particle models
- :doc:`Howto spherical <Howto_spherical>`

View File

@ -5,18 +5,28 @@ LAMMPS has several commands which can be used to invoke Python
code directly from an input script:
* :doc:`python <python>`
* :doc:`variable python <variable>`
* :doc:`python-style variables <variable>`
* :doc:`equal-style and atom-style variables with formulas containing Python function wrappers <variable>`
* :doc:`fix python/invoke <fix_python_invoke>`
* :doc:`pair_style python <pair_python>`
The :doc:`python <python>` command which can be used to define and
execute a Python function that you write the code for. The Python
function can also be assigned to a LAMMPS python-style variable via
the :doc:`variable <variable>` command. Each time the variable is
The :doc:`python <python>` command can be used to define and execute a
Python function that you write the code for. The Python function can
also be assigned to a LAMMPS python-style variable via the
:doc:`variable <variable>` command. Each time the variable is
evaluated, either in the LAMMPS input script itself, or by another
LAMMPS command that uses the variable, this will trigger the Python
function to be invoked.
The Python function can also be referenced in the formula used to
define an :doc:`equal-style or atom-style variable <variable>`, using
the syntax for a :doc:`Python function wrapper <variable>`. This make
it easy to pass LAMMPS-related arguments to the Python function, as
well as to invoke it whenever the equal- or atom-style variable is
evaluated. For an atom-style variable it means the Python function
can be invoked once per atom, using per-atom properties as arguments
to the function.
The Python code for the function can be included directly in the input
script or in an auxiliary file. The function can have arguments which
are mapped to LAMMPS variables (also defined in the input script) and

View File

@ -106,20 +106,37 @@ folder that the dynamic loader searches or inside of the installed
has to be made during the CMake configuration step.
If the default settings of ``make install-python`` are not what you want,
you can invoke ``install.py`` from the python directory manually as
you can invoke ``install.py`` from the ``python`` directory manually as
.. code-block:: bash
python install.py -p <python package> -l <shared library> -v <version.h file> [-n] [-f]
python3 install.py -p <python package> -l <shared library> -v <version.h file> [-n] [-f]
* The ``-p`` flag argument is the full path to the
``python/lammps`` folder to be installed,
* the ``-l`` flag argument is the full path to the LAMMPS shared
library file to be installed,
* the ``-v`` flag argument is the full path to the ``src/version.h`` file
* the optional ``-n`` flag instructs the script to only build a
wheel file but not attempt to install it (default is to try installing),
* the optional ``-w`` flag argument is the path to a folder where
to store the resulting wheel file (default is the current folder)
* and the optional ``-f`` argument instructs the script to force
installation even if pip would otherwise refuse installation
with an :ref:`error about externally managed environments
<externally_managed>`. The Python developers recommend to not
augment a Python installation with custom packages, both at the
user and the system level, and advise to use virtual
environments instead. Some recent Linux distributions enforce
that recommendation by default.
Example command line for building only the wheel after building
LAMMPS with ``cmake`` in the folder ``build``:
.. code-block:: bash
python3 python/install.py -n -p python/lammps -l build/liblammps.so -v src/version.h -w build
* The ``-p`` flag points to the ``lammps`` Python package folder to be installed,
* the ``-l`` flag points to the LAMMPS shared library file to be installed,
* the ``-v`` flag points to the LAMMPS version header file to extract the version date,
* the optional ``-n`` instructs the script to only build a wheel file but not attempt
to install it,
* and the optional ``-f`` argument instructs the script to force installation even if
pip would otherwise refuse installation with an
:ref:`error about externally managed environments <externally_managed>`.
.. tab:: Virtual environment
@ -335,4 +352,3 @@ that the order of the lines is not deterministic
Proc 1 out of 4 procs
Proc 2 out of 4 procs
Proc 3 out of 4 procs

View File

@ -75,15 +75,34 @@ section below for examples where this has been done.
**Differences between the GPU and KOKKOS packages:**
* The GPU package accelerates only pair force, neighbor list, and (parts
of) PPPM calculations. The KOKKOS package attempts to run most of the
of) PPPM calculations (and runs the remaining force computations on
the CPU concurrently). The KOKKOS package attempts to run most of the
calculation on the GPU, but can transparently support non-accelerated
code (with a performance penalty due to having data transfers between
host and GPU).
* The list of which styles are accelerated by the GPU or KOKKOS package
differs with some overlap.
* The GPU package requires neighbor lists to be built on the CPU when using
hybrid pair styles, exclusion lists, or a triclinic simulation box.
* The GPU package can be compiled for CUDA, HIP, or OpenCL and thus supports
NVIDIA, AMD, and Intel GPUs well. On NVIDIA hardware, using CUDA is
typically resulting in equal or better performance over OpenCL.
* OpenCL in the GPU package does theoretically also support Intel CPUs or
Intel Xeon Phi, but the native support for those in KOKKOS (or INTEL)
is superior.
* The GPU package benefits from running multiple MPI processes (2-8) per
GPU to parallelize the non-GPU accelerated styles. The KOKKOS package
usually not, especially when all parts of the calculation have KOKKOS
support.
* The GPU package can be compiled for CUDA, HIP, or OpenCL and thus
supports NVIDIA, AMD, and Intel GPUs well. On NVIDIA or AMD hardware,
using native CUDA or HIP compilation, respectively, with either GPU or
KOKKOS results in equal or better performance over OpenCL.
* OpenCL in the GPU package supports NVIDIA, AMD, and Intel GPUs at the
*same time* and with the *same executable*. KOKKOS currently does not
support OpenCL.
* The GPU package supports single precision floating point, mixed
precision floating point, and double precision floating point math on
the GPU. This must be chosen at compile time. KOKKOS currently only
supports double precision floating point math. Using single or mixed
precision (recommended) results in significantly improved performance
on consumer GPUs for some loss in accuracy (which is rather small with
mixed precision). Single and mixed precision support for KOKKOS is in
development (no ETA yet).
* Some pair styles (for example :doc:`snap <pair_snap>`, :doc:`mliap
<pair_mliap>` or :doc:`reaxff <pair_reaxff>` in the KOKKOS package have
seen extensive optimizations and specializations for GPUs and CPUs.

View File

@ -1,16 +1,218 @@
Measuring performance
=====================
Before trying to make your simulation run faster, you should
understand how it currently performs and where the bottlenecks are.
Factors that influence performance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The best way to do this is run the your system (actual number of
atoms) for a modest number of timesteps (say 100 steps) on several
different processor counts, including a single processor if possible.
Do this for an equilibrium version of your system, so that the
100-step timings are representative of a much longer run. There is
typically no need to run for 1000s of timesteps to get accurate
timings; you can simply extrapolate from short runs.
Before trying to make your simulation run faster, you should understand
how it currently performs and where the bottlenecks are. We generally
distinguish between serial performance (how fast can a single process do
the calculations?) and parallel efficiency (how much faster does a
calculation get by using more processes?). There are many factors
affecting either and below are some lists discussing some commonly
known but also some less known factors.
Factors affecting serial performance (in no specific order):
* CPU hardware: clock rate, cache sizes, CPU architecture (instructions
per clock, vectorization support, fused multiply-add support and more)
* RAM speed and number of channels that the CPU can use to access RAM
* Cooling: CPUs can change the CPU clock based on thermal load, thus the
degree of cooling can affect the speed of a CPU. Sometimes even the
temperature of neighboring compute nodes in a cluster can make a
difference.
* Compiler optimization: most of LAMMPS is written to be easy to modify
and thus compiler optimization can speed up calculations. However, too
aggressive compiler optimization can produce incorrect results or
crashes (during compilation or at runtime).
* Source code improvements: styles in the OPT, OPENMP, and INTEL package
can be faster than their base implementation due to improved data
access patterns, cache efficiency, or vectorization. Compiler optimization
is required to take full advantage of these.
* Number and kind of fixes, computes, or variables used during a simulation,
especially if they result in collective communication operations
* Pair style cutoffs and system density: calculations get slower the more
neighbors are in the neighbor list and thus for which interactions need
to be computed. Force fields with pair styles that compute interactions
between triples or quadruples of atoms or that use embedding energies or
charge equilibration will need to walk the neighbor lists multiple times.
* Neighbor list settings: tradeoff between neighbor list skin (larger
skin = more neighbors, more distances to compute before applying the
cutoff) and frequency of neighbor list builds (larger skin = fewer
neighbor list builds).
* Proximity of per-atom data in physical memory that for atoms that are
close in space improves cache efficiency (thus LAMMPS will by default
sort atoms in local storage accordingly)
* Using r-RESPA multi-timestepping or a SHAKE or RATTLE fix to constrain
bonds with higher-frequency vibrations may allow a larger (outer) timestep
and thus fewer force evaluations (usually the most time consuming step in
MD) for the same simulated time (with some tradeoff in accuracy).
Factors affecting parallel efficiency (in no specific order):
* Bandwidth and latency of communication between processes. This can vary a
lot between processes on the same CPU or physical node and processes
on different physical nodes and there vary between different
communication technologies (like Ethernet or InfiniBand or other
high-speed interconnects)
* Frequency and complexity of communication patterns required
* Number of "work units" (usually correlated with the number of atoms
and choice of force field) per MPI-process required for one time step
(if this number becomes too small, the cost of communication becomes
dominant).
* Choice of parallelization method (MPI-only, OpenMP-only, MPI+OpenMP,
MPI+GPU, MPI+GPU+OpenMP)
* Algorithmic complexity of the chosen force field (pair-wise vs. many-body
potential, Ewald vs. PPPM vs. (compensated or smoothed) cutoff-Coulomb)
* Communication cutoff: a larger cutoff results in more ghost atoms and
thus more data that needs to be communicated
* Frequency of neighbor list builds: during a neighbor list build the
domain decomposition is updated and the list of ghost atoms rebuilt
which requires multiple global communication steps
* FFT-grid settings and number of MPI processes for kspace style PPPM:
PPPM uses parallel 3d FFTs which will drop much faster in parallel
efficiency with respect to the number of MPI processes than other
parts of the force computation. Thus using MPI+OpenMP parallelization
or :doc:`run style verlet/split <run_style>` can improve parallel
efficiency by limiting the number of MPI processes used for the FFTs.
* Load (im-)balance: LAMMPS' domain decomposition assumes that atoms are
evenly distributed across the entire simulation box. If there are
areas of vacuum, this may lead to different amounts of work for
different MPI processes. Using the :doc:`processors command
<processors>` to change the spatial decomposition, or MPI+OpenMP
parallelization instead of only-MPI to have larger sub-domains, or the
(fix) balance command (without or with switching to communication style
tiled) to change the sub-domain volumes are all methods that
can help to avoid load imbalances.
Examples comparing serial performance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Before looking at your own input deck(s), you should get some reference
data from a known input so that you know what kind of performance you
should expect from your input. For the following we therefore use the
``in.rhodo.scaled`` input file and ``data.rhodo`` data file from the
``bench`` folder. This is a system of 32000 atoms using the CHARMM force
field and long-range electrostatics running for 100 MD steps. The
performance data is printed at the end of a run and only measures the
performance during propagation and excludes the setup phase.
Running with a single MPI process on an AMD Ryzen Threadripper PRO
9985WX CPU (64 cores, 128 threads, base clock: 3.2GHz, max. clock
5.4GHz, L1/L2/L3 cache 5MB/64MB/256MB, 8 DDR5-6400 memory channels) one
gets the following performance report:
.. code-block::
Performance: 1.232 ns/day, 19.476 hours/ns, 7.131 timesteps/s, 228.197 katom-step/s
99.2% CPU use with 1 MPI tasks x 1 OpenMP threads
The %CPU value should be at 100% or very close. Lower values would
be an indication that there are *other* processes also using the same
CPU core and thus invalidating the performance data. The katom-step/s
value is best suited for comparisons, since it is fairly independent
from the system size. The `in.rhodo.scaled` input can be easily made
larger through replication in the three dimensions by settings variables
"x", "y", "z" to values other than 1 from the command line with the
"-var" flag. Example:
- 32000 atoms: 228.8 katom-step/s
- 64000 atoms: 231.6 katom-step/s
- 128000 atoms: 231.1 katom-step/s
- 256000 atoms: 226.4 katom-step/s
- 864000 atoms: 229.6 katom-step/s
Comparing to an AMD Ryzen 7 7840HS CPU (8 cores, 16 threads, base clock
3.8GHz, max. clock 5.1GHz, L1/L2/L3 cache 512kB/8MB/16MB, 2 DDR5-5600
memory channels), we get similar single core performance (~220
katom-step/s vs. ~230 katom-step/s) due to the similar clock and
architecture:
- 32000 atoms: 219.8 katom-step/s
- 64000 atoms: 222.5 katom-step/s
- 128000 atoms: 216.8 katom-step/s
- 256000 atoms: 221.0 katom-step/s
- 864000 atoms: 221.1 katom-step/s
Switching to an older Intel Xeon E5-2650 v4 CPU (12 cores, 12 threads,
base clock 2.2GHz, max. clock 2.9GHz, L1/L2/L3 cache (64kB/256kB/30MB, 4
DDR4-2400 memory channels) leads to a lower performance of approximately
109 katom-step/s due to differences in architecture and clock. In all
cases, when looking at multiple runs, the katom-step/s property
fluctuates by approximately 1% around the average.
From here on we are looking at the performance for the 256000 atom system only
and change several settings incrementally:
#. No compiler optimization GCC (-Og -g): 183.8 katom-step/s
#. Moderate optimization with debug info GCC (-O2 -g): 231.1 katom-step/s
#. Full compiler optimization GCC (-DNDEBUG -O3): 236.0 katom-step/s
#. Aggressive compiler optimization GCC (-O3 -ffast-math -march=native): 239.9 katom-step/s
#. Source code optimization in OPENMP package (1 thread): 266.7 katom-step/s
#. Use *fix nvt* instead of *fix npt* (compute virial only every 50 steps): 272.9 katom-step/s
#. Increase pair style cutoff by 2 :math:`\AA`: 181.2 katom-step/s
#. Use tight PPPM convergence (1.0e-6 instead of 1.0e-4): 161.9 katom-step/s
#. Use Ewald summation instead of PPPM (at 1.0e-4 convergence): 19.9 katom-step/s
The numbers show that gains from aggressive compiler optimizations are
rather small in LAMMPS, the data access optimizations in the OPENMP (and
OPT) packages are more prominent. On the other side, using more
accurate force field settings causes, not unexpectedly, a significant
slowdown (to about half the speed). Finally, using regular Ewald
summation causes a massive slowdown due to the bad algorithmic scaling
with system size.
Examples comparing parallel performance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The parallel performance usually goes on top of the serial performance.
Using twice as many processors should increase the performance metric
by up to a factor of two. With the number of processors *N* and the
serial performance :math:`p_1` and the performance for *N* processors
:math:`p_N` we can define a *parallel efficiency* in percent as follows:
.. math::
P_{eff} = \frac{p_N}{p_1 \cdot N} \cdot 100\%
For the AMD Ryzen Threadripper PRO 9985WX CPU and the serial
simulation settings of point 6. from above, we get the following
parallel efficiency data for the 256000 atom system:
- 1 MPI task: 273.6 katom-step/s, :math:`P_{eff} = 100\%`
- 2 MPI tasks: 530.6 katom-step/s, :math:`P_{eff} = 97\%`
- 4 MPI tasks: 1.021 Matom-step/s, :math:`P_{eff} = 93\%`
- 8 MPI tasks: 1.837 Matom-step/s, :math:`P_{eff} = 84\%`
- 16 MPI tasks: 3.574 Matom-step/s, :math:`P_{eff} = 82\%`
- 32 MPI tasks: 6.479 Matom-step/s, :math:`P_{eff} = 74\%`
- 64 MPI tasks: 9.032 Matom-step/s, :math:`P_{eff} = 52\%`
- 128 MPI tasks: 12.03 Matom-step/s, :math:`P_{eff} = 34\%`
The 128 MPI tasks run uses CPU cores from hyper-threading.
For a small system with only 32000 atoms the parallel efficiency
drops off earlier when the number of work units is too small relative
to the communication overhead:
- 1 MPI task: 270.8 katom-step/s, :math:`P_{eff} = 100\%`
- 2 MPI tasks: 529.3 katom-step/s, :math:`P_{eff} = 98\%`
- 4 MPI tasks: 989.8 katom-step/s, :math:`P_{eff} = 91\%`
- 8 MPI tasks: 1.832 Matom-step/s, :math:`P_{eff} = 85\%`
- 16 MPI tasks: 3.463 Matom-step/s, :math:`P_{eff} = 80\%`
- 32 MPI tasks: 5.970 Matom-step/s, :math:`P_{eff} = 69\%`
- 64 MPI tasks: 7.477 Matom-step/s, :math:`P_{eff} = 42\%`
- 128 MPI tasks: 8.069 Matom-step/s, :math:`P_{eff} = 23\%`
Measuring performance of your input deck
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The best way to do this is run the your system (actual number of atoms)
for a modest number of timesteps (say 100 steps) on several different
processor counts, including a single processor if possible. Do this for
an equilibrium version of your system, so that the 100-step timings are
representative of a much longer run. There is typically no need to run
for 1000s of timesteps to get accurate timings; you can simply
extrapolate from short runs.
For the set of runs, look at the timing data printed to the screen and
log file at the end of each LAMMPS run. The
@ -28,12 +230,15 @@ breakdown and relative percentages. For example, trying different
options for speeding up the long-range solvers will have little impact
if they only consume 10% of the run time. If the pairwise time is
dominating, you may want to look at GPU or OMP versions of the pair
style, as discussed below. Comparing how the percentages change as
you increase the processor count gives you a sense of how different
operations within the timestep are scaling. Note that if you are
running with a Kspace solver, there is additional output on the
breakdown of the Kspace time. For PPPM, this includes the fraction
spent on FFTs, which can be communication intensive.
style, as discussed below. Comparing how the percentages change as you
increase the processor count gives you a sense of how different
operations within the timestep are scaling. If you are using PPPM as
Kspace solver, you can turn on an additional output with
:doc:`kspace_modify fftbench yes <kspace_modify>` which measures the
time spent during PPPM on the 3d FFTs, which can be communication
intensive for larger processor counts. This provides an indication
whether it is worth trying out alternatives to the default FFT settings
for additional performance.
Another important detail in the timing info are the histograms of
atoms counts and neighbor counts. If these vary widely across

View File

@ -92,6 +92,7 @@ Miscellaneous tools
* :ref:`LAMMPS coding standards <coding_standard>`
* :ref:`emacs <emacs>`
* :ref:`i-PI <ipi>`
* :ref:`JSON support <json>`
* :ref:`kate <kate>`
* :ref:`LAMMPS-GUI <lammps_gui>`
* :ref:`LAMMPS magic patterns for file(1) <magic>`
@ -364,7 +365,7 @@ These tools were provided by Aidan Thompson at Sandia
.. _fep:
fep tool
------------------
--------
The tools/fep directory contains Python scripts useful for
post-processing results from performing free-energy perturbation
@ -379,7 +380,7 @@ See README file in the tools/fep directory.
.. _ipi:
i-PI tool
-------------------
---------
.. versionchanged:: 27June2024
@ -432,6 +433,87 @@ tools/createatoms tool's input file.
----------
.. _json:
JSON support files
------------------
.. versionadded:: 12June2025
The ``tools/json`` directory contains files and tools to support
using `JSON format <https://www.json.org/>`_ files in LAMMPS.
Currently only the :doc:`molecule command <molecule>` supports
files in JSON format directly, but this is planned to be expanded
in the future.
JSON file validation
^^^^^^^^^^^^^^^^^^^^
The JSON syntax is independent of its content, and thus the data in the
file must follow suitable conventions to be correctly parsed during
input. This can be done in a portable fashion using a `JSON schema file
<https://json-schema.org/>`_ (which is in JSON format as well) to define
those conventions. A suitable JSON validator software can then validate
JSON files against the requirements. Validating a particular JSON file
against a schema ensures that both, the syntax *and* the conventions
are followed. This is useful when writing or editing JSON files in a
text editor or when writing a pre-processing script or tool to create
JSON files for a specific purpose in LAMMPS. It **cannot** check
whether the file contents are physically meaningful, though.
One such validator tool is `check-jsonschema
<https://check-jsonschema.readthedocs.io/>`_ which is written in Python
and can be installed using the `pip Python package manager
<https://pypi.org/>`_, best in a virtual environment as shown below (for
a Bourne Shell command line):
.. code-block:: sh
python -m venv validate-json
source validate-json/bin/activate
pip install --upgrade pip
pip install check-jsonschema
To validate a specific JSON file against a provided schema (here for
a :doc:`molecule command file <molecule>` you would then run for example:
.. code-block:: sh
check-jsonschema --schemafile molecule-schema.json tip3p.json
The latest schema files are also maintained and available for download
at https://download.lammps.org/json . This enables validation of JSON
files even if the LAMMPS sources are not locally available. Example:
.. code-block:: sh
check-jsonschema --schemafile https://download.lammps.org/json/molecule-schema.json tip3p.json
JSON file format normalization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are extensions to the strict JSON format that allow for comments
or ignore additional (dangling) commas. The ``reformat-json.cpp`` tool
will read JSON files in relaxed format, but write it out in strict format.
It is also possible to change the level of indentation from -1 (all data
one long line) to any positive integer value. The original file will be
backed up (.bak added to file name) and then overwritten.
Manual compilation (it will be automatically included in the CMake build
if building tools is requested during CMake configuration):
.. code-block:: sh
g++ -I <path/to/lammps/src> -o reformat-json reformat-json.cpp
Usage:
.. parsed-literal::
reformat-json <indent-width> <json-file-1> [<json-file-2> ...]
----------
.. _kate:
kate tool
@ -475,9 +557,13 @@ beginners to start with LAMMPS, it is also the expectation that
LAMMPS-GUI users will eventually transition to workflows that most
experienced LAMMPS users employ.
All features have been extensively exposed to keyboard shortcuts, so
that there is also appeal for experienced LAMMPS users for prototyping
and testing simulation setups.
.. image:: JPG/lammps-gui-screen.png
:align: center
:scale: 50%
Features have been extensively exposed to keyboard shortcuts, so that
there is also appeal for experienced LAMMPS users for prototyping and
testing simulation setups.
Features
^^^^^^^^
@ -502,7 +588,7 @@ Here are a few highlights of LAMMPS-GUI
- Visualization of current state in Image Viewer (via calling :doc:`write_dump image <dump_image>`)
- Capture of images created via :doc:`dump image <dump_image>` in Slide show window
- Dialog to set variables, similar to the LAMMPS command-line flag '-v' / '-var'
- Support for GPU, INTEL, KOKKOS/OpenMP, OPENMAP, and OPT and accelerator packages
- Support for GPU, INTEL, KOKKOS/OpenMP, OPENMP, and OPT accelerator packages
Parallelization
^^^^^^^^^^^^^^^
@ -523,8 +609,8 @@ with CMake is required.
The LAMMPS-GUI has been successfully compiled and tested on:
- Ubuntu Linux 20.04LTS x86_64 using GCC 9, Qt version 5.12
- Fedora Linux 40 x86\_64 using GCC 14 and Clang 17, Qt version 5.15LTS
- Fedora Linux 40 x86\_64 using GCC 14, Qt version 6.7
- Fedora Linux 41 x86\_64 using GCC 14 and Clang 17, Qt version 5.15LTS
- Fedora Linux 41 x86\_64 using GCC 14, Qt version 6.8
- Apple macOS 12 (Monterey) and macOS 13 (Ventura) with Xcode on arm64 and x86\_64, Qt version 5.15LTS
- Windows 10 and 11 x86_64 with Visual Studio 2022 and Visual C++ 14.36, Qt version 5.15LTS
- Windows 10 and 11 x86_64 with Visual Studio 2022 and Visual C++ 14.40, Qt version 6.7

View File

@ -10,7 +10,7 @@ Syntax
atom_style style args
* style = *amoeba* or *angle* or *atomic* or *body* or *bond* or *charge* or *dielectric* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *molecular* or *oxdna* or *peri* or *smd* or *sph* or *sphere* or *bpm/sphere* or *spin* or *tdpd* or *tri* or *template* or *wavepacket* or *hybrid*
* style = *amoeba* or *angle* or *apip* or *atomic* or *body* or *bond* or *charge* or *dielectric* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *molecular* or *oxdna* or *peri* or *smd* or *sph* or *sphere* or *bpm/sphere* or *spin* or *tdpd* or *tri* or *template* or *wavepacket* or *hybrid*
.. parsed-literal::
@ -117,6 +117,10 @@ the Additional Information section below.
- *bond* + "angle data"
- :ref:`MOLECULE <PKG-MOLECULE>`
- bead-spring polymers with stiffness
* - *apip*
- *atomic* + apip_lambda, apip_lambda_required, apip_lambda_input, apip_lambda_const, apip_lambda_input_ta, apip_e_fast, apip_e_precise, apip_f_const_lambda, apip_f_dyn_lambda
- :ref:`APIP <PKG-APIP>`
- adaptive-precision interatomic potentials(APIP), see :doc:`APIP howto <Howto_apip>`
* - *atomic*
- tag, type, x, v, f, image, mask
-

View File

@ -53,15 +53,17 @@ The value *eng* is the interaction energy for the angle.
The value *v_name* can be used together with the *set* keyword to
compute a user-specified function of the angle theta. The *name*
specified for the *v_name* value is the name of an :doc:`equal-style variable <variable>` which should evaluate a formula based on a
specified for the *v_name* value is the name of an :doc:`equal-style
variable <variable>` which should evaluate a formula based on a
variable which will store the angle theta. This other variable must
be an :doc:`internal-style variable <variable>` defined in the input
script; its initial numeric value can be anything. It must be an
internal-style variable, because this command resets its value
directly. The *set* keyword is used to identify the name of this
other variable associated with theta.
be an :doc:`internal-style variable <variable>` specified by the *set*
keyword. It is an internal-style variable, because this command
resets its value directly. The internal-style variable does not need
to be defined in the input script (though it can be); if it is not
defined, then the *set* option creates an :doc:`internal-style
variable <variable>` with the specified name.
Note that the value of theta for each angle which stored in the
Note that the value of theta for each angle which is stored in the
internal variable is in radians, not degrees.
As an example, these commands can be added to the bench/in.rhodo
@ -70,7 +72,6 @@ system and output the statistics in various ways:
.. code-block:: LAMMPS
variable t internal 0.0
variable cos equal cos(v_t)
variable cossq equal cos(v_t)*cos(v_t)

View File

@ -64,20 +64,32 @@ All these properties are computed for the pair of atoms in a bond,
whether the two 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.
.. versionchanged:: 12Jun2025
The sign of *dx*, *dy*, *dz* is no longer determined by the atom IDs
of the bonded atoms but by their order in the bond list to be
consistent with *fx*, *fy*, and *fz*.
The value *dist* is the current length of the bond. The values *dx*,
*dy*, and *dz* are the :math:`(x,y,z)` components of the distance vector
:math:`\vec{x_i} - \vec{x_j}` between the atoms in the bond. The order
of the atoms is determined by the bond list and the respective atom-IDs
can be output with :doc:`compute property/local
<compute_property_local>`.
The value *engpot* is the potential energy for the bond,
based on the current separation of the pair of atoms in the bond.
The value *force* is the magnitude of the force acting between the
pair of atoms in the bond.
The value *force* is the magnitude of the force acting between the pair
of atoms in the bond, which is positive for a repulsive force and
negative for an attractive force.
The values *fx*, *fy*, and *fz* are the xyz components of
*force* between the pair of atoms in the bond. For bond styles that apply
non-central forces, such as :doc:`bond_style bpm/rotational
The values *fx*, *fy*, and *fz* are the :math:`(x,y,z)` components of
the force on the first atom *i* in the bond due to the second atom *j*.
Mathematically, they are obtained by multiplying the value of *force*
from above with a unit vector created from the *dx*, *dy*, and *dz*
components of the distance vector also described above. For bond styles
that apply non-central forces, such as :doc:`bond_style bpm/rotational
<bond_bpm_rotational>`, these values only include the :math:`(x,y,z)`
components of the normal force component.
@ -118,13 +130,15 @@ moving apart.
The value *v_name* can be used together with the *set* keyword to
compute a user-specified function of the bond distance. The *name*
specified for the *v_name* value is the name of an :doc:`equal-style variable <variable>` which should evaluate a formula based on a
variable which will store the bond distance. This other variable must
be an :doc:`internal-style variable <variable>` defined in the input
script; its initial numeric value can be anything. It must be an
internal-style variable, because this command resets its value
directly. The *set* keyword is used to identify the name of this
other variable associated with theta.
specified for the *v_name* value is the name of an :doc:`equal-style
variable <variable>` which should evaluate a formula based on a
variable which stores the bond distance. This other variable must be
the :doc:`internal-style variable <variable>` specified by the *set*
keyword. It is an internal-style variable, because this command
resets its value directly. The internal-style variable does not need
to be defined in the input script (though it can be); if it is not
defined, then the *set* option creates an :doc:`internal-style
variable <variable>` with the specified name.
As an example, these commands can be added to the bench/in.rhodo
script to compute the length\ :math:`^2` of every bond in the system and
@ -132,7 +146,6 @@ output the statistics in various ways:
.. code-block:: LAMMPS
variable d internal 0.0
variable dsq equal v_d*v_d
compute 1 all property/local batom1 batom2 btype

View File

@ -45,30 +45,31 @@ interactions. The number of datums generated, aggregated across all
processors, equals the number of dihedral angles in the system, modified
by the group parameter as explained below.
The value *phi* (:math:`\phi`) is the dihedral angle, as defined in the diagram
on the :doc:`dihedral_style <dihedral_style>` doc page.
The value *phi* (:math:`\phi`) is the dihedral angle, as defined in
the diagram on the :doc:`dihedral_style <dihedral_style>` doc page.
The value *v_name* can be used together with the *set* keyword to compute a
user-specified function of the dihedral angle :math:`\phi`. The *name*
specified for the *v_name* value is the name of an
:doc:`equal-style variable <variable>` which should evaluate a formula based on
a variable which will store the angle :math:`\phi`. This other variable must
be an :doc:`internal-style variable <variable>` defined in the input
script; its initial numeric value can be anything. It must be an
internal-style variable, because this command resets its value
directly. The *set* keyword is used to identify the name of this
other variable associated with :math:`\phi`.
The value *v_name* can be used together with the *set* keyword to
compute a user-specified function of the dihedral angle :math:`\phi`.
The *name* specified for the *v_name* value is the name of an
:doc:`equal-style variable <variable>` which should evaluate a formula
based on a variable which will store the angle :math:`\phi`. This
other variable must be an :doc:`internal-style variable <variable>`
specified by the *set* keyword. It is an internal-style variable,
because this command resets its value directly. The internal-style
variable does not need to be defined in the input script (though it
can be); if it is not defined, then the *set* option creates an
:doc:`internal-style variable <variable>` with the specified name.
Note that the value of :math:`\phi` for each angle which stored in the internal
variable is in radians, not degrees.
Note that the value of :math:`\phi` for each angle which stored in the
internal variable is in radians, not degrees.
As an example, these commands can be added to the bench/in.rhodo
script to compute the :math:`\cos\phi` and :math:`\cos^2\phi` of every dihedral
angle in the system and output the statistics in various ways:
script to compute the :math:`\cos\phi` and :math:`\cos^2\phi` of every
dihedral angle in the system and output the statistics in various
ways:
.. code-block:: LAMMPS
variable p internal 0.0
variable cos equal cos(v_p)
variable cossq equal cos(v_p)*cos(v_p)
@ -100,10 +101,10 @@ no consistent ordering of the entries within the local vector or array
from one timestep to the next. The only consistency that is
guaranteed is that the ordering on a particular timestep will be the
same for local vectors or arrays generated by other compute commands.
For example, dihedral output from the
:doc:`compute property/local <compute_property_local>` command can be combined
with data from this command and output by the :doc:`dump local <dump>`
command in a consistent way.
For example, dihedral output from the :doc:`compute property/local
<compute_property_local>` command can be combined with data from this
command and output by the :doc:`dump local <dump>` command in a
consistent way.
Here is an example of how to do this:

View File

@ -49,8 +49,6 @@ proportional to the diffusion coefficient of the diffusing atoms.
The displacement of an atom is from its reference position. This is
normally the original position at the time
the compute command was issued, unless the *average* keyword is set to *yes*\ .
The value of the displacement will be
0.0 for atoms not in the specified compute group.
If the *com* option is set to *yes* then the effect of any drift in
the center-of-mass of the group of atoms is subtracted out before the
@ -111,7 +109,10 @@ distance\ :math:`^2` :doc:`units <units>`.
Restrictions
""""""""""""
Compute *msd* cannot be used with a dynamic group.
Compute *msd* cannot be used with a dynamic group and the number of
atoms in the compute group must not be changed by some fixes like,
for example, :doc:`fix deposit <fix_deposit>` or
:doc:`fix evaporate <fix_evaporate>`.
Related commands
""""""""""""""""

View File

@ -56,19 +56,33 @@ force cutoff distance for that interaction, as defined by the
:doc:`pair_style <pair_style>` and :doc:`pair_coeff <pair_coeff>`
commands.
The value *dist* is the distance between the pair of atoms.
The values *dx*, *dy*, and *dz* are the :math:`(x,y,z)` components of the
*distance* between the pair of atoms. This value is always the
distance from the atom of higher to the one with the lower atom ID.
.. versionchanged:: 12Jun2025
The sign of *dx*, *dy*, *dz* is no longer determined by the value of
their atom-IDs but by their order in the neighbor list to be
consistent with *fx*, *fy*, and *fz*.
The value *dist* is the distance between the pair of atoms. The values
*dx*, *dy*, and *dz* are the :math:`(x,y,z)` components of the distance
vector :math:`\vec{x_i} - \vec{x_j}` between the pair of atoms. The
order of the atoms is determined by the neighbor list and the respective
atom-IDs can be output with :doc:`compute property/local
<compute_property_local>`.
The value *eng* is the interaction energy for the pair of atoms.
The value *force* is the force acting between the pair of atoms, which
is positive for a repulsive force and negative for an attractive
force. The values *fx*, *fy*, and *fz* are the :math:`(x,y,z)` components of
*force* on atom I. For pair styles that apply non-central forces,
such as :doc:`granular pair styles <pair_gran>`, these values only include
the :math:`(x,y,z)` components of the normal force component.
force.
The values *fx*, *fy*, and *fz* are the :math:`(x,y,z)` components of
the force vector on the first atom *i* of a pair in the neighbor list
due to the second atom *j*. Mathematically, they are obtained by
multiplying the value of *force* from above with a unit vector created
from the *dx*, *dy*, and *dz* components of the distance vector also
described above. For pair styles that apply non-central forces, such as
:doc:`granular pair styles <pair_gran>`, these values only include the
:math:`(x,y,z)` components of the normal force component.
A pair style may define additional pairwise quantities which can be
accessed as *p1* to *pN*, where :math:`N` is defined by the pair style.

View File

@ -34,6 +34,8 @@ Syntax
i_name, d_name, i2_name[I], d2_name[I],
vfrac, s0, espin, eradius, ervel, erforce,
rho, drho, e, de, cv, buckling,
apip_lambda, apip_lambda_input, apip_e_fast,
apip_e_precise
.. parsed-literal::
@ -70,6 +72,13 @@ Syntax
*i2_name[I]* = Ith column of custom integer array with name
*d2_name[I]* = Ith column of custom floating-point array with name
.. parsed-literal::
APIP package per-atom properties:
*apip_lambda* = switching parameter
*apip_lambda_input* = input used to calculate the switching parameter
*apip_e_fast,apip_e_precise* = potential energies mixed by the adaptive-precision potential
.. parsed-literal::
PERI package per-atom properties:
@ -162,6 +171,22 @@ segment particles and define the end points of each line segment.
*corner2z*, *corner3x*, *corner3y*, *corner3z*, are defined for
triangular particles and define the corner points of each triangle.
The accessible quantities from the :doc:`APIP package <Howto_apip>` are
explained in the doc pages of this package in detail.
In short: *apip_lambda* is the switching parameter :math:`\lambda\in[0,1]`,
that is calculated from *apip_lambda_input* and that mixes the energies
of a fast (*apip_e_fast*) and a precise (*apip_e_precise*) potential
into an adaptive-precision energy.
.. note::
The energy according to the fast and the precise potential are only
computed for the subset of atoms, for which it is required, i.e.,
for an atom :math:`i` with :math:`\lambda_i=1` one does not need
:math:`E_i^\text{precise}` and with :math:`\lambda_i=0` one does
not need :math:`E_i^\text{fast}`.
In addition, the various per-atom quantities listed above for specific
packages are only accessible by this command.

View File

@ -45,13 +45,13 @@ Examples
Description
"""""""""""
Compute *stress/mop* and compute *stress/mop/profile* define
computations that calculate components of the local stress tensor using
the method of planes :ref:`(Todd) <mop-todd>`. Specifically in compute
*stress/mop* calculates 3 components are computed in directions *dir*,\
*x*\ ; *dir*,\ *y*\ ; and *dir*,\ *z*\ ; where *dir* is the direction
normal to the plane, while in compute *stress/mop/profile* the profile
of the stress is computed.
Compute *stress/mop* and compute *stress/mop/profile*
calculate components of the local stress tensor using
the method of planes :ref:`(Todd) <mop-todd>`. Specifically, compute
*stress/mop* calculates 3 components in directions :math:`ix`,
:math:`iy`, and :math:`iz` where :math:`i` is the direction
normal to the plane, while compute *stress/mop/profile* calculates the profile
of the local stress along the :math:`i` direction.
Contrary to methods based on histograms of atomic stress (i.e., using
:doc:`compute stress/atom <compute_stress_atom>`), the method of planes
@ -103,14 +103,15 @@ Output info
Compute *stress/mop* calculates a global vector (indices starting at 1),
with 3 values for each declared keyword (in the order the keywords have
been declared). For each keyword, the stress tensor components are
ordered as follows: stress_dir,x, stress_dir,y, and stress_dir,z.
ordered as follows: :math:`P_{ix}`, :math:`P_{iy}`, and :math:`P_{iz}`,
where :math:`i` is the direction normal to the plane.
Compute *stress/mop/profile* instead calculates a global array, with 1
column giving the position of the planes where the stress tensor was
computed, and with 3 columns of values for each declared keyword (in the
order the keywords have been declared). For each keyword, the profiles
of stress tensor components are ordered as follows: stress_dir,x;
stress_dir,y; and stress_dir,z.
of stress tensor components are ordered as follows: :math:`P_{ix}`,
:math:`P_{iy}`, and :math:`P_{iz}`.
The values are in pressure :doc:`units <units>`.
@ -129,15 +130,11 @@ package <Build_package>` doc page on for more info.
The method is implemented for orthogonal simulation boxes whose
size does not change in time, and axis-aligned planes.
Contributions from bonds, angles, and dihedrals are not compatible
with MPI parallel runs.
The method only works with two-body pair interactions, because it
requires the class method ``Pair::single()`` to be implemented, which is
not possible for manybody potentials. In particular, compute
*stress/mop/profile* and *stress/mop* do not work with more than two-body
pair interactions, long range (kspace) interactions and
improper intramolecular interactions.
Compute *stress/mop* and *stress/mop/profile* do not work with manybody
non-bonded interactions, long range (kspace) interactions and
improper intramolecular interactions. The reason is that the current
implementation requires the class method ``Pair::single()`` to be implemented,
which is not possible for manybody potentials.
The impact of fixes that affect the stress (e.g. fix langevin) is
also not included in the stress computed here.

View File

@ -396,7 +396,7 @@ correct number of particles are inserted, in a perfectly random
fashion. Which lattice sites are selected will change with the number
of processors used.
.. versionadded:: TBD
.. versionadded:: 12Jun2025
The *group* keyword adds the newly created atoms to the named
:doc:`group <group>`. If the group does not yet exist it will be
@ -416,24 +416,23 @@ atom, based on its coordinates. They apply to all styles except
*single*. The *name* specified for the *var* keyword is the name of
an :doc:`equal-style variable <variable>` that should evaluate to a
zero or non-zero value based on one or two or three variables that
will store the *x*, *y*, or *z* coordinates of an atom (one variable per
coordinate). If used, these other variables must be
:doc:`internal-style variables <variable>` defined in the input
script; their initial numeric value can be anything. They must be
internal-style variables, because this command resets their values
directly. The *set* keyword is used to identify the names of these
other variables, one variable for the *x*-coordinate of a created atom,
one for *y*, and one for *z*.
will store the *x*, *y*, or *z* coordinates of an atom (one variable
per coordinate). If used, these other variables must be specified by
the *set* keyword. They are internal-style variable, because this
command resets their values directly. The internal-style variables do
not need to be defined in the input script (though they can be); if
one (or more) is not defined, then the *set* option creates an
:doc:`internal-style variable <variable>` with the specified name.
.. figure:: img/sinusoid.jpg
:figwidth: 50%
:align: right
:target: _images/sinusoid.jpg
When an atom is created, its :math:`(x,y,z)` coordinates become the values for
any *set* variable that is defined. The *var* variable is then
evaluated. If the returned value is 0.0, the atom is not created. If
it is non-zero, the atom is created.
When an atom is about to be created, its :math:`(x,y,z)` coordinates
become the values for any *set* variable that is defined. The *var*
variable is then evaluated. If the returned value is 0.0, the atom is
not created. If it is non-zero, the atom is created.
As an example, these commands can be used in a 2d simulation, to
create a sinusoidal surface. Note that the surface is "rough" due to
@ -456,8 +455,6 @@ converts lattice spacings to distance.
region box block 0 $x 0 $y -0.5 0.5
create_box 1 box
variable xx internal 0.0
variable yy internal 0.0
variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0"
create_atoms 1 box var v set x xx set y yy
write_dump all atom sinusoid.lammpstrj

View File

@ -201,6 +201,7 @@ accelerated styles exist.
* :doc:`append/atoms <fix_append_atoms>` - append atoms to a running simulation
* :doc:`atc <fix_atc>` - initiates a coupled MD/FE simulation
* :doc:`atom/swap <fix_atom_swap>` - Monte Carlo atom type swapping
* :doc:`atom_weight/apip <fix_atom_weight_apip>` - compute atomic load of an :doc:`APIP potential <Howto_apip>` for load balancing
* :doc:`ave/atom <fix_ave_atom>` - compute per-atom time-averaged quantities
* :doc:`ave/chunk <fix_ave_chunk>` - compute per-chunk time-averaged quantities
* :doc:`ave/correlate <fix_ave_correlate>` - compute/output time correlations
@ -208,6 +209,7 @@ accelerated styles exist.
* :doc:`ave/grid <fix_ave_grid>` - compute per-grid time-averaged quantities
* :doc:`ave/histo <fix_ave_histo>` - compute/output time-averaged histograms
* :doc:`ave/histo/weight <fix_ave_histo>` - weighted version of fix ave/histo
* :doc:`ave/moments <fix_ave_moments>` - compute moments of scalar quantities
* :doc:`ave/time <fix_ave_time>` - compute/output global time-averaged quantities
* :doc:`aveforce <fix_aveforce>` - add an averaged force to each atom
* :doc:`balance <fix_balance>` - perform dynamic load-balancing
@ -256,6 +258,7 @@ accelerated styles exist.
* :doc:`flow/gauss <fix_flow_gauss>` - Gaussian dynamics for constant mass flux
* :doc:`freeze <fix_freeze>` - freeze atoms in a granular simulation
* :doc:`gcmc <fix_gcmc>` - grand canonical insertions/deletions
* :doc:`gjf <fix_gjf>` - statistically correct Langevin temperature control using the GJ methods
* :doc:`gld <fix_gld>` - generalized Langevin dynamics integrator
* :doc:`gle <fix_gle>` - generalized Langevin equation thermostat
* :doc:`gravity <fix_gravity>` - add gravity to atoms in a granular simulation
@ -263,11 +266,13 @@ accelerated styles exist.
* :doc:`halt <fix_halt>` - terminate a dynamics run or minimization
* :doc:`heat <fix_heat>` - add/subtract momentum-conserving heat
* :doc:`heat/flow <fix_heat_flow>` - plain time integration of heat flow with per-atom temperature updates
* :doc:`hmc <fix_hmc>` - Hybrid/Hamiltonian Monte Carlo (HMC) particle propagation
* :doc:`hyper/global <fix_hyper_global>` - global hyperdynamics
* :doc:`hyper/local <fix_hyper_local>` - local hyperdynamics
* :doc:`imd <fix_imd>` - implements the "Interactive MD" (IMD) protocol
* :doc:`indent <fix_indent>` - impose force due to an indenter
* :doc:`ipi <fix_ipi>` - enable LAMMPS to run as a client for i-PI path-integral simulations
* :doc:`lambda/apip <fix_lambda_apip>` - compute switching parameter, that controls the precision of an :doc:`APIP potential <Howto_apip>`
* :doc:`langevin <fix_langevin>` - Langevin temperature control
* :doc:`langevin/drude <fix_langevin_drude>` - Langevin temperature control of Drude oscillators
* :doc:`langevin/eff <fix_langevin_eff>` - Langevin temperature control for the electron force field model
@ -276,6 +281,7 @@ accelerated styles exist.
* :doc:`lb/momentum <fix_lb_momentum>` - :doc:`fix momentum <fix_momentum>` replacement for use with a lattice-Boltzmann fluid
* :doc:`lb/viscous <fix_lb_viscous>` - :doc:`fix viscous <fix_viscous>` replacement for use with a lattice-Boltzmann fluid
* :doc:`lineforce <fix_lineforce>` - constrain atoms to move in a line
* :doc:`lambda_thermostat/apip <fix_lambda_thermostat_apip>` - apply energy conserving correction for an :doc:`APIP potential <Howto_apip>`
* :doc:`manifoldforce <fix_manifoldforce>` - restrain atoms to a manifold during minimization
* :doc:`mdi/qm <fix_mdi_qm>` - LAMMPS operates as a client for a quantum code via the MolSSI Driver Interface (MDI)
* :doc:`mdi/qmmm <fix_mdi_qmmm>` - LAMMPS operates as client for QM/MM simulation with a quantum code via the MolSSI Driver Interface (MDI)
@ -290,6 +296,7 @@ accelerated styles exist.
* :doc:`mvv/tdpd <fix_mvv_dpd>` - constant temperature DPD using the modified velocity-Verlet algorithm
* :doc:`neb <fix_neb>` - nudged elastic band (NEB) spring forces
* :doc:`neb/spin <fix_neb_spin>` - nudged elastic band (NEB) spring forces for spins
* :doc:`neighbor/swap <fix_neighbor_swap>` - kinetic Monte Carlo (kMC) atom swapping
* :doc:`nonaffine/displacement <fix_nonaffine_displacement>` - calculate nonaffine displacement of atoms
* :doc:`nph <fix_nh>` - constant NPH time integration via Nose/Hoover
* :doc:`nph/asphere <fix_nph_asphere>` - NPH for aspherical particles
@ -395,6 +402,7 @@ accelerated styles exist.
* :doc:`rigid/small <fix_rigid>` - constrain many small clusters of atoms to move as a rigid body with NVE integration
* :doc:`rx <fix_rx>` - solve reaction kinetic ODEs for a defined reaction set
* :doc:`saed/vtk <fix_saed_vtk>` - time-average the intensities from :doc:`compute saed <compute_saed>`
* :doc:`set <fix_set>` - reset an atom property via an atom-style variable every N steps
* :doc:`setforce <fix_setforce>` - set the force on each atom
* :doc:`setforce/spin <fix_setforce>` - set magnetic precession vectors on each atom
* :doc:`sgcmc <fix_sgcmc>` - fix for hybrid semi-grand canonical MD/MC simulations

View File

@ -440,7 +440,7 @@ this fix uses to reset theta0 needs to generate values in radians.
----------
.. versionadded:: TBD
.. versionadded:: 12Jun2025
The *dihedral* keyword uses the specified variable to change the value of
a dihedral coefficient over time, very similar to how the *angle* keyword

View File

@ -116,7 +116,10 @@ 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.
changed when the atom types change. The same applies for systems
with per-atom masses: non *semi-grand* will swap atom masses, but
the masses have to be the same each for the atom types. When using
*semi-grand* no per-atom masses are changed.
Since this fix computes total potential energies before and after
proposed swaps, even complicated potential energy calculations are
@ -184,11 +187,10 @@ When this fix is used with a :doc:`hybrid pair style <pair_hybrid>`
system, only swaps between atom types of the same sub-style (or
combination of sub-styles) are permitted.
This fix cannot be used with systems that do not have per-type masses
(e.g. atom style sphere) since the implemented algorithm pre-computes
velocity rescaling factors from per-type masses and ignores any per-atom
masses, if present. In case both, per-type and per-atom masses are
present, a warning is printed.
This fix can be used with systems that have per-atom masses
(e.g. atom style sphere) provided all atoms of the types handled
by this fix have the same mass per type. The fix will check for that.
In case both, per-type and per-atom masses are present, a warning is printed.
Related commands
""""""""""""""""

View File

@ -0,0 +1,143 @@
.. index:: fix atom_weight/apip
fix atom_weight/apip command
============================
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID atom_weight/apip nevery fast_potential precise_potential lambda_input lambda_zone group_lambda_input [no_rescale]
* ID, group-ID are documented in :doc:`fix <fix>` command
* atom_weight/apip = style name of this fix command
* nevery = perform load calculation every this many steps
* fast_potential = *eam* or *ace* for time measurements of the corresponding pair_style or float for constant time
* precise_potential = *ace* for a time measurement of the pair_style pace/apip or float for constant time
* lambda_input = *lambda/input* for a time measurement of pair_style lambda/input/apip or float for constant time
* lambda_zone = *lambda/zone* for a time measurement of pair_style lambda/zone/apip or float for constant time
* group_lambda_input = group-ID of the group for which lambda_input is computed
* no_rescale = do not rescale the work per processor to the measured total force-computation time
Examples
""""""""
.. code-block:: LAMMPS
fix 2 all atom_weight/apip 50 eam ace lambda/input lambda/zone all
fix 2 all atom_weight/apip 50 1e-05 0.0004 4e-06 4e-06 all
fix 2 all atom_weight/apip 50 ace ace 4e-06 4e-06 all no_rescale
Description
"""""""""""
This command approximates the load every atom causes when an
adaptive-precision interatomic potential (APIP) according to
:ref:`(Immel) <Immel2025_2>` is used.
This approximated load can be saved as atomic variable and
used as input for the dynamic load balancing via the
:doc:`fix balance <fix_balance>` command.
An adaptive-precision potential like :doc:`eam/apip <pair_eam_apip>`
and :doc:`pace/apip <pair_pace_apip>` is calculated only
for a subset of atoms.
The switching parameter that determines per atom, which potential energy is
used, can be also calculated by
:doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`.
A spatial switching zone, that ensures a smooth transition between two
different interatomic potentials, can be calculated by
:doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`.
Thus, there are up to four force-subroutines, that are computed only for a
subset of atoms and combined via the pair_style :doc:`hybrid/overlay <pair_hybrid>`.
For all four force-subroutines, the average work per atom is be measured
per processor by the corresponding pair_style.
This fix extracts these measurements of the pair styles every *nevery*
steps. The average compute times are used to calculates a per-atom vector with
the approximated atomic weight, whereas the average compute time of the four
subroutines contributes only to the load of atoms, for which the corresponding
subroutine was calculated.
If not disabled via *no_rescale*, the so calculated load is
rescaled per processor so that the total atomic compute time matches the
also measured total compute time of the whole pair_style.
This atomic weight is intended to be used
as input for :doc:`fix balance <fix_balance>`:
.. code-block:: LAMMPS
variable nevery equal 10
fix weight_atom all atom_weight/apip ${nevery} eam ace lambda/input lambda/zone all
variable myweight atom f_weight_atom
fix balance all balance ${nevery} 1.1 rcb weight var myweight
Furthermore, this fix provides the over the processors averaged compute time of the
four pair_styles, which are used to approximate the atomic weight, as vector.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to
:doc:`binary restart files <restart>`. None of the
:doc:`fix_modify <fix_modify>` options are relevant to this fix.
This fix produces a per-atom vector that contains the atomic
weight of each atom.
The per-atom vector can only be accessed on timesteps that are multiples
of *nevery*.
Furthermore, this fix computes a global vector of length 4 with
statistical information about the four different (possibly)
measured compute times per force subroutine. The four
values in the vector are as follows:
#. average compute time for one atom using the fast pair_style
#. average compute time for one atom using the precise pair_style
#. average compute time of lambda/input/apip for one atom
#. average compute time of lambda/zone/apip for one atom
The compute times are computed as average of all processors that
measured at least one computation of the corresponding style.
The vector values calculated by this fix are "intensive" and
updated whenever the per-atom vector is computed, i.e., in
timesteps that are multiples of *nevery*.
The vector and the per-atom vector can be accessed 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 not invoked during
:doc:`energy minimization <minimize>`.
----------
Restrictions
""""""""""""
This fix is part of the APIP 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:`fix balance <fix_balance>`,
:doc:`fix lambda/apip <fix_lambda_apip>`,
:doc:`fix lambda_thermostat/apip <fix_lambda_thermostat_apip>`,
:doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`,
:doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`,
:doc:`pair_style eam/apip <pair_eam_apip>`,
:doc:`pair_style pace/apip <pair_pace_apip>`,
Default
"""""""
*no_rescale* is not used by default.
----------
.. _Immel2025_2:
**(Immel)** Immel, Drautz and Sutmann, J Chem Phys, 162, 114119 (2025)

View File

@ -82,10 +82,9 @@ specified values may represent calculations performed by computes and
fixes which store their own "group" definitions.
Each listed value can be the result of a compute or fix or the
evaluation of an equal-style or vector-style variable. For
vector-style variables, the specified indices can include a wildcard
character. See the :doc:`fix ave/correlate <fix_ave_correlate>` page
for details.
evaluation of an equal-style or vector-style variable. The specified
indices can include a wildcard string. See the
:doc:`fix ave/correlate <fix_ave_correlate>` page for details on that.
The *Nevery* and *Nfreq* arguments specify on what time steps the input
values will be used to calculate correlation data and the frequency

296
doc/src/fix_ave_moments.rst Normal file
View File

@ -0,0 +1,296 @@
.. index:: fix ave/moments
fix ave/moments command
=======================
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID ave/moments Nevery Nrepeat Nfreq value1 value2 ... moment1 moment2 ... keyword args ...
* ID, group-ID are documented in :doc:`fix <fix>` command
* ave/moments = style name of this fix command
* Nevery = use input values every this many time steps
* Nrepeat = # of times to use input values for calculating averages
* Nfreq = calculate averages every this many time steps
* one or more input variables can be listed
* value = v_name
.. parsed-literal::
c_ID = global scalar calculated by a compute with ID
c_ID[I] = Ith component of global vector calculated by a compute with ID, I can include wildcard (see below)
f_ID = global scalar calculated by a fix with ID
f_ID[I] = Ith component of global vector calculated by a fix with ID, I can include wildcard (see below)
v_name = value calculated by an equal-style variable with name
v_name[I] = value calculated by a vector-style variable with name, I can include wildcard (see below)
* one or more moments to compute can be listed
* moment = *mean* or *stddev* or *variance* or *skew* or *kurtosis*, see exact definitions below.
* zero or more keyword/arg pairs may be appended
* keyword = *start* or *history*
.. parsed-literal::
*start* args = Nstart
Nstart = invoke first after this time step
*history* args = Nrecent
Nrecent = keep a history of up to Nrecent outputs
Examples
""""""""
.. code-block:: LAMMPS
fix 1 all ave/moments 1 1000 100 v_volume mean stddev
fix 1 all ave/moments 1 200 1000 v_volume variance kurtosis history 10
Description
"""""""""""
.. versionadded:: 12Jun2025
Using one or more values as input, calculate the moments of the underlying
(population) distributions based on samples collected every few time
steps over a time step window. The definitions of the moments calculated
are given below.
The group specified with this command is ignored. However, note that
specified values may represent calculations performed by computes and
fixes which store their own "group" definitions.
Each listed value can be the result of a :doc:`compute <compute>` or
:doc:`fix <fix>` or the evaluation of an equal-style or vector-style
:doc:`variable <variable>`. In each case, the compute, fix, or variable
must produce a global quantity, not a per-atom or local quantity.
If you wish to spatial- or time-average or histogram per-atom
quantities from a compute, fix, or variable, then see the :doc:`fix
ave/chunk <fix_ave_chunk>`, :doc:`fix ave/atom <fix_ave_atom>`, or
:doc:`fix ave/histo <fix_ave_histo>` commands. If you wish to sum a
per-atom quantity into a single global quantity, see the :doc:`compute
reduce <compute_reduce>` command.
Many :doc:`computes <compute>` and :doc:`fixes <fix>` produce global
quantities. See their doc pages for details. :doc:`Variables <variable>`
of style *equal* and *vector* are the only ones that can be used with
this fix. Variables of style *atom* cannot be used, since they produce
per-atom values.
The input values must all be scalars or vectors with a bracketed term
appended, indicating the :math:`I^\text{th}` value of the vector is
used.
The result of this fix can be accessed as a vector, containing the
interleaved moments of each input in order. If M moments are requested,
then the moments of input 1 will be the first M values in the vector
output by this fix. The moments of input 2 will the next M values, etc.
If there are N values, the vector length will be N*M.
----------
For input values from a compute or fix or variable, the bracketed index
I can be specified using a wildcard asterisk with the index to
effectively specify multiple values. This takes the form "\*" or "\*n"
or "m\*" or "m\*n". If :math:`N` is the size of the vector, then an
asterisk with no numeric values means all indices from 1 to :math:`N`.
A leading asterisk means all indices from 1 to n (inclusive). A
trailing asterisk means all indices from n to :math:`N` (inclusive). A
middle asterisk means all indices from m to n (inclusive).
Using a wildcard is the same as if the individual elements of the vector
or cells of the array had been listed one by one. For examples, see the
description of this capability in :doc:`fix ave/time <fix_ave_time>`.
----------
The :math:`N_\text{every}`, :math:`N_\text{repeat}`, and
:math:`N_\text{freq}` arguments specify on what time steps the input
values will be used in order to contribute to the average. The final
statistics are generated on time steps that are a multiple of
:math:`N_\text{freq}`\ . The average is over a window of up to
:math:`N_\text{repeat}` quantities, computed in the preceding portion of
the simulation once every :math:`N_\text{every}` time steps.
.. note::
Contrary to most fix ave/* commands, it is not required that Nevery *
Nrepeat <= Nfreq. This is to allow the user to choose the time
window and number of samples contributing to the output at each
Nfreq interval.
For example, if :math:`N_\text{freq}=100` and :math:`N_\text{repeat}=5`
(and :math:`N_\text{every}=1`), then on step 100 values from time steps
96, 97, 98, 99, and 100 will be used. The fix does not compute its
inputs on steps that are not required. If :math:`N_\text{freq}=5`,
:math:`N_\text{repeat}=8` and :math:`N_\text{every}=1`, then values
will first be calculated on step 5 from steps 1-5, on step 10 from 3-10,
on step 15 from 8-15 and so on, forming a rolling average over
timesteps that span a time window larger than Nfreq.
----------
If a value begins with "c\_", a compute ID must follow which has been
previously defined in the input script. If no bracketed term is
appended, the global scalar calculated by the compute is used. If a
bracketed term is appended, the Ith element of the global vector
calculated by the compute is used. See the discussion above for how I
can be specified with a wildcard asterisk to effectively specify
multiple values.
If a value begins with "f\_", a fix ID must follow which has been
previously defined in the input script. If no bracketed term is
appended, the global scalar calculated by the fix is used. If a
bracketed term is appended, the Ith element of the global vector
calculated by the fix is used. See the discussion above for how I can
be specified with a wildcard asterisk to effectively specify multiple
values.
Note that some fixes only produce their values on certain time steps,
which must be compatible with *Nevery*, else an error will result.
Users can also write code for their own fix styles and :doc:`add them to
LAMMPS <Modify>`.
If a value begins with "v\_", a variable name must follow which has been
previously defined in the input script. Only equal-style or vector-style
variables can be used, which both produce global values. Vector-style
variables require a bracketed term to specify the Ith element of the
vector calculated by the variable.
Note that variables of style *equal* and *vector* define a formula which
can reference individual atom properties or thermodynamic keywords, or
they can invoke other computes, fixes, or variables when they are
evaluated, so this is a very general means of specifying quantities to
time average.
----------
The moments are output in the order requested in the arguments following
the last input. Any number and order of moments can be specified,
although it does not make much sense to specify the same moment multiple
times. All moments are computed using a correction of the sample estimators
used to obtain unbiased cumulants :math:`k_{1..4}` (see :ref:`(Cramer)
<Cramer1>`). The correction for variance is the standard Bessel
correction. For other moments, see :ref:`(Joanes)<Joanes1>`.
For *mean*, the arithmetic mean :math:`\bar{x} = \frac{1}{n}
\sum_{i=1}^{n} x_i` is calculated.
For *variance*, the Bessel-corrected sample variance :math:`var = k_2 =
\frac{1}{n - 1} \sum_{i=1}^{n} (x_i - \bar{x})^2` is calculated.
For *stddev*, the Bessel-corrected sample standard deviation
:math:`stddev = \sqrt{k_2}` is calculated.
For *skew*, the adjusted Fisher--Pearson standardized moment :math:`G_1
= \frac{k_3}{k_2^{3/2}} = \frac{k_3}{stddev^3}` is calculated.
For *kurtosis*, the adjusted Fisher--Pearson standardized moment
:math:`G_2 = \frac{k_4}{k_2^2}` is calculated.
----------
Fix invocation and output can be modified by optional keywords.
The *start* keyword specifies that the first computation should be no
earlier than the step number given (but will still occur on a multiple
of *Nfreq*). The default is step 0. Often input values can be 0.0 at
time 0, so setting *start* to a larger value can avoid including a 0.0
in a longer series.
The *history* keyword stores the Nrecent most recent outputs on Nfreq
timesteps, so they can be accessed as global outputs of the fix. Nrecent
must be >= 1. The default is 1, meaning only the most recent output is
accessible. For example, if history 10 is specified and Nfreq = 1000,
then on timestep 20000, the Nfreq outputs from steps 20000, 19000, ...
11000 are available for access. See below for details on how to access
the history values.
For example, this will store the outputs of the previous 10 Nfreq
time steps, i.e. a window of 10000 time steps:
.. code-block:: LAMMPS
fix 1 all ave/moments 1 200 1000 v_volume mean history 10
The previous results can be accessed as values in a global array output
by this fix. Each column of the array is the vector output of the N-th
preceding Nfreq timestep. For example, assuming a single moment is
calculated, the most recent result corresponding to the third input
value would be accessed as "f_name[3][1]", "f_name[3][4]" is the 4th
most recent and so on. The current vector output is always the first
column of the array, corresponding to the most recent result.
To illustrate the utility of keeping output history, consider using
this fix in conjunction with :doc:`fix halt <fix_halt>` to stop a run
automatically if a quantity is converged to within some desired tolerance:
.. code-block:: LAMMPS
variable target equal etot
fix aveg all ave/moments 1 200 1000 v_target mean stddev history 10
variable stopcond equal "abs(f_aveg[1]-f_aveg[1][10])<f_aveg[2]"
fix fhalt all halt 1000 v_stopcond == 1
In this example, every 1000 time steps, the average and standard
deviation of the total energy over the previous 200 time steps are
calculated. If the difference between the most recent and 10-th most
recent average is lower than the most recent standard deviation, the run
is stopped.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files
<restart>`.
This fix produces a global vector and global array which can be accessed
by various :doc:`output commands <Howto_output>`. The values can be
accessed on any time step, but may not be current.
A global vector is produced with the # of elements = number of moments *
number of inputs. The moments are output in the order given in the fix
definition. An array is produced having # of rows = length of vector
output (with an ordering which matches the vector) and # of columns =
value of *history*. There is always at least one column.
Each element of the global vector or array can be either "intensive" or
"extensive", depending on whether the values contributing to the element
are "intensive" or "extensive". If a compute or fix provides the value
being time averaged, then the compute or fix determines whether the value
is intensive or extensive; see the page for that compute or fix for
further info. Values produced by a variable are treated as intensive.
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>`.
Restrictions
""""""""""""
This compute 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.
Related commands
""""""""""""""""
:doc:`fix ave/time <fix_ave_time>`,
Default
"""""""
The option defaults are history = 1, start = 0.
----------
.. _Cramer1:
**(Cramer)** Cramer, Mathematical Methods of Statistics, Princeton University Press (1946).
.. _Joanes1:
**(Joanes)** Joanes, Gill, The Statistician, 47, 183--189 (1998).

View File

@ -21,7 +21,7 @@ Syntax
* Rmin = two atoms separated by less than Rmin can bond (distance units)
* bondtype = type of created bonds (integer or type label)
* zero or more keyword/value pairs may be appended to args
* keyword = *iparam* or *jparam* or *prob* or *atype* or *dtype* or *itype* or *aconstrain*
* keyword = *iparam* or *jparam* or *prob* or *atype* or *dtype* or *itype* or *aconstrain* or *molecule*
.. parsed-literal::
@ -43,6 +43,10 @@ Syntax
*aconstrain* value = amin amax
amin = minimal angle at which new bonds can be created
amax = maximal angle at which new bonds can be created
*molecule* value = *off* or *inter* or *intra*
*off* = allow both inter- and intramolecular reactions (default)
*inter* = search for reactions between molecules with different IDs
*intra* = search for reactions within the same molecule
Examples
""""""""
@ -52,6 +56,7 @@ Examples
fix 5 all bond/create 10 1 2 0.8 1
fix 5 all bond/create 1 3 3 0.8 1 prob 0.5 85784 iparam 2 3
fix 5 all bond/create 1 3 3 0.8 1 prob 0.5 85784 iparam 2 3 atype 1 dtype 2
fix 5 all bond/create 10 13 25 7 28 iparam 1 15 jparam 1 27 prob 0.2 91322 molecule inter
fix 5 all bond/create/angle 10 1 2 1.122 1 aconstrain 120 180 prob 1 4928459 iparam 2 1 jparam 2 2
labelmap atom 1 c1 2 n2
@ -123,6 +128,8 @@ actually created. The *fraction* setting must be a value between 0.0
and 1.0. A uniform random number between 0.0 and 1.0 is generated and
the eligible bond is only created if the random number is less than *fraction*.
The *molecule* keyword can be used to force the reaction to be intermolecular, intramolecular or either. When the value is set to *off*, molecule IDs are not considered when searching for reactions (default). When the value is set to *inter*, atoms must have different molecule IDs in order to be considered for the reaction. When the value is set to *intra*, only atoms with the same molecule ID are considered for the reaction.
The *aconstrain* keyword is only available with the fix
bond/create/angle command. It allows one to specify minimum and maximum
angles *amin* and *amax*, respectively, between the two prospective bonding

View File

@ -98,52 +98,53 @@ the following dynamic equation:
\frac{dc}{dt} = -\alpha (K_p e + K_i \int_0^t e \, dt + K_d \frac{de}{dt} )
where *c* is the continuous time analog of the control variable,
*e* =\ *pvar*\ -\ *setpoint* is the error in the process variable, and
:math:`\alpha`, :math:`K_p`, :math:`K_i` , and :math:`K_d` are constants
set by the corresponding
keywords described above. The discretized version of this equation is:
where *c* is the continuous time analog of the control variable, *e*
=\ *pvar*\ -\ *setpoint* is the error in the process variable, and
:math:`\alpha`, :math:`K_p`, :math:`K_i` , and :math:`K_d` are
constants set by the corresponding keywords described above. The
discretized version of this equation is:
.. math::
c_n = c_{n-1} -\alpha \left( K_p \tau e_n + K_i \tau^2 \sum_{i=1}^n e_i + K_d (e_n - e_{n-1}) \right)
where :math:`\tau = \mathtt{Nevery} \cdot \mathtt{timestep}` is the time
interval between updates,
and the subscripted variables indicate the values of *c* and *e* at
successive updates.
where :math:`\tau = \mathtt{Nevery} \cdot \mathtt{timestep}` is the
time interval between updates, and the subscripted variables indicate
the values of *c* and *e* at successive updates.
From the first equation, it is clear that if the three gain values
:math:`K_p`, :math:`K_i`, :math:`K_d` are dimensionless constants,
then :math:`\alpha` must have
units of [unit *cvar*\ ]/[unit *pvar*\ ]/[unit time] e.g. [ eV/K/ps
]. The advantage of this unit scheme is that the value of the
constants should be invariant under a change of either the MD timestep
size or the value of *Nevery*\ . Similarly, if the LAMMPS :doc:`unit style <units>` is changed, it should only be necessary to change
the value of :math:`\alpha` to reflect this, while leaving :math:`K_p`,
:math:`K_i`, and :math:`K_d` unaltered.
then :math:`\alpha` must have units of [unit *cvar*\ ]/[unit *pvar*\
]/[unit time] e.g. [ eV/K/ps ]. The advantage of this unit scheme is
that the value of the constants should be invariant under a change of
either the MD timestep size or the value of *Nevery*\ . Similarly, if
the LAMMPS :doc:`unit style <units>` is changed, it should only be
necessary to change the value of :math:`\alpha` to reflect this, while
leaving :math:`K_p`, :math:`K_i`, and :math:`K_d` unaltered.
When choosing the values of the four constants, it is best to first
pick a value and sign for :math:`\alpha` that is consistent with the
magnitudes and signs of *pvar* and *cvar*\ . The magnitude of :math:`K_p`
should then be tested over a large positive range keeping :math:`K_i = K_d =0`.
A good value for :math:`K_p` will produce a fast response in *pvar*,
without overshooting the *setpoint*\ . For many applications, proportional
feedback is sufficient, and so :math:`K_i = K_d =0` can be used. In cases
where there is a substantial lag time in the response of *pvar* to a change
in *cvar*, this can be counteracted by increasing :math:`K_d`. In situations
magnitudes and signs of *pvar* and *cvar*\ . The magnitude of
:math:`K_p` should then be tested over a large positive range keeping
:math:`K_i = K_d =0`. A good value for :math:`K_p` will produce a
fast response in *pvar*, without overshooting the *setpoint*\ . For
many applications, proportional feedback is sufficient, and so
:math:`K_i = K_d =0` can be used. In cases where there is a
substantial lag time in the response of *pvar* to a change in *cvar*,
this can be counteracted by increasing :math:`K_d`. In situations
where *pvar* plateaus without reaching *setpoint*, this can be
counteracted by increasing :math:`K_i`. In the language of Charles Dickens,
:math:`K_p` represents the error of the present, :math:`K_i` the error of
the past, and :math:`K_d` the error yet to come.
counteracted by increasing :math:`K_i`. In the language of Charles
Dickens, :math:`K_p` represents the error of the present, :math:`K_i`
the error of the past, and :math:`K_d` the error yet to come.
Because this fix updates *cvar*, but does not initialize its value,
the initial value :math:`c_0` is that assigned by the user in the input script via
the :doc:`internal-style variable <variable>` command. This value is
used (by every other LAMMPS command that uses the variable) until this
fix performs its first update of *cvar* after *Nevery* timesteps. On
the first update, the value of the derivative term is set to zero,
because the value of :math:`e_{n-1}` is not yet defined.
the initial value :math:`c_0` is that assigned by the user in the
input script via the :doc:`internal-style variable <variable>`
command. This value is used (by every other LAMMPS command that uses
the variable) until this fix performs its first update of *cvar* after
*Nevery* timesteps. On the first update, the value of the derivative
term is set to zero, because the value of :math:`e_{n-1}` is not yet
defined.
----------
@ -154,21 +155,23 @@ must produce a global quantity, not a per-atom or local quantity.
If *pvar* begins with "c\_", a compute ID must follow which has been
previously defined in the input script and which generates a global
scalar or vector. See the individual :doc:`compute <compute>` doc page
for details. If no bracketed integer is appended, the scalar
scalar or vector. See the individual :doc:`compute <compute>` doc
page for details. If no bracketed integer is appended, the scalar
calculated by the compute is used. If a bracketed integer is
appended, the Ith value of the vector calculated by the compute is
used. Users can also write code for their own compute styles and :doc:`add them to LAMMPS <Modify>`.
used. Users can also write code for their own compute styles and
:doc:`add them to LAMMPS <Modify>`.
If *pvar* begins with "f\_", a fix ID must follow which has been
previously defined in the input script and which generates a global
scalar or vector. See the individual :doc:`fix <fix>` page for
details. Note that some fixes only produce their values on certain
timesteps, which must be compatible with when fix controller
references the values, or else an error results. If no bracketed integer
is appended, the scalar calculated by the fix is used. If a bracketed
integer is appended, the Ith value of the vector calculated by the fix
is used. Users can also write code for their own fix style and :doc:`add them to LAMMPS <Modify>`.
references the values, or else an error results. If no bracketed
integer is appended, the scalar calculated by the fix is used. If a
bracketed integer is appended, the Ith value of the vector calculated
by the fix is used. Users can also write code for their own fix style
and :doc:`add them to LAMMPS <Modify>`.
If *pvar* begins with "v\_", a variable name must follow which has been
previously defined in the input script. Only equal-style variables
@ -182,19 +185,21 @@ variable.
The target value *setpoint* for the process variable must be a numeric
value, in whatever units *pvar* is defined for.
The control variable *cvar* must be the name of an :doc:`internal-style variable <variable>` previously defined in the input script. Note
that it is not specified with a "v\_" prefix, just the name of the
variable. It must be an internal-style variable, because this fix
updates its value directly. Note that other commands can use an
equal-style versus internal-style variable interchangeably.
The control variable *cvar* must be the name of an
:doc:`internal-style variable <variable>` previously defined in the
input script. Note that it is not specified with a "v\_" prefix, just
the name of the variable. It must be an internal-style variable,
because this fix updates its value directly. Note that other commands
can use an equal-style versus internal-style variable interchangeably.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Currently, no information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
are relevant to this fix.
Currently, no information about this fix is written to :doc:`binary
restart files <restart>`. None of the :doc:`fix_modify <fix_modify>`
options are relevant to this fix.
This fix produces a global vector with 3 values which can be accessed
by various :doc:`output commands <Howto_output>`. The values can be
@ -211,7 +216,8 @@ variable is in. 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
""""""""""""

View File

@ -298,7 +298,8 @@ Note that it should return the "change" in box length, not the
absolute box length. This means it should evaluate to 0.0 when
invoked on the initial timestep of the run following the definition of
fix deform. It should evaluate to a value > 0.0 to dilate the box at
future times, or a value < 0.0 to compress the box.
future times, or a value < 0.0 to compress the box. The exception
would be if the run command uses the *pre no* option.
The variable *name2* must also be an :doc:`equal-style variable
<variable>` and should calculate the rate of box length change, in

View File

@ -225,22 +225,25 @@ rotated configuration of the molecule.
.. versionadded:: 21Nov2023
The *var* and *set* keywords can be used together to provide a criterion
for accepting or rejecting the addition of an individual atom, based on its
coordinates. The *name* specified for the *var* keyword is the name of an
:doc:`equal-style variable <variable>` that should evaluate to a zero or
non-zero value based on one or two or three variables that will store the
*x*, *y*, or *z* coordinates of an atom (one variable per coordinate). If
used, these other variables must be :doc:`internal-style variables
<variable>` defined in the input script; their initial numeric value can be
anything. They must be internal-style variables, because this command
resets their values directly. The *set* keyword is used to identify the
names of these other variables, one variable for the *x*-coordinate of a
created atom, one for *y*, and one for *z*. When an atom is created, its
:math:`(x,y,z)` coordinates become the values for any *set* variable that
is defined. The *var* variable is then evaluated. If the returned value
is 0.0, the atom is not created. If it is non-zero, the atom is created.
For an example of how to use these keywords, see the
The *var* and *set* keywords can be used together to provide a
criterion for accepting or rejecting the addition of an individual
atom, based on its coordinates. The *name* specified for the *var*
keyword is the name of an :doc:`equal-style variable <variable>` that
should evaluate to a zero or non-zero value based on one or two or
three variables that will store the *x*, *y*, or *z* coordinates of an
atom (one variable per coordinate). If used, these other variables
must be :doc:`internal-style variables <variable>` specified by the
*set* keyword. They must be internal-style variables, because this
command resets their values directly. The internal-style variables do
not need to be defined in the input script (though they can be); if
one (or more) is not defined, then the *set* option creates an
:doc:`internal-style variable <variable>` with the specified name.
When an atom is about to be created, its :math:`(x,y,z)` coordinates
become the values for any *set* variable that is defined. The *var*
variable is then evaluated. If the returned value is 0.0, the atom is
not created. If it is non-zero, the atom is created. For an example
of how to use the set/var keywords in a similar context, see the
:doc:`create_atoms <create_atoms>` command.
The *rate* option moves the insertion volume in the z direction (3d)
@ -304,12 +307,13 @@ units of distance or velocity.
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This fix writes the state of the deposition to :doc:`binary restart files <restart>`. This includes information about how many
particles have been deposited, the random number generator seed, the
next timestep for deposition, 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 deposition to :doc:`binary restart
files <restart>`. This includes information about how many particles
have been deposited, the random number generator seed, the next
timestep for deposition, 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::

View File

@ -1,9 +1,12 @@
.. index:: fix electron/stopping
.. index:: fix electron/stopping/kk
.. index:: fix electron/stopping/fit
fix electron/stopping command
=============================
Accelerator Variants: *electron/stopping/kk*
fix electron/stopping/fit command
=================================
@ -157,6 +160,18 @@ of the atom types. There is an examples/PACKAGES/electron_stopping/ directory,
which illustrates uses of this command. Details of this implementation are
further described in :ref:`Stewart2018 <Stewart2018>` and :ref:`Lee2020 <Lee2020>`.
----------
.. include:: accel_styles.rst
.. note::
The region keyword is supported by Kokkos, but a Kokkos-enabled
region must be used. See the region :doc:`region <region>` command for
more information.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

208
doc/src/fix_gjf.rst Normal file
View File

@ -0,0 +1,208 @@
.. index:: fix gjf
fix gjf command
========================
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID gjf Tstart Tstop damp seed keyword values ...
* ID, group-ID are documented in :doc:`fix <fix>` command
* gjf = style name of this fix command
* Tstart,Tstop = desired temperature at start/end of run (temperature units)
* Tstart can be a variable (see below)
* damp = damping parameter (time units)
* seed = random number seed to use for white noise (positive integer)
* zero or more keyword/value pairs may be appended
* keyword = *vel* or *method*
.. parsed-literal::
*vel* value = *vfull* or *vhalf*
*vfull* = use on-site velocity
*vhalf* = use half-step velocity
*method* value = *1-8*
*1-8* = choose one of the many GJ formulations
*7* = requires input of additional scalar between 0 and 1
Examples
""""""""
.. code-block:: LAMMPS
fix 3 boundary gjf 10.0 10.0 1.0 699483
fix 1 all gjf 10.0 100.0 100.0 48279 vel vfull method 4
fix 2 all gjf 10.0 10.0 1.0 26488 method 7 0.95
Description
"""""""""""
.. versionadded:: 12Jun2025
Apply a Langevin thermostat as described in :ref:`(Gronbech-Jensen-2020) <Gronbech-Jensen-2020>`
to a group of atoms which models an interaction with a background
implicit solvent. As described in the papers cited below, the GJ methods
provide exact diffusion, drift, and Boltzmann sampling for linear systems for
any time step within the stability limit. The purpose of this set of methods
is therefore to significantly improve statistical accuracy at longer time steps
compared to other thermostats.
The current implementation provides the user with the option to output
the velocity in one of two forms: *vfull* or *vhalf*. The option *vhalf*
outputs the 2GJ half-step velocity given in :ref:`Gronbech Jensen/Gronbech-Jensen
<Gronbech-Jensen-2019>`; for linear systems, this velocity is shown to not
have any statistical errors for any stable time step. The option *vfull*
outputs the on-site velocity given in :ref:`Gronbech-Jensen/Farago
<Gronbech-Jensen-Farago>`; this velocity is shown to be systematically lower
than the target temperature by a small amount, which grows
quadratically with the timestep. An overview of statistically correct Boltzmann
and Maxwell-Boltzmann sampling of true on-site and true half-step velocities is
given in :ref:`Gronbech-Jensen-2020 <Gronbech-Jensen-2020>`.
This fix allows the use of several GJ methods as listed in :ref:`Gronbech-Jensen-2020 <Gronbech-Jensen-2020>`.
The GJ-VII method is described in :ref:`Finkelstein <Finkelstein>` and GJ-VIII
is described in :ref:`Gronbech-Jensen-2024 <Gronbech-Jensen-2024>`.
The implementation follows the splitting form provided in Eqs. (24) and (25)
in :ref:`Gronbech-Jensen-2024 <Gronbech-Jensen-2024>`, including the application
of Gaussian noise values, per the description in
:ref:`Gronbech-Jensen-2023 <Gronbech-Jensen-2023>`.
.. note::
Unlike the :doc:`fix langevin <fix_langevin>` command which performs force
modifications only, this fix performs thermostatting and time integration.
Thus you no longer need a separate time integration fix, like :doc:`fix nve <fix_nve>`.
See the :doc:`Howto thermostat <Howto_thermostat>` page for
a discussion of different ways to compute temperature and perform
thermostatting.
The desired temperature at each timestep is a ramped value during the
run from *Tstart* to *Tstop*\ .
*Tstart* can be specified as an equal-style or atom-style
:doc:`variable <variable>`. In this case, the *Tstop* setting is
ignored. If the value is a variable, it should be specified as
v_name, where name is the variable name. In this case, the variable
will be evaluated each timestep, and its value used to determine the
target temperature.
Equal-style variables can specify formulas with various mathematical
functions, and include :doc:`thermo_style <thermo_style>` command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent temperature.
Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent
temperature with optional time-dependence as well.
Like other fixes that perform thermostatting, this fix can be used
with :doc:`compute commands <compute>` that remove a "bias" from the
atom velocities. E.g. to apply the thermostat only to atoms within a
spatial :doc:`region <region>`, or to remove the center-of-mass
velocity from a group of atoms, or to remove the x-component of
velocity from the calculation.
This is not done by default, but only if the :doc:`fix_modify
<fix_modify>` command is used to assign a temperature compute to this
fix that includes such a bias term. See the doc pages for individual
:doc:`compute temp commands <compute>` to determine which ones include
a bias.
The *damp* parameter is specified in time units and determines how
rapidly the temperature is relaxed. For example, a value of 100.0 means
to relax the temperature in a timespan of (roughly) 100 time units
(:math:`\tau` or fs or ps - see the :doc:`units <units>` command). The
damp factor can be thought of as inversely related to the viscosity of
the solvent. I.e. a small relaxation time implies a high-viscosity
solvent and vice versa. See the discussion about :math:`\gamma` and
viscosity in the documentation for the :doc:`fix viscous <fix_viscous>`
command for more details.
The random # *seed* must be a positive integer. A Marsaglia random
number generator is used. Each processor uses the input seed to
generate its own unique seed and its own stream of random numbers.
Thus the dynamics of the system will not be identical on two runs on
different numbers of processors.
----------
The keyword/value option pairs are used in the following ways.
The keyword *vel* determines which velocity is used to determine
quantities of interest in the simulation.
The keyword *method* selects one of the eight GJ-methods implemented in LAMMPS.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`.
Because the state of the random number generator is not saved in restart files,
this means you cannot do "exact" restarts with this fix, where the simulation
continues on the same as if no restart had taken place. However, in a
statistical sense, a restarted simulation should produce the same behavior.
Additionally, the GJ methods implement noise exclusively within each time step
(unlike the BBK thermostat of the fix-langevin). The restart is done with
either vfull or vhalf velocity output for as long as the choice of vfull/vhalf
is the same for the simulation as it is in the restart file.
The :doc:`fix_modify <fix_modify>` *temp* option is supported by this
fix. You can use it to assign a temperature :doc:`compute <compute>`
you have defined to this fix which will be used in its thermostatting
procedure, as described above. For consistency, the group used by
this fix and by the compute should be the same.
This fix can ramp its target temperature over multiple runs, using the
*start* and *stop* keywords of the :doc:`run <run>` command. See the
:doc:`run <run>` command for details of how to do this.
This fix is not invoked during :doc:`energy minimization <minimize>`.
Restrictions
""""""""""""
This fix is not compatible with run_style respa. It is not compatible with
accelerated packages such as KOKKOS.
Related commands
""""""""""""""""
:doc:`fix langevin <fix_langevin>`, :doc:`fix nvt <fix_nh>`
Default
"""""""
The option defaults are vel = vhalf, method = 1.
----------
.. _Gronbech-Jensen-2020:
**(Gronbech-Jensen-2020)** Gronbech-Jensen, Mol Phys 118, e1662506 (2020).
.. _Gronbech-Jensen-2019:
**(Gronbech Jensen/Gronbech-Jensen)** Gronbech Jensen and Gronbech-Jensen, Mol Phys, 117, 2511 (2019)
.. _Gronbech-Jensen-Farago:
**(Gronbech-Jensen/Farago)** Gronbech-Jensen and Farago, Mol Phys, 111, 983 (2013).
.. _Finkelstein:
**(Finkelstein)** Finkelstein, Cheng, Florin, Seibold, Gronbech-Jensen, J. Chem. Phys., 155, 18 (2021)
.. _Gronbech-Jensen-2024:
**(Gronbech-Jensen-2024)** Gronbech-Jensen, J. Stat. Phys. 191, 137 (2024).
.. _Gronbech-Jensen-2023:
**(Gronbech-Jensen-2023)** Gronbech-Jensen, J. Stat. Phys. 190, 96 (2023).

250
doc/src/fix_hmc.rst Normal file
View File

@ -0,0 +1,250 @@
.. index:: fix hmc
fix hmc command
===============
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID hmc N seed T keyword values ...
* ID, group-ID are documented in :doc:`fix <fix>` command
* hmc = style name of this fix command
* N = invoke a Monte Carlo step every N steps
* seed = random # seed (positive integer)
* T = temperature for assigning velocities and acceptance criterion
* one or more keyword/value pairs may be appended
.. parsed-literal::
keyword = *rigid* or *resample* or *mom*
*rigid* value = rigidID
rigidID = ID of :doc:`fix rigid/small <fix_rigid>` command
*resample* value = *yes* or *no*
*mom* value = *yes* or *no*
Examples
""""""""
.. code-block:: LAMMPS
fix 1 all hmc 10 123 500
fix hmc_water all hmc 100 123 298.15 rigid 1
fix 2 all hmc 10 12345 300 mom no resample yes
Description
"""""""""""
.. versionadded:: TBD
This fix implements the hybrid or Hamiltonian Monte Carlo (HMC)
algorithm. The basic idea is to use molecular dynamics (MD) to
generate trial MC "moves" which are then accepted or rejected via the
Metropolis criterion. In this context, an MC "move" is the new
configuration of particles after *N* MD steps, i.e. all the particles
in the system have moved to new positions. HMC generates a canonical
distribution in configuration space. More details on the theory behind
HMC can be found in the references, :ref:`(Mehlig) <Mehlig1>` and
:ref:`(Mehlig) <Mehlig2>`.
The details of the HMC algorithm for a repeating series of $N$ MD
steps are as follows:
(1) The configuration of the system is stored along with its current
total energy. This includes all particle positions and velocities and other
per-atom properties (e.g. dipole orientation vector for particles with
dipole moments).
(2) The system is time integrated in the NVE ensemble for the
specified *N* MD steps and the new energy is calculated. The new
configuration is the trial "move" to accept or reject.
(3) The energy change :math:`\Delta{H}` in the Hamiltonian of the
system due to the "move" is calculated by the following equation:
.. math::
\Delta{H} = H(q',p') - H(q,p)
The new configuration is then accepted/rejected according to the
Metropolis criterion with probability:
.. math::
p^{acc} = min(1,e^{\frac{-\Delta{H}}{k_B T}})
where *T* is the specified temperature.
The idea of HMC is to use a timestep large enough that total energy is
*not* conserved. The change in total energy (the Hamiltonian) is what
the Metropolis criterion is based on, not the change in potential
energy.
(4) If accepted, the new configuration becomes the starting point for
the next trial MC "move". If *resample* is *yes* then the velocities are
resampled at this point as well.
(5) If rejected, the old configuration (from *N* steps ago) is
restored and new momenta (velocities) are assigned to each particle
in the fix group by randomly resampling from a normal distribution
at the specified temperature $T$ using the following equation:
.. math::
p_{x,y,z} = \textbf{N}(0,1) \sqrt{\frac{k_B T}{2 m^2}}
The velocity-modified "old" configuration becomes the starting point
for the next trial MC "move".
.. note::
HMC should be run with a larger timestep than would be used for
traditional MD, which enables total energy fluctuations and
generation of new conformations which MD would not normally generate
as quickly. The timestep size may also affect the acceptance ratio
as a larger timestep will lead to larger and more extreme MC moves
which are less likely to be accepted. The timestep size must strike
a balance between allowing the total energy to change and generating
errors such as lost atoms due to atomic overlap. This means that
during the MD portion of the algorithm, unphysical dynamics will take
place, such as large temperature fluctuations and large forces
between atoms. This is expected and is part of the HMC algorithm, as
the MD step is not intended to produce a physically realistic
trajectory, but rather to generate a new configuration of particles
that can be accepted or rejected based on the Metropolis criterion.
.. note::
High acceptance ratios indicate that the MC algorithm is inefficient,
as it is not generating new configurations of particles any faster
than MD would on its own. In the limit of an acceptance ratio of 1.0,
the algorithm is equivalent to MD (with momentum resampling every *N*
timesteps if *resample* = *yes*), and no benefit is gained from MC.
A good rule of thumb is to aim for an acceptance ratio of 0.5 to 0.8,
which can be monitored via the output of this fix. This can be
achieved by adjusting the *N* parameter and the timestep size.
Increasing either of these values will increase the size of the total
energy fluctuations, which can decrease acceptance ratio. Increasing
*N* will also increase the computation time for each MC step, as more
MD steps are performed before each acceptance/rejection decision. As
noted above, increasing the timestep too much can lead to LAMMPS
errors due to lost atoms or bonds, so both of these parameters should
be chosen carefully.
.. note::
This fix is designed to be used only for constant NVE simulations.
No thermostat or barostat should be used, though LAMMPS does not
check for this. A :doc:`fix nve <fix_nve>` command must be defined
to perform time integration for the MD portion of the algorithm. See
the explanation of the *rigid* keyword below for an exception when
rigid bodies are defined. Also note that only per-atom data is
restored on MC move rejection, so anything which adds or remove
particles, changes the box size, or has some external state not
dependent on per-atom data will have undefined behavior.
----------
The keyword/value options are as follows:
The *rigid* keyword enables use of HMC for systems containing a
collection of small rigid bodies, with or without solvent (atomic
fluid or non-rigid molecular fluid).
The *rigidID* value should be the ID of a :doc:`fix rigid/small
<fix_rigid>` or :doc:`fix rigid/nve/small <fix_rigid>` command which
defines the rigid bodies. Its integrator will be used during the MD
timesteps. If there are additional particles in the system,
e.g. solvent, they should be time-integrated by a :doc:`fix nve
<fix_nve>` command as explained above.
The *resample* keyword determines whether velocities are also
resampled upon acceptance in step (4) above, in addition to step (5).
If *resample* = *yes*, velocities are resampled upon acceptance. If
*resample* = *no* (default), velocities are not resampled upon
acceptance.
The *mom* keyword sets the linear momentum of the ensemble of
particles each time velocities are reset in steps (4 or 5) above. If
*mom* = *yes* (default), the linear momentum of the ensemble of
velocities is zeroed. If *mom* = *no*, the linear momentum of the
ensemble of velocities is not zeroed.
----------
This fix creates several additional computes for monitoring the energy
and virial of the system and storing/restoring the system state. This
is done internally, as if these commands had been issued, where ID is
the ID of this fix:
.. code-block:: LAMMPS
compute hmc_ke_ID all ke
compute hmc_pe_ID all pe
compute hmc_peatom_ID all pe/atom
compute hmc_press_ID all pressure NULL virial
compute hmc_pressatom_ID all stress/atom NULL virial
The output of these computes can be accessed by the input script,
along with the other outputs described in the next section.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files
<restart>`. None of the :doc:`fix_modify <fix_modify>` options are
relevant to this fix.
This fix calculates a global scalar and global vector of length 5,
which can be accessed by various :doc:`output commands
<Howto_output>`. The scalar is the fraction (0-1) of attempted MC
moves which have been accepted. The vector stores the following
quantities:
* 1 = cumulative number of accepted moves
* 2 = cumulative number of rejected moves
* 3 = change in potential energy for last trial move
* 4 = change in kinetic energy for last trial move
* 5 = change in total energy (kinetic + potential energy) for last trial move
These values are updated once every *N* timesteps. The scalar and
cumulative counts are "intensive"; the three energies are "extensive"
and are in energy :doc:`units <units>`.
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>`.
Restrictions
""""""""""""
This fix is part of the MC package and requires the RIGID package to
be installed. It is only enabled if LAMMPS was built with both
packages. See the :doc:`Build package <Build_package>` doc page for
more info.
Related commands
""""""""""""""""
:doc:`fix nvt <fix_nh>`, :doc:`fix gcmc <fix_gcmc>`,
:doc:`fix tfmc <fix_tfmc>`
Default
"""""""
The option defaults are resample = no and mom = yes.
----------
.. _Mehlig1:
**(Mehlig1)** Mehlig, B., Heermann, D. W., & Forrest, B. M. (1992).
Hybrid Monte Carlo method for condensed-matter systems. Physical Review B, 45(2), 679.
.. _Mehlig2:
**(Mehlig2)** Mehlig, B., Heermann, D. W., & Forrest, B. M. (1992).
Exact langevin algorithms. Molecular Physics, 76(6), 1347-1357.

262
doc/src/fix_lambda_apip.rst Normal file
View File

@ -0,0 +1,262 @@
.. index:: fix lambda/apip
fix lambda/apip command
=======================
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID lambda/apip thr_lo thr_hi keyword args ...
* ID, group-ID are documented in :doc:`fix <fix>` command
* lambda/apip = style name of this fix command
* thr_lo = value below which :math:`\lambda_i^\text{input}` results in a switching parameter of 1
* thr_hi = value above which :math:`\lambda_i^\text{input}` results in a switching parameter of 0
* zero or one keyword/args pairs may be appended
* keyword = *time_averaged_zone* or *min_delta_lambda* or *lambda_non_group* or *store_atomic_stats* or *dump_atomic_history* or *group_fast* or *group_precise* or *group_ignore_lambda_input*
.. parsed-literal::
*time_averaged_zone* args = cut_lo cut_hi history_len_lambda_input history_len_lambda
cut_lo = distance at which the radial function decreases from 1
cut_hi = distance from which on the radial function is 0
history_len_lambda_input = number of time steps for which lambda_input is averaged
history_len_lambda = number of time steps for which the switching parameter is averaged
*min_delta_lambda* args = delta
delta = value below which changes of the switching parameter are neglected (>= 0)
*lambda_non_group* args = lambda_ng
lambda_ng = *precise* or *fast* or float
*precise* = assign a constant switching parameter of 0 to atoms, that are not in the group specified by group-ID
*fast* = assign a constant switching parameter of 1 to atoms, that are not in the group specified by group-ID
float = assign this constant switching parameter to atoms, that are not in the group specified by group-ID (0 <= float <= 1)
*group_fast* args = group-ID-fast
group-ID-fast = the switching parameter of 1 is used instead of the one computed by lambda_input for atoms in the group specified by group-ID-fast
*group_precise* args = group-ID-precise
group-ID-precise = the switching parameter of 0 is used instead of the one computed by lambda_input for atoms in the group specified by group-ID-precise
*group_ignore_lambda_input* args = group-ID-ignore-lambda-input
group-ID-ignore-lambda-input = the switching parameter of lambda_ng is used instead of the one computed by lambda_input for atoms in the group specified by group-ID-ignore-lambda-input
*store_atomic_stats* args = none
*dump_atomic_history* args = none
Examples
""""""""
.. code-block:: LAMMPS
fix 2 all lambda/apip 3.0 3.5 time_averaged_zone 4.0 12.0 110 110 min_delta_lambda 0.01
fix 2 mobile lambda/apip 3.0 3.5 time_averaged_zone 4.0 12.0 110 110 min_delta_lambda 0.01 group_ignore_lambda_input immobile lambda_non_group fast
Description
"""""""""""
The potential energy :math:`E_i` of an atom :math:`i` of an adaptive-precision
potential according to :ref:`(Immel) <Immel2025_3>` is given by
.. math::
E_i = \lambda_i E_i^\text{(fast)} + (1-\lambda_i) E_i^\text{(precise)},
whereas :math:`E_i^\text{(fast)}` is the potential energy of atom :math:`i`
according to a fast interatomic potential like EAM,
:math:`E_i^\text{(precise)}` is the potential energy according to a precise
interatomic potential such as ACE and :math:`\lambda_i\in[0,1]` is the
switching parameter that decides which potential energy is used.
This fix calculates the switching parameter :math:`\lambda_i` based on the
input provided from :doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`.
The calculation of the switching parameter is described in detail in
:ref:`(Immel) <Immel2025_3>`.
This fix calculates the switching parameter for all atoms in the
:doc:`group <group>`
described by group-ID, while the value of *lambda_non_group* is used
as switching parameter for all other atoms.
First, this fix calculates per atom :math:`i` the time averaged input
:math:`\lambda^\text{input}_{\text{avg},i}` from
:math:`\lambda^\text{input}_{i}`, whereas the number of averaged timesteps
can be set via *time_averaged_zone*.
.. note::
:math:`\lambda^\text{input}_{i}` is calculated by
:doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`, which needs to be included
in the input script as well.
The time averaged input :math:`\lambda^\text{input}_{\text{avg},i}` is then
used to calculate the switching parameter
.. math::
\lambda_{0,i}(t) = f^\text{(cut)} \left(\frac{\lambda_{\text{avg},i}^\text{input}(t) - \lambda_\text{lo}^\text{input}}{\lambda_\text{hi}^\text{input} - \lambda_\text{lo}^\text{input}} \right)\,,
whereas the thresholds :math:`\lambda_\text{hi}^\text{input}`
and :math:`\lambda_\text{lo}^\text{input}` are set by the
values provided as *thr_lo* and *thr_hi* and :math:`f^\text{(cut)}(x)` is a cutoff function
that is 1 for :math:`x\leq 0`, decays from 1 to 0 for :math:`x\in[0,1]`, and
is 0 for :math:`x\geq 1`.
If the *group_precise* argument is used, :math:`\lambda_{0,i}=0` is used for all
atoms :math:`i` assigned to the corresponding :doc:`group <group>`.
If the *group_fast* argument is used, :math:`\lambda_{0,i}=1` is used for all
atoms :math:`i` assigned to the corresponding :doc:`group <group>`.
If an atom is in the groups *group_fast* and *group_precise*,
:math:`\lambda_{0,i}=0` is used.
If the *group_ignore_lambda_input* argument is used,
:math:`\lambda_i^\text{input}` is not computed for all atoms :math:`i` assigned
to the corresponding :doc:`group <group>`; instead, if the value is not already
set by *group_fast* or *group_precise*, the value of *lambda_non_group* is
used.
.. note::
The computation of :math:`\lambda_i^\text{input}` is not required for
atoms that are in the groups *group_fast* and *group_precise*.
Thus, one should use *group_ignore_lambda_input* and prevent the
computation of :math:`\lambda_i^\text{input}` for all atoms, for
which a constant input is used.
A spatial transition zone between the fast and the precise potential is
introduced via
.. math::
\lambda_{\text{min},i}(t) = \text{min}\left(\left\{1 - (1 -\lambda_{0,j}(t)) f^\text{(cut)}\left(\frac{r_{ij}(t)-r_{\lambda,\text{lo}}}{r_{\lambda,\text{hi}} - r_{\lambda,\text{lo}}}\right) : j \in \Omega_{\lambda,i} \right\}\right)\,,
whereas the thresholds :math:`r_{\lambda,\text{lo}}` and
:math:`r_{\lambda,\text{hi}}`
of the cutoff function are set via *time_averaged_zone* and
:math:`\Omega_{\lambda,i}` is the set of
neighboring atoms of atom :math:`i`.
.. note::
:math:`\lambda_{\text{min},i}` is calculated by
:doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`, which needs to be included
in the input script as well.
The switching parameter is smoothed by the calculation of the time average
.. math::
\lambda_{\text{avg},i}(t) = \frac{1}{N_{\lambda,\text{avg}}} \sum_{n=1}^{N_{\lambda,\text{avg}}} \lambda_{\text{min},i}(t - n \Delta t)\,,
whereas :math:`\Delta t` is the :doc:`timestep <timestep>` and
:math:`N_{\lambda,\text{avg}}` is the number of averaged timesteps, that
can be set via *time_averaged_zone*.
Finally, numerical fluctuations of the switching parameter are suppressed by the usage of
.. math::
\lambda_{i}(t) = \left\{
\begin{array}{ll}
\lambda_{\text{avg},i}(t) & \text{ for } \left|\lambda_{\text{avg},i}(t) - \lambda_{i}(t-\Delta t)\right|\geq \Delta\lambda_\text{min} \text{ or } \lambda_{\text{avg},i}(t)\in\{0,1\}, \\
\lambda_{i}(t-\Delta t) & \text{ otherwise}\,,
\end{array}
\right.
whereas the minimum change :math:`\Delta\lambda_\text{min}` is set by the
*min_delta_lambda* argument.
.. note::
*group_fast* affects only :math:`\lambda_{0,i}(t)`. The switching parameter
of atoms in this :doc:`group <group>` may change due to the calculation of the
spatial switching zone.
A switching parameter of 1 can be enforced by excluding the corresponding
atoms from the :doc:`group <group>` described by group-ID and using *lambda_non_group* 1
as argument.
----------
A code example for the calculation of the switching parameter for an
adaptive-precision potential is given in the following:
The adaptive-precision potential is created
by combining :doc:`pair_style eam/fs/apip <pair_eam_apip>`
and :doc:`pair_style pace/precise/apip <pair_pace_apip>`.
The input, from which the switching parameter is calculated, is provided
by :doc:`pair lambda/input/csp/apip <pair_lambda_input_apip>`.
The switching parameter is calculated by this fix, whereas the spatial
transition zone of the switching parameter is calculated by
:doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`.
.. code-block:: LAMMPS
pair_style hybrid/overlay eam/fs/apip pace/precise/apip lambda/input/csp/apip fcc cutoff 5.0 lambda/zone/apip 12.0
pair_coeff * * eam/fs/apip Cu.eam.fs Cu
pair_coeff * * pace/precise/apip Cu_precise.yace Cu
pair_coeff * * lambda/input/csp/apip
pair_coeff * * lambda/zone/apip
fix 2 all lambda/apip 3.0 3.5 time_averaged_zone 4.0 12.0 110 110 min_delta_lambda 0.01
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The saved history of the switching parameter :math:`\lambda_i`
and the saved history of
:math:`\lambda_i^\text{input}` are written to
:doc:`binary restart files <restart>` allow a smooth restart of a simulation.
None of the :doc:`fix_modify <fix_modify>` options are relevant to this fix.
If the *store_atomic_stats* argument is used, basic statistics is provided as
per-atom array:
#. :math:`\lambda_i^\text{input}(t)`
#. :math:`\lambda_{\text{avg},i}^\text{input}(t)`
#. :math:`\lambda_{0,i}(t)`
#. :math:`\lambda_{\text{min},i}(t)`
#. :math:`\lambda_{i}(t)`
If the *dump_atomic_history* argument is used, the whole saved history
of :math:`\lambda_i^\text{input}(t)` is appended to the previously
mentioned array per atom.
The per-atom vector can be accessed 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 not invoked during
:doc:`energy minimization <minimize>`.
----------
Restrictions
""""""""""""
This fix is part of the APIP 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:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`,
:doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`,
:doc:`pair_style eam/apip <pair_eam_apip>`,
:doc:`pair_style pace/apip <pair_pace_apip>`,
:doc:`fix atom_weight/apip <fix_atom_weight_apip>`
:doc:`fix lambda_thermostat/apip <fix_lambda_thermostat_apip>`,
Default
"""""""
*min_delta_lambda* = 0,
*lambda_non_group* = 1,
*cut_lo* = 4.0,
*cut_hi* = 12.0,
*history_len_lambda_input* = 100,
*history_len_lambda* = 100,
*store_atomic_stats* is not used,
*dump_atomic_history* is not used,
*group_fast* is not used,
*group_precise* is not used,
*group_ignore_lambda_input* is not used
----------
.. _Immel2025_3:
**(Immel)** Immel, Drautz and Sutmann, J Chem Phys, 162, 114119 (2025)

View File

@ -0,0 +1,176 @@
.. index:: fix lambda_thermostat/apip
fix lambda_thermostat/apip command
==================================
Syntax
""""""
.. code-block:: LAMMPS
fix ID group-ID lambda_thermostat/apip keyword values ...
* ID, group-ID are documented in :doc:`fix <fix>` command
* lambda_thermostat/apip = style name of this fix command
* zero or more keyword/value pairs may be appended
* keyword = *seed* or *store_atomic_forces* or *N_rescaling*
.. parsed-literal::
*seed* value = integer
integer = integer that is used as seed for the random number generator (> 0)
*store_atomic_forces* value = nevery
nevery = provide per-atom output every this many steps
*N_rescaling* value = groupsize
groupsize = rescale this many neighboring atoms (> 1)
Examples
""""""""
.. code-block:: LAMMPS
fix 2 all lambda_thermostat/apip
fix 2 all lambda_thermostat/apip N_rescaling 100
fix 2 all lambda_thermostat/apip seed 42
fix 2 all lambda_thermostat/apip seed 42 store_atomic_forces 1000
Description
"""""""""""
This command applies the local thermostat described in
:ref:`(Immel) <Immel2025_4>`
to conserve the energy when the switching parameters of an
:doc:`adaptive-precision interatomic potential <Howto_apip>` (APIP)
are updated while the gradient
of the switching parameter is neglected in the force calculation.
.. warning::
The temperature change caused by this fix is only the means to the end of
conserving the energy. Thus, this fix is not a classical thermostat, that
ensures a given temperature in the system.
All available thermostats are listed :doc:`here <Howto_thermostat>`.
The potential energy :math:`E_i` of an atom :math:`i` is given by the formula from
:ref:`(Immel) <Immel2025_4>`
.. math::
E_i = \lambda_i E_i^\text{(fast)} + (1-\lambda_i) E_i^\text{(precise)},
whereas :math:`E_i^\text{(fast)}` is the potential energy of atom :math:`i`
according to a fast interatomic potential like EAM,
:math:`E_i^\text{(precise)}` is the potential energy according to a precise
interatomic potential such as ACE and :math:`\lambda_i\in[0,1]` is the
switching parameter that decides which potential energy is used.
This potential energy and the corresponding forces are conservative when
the switching parameter :math:`\lambda_i` is constant in time for all atoms
:math:`i`.
For a conservative force calculation and dynamic switching parameters,
the atomic force on an atom is given by
:math:`F_i = -\nabla_i \sum_j E_j` and includes the derivative of the switching
parameter :math:`\lambda_i`.
The force contribution of this gradient of the switching function can cause
large forces which are not similar to the forces of the fast or the precise
interatomic potential as discussed in :ref:`(Immel) <Immel2025_4>`.
Thus, one can neglect the gradient of the switching parameter in the force
calculation and compensate for the violation of energy conservation by
the application of the local thermostat implemented in this fix.
One can compute the violation of the energy conservation :math:`\Delta H_i`
for all atoms :math:`i` as discussed in :ref:`(Immel) <Immel2025_4>`.
To locally correct this energy violation :math:`\Delta H_i`, one
can rescale the velocity of atom :math:`i` and of neighboring atoms.
The rescaling is done relative to the center-of-mass velocity of the
group and, thus, conserves the momentum.
.. note::
This local thermostat provides the NVE ensemble rather than the NVT
ensemble as
the energy :math:`\Delta H_i` determines the rescaling factor rather than
a temperature.
Velocities :math:`v` are updated by the integrator according to
:math:`\Delta v_i = (F_i/m_i)\Delta t`, whereas `m` denotes the mass of atom
:math:`i` and :math:`\Delta t` is the time step.
One can interpret the velocity difference :math:`\Delta v` caused by the
rescaling as the application of an additional force which is given by
:math:`F^\text{lt}_i = (v^\text{unscaled}_i - v^\text{rescaled}_i) m_i
/ \Delta t` :ref:`(Immel) <Immel2025_4>`.
This additional force is computed when the *store_atomic_forces* option
is used.
The local thermostat is not appropriate for simulations at a temperature of 0K.
.. note::
The maximum decrease of the kinetic energy is achieved with a rescaling
factor of 0, i.e., the relative velocity of the group of rescaled atoms
is set to zero. One cannot decrease the energy further. Thus, the
local thermostat can fail, which is, however, reported by the returned
vector.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to
:doc:`binary restart files <restart>`. None of the
:doc:`fix_modify <fix_modify>` options are relevant to this fix.
If the *store_atomic_forces* option is used, this fix produces every
*nevery* time steps a per-atom array that contains the theoretical force
applied by the local thermostat in all three spatial dimensions in the first
three components. :math:`\Delta H_i` is the fourth component of the per-atom
array.
The per-atom array can only be accessed on timesteps that are multiples
of *nevery*.
Furthermore, this fix computes a global vector of length 6 with
information about the rescaling:
#. number of atoms whose energy changed due to the last :math:`\lambda` update
#. contribution of the potential energy to the last computed :math:`\Delta H`
#. contribution of the kinetic energy to the last computed :math:`\Delta H`
#. sum over all atoms of the absolute energy change caused by the last rescaling step
#. energy change that could not be compensated accumulated over all timesteps
#. number of atoms whose energy change could not be compensated accumulated over all timesteps
The vector and the per-atom vector can be accessed 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 not invoked during
:doc:`energy minimization <minimize>`.
----------
Restrictions
""""""""""""
This fix is part of the APIP 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:`fix lambda/apip <fix_lambda_apip>`,
:doc:`pair_style lambda/zone/apip <pair_lambda_zone_apip>`,
:doc:`pair_style lambda/input/apip <pair_lambda_input_apip>`,
:doc:`pair_style eam/apip <pair_eam_apip>`,
:doc:`pair_style pace/apip <pair_pace_apip>`,
:doc:`fix atom_weight/apip <fix_atom_weight_apip>`
Default
"""""""
seed = 42, N_rescaling = 200, *store_atomic_forces* is not used
----------
.. _Immel2025_4:
**(Immel)** Immel, Drautz and Sutmann, J Chem Phys, 162, 114119 (2025)

View File

@ -56,7 +56,7 @@ Examples
Description
"""""""""""
Apply a Langevin thermostat as described in :ref:`(Schneider) <Schneider1>`
Apply a Langevin thermostat as described in :ref:`(Bruenger) <Bruenger1>`
to a group of atoms which models an interaction with a background
implicit solvent. Used with :doc:`fix nve <fix_nve>`, this command
performs Brownian dynamics (BD), since the total force on each atom
@ -241,6 +241,13 @@ to zero by subtracting off an equal part of it from each atom in the
group. As a result, the center-of-mass of a system with zero initial
momentum will not drift over time.
.. deprecated:: TDB
The *gjf* keyword in fix langevin is deprecated and will be removed
soon. The GJF functionality has been moved to its own fix style
:doc:`fix gjf <fix_gjf>` and it is strongly recommended to use that
fix instead.
The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago
<Gronbech-Jensen>` time-discretization of the Langevin model. As
described in the papers cited below, the purpose of this method is to
@ -324,14 +331,16 @@ types, tally = no, zero = no, gjf = no.
----------
.. _Bruenger1:
**(Bruenger)** Bruenger, Brooks, and Karplus, Chem. Phys. Lett. 105, 495 (1982).
[Previously attributed to Schneider and Stoll, Phys. Rev. B 17, 1302 (1978).
Implementation remains unchanged.]
.. _Dunweg1:
**(Dunweg)** Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991).
.. _Schneider1:
**(Schneider)** Schneider and Stoll, Phys Rev B, 17, 1302 (1978).
.. _Gronbech-Jensen:
**(Gronbech-Jensen)** Gronbech-Jensen and Farago, Mol Phys, 111, 983

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