Compare commits
1207 Commits
patch_19No
...
patch_4Feb
| Author | SHA1 | Date | |
|---|---|---|---|
| c10219da9e | |||
| 2777984355 | |||
| 3fb8857be5 | |||
| 113b2e47f0 | |||
| a01ac8c907 | |||
| 995d6ab41f | |||
| 87dae19019 | |||
| 848a4300fe | |||
| 3b62892fc3 | |||
| 06506aa23b | |||
| 8a0027e788 | |||
| b17699a56a | |||
| a0253fba2d | |||
| e567e4cdd6 | |||
| 6dfc4f343c | |||
| 22eb984e68 | |||
| d1e65d0b9a | |||
| 54832b2091 | |||
| 38b1efa9d4 | |||
| 7f9423a1ee | |||
| e9f07af140 | |||
| d17186a8fa | |||
| e9e4addacb | |||
| f89ba1f354 | |||
| 3f5630c073 | |||
| 64ec02b87d | |||
| 920337963b | |||
| 8f23701352 | |||
| ebf81c0363 | |||
| 62d703a1f4 | |||
| 8b8e10d54f | |||
| 8e90e77a64 | |||
| 541f81ba93 | |||
| 3a58f9a5aa | |||
| 52fcfcaab1 | |||
| d96136f23d | |||
| 21f77a9275 | |||
| fdc3823969 | |||
| eb1174b54b | |||
| 29b5fce5e4 | |||
| 381f141384 | |||
| 6da7e4aa47 | |||
| be1be668a2 | |||
| 1dc5f8739a | |||
| 7d7cdf3e08 | |||
| a83b45c0fb | |||
| 9eb3e35255 | |||
| 6f6adc05ce | |||
| c5f287d747 | |||
| ac21f24013 | |||
| 2ea86efe67 | |||
| 1df1b3e2fc | |||
| 4cfa2e4ed9 | |||
| 2c7bd41b7b | |||
| 3f952f53ce | |||
| 0c28dfad44 | |||
| 42e379a8de | |||
| ea1607f1d8 | |||
| 6d997258e7 | |||
| 9bb56d10b3 | |||
| 2099dabb49 | |||
| 72542c1619 | |||
| 030ad0d5af | |||
| aa9b2b415f | |||
| b98797ec2c | |||
| c2dd04b991 | |||
| 1d286f194e | |||
| 48893236ec | |||
| 75b33ac436 | |||
| 60c4cc08e9 | |||
| 4e3a41dc25 | |||
| c9241aa2be | |||
| 363309a7d8 | |||
| 444c6d78f7 | |||
| 2b0a6419b7 | |||
| 31720b2741 | |||
| 48f749fbdd | |||
| 6685524fdb | |||
| da1bbec0be | |||
| 06bdb7b637 | |||
| 29891e06c0 | |||
| 81e10bdd53 | |||
| 4df3dead69 | |||
| 3b5dfb0a05 | |||
| 67e28c2bfd | |||
| c4106f9d09 | |||
| 74dca2daad | |||
| f5a8019654 | |||
| b4eee0c27a | |||
| d638f66b68 | |||
| ff340cf409 | |||
| 6c8d531f78 | |||
| 3f38635ecc | |||
| 229916e11f | |||
| 201d1a59b5 | |||
| 759a37cc75 | |||
| 8b85ee22a3 | |||
| f928df87a1 | |||
| 0a7e0dc388 | |||
| e728ca31d6 | |||
| ec2b98448d | |||
| 800a5f6310 | |||
| 48f92a6404 | |||
| 005433c7e3 | |||
| f8ac22ade7 | |||
| bb83497f61 | |||
| 1ebc109234 | |||
| 082fa6fae5 | |||
| ab2c8af38d | |||
| 0f6ee5c8a1 | |||
| 334dab68f7 | |||
| 2c3f0d65ac | |||
| 8f551df46a | |||
| 026da76a3b | |||
| 23045d62c5 | |||
| 5d47c417ed | |||
| 77e6a6dcef | |||
| d42f881c06 | |||
| 6398a7c7aa | |||
| 0fde98cfbc | |||
| a242511ce7 | |||
| 3a986fb50d | |||
| 6bb022853e | |||
| 8e2cb0f4c8 | |||
| 4c22410548 | |||
| 991b8c11ff | |||
| 464d9d82d6 | |||
| baf9a9b2d2 | |||
| 00054a8d97 | |||
| 28bc5fb2bd | |||
| f8750baf4e | |||
| 281336800a | |||
| 9fb8cc1d17 | |||
| 8482d150e1 | |||
| ccc790265d | |||
| ceac416f9a | |||
| 0a954b0129 | |||
| cbd99d29cf | |||
| 4bdc02ef3a | |||
| 3a44a03f04 | |||
| 563b5b0997 | |||
| e039927a31 | |||
| 8c6d0bef41 | |||
| 6fb318f61c | |||
| a0fcbc9b71 | |||
| 934bed29f5 | |||
| b9a8ddbb8c | |||
| b5da9ce3e2 | |||
| 0dfd5d821a | |||
| f8484de195 | |||
| a771277a6c | |||
| a30b5f9345 | |||
| dac011b865 | |||
| d7ffa16817 | |||
| 493ff3017c | |||
| 49dc526bc8 | |||
| 790b124f6a | |||
| 57cc7b6817 | |||
| 5803a62822 | |||
| d1dc0f7efc | |||
| 4be26c3480 | |||
| 3e4a50fe63 | |||
| b016b135fa | |||
| 048b96af65 | |||
| 55add23309 | |||
| 5959a01abd | |||
| 1aee093bfd | |||
| 1fef98dc50 | |||
| b5e48f6769 | |||
| 80d00e3b3c | |||
| e26599c532 | |||
| 8f57539bab | |||
| e4dbfee498 | |||
| 8baec60155 | |||
| 3412c4744d | |||
| b4f012057c | |||
| c1662f64ca | |||
| cc36947449 | |||
| 3012e02de1 | |||
| 5ddad0bbde | |||
| 94eee049b4 | |||
| e548c656ce | |||
| 6b4ecfd719 | |||
| 19d64fd0f9 | |||
| b00a2a2e1d | |||
| c0be84356e | |||
| b1b51307c0 | |||
| 21bbd69b3c | |||
| 651c1b2bc2 | |||
| 0767de7eeb | |||
| 4912f1347c | |||
| 4fdd85df4f | |||
| fbfdcbbac1 | |||
| 7c0254caee | |||
| c6adf793ab | |||
| 96d44c729b | |||
| 8c2d83c5eb | |||
| 3bb26ae87b | |||
| 536aa7cadf | |||
| f4b8200bcc | |||
| 45222b3f9a | |||
| 2d3cd6a646 | |||
| f10d1a30fc | |||
| 911fd0946c | |||
| 3c02731362 | |||
| a7af0fc078 | |||
| d614aeb91d | |||
| 75f4d3deb7 | |||
| 9cb67de38f | |||
| 29397b4a44 | |||
| 292ae27f98 | |||
| 2c82ce8142 | |||
| 93e266f648 | |||
| a5b66f02d1 | |||
| d99c960eb9 | |||
| 9cca8ab179 | |||
| 2817ad036f | |||
| c2bcf79196 | |||
| 0501f76fcf | |||
| 7b994801b5 | |||
| 23c63511f0 | |||
| 7ffe04ca92 | |||
| efd5165707 | |||
| e38c13a764 | |||
| e350f28e26 | |||
| fecf1c2f69 | |||
| f540e8b9ff | |||
| 72784262b1 | |||
| 9b443c9a4d | |||
| 769b0b9211 | |||
| e6a84d5f2a | |||
| 90416b63fc | |||
| 7900f24844 | |||
| ea9345444a | |||
| b9dbfc6eb2 | |||
| 5a45ef6994 | |||
| 0cb64afc84 | |||
| 7c4649adbf | |||
| a4cc00041c | |||
| 1e179b2432 | |||
| 3b815c1bbe | |||
| cf7695e99f | |||
| 1636a11054 | |||
| fa54fd1097 | |||
| de5a41de7b | |||
| 57d47ebb4f | |||
| b9a5557911 | |||
| 1bcbf6dc4b | |||
| 95152b1eb6 | |||
| af8b873bf5 | |||
| da5a12fcd1 | |||
| 6c16b1de74 | |||
| f273116681 | |||
| 82598ab3ca | |||
| 00f23d4829 | |||
| 36dcb294b3 | |||
| f60139d374 | |||
| 8c93986e47 | |||
| b21f804e4e | |||
| 6aa0c95c5e | |||
| 4cfe4831ed | |||
| 0f462a60ff | |||
| c5e3ffed75 | |||
| b8fcb927ee | |||
| 50f932ba9e | |||
| a5e3e755c2 | |||
| 7fa1bf39f3 | |||
| 48f49837d8 | |||
| c3ca6a8e56 | |||
| 4afdf493d7 | |||
| 66ffb1c39e | |||
| 29fca919b1 | |||
| f1fb0906be | |||
| 865ce67e83 | |||
| bf0f149445 | |||
| dfd8631394 | |||
| 11a790a04a | |||
| 41555a66e9 | |||
| 58eca0eef4 | |||
| 3a2349fa32 | |||
| 27540503ad | |||
| 8b5c9a18fd | |||
| 2cbdaf8a6a | |||
| 5f50278241 | |||
| 781b40643c | |||
| fbc66f75ac | |||
| 5e90674fbe | |||
| ffa4765b15 | |||
| 34075ebb3f | |||
| 494c2fc033 | |||
| e745b37a45 | |||
| 89370efe39 | |||
| 906399b14f | |||
| bbb7d86614 | |||
| 028367804e | |||
| 264c1c3140 | |||
| eb5977dc66 | |||
| 008bf14693 | |||
| 0ee4bf621f | |||
| 3101bb3263 | |||
| 4611b84b6f | |||
| 0fe7fbdb42 | |||
| b7c02d6a03 | |||
| b2e35f1808 | |||
| 853a8efa88 | |||
| 14389cfd2c | |||
| 9c7714e40f | |||
| a4f02fbad3 | |||
| b27aa31baa | |||
| 276b8d9c93 | |||
| 1f7533029b | |||
| af1f442b97 | |||
| edb068c43f | |||
| e682f3d3e5 | |||
| 783d21c19b | |||
| a50343077d | |||
| 31d1addfad | |||
| 7b9f7be485 | |||
| 7c8c8c9d01 | |||
| b56b8a016a | |||
| c2868c448e | |||
| 754517dcf6 | |||
| 6d7926a026 | |||
| 663f812799 | |||
| 55a3b28f7d | |||
| 8705a14b35 | |||
| ec669676d0 | |||
| 742c869534 | |||
| be048fc636 | |||
| ddff545a4c | |||
| 2a5e20c1c1 | |||
| dd8cc3ebdd | |||
| 1d1320f648 | |||
| 83a73ba0b9 | |||
| 62aa803d53 | |||
| a22c58cd47 | |||
| dc7f28c4c0 | |||
| 686326a999 | |||
| 528770f07d | |||
| d692a99e4d | |||
| dd6fea3fcd | |||
| e20f3ec874 | |||
| f50edb5a38 | |||
| 0aadc4cf46 | |||
| 78850efaed | |||
| 7c990f8b0e | |||
| 2df402c4ff | |||
| 906117ff47 | |||
| c476e6704b | |||
| 4519489f8b | |||
| fedb3fa6b8 | |||
| c8a46fe4ce | |||
| 943504fd98 | |||
| 60b10c1588 | |||
| f34ae8a011 | |||
| 296f1ab29f | |||
| 7b60abf569 | |||
| 9e4a51d568 | |||
| a5c3305c42 | |||
| 85dec585a6 | |||
| dce1231052 | |||
| be596cca0c | |||
| cf2e800aaa | |||
| 672faf9fe5 | |||
| fb1c090f19 | |||
| cb2acb633b | |||
| 61c541ff92 | |||
| 91dfa41494 | |||
| a443fe4142 | |||
| b508229bd2 | |||
| 8b2c852121 | |||
| 994a631150 | |||
| 283adb288b | |||
| a2f8e730a2 | |||
| 69e1bbae04 | |||
| be62d7e04b | |||
| 0d85c5c704 | |||
| 7520282568 | |||
| e3f930b33f | |||
| 3126482c48 | |||
| c4a5906382 | |||
| 4f6c3d12f7 | |||
| dbc6f77e53 | |||
| bc8c8f1c3f | |||
| 6732013935 | |||
| 5a0222153a | |||
| e858c8a78d | |||
| 4af328cba1 | |||
| 5490336543 | |||
| 6bdc58baaf | |||
| 3731513576 | |||
| c7ae973948 | |||
| 2b688bb013 | |||
| 38c3477d2f | |||
| 4330801a2f | |||
| 9f40bbc2b6 | |||
| a17213fc62 | |||
| a769b3d6b2 | |||
| cb930d6470 | |||
| 9c1da4cbc9 | |||
| 090e55b1d8 | |||
| 617f798199 | |||
| ce05f0cd9d | |||
| 9a513ca82c | |||
| 50bda6077c | |||
| 52d932df3b | |||
| 41e7cf7879 | |||
| 494f58904c | |||
| 1032c94c9f | |||
| 6a363d441b | |||
| 02a8a9d706 | |||
| 1ebf591592 | |||
| 0dacedd8b0 | |||
| 668435380b | |||
| 748046089c | |||
| f3425ebfbf | |||
| e7d9244184 | |||
| 8ec9f37611 | |||
| ec7be395ea | |||
| 24763bfd8e | |||
| ae6b2d85fb | |||
| cbab95e569 | |||
| 1432df370b | |||
| 613c38d9e6 | |||
| d66d1a2dd2 | |||
| 42adfc1ae3 | |||
| 0abb371fbe | |||
| de667de8eb | |||
| 2482cfafe9 | |||
| d9e40a79c1 | |||
| 2c64d3b711 | |||
| a795ae35fd | |||
| 61bc514b38 | |||
| 8595d8f05c | |||
| 9e373e7cc1 | |||
| 75543e27e4 | |||
| ccc57f85a3 | |||
| 6c7d3646c7 | |||
| 36b041a9ae | |||
| b10a5427a1 | |||
| c528573b62 | |||
| 14be59d3cc | |||
| 16f6fe315c | |||
| 09735b29e7 | |||
| 53084018ae | |||
| 2c655db731 | |||
| cec242a421 | |||
| e9057ae5c8 | |||
| df75830d63 | |||
| 467ceee9cb | |||
| 670447ea21 | |||
| 119aa59016 | |||
| 2b10fc153b | |||
| 534632a598 | |||
| 629cb9d0d3 | |||
| cd6ab17d36 | |||
| bc30665689 | |||
| 1fcf1a7c56 | |||
| f7cea5e428 | |||
| 735606a0b5 | |||
| d87abc0d01 | |||
| 31963900da | |||
| 399d7111d5 | |||
| 463452e6a0 | |||
| b246599654 | |||
| f809aee52f | |||
| 908c2aaf5e | |||
| 8b32516b79 | |||
| 78a897c1bf | |||
| 4d36a84738 | |||
| 9dbb9d356d | |||
| 0bdaece1f0 | |||
| f6c0c73289 | |||
| 7d67bcad22 | |||
| d70b923c5a | |||
| 73eeda3b1d | |||
| 255e50cfc3 | |||
| f50b5d63f3 | |||
| be9ace068a | |||
| e5ee94a13c | |||
| bbef7e3eac | |||
| 211099b7ca | |||
| 90d1e4d45f | |||
| 86e0b7e1d1 | |||
| c9b69b00c5 | |||
| 9241f89582 | |||
| f71fa8e94e | |||
| 916e5a81fb | |||
| 1d4e2d7867 | |||
| fb33541961 | |||
| de0baba124 | |||
| 53c3fa2afd | |||
| 332653d5ca | |||
| 5ece81323e | |||
| 833607f926 | |||
| c7d58a4eef | |||
| 48178ccc50 | |||
| b762610944 | |||
| 5947e3e82c | |||
| f3cbf55d3c | |||
| f9b00fb0b4 | |||
| c78c53b36f | |||
| 77ab630080 | |||
| f00addcfaf | |||
| 940473af98 | |||
| a9ce245527 | |||
| e31ca3c9c5 | |||
| a23dcb67d1 | |||
| c27ca94660 | |||
| fbba20fa89 | |||
| aecbc21123 | |||
| 39efb67a7a | |||
| ecb0f9525b | |||
| 6abbdfd740 | |||
| af4a731ef2 | |||
| 78aee50de8 | |||
| 8c6a1f01f5 | |||
| 1896244d96 | |||
| 822f774fd0 | |||
| 1717840c3f | |||
| 399f81cf46 | |||
| 210f7d7225 | |||
| 095d33dafb | |||
| 1f61c9ba82 | |||
| 824dcda382 | |||
| 5f3ea61080 | |||
| f06c4daee0 | |||
| aadc87279d | |||
| 74cf599778 | |||
| bf10fcd2f5 | |||
| bff2e64bbc | |||
| 82b0687a15 | |||
| 844d3a6cab | |||
| 3b21f69d70 | |||
| 8cf03b0b1c | |||
| d764c367c7 | |||
| ab6e3f6015 | |||
| b4a6be2623 | |||
| 089e45375f | |||
| 3311e71a82 | |||
| 7cd6c49a0d | |||
| 4b1a8d1a78 | |||
| 03fff14922 | |||
| 6505a9052b | |||
| 6fdc67e2a8 | |||
| e288163ea4 | |||
| a47503fd8b | |||
| cac3bdd175 | |||
| 7921aeda9e | |||
| 61734a414c | |||
| 1ba8ec4a0a | |||
| 3c026df75d | |||
| 2c9ad698ca | |||
| 3d29991947 | |||
| aeb2190582 | |||
| 67a8120c44 | |||
| 5e16a21d9e | |||
| 1e0a3f4601 | |||
| 9732efa32c | |||
| 6fe5f373d9 | |||
| a7ba185a4c | |||
| faab36cbd0 | |||
| fe77596099 | |||
| 4bdf6b0e2e | |||
| 8ee83bc926 | |||
| 8daad30ae1 | |||
| abd9f71990 | |||
| baa5fa6dfd | |||
| a7561d3d28 | |||
| 96e53c4714 | |||
| 5625f5f3e8 | |||
| c6e9e90e15 | |||
| 97f19d9d54 | |||
| 5ffbf3934b | |||
| 7922c923e2 | |||
| 5d865598ed | |||
| 64c06e9673 | |||
| a6d53d8d13 | |||
| 861b1fb16f | |||
| afe0d94122 | |||
| c9d0ebadd9 | |||
| 5fa4be4597 | |||
| 4c33bf663d | |||
| e48f288e2b | |||
| 70c5722e9f | |||
| 1cb12e3753 | |||
| 6124631a65 | |||
| 1188c38e73 | |||
| 0c91880192 | |||
| e3b991c27a | |||
| f557b7b0e5 | |||
| 4c347a719e | |||
| 9e3f7e55ee | |||
| 7f68aeb6d5 | |||
| 2c1447dec6 | |||
| 16e0a7788a | |||
| 754aa1c73f | |||
| e45ef5adc0 | |||
| 24a4ff78b6 | |||
| d50a62f827 | |||
| 5134529ee0 | |||
| 1b29f3dc6e | |||
| 3986ca4289 | |||
| 077a229cc8 | |||
| 8f25a31dee | |||
| 483111b637 | |||
| 3aeb64de89 | |||
| b4acfd1e3b | |||
| 0674f43364 | |||
| eba7dfad36 | |||
| 91c0d599f6 | |||
| 0fa1255cc3 | |||
| 9da58b3ffc | |||
| 49938456a3 | |||
| 335069f1ca | |||
| 02db7be6e2 | |||
| a78aee5731 | |||
| e902d19e06 | |||
| 6f4466f300 | |||
| f59f084c37 | |||
| 93e04e3177 | |||
| 1b7bc59e51 | |||
| 90f121e02c | |||
| 6de8c38a83 | |||
| fdfe6d54c6 | |||
| 2562d3afc4 | |||
| 4c496df934 | |||
| bcd123c882 | |||
| 00ebe9a3e8 | |||
| e21ed49695 | |||
| f93dd3273d | |||
| 80acfeebe7 | |||
| 3c6f4374ee | |||
| f0c176c603 | |||
| 5f3ee3100a | |||
| 828f5b9a77 | |||
| aaa8431919 | |||
| 2eb3084a8c | |||
| 30d39c8fb3 | |||
| 2279763c05 | |||
| ade5289030 | |||
| 2185ffa428 | |||
| b146a1d59b | |||
| dc3a100141 | |||
| c2b6ce5786 | |||
| 50df32f6fe | |||
| 296941ede7 | |||
| a7cfd4b934 | |||
| cd16308d71 | |||
| 6102350eed | |||
| 7c87874f5e | |||
| ef4b070e6f | |||
| e9073e4e1d | |||
| 09cd209c62 | |||
| 8aba26bd71 | |||
| 6b4f82dc31 | |||
| a420d04418 | |||
| 461dd67bb4 | |||
| 1beb4b17ec | |||
| aeb9003890 | |||
| 6f36dcecc6 | |||
| 88807c6ae6 | |||
| f7915109f9 | |||
| c87e0735a9 | |||
| 3f78ee72c6 | |||
| 471fdf27cd | |||
| e4683c3134 | |||
| 10c429fe21 | |||
| e7c995abcb | |||
| ce6e0dbe68 | |||
| 261abaa683 | |||
| 28e64fca94 | |||
| 67470f236e | |||
| 6c333837e0 | |||
| 43fbdc2d93 | |||
| f3221ee2e1 | |||
| dde2c91a27 | |||
| 78bd71760b | |||
| 2d65365a67 | |||
| e8e2a0b012 | |||
| 5dcadf5748 | |||
| 6e54d9326b | |||
| 98b67b8ea0 | |||
| 8a65f44237 | |||
| 99c4d116b8 | |||
| 457e4c094b | |||
| 30349d2a48 | |||
| 7259082cbc | |||
| 4296db4991 | |||
| 8ba0d7bece | |||
| 53b2930ef4 | |||
| 277fba1907 | |||
| 976167e2e5 | |||
| cb548143ee | |||
| cf6714ea33 | |||
| abbcd86174 | |||
| 3c4a42ba72 | |||
| 2fc33f3fd4 | |||
| 120c4600cf | |||
| e95d1dec3f | |||
| c9754e5fd3 | |||
| 58d70366c2 | |||
| ce92b565b2 | |||
| a4d821197e | |||
| 940308ba59 | |||
| 15999f6518 | |||
| ea873c5c06 | |||
| 2bcd6d1f73 | |||
| 92d4bec1a3 | |||
| 3acb0243a7 | |||
| cb5bad7ece | |||
| 33128323d8 | |||
| 9e0047ff06 | |||
| 8521ff0587 | |||
| 0e90de7d95 | |||
| 15767903b2 | |||
| 59af94b8e3 | |||
| c0edafc0cf | |||
| bd9bcb3bf7 | |||
| 009a976ae2 | |||
| a93a930f2f | |||
| c1ac0cea1d | |||
| f483a90d8a | |||
| 14041bb20c | |||
| a15a315341 | |||
| df882a9552 | |||
| 3fd4f9b7f3 | |||
| 9e25c8610c | |||
| e1f14e1ee8 | |||
| 47e9a7fe79 | |||
| cfb8b25c6e | |||
| d5c5e164e1 | |||
| 74e449605a | |||
| 0ae0afbae9 | |||
| a73baf81b1 | |||
| 166f0cb5ea | |||
| 0ed18c1203 | |||
| 8874fd4cbf | |||
| 0a3d213ed9 | |||
| e06be9b030 | |||
| 3338433615 | |||
| 131b40c806 | |||
| a3c23f2ce8 | |||
| e3768f9ab0 | |||
| d09ea909e5 | |||
| 38e4df45ef | |||
| 9cd7d32a1c | |||
| a43a3a50e0 | |||
| 7263bb49b6 | |||
| 3d4a73a739 | |||
| 906ae818da | |||
| 3bed50c1c3 | |||
| 3effab8024 | |||
| ae80dba958 | |||
| bf492c108b | |||
| 2d86e6b4f0 | |||
| e1f36275f1 | |||
| 995ccd494e | |||
| 0729c04dc1 | |||
| f93281d868 | |||
| 787c49d841 | |||
| a48b67baae | |||
| 4b56e81b66 | |||
| 61ffe1ece1 | |||
| 9cfbf3dcdd | |||
| e763f9e052 | |||
| 6aa592d286 | |||
| 9f2e542c80 | |||
| 7c13562c41 | |||
| 9f73494c91 | |||
| bb1624b20d | |||
| 898d97e603 | |||
| d2b5f55737 | |||
| d95d65bb69 | |||
| 742e6d4ff4 | |||
| 91f462e70b | |||
| 282183dc57 | |||
| c25f9032ad | |||
| 5d418e90a5 | |||
| 4af280c9f0 | |||
| 2251ac9127 | |||
| 339911eeed | |||
| efdaf57058 | |||
| f2b778aa5e | |||
| c75b9a929c | |||
| fa2db39c55 | |||
| 8ef96f6ff8 | |||
| 69b9deca39 | |||
| 53f39eeae4 | |||
| b217bf4b24 | |||
| 44c8f722a3 | |||
| 2ef030f33c | |||
| 1c9d62543b | |||
| dd99ea371d | |||
| a5b262aefa | |||
| 36e24d00d1 | |||
| 27d065a682 | |||
| f1dd7f1415 | |||
| 79e05595db | |||
| 63a3c3f30c | |||
| cb915cdce7 | |||
| b5dc7d58a8 | |||
| 3f9cc8f0fd | |||
| 2fc1844443 | |||
| be5eb198c3 | |||
| 969cc5dc03 | |||
| c871fe8505 | |||
| 9eb26e4cd0 | |||
| 5885f49b75 | |||
| fc5e583c56 | |||
| 5e01ffe6a6 | |||
| 904fde8189 | |||
| 788fd3a9ac | |||
| b1105a231b | |||
| b1ffcbcd41 | |||
| be5476e442 | |||
| 95e39ba89a | |||
| 1037e4a4eb | |||
| 709da60474 | |||
| e169327162 | |||
| 59e8b9370f | |||
| 39fa2021e2 | |||
| 83f492a195 | |||
| 933457acbe | |||
| 06f4099566 | |||
| 5624a78b17 | |||
| 66def742c4 | |||
| 47e875142f | |||
| 62c844d5ac | |||
| 263b6d4d6f | |||
| 4acca38a65 | |||
| 4cf642b526 | |||
| 470581d469 | |||
| 52fc8f05ee | |||
| 40db9b1701 | |||
| d75ceabfb0 | |||
| a720328770 | |||
| a3d8ab3088 | |||
| 02122c809c | |||
| bd1134c083 | |||
| 7539264846 | |||
| 212b864052 | |||
| 047df9aa9e | |||
| fb3bd20dff | |||
| c7d62c4709 | |||
| b18008c58d | |||
| 9469321e3d | |||
| a4a9efeefc | |||
| 70744f10e0 | |||
| 9bea55bd77 | |||
| 73525b3bbc | |||
| 9cf67699cc | |||
| 666fe4cfbe | |||
| ed7bd50500 | |||
| de4dbec661 | |||
| 584a6200f5 | |||
| a0a7f14db5 | |||
| 234346c37d | |||
| e1e7984822 | |||
| d241e26d03 | |||
| 73e7163ed6 | |||
| 5a5a86684a | |||
| ae3f57e89a | |||
| fff7b2a859 | |||
| 83ba1c9d20 | |||
| ce10614cab | |||
| facbeac052 | |||
| 188ee5af15 | |||
| f176b8b14c | |||
| 2396b2feea | |||
| 4399c1b6c1 | |||
| fd046c8fd8 | |||
| 09b7694601 | |||
| df20503434 | |||
| f4aa24a36a | |||
| 007c04bc97 | |||
| 418d1e16e1 | |||
| 6471d781d0 | |||
| 97ddc5917c | |||
| a95ff20647 | |||
| 9e0a9e2601 | |||
| 8b34d65970 | |||
| 0a1c2bcccc | |||
| c9442c591c | |||
| b7d316031d | |||
| 361e9f3ea5 | |||
| 28120793b8 | |||
| f32ce8377e | |||
| 9021b8bc6a | |||
| 838fe3020d | |||
| b4d4dcbcbc | |||
| 52a892ec46 | |||
| 0ee3d9da5d | |||
| 50afb292b0 | |||
| 275ef9da17 | |||
| b6a87390a3 | |||
| 72178631c5 | |||
| f8859c5fca | |||
| 979119a29b | |||
| bc66572275 | |||
| 609231675f | |||
| d9675b5da4 | |||
| 7d32b4f42a | |||
| 697e5b15ec | |||
| ade0718c11 | |||
| 31033ff6e0 | |||
| 9a598ba5a8 | |||
| ff20448b1d | |||
| af5229ba58 | |||
| b180200c48 | |||
| 27441cf2ea | |||
| db61bf609b | |||
| 015fa4cb0a | |||
| 62f6f91146 | |||
| e163b0b1d7 | |||
| 169a886898 | |||
| cbd276c49d | |||
| 183c6c06ff | |||
| 93a46da58e | |||
| 6b6a47bd3c | |||
| 4a0a98a0fd | |||
| 369ea4fd26 | |||
| d63c002bf5 | |||
| e931d3153b | |||
| 2913c063d4 | |||
| 5606b57646 | |||
| 0fafe34008 | |||
| a9a1640d67 | |||
| 812363fb99 | |||
| b40e0be1c9 | |||
| be94176c03 | |||
| 1be973da07 | |||
| aca2c52795 | |||
| 536b2ab7e5 | |||
| ccef293161 | |||
| 4b0de87813 | |||
| fa22aef31b | |||
| cb7544a615 | |||
| a9be4906b7 | |||
| 6f36d21a04 | |||
| c55a15c4dc | |||
| 8f01dad1a9 | |||
| db6e1aa20d | |||
| 3cee69a077 | |||
| 69ffe71595 | |||
| 16fa033111 | |||
| 8e494aa771 | |||
| d203cce8b5 | |||
| f8de1b1a75 | |||
| de89a25a25 | |||
| f982e95267 | |||
| 293d0cdb58 | |||
| 011f2651ee | |||
| a8d3c43a77 | |||
| c19641f8b3 | |||
| 6596b343ff | |||
| b6dbb0330c | |||
| 0dd138666a | |||
| 33b9fec150 | |||
| 32b020a165 | |||
| c1db230331 | |||
| 254c052ecc | |||
| 8e889dfa7c | |||
| 5b6a52a646 | |||
| 55f56deb63 | |||
| bfe127a720 | |||
| d95c8911a3 | |||
| 0380f9d854 | |||
| 71b1d60363 | |||
| 8b1f92fabd | |||
| 419af0cf28 | |||
| 9030c59932 | |||
| ee88078150 | |||
| 04451f6072 | |||
| 2364f7f08b | |||
| 7f82a58f51 | |||
| 1caf074ba1 | |||
| 34677f78c2 | |||
| e095609ac6 | |||
| 1122408957 | |||
| 5f9b78ca01 | |||
| fe138fc75c | |||
| 31c324ff61 | |||
| 30564ed8b7 | |||
| f05bfe45a8 | |||
| 88c8b6ec6f | |||
| f01e28f574 | |||
| 96627d27b1 | |||
| b3fc574a6a | |||
| 8a3f7560c9 | |||
| 8406e92a9a | |||
| 3b376b4448 | |||
| ca3b7be623 | |||
| c825c52d2f | |||
| 0ea0e4ce59 | |||
| d53d4b4d99 | |||
| b37cd14dd1 | |||
| a921a6bdc1 | |||
| 51a0345941 | |||
| 8d70960e2d | |||
| 5661703b30 | |||
| bc30304f72 | |||
| c76da483fb | |||
| 036a1e47d2 | |||
| 5430c3b592 | |||
| 9b7cb8200c | |||
| 550eedbb1f | |||
| 3a058f278d | |||
| 0f7f0b5f86 | |||
| 3de7534b84 | |||
| 7065462faf | |||
| 2e9d8e1ccb | |||
| 19b84f7cbd | |||
| 9b7c445a15 | |||
| 91e56444ce | |||
| 9b3c8c36bd | |||
| 3403520967 | |||
| d8f969f1df | |||
| 3487deccb6 | |||
| 0926fc627d | |||
| 7999778d94 | |||
| b4ef4c1ff2 | |||
| 72b08e4b87 | |||
| faa64a84e8 | |||
| 32b67fff2b | |||
| f3dbf4122d | |||
| e25ac786da | |||
| f30fba0061 | |||
| 03f319604f | |||
| 0782dab1ec | |||
| c43cce54ab | |||
| 281a368702 | |||
| f28d69b429 | |||
| e674e0c927 | |||
| eebabf99b8 | |||
| 23a19f4431 | |||
| d618b0ffc0 | |||
| ffc71b8733 | |||
| 564df78698 | |||
| 8db0b5ca39 | |||
| 79e26fe829 | |||
| 523d4b0242 | |||
| fe39a3e581 | |||
| 081cc1f992 | |||
| 53c80c2c00 | |||
| 554b64a147 | |||
| dc08dba592 | |||
| 0eaa2775cd | |||
| 852673ce41 | |||
| 8c711e405a | |||
| 25b9f95061 | |||
| ee66a6f8c1 | |||
| b694a5f582 | |||
| 7ab3fce93f | |||
| 1f9509cb6f | |||
| cad1d8ece4 | |||
| b709d75f80 | |||
| 5839909061 | |||
| 30f374de58 | |||
| 0f9fec05fb | |||
| 972a86f0ec | |||
| 7338ebfc94 | |||
| 7132152693 | |||
| c9925f64f7 | |||
| 6da523c8b8 | |||
| 0522284589 | |||
| e10a66dabc | |||
| 51dd631a76 | |||
| d37249787e | |||
| f44841de69 | |||
| 54c5337d2d | |||
| efb0e63bf6 | |||
| 13d78c3afa | |||
| f2910b1d9c | |||
| 78b22a64aa | |||
| 8bb1880c9d | |||
| e7b36c7b90 | |||
| d7804e3770 | |||
| 8d0f9695d2 | |||
| 52b2e4f364 | |||
| 41140149ea | |||
| 85e556ac8f | |||
| cd5437a7e2 | |||
| 00cc82ac94 | |||
| 20f87e3f1d | |||
| 97e34f0667 | |||
| 3e5da9b09a | |||
| a62fcca7a4 | |||
| 778d59fa6b | |||
| 3833a85d7a | |||
| 6d961ab29f | |||
| 001824e0f6 | |||
| 953d32f9b3 | |||
| edba922665 | |||
| 53806d4601 | |||
| 67597722d5 | |||
| 337794a9e9 | |||
| 5f5fb895ff | |||
| 0302d03bc6 | |||
| 0a4fef369f | |||
| 7d5fc356fe | |||
| 8103e5a18f | |||
| e5b56b67fe | |||
| 8ffb7e5f89 | |||
| cb9ab48ce7 | |||
| 1ebb1cee40 | |||
| f0e7101bd2 | |||
| 6fd8b2b177 | |||
| 6edaf42b3d | |||
| 79c047487d | |||
| ac5acb9abf | |||
| 87fbbd3b13 | |||
| 8ac0ec6473 | |||
| 8acba74c4d | |||
| 34bcbdf41d | |||
| d519ca0213 | |||
| a392e8dc09 | |||
| a4d4f77bc2 | |||
| 83a8f72d83 | |||
| 3c54b56cfe | |||
| ff1a08f148 | |||
| 5a53b0fc03 | |||
| e550600ebe | |||
| 7cb13be52a | |||
| ab56d7ecd7 | |||
| bd6ac3ee6d | |||
| 27ca0a8f41 | |||
| f688b9b6b5 | |||
| 16c61b3cc0 | |||
| fb480f22fc | |||
| d0507559a4 | |||
| 58eb331b08 | |||
| c68015ca87 | |||
| 583c22d6e0 | |||
| 58a4694d92 | |||
| 97cf345528 | |||
| 0658abbdd4 | |||
| 72026a58bf | |||
| 7152231a10 | |||
| 8fe8a667b6 | |||
| 560c543e69 | |||
| c5e6650924 | |||
| 10373ea5c9 | |||
| 992b1cf582 | |||
| 1505f3de06 | |||
| 566efe04f2 | |||
| 7586adbb6a | |||
| 69d6ddccc5 | |||
| 5ae496dcef | |||
| bc5d742623 | |||
| 882e699163 | |||
| 9c725d79d6 | |||
| 79fbf437a3 | |||
| d130aa4289 | |||
| 5d8b83a251 | |||
| 5a2548a83d | |||
| a85b310e1f | |||
| e51fd40547 | |||
| 62f271658b | |||
| 0aa742934f | |||
| a26a709a7b | |||
| 027293d285 | |||
| f7d049ac2d | |||
| ea0ff1c8f7 | |||
| 5c1bb5f13a | |||
| 24d9b4b611 | |||
| a0e75c9006 | |||
| 2435b953e1 | |||
| c042e12323 | |||
| e9efe46db9 | |||
| ecc14b7308 | |||
| 0152fe5cdf | |||
| 892d17af22 | |||
| 2cca00203e | |||
| 9f4626a62a | |||
| e890a0b45e | |||
| 68223f0385 | |||
| 1291a88bff | |||
| d9b687450a | |||
| bd950b37d7 | |||
| 21fcdf8c56 | |||
| 6b400fb4bf | |||
| d982298ab2 | |||
| 765fd7f763 | |||
| 0325047c01 | |||
| 2dce8923ee | |||
| 8d1ba074be | |||
| 4675a3b560 | |||
| 8999b1f69f | |||
| 6c2b19c11b | |||
| a425334928 | |||
| db2faf2789 | |||
| fdbb7d0da4 | |||
| 52cd99918f | |||
| a3e6a95ffb | |||
| 5b65169997 | |||
| 5f3bf69e30 | |||
| 507c02b9af | |||
| b7fe47ba48 | |||
| 7dfd11da4b | |||
| 97ba95f30e | |||
| c1945b4ec9 | |||
| c4291a4b8e | |||
| 5b5dfa86c5 | |||
| 3ca3f6959f | |||
| f7b7bfa406 | |||
| 3d2f29c92d |
195
.github/release_steps.md
vendored
195
.github/release_steps.md
vendored
@ -1,55 +1,196 @@
|
||||
# LAMMPS Release Steps
|
||||
|
||||
The following notes chronicle the current steps for preparing and publishing LAMMPS releases.
|
||||
For definition of what LAMMPS versions and the different kinds of releases mean, please
|
||||
refer to [the corresponding section in the LAMMPS manual](https://docs.lammps.org/Manual_version.html).
|
||||
The following notes chronicle the current steps for preparing and
|
||||
publishing LAMMPS releases. For definitions of LAMMPS versions and
|
||||
releases, please refer to [the corresponding section in the LAMMPS
|
||||
manual](https://docs.lammps.org/Manual_version.html).
|
||||
|
||||
## LAMMPS Feature Release
|
||||
|
||||
A LAMMPS feature release is currently prepared after about 500 to 750 commits to the
|
||||
'develop' branch or after a period of four weeks up to two months.
|
||||
A LAMMPS feature release is currently prepared after about 500 to 750
|
||||
commits to the 'develop' branch or after a period of four weeks up to
|
||||
two months. This is not a fixed rule, though, since external
|
||||
circumstances can cause delays in preparing a release, or pull requests
|
||||
that are desired to be merged for the release are not yet completed.
|
||||
|
||||
### Preparing a 'next\_release' branch
|
||||
|
||||
Create a 'next\_release' branch off 'develop' and make the following changes:
|
||||
- set the LAMMPS\_VERSION define to the planned release date in src/version.h in the format "D Mmm YYYY" or "DD Mmm YYYY"
|
||||
|
||||
- set the LAMMPS\_VERSION define to the planned release date in
|
||||
src/version.h in the format "D Mmm YYYY" or "DD Mmm YYYY"
|
||||
- remove the LAMMPS\_UPDATE define in src/version.h
|
||||
- update the release date in doc/lammps.1
|
||||
- update all TBD arguments for ..versionadded::, ..versionchanged:: ..deprecated:: to the
|
||||
planned release date in the format "DMmmYYYY" or "DDMmmYYYY"
|
||||
- update all TBD arguments for ..versionadded::, ..versionchanged::
|
||||
..deprecated:: to the planned release date in the format "DMmmYYYY" or
|
||||
"DDMmmYYYY"
|
||||
- check release notes for merged new features and check if
|
||||
..versionadded:: or ..versionchanged:: are missing and need to be
|
||||
added
|
||||
|
||||
Submit this pull request, rebase if needed. This is the last pull request merged for the release
|
||||
and should not contain any other changes. (Exceptions: this document, last minute trivial(!) changes).
|
||||
This PR shall not be merged before **all** pending tests have completed and cleared. If needed, a
|
||||
bugfix pull request should be created and merged to clear all tests.
|
||||
Submit this pull request, rebase if needed. This is the last pull
|
||||
request merged for the release and should not contain any other
|
||||
changes. (Exceptions: this document, last minute trivial(!) changes).
|
||||
|
||||
This PR shall not be merged before **all** pending tests have completed
|
||||
and cleared. We currently use a mix of automated tests running on
|
||||
either Temple's Jenkins cluster or GitHub workflows. Those include time
|
||||
consuming tests not run on pull requests. If needed, a bugfix pull
|
||||
request should be created and merged to clear all tests.
|
||||
|
||||
### Create release on GitHub
|
||||
|
||||
When all pending pull requests for the release are merged and have
|
||||
cleared testing, the 'next\_release' branch is merged into 'develop'.
|
||||
|
||||
Check out or update the 'develop' branch locally, pull the latest
|
||||
changes, merge them into 'release' with a fast forward(!) merge, and
|
||||
apply a suitable release tag (for historical reasons the tag starts with
|
||||
"patch_" followed by the date, and finally push everything back to
|
||||
GitHub. There should be no commits made to 'release' but only
|
||||
fast forward merges. Example:
|
||||
|
||||
```
|
||||
git checkout develop
|
||||
git pull
|
||||
git checkout release
|
||||
git pull
|
||||
git merge --ff-only develop
|
||||
git tag -s -m "LAMMPS feature release 19 November 2024" patch_19Nov2024
|
||||
git push git@github.com:lammps/lammps.git --tags develop release
|
||||
```
|
||||
|
||||
Applying this tag will trigger two actions on the Temple Jenkins cluster:
|
||||
- The online manual at https://docs.lammps.org/ will be updated to the
|
||||
state of the 'release' branch. Merges to the 'develop' branch will
|
||||
trigger updating https://docs.lammps.org/latest/ so by reviewing the
|
||||
version of the manual under the "latest" URL, it is possible to preview
|
||||
what the updated release documentation will look like.
|
||||
- A downloadable tar archive of the LAMMPS distribution that includes the
|
||||
html format documentation and a PDF of the manual will be created and
|
||||
uploaded to the download server at https://download.lammps.org/tars
|
||||
Note that the file is added, but the `index.html` file is not updated,
|
||||
so it is not yet publicly visible.
|
||||
|
||||
Go to https://github.com/lammps/lammps/releases and create a new (draft)
|
||||
release page with a summary of all the changes included and references
|
||||
to the pull requests they were merged from or check the existing draft
|
||||
for any necessary changes from pull requests that were merged but are
|
||||
not listed. Then select the applied tag for the release in the "Choose
|
||||
a tag" dropdown list. Go to the bottom of the list and select the "Set
|
||||
as pre-release" checkbox. The "Set as the latest release" button is
|
||||
reserved for stable releases and updates to them.
|
||||
|
||||
If everything is in order, you can click on the "Publish release"
|
||||
button. Otherwise, click on "Save draft" and finish pending tasks until
|
||||
you can return to edit the release page and publish it.
|
||||
|
||||
### Prepare pre-compiled packages, update packages to GitHub
|
||||
|
||||
Build a fully static LAMMPS installation using a musl-libc
|
||||
cross-compiler, install into a lammps-static folder, and create a
|
||||
tarball called lammps-linux-x86_64-19Nov2024.tar.gz (or using a
|
||||
corresponding date with a future release) from the lammps-static folder.
|
||||
A suitable build environment is provided with the
|
||||
https://download.lammps.org/static/fedora37_musl.sif container image.
|
||||
|
||||
``` sh
|
||||
rm -rf release-packages
|
||||
mkdir release-packages
|
||||
cd release-packages
|
||||
wget https://download.lammps.org/static/fedora41_musl.sif
|
||||
apptainer shell fedora41_musl.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/*
|
||||
tar -czvvf lammps-linux-x86_64-19Nov2024.tar.gz lammps-static
|
||||
exit # fedora 41 container
|
||||
```
|
||||
|
||||
The resulting tar archive can be uploaded to the GitHub release page with:
|
||||
|
||||
```
|
||||
gh release upload patch_19Nov2024 lammps-linux-x86_64-19Nov2024.tar.gz
|
||||
```
|
||||
|
||||
Make sure you have the `flatpak` and `flatpak-builder` packages
|
||||
installed locally (they cannot be used from the container) and build a
|
||||
LAMMPS and LAMMPS-GUI flatpak bundle in the `release-packages` folder
|
||||
with:
|
||||
|
||||
``` sh
|
||||
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak-builder --force-clean --verbose --repo=$PWD/flatpak-repo --install-deps-from=flathub --state-dir=$PWD --user --ccache --default-branch=release flatpak-build lammps-release/tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo --verbose $PWD/flatpak-repo LAMMPS-Linux-x86_64-GUI-19Nov2024.flatpak org.lammps.lammps-gui release
|
||||
```
|
||||
|
||||
The resulting flatpak bundle file can be uploaded to the GitHub release page with:
|
||||
|
||||
```
|
||||
gh release upload patch_19Nov2024 LAMMPS-Linux-x86_64-GUI-19Nov2024.flatpak
|
||||
```
|
||||
|
||||
Also build serial executable packages that also include LAMMPS-GUI for
|
||||
Linux, macOS, and Windows, and upload them to the GitHub release.
|
||||
|
||||
Clean up:
|
||||
|
||||
``` sh
|
||||
cd ..
|
||||
rm -r release-packages
|
||||
```
|
||||
|
||||
TODO:
|
||||
- add detailed commands for building GUI packages on Ubuntu 20.04LTS (move to 22.04LTS?),
|
||||
macOS, and Windows cross-compiler and upload to GitHub
|
||||
- build all Windows cross-compiled installer packages using lammps-packages repo
|
||||
|
||||
### Update download website
|
||||
|
||||
Check out the LAMMPS website repo
|
||||
https://github.com/lammps/lammps-website.git and edit the file
|
||||
`src/download.txt` for the new release. Test translation with `make
|
||||
html` and review `html/download.html` Then add and commit to git and
|
||||
push the changes to GitHub. The Temple Jenkis cluster will
|
||||
automatically update https://www.lammps.org/download.html accordingly.
|
||||
|
||||
Notify Steve of the release so he can update `src/bug.txt` on the
|
||||
website from the available release notes.
|
||||
|
||||
## LAMMPS Stable Release
|
||||
|
||||
A LAMMPS stable release is prepared about once per year in the months July, August, or September.
|
||||
One (or two, if needed) feature releases before the stable release shall contain only bug fixes
|
||||
or minor feature updates in optional packages. Also substantial changes to the core of the code
|
||||
shall be applied rather toward the beginning of a development cycle between two stable releases
|
||||
than toward the end. The intention is to stablilize significant change to the core and have
|
||||
outside users and developers try them out during the development cycle; the sooner the changes
|
||||
are included, the better chances for spotting peripheral bugs and issues.
|
||||
A LAMMPS stable release is prepared about once per year in the months
|
||||
July, August, or September. One (or two, if needed) feature releases
|
||||
before the stable release shall contain only bug fixes or minor feature
|
||||
updates in optional packages. Also substantial changes to the core of
|
||||
the code shall be applied rather toward the beginning of a development
|
||||
cycle between two stable releases than toward the end. The intention is
|
||||
to stablilize significant change to the core and have outside users and
|
||||
developers try them out during the development cycle; the sooner the
|
||||
changes are included, the better chances for spotting peripheral bugs
|
||||
and issues.
|
||||
|
||||
### Prerequesites
|
||||
|
||||
Before making a stable release all remaining backported bugfixes shall be released as a (final)
|
||||
stable update release (see below).
|
||||
Before making a stable release all remaining backported bugfixes shall
|
||||
be released as a (final) stable update release (see below).
|
||||
|
||||
A LAMMPS stable release process starts like a feature release (see above), only that this feature
|
||||
release is called a "Stable Release Candidate" and no assets are uploaded to GitHub.
|
||||
A LAMMPS stable release process starts like a feature release (see
|
||||
above), only that this feature release is called a "Stable Release
|
||||
Candidate" and no assets are uploaded to GitHub.
|
||||
|
||||
### Synchronize 'maintenance' branch with 'release'
|
||||
|
||||
The state of the 'release' branch is then transferred to the 'maintenance' branch (which will
|
||||
have diverged significantly from 'release' due to the selectively backported bug fixes).
|
||||
The state of the 'release' branch is then transferred to the
|
||||
'maintenance' branch (which will have diverged significantly from
|
||||
'release' due to the selectively backported bug fixes).
|
||||
|
||||
### Fast-forward merge of 'maintenance' into 'stable' and apply tag
|
||||
|
||||
At this point it should be possible to do a fast-forward merge of 'maintenance' to 'stable'
|
||||
and then apply the stable\_DMmmYYYY tag.
|
||||
At this point it should be possible to do a fast-forward merge of
|
||||
'maintenance' to 'stable' and then apply the stable\_DMmmYYYY tag.
|
||||
|
||||
### Push branches and tags
|
||||
|
||||
|
||||
1
.github/workflows/coverity.yml
vendored
1
.github/workflows/coverity.yml
vendored
@ -67,7 +67,6 @@ jobs:
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_MDI=on \
|
||||
-D PKG_MGPT=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_MOLFILE=on \
|
||||
-D PKG_NETCDF=on \
|
||||
|
||||
53
.github/workflows/lammps-gui-flatpak.yml
vendored
Normal file
53
.github/workflows/lammps-gui-flatpak.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
# GitHub action to build LAMMPS-GUI as a flatpak bundle
|
||||
name: "Build LAMMPS-GUI as flatpak bundle"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: LAMMPS-GUI flatpak build
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
ninja-build \
|
||||
python3-dev \
|
||||
flatpak \
|
||||
flatpak-builder
|
||||
|
||||
- name: Set up access to flatpak repo
|
||||
run: flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
- name: Build flatpak
|
||||
run: |
|
||||
mkdir flatpack-state
|
||||
sed -i -e 's/branch:.*/branch: develop/' tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak-builder --force-clean --verbose --repo=flatpak-repo \
|
||||
--install-deps-from=flathub --state-dir=flatpak-state \
|
||||
--user --ccache --default-branch=${{ github.ref_name }} \
|
||||
flatpak-build tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
|
||||
--verbose flatpak-repo LAMMPS-Linux-x86_64-GUI.flatpak \
|
||||
org.lammps.lammps-gui ${{ github.ref_name }}
|
||||
flatpak install -y -v --user LAMMPS-Linux-x86_64-GUI.flatpak
|
||||
1
.github/workflows/style-check.yml
vendored
1
.github/workflows/style-check.yml
vendored
@ -35,3 +35,4 @@ jobs:
|
||||
make check-permissions
|
||||
make check-homepage
|
||||
make check-errordocs
|
||||
make check-fmtlib
|
||||
|
||||
81
.github/workflows/unittest-arm64.yml
vendored
Normal file
81
.github/workflows/unittest-arm64.yml
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
# GitHub action to build LAMMPS on Linux with ARM64 and run standard unit tests
|
||||
name: "Unittest for Linux on ARM64"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux ARM64 Unit Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-22.04-arm
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
ninja-build \
|
||||
python3-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-unit-ccache-${{ github.sha }}
|
||||
restore-keys: linux-unit-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D ENABLE_TESTING=on \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V -LE unstable
|
||||
@ -3,6 +3,9 @@
|
||||
# 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()
|
||||
########################################
|
||||
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
||||
if(POLICY CMP0074)
|
||||
@ -144,16 +147,28 @@ if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL
|
||||
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT}" "-Xcudafe --diag_suppress=unrecognized_pragma,--diag_suppress=128")
|
||||
endif()
|
||||
|
||||
# we require C++11 without extensions. Kokkos requires at least C++17 (currently)
|
||||
# we *require* C++11 without extensions but prefer C++17.
|
||||
# Kokkos requires at least C++17 (currently)
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
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()
|
||||
# turn off C++17 check in lmptype.h
|
||||
if(LAMMPS_CXX11)
|
||||
add_compile_definitions(LAMMPS_CXX11)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
@ -347,6 +362,17 @@ 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
|
||||
######################################################
|
||||
@ -579,6 +605,16 @@ foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# settings for misc packages and styles
|
||||
if(PKG_MISC)
|
||||
option(LAMMPS_ASYNC_IMD "Asynchronous IMD processing" OFF)
|
||||
mark_as_advanced(LAMMPS_ASYNC_IMD)
|
||||
if(LAMMPS_ASYNC_IMD)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_ASYNC_IMD)
|
||||
message(STATUS "Using IMD in asynchronous mode")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# optionally enable building script wrappers using swig
|
||||
option(WITH_SWIG "Build scripting language wrappers with SWIG" OFF)
|
||||
if(WITH_SWIG)
|
||||
@ -1078,12 +1114,15 @@ if(BUILD_TOOLS)
|
||||
message(STATUS "<<< Building Tools >>>")
|
||||
endif()
|
||||
if(BUILD_LAMMPS_GUI)
|
||||
message(STATUS "<<< Building LAMMPS GUI >>>")
|
||||
message(STATUS "<<< Building LAMMPS-GUI >>>")
|
||||
if(LAMMPS_GUI_USE_PLUGIN)
|
||||
message(STATUS "Loading LAMMPS library as plugin at run time")
|
||||
else()
|
||||
message(STATUS "Linking LAMMPS library at compile time")
|
||||
endif()
|
||||
if(BUILD_WHAM)
|
||||
message(STATUS "<<< Building WHAM >>>")
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_TESTING)
|
||||
message(STATUS "<<< Building Unit Tests >>>")
|
||||
|
||||
@ -72,6 +72,10 @@ if(INTEL_ARCH STREQUAL "KNL")
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
message(FATAL_ERROR "Must use Intel compiler with INTEL for KNL architecture")
|
||||
endif()
|
||||
message(WARNING, "Support for Intel Xeon Phi accelerators and Knight's Landing CPUs "
|
||||
"will be removed from LAMMPS in Summer 2025 due to lack of available machines "
|
||||
"in labs and HPC centers and removed support in recent compilers "
|
||||
"Please contact developers@lammps.org if you have any concerns about this step.")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload")
|
||||
set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"")
|
||||
target_compile_options(lammps PRIVATE -xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS})
|
||||
|
||||
@ -7,26 +7,13 @@ endif()
|
||||
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
if(Kokkos_ENABLE_CUDA)
|
||||
option(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC "CUDA asynchronous malloc support" OFF)
|
||||
mark_as_advanced(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC)
|
||||
if(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC)
|
||||
message(STATUS "KOKKOS: CUDA malloc async support enabled")
|
||||
else()
|
||||
message(STATUS "KOKKOS: CUDA malloc async support disabled")
|
||||
endif()
|
||||
endif()
|
||||
if(Kokkos_ENABLE_HIP)
|
||||
option(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS "Enable multiple kernel instantiations with HIP" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS)
|
||||
option(Kokkos_ENABLE_ROCTHRUST "Use RoCThrust library" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_ROCTHRUST)
|
||||
|
||||
if(Kokkos_ARCH_AMD_GFX942 OR Kokkos_ARCH_AMD_GFX940)
|
||||
option(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY "Enable unified memory with HIP" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Adding OpenMP compiler flags without the checks done for
|
||||
# BUILD_OMP can result in compile failures. Enforce consistency.
|
||||
if(Kokkos_ENABLE_OPENMP)
|
||||
@ -70,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.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "de6ee80d00b6212b02bfb7f1e71a8392" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.5.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "4d832aa0284169d9e3fbae3165286bc6" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
mark_as_advanced(KOKKOS_URL)
|
||||
mark_as_advanced(KOKKOS_MD5)
|
||||
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
|
||||
@ -96,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.4.01 REQUIRED CONFIG)
|
||||
find_package(Kokkos 4.5.01 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
@ -130,7 +117,6 @@ set(KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/atom_vec_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/comm_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/comm_tiled_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/group_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/min_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/min_linesearch_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/neighbor_kokkos.cpp
|
||||
|
||||
@ -1,50 +1,62 @@
|
||||
# PACE library support for ML-PACE package
|
||||
find_package(pace QUIET)
|
||||
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||
|
||||
# LOCAL_ML-PACE points to top-level dir with local lammps-user-pace repo,
|
||||
# to make it easier to check local build without going through the public github releases
|
||||
if(LOCAL_ML-PACE)
|
||||
set(lib-pace "${LOCAL_ML-PACE}")
|
||||
if(pace_FOUND)
|
||||
find_package(pace)
|
||||
target_link_libraries(lammps PRIVATE pace::pace)
|
||||
else()
|
||||
# download library sources to build folder
|
||||
if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz)
|
||||
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||
endif()
|
||||
if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")
|
||||
message(STATUS "Downloading ${PACELIB_URL}")
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS)
|
||||
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}"))
|
||||
message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}")
|
||||
file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS)
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||
endif()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix2.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "a53bd87cfee8b07d9f44bc17aad69c3f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||
|
||||
# LOCAL_ML-PACE points to top-level dir with local lammps-user-pace repo,
|
||||
# to make it easier to check local build without going through the public github releases
|
||||
if(LOCAL_ML-PACE)
|
||||
set(lib-pace "${LOCAL_ML-PACE}")
|
||||
else()
|
||||
# download library sources to build folder
|
||||
if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz)
|
||||
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||
endif()
|
||||
if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")
|
||||
message(STATUS "Downloading ${PACELIB_URL}")
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS)
|
||||
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}"))
|
||||
message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}")
|
||||
file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||
endif()
|
||||
|
||||
|
||||
# uncompress downloaded sources
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace*
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${lib-pace} build-pace)
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
# uncompress downloaded sources
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace*
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||
endif()
|
||||
|
||||
# some preinstalled yaml-cpp versions don't provide a namespaced target
|
||||
find_package(yaml-cpp QUIET)
|
||||
if(TARGET yaml-cpp AND NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${lib-pace} build-pace)
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -32,9 +32,9 @@ endif()
|
||||
|
||||
# Note: must also adjust check for supported API versions in
|
||||
# fix_plumed.cpp when version changes from v2.n.x to v2.n+1.y
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.2/plumed-src-2.9.2.tgz"
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.3/plumed-src-2.9.3.tgz"
|
||||
CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "04862602a372c1013bdfee2d6d03bace" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_MD5 "ee1249805fe94bccee17d10610d3f6f1" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
# FindVTK requires that C support is enabled when looking for MPI support
|
||||
enable_language(C)
|
||||
find_package(VTK REQUIRED NO_MODULE)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
||||
if (VTK_MAJOR_VERSION VERSION_LESS 9.0)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "LAMMPS Programmer's Guide"
|
||||
PROJECT_NUMBER = "4 May 2022"
|
||||
PROJECT_NUMBER = "19 November 2024"
|
||||
PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper"
|
||||
PROJECT_LOGO = lammps-logo.png
|
||||
CREATE_SUBDIRS = NO
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.TH LAMMPS "1" "19 November 2024" "2024-11-19"
|
||||
.TH LAMMPS "1" "4 February 2025" "2025-02-04"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator. Version 19 November 2024
|
||||
\- Molecular Dynamics Simulator. Version 4 February 2025
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B lmp
|
||||
@ -311,7 +311,7 @@ the chapter on errors in the
|
||||
manual gives some additional information about error messages, if possible.
|
||||
|
||||
.SH COPYRIGHT
|
||||
© 2003--2024 Sandia Corporation
|
||||
© 2003--2025 Sandia Corporation
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
Build LAMMPS
|
||||
============
|
||||
|
||||
LAMMPS is built as a library and an executable from source code using
|
||||
either traditional makefiles for use with GNU make (which may require
|
||||
manual editing), or using a build environment generated by CMake (Unix
|
||||
Makefiles, Ninja, Xcode, Visual Studio, KDevelop, CodeBlocks and more).
|
||||
LAMMPS is built as a library and an executable from source code using a
|
||||
build environment generated by CMake (Unix Makefiles, Ninja, Xcode,
|
||||
Visual Studio, KDevelop, CodeBlocks and more depending on the platform).
|
||||
Using CMake is the preferred way to build LAMMPS. In addition, LAMMPS
|
||||
can be compiled using the legacy build system based on traditional
|
||||
makefiles for use with GNU make (which may require manual editing).
|
||||
Support for the legacy build system is slowly being phased out and may
|
||||
not be available for all optional features.
|
||||
|
||||
As an alternative, you can download a package with pre-built executables
|
||||
or automated build trees, as described in the :doc:`Install <Install>`
|
||||
|
||||
@ -160,7 +160,7 @@ with the OpenMP 3.1 semantics used in LAMMPS for maximal compatibility
|
||||
with compiler versions in use. If compilation with OpenMP enabled fails
|
||||
because of your compiler requiring strict OpenMP 4.0 semantics, you can
|
||||
change the behavior by adding ``-D LAMMPS_OMP_COMPAT=4`` to the
|
||||
``LMP_INC`` variable in your makefile, or add it to the command line
|
||||
``LMP_INC`` variable in your makefile, or add it to the command-line flags
|
||||
while configuring with CMake. LAMMPS will auto-detect a suitable setting
|
||||
for most GNU, Clang, and Intel compilers.
|
||||
|
||||
@ -196,13 +196,18 @@ LAMMPS.
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
By default CMake will use the compiler it finds according to
|
||||
By default CMake will use the compiler it finds according to its
|
||||
internal preferences, and it will add optimization flags
|
||||
appropriate to that compiler and any :doc:`accelerator packages
|
||||
<Speed_packages>` you have included in the build. CMake will
|
||||
check if the detected or selected compiler is compatible with the
|
||||
C++ support requirements of LAMMPS and stop with an error, if this
|
||||
is not the case.
|
||||
is not the case. A C++11 compatible compiler is currently
|
||||
required, but a transition to require C++17 is in progress and
|
||||
planned to be completed in Summer 2025. Currently, setting
|
||||
``-DLAMMPS_CXX11=yes`` is required when configuring with CMake while
|
||||
using a C++11 compatible compiler that does not support C++17,
|
||||
otherwise setting ``-DCMAKE_CXX_STANDARD=17`` is preferred.
|
||||
|
||||
You can tell CMake to look for a specific compiler with setting
|
||||
CMake variables (listed below) during configuration. For a few
|
||||
@ -223,6 +228,8 @@ LAMMPS.
|
||||
-D CMAKE_C_COMPILER=name # name of C compiler
|
||||
-D CMAKE_Fortran_COMPILER=name # name of Fortran compiler
|
||||
|
||||
-D CMAKE_CXX_STANDARD=17 # put compiler in C++17 mode
|
||||
-D LAMMPS_CXX11=yes # enforce compilation in C++11 mode
|
||||
-D CMAKE_CXX_FLAGS=string # flags to use with C++ compiler
|
||||
-D CMAKE_C_FLAGS=string # flags to use with C compiler
|
||||
-D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler
|
||||
@ -321,15 +328,23 @@ LAMMPS.
|
||||
you would have to install a newer compiler that supports C++11;
|
||||
either as a binary package or through compiling from source.
|
||||
|
||||
If you build LAMMPS with any :doc:`Speed_packages` included,
|
||||
there may be specific compiler or linker flags that are either
|
||||
required or recommended to enable required features and to
|
||||
achieve optimal performance. You need to include these in the
|
||||
``CCFLAGS`` and ``LINKFLAGS`` settings above. For details, see the
|
||||
documentation for the individual packages listed on the
|
||||
:doc:`Speed_packages` page. Or examine these files in the
|
||||
``src/MAKE/OPTIONS`` directory. They correspond to each of the 5
|
||||
accelerator packages and their hardware variants:
|
||||
While a C++11 compatible compiler is currently sufficient to compile
|
||||
LAMMPS, a transition to require C++17 is in progress and planned to
|
||||
be completed in Summer 2025. Currently, setting ``-DLAMMPS_CXX11``
|
||||
in the ``LMP_INC =`` line in the machine makefile is required when
|
||||
using a C++11 compatible compiler that does not support C++17.
|
||||
Otherwise, to enable C++17 support (if not enabled by default) using
|
||||
a compiler flag like ``-std=c++17`` in CCFLAGS may needed.
|
||||
|
||||
If you build LAMMPS with any :doc:`Speed_packages` included,
|
||||
there may be specific compiler or linker flags that are either
|
||||
required or recommended to enable required features and to
|
||||
achieve optimal performance. You need to include these in the
|
||||
``CCFLAGS`` and ``LINKFLAGS`` settings above. For details, see the
|
||||
documentation for the individual packages listed on the
|
||||
:doc:`Speed_packages` page. Or examine these files in the
|
||||
``src/MAKE/OPTIONS`` directory. They correspond to each of the 5
|
||||
accelerator packages and their hardware variants:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -502,6 +517,8 @@ using CMake or Make.
|
||||
# chain.x, micelle2d.x, msi2lmp, phana,
|
||||
# stl_bin2txt
|
||||
-D BUILD_LAMMPS_GUI=value # yes or no (default). Build LAMMPS-GUI
|
||||
-D BUILD_WHAM=value # yes (default). Download and build WHAM;
|
||||
# only available for BUILD_LAMMPS_GUI=yes
|
||||
|
||||
The generated binaries will also become part of the LAMMPS installation
|
||||
(see below).
|
||||
|
||||
@ -8,7 +8,7 @@ packages. Links to those pages on the :doc:`Build overview <Build>`
|
||||
page.
|
||||
|
||||
The following text assumes some familiarity with CMake and focuses on
|
||||
using the command line tool ``cmake`` and what settings are supported
|
||||
using the command-line tool ``cmake`` and what settings are supported
|
||||
for building LAMMPS. A more detailed tutorial on how to use CMake
|
||||
itself, the text mode or graphical user interface, to change the
|
||||
generated output files for different build tools and development
|
||||
@ -16,7 +16,7 @@ environments is on a :doc:`separate page <Howto_cmake>`.
|
||||
|
||||
.. note::
|
||||
|
||||
LAMMPS currently requires that CMake version 3.16 or later is available.
|
||||
LAMMPS currently requires that CMake version 3.20 or later is available.
|
||||
|
||||
.. warning::
|
||||
|
||||
@ -32,22 +32,22 @@ environments is on a :doc:`separate page <Howto_cmake>`.
|
||||
Advantages of using CMake
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
CMake is an alternative to compiling LAMMPS in the traditional way
|
||||
through :doc:`(manually customized) makefiles <Build_make>`. Using
|
||||
CMake has multiple advantages that are specifically helpful for
|
||||
people with limited experience in compiling software or for people
|
||||
that want to modify or extend LAMMPS.
|
||||
CMake is the preferred way of compiling LAMMPS in contrast to the legacy
|
||||
build system based on GNU make and through :doc:`(manually customized)
|
||||
makefiles <Build_make>`. Using CMake has multiple advantages that are
|
||||
specifically helpful for people with limited experience in compiling
|
||||
software or for people that want to modify or extend LAMMPS.
|
||||
|
||||
- CMake can detect available hardware, tools, features, and libraries
|
||||
and adapt the LAMMPS default build configuration accordingly.
|
||||
- CMake can generate files for different build tools and integrated
|
||||
development environments (IDE).
|
||||
- CMake supports customization of settings with a command line, text
|
||||
- CMake supports customization of settings with a command-line, text
|
||||
mode, or graphical user interface. No manual editing of files,
|
||||
knowledge of file formats or complex command line syntax is required.
|
||||
knowledge of file formats or complex command-line syntax is required.
|
||||
- All enabled components are compiled in a single build operation.
|
||||
- Automated dependency tracking for all files and configuration options.
|
||||
- Support for true out-of-source compilation. Multiple configurations
|
||||
- Support for true out-of-source compilation. Multiple configurations
|
||||
and settings with different choices of LAMMPS packages, settings, or
|
||||
compilers can be configured and built concurrently from the same
|
||||
source tree.
|
||||
@ -68,7 +68,7 @@ that purpose you can use either the command-line utility ``cmake`` (or
|
||||
graphical utility ``cmake-gui``, or use them interchangeably. The
|
||||
second step is then the compilation and linking of all objects,
|
||||
libraries, and executables using the selected build tool. Here is a
|
||||
minimal example using the command line version of CMake to build LAMMPS
|
||||
minimal example using the command-line version of CMake to build LAMMPS
|
||||
with no add-on packages enabled and no customization:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -131,7 +131,7 @@ file called ``CMakeLists.txt`` (for LAMMPS it is located in the
|
||||
configuration step. The cache file contains all current CMake settings.
|
||||
|
||||
To modify settings, enable or disable features, you need to set
|
||||
*variables* with either the ``-D`` command line flag (``-D
|
||||
*variables* with either the ``-D`` command-line flag (``-D
|
||||
VARIABLE1_NAME=value``) or change them in the text mode of the graphical
|
||||
user interface. The ``-D`` flag can be used several times in one command.
|
||||
|
||||
@ -141,11 +141,11 @@ a different compiler tool chain. Those are loaded with the ``-C`` flag
|
||||
(``-C ../cmake/presets/basic.cmake``). This step would only be needed
|
||||
once, as the settings from the preset files are stored in the
|
||||
``CMakeCache.txt`` file. It is also possible to customize the build
|
||||
by adding one or more ``-D`` flags to the CMake command line.
|
||||
by adding one or more ``-D`` flags to the CMake command.
|
||||
|
||||
Generating files for alternate build tools (e.g. Ninja) and project files
|
||||
for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the ``-G``
|
||||
command line flag. A list of available generator settings for your
|
||||
command-line flag. A list of available generator settings for your
|
||||
specific CMake version is given when running ``cmake --help``.
|
||||
|
||||
.. _cmake_multiconfig:
|
||||
|
||||
@ -263,9 +263,9 @@ will be skipped if prerequisite features are not available in LAMMPS.
|
||||
time. Preference is given to parts of the code base that are easy to
|
||||
test or commonly used.
|
||||
|
||||
Tests as shown by the ``ctest`` program are command lines defined in the
|
||||
Tests as shown by the ``ctest`` program are commands defined in the
|
||||
``CMakeLists.txt`` files in the ``unittest`` directory tree. A few
|
||||
tests simply execute LAMMPS with specific command line flags and check
|
||||
tests simply execute LAMMPS with specific command-line flags and check
|
||||
the output to the screen for expected content. A large number of unit
|
||||
tests are special tests programs using the `GoogleTest framework
|
||||
<https://github.com/google/googletest/>`_ and linked to the LAMMPS
|
||||
@ -420,7 +420,7 @@ during MD timestepping and manipulate per-atom properties like
|
||||
positions, velocities, and forces. For those fix styles, testing can be
|
||||
done in a very similar fashion as for force fields and thus there is a
|
||||
test program `test_fix_timestep` that shares a lot of code, properties,
|
||||
and command line flags with the force field style testers described in
|
||||
and command-line flags with the force field style testers described in
|
||||
the previous section.
|
||||
|
||||
This tester will set up a small molecular system run with verlet run
|
||||
@ -642,10 +642,10 @@ The following target are available for both, GNU make and CMake:
|
||||
|
||||
.. _gh-cli:
|
||||
|
||||
GitHub command line interface
|
||||
GitHub command-line interface
|
||||
-----------------------------
|
||||
|
||||
GitHub has developed a `command line tool <https://cli.github.com>`_
|
||||
GitHub has developed a `command-line tool <https://cli.github.com>`_
|
||||
to interact with the GitHub website via a command called ``gh``.
|
||||
This is extremely convenient when working with a Git repository hosted
|
||||
on GitHub (like LAMMPS). It is thus highly recommended to install it
|
||||
|
||||
@ -48,6 +48,7 @@ This is the list of packages that may require additional steps.
|
||||
* :ref:`LEPTON <lepton>`
|
||||
* :ref:`MACHDYN <machdyn>`
|
||||
* :ref:`MDI <mdi>`
|
||||
* :ref:`MISC <misc>`
|
||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||
* :ref:`ML-IAP <mliap>`
|
||||
* :ref:`ML-PACE <ml-pace>`
|
||||
@ -209,7 +210,7 @@ necessary for ``hipcc`` and the linker to work correctly.
|
||||
Using the CHIP-SPV implementation of HIP is supported. It allows one to
|
||||
run HIP code on Intel GPUs via the OpenCL or Level Zero back ends. To use
|
||||
CHIP-SPV, you must set ``-DHIP_USE_DEVICE_SORT=OFF`` in your CMake
|
||||
command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
|
||||
command-line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
|
||||
the use of HIP for Intel GPUs is experimental. You should only use this
|
||||
option in preparations to run on Aurora system at Argonne.
|
||||
|
||||
@ -232,7 +233,7 @@ option in preparations to run on Aurora system at Argonne.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# CUDA target (not recommended, use GPU_ARCH=cuda)
|
||||
# CUDA target (not recommended, use GPU_API=cuda)
|
||||
# !!! DO NOT set CMAKE_CXX_COMPILER !!!
|
||||
export HIP_PLATFORM=nvcc
|
||||
export HIP_PATH=/path/to/HIP/install
|
||||
@ -421,9 +422,10 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||
``CMAKE`` environment variable if the cmake executable is named other
|
||||
than ``cmake`` on your system. Additional environment variables may be
|
||||
provided on the command line for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the gnu version 11 compilers
|
||||
to build KIM, one could use the following command line.
|
||||
set with the ``make`` command for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the GNU version 11 compilers
|
||||
called ``g++-11``, ``gcc-11`` and ``gfortran-11`` to build KIM, one
|
||||
could use the following command.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -546,16 +548,7 @@ They must be specified in uppercase.
|
||||
- Local machine
|
||||
* - AMDAVX
|
||||
- HOST
|
||||
- AMD 64-bit x86 CPU (AVX 1)
|
||||
* - ZEN
|
||||
- HOST
|
||||
- AMD Zen class CPU (AVX 2)
|
||||
* - ZEN2
|
||||
- HOST
|
||||
- AMD Zen2 class CPU (AVX 2)
|
||||
* - ZEN3
|
||||
- HOST
|
||||
- AMD Zen3 class CPU (AVX 2)
|
||||
- AMD chip
|
||||
* - ARMV80
|
||||
- HOST
|
||||
- ARMv8.0 Compatible CPU
|
||||
@ -571,105 +564,126 @@ They must be specified in uppercase.
|
||||
* - A64FX
|
||||
- HOST
|
||||
- ARMv8.2 with SVE Support
|
||||
* - ARMV9_GRACE
|
||||
- HOST
|
||||
- ARMv9 NVIDIA Grace CPU
|
||||
* - SNB
|
||||
- HOST
|
||||
- Intel Sandy/Ivy Bridge CPU (AVX 1)
|
||||
- Intel Sandy/Ivy Bridge CPUs
|
||||
* - HSW
|
||||
- HOST
|
||||
- Intel Haswell CPU (AVX 2)
|
||||
- Intel Haswell CPUs
|
||||
* - BDW
|
||||
- HOST
|
||||
- Intel Broadwell Xeon E-class CPU (AVX 2 + transactional mem)
|
||||
* - SKL
|
||||
- HOST
|
||||
- Intel Skylake Client CPU
|
||||
* - SKX
|
||||
- HOST
|
||||
- Intel Skylake Xeon Server CPU (AVX512)
|
||||
- Intel Broadwell Xeon E-class CPUs
|
||||
* - ICL
|
||||
- HOST
|
||||
- Intel Ice Lake Client CPU (AVX512)
|
||||
- Intel Ice Lake Client CPUs (AVX512)
|
||||
* - ICX
|
||||
- HOST
|
||||
- Intel Ice Lake Xeon Server CPU (AVX512)
|
||||
* - SPR
|
||||
- Intel Ice Lake Xeon Server CPUs (AVX512)
|
||||
* - SKL
|
||||
- HOST
|
||||
- Intel Sapphire Rapids Xeon Server CPU (AVX512)
|
||||
- Intel Skylake Client CPUs
|
||||
* - SKX
|
||||
- HOST
|
||||
- Intel Skylake Xeon Server CPUs (AVX512)
|
||||
* - KNC
|
||||
- HOST
|
||||
- Intel Knights Corner Xeon Phi
|
||||
* - KNL
|
||||
- HOST
|
||||
- Intel Knights Landing Xeon Phi
|
||||
* - SPR
|
||||
- HOST
|
||||
- Intel Sapphire Rapids Xeon Server CPUs (AVX512)
|
||||
* - POWER8
|
||||
- HOST
|
||||
- IBM POWER8 CPU
|
||||
- IBM POWER8 CPUs
|
||||
* - POWER9
|
||||
- HOST
|
||||
- IBM POWER9 CPU
|
||||
- IBM POWER9 CPUs
|
||||
* - ZEN
|
||||
- HOST
|
||||
- AMD Zen architecture
|
||||
* - ZEN2
|
||||
- HOST
|
||||
- AMD Zen2 architecture
|
||||
* - ZEN3
|
||||
- HOST
|
||||
- AMD Zen3 architecture
|
||||
* - RISCV_SG2042
|
||||
- HOST
|
||||
- SG2042 (RISC-V) CPU
|
||||
- SG2042 (RISC-V) CPUs
|
||||
* - RISCV_RVA22V
|
||||
- HOST
|
||||
- RVA22V (RISC-V) CPUs
|
||||
* - KEPLER30
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.0 GPU
|
||||
- NVIDIA Kepler generation CC 3.0
|
||||
* - KEPLER32
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.2 GPU
|
||||
- NVIDIA Kepler generation CC 3.2
|
||||
* - KEPLER35
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.5 GPU
|
||||
- NVIDIA Kepler generation CC 3.5
|
||||
* - KEPLER37
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.7 GPU
|
||||
- NVIDIA Kepler generation CC 3.7
|
||||
* - MAXWELL50
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.0 GPU
|
||||
- NVIDIA Maxwell generation CC 5.0
|
||||
* - MAXWELL52
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.2 GPU
|
||||
- NVIDIA Maxwell generation CC 5.2
|
||||
* - MAXWELL53
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.3 GPU
|
||||
- NVIDIA Maxwell generation CC 5.3
|
||||
* - PASCAL60
|
||||
- GPU
|
||||
- NVIDIA Pascal generation CC 6.0 GPU
|
||||
- NVIDIA Pascal generation CC 6.0
|
||||
* - PASCAL61
|
||||
- GPU
|
||||
- NVIDIA Pascal generation CC 6.1 GPU
|
||||
- NVIDIA Pascal generation CC 6.1
|
||||
* - VOLTA70
|
||||
- GPU
|
||||
- NVIDIA Volta generation CC 7.0 GPU
|
||||
- NVIDIA Volta generation CC 7.0
|
||||
* - VOLTA72
|
||||
- GPU
|
||||
- NVIDIA Volta generation CC 7.2 GPU
|
||||
- NVIDIA Volta generation CC 7.2
|
||||
* - TURING75
|
||||
- GPU
|
||||
- NVIDIA Turing generation CC 7.5 GPU
|
||||
- NVIDIA Turing generation CC 7.5
|
||||
* - AMPERE80
|
||||
- GPU
|
||||
- NVIDIA Ampere generation CC 8.0 GPU
|
||||
- NVIDIA Ampere generation CC 8.0
|
||||
* - AMPERE86
|
||||
- GPU
|
||||
- NVIDIA Ampere generation CC 8.6 GPU
|
||||
- NVIDIA Ampere generation CC 8.6
|
||||
* - ADA89
|
||||
- GPU
|
||||
- NVIDIA Ada Lovelace generation CC 8.9 GPU
|
||||
- NVIDIA Ada generation CC 8.9
|
||||
* - HOPPER90
|
||||
- GPU
|
||||
- NVIDIA Hopper generation CC 9.0 GPU
|
||||
- NVIDIA Hopper generation CC 9.0
|
||||
* - AMD_GFX906
|
||||
- GPU
|
||||
- AMD GPU MI50/MI60
|
||||
- AMD GPU MI50/60
|
||||
* - AMD_GFX908
|
||||
- GPU
|
||||
- AMD GPU MI100
|
||||
* - AMD_GFX90A
|
||||
- GPU
|
||||
- AMD GPU MI200
|
||||
* - AMD_GFX940
|
||||
- GPU
|
||||
- AMD GPU MI300
|
||||
* - AMD_GFX942
|
||||
- GPU
|
||||
- AMD GPU MI300
|
||||
* - AMD_GFX942_APU
|
||||
- GPU
|
||||
- AMD APU MI300A
|
||||
* - AMD_GFX1030
|
||||
- GPU
|
||||
- AMD GPU V620/W6800
|
||||
@ -678,7 +692,7 @@ They must be specified in uppercase.
|
||||
- AMD GPU RX7900XTX
|
||||
* - AMD_GFX1103
|
||||
- GPU
|
||||
- AMD Phoenix APU with Radeon 740M/760M/780M/880M/890M
|
||||
- AMD APU Phoenix
|
||||
* - INTEL_GEN
|
||||
- GPU
|
||||
- SPIR64-based devices, e.g. Intel GPUs, using JIT
|
||||
@ -701,7 +715,7 @@ They must be specified in uppercase.
|
||||
- GPU
|
||||
- Intel GPU Ponte Vecchio
|
||||
|
||||
This list was last updated for version 4.3.0 of the Kokkos library.
|
||||
This list was last updated for version 4.5.1 of the Kokkos library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -2018,7 +2032,7 @@ TBB and MKL.
|
||||
.. _mdi:
|
||||
|
||||
MDI package
|
||||
-----------------------------
|
||||
-----------
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -2045,6 +2059,37 @@ MDI package
|
||||
|
||||
----------
|
||||
|
||||
.. _misc:
|
||||
|
||||
MISC package
|
||||
------------
|
||||
|
||||
The :doc:`fix imd <fix_imd>` style in this package can be run either
|
||||
synchronously (communication with IMD clients is done in the main
|
||||
process) or asynchronously (the fix spawns a separate thread that can
|
||||
communicate with IMD clients concurrently to the LAMMPS execution).
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_ASYNC_IMD=value # Run IMD server asynchronously
|
||||
# value = no (default) or yes
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
To enable asynchronous mode the ``-DLAMMPS_ASYNC_IMD`` define
|
||||
needs to be added to the ``LMP_INC`` variable in the
|
||||
``Makefile.machine`` you are using. For example:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_ASYNC_IMD -DLAMMPS_MEMALIGN=64
|
||||
|
||||
----------
|
||||
|
||||
.. _molfile:
|
||||
|
||||
MOLFILE package
|
||||
@ -2191,7 +2236,7 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
||||
from the sources in the *lib* folder (including the essential
|
||||
libqmmm.a) are not included in the static LAMMPS library and
|
||||
(currently) not installed, while their code is included in the
|
||||
shared LAMMPS library. Thus a typical command line to configure
|
||||
shared LAMMPS library. Thus a typical command to configure
|
||||
building LAMMPS for QMMM would be:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -8,6 +8,10 @@ Building LAMMPS with traditional makefiles requires that you have a
|
||||
for customizing your LAMMPS build with a number of global compilation
|
||||
options and features.
|
||||
|
||||
This build system is slowly being phased out and may not support all
|
||||
optional features and packages in LAMMPS. It is recommended to switch
|
||||
to the :doc:`CMake based build system <Build_cmake>`.
|
||||
|
||||
Requirements
|
||||
^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ packages:
|
||||
* :ref:`LEPTON <lepton>`
|
||||
* :ref:`MACHDYN <machdyn>`
|
||||
* :ref:`MDI <mdi>`
|
||||
* :ref:`MISC <misc>`
|
||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||
* :ref:`ML-IAP <mliap>`
|
||||
* :ref:`ML-PACE <ml-pace>`
|
||||
|
||||
@ -100,9 +100,9 @@ procedure.
|
||||
|
||||
It is possible to use both the integrated CMake support of the Visual
|
||||
Studio IDE or use an external CMake installation (e.g. downloaded from
|
||||
cmake.org) to create build files and compile LAMMPS from the command line.
|
||||
cmake.org) to create build files and compile LAMMPS from the command-line.
|
||||
|
||||
Compilation via command line and unit tests are checked automatically
|
||||
Compilation via command-line and unit tests are checked automatically
|
||||
for the LAMMPS development branch through
|
||||
`GitHub Actions <https://github.com/lammps/lammps/actions/workflows/compile-msvc.yml>`_.
|
||||
|
||||
@ -115,7 +115,7 @@ for the LAMMPS development branch through
|
||||
|
||||
Please note, that for either approach CMake will create a so-called
|
||||
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
|
||||
the command lines for building and testing LAMMPS must be adjusted
|
||||
the commands for building and testing LAMMPS must be adjusted
|
||||
accordingly.
|
||||
|
||||
The LAMMPS cmake folder contains a ``CMakeSettings.json`` file with
|
||||
|
||||
@ -4,7 +4,7 @@ LAMMPS Class
|
||||
The LAMMPS class is encapsulating an MD simulation state and thus it is
|
||||
the class that needs to be created when starting a new simulation system
|
||||
state. The LAMMPS executable essentially creates one instance of this
|
||||
class and passes the command line flags and tells it to process the
|
||||
class and passes the command-line flags and tells it to process the
|
||||
provided input (a file or ``stdin``). It shuts the class down when
|
||||
control is returned to it and then exits. When using LAMMPS as a
|
||||
library from another code it is required to create an instance of this
|
||||
|
||||
@ -90,6 +90,7 @@ OPT.
|
||||
* :doc:`lepton (o) <angle_lepton>`
|
||||
* :doc:`mesocnt <angle_mesocnt>`
|
||||
* :doc:`mm3 <angle_mm3>`
|
||||
* :doc:`mwlc <angle_mwlc>`
|
||||
* :doc:`quartic (o) <angle_quartic>`
|
||||
* :doc:`spica (ko) <angle_spica>`
|
||||
* :doc:`table (o) <angle_table>`
|
||||
|
||||
@ -58,6 +58,7 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`fep/ta <compute_fep_ta>`
|
||||
* :doc:`force/tally <compute_tally>`
|
||||
* :doc:`fragment/atom <compute_cluster_atom>`
|
||||
* :doc:`gaussian/grid/local (k) <compute_gaussian_grid_local>`
|
||||
* :doc:`global/atom <compute_global_atom>`
|
||||
* :doc:`group/group <compute_group_group>`
|
||||
* :doc:`gyration <compute_gyration>`
|
||||
@ -140,8 +141,8 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`smd/vol <compute_smd_vol>`
|
||||
* :doc:`snap <compute_sna_atom>`
|
||||
* :doc:`sna/atom <compute_sna_atom>`
|
||||
* :doc:`sna/grid <compute_sna_atom>`
|
||||
* :doc:`sna/grid/local <compute_sna_atom>`
|
||||
* :doc:`sna/grid (k) <compute_sna_atom>`
|
||||
* :doc:`sna/grid/local (k) <compute_sna_atom>`
|
||||
* :doc:`snad/atom <compute_sna_atom>`
|
||||
* :doc:`snav/atom <compute_sna_atom>`
|
||||
* :doc:`sph/e/atom <compute_sph_e_atom>`
|
||||
|
||||
@ -58,6 +58,7 @@ OPT.
|
||||
* :doc:`dt/reset (k) <fix_dt_reset>`
|
||||
* :doc:`edpd/source <fix_dpd_source>`
|
||||
* :doc:`efield (k) <fix_efield>`
|
||||
* :doc:`efield/lepton <fix_efield_lepton>`
|
||||
* :doc:`efield/tip4p <fix_efield>`
|
||||
* :doc:`ehex <fix_ehex>`
|
||||
* :doc:`electrode/conp (i) <fix_electrode>`
|
||||
|
||||
@ -69,7 +69,7 @@ WARNING message is printed. The :doc:`Errors <Errors>` page gives
|
||||
more information on what errors mean. The documentation for each
|
||||
command lists restrictions on how the command can be used.
|
||||
|
||||
You can use the :ref:`-skiprun <skiprun>` command line flag
|
||||
You can use the :ref:`-skiprun <skiprun>` command-line flag
|
||||
to have LAMMPS skip the execution of any ``run``, ``minimize``, or similar
|
||||
commands to check the entire input for correct syntax to avoid crashes
|
||||
on typos or syntax errors in long runs.
|
||||
|
||||
@ -80,6 +80,7 @@ OPT.
|
||||
* :doc:`coul/tt <pair_coul_tt>`
|
||||
* :doc:`coul/wolf (ko) <pair_coul>`
|
||||
* :doc:`coul/wolf/cs <pair_cs>`
|
||||
* :doc:`dispersion/d3 <pair_dispersion_d3>`
|
||||
* :doc:`dpd (giko) <pair_dpd>`
|
||||
* :doc:`dpd/coul/slater/long (g) <pair_dpd_coul_slater_long>`
|
||||
* :doc:`dpd/ext (ko) <pair_dpd_ext>`
|
||||
@ -114,7 +115,9 @@ OPT.
|
||||
* :doc:`gw/zbl <pair_gw>`
|
||||
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
|
||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/lj/angleoffset (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse/angleoffset (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hdnnp <pair_hdnnp>`
|
||||
* :doc:`hippo (g) <pair_amoeba>`
|
||||
* :doc:`ilp/graphene/hbn (t) <pair_ilp_graphene_hbn>`
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
Removed commands and packages
|
||||
=============================
|
||||
|
||||
.. contents::
|
||||
|
||||
------
|
||||
|
||||
This page lists LAMMPS commands and packages that have been removed from
|
||||
the distribution and provides suggestions for alternatives or
|
||||
replacements. LAMMPS has special dummy styles implemented, that will
|
||||
@ -8,94 +12,32 @@ 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.
|
||||
|
||||
restart2data tool
|
||||
-----------------
|
||||
|
||||
.. versionchanged:: 23Nov2013
|
||||
|
||||
The functionality of the restart2data tool has been folded into the
|
||||
LAMMPS executable directly instead of having a separate tool. A
|
||||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||
added convenience this conversion can also be triggered by
|
||||
:doc:`command line flags <Run_options>`
|
||||
|
||||
Fix ave/spatial and fix ave/spatial/sphere
|
||||
------------------------------------------
|
||||
|
||||
.. deprecated:: 11Dec2015
|
||||
|
||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||
since they were superseded by the more general and extensible "chunk
|
||||
infrastructure". Here the system is partitioned in one of many possible
|
||||
ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
|
||||
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
||||
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||
|
||||
Box command
|
||||
-----------
|
||||
|
||||
.. deprecated:: 22Dec2022
|
||||
|
||||
The *box* command has been removed and the LAMMPS code changed so it won't
|
||||
be needed. If present, LAMMPS will ignore the command and print a warning.
|
||||
|
||||
Reset_ids, reset_atom_ids, reset_mol_ids commands
|
||||
-------------------------------------------------
|
||||
|
||||
.. deprecated:: 22Dec2022
|
||||
|
||||
The *reset_ids*, *reset_atom_ids*, and *reset_mol_ids* commands have
|
||||
been folded into the :doc:`reset_atoms <reset_atoms>` command. If
|
||||
present, LAMMPS will replace the commands accordingly and print a
|
||||
warning.
|
||||
|
||||
LATTE package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 15Jun2023
|
||||
|
||||
The LATTE package with the fix latte command was removed from LAMMPS.
|
||||
This functionality has been superseded by :doc:`fix mdi/qm <fix_mdi_qm>`
|
||||
and :doc:`fix mdi/qmmm <fix_mdi_qmmm>` from the :ref:`MDI package
|
||||
<PKG-MDI>`. These fixes are compatible with several quantum software
|
||||
packages, including LATTE. See the ``examples/QUANTUM`` dir and the
|
||||
:doc:`MDI coupling HOWTO <Howto_mdi>` page. MDI supports running LAMMPS
|
||||
with LATTE as a plugin library (similar to the way fix latte worked), as
|
||||
well as on a different set of MPI processors.
|
||||
|
||||
MEAM package
|
||||
LAMMPS shell
|
||||
------------
|
||||
|
||||
The MEAM package in Fortran has been replaced by a C++ implementation.
|
||||
The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
||||
Fortran code of MEAM into C++, which removes several restrictions
|
||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||
for some optimizations leading to better performance. The pair style
|
||||
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||
coexist with the Fortran version.
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
Minimize style fire/old
|
||||
-----------------------
|
||||
The LAMMPS shell has been removed from the LAMMPS distribution. Users
|
||||
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
i-PI tool
|
||||
---------
|
||||
|
||||
Minimize style *fire/old* has been removed. Its functionality can be
|
||||
reproduced with *fire* with specific options. Please see the
|
||||
:doc:`min_modify command <min_modify>` documentation for details.
|
||||
.. versionchanged:: 27Jun2024
|
||||
|
||||
Pair style mesont/tpm, compute style mesont, atom style mesont
|
||||
--------------------------------------------------------------
|
||||
The i-PI tool has been removed from the LAMMPS distribution. Instead,
|
||||
instructions to install i-PI from PyPI via pip are provided.
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
USER-REAXC package
|
||||
------------------
|
||||
|
||||
Pair style *mesont/tpm*, compute style *mesont*, and atom style
|
||||
*mesont* have been removed from the :ref:`MESONT package <PKG-MESONT>`.
|
||||
The same functionality is available through
|
||||
:doc:`pair style mesocnt <pair_mesocnt>`,
|
||||
:doc:`bond style mesocnt <bond_mesocnt>` and
|
||||
:doc:`angle style mesocnt <angle_mesocnt>`.
|
||||
.. deprecated:: 7Feb2024
|
||||
|
||||
The USER-REAXC package has been renamed to :ref:`REAXFF <PKG-REAXFF>`.
|
||||
In the process also the pair style and related fixes were renamed to use
|
||||
the "reaxff" string instead of "reax/c". For a while LAMMPS was maintaining
|
||||
backward compatibility by providing aliases for the styles. These have
|
||||
been removed, so using "reaxff" is now *required*.
|
||||
|
||||
MPIIO package
|
||||
-------------
|
||||
@ -115,7 +57,6 @@ Similarly, the "nfile" and "fileper" keywords exist for restarts:
|
||||
see :doc:`restart <restart>`, :doc:`read_restart <read_restart>`,
|
||||
:doc:`write_restart <write_restart>`.
|
||||
|
||||
|
||||
MSCG package
|
||||
------------
|
||||
|
||||
@ -126,9 +67,73 @@ for many years and instead superseded by the `OpenMSCG software
|
||||
<https://software.rcc.uchicago.edu/mscg/>`_ of the Voth group at the
|
||||
University of Chicago, which can be used independent from LAMMPS.
|
||||
|
||||
LATTE package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 15Jun2023
|
||||
|
||||
The LATTE package with the fix latte command was removed from LAMMPS.
|
||||
This functionality has been superseded by :doc:`fix mdi/qm <fix_mdi_qm>`
|
||||
and :doc:`fix mdi/qmmm <fix_mdi_qmmm>` from the :ref:`MDI package
|
||||
<PKG-MDI>`. These fixes are compatible with several quantum software
|
||||
packages, including LATTE. See the ``examples/QUANTUM`` dir and the
|
||||
:doc:`MDI coupling HOWTO <Howto_mdi>` page. MDI supports running LAMMPS
|
||||
with LATTE as a plugin library (similar to the way fix latte worked), as
|
||||
well as on a different set of MPI processors.
|
||||
|
||||
Minimize style fire/old
|
||||
-----------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Minimize style *fire/old* has been removed. Its functionality can be
|
||||
reproduced with style *fire* with specific options. Please see the
|
||||
:doc:`min_modify command <min_modify>` documentation for details.
|
||||
|
||||
Pair style mesont/tpm, compute style mesont, atom style mesont
|
||||
--------------------------------------------------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Pair style *mesont/tpm*, compute style *mesont*, and atom style
|
||||
*mesont* have been removed from the :ref:`MESONT package <PKG-MESONT>`.
|
||||
The same functionality is available through
|
||||
:doc:`pair style mesocnt <pair_mesocnt>`,
|
||||
:doc:`bond style mesocnt <bond_mesocnt>` and
|
||||
:doc:`angle style mesocnt <angle_mesocnt>`.
|
||||
|
||||
Box command
|
||||
-----------
|
||||
|
||||
.. deprecated:: 22Dec2022
|
||||
|
||||
The *box* command has been removed and the LAMMPS code changed so it won't
|
||||
be needed. If present, LAMMPS will ignore the command and print a warning.
|
||||
|
||||
Reset_ids, reset_atom_ids, reset_mol_ids commands
|
||||
-------------------------------------------------
|
||||
|
||||
.. deprecated:: 22Dec2022
|
||||
|
||||
The *reset_ids*, *reset_atom_ids*, and *reset_mol_ids* commands have
|
||||
been folded into the :doc:`reset_atoms <reset_atoms>` command. If
|
||||
present, LAMMPS will replace the commands accordingly and print a
|
||||
warning.
|
||||
|
||||
MESSAGE package
|
||||
---------------
|
||||
|
||||
.. deprecated:: 4May2022
|
||||
|
||||
The MESSAGE package has been removed since it was superseded by the
|
||||
:ref:`MDI package <PKG-MDI>`. MDI implements the same functionality
|
||||
and in a more general way with direct support for more applications.
|
||||
|
||||
REAX package
|
||||
------------
|
||||
|
||||
.. deprecated:: 4Jan2019
|
||||
|
||||
The REAX package has been removed since it was superseded by the
|
||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||
to yield equivalent results to the REAX package, offers better
|
||||
@ -138,20 +143,25 @@ syntax compatible with the removed reax pair style, so input files will
|
||||
have to be adapted. The REAXFF package was originally called
|
||||
USER-REAXC.
|
||||
|
||||
USER-REAXC package
|
||||
------------------
|
||||
MEAM package
|
||||
------------
|
||||
|
||||
.. deprecated:: 7Feb2024
|
||||
.. deprecated:: 4Jan2019
|
||||
|
||||
The USER-REAXC package has been renamed to :ref:`REAXFF <PKG-REAXFF>`.
|
||||
In the process also the pair style and related fixes were renamed to use
|
||||
the "reaxff" string instead of "reax/c". For a while LAMMPS was maintaining
|
||||
backward compatibility by providing aliases for the styles. These have
|
||||
been removed, so using "reaxff" is now *required*.
|
||||
The MEAM package in Fortran has been replaced by a C++ implementation.
|
||||
The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
||||
Fortran code of MEAM into C++, which removes several restrictions
|
||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||
for some optimizations leading to better performance. The pair style
|
||||
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||
coexist with the Fortran version.
|
||||
|
||||
USER-CUDA package
|
||||
-----------------
|
||||
|
||||
.. deprecated:: 31May2016
|
||||
|
||||
The USER-CUDA package had been removed, since it had been unmaintained
|
||||
for a long time and had known bugs and problems. Significant parts of
|
||||
the design were transferred to the
|
||||
@ -160,19 +170,27 @@ performance characteristics on NVIDIA GPUs. Both, the KOKKOS
|
||||
and the :ref:`GPU package <PKG-GPU>` are maintained
|
||||
and allow running LAMMPS with GPU acceleration.
|
||||
|
||||
i-PI tool
|
||||
---------
|
||||
Fix ave/spatial and fix ave/spatial/sphere
|
||||
------------------------------------------
|
||||
|
||||
.. versionchanged:: 27Jun2024
|
||||
.. deprecated:: 11Dec2015
|
||||
|
||||
The i-PI tool has been removed from the LAMMPS distribution. Instead,
|
||||
instructions to install i-PI from PyPI via pip are provided.
|
||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||
since they were superseded by the more general and extensible "chunk
|
||||
infrastructure". Here the system is partitioned in one of many possible
|
||||
ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
|
||||
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
||||
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||
|
||||
LAMMPS shell
|
||||
------------
|
||||
restart2data tool
|
||||
-----------------
|
||||
|
||||
.. versionchanged:: 29Aug2024
|
||||
.. deprecated:: 23Nov2013
|
||||
|
||||
The LAMMPS shell has been removed from the LAMMPS distribution. Users
|
||||
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
|
||||
The functionality of the restart2data tool has been folded into the
|
||||
LAMMPS executable directly instead of having a separate tool. A
|
||||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||
added convenience this conversion can also be triggered by
|
||||
:doc:`command-line flags <Run_options>`
|
||||
|
||||
|
||||
@ -203,6 +203,7 @@ processed in the expected order before types are removed from dynamic
|
||||
dispatch.
|
||||
|
||||
.. admonition:: Important Notes
|
||||
:class: note
|
||||
|
||||
In order to be able to detect incompatibilities at compile time and
|
||||
to avoid unexpected behavior, it is crucial that all member functions
|
||||
@ -300,18 +301,24 @@ Formatting with the {fmt} library
|
||||
|
||||
The LAMMPS source code includes a copy of the `{fmt} library
|
||||
<https://fmt.dev>`_, which is preferred over formatting with the
|
||||
"printf()" family of functions. The primary reason is that it allows
|
||||
a typesafe default format for any type of supported data. This is
|
||||
"printf()" family of functions. The primary reason is that it allows a
|
||||
typesafe default format for any type of supported data. This is
|
||||
particularly useful for formatting integers of a given size (32-bit or
|
||||
64-bit) which may require different format strings depending on
|
||||
compile time settings or compilers/operating systems. Furthermore,
|
||||
{fmt} gives better performance, has more functionality, a familiar
|
||||
formatting syntax that has similarities to ``format()`` in Python, and
|
||||
provides a facility that can be used to integrate format strings and a
|
||||
variable number of arguments into custom functions in a much simpler
|
||||
way than the varargs mechanism of the C library. Finally, {fmt} has
|
||||
been included into the C++20 language standard, so changes to adopt it
|
||||
are future-proof.
|
||||
64-bit) which may require different format strings depending on compile
|
||||
time settings or compilers/operating systems. Furthermore, {fmt} gives
|
||||
better performance, has more functionality, a familiar formatting syntax
|
||||
that has similarities to ``format()`` in Python, and provides a facility
|
||||
that can be used to integrate format strings and a variable number of
|
||||
arguments into custom functions in a much simpler way than the varargs
|
||||
mechanism of the C library. Finally, {fmt} has been included into the
|
||||
C++20 language standard as ``std::format()``, so changes to adopt it are
|
||||
future-proof, for as long as they are not using any extensions that are
|
||||
not (yet) included into C++.
|
||||
|
||||
The long-term plan is to switch to using ``std::format()`` instead of
|
||||
``fmt::format()`` when the minimum C++ standard required for LAMMPS will
|
||||
be set to C++20. See the :ref:`basic build instructions <compile>` for
|
||||
more details.
|
||||
|
||||
Formatted strings are frequently created by calling the
|
||||
``fmt::format()`` function, which will return a string as a
|
||||
@ -319,11 +326,13 @@ Formatted strings are frequently created by calling the
|
||||
``printf()``, the {fmt} library uses ``{}`` to embed format descriptors.
|
||||
In the simplest case, no additional characters are needed, as {fmt} will
|
||||
choose the default format based on the data type of the argument.
|
||||
Otherwise, the ``fmt::print()`` function may be used instead of
|
||||
``printf()`` or ``fprintf()``. In addition, several LAMMPS output
|
||||
functions, that originally accepted a single string as argument have
|
||||
been overloaded to accept a format string with optional arguments as
|
||||
well (e.g., ``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
|
||||
Otherwise, the :cpp:func:`utils::print() <LAMMPS_NS::utils::print>`
|
||||
function may be used instead of ``printf()`` or ``fprintf()``. In
|
||||
addition, several LAMMPS output functions, that originally accepted a
|
||||
single string as argument have been overloaded to accept a format string
|
||||
with optional arguments as well (e.g., ``Error::all()``,
|
||||
``Error::one()``, :cpp:func:`utils::logmesg()
|
||||
<LAMMPS_NS::utils::logmesg>`).
|
||||
|
||||
Summary of the {fmt} format syntax
|
||||
==================================
|
||||
|
||||
@ -79,19 +79,19 @@ containing ``double`` values. To correctly store integers that may be
|
||||
64-bit (bigint, tagint, imageint) in the buffer, you need to use the
|
||||
:ref:`ubuf union <communication_buffer_coding_with_ubuf>` construct.
|
||||
|
||||
The *Fix*, *Compute*, and *Dump* classes can also invoke the same kind
|
||||
of forward and reverse communication operations using the same *Comm*
|
||||
class methods. Likewise, the same pack/unpack methods and
|
||||
The *Fix*, *Bond*, *Compute*, and *Dump* classes can also invoke the
|
||||
same kind of forward and reverse communication operations using the
|
||||
same *Comm* class methods. Likewise, the same pack/unpack methods and
|
||||
comm_forward/comm_reverse variables must be defined by the calling
|
||||
*Fix*, *Compute*, or *Dump* class.
|
||||
*Fix*, *Bond*, *Compute*, or *Dump* class.
|
||||
|
||||
For *Fix* classes, there is an optional second argument to the
|
||||
For all of these classes, there is an optional second argument to the
|
||||
*forward_comm()* and *reverse_comm()* call which can be used when the
|
||||
fix performs multiple modes of communication, with different numbers
|
||||
of values per atom. The fix should set the *comm_forward* and
|
||||
class performs multiple modes of communication, with different numbers
|
||||
of values per atom. The class should set the *comm_forward* and
|
||||
*comm_reverse* variables to the maximum value, but can invoke the
|
||||
communication for a particular mode with a smaller value. For this
|
||||
to work, the *pack_forward_comm()*, etc methods typically use a class
|
||||
to work, the *pack_forward_comm()*, etc. methods typically use a class
|
||||
member variable to choose which values to pack/unpack into/from the
|
||||
buffer.
|
||||
|
||||
|
||||
@ -209,7 +209,7 @@ nve, nvt, npt.
|
||||
|
||||
At the end of the timestep, fixes that contain an ``end_of_step()``
|
||||
method are invoked. These typically perform a diagnostic calculation,
|
||||
e.g. the ave/time and ave/spatial fixes. The final operation of the
|
||||
e.g. the ave/time and ave/chunk fixes. The final operation of the
|
||||
timestep is to perform any requested output, via the ``write()`` method
|
||||
of the Output class. There are 3 kinds of LAMMPS output: thermodynamic
|
||||
output to the screen and log file, snapshots of atom data to a dump
|
||||
|
||||
@ -7,13 +7,7 @@ typically document what a variable stores, what a small section of
|
||||
code does, or what a function does and its input/outputs. The topics
|
||||
on this page are intended to document code functionality at a higher level.
|
||||
|
||||
Available topics are:
|
||||
|
||||
- `Reading and parsing of text and text files`_
|
||||
- `Requesting and accessing neighbor lists`_
|
||||
- `Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM`_
|
||||
- `Fix contributions to instantaneous energy, virial, and cumulative energy`_
|
||||
- `KSpace PPPM FFT grids`_
|
||||
.. contents::
|
||||
|
||||
----
|
||||
|
||||
@ -218,6 +212,149 @@ command:
|
||||
|
||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||
|
||||
|
||||
Errors, warnings, and informational messages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS has specialized functionality to handle errors (which should
|
||||
terminate LAMMPS), warning messages (which should indicate possible
|
||||
problems *without* terminating LAMMPS), and informational text for
|
||||
messages about the progress and chosen settings. We *strongly*
|
||||
encourage using these facilities and to *stay away* from using
|
||||
``printf()`` or ``fprintf()`` or ``std::cout`` or ``std::cerr`` and
|
||||
calling ``MPI_Abort()`` or ``exit()`` directly. Warnings and
|
||||
informational messages should be printed only on MPI rank 0 to avoid
|
||||
flooding the output when running in parallel with many MPI processes.
|
||||
|
||||
**Errors**
|
||||
|
||||
When LAMMPS encounters an error, for example a syntax error in the
|
||||
input, then a suitable error message should be printed giving a brief,
|
||||
one line remark about the reason and then call either ``Error::all()``
|
||||
or ``Error::one()``. ``Error::all()`` must be called when the failing
|
||||
code path is executed by *all* MPI processes and the error condition
|
||||
will appear for *all* MPI processes the same. If desired, each MPI
|
||||
process may set a flag to either 0 or 1 and then MPI_Allreduce()
|
||||
searching for the maximum can be used to determine if there was an error
|
||||
on *any* of the MPI processes and make this information available to
|
||||
*all*. ``Error::one()`` in contrast needs to be called when only one or
|
||||
a few MPI processes execute the code path or can have the error
|
||||
condition. ``Error::all()`` is generally the preferred option.
|
||||
|
||||
Calling these functions does not abort LAMMPS directly, but rather
|
||||
throws either a ``LAMMPSException`` (from ``Error::all()``) or a
|
||||
``LAMMPSAbortException`` (from ``Error::one()``). These exceptions are
|
||||
caught by the LAMMPS ``main()`` program and then handled accordingly.
|
||||
The reason for this approach is to support applications, especially
|
||||
graphical applications like :ref:`LAMMPS-GUI <lammps_gui>`, that are
|
||||
linked to the LAMMPS library and have a mechanism to avoid that an error
|
||||
in LAMMPS terminates the application. By catching the exceptions, the
|
||||
application can delete the failing LAMMPS class instance and create a
|
||||
new one to try again. In a similar fashion, the :doc:`LAMMPS Python
|
||||
module <Python_module>` checks for this and then re-throws corresponding
|
||||
Python exception, which in turn can be caught by the calling Python
|
||||
code.
|
||||
|
||||
There are multiple "signatures" that can be called:
|
||||
|
||||
- ``Error::all(FLERR, "Error message")``: this will abort LAMMPS with
|
||||
the error message "Error message", followed by the last line of input
|
||||
that was read and processed before the error condition happened.
|
||||
|
||||
- ``Error::all(FLERR, Error::NOLASTLINE, "Error message")``: this is the
|
||||
same as before but without the last line of input. This is preferred
|
||||
for errors that would happen *during* a :doc:`run <run>` or
|
||||
:doc:`minimization <minimize>`, since showing the "run" or "minimize"
|
||||
command would be the last line, but is unrelated to the error.
|
||||
|
||||
- ``Error::all(FLERR, idx, "Error message")``: this is for argument
|
||||
parsing where "idx" is the index (starting at 0) of the argument for a
|
||||
LAMMPS command that is causing the failure (use -1 for the command
|
||||
itself). For index 0, you need to use the constant ``Error::ARGZERO``
|
||||
to work around the inability of some compilers to disambiguate between
|
||||
a NULL pointer and an integer constant 0, even with an added type cast.
|
||||
The output may also include the last input line *before* and
|
||||
*after*, if they differ due to substituting variables. A textual
|
||||
indicator is pointing to the specific word that failed. Using the
|
||||
constant ``Error::NOPOINTER`` in place of the *idx* argument will
|
||||
suppress the marker and then the behavior is like the *idx* argument
|
||||
is not provided.
|
||||
|
||||
FLERR is a macro containing the filename and line where the Error class
|
||||
is called and that information is appended to the error message. This
|
||||
allows to quickly find the relevant source code causing the error. For
|
||||
all three signatures, the single string "Error message" may be replaced
|
||||
with a format string using '{}' placeholders and followed by a variable
|
||||
number of arguments, one for each placeholder. This format string and
|
||||
the arguments are then handed for formatting to the `{fmt} library
|
||||
<https://fmt.dev>`_ (which is bundled with LAMMPS) and thus allow
|
||||
processing similar to the "format()" functionality in Python.
|
||||
|
||||
.. note::
|
||||
|
||||
For commands like :doc:`fix ave/time <fix_ave_time>` that accept
|
||||
wildcard arguments, the :cpp:func:`utils::expand_args` function
|
||||
may be passed as an optional argument where the function will provide
|
||||
a map to the original arguments from the expanded argument indices.
|
||||
|
||||
For complex errors, that can have multiple causes and which cannot be
|
||||
explained in a single line, you can append to the error message, the
|
||||
string created by :cpp:func:`utils::errorurl`, which then provides a
|
||||
URL pointing to a paragraph of the :doc:`Errors_details` that
|
||||
corresponds to the number provided. Example:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
error->all(FLERR, "Unknown identifier in data file: {}{}", keyword, utils::errorurl(1));
|
||||
|
||||
This will output something like this:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Unknown identifier in data file: Massess
|
||||
For more information see https://docs.lammps.org/err0001 (src/read_data.cpp:1482)
|
||||
Last input line: read_data data.peptide
|
||||
|
||||
Where the URL points to the first paragraph with explanations on
|
||||
the :doc:`Errors_details` page in the manual.
|
||||
|
||||
**Warnings**
|
||||
|
||||
To print warnings, the ``Errors::warning()`` function should be used.
|
||||
It also requires the FLERR macros as first argument to easily identify
|
||||
the location of the warning in the source code. Same as with the error
|
||||
functions above, the function has two variants: one just taking a single
|
||||
string as final argument and a second that uses the `{fmt} library
|
||||
<https://fmt.dev>`_ to make it similar to, say, ``fprintf()``. One
|
||||
motivation to use this function is that it will output warnings with
|
||||
always the same capitalization of the leading "WARNING" string. A
|
||||
second is that it has a built in rate limiter. After a given number (by
|
||||
default 100), that can be set via the :doc:`thermo_modify command
|
||||
<thermo_modify>` no more warnings are printed. Also, warnings are
|
||||
written consistently to both screen and logfile or not, depending on the
|
||||
settings for :ref:`screen <screen>` or :doc:`logfile <log>` output.
|
||||
|
||||
.. note::
|
||||
|
||||
Unlike ``Error::all()``, the warning function will produce output on
|
||||
*every* MPI process, so it typically would be prefixed with an if
|
||||
statement testing for ``comm->me == 0``, i.e. limiting output to MPI
|
||||
rank 0.
|
||||
|
||||
**Informational messages**
|
||||
|
||||
Finally, for informational message LAMMPS has the
|
||||
:cpp:func:`utils::logmesg() convenience function
|
||||
<LAMMPS_NS::utils::logmesg>`. It also uses the `{fmt} library
|
||||
<https://fmt.dev>`_ to support using a format string followed by a
|
||||
matching number of arguments. It will output the resulting formatted
|
||||
text to both, the screen and the logfile and will honor the
|
||||
corresponding settings about whether this output is active and to which
|
||||
file it should be send. Same as for ``Error::warning()``, it would
|
||||
produce output for every MPI process and thus should usually be called
|
||||
only on MPI rank 0 to avoid flooding the output when running with many
|
||||
parallel processes.
|
||||
|
||||
Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -94,12 +94,12 @@ represents what is generally referred to as an "instance of LAMMPS". It
|
||||
is a composite holding pointers to instances of other core classes
|
||||
providing the core functionality of the MD engine in LAMMPS and through
|
||||
them abstractions of the required operations. The constructor of the
|
||||
LAMMPS class will instantiate those instances, process the command line
|
||||
LAMMPS class will instantiate those instances, process the command-line
|
||||
flags, initialize MPI (if not already done) and set up file pointers for
|
||||
input and output. The destructor will shut everything down and free all
|
||||
associated memory. Thus code for the standalone LAMMPS executable in
|
||||
``main.cpp`` simply initializes MPI, instantiates a single instance of
|
||||
LAMMPS while passing it the command line flags and input script. It
|
||||
LAMMPS while passing it the command-line flags and input script. It
|
||||
deletes the LAMMPS instance after the method reading the input returns
|
||||
and shuts down the MPI environment before it exits the executable.
|
||||
|
||||
|
||||
@ -227,12 +227,12 @@ Tests for the C-style library interface
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Tests for validating the LAMMPS C-style library interface are in the
|
||||
``unittest/c-library`` folder. They are implemented either to be used
|
||||
for utility functions or for LAMMPS commands, but use the functions
|
||||
implemented in the ``src/library.cpp`` file as much as possible. There
|
||||
may be some overlap with other tests, but only in as much as is required
|
||||
to test the C-style library API. The tests are distributed over
|
||||
multiple test programs which try to match the grouping of the
|
||||
``unittest/c-library`` folder. They text either utility functions or
|
||||
LAMMPS commands, but use the functions implemented in
|
||||
``src/library.cpp`` as much as possible. There may be some overlap with
|
||||
other tests as far as the LAMMPS functionality is concerned, but the
|
||||
focus is on testing the C-style library API. The tests are distributed
|
||||
over multiple test programs which try to match the grouping of the
|
||||
functions in the source code and :ref:`in the manual <lammps_c_api>`.
|
||||
|
||||
This group of tests also includes tests invoking LAMMPS in parallel
|
||||
@ -258,7 +258,7 @@ Tests for the Python module and package
|
||||
|
||||
The ``unittest/python`` folder contains primarily tests for classes and
|
||||
functions in the LAMMPS python module but also for commands in the
|
||||
PYTHON package. These tests are only enabled if the necessary
|
||||
PYTHON package. These tests are only enabled, if the necessary
|
||||
prerequisites are detected or enabled during configuration and
|
||||
compilation of LAMMPS (shared library build enabled, Python interpreter
|
||||
found, Python development files found).
|
||||
@ -272,29 +272,30 @@ Tests for the Fortran interface
|
||||
|
||||
Tests for using the Fortran module are in the ``unittest/fortran``
|
||||
folder. Since they are also using the GoogleTest library, they require
|
||||
implementing test wrappers in C++ that will call fortran functions
|
||||
which provide a C function interface through ISO_C_BINDINGS that will in
|
||||
turn call the functions in the LAMMPS Fortran module.
|
||||
test wrappers written in C++ that will call fortran functions with a C
|
||||
function interface through ISO_C_BINDINGS which will in turn call the
|
||||
functions in the LAMMPS Fortran module.
|
||||
|
||||
Tests for the C++-style library interface
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The tests in the ``unittest/cplusplus`` folder are somewhat similar to
|
||||
the tests for the C-style library interface, but do not need to test the
|
||||
several convenience and utility functions that are only available through
|
||||
the C-style interface. Instead it can focus on the more generic features
|
||||
that are used internally. This part of the unit tests is currently still
|
||||
mostly in the planning stage.
|
||||
convenience and utility functions that are only available through the
|
||||
C-style library interface. Instead they focus on the more generic
|
||||
features that are used in LAMMPS internally. This part of the unit
|
||||
tests is currently still mostly in the planning stage.
|
||||
|
||||
Tests for reading and writing file formats
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``unittest/formats`` folder contains test programs for reading and
|
||||
writing files like data files, restart files, potential files or dump files.
|
||||
This covers simple things like the file i/o convenience functions in the
|
||||
``utils::`` namespace to complex tests of atom styles where creating and
|
||||
deleting atoms with different properties is tested in different ways
|
||||
and through script commands or reading and writing of data or restart files.
|
||||
writing files like data files, restart files, potential files or dump
|
||||
files. This covers simple things like the file i/o convenience
|
||||
functions in the ``utils::`` namespace to complex tests of atom styles
|
||||
where creating and deleting of atoms with different properties is tested
|
||||
in different ways and through script commands or reading and writing of
|
||||
data or restart files.
|
||||
|
||||
Tests for styles computing or modifying forces
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -443,7 +444,7 @@ file for a style that is similar to one to be tested. The file name should
|
||||
follow the naming conventions described above and after copying the file,
|
||||
the first step is to replace the style names where needed. The coefficient
|
||||
values do not have to be meaningful, just in a reasonable range for the
|
||||
given system. It does not matter if some forces are large, as long as
|
||||
given system. It does not matter if some forces are large, for as long as
|
||||
they do not diverge.
|
||||
|
||||
The template input files define a large number of index variables at the top
|
||||
@ -476,7 +477,7 @@ the tabulated coulomb, to test both code paths. The reference results in the YA
|
||||
files then should be compared manually, if they agree well enough within the limits
|
||||
of those two approximations.
|
||||
|
||||
The ``test_pair_style`` and equivalent programs have special command line options
|
||||
The ``test_pair_style`` and equivalent programs have special command-line options
|
||||
to update the YAML files. Running a command like
|
||||
|
||||
.. code-block:: bash
|
||||
@ -531,19 +532,20 @@ Python module.
|
||||
Troubleshooting failed unit tests
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The are by default no unit tests for newly added features (e.g. pair, fix,
|
||||
or compute styles) unless your pull request also includes tests for the
|
||||
added features. If you are modifying some features, you may see failures
|
||||
for existing tests, if your modifications have some unexpected side effects
|
||||
or your changes render the existing test invalid. If you are adding an
|
||||
accelerated version of an existing style, then only tests for INTEL,
|
||||
KOKKOS (with OpenMP only), OPENMP, and OPT will be run automatically.
|
||||
Tests for the GPU package are time consuming and thus are only run
|
||||
*after* a merge, or when a special label, ``gpu_unit_tests`` is added
|
||||
to the pull request. After the test has started, it is often best to
|
||||
remove the label since every PR activity will re-trigger the test (that
|
||||
is a limitation of triggering a test with a label). Support for unit
|
||||
tests when using KOKKOS with GPU acceleration is currently not supported.
|
||||
There are by default no unit tests for newly added features (e.g. pair,
|
||||
fix, or compute styles) unless your pull request also includes tests for
|
||||
these added features. If you are modifying some existing LAMMPS
|
||||
features, you may see failures for existing tests, if your modifications
|
||||
have some unexpected side effects or your changes render the existing
|
||||
test invalid. If you are adding an accelerated version of an existing
|
||||
style, then only tests for INTEL, KOKKOS (with OpenMP only), OPENMP, and
|
||||
OPT will be run automatically. Tests for the GPU package are time
|
||||
consuming and thus are only run *after* a merge, or when a special
|
||||
label, ``gpu_unit_tests`` is added to the pull request. After the test
|
||||
has started, it is often best to remove the label since every PR
|
||||
activity will re-trigger the test (that is a limitation of triggering a
|
||||
test with a label). Support for unit tests using KOKKOS with GPU
|
||||
acceleration is currently not supported.
|
||||
|
||||
When you see a failed build on GitHub, click on ``Details`` to be taken
|
||||
to the corresponding LAMMPS Jenkins CI web page. Click on the "Exit"
|
||||
@ -588,7 +590,7 @@ While the epsilon (relative precision) for a single, `IEEE 754 compliant
|
||||
<https://en.wikipedia.org/wiki/IEEE_754>`_, double precision floating
|
||||
point operation is at about 2.2e-16, the achievable precision for the
|
||||
tests is lower due to most numbers being sums over intermediate results
|
||||
and the non-associativity of floating point math leading to larger
|
||||
for which the non-associativity of floating point math leads to larger
|
||||
errors. As a rule of thumb, the test epsilon can often be in the range
|
||||
5.0e-14 to 1.0e-13. But for "noisy" force kernels, e.g. those a larger
|
||||
amount of arithmetic operations involving `exp()`, `log()` or `sin()`
|
||||
@ -602,14 +604,14 @@ of floating point operations or that some or most intermediate operations
|
||||
may be done using approximations or with single precision floating point
|
||||
math.
|
||||
|
||||
To rerun the failed unit test individually, change to the ``build`` directory
|
||||
To rerun a failed unit test individually, change to the ``build`` directory
|
||||
and run the test with verbose output. For example,
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
env TEST_ARGS=-v ctest -R ^MolPairStyle:lj_cut_coul_long -V
|
||||
|
||||
``ctest`` with the ``-V`` flag also shows the exact command line
|
||||
``ctest`` with the ``-V`` flag also shows the exact command
|
||||
of the test. One can then use ``gdb --args`` to further debug and
|
||||
catch exceptions with the test command, for example,
|
||||
|
||||
|
||||
@ -133,6 +133,9 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: trim_comment
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strcompress
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strip_style_suffix
|
||||
:project: progguide
|
||||
|
||||
@ -166,6 +169,9 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: split_lines
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strsame
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strmatch
|
||||
:project: progguide
|
||||
|
||||
@ -232,12 +238,21 @@ Convenience functions
|
||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: print(FILE *fp, const std::string &format, Args&&... args)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: print(FILE *fp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: errorurl
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: missing_cmd_args
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: point_to_error
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: flush_buffers(LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -96,8 +96,8 @@ Here the we specify which methods of the fix should be called during
|
||||
MPI_Allreduce(localAvgVel, globalAvgVel, 4, MPI_DOUBLE, MPI_SUM, world);
|
||||
scale3(1.0 / globalAvgVel[3], globalAvgVel);
|
||||
if ((comm->me == 0) && screen) {
|
||||
fmt::print(screen,"{}, {}, {}\n",
|
||||
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
|
||||
utils::print(screen, "{}, {}, {}\n",
|
||||
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ the constructor and the destructor.
|
||||
|
||||
Pair styles are different from most classes in LAMMPS that define a
|
||||
"style", as their constructor only uses the LAMMPS class instance
|
||||
pointer as an argument, but **not** the command line arguments of the
|
||||
pointer as an argument, but **not** the arguments of the
|
||||
:doc:`pair_style command <pair_style>`. Instead, those arguments are
|
||||
processed in the ``Pair::settings()`` function (or rather the version in
|
||||
the derived class). The constructor is the place where global defaults
|
||||
@ -891,7 +891,7 @@ originally created from mixing or not).
|
||||
These data file output functions are only useful for true pair-wise
|
||||
additive potentials, where the potential parameters can be entered
|
||||
through *multiple* :doc:`pair_coeff commands <pair_coeff>`. Pair styles
|
||||
that require a single "pair_coeff \* \*" command line are not compatible
|
||||
that require a single "pair_coeff \* \*" command are not compatible
|
||||
with reading their parameters from data files. For pair styles like
|
||||
*born/gauss* that do support writing to data files, the potential
|
||||
parameters will be read from the data file, if present, and
|
||||
@ -1122,7 +1122,7 @@ once. Thus, the ``coeff()`` function has to do three tasks, each of
|
||||
which is delegated to a function in the ``PairTersoff`` class:
|
||||
|
||||
#. map elements to atom types. Those follow the potential file name in the
|
||||
command line arguments and are processed by the ``map_element2type()`` function.
|
||||
command arguments and are processed by the ``map_element2type()`` function.
|
||||
#. read and parse the potential parameter file in the ``read_file()`` function.
|
||||
#. Build data structures where the original and derived parameters are
|
||||
indexed by all possible triples of atom types and thus can be looked
|
||||
@ -1356,8 +1356,8 @@ either 0 or 1.
|
||||
|
||||
The ``morseflag`` variable defaults to 0 and is set to 1 in the
|
||||
``PairAIREBOMorse::settings()`` function which is called by the
|
||||
:doc:`pair_style <pair_style>` command. This function delegates
|
||||
all command line processing and setting of other parameters to the
|
||||
:doc:`pair_style <pair_style>` command. This function delegates all
|
||||
command argument processing and setting of other parameters to the
|
||||
``PairAIREBO::settings()`` function of the base class.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@ -83,7 +83,7 @@ Run LAMMPS from within the debugger
|
||||
Running LAMMPS under the control of the debugger as shown below only
|
||||
works for a single MPI rank (for debugging a program running in parallel
|
||||
you usually need a parallel debugger program). A simple way to launch
|
||||
GDB is to prefix the LAMMPS command line with ``gdb --args`` and then
|
||||
GDB is to prefix the LAMMPS command-line with ``gdb --args`` and then
|
||||
type the command "run" at the GDB prompt. This will launch the
|
||||
debugger, load the LAMMPS executable and its debug info, and then run
|
||||
it. When it reaches the code causing the segmentation fault, it will
|
||||
@ -180,7 +180,7 @@ inspect the behavior of a compiled program by essentially emulating a
|
||||
CPU and instrumenting the program while running. This slows down
|
||||
execution quite significantly, but can also report issues that are not
|
||||
resulting in a crash. The default valgrind tool is a memory checker and
|
||||
you can use it by prefixing the normal command line with ``valgrind``.
|
||||
you can use it by prefixing the normal command-line with ``valgrind``.
|
||||
Unlike GDB, this will also work for parallel execution, but it is
|
||||
recommended to redirect the valgrind output to a file (e.g. with
|
||||
``--log-file=crash-%p.txt``, the %p will be substituted with the
|
||||
@ -235,3 +235,53 @@ from GDB. In addition you get a more specific hint about what cause the
|
||||
segmentation fault, i.e. that it is a NULL pointer dereference. To find
|
||||
out which pointer exactly was NULL, you need to use the debugger, though.
|
||||
|
||||
Debugging when LAMMPS appears to be stuck
|
||||
=========================================
|
||||
|
||||
Sometimes the LAMMPS calculation appears to be stuck, that is the LAMMPS
|
||||
process or processes are active, but there is no visible progress. This
|
||||
can have multiple reasons:
|
||||
|
||||
- The selected styles are slow and require a lot of CPU time and the
|
||||
system is large. When extrapolating the expected speed from smaller
|
||||
systems, one has to factor in that not all models scale linearly with
|
||||
system size, e.g. :doc:`kspace styles like ewald or pppm
|
||||
<kspace_style>`. There is very little that can be done in this case.
|
||||
- The output interval is not set or set to a large value with the
|
||||
:doc:`thermo <thermo>` command. I the first case, there will be output
|
||||
only at the first and last step.
|
||||
- The output is block-buffered and instead of line-buffered. The output
|
||||
will only be written to the screen after 4096 or 8192 characters of
|
||||
output have accumulated. This most often happens for files but also
|
||||
with MPI parallel executables for output to the screen, since the
|
||||
output to the screen is handled by the MPI library so that output from
|
||||
all processes can be shown. This can be suppressed by using the
|
||||
``-nonblock`` or ``-nb`` command-line flag, which turns off buffering
|
||||
for screen and logfile output.
|
||||
- An MPI parallel calculation has a bug where a collective MPI function
|
||||
is called (e.g. ``MPI_Barrier()``, ``MPI_Bcast()``,
|
||||
``MPI_Allreduce()`` and so on) before pending point-to-point
|
||||
communications are completed or when the collective function is only
|
||||
called from a subset of the MPI processes. This also applies to some
|
||||
internal LAMMPS functions like ``Error::all()`` which uses
|
||||
``MPI_Barrier()`` and thus ``Error::one()`` must be called, if the
|
||||
error condition does not happen on all MPI processes simultaneously.
|
||||
- Some function in LAMMPS has a bug where a ``for`` or ``while`` loop
|
||||
does not trigger the exit condition and thus will loop forever. This
|
||||
can happen when the wrong variable is incremented or when one value in
|
||||
a comparison becomes ``NaN`` due to an overflow.
|
||||
|
||||
In the latter two cases, further information and stack traces (see above)
|
||||
can be obtain by attaching a debugger to a running process. For that the
|
||||
process ID (PID) is needed; this can be found on Linux machines with the
|
||||
``top``, ``htop``, ``ps``, or ``pstree`` commands.
|
||||
|
||||
Then running the (GNU) debugger ``gdb`` with the ``-p`` flag followed by
|
||||
the process id will attach the process to the debugger and stop
|
||||
execution of that specific process. From there on it is possible to
|
||||
issue all debugger commands in the same way as when LAMMPS was started
|
||||
from the debugger (see above). Most importantly it is possible to
|
||||
obtain a stack trace with the ``where`` command and thus determine where
|
||||
in the execution of a timestep this process is. Also internal data can
|
||||
be printed and execution single stepped or continued. When the debugger
|
||||
is exited, the calculation will resume normally.
|
||||
|
||||
@ -4,9 +4,172 @@ Error and warning details
|
||||
Many errors or warnings are self-explanatory and thus straightforward to
|
||||
resolve. However, there are also cases, where there is no single cause
|
||||
and explanation, where LAMMPS can only detect symptoms of an error but
|
||||
not the exact cause, or where the explanation needs to be more detailed than
|
||||
what can be fit into a message printed by the program. The following are
|
||||
discussions of such cases.
|
||||
not the exact cause, or where the explanation needs to be more detailed
|
||||
than what can be fit into a message printed by the program. The
|
||||
following are discussions of such cases.
|
||||
|
||||
- :ref:`Unknown identifier in data file <err0001>`
|
||||
- :ref:`Incorrect format in ... section of data file <err0002>`
|
||||
- :ref:`Illegal variable command: expected X arguments but found Y <err0003>`
|
||||
- :ref:`Out of range atoms - cannot compute ... <err0004>`
|
||||
- :ref:`Too many neighbor bins <err0009>`
|
||||
- :ref:`Cannot use neighbor bins - box size \<\< cutoff <err0015>`
|
||||
- :ref:`Domain too large for neighbor bins <err0017>`
|
||||
- :ref:`Molecule topology/atom exceeds system topology/atom <err0024>`
|
||||
- :ref:`Molecule topology type exceeds system topology type <err0025>`
|
||||
- :ref:`Molecule attributes do not match system attributes <err0026>`
|
||||
|
||||
------
|
||||
|
||||
General troubleshooting advice
|
||||
------------------------------
|
||||
|
||||
Below are suggestions that can help to understand the causes of problems
|
||||
with simulations leading to errors or unexpected results.
|
||||
|
||||
Create a small test system
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Debugging problems often requires running a simulation many times with
|
||||
small modifications, thus it can be a huge time saver to first assemble
|
||||
a small test system input that has the same issue, but will take much
|
||||
time until it triggers the error condition. Also, it will be easier to
|
||||
see what happens.
|
||||
|
||||
Visualize your trajectory
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To better understand what is causing problems, it is often very useful
|
||||
to visualize the system close to the point of failure. It may be
|
||||
necessary to have LAMMPS output trajectory frames rather frequently. To
|
||||
avoid gigantic files, you can use :doc:`dump_modify delay <dump_modify>`
|
||||
to delay output until the critical section is reached, and you can use a
|
||||
smaller test system (see above).
|
||||
|
||||
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,
|
||||
errors may be triggered faster with more processors and thus smaller
|
||||
sub-domains.
|
||||
|
||||
Fast moving atoms
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Fast moving atoms may be "lost" or "missing" when their velocity becomes
|
||||
so large that they can cross a sub-domain within one timestep. This
|
||||
often happens when atoms are too close, but atoms may also "move" too
|
||||
fast from sub-domain to sub-domain if the box changes rapidly, e.g. when
|
||||
setting a large an initial box with :doc:`shrink-wrap boundary
|
||||
conditions <boundary>` that collapses on the first step (in this case
|
||||
the solution is often using 'm' instead of 's' as boundary condition).
|
||||
|
||||
To reduce the impact of "close contacts", one can remove those atoms or
|
||||
molecules with something like :doc:`delete_atoms overlap 0.1 all all
|
||||
<delete_atoms>`. With periodic boundaries, a close contact pair of atoms
|
||||
may be on opposite sides of the simulation box. Another option would be
|
||||
to first run a minimization (aka quench) before starting the MD. Reducing
|
||||
the time step can also help. Many times, one just needs to "ease" the
|
||||
system into a balanced state and can then switch to more aggressive settings.
|
||||
|
||||
The speed of atoms during an MD depends on the steepness of the
|
||||
potential function and their mass. Since the positions and velocities
|
||||
of atoms are computed with finite timesteps, they choice of timestep can
|
||||
be too large for a stable numeric integration of the trajectory. In
|
||||
those cases using (temporarily) :doc:`fix nve/limit <fix_nve_limit>` or
|
||||
:doc:`fix dt/reset <fix_dt_reset>` can help to avoid too large updates
|
||||
or adapt the timestep according to the displacements.
|
||||
|
||||
|
||||
Pressure, forces, positions becoming NaN of Inf
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Some potentials can overflow or have a division by zero with close contacts
|
||||
or bad geometries (for the given force styles in use) leading to forces
|
||||
that can no longer be represented as numbers. Those will show as "NaN" or
|
||||
"Inf". On most machines, the program will continue, but there is no way
|
||||
to recover from it and those NaN or Inf values will propagate. So-called
|
||||
:doc:`"soft-core" potentials <pair_fep_soft>` or the :doc:`"soft" repulsive-only
|
||||
pair style <pair_soft>` are less prone for this behavior (depending on the
|
||||
settings in use) and can be used at the beginning of a simulation. Also,
|
||||
single precision numbers can overflow much faster, so for the GPU or INTEL
|
||||
package it may be beneficial to run with double precision initially before
|
||||
switching to mixed or single precision for faster execution when the system
|
||||
has relaxed.
|
||||
|
||||
Communication cutoff
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The communication cutoff determines the "overlap" between sub-domains
|
||||
and atoms in these regions are referred to in LAMMPS as "ghost atoms".
|
||||
This region has to be large enough to contain all atoms of a bond,
|
||||
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 be more than sufficient for all bonded
|
||||
interactions. But if the pair style cutoff is small this may bot be
|
||||
enough. LAMMPS will print a warning in this case using some heuristic
|
||||
based on the equilibrium bond length, but that 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.
|
||||
|
||||
Neighbor list settings
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Every time LAMMPS rebuilds the neighbor lists, LAMMPS will also check
|
||||
for "lost" or "missing" atoms. Thus it can help to use very
|
||||
conservative :doc:`neighbor list settings <neigh_modify>` and then
|
||||
examine the neighbor list statistics if the neighbor list rebuild can be
|
||||
safely delayed. Rebuilding the neighbor list less frequently
|
||||
(i.e. through increasing the *delay* or *every* setting has diminishing
|
||||
returns and increasing risks).
|
||||
|
||||
Ignoring lost atoms
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It is tempting to use the :doc:`thermo_modify lost ignore <thermo_modify>`
|
||||
to avoid that LAMMPS stops with an error. This setting should, however,
|
||||
*only* be used when atoms *should* leave the system. In general, ignoring
|
||||
a problem does not solve it.
|
||||
|
||||
Units
|
||||
^^^^^
|
||||
|
||||
A frequent cause for a variety of problems is due to using the wrong
|
||||
:doc:`units <units>` settings for a particular potentials, especially
|
||||
when reading them from a potential file. Most of the (example)
|
||||
potentials bundled with LAMMPS have a "UNITS:" tag that allows LAMMPS to
|
||||
check of the units are consistent with what is intended, but potential
|
||||
files from publications or potential parameter databases may lack this
|
||||
metadata information and thus will not error out or warn when using the
|
||||
wrong setting. Most potential files usually use "metal" units, but some
|
||||
are parameterized for other settings, most notably :doc:`ReaxFF
|
||||
potentials <pair_reaxff>` that use "real" units.
|
||||
|
||||
Also, individual parameters for :doc:`pair_coeff <pair_coeff>` commands
|
||||
taken from publications or other MD software, may need to be converted
|
||||
and sometimes in unexpected ways. Thus some careful checking is
|
||||
recommended.
|
||||
|
||||
No error message printed
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In some cases - especially when running in parallel with MPI - LAMMPS
|
||||
may stop without displaying an error. But that does not mean, that
|
||||
there was no error message, instead it is highly likely that the message
|
||||
was written to a buffer and LAMMPS was aborted before the buffer was
|
||||
output. Usually, output buffers are output for every line of output,
|
||||
but sometimes, this is delayed until 4096 or 8192 bytes of output have
|
||||
been accumulated. This buffering for screen and logfile output can be
|
||||
disabled by using the :ref:`-nb or -nonbuf <nonbuf>` command-line flag.
|
||||
This is most often needed when debugging crashing multi-replica
|
||||
calculations.
|
||||
|
||||
------
|
||||
|
||||
.. _err0001:
|
||||
|
||||
@ -54,3 +217,153 @@ header of a data file (e.g. the number of atoms) is larger than the
|
||||
number of lines provided (e.g. in the corresponding Atoms section)
|
||||
and then LAMMPS will continue reading into the next section and that
|
||||
would have a completely different format.
|
||||
|
||||
.. _err0003:
|
||||
|
||||
Illegal variable command: expected X arguments but found Y
|
||||
----------------------------------------------------------
|
||||
|
||||
This error indicates that there are the wrong number of arguments for a
|
||||
specific variable command, but a common reason for that is a variable
|
||||
expression that has whitespace but is not enclosed in single or double
|
||||
quotes.
|
||||
|
||||
To explain, the LAMMPS input parser reads and processes lines. The
|
||||
resulting line is broken down into "words". Those are usually
|
||||
individual commands, labels, names, values separated by whitespace (a
|
||||
space or tab character). For "words" that may contain whitespace, they
|
||||
have to be enclosed in single (') or double (") quotes. The parser will
|
||||
then remove the outermost pair of quotes and then pass that string as
|
||||
"word" to the variable command.
|
||||
|
||||
Thus missing quotes or accidental extra whitespace will lead to the
|
||||
error shown in the header because the unquoted whitespace will result
|
||||
in the text being broken into more "words", i.e. the variable expression
|
||||
being split.
|
||||
|
||||
.. _err0004:
|
||||
|
||||
Out of range atoms - cannot compute ...
|
||||
---------------------------------------
|
||||
|
||||
The PPPM (and also PPPMDisp and MSM) methods require to assemble a grid
|
||||
of electron density data derived from the (partial) charges assigned to
|
||||
the atoms. This charges are smeared out across multiple grid points
|
||||
(see :doc:`kspace_modify order <kspace_modify>`). When running in
|
||||
parallel with MPI, LAMMPS uses a :doc:`domain decomposition scheme
|
||||
<Developer_par_part>` where each processor manages a subset of atoms and
|
||||
thus also a grid representing the density, which covers the actual
|
||||
volume of the sub-domain and some extra space corresponding to the
|
||||
:doc:`neighbor list skin <neighbor>`. These are then :doc:`combined and
|
||||
redistributed <Developer_par_long>` for parallel processing of the
|
||||
long-range component of the Coulomb interaction.
|
||||
|
||||
The ``Out of range atoms`` error can happen, when atoms move too fast or
|
||||
the neighbor list skin is too small or the neighbor lists are not
|
||||
updated frequently enough. Then the smeared charges cannot be fully
|
||||
assigned to the density grid for all atoms. LAMMPS checks for this
|
||||
condition and stops with an error. Most of the time, this is an
|
||||
indication of a system with very high forces, most often at the
|
||||
beginning of a simulation or when boundary conditions are changed. The
|
||||
error becomes more likely with more MPI processes.
|
||||
|
||||
There are multiple options to explore for avoiding the error. The best
|
||||
choice depends strongly on the individual system, and often a
|
||||
combination of changes is required. For example, more conservative MD
|
||||
parameter settings can be used (larger neighbor skin, shorter time step,
|
||||
more frequent neighbor list updates). Sometimes, it helps to revisit
|
||||
the system generation and avoid close contacts when building it, or use
|
||||
the :doc:`delete_atoms overlap<delete_atoms>` command to delete those
|
||||
close contact atoms, or run a minimization before the MD. It can also
|
||||
help to temporarily use a cutoff-Coulomb pair style and no kspace style
|
||||
until the system has somewhat equilibrated and then switch to the
|
||||
long-range solver.
|
||||
|
||||
.. _err0009:
|
||||
|
||||
Too many neighbor bins
|
||||
----------------------
|
||||
|
||||
The simulation box has become too large relative to the size of a
|
||||
neighbor bin and LAMMPS is unable to store the needed number of
|
||||
bins. This typically implies the simulation box has expanded too far.
|
||||
This can happen when some atoms move rapidly apart with shrink-wrap
|
||||
boundaries or when a fix (like fix deform or a barostat) excessively
|
||||
grows the simulation box.
|
||||
|
||||
.. _err0015:
|
||||
|
||||
Cannot use neighbor bins - box size \<\< cutoff
|
||||
-----------------------------------------------
|
||||
|
||||
LAMMPS is unable to build neighbor bins since the size of the box is
|
||||
much smaller than an interaction cutoff in at least one of its dimensions.
|
||||
Typically, this error is triggered when the simulation box has one very
|
||||
thin dimension. If a cubic neighbor bin had to fit exactly within
|
||||
the thin dimension, then an inordinate amount of bins would be created to
|
||||
fill space. This error can be avoided using the generally slower
|
||||
:doc:`nsq neighbor style <neighbor>` or by increasing the size of the
|
||||
smallest box lengths.
|
||||
|
||||
.. _err0017:
|
||||
|
||||
Domain too large for neighbor bins
|
||||
----------------------------------
|
||||
|
||||
The domain has become extremely large so that neighbor bins cannot
|
||||
be used. Too many neighbor bins would need to be created to fill space
|
||||
Most likely, one or more atoms have been blown out of the simulation
|
||||
box to a great distance or a fix (like fix deform or a barostat) has
|
||||
excessively grown the simulation box.
|
||||
|
||||
.. _err0024:
|
||||
|
||||
Molecule topology/atom exceeds system topology/atom
|
||||
---------------------------------------------------
|
||||
|
||||
LAMMPS uses :doc:`domain decomposition <Developer_par_part>` to
|
||||
distribute data (i.e. atoms) across the MPI processes in parallel runs.
|
||||
This includes topology data, that is data about bonds, angles,
|
||||
dihedrals, impropers and :doc:`"special" neighbors <special_bonds>`.
|
||||
This information is stored with either one or all atoms involved in such
|
||||
a topology entry (which of the two option applies depends on the
|
||||
:doc:`newton <newton>` setting for bonds. When reading a data file,
|
||||
LAMMPS analyzes the requirements for this file and then the values
|
||||
are "locked in" and cannot be extended.
|
||||
|
||||
So loading a molecule file that requires more of the topology per atom
|
||||
storage or adding a data file with such needs will lead to an error. To
|
||||
avoid the error, one or more of the `extra/XXX/per/atom` keywords are
|
||||
required to extend the corresponding storage. It is no problem to
|
||||
choose those numbers generously and have more storage reserved than
|
||||
actually needed, but having these numbers set too small will lead to an
|
||||
error.
|
||||
|
||||
.. _err0025:
|
||||
|
||||
Molecule topology type exceeds system topology type
|
||||
---------------------------------------------------
|
||||
|
||||
The total number of atom, bond, angle, dihedral, and improper types is
|
||||
"locked in" when LAMMPS creates the simulation box. This can happen
|
||||
through either the :doc:`create_box <create_box>`, the :doc:`read_data
|
||||
<read_data>`, or the :doc:`read_restart <read_restart>` command. After
|
||||
this it is not possible to refer to an additional type. So loading a
|
||||
molecule file that uses additional types or adding a data file that
|
||||
would require additional types will lead to an error. To avoid the
|
||||
error, one or more of the `extra/XXX/types` keywords are required to
|
||||
extend the maximum number of the individual types.
|
||||
|
||||
.. _err0026:
|
||||
|
||||
Molecule attributes do not match system attributes
|
||||
--------------------------------------------------
|
||||
|
||||
Choosing an :doc:`atom_style <atom_style>` in LAMMPS determines which
|
||||
per-atom properties are available. In a :doc:`molecule file
|
||||
<molecule>`, however, it is possible to add sections (for example Masses
|
||||
or Charges) that are not supported by the atom style. Masses for
|
||||
example, are usually not a per-atom property, but defined through the
|
||||
atom type. Thus it would not be required to have a Masses section and
|
||||
the included data would be ignored. LAMMPS prints this warning to
|
||||
inform about this case.
|
||||
|
||||
@ -7774,7 +7774,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
*Too few values in body section of molecule file*
|
||||
Self-explanatory.
|
||||
|
||||
*Too many -pk arguments in command line*
|
||||
*Too many -pk arguments in command-line*
|
||||
The string formed by concatenating the arguments is too long. Use a
|
||||
package command in the input script instead.
|
||||
|
||||
|
||||
@ -146,6 +146,8 @@ Lowercase directories
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| streitz | use of Streitz/Mintmire potential with charge equilibration |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| stress_vcm | removing binned rigid body motion from binned stress profile |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| tad | temperature-accelerated dynamics of vacancy diffusion in bulk Si |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| threebody | regression test input for a variety of manybody potentials |
|
||||
|
||||
@ -16,7 +16,7 @@ compiled alongside the code using it from the source code in
|
||||
``fortran/lammps.f90`` *and* with the same compiler used to build the
|
||||
rest of the Fortran code that interfaces to LAMMPS. When linking, you
|
||||
also need to :doc:`link to the LAMMPS library <Build_link>`. A typical
|
||||
command line for a simple program using the Fortran interface would be:
|
||||
command for a simple program using the Fortran interface would be:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -91,12 +91,12 @@ function and triggered with the optional logical argument set to
|
||||
CALL lmp%close(.TRUE.)
|
||||
END PROGRAM testlib
|
||||
|
||||
It is also possible to pass command line flags from Fortran to C/C++ and
|
||||
It is also possible to pass command-line flags from Fortran to C/C++ and
|
||||
thus make the resulting executable behave similarly to the standalone
|
||||
executable (it will ignore the `-in/-i` flag, though). This allows
|
||||
using the command line to configure accelerator and suffix settings,
|
||||
using the command-line to configure accelerator and suffix settings,
|
||||
configure screen and logfile output, or to set index style variables
|
||||
from the command line and more. Here is a correspondingly adapted
|
||||
from the command-line and more. Here is a correspondingly adapted
|
||||
version of the previous example:
|
||||
|
||||
.. code-block:: fortran
|
||||
@ -108,7 +108,7 @@ version of the previous example:
|
||||
CHARACTER(LEN=128), ALLOCATABLE :: command_args(:)
|
||||
INTEGER :: i, argc
|
||||
|
||||
! copy command line flags to `command_args()`
|
||||
! copy command-line flags to `command_args()`
|
||||
argc = COMMAND_ARGUMENT_COUNT()
|
||||
ALLOCATE(command_args(0:argc))
|
||||
DO i=0, argc
|
||||
@ -321,6 +321,14 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS.
|
||||
:ftype set_string_variable: subroutine
|
||||
:f set_internal_variable: :f:subr:`set_internal_variable`
|
||||
:ftype set_internal_variable: subroutine
|
||||
:f eval: :f:func:`eval`
|
||||
:ftype eval: function
|
||||
:f clearstep_compute: :f:subr:`clearstep_compute`
|
||||
:ftype clearstep_compute: subroutine
|
||||
:f addstep_compute: :f:subr:`addstep_compute`
|
||||
:ftype addstep_compute: subroutine
|
||||
:f addstep_compute_all: :f:subr:`addstep_compute_all`
|
||||
:ftype addstep_compute_all: subroutine
|
||||
:f gather_atoms: :f:subr:`gather_atoms`
|
||||
:ftype gather_atoms: subroutine
|
||||
:f gather_atoms_concat: :f:subr:`gather_atoms_concat`
|
||||
@ -448,7 +456,7 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS.
|
||||
compiled with MPI support, it will also initialize MPI, if it has
|
||||
not already been initialized before.
|
||||
|
||||
The *args* argument with the list of command line parameters is
|
||||
The *args* argument with the list of command-line parameters is
|
||||
optional and so it the *comm* argument with the MPI communicator.
|
||||
If *comm* is not provided, ``MPI_COMM_WORLD`` is assumed. For
|
||||
more details please see the documentation of :cpp:func:`lammps_open`.
|
||||
@ -954,6 +962,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
:f:func:`extract_atom` between runs.
|
||||
|
||||
.. admonition:: Array index order
|
||||
:class: tip
|
||||
|
||||
Two-dimensional arrays returned from :f:func:`extract_atom` will be
|
||||
**transposed** from equivalent arrays in C, and they will be indexed
|
||||
@ -1066,6 +1075,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
you based on data from the :cpp:class:`Compute` class.
|
||||
|
||||
.. admonition:: Array index order
|
||||
:class: tip
|
||||
|
||||
Two-dimensional arrays returned from :f:func:`extract_compute` will be
|
||||
**transposed** from equivalent arrays in C, and they will be indexed
|
||||
@ -1324,6 +1334,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
:rtype data: polymorphic
|
||||
|
||||
.. admonition:: Array index order
|
||||
:class: tip
|
||||
|
||||
Two-dimensional global, per-atom, or local array data from
|
||||
:f:func:`extract_fix` will be **transposed** from equivalent arrays in
|
||||
@ -1448,11 +1459,62 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
an internal-style variable, an error is generated.
|
||||
|
||||
:p character(len=*) name: name of the variable
|
||||
:p read(c_double) val: new value to assign to the variable
|
||||
:p real(c_double) val: new value to assign to the variable
|
||||
:to: :cpp:func:`lammps_set_internal_variable`
|
||||
|
||||
--------
|
||||
|
||||
.. f:function:: eval(expr)
|
||||
|
||||
This function is a wrapper around :cpp:func:`lammps_eval` that takes a
|
||||
LAMMPS equal style variable string, evaluates it and returns the resulting
|
||||
scalar value as a floating-point number.
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
:p character(len=\*) expr: string to be evaluated
|
||||
:to: :cpp:func:`lammps_eval`
|
||||
:r value [real(c_double)]: result of the evaluated string
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: clearstep_compute()
|
||||
|
||||
Clear whether a compute has been invoked
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
:to: :cpp:func:`lammps_clearstep_compute`
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: addstep_compute(nextstep)
|
||||
|
||||
Add timestep to list of future compute invocations
|
||||
if the compute has been invoked on the current timestep
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
overloaded for 32-bit and 64-bit integer arguments
|
||||
|
||||
:p integer(kind=8 or kind=4) nextstep: next timestep
|
||||
:to: :cpp:func:`lammps_addstep_compute`
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: addstep_compute_all(nextstep)
|
||||
|
||||
Add timestep to list of future compute invocations
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
overloaded for 32-bit and 64-bit integer arguments
|
||||
|
||||
:p integer(kind=8 or kind=4) nextstep: next timestep
|
||||
:to: :cpp:func:`lammps_addstep_compute_all`
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: gather_atoms(name, count, data)
|
||||
|
||||
This function calls :cpp:func:`lammps_gather_atoms` to gather the named
|
||||
|
||||
@ -103,6 +103,7 @@ Tutorials howto
|
||||
Howto_github
|
||||
Howto_lammps_gui
|
||||
Howto_moltemplate
|
||||
Howto_python
|
||||
Howto_pylammps
|
||||
Howto_wsl
|
||||
|
||||
|
||||
@ -10,20 +10,21 @@ and/or pressure (P) is specified by the user, and the thermostat or
|
||||
barostat attempts to equilibrate the system to the requested T and/or
|
||||
P.
|
||||
|
||||
Barostatting in LAMMPS is performed by :doc:`fixes <fix>`. Two
|
||||
Barostatting in LAMMPS is performed by :doc:`fixes <fix>`. Three
|
||||
barostatting methods are currently available: Nose-Hoover (npt and
|
||||
nph) and Berendsen:
|
||||
nph), Berendsen, and various linear controllers in deform/pressure:
|
||||
|
||||
* :doc:`fix npt <fix_nh>`
|
||||
* :doc:`fix npt/sphere <fix_npt_sphere>`
|
||||
* :doc:`fix npt/asphere <fix_npt_asphere>`
|
||||
* :doc:`fix nph <fix_nh>`
|
||||
* :doc:`fix press/berendsen <fix_press_berendsen>`
|
||||
* :doc:`fix deform/pressure <fix_deform_pressure>`
|
||||
|
||||
The :doc:`fix npt <fix_nh>` commands include a Nose-Hoover thermostat
|
||||
and barostat. :doc:`Fix nph <fix_nh>` is just a Nose/Hoover barostat;
|
||||
it does no thermostatting. Both :doc:`fix nph <fix_nh>` and :doc:`fix press/berendsen <fix_press_berendsen>` can be used in conjunction
|
||||
with any of the thermostatting fixes.
|
||||
it does no thermostatting. The fixes :doc:`nph <fix_nh>`, :doc:`press/berendsen <fix_press_berendsen>`, and :doc:`deform/pressure <fix_deform_pressure>`
|
||||
can be used in conjunction with any of the thermostatting fixes.
|
||||
|
||||
As with the :doc:`thermostats <Howto_thermostat>`, :doc:`fix npt <fix_nh>`
|
||||
and :doc:`fix nph <fix_nh>` only use translational motion of the
|
||||
@ -44,9 +45,9 @@ a temperature or pressure compute to a barostatting fix.
|
||||
.. note::
|
||||
|
||||
As with the thermostats, the Nose/Hoover methods (:doc:`fix npt <fix_nh>` and :doc:`fix nph <fix_nh>`) perform time integration.
|
||||
:doc:`Fix press/berendsen <fix_press_berendsen>` does NOT, so it should
|
||||
be used with one of the constant NVE fixes or with one of the NVT
|
||||
fixes.
|
||||
:doc:`Fix press/berendsen <fix_press_berendsen>` and :doc:`fix deform/pressure <fix_deform_pressure>`
|
||||
do NOT, so they should be used with one of the constant NVE fixes or with
|
||||
one of the NVT fixes.
|
||||
|
||||
Thermodynamic output, which can be setup via the
|
||||
:doc:`thermo_style <thermo_style>` command, often includes pressure
|
||||
|
||||
@ -56,7 +56,7 @@ using a shell like Bash or Zsh.
|
||||
Visual Studio IDE with the bundled CMake or from the Windows command prompt using
|
||||
a separately installed CMake package, both using the native Microsoft Visual C++
|
||||
compilers and (optionally) the Microsoft MPI SDK. This tutorial, however, only
|
||||
covers unix-like command line interfaces.
|
||||
covers unix-like command-line interfaces.
|
||||
|
||||
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
|
||||
or used Git to create a clone of the LAMMPS sources on your compilation machine.
|
||||
@ -277,7 +277,7 @@ Setting options
|
||||
---------------
|
||||
|
||||
Options that enable, disable or modify settings are modified by setting
|
||||
the value of CMake variables. This is done on the command line with the
|
||||
the value of CMake variables. This is done on the command-line with the
|
||||
*-D* flag in the format ``-D VARIABLE=value``, e.g. ``-D
|
||||
CMAKE_BUILD_TYPE=Release`` or ``-D BUILD_MPI=on``. There is one quirk:
|
||||
when used before the CMake directory, there may be a space between the
|
||||
@ -376,7 +376,7 @@ Using presets
|
||||
-------------
|
||||
|
||||
Since LAMMPS has a lot of optional features and packages, specifying
|
||||
them all on the command line can be tedious. Or when selecting a
|
||||
them all on the command-line can be tedious. Or when selecting a
|
||||
different compiler toolchain, multiple options have to be changed
|
||||
consistently and that is rather error prone. Or when enabling certain
|
||||
packages, they require consistent settings to be operated in a
|
||||
@ -384,7 +384,7 @@ particular mode. For this purpose, we are providing a selection of
|
||||
"preset files" for CMake in the folder ``cmake/presets``. They
|
||||
represent a way to pre-load or override the CMake configuration cache by
|
||||
setting or changing CMake variables. Preset files are loaded using the
|
||||
*-C* command line flag. You can combine loading multiple preset files or
|
||||
*-C* command-line flag. You can combine loading multiple preset files or
|
||||
change some variables later with additional *-D* flags. A few examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -163,7 +163,7 @@ After everything is done, add the files to the branch and commit them:
|
||||
*git rm*, *git mv* for adding, removing, renaming individual files,
|
||||
respectively, and then *git commit* to finalize the commit.
|
||||
Carefully check all pending changes with *git status* before
|
||||
committing them. If you find doing this on the command line too
|
||||
committing them. If you find doing this on the command-line too
|
||||
tedious, consider using a GUI, for example the one included in git
|
||||
distributions written in Tk, i.e. use *git gui* (on some Linux
|
||||
distributions it may be required to install an additional package to
|
||||
|
||||
@ -20,8 +20,11 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
||||
(Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big
|
||||
Sur or later), and Windows (version 10 or later) :ref:`are available
|
||||
<lammps_gui_install>` for download. Non-MPI LAMMPS executables (as
|
||||
``lmp``) for running LAMMPS from the command line and :doc:`some
|
||||
``lmp``) for running LAMMPS from the command-line and :doc:`some
|
||||
LAMMPS tools <Tools>` compiled executables are also included.
|
||||
Also, the pre-compiled LAMMPS-GUI packages include the WHAM executables
|
||||
from http://membrane.urmc.rochester.edu/content/wham/ for use with
|
||||
LAMMPS tutorials.
|
||||
|
||||
The source code for LAMMPS-GUI is included in the LAMMPS source code
|
||||
distribution and can be found in the ``tools/lammps-gui`` folder. It
|
||||
@ -29,16 +32,16 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
||||
<Build_cmake>`.
|
||||
|
||||
LAMMPS-GUI tries to provide an experience similar to what people
|
||||
traditionally would have running LAMMPS using a command line window and
|
||||
traditionally would have running LAMMPS using a command-line window and
|
||||
the console LAMMPS executable but just rolled into a single executable:
|
||||
|
||||
- writing & editing LAMMPS input files with a text editor
|
||||
- run LAMMPS on those input file with selected command line flags
|
||||
- run LAMMPS on those input file with selected command-line flags
|
||||
- extract data from the created files and visualize it with and
|
||||
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
|
||||
command-line, as that allows them to use 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.
|
||||
@ -61,13 +64,18 @@ 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.
|
||||
updated for use with LAMMPS-GUI and can their tutorial materials can
|
||||
be downloaded and loaded directly from the GUI.
|
||||
|
||||
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:
|
||||
|
||||
- auto-adapting to features available in the integrated LAMMPS library
|
||||
- auto-completion for LAMMPS commands and options
|
||||
- context-sensitive online help
|
||||
- start and stop of simulations via mouse or keyboard
|
||||
- monitoring of simulation progress
|
||||
- interactive visualization using the :doc:`dump image <dump_image>`
|
||||
command with the option to copy-paste the resulting settings
|
||||
- automatic slide show generation from dump image out at runtime
|
||||
@ -100,10 +108,11 @@ MacOS 11 and later
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
After downloading the ``LAMMPS-macOS-multiarch-GUI-<version>.dmg``
|
||||
installer package, you need to double-click it and then, in the window
|
||||
that opens, drag the app bundle as indicated into the "Applications"
|
||||
folder. The follow the instructions in the "README.txt" file to
|
||||
get access to the other included executables.
|
||||
application bundle disk image, you need to double-click it and then, in
|
||||
the window that opens, drag the app bundle as indicated into the
|
||||
"Applications" folder. Afterwards, the disk image can be unmounted.
|
||||
Then follow the instructions in the "README.txt" file to get access to
|
||||
the other included command-line executables.
|
||||
|
||||
Linux on x86\_64
|
||||
^^^^^^^^^^^^^^^^
|
||||
@ -117,15 +126,25 @@ into the "LAMMPS_GUI" folder and execute "./lammps-gui" directly.
|
||||
|
||||
The second variant uses `flatpak <https://www.flatpak.org>`_ and
|
||||
requires the flatpak management and runtime software to be installed.
|
||||
After downloading the ``LAMMPS-GUI-Linux-x86_64-GUI-<version>.tar.gz``
|
||||
After downloading the ``LAMMPS-GUI-Linux-x86_64-GUI-<version>.flatpak``
|
||||
flatpak bundle, you can install it with ``flatpak install --user
|
||||
LAMMPS-GUI-Linux-x86_64-GUI-<version>.tar.gz``. After installation,
|
||||
LAMMPS-GUI-Linux-x86_64-GUI-<version>.flatpak``. After installation,
|
||||
LAMMPS-GUI should be integrated into your desktop environment under
|
||||
"Applications > Science" but also can be launched from the console with
|
||||
``flatpak run org.lammps.lammps-gui``. The flatpak bundle also includes
|
||||
the console LAMMPS executable ``lmp`` which can be launched to run
|
||||
simulations with, for example: ``flatpak run --command=lmp
|
||||
org.lammps.lammps-gui -in in.melt``.
|
||||
simulations with, for example with:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
flatpak run --command=lmp org.lammps.lammps-gui -in in.melt
|
||||
|
||||
Other bundled command-line executables are run the same way and can be
|
||||
listed with:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
ls $(flatpak info --show-location org.lammps.lammps-gui )/files/bin
|
||||
|
||||
|
||||
Compiling from Source
|
||||
@ -165,9 +184,9 @@ window is stored when exiting and restored when starting again.
|
||||
Opening Files
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
The LAMMPS-GUI application can be launched without command line arguments
|
||||
The LAMMPS-GUI application can be launched without command-line arguments
|
||||
and then starts with an empty buffer in the *Editor* window. If arguments
|
||||
are given LAMMPS will use first command line argument as the file name for
|
||||
are given LAMMPS will use first command-line argument as the file name for
|
||||
the *Editor* buffer and reads its contents into the buffer, if the file
|
||||
exists. All further arguments are ignored. Files can also be opened via
|
||||
the *File* menu, the `Ctrl-O` (`Command-O` on macOS) keyboard shortcut
|
||||
@ -261,14 +280,21 @@ Output Window
|
||||
|
||||
By default, when starting a run, an *Output* window opens that displays
|
||||
the screen output of the running LAMMPS calculation, as shown below.
|
||||
This text would normally be seen in the command line window.
|
||||
This text would normally be seen in the command-line window.
|
||||
|
||||
.. image:: JPG/lammps-gui-log.png
|
||||
:align: center
|
||||
:scale: 50%
|
||||
|
||||
LAMMPS-GUI captures the screen output from LAMMPS as it is generated and
|
||||
updates the *Output* window regularly during a run.
|
||||
updates the *Output* window regularly during a run. If there are any
|
||||
warnings or errors in the LAMMPS output, they are highlighted by using
|
||||
bold text colored in red. There is a small panel at the bottom center
|
||||
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.
|
||||
|
||||
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
|
||||
@ -398,7 +424,7 @@ below.
|
||||
Like for the *Output* and *Charts* windows, its content is continuously
|
||||
updated during a run. It will show "(none)" if there are no variables
|
||||
defined. Note that it is also possible to *set* :doc:`index style
|
||||
variables <variable>`, that would normally be set via command line
|
||||
variables <variable>`, that would normally be set via command-line
|
||||
flags, via the "Set Variables..." dialog from the *Run* menu.
|
||||
LAMMPS-GUI automatically defines the variable "gui_run" to the current
|
||||
value of the run counter. That way it is possible to automatically
|
||||
@ -775,11 +801,11 @@ General Settings:
|
||||
|
||||
- *Echo input to log:* when checked, all input commands, including
|
||||
variable expansions, are echoed to the *Output* window. This is
|
||||
equivalent to using `-echo screen` at the command line. There is no
|
||||
equivalent to using `-echo screen` at the command-line. There is no
|
||||
log *file* produced by default, since LAMMPS-GUI uses `-log none`.
|
||||
- *Include citation details:* when checked full citation info will be
|
||||
included to the log window. This is equivalent to using `-cite
|
||||
screen` on the command line.
|
||||
screen` on the command-line.
|
||||
- *Show log window by default:* when checked, the screen output of a
|
||||
LAMMPS run will be collected in a log window during the run
|
||||
- *Show chart window by default:* when checked, the thermodynamic
|
||||
@ -828,7 +854,7 @@ 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
|
||||
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.
|
||||
|
||||
@ -738,8 +738,8 @@ command.
|
||||
|
||||
This can be done, for example, by using the built-in visualizer of the
|
||||
:doc:`dump image or dump movie <dump_image>` command to create snapshot
|
||||
images or a movie. Below are example command lines for using dump image
|
||||
with the :ref:`example listed below <periexample>` and a set of images
|
||||
images or a movie. Below are example command for using dump image with
|
||||
the :ref:`example listed below <periexample>` and a set of images
|
||||
created for steps 300, 600, and 2000 this way.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -1,564 +1,6 @@
|
||||
PyLammps Tutorial
|
||||
=================
|
||||
|
||||
.. contents::
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
:py:class:`PyLammps <lammps.PyLammps>` is a Python wrapper class for
|
||||
LAMMPS which can be created on its own or use an existing
|
||||
:py:class:`lammps Python <lammps.lammps>` object. It creates a simpler,
|
||||
more "pythonic" interface to common LAMMPS functionality, in contrast to
|
||||
the :py:class:`lammps <lammps.lammps>` wrapper for the LAMMPS :ref:`C
|
||||
language library interface API <lammps_c_api>` which is written using
|
||||
`Python ctypes <ctypes_>`_. The :py:class:`lammps <lammps.lammps>`
|
||||
wrapper is discussed on the :doc:`Python_head` doc page.
|
||||
|
||||
Unlike the flat `ctypes <ctypes_>`_ interface, PyLammps exposes a
|
||||
discoverable API. It no longer requires knowledge of the underlying C++
|
||||
code implementation. Finally, the :py:class:`IPyLammps
|
||||
<lammps.IPyLammps>` wrapper builds on top of :py:class:`PyLammps
|
||||
<lammps.PyLammps>` and adds some additional features for `IPython
|
||||
integration <ipython_>`_ into `Jupyter notebooks <jupyter_>`_, e.g. for
|
||||
embedded visualization output from :doc:`dump style image <dump_image>`.
|
||||
|
||||
.. _ctypes: https://docs.python.org/3/library/ctypes.html
|
||||
.. _ipython: https://ipython.org/
|
||||
.. _jupyter: https://jupyter.org/
|
||||
|
||||
Comparison of lammps and PyLammps interfaces
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
lammps.lammps
|
||||
"""""""""""""
|
||||
|
||||
* uses `ctypes <ctypes_>`_
|
||||
* direct memory access to native C++ data with optional support for NumPy arrays
|
||||
* provides functions to send and receive data to LAMMPS
|
||||
* interface modeled after the LAMMPS :ref:`C language library interface API <lammps_c_api>`
|
||||
* requires knowledge of how LAMMPS internally works (C pointers, etc)
|
||||
* full support for running Python with MPI using `mpi4py <https://mpi4py.readthedocs.io>`_
|
||||
* no overhead from creating a more Python-like interface
|
||||
|
||||
lammps.PyLammps
|
||||
"""""""""""""""
|
||||
|
||||
* higher-level abstraction built on *top* of the original :py:class:`ctypes based interface <lammps.lammps>`
|
||||
* manipulation of Python objects
|
||||
* communication with LAMMPS is hidden from API user
|
||||
* shorter, more concise Python
|
||||
* better IPython integration, designed for quick prototyping
|
||||
* designed for serial execution
|
||||
* additional overhead from capturing and parsing the LAMMPS screen output
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
System-wide Installation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Step 1: Building LAMMPS as a shared library
|
||||
"""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
To use LAMMPS inside of Python it has to be compiled as shared
|
||||
library. This library is then loaded by the Python interface. In this
|
||||
example we enable the MOLECULE package and compile LAMMPS with PNG, JPEG
|
||||
and FFMPEG output support enabled.
|
||||
|
||||
Step 1a: For the CMake based build system, the steps are:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mkdir $LAMMPS_DIR/build-shared
|
||||
cd $LAMMPS_DIR/build-shared
|
||||
|
||||
# MPI, PNG, Jpeg, FFMPEG are auto-detected
|
||||
cmake ../cmake -DPKG_MOLECULE=yes -DBUILD_LIB=yes -DBUILD_SHARED_LIBS=yes
|
||||
make
|
||||
|
||||
Step 1b: For the legacy, make based build system, the steps are:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd $LAMMPS_DIR/src
|
||||
|
||||
# add packages if necessary
|
||||
make yes-MOLECULE
|
||||
|
||||
# compile shared library using Makefile
|
||||
make mpi mode=shlib LMP_INC="-DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG" JPG_LIB="-lpng -ljpeg"
|
||||
|
||||
Step 2: Installing the LAMMPS Python package
|
||||
""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
PyLammps is part of the lammps Python package. To install it simply install
|
||||
that package into your current Python installation with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make install-python
|
||||
|
||||
.. note::
|
||||
|
||||
Recompiling the shared library requires re-installing the Python package
|
||||
|
||||
Installation inside of a virtualenv
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can use virtualenv to create a custom Python environment specifically tuned
|
||||
for your workflow.
|
||||
|
||||
Benefits of using a virtualenv
|
||||
""""""""""""""""""""""""""""""
|
||||
|
||||
* isolation of your system Python installation from your development installation
|
||||
* installation can happen in your user directory without root access (useful for HPC clusters)
|
||||
* installing packages through pip allows you to get newer versions of packages than e.g., through apt-get or yum package managers (and without root access)
|
||||
* you can even install specific old versions of a package if necessary
|
||||
|
||||
**Prerequisite (e.g. on Ubuntu)**
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
apt-get install python-virtualenv
|
||||
|
||||
Creating a virtualenv with lammps installed
|
||||
"""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# create virtualenv named 'testing'
|
||||
virtualenv $HOME/python/testing
|
||||
|
||||
# activate 'testing' environment
|
||||
source $HOME/python/testing/bin/activate
|
||||
|
||||
Now configure and compile the LAMMPS shared library as outlined above.
|
||||
When using CMake and the shared library has already been build, you
|
||||
need to re-run CMake to update the location of the python executable
|
||||
to the location in the virtual environment with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake . -DPython_EXECUTABLE=$(which python)
|
||||
|
||||
# install LAMMPS package in virtualenv
|
||||
(testing) make install-python
|
||||
|
||||
# install other useful packages
|
||||
(testing) pip install matplotlib jupyter mpi4py
|
||||
|
||||
...
|
||||
|
||||
# return to original shell
|
||||
(testing) deactivate
|
||||
|
||||
Creating a new instance of PyLammps
|
||||
-----------------------------------
|
||||
|
||||
To create a PyLammps object you need to first import the class from the lammps
|
||||
module. By using the default constructor, a new *lammps* instance is created.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import PyLammps
|
||||
L = PyLammps()
|
||||
|
||||
You can also initialize PyLammps on top of this existing *lammps* object:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps, PyLammps
|
||||
lmp = lammps()
|
||||
L = PyLammps(ptr=lmp)
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
Sending a LAMMPS command with the existing library interfaces is done using
|
||||
the command method of the lammps object instance.
|
||||
|
||||
For instance, let's take the following LAMMPS command:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
region box block 0 10 0 5 -0.5 0.5
|
||||
|
||||
In the original interface this command can be executed with the following
|
||||
Python code if *L* was a lammps instance:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.command("region box block 0 10 0 5 -0.5 0.5")
|
||||
|
||||
With the PyLammps interface, any command can be split up into arbitrary parts
|
||||
separated by white-space, passed as individual arguments to a region method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||
|
||||
Note that each parameter is set as Python literal floating-point number. In the
|
||||
PyLammps interface, each command takes an arbitrary parameter list and transparently
|
||||
merges it to a single command string, separating individual parameters by white-space.
|
||||
|
||||
The benefit of this approach is avoiding redundant command calls and easier
|
||||
parameterization. In the original interface parameterization needed to be done
|
||||
manually by creating formatted strings.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||
|
||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||
them automatically to a final command string.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||
|
||||
System state
|
||||
------------
|
||||
|
||||
In addition to dispatching commands directly through the PyLammps object, it
|
||||
also provides several properties which allow you to query the system state.
|
||||
|
||||
L.system
|
||||
Is a dictionary describing the system such as the bounding box or number of atoms
|
||||
|
||||
L.system.xlo, L.system.xhi
|
||||
bounding box limits along x-axis
|
||||
|
||||
L.system.ylo, L.system.yhi
|
||||
bounding box limits along y-axis
|
||||
|
||||
L.system.zlo, L.system.zhi
|
||||
bounding box limits along z-axis
|
||||
|
||||
L.communication
|
||||
configuration of communication subsystem, such as the number of threads or processors
|
||||
|
||||
L.communication.nthreads
|
||||
number of threads used by each LAMMPS process
|
||||
|
||||
L.communication.nprocs
|
||||
number of MPI processes used by LAMMPS
|
||||
|
||||
L.fixes
|
||||
List of fixes in the current system
|
||||
|
||||
L.computes
|
||||
List of active computes in the current system
|
||||
|
||||
L.dump
|
||||
List of active dumps in the current system
|
||||
|
||||
L.groups
|
||||
List of groups present in the current system
|
||||
|
||||
Working with LAMMPS variables
|
||||
-----------------------------
|
||||
|
||||
LAMMPS variables can be both defined and accessed via the PyLammps interface.
|
||||
|
||||
To define a variable you can use the :doc:`variable <variable>` command:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.variable("a index 2")
|
||||
|
||||
A dictionary of all variables is returned by L.variables
|
||||
|
||||
you can access an individual variable by retrieving a variable object from the
|
||||
L.variables dictionary by name
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
a = L.variables['a']
|
||||
|
||||
The variable value can then be easily read and written by accessing the value
|
||||
property of this object.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
print(a.value)
|
||||
a.value = 4
|
||||
|
||||
Retrieving the value of an arbitrary LAMMPS expressions
|
||||
-------------------------------------------------------
|
||||
|
||||
LAMMPS expressions can be immediately evaluated by using the eval method. The
|
||||
passed string parameter can be any expression containing global thermo values,
|
||||
variables, compute or fix data.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result = L.eval("ke") # kinetic energy
|
||||
result = L.eval("pe") # potential energy
|
||||
|
||||
result = L.eval("v_t/2.0")
|
||||
|
||||
Accessing atom data
|
||||
-------------------
|
||||
|
||||
All atoms in the current simulation can be accessed by using the L.atoms list.
|
||||
Each element of this list is an object which exposes its properties (id, type,
|
||||
position, velocity, force, etc.).
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# access first atom
|
||||
L.atoms[0].id
|
||||
L.atoms[0].type
|
||||
|
||||
# access second atom
|
||||
L.atoms[1].position
|
||||
L.atoms[1].velocity
|
||||
L.atoms[1].force
|
||||
|
||||
Some properties can also be used to set:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# set position in 2D simulation
|
||||
L.atoms[0].position = (1.0, 0.0)
|
||||
|
||||
# set position in 3D simulation
|
||||
L.atoms[0].position = (1.0, 0.0, 1.)
|
||||
|
||||
Evaluating thermo data
|
||||
----------------------
|
||||
|
||||
Each simulation run usually produces thermo output based on system state,
|
||||
computes, fixes or variables. The trajectories of these values can be queried
|
||||
after a run via the L.runs list. This list contains a growing list of run data.
|
||||
The first element is the output of the first run, the second element that of
|
||||
the second run.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.run(1000)
|
||||
L.runs[0] # data of first 1000 time steps
|
||||
|
||||
L.run(1000)
|
||||
L.runs[1] # data of second 1000 time steps
|
||||
|
||||
Each run contains a dictionary of all trajectories. Each trajectory is
|
||||
accessible through its thermo name:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.runs[0].thermo.Step # list of time steps in first run
|
||||
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
||||
|
||||
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import matplotlib.plot as plt
|
||||
steps = L.runs[0].thermo.Step
|
||||
ke = L.runs[0].thermo.Ke
|
||||
plt.plot(steps, ke)
|
||||
|
||||
Error handling with PyLammps
|
||||
----------------------------
|
||||
|
||||
Using C++ exceptions in LAMMPS for errors allows capturing them on the
|
||||
C++ side and rethrowing them on the Python side. This way you can handle
|
||||
LAMMPS errors through the Python exception handling mechanism.
|
||||
|
||||
.. warning::
|
||||
|
||||
Capturing a LAMMPS exception in Python can still mean that the
|
||||
current LAMMPS process is in an illegal state and must be
|
||||
terminated. It is advised to save your data and terminate the Python
|
||||
instance as quickly as possible.
|
||||
|
||||
Using PyLammps in IPython notebooks and Jupyter
|
||||
-----------------------------------------------
|
||||
|
||||
If the LAMMPS Python package is installed for the same Python interpreter as
|
||||
IPython, you can use PyLammps directly inside of an IPython notebook inside of
|
||||
Jupyter. Jupyter is a powerful integrated development environment (IDE) for
|
||||
many dynamic languages like Python, Julia and others, which operates inside of
|
||||
any web browser. Besides auto-completion and syntax highlighting it allows you
|
||||
to create formatted documents using Markup, mathematical formulas, graphics and
|
||||
animations intermixed with executable Python code. It is a great format for
|
||||
tutorials and showcasing your latest research.
|
||||
|
||||
To launch an instance of Jupyter simply run the following command inside your
|
||||
Python environment (this assumes you followed the Quick Start instructions):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
jupyter notebook
|
||||
|
||||
IPyLammps Examples
|
||||
------------------
|
||||
|
||||
Examples of IPython notebooks can be found in the python/examples/pylammps
|
||||
subdirectory. To open these notebooks launch *jupyter notebook* inside this
|
||||
directory and navigate to one of them. If you compiled and installed
|
||||
a LAMMPS shared library with exceptions, PNG, JPEG and FFMPEG support
|
||||
you should be able to rerun all of these notebooks.
|
||||
|
||||
Validating a dihedral potential
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This example showcases how an IPython Notebook can be used to compare a simple
|
||||
LAMMPS simulation of a harmonic dihedral potential to its analytical solution.
|
||||
Four atoms are placed in the simulation and the dihedral potential is applied on
|
||||
them using a datafile. Then one of the atoms is rotated along the central axis by
|
||||
setting its position from Python, which changes the dihedral angle.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
phi = [d \* math.pi / 180 for d in range(360)]
|
||||
|
||||
pos = [(1.0, math.cos(p), math.sin(p)) for p in phi]
|
||||
|
||||
pe = []
|
||||
for p in pos:
|
||||
L.atoms[3].position = p
|
||||
L.run(0)
|
||||
pe.append(L.eval("pe"))
|
||||
|
||||
By evaluating the potential energy for each position we can verify that
|
||||
trajectory with the analytical formula. To compare both solutions, we plot
|
||||
both trajectories over each other using matplotlib, which embeds the generated
|
||||
plot inside the IPython notebook.
|
||||
|
||||
.. image:: JPG/pylammps_dihedral.jpg
|
||||
:align: center
|
||||
|
||||
Running a Monte Carlo relaxation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This second example shows how to use PyLammps to create a 2D Monte Carlo Relaxation
|
||||
simulation, computing and plotting energy terms and even embedding video output.
|
||||
|
||||
Initially, a 2D system is created in a state with minimal energy.
|
||||
|
||||
.. image:: JPG/pylammps_mc_minimum.jpg
|
||||
:align: center
|
||||
|
||||
It is then disordered by moving each atom by a random delta.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
random.seed(27848)
|
||||
deltaperturb = 0.2
|
||||
|
||||
for i in range(L.system.natoms):
|
||||
x, y = L.atoms[i].position
|
||||
dx = deltaperturb \* random.uniform(-1, 1)
|
||||
dy = deltaperturb \* random.uniform(-1, 1)
|
||||
L.atoms[i].position = (x+dx, y+dy)
|
||||
|
||||
L.run(0)
|
||||
|
||||
.. image:: JPG/pylammps_mc_disordered.jpg
|
||||
:align: center
|
||||
|
||||
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
||||
moves random atoms by a random delta and only accepts certain moves.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
estart = L.eval("pe")
|
||||
elast = estart
|
||||
|
||||
naccept = 0
|
||||
energies = [estart]
|
||||
|
||||
niterations = 3000
|
||||
deltamove = 0.1
|
||||
kT = 0.05
|
||||
|
||||
natoms = L.system.natoms
|
||||
|
||||
for i in range(niterations):
|
||||
iatom = random.randrange(0, natoms)
|
||||
current_atom = L.atoms[iatom]
|
||||
|
||||
x0, y0 = current_atom.position
|
||||
|
||||
dx = deltamove \* random.uniform(-1, 1)
|
||||
dy = deltamove \* random.uniform(-1, 1)
|
||||
|
||||
current_atom.position = (x0+dx, y0+dy)
|
||||
|
||||
L.run(1, "pre no post no")
|
||||
|
||||
e = L.eval("pe")
|
||||
energies.append(e)
|
||||
|
||||
if e <= elast:
|
||||
naccept += 1
|
||||
elast = e
|
||||
elif random.random() <= math.exp(natoms\*(elast-e)/kT):
|
||||
naccept += 1
|
||||
elast = e
|
||||
else:
|
||||
current_atom.position = (x0, y0)
|
||||
|
||||
The energies of each iteration are collected in a Python list and finally plotted using matplotlib.
|
||||
|
||||
.. image:: JPG/pylammps_mc_energies_plot.jpg
|
||||
:align: center
|
||||
|
||||
The IPython notebook also shows how to use dump commands and embed video files
|
||||
inside of the IPython notebook.
|
||||
|
||||
Using PyLammps and mpi4py (Experimental)
|
||||
----------------------------------------
|
||||
|
||||
PyLammps can be run in parallel using `mpi4py
|
||||
<https://mpi4py.readthedocs.io>`_. This python package can be installed
|
||||
using
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install mpi4py
|
||||
|
||||
.. warning::
|
||||
|
||||
Usually, any :py:class:`PyLammps <lammps.PyLammps>` command must be
|
||||
executed by *all* MPI processes. However, evaluations and querying
|
||||
the system state is only available on MPI rank 0. Using these
|
||||
functions from other MPI ranks will raise an exception.
|
||||
|
||||
The following is a short example which reads in an existing LAMMPS input
|
||||
file and executes it in parallel. You can find in.melt in the
|
||||
examples/melt folder. Please take note that the
|
||||
:py:meth:`PyLammps.eval() <lammps.PyLammps.eval>` is called only from
|
||||
MPI rank 0.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from mpi4py import MPI
|
||||
from lammps import PyLammps
|
||||
|
||||
L = PyLammps()
|
||||
L.file("in.melt")
|
||||
|
||||
if MPI.COMM_WORLD.rank == 0:
|
||||
print("Potential energy: ", L.eval("pe"))
|
||||
|
||||
MPI.Finalize()
|
||||
|
||||
To run this script (melt.py) in parallel using 4 MPI processes we invoke the
|
||||
following mpirun command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mpirun -np 4 python melt.py
|
||||
|
||||
Feedback and Contributing
|
||||
-------------------------
|
||||
|
||||
If you find this Python interface useful, please feel free to provide feedback
|
||||
and ideas on how to improve it to Richard Berger (richard.berger@outlook.com). We also
|
||||
want to encourage people to write tutorial style IPython notebooks showcasing LAMMPS usage
|
||||
and maybe their latest research results.
|
||||
The PyLammps interface is deprecated and will be removed in a future release of
|
||||
LAMMPS. As such, the PyLammps version of this tutorial has been removed and is
|
||||
replaced by the :doc:`Python_head`.
|
||||
|
||||
441
doc/src/Howto_python.rst
Normal file
441
doc/src/Howto_python.rst
Normal file
@ -0,0 +1,441 @@
|
||||
LAMMPS Python Tutorial
|
||||
======================
|
||||
|
||||
.. contents::
|
||||
|
||||
-----
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The :py:class:`lammps <lammps.lammps>` Python module is a wrapper class for the
|
||||
LAMMPS :ref:`C language library interface API <lammps_c_api>` which is written using
|
||||
`Python ctypes <ctypes_>`_. The design choice of this wrapper class is to
|
||||
follow the C language API closely with only small changes related to Python
|
||||
specific requirements and to better accommodate object oriented programming.
|
||||
|
||||
In addition to this flat `ctypes <ctypes_>`_ interface, the
|
||||
:py:class:`lammps <lammps.lammps>` wrapper class exposes a discoverable
|
||||
API that doesn't require as much knowledge of the underlying C language
|
||||
library interface or LAMMPS C++ code implementation.
|
||||
|
||||
Finally, the API exposes some additional features for `IPython integration
|
||||
<ipython_>`_ into `Jupyter notebooks <jupyter_>`_, e.g. for embedded
|
||||
visualization output from :doc:`dump style image <dump_image>`.
|
||||
|
||||
.. _ctypes: https://docs.python.org/3/library/ctypes.html
|
||||
.. _ipython: https://ipython.org/
|
||||
.. _jupyter: https://jupyter.org/
|
||||
|
||||
-----
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
System-wide or User Installation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Step 1: Building LAMMPS as a shared library
|
||||
"""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
To use LAMMPS inside of Python it has to be compiled as shared library.
|
||||
This library is then loaded by the Python interface. In this example we
|
||||
enable the :ref:`MOLECULE package <PKG-MOLECULE>` and compile LAMMPS
|
||||
with :ref:`PNG, JPEG and FFMPEG output support <graphics>` enabled.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mkdir $LAMMPS_DIR/build-shared
|
||||
cd $LAMMPS_DIR/build-shared
|
||||
|
||||
# MPI, PNG, Jpeg, FFMPEG are auto-detected
|
||||
cmake ../cmake -DPKG_MOLECULE=yes -DPKG_PYTHON=on -DBUILD_SHARED_LIBS=yes
|
||||
make
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd $LAMMPS_DIR/src
|
||||
|
||||
# add packages if necessary
|
||||
make yes-MOLECULE
|
||||
make yes-PYTHON
|
||||
|
||||
# compile shared library using Makefile
|
||||
make mpi mode=shlib LMP_INC="-DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG" JPG_LIB="-lpng -ljpeg"
|
||||
|
||||
Step 2: Installing the LAMMPS Python package
|
||||
""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
Next install the LAMMPS Python package into your current Python installation with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make install-python
|
||||
|
||||
This will create a so-called `"wheel"
|
||||
<https://packaging.python.org/en/latest/discussions/package-formats/#what-is-a-wheel>`_
|
||||
and then install the LAMMPS Python module from that "wheel" into either
|
||||
into a system folder (provided the command is executed with root
|
||||
privileges) or into your personal Python module folder.
|
||||
|
||||
.. note::
|
||||
|
||||
Recompiling the shared library requires re-installing the Python
|
||||
package.
|
||||
|
||||
Installation inside of a virtual environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can use virtual environments to create a custom Python environment
|
||||
specifically tuned for your workflow.
|
||||
|
||||
Benefits of using a virtualenv
|
||||
""""""""""""""""""""""""""""""
|
||||
|
||||
* isolation of your system Python installation from your development installation
|
||||
* installation can happen in your user directory without root access (useful for HPC clusters)
|
||||
* installing packages through pip allows you to get newer versions of packages than e.g., through apt-get or yum package managers (and without root access)
|
||||
* you can even install specific old versions of a package if necessary
|
||||
|
||||
**Prerequisite (e.g. on Ubuntu)**
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
apt-get install python-venv
|
||||
|
||||
Creating a virtualenv with lammps installed
|
||||
"""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# create virtual envrionment named 'testing'
|
||||
python3 -m venv $HOME/python/testing
|
||||
|
||||
# activate 'testing' environment
|
||||
source $HOME/python/testing/bin/activate
|
||||
|
||||
Now configure and compile the LAMMPS shared library as outlined above.
|
||||
When using CMake and the shared library has already been build, you
|
||||
need to re-run CMake to update the location of the python executable
|
||||
to the location in the virtual environment with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake . -DPython_EXECUTABLE=$(which python)
|
||||
|
||||
# install LAMMPS package in virtualenv
|
||||
(testing) make install-python
|
||||
|
||||
# install other useful packages
|
||||
(testing) pip install matplotlib jupyter mpi4py pandas
|
||||
|
||||
...
|
||||
|
||||
# return to original shell
|
||||
(testing) deactivate
|
||||
|
||||
-------
|
||||
|
||||
Creating a new lammps instance
|
||||
------------------------------
|
||||
|
||||
To create a lammps object you need to first import the class from the lammps
|
||||
module. By using the default constructor, a new :py:class:`lammps
|
||||
<lammps.lammps>` instance is created.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps
|
||||
L = lammps()
|
||||
|
||||
See the :doc:`LAMMPS Python documentation <Python_create>` for how to customize
|
||||
the instance creation with optional arguments.
|
||||
|
||||
-----
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
Sending a LAMMPS command with the library interface is done using
|
||||
the ``command`` method of the lammps object.
|
||||
|
||||
For instance, let's take the following LAMMPS command:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
region box block 0 10 0 5 -0.5 0.5
|
||||
|
||||
This command can be executed with the following Python code if ``L`` is a ``lammps``
|
||||
instance:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.command("region box block 0 10 0 5 -0.5 0.5")
|
||||
|
||||
For convenience, the ``lammps`` class also provides a command wrapper ``cmd``
|
||||
that turns any LAMMPS command into a regular function call:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.cmd.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||
|
||||
Note that each parameter is set as Python number literal. With
|
||||
the wrapper each command takes an arbitrary parameter list and transparently
|
||||
merges it to a single command string, separating individual parameters by
|
||||
white-space.
|
||||
|
||||
The benefit of this approach is avoiding redundant command calls and easier
|
||||
parameterization. With the ``command`` function each call needs to be assembled
|
||||
manually using formatted strings.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.command(f"region box block {xlo} {xhi} {ylo} {yhi} {zlo} {zhi}")
|
||||
|
||||
The wrapper accepts parameters directly and will convert
|
||||
them automatically to a final command string.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.cmd.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||
|
||||
.. note::
|
||||
|
||||
When running in IPython you can use Tab-completion after ``L.cmd.`` to see
|
||||
all available LAMMPS commands.
|
||||
|
||||
-----
|
||||
|
||||
Accessing atom data
|
||||
-------------------
|
||||
|
||||
All per-atom properties that are part of the :doc:`atom style
|
||||
<atom_style>` in the current simulation can be accessed using the
|
||||
:py:meth:`extract_atoms() <lammps.lammps.extract_atoms()>` method. This
|
||||
can be retrieved as ctypes objects or as NumPy arrays through the
|
||||
lammps.numpy module. Those represent the *local* atoms of the
|
||||
individual sub-domain for the current MPI process and may contain
|
||||
information for the local ghost atoms or not depending on the property.
|
||||
Both can be accessed as lists, but for the ctypes list object the size
|
||||
is not known and hast to be retrieved first to avoid out-of-bounds
|
||||
accesses.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
nlocal = L.extract_setting("nlocal")
|
||||
nall = L.extract_setting("nall")
|
||||
print("Number of local atoms ", nlocal, " Number of local and ghost atoms ", nall);
|
||||
|
||||
# access via ctypes directly
|
||||
atom_id = L.extract_atom("id")
|
||||
print("Atom IDs", atom_id[0:nlocal])
|
||||
|
||||
# access through numpy wrapper
|
||||
atom_type = L.numpy.extract_atom("type")
|
||||
print("Atom types", atom_type)
|
||||
|
||||
x = L.numpy.extract_atom("x")
|
||||
v = L.numpy.extract_atom("v")
|
||||
print("positions array shape", x.shape)
|
||||
print("velocity array shape", v.shape)
|
||||
# turn on communicating velocities to ghost atoms
|
||||
L.cmd.comm_modify("vel", "yes")
|
||||
v = L.numpy.extract_atom('v')
|
||||
print("velocity array shape", v.shape)
|
||||
|
||||
Some properties can also be set from Python since internally the
|
||||
data of the C++ code is accessed directly:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# set position in 2D simulation
|
||||
x[0] = (1.0, 0.0)
|
||||
|
||||
# set position in 3D simulation
|
||||
x[0] = (1.0, 0.0, 1.)
|
||||
|
||||
------
|
||||
|
||||
Retrieving the values of thermodynamic data and variables
|
||||
---------------------------------------------------------
|
||||
|
||||
To access thermodynamic data from the last completed timestep,
|
||||
you can use the :py:meth:`get_thermo() <lammps.lammps.get_thermo>`
|
||||
method, and to extract the value of (compatible) variables, you
|
||||
can use the :py:meth:`extract_variable() <lammps.lammps.extract_variable>`
|
||||
method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result = L.get_thermo("ke") # kinetic energy
|
||||
result = L.get_thermo("pe") # potential energy
|
||||
|
||||
result = L.extract_variable("t") / 2.0
|
||||
|
||||
Error handling
|
||||
--------------
|
||||
|
||||
We are using C++ exceptions in LAMMPS for errors and the C language
|
||||
library interface captures and records them. This allows checking
|
||||
whether errors have happened in Python during a call into LAMMPS and
|
||||
then re-throw the error as a Python exception. This way you can handle
|
||||
LAMMPS errors in the conventional way through the Python exception
|
||||
handling mechanism.
|
||||
|
||||
.. warning::
|
||||
|
||||
Capturing a LAMMPS exception in Python can still mean that the
|
||||
current LAMMPS process is in an illegal state and must be
|
||||
terminated. It is advised to save your data and terminate the Python
|
||||
instance as quickly as possible.
|
||||
|
||||
Using LAMMPS in IPython notebooks and Jupyter
|
||||
---------------------------------------------
|
||||
|
||||
If the LAMMPS Python package is installed for the same Python
|
||||
interpreter as IPython, you can use LAMMPS directly inside of an IPython
|
||||
notebook inside of Jupyter. Jupyter is a powerful integrated development
|
||||
environment (IDE) for many dynamic languages like Python, Julia and
|
||||
others, which operates inside of any web browser. Besides
|
||||
auto-completion and syntax highlighting it allows you to create
|
||||
formatted documents using Markup, mathematical formulas, graphics and
|
||||
animations intermixed with executable Python code. It is a great format
|
||||
for tutorials and showcasing your latest research.
|
||||
|
||||
To launch an instance of Jupyter simply run the following command inside your
|
||||
Python environment (this assumes you followed the Quick Start instructions):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
jupyter notebook
|
||||
|
||||
Interactive Python Examples
|
||||
---------------------------
|
||||
|
||||
Examples of IPython notebooks can be found in the ``python/examples/ipython``
|
||||
subdirectory. To open these notebooks launch ``jupyter notebook`` inside this
|
||||
directory and navigate to one of them. If you compiled and installed
|
||||
a LAMMPS shared library with PNG, JPEG and FFMPEG support
|
||||
you should be able to rerun all of these notebooks.
|
||||
|
||||
Validating a dihedral potential
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This example showcases how an IPython Notebook can be used to compare a simple
|
||||
LAMMPS simulation of a harmonic dihedral potential to its analytical solution.
|
||||
Four atoms are placed in the simulation and the dihedral potential is applied on
|
||||
them using a datafile. Then one of the atoms is rotated along the central axis by
|
||||
setting its position from Python, which changes the dihedral angle.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
phi = [d \* math.pi / 180 for d in range(360)]
|
||||
|
||||
pos = [(1.0, math.cos(p), math.sin(p)) for p in phi]
|
||||
|
||||
x = L.numpy.extract_atom("x")
|
||||
|
||||
pe = []
|
||||
for p in pos:
|
||||
x[3] = p
|
||||
L.cmd.run(0, "post", "no")
|
||||
pe.append(L.get_thermo("pe"))
|
||||
|
||||
By evaluating the potential energy for each position we can verify that
|
||||
trajectory with the analytical formula. To compare both solutions, we plot
|
||||
both trajectories over each other using matplotlib, which embeds the generated
|
||||
plot inside the IPython notebook.
|
||||
|
||||
.. image:: JPG/pylammps_dihedral.jpg
|
||||
:align: center
|
||||
|
||||
Running a Monte Carlo relaxation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This second example shows how to use the `lammps` Python interface to create a
|
||||
2D Monte Carlo Relaxation simulation, computing and plotting energy terms and
|
||||
even embedding video output.
|
||||
|
||||
Initially, a 2D system is created in a state with minimal energy.
|
||||
|
||||
.. image:: JPG/pylammps_mc_minimum.jpg
|
||||
:align: center
|
||||
|
||||
It is then disordered by moving each atom by a random delta.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
random.seed(27848)
|
||||
deltaperturb = 0.2
|
||||
x = L.numpy.extract_atom("x")
|
||||
natoms = x.shape[0]
|
||||
|
||||
for i in range(natoms):
|
||||
dx = deltaperturb \* random.uniform(-1, 1)
|
||||
dy = deltaperturb \* random.uniform(-1, 1)
|
||||
x[i][0] += dx
|
||||
x[i][1] += dy
|
||||
|
||||
L.cmd.run(0, "post", "no")
|
||||
|
||||
.. image:: JPG/pylammps_mc_disordered.jpg
|
||||
:align: center
|
||||
|
||||
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
||||
moves random atoms by a random delta and only accepts certain moves.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
estart = L.get_thermo("pe")
|
||||
elast = estart
|
||||
|
||||
naccept = 0
|
||||
energies = [estart]
|
||||
|
||||
niterations = 3000
|
||||
deltamove = 0.1
|
||||
kT = 0.05
|
||||
|
||||
for i in range(niterations):
|
||||
x = L.numpy.extract_atom("x")
|
||||
natoms = x.shape[0]
|
||||
iatom = random.randrange(0, natoms)
|
||||
current_atom = x[iatom]
|
||||
|
||||
x0 = current_atom[0]
|
||||
y0 = current_atom[1]
|
||||
|
||||
dx = deltamove \* random.uniform(-1, 1)
|
||||
dy = deltamove \* random.uniform(-1, 1)
|
||||
|
||||
current_atom[0] = x0 + dx
|
||||
current_atom[1] = y0 + dy
|
||||
|
||||
L.cmd.run(1, "pre no post no")
|
||||
|
||||
e = L.get_thermo("pe")
|
||||
energies.append(e)
|
||||
|
||||
if e <= elast:
|
||||
naccept += 1
|
||||
elast = e
|
||||
elif random.random() <= math.exp(natoms\*(elast-e)/kT):
|
||||
naccept += 1
|
||||
elast = e
|
||||
else:
|
||||
current_atom[0] = x0
|
||||
current_atom[1] = y0
|
||||
|
||||
The energies of each iteration are collected in a Python list and finally plotted using matplotlib.
|
||||
|
||||
.. image:: JPG/pylammps_mc_energies_plot.jpg
|
||||
:align: center
|
||||
|
||||
The IPython notebook also shows how to use dump commands and embed video files
|
||||
inside of the IPython notebook.
|
||||
@ -15,8 +15,9 @@ details of the system, or develop new capabilities. For instance, the numerics
|
||||
associated with calculating gradients, reproducing kernels, etc. are separated
|
||||
into distinct classes to simplify the development of new integration schemes
|
||||
which can call these calculations. Additional numerical details can be found in
|
||||
:ref:`(Clemmer) <howto_rheo_clemmer>`. Example movies illustrating some of these
|
||||
capabilities are found at https://www.lammps.org/movies.html#rheopackage.
|
||||
:ref:`(Palermo) <howto_rheo_palermo>` and :ref:`(Clemmer) <howto_rheo_clemmer>`.
|
||||
Example movies illustrating some of these capabilities are found at
|
||||
https://www.lammps.org/movies.html#rheopackage.
|
||||
|
||||
Note, if you simply want to run a traditional SPH simulation, the :ref:`SPH package
|
||||
<PKG-SPH>` package is likely better suited for your application. It has fewer advanced
|
||||
@ -70,7 +71,7 @@ particles to solid (e.g. with the :doc:`set <set>` command), (b) create bpm
|
||||
bonds between the particles (see the :doc:`bpm howto <Howto_bpm>` page for
|
||||
more details), and (c) use :doc:`pair rheo/solid <pair_rheo_solid>` to
|
||||
apply repulsive contact forces between distinct solid bodies. Akin to pair rheo,
|
||||
pair rheo/solid considers a particles fluid/solid phase to determine whether to
|
||||
pair rheo/solid considers a particle's fluid/solid phase to determine whether to
|
||||
apply forces. However, unlike pair rheo, pair rheo/solid does obey special bond
|
||||
settings such that contact forces do not have to be calculated between two bonded
|
||||
solid particles in the same elastic body.
|
||||
@ -79,10 +80,10 @@ In systems with thermal evolution, fix rheo/thermal can optionally set a
|
||||
melting/solidification temperature allowing particles to dynamically swap their
|
||||
state between fluid and solid when the temperature exceeds or drops below the
|
||||
critical temperature, respectively. Using the *react* option, one can specify a maximum
|
||||
bond length and a bond type. Then, when solidifying, particles will search their
|
||||
bond length and a bond type. Then, when solidifying, particles search their
|
||||
local neighbors and automatically create bonds with any neighboring solid particles
|
||||
in range. For BPM bond styles, bonds will then use the immediate position of the two
|
||||
particles to calculate a reference state. When melting, particles will delete any
|
||||
in range. For BPM bond styles, bonds then use the immediate position of the two
|
||||
particles to calculate a reference state. When melting, particles delete any
|
||||
bonds of the specified type when reverting to a fluid state. Special bonds are updated
|
||||
as bonds are created/broken.
|
||||
|
||||
@ -107,6 +108,10 @@ criteria for creating/deleting a bond or altering force calculations).
|
||||
|
||||
----------
|
||||
|
||||
.. _howto_rheo_palermo:
|
||||
|
||||
**(Palermo)** Palermo, Wolf, Clemmer, O'Connor, Phys. Fluids, 36, 113337 (2024).
|
||||
|
||||
.. _howto_rheo_clemmer:
|
||||
|
||||
**(Clemmer)** Clemmer, Pierce, O'Connor, Nevins, Jones, Lechman, Tencer, Appl. Math. Model., 130, 310-326 (2024).
|
||||
|
||||
@ -260,7 +260,7 @@ Switch into the :code:`examples/melt` folder:
|
||||
|
||||
cd ../examples/melt
|
||||
|
||||
To run this example in serial, use the following command line:
|
||||
To run this example in serial, use the following command:
|
||||
|
||||
.. code-block::
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ your machine and "release" is one of the 3 branches listed above.
|
||||
between them at any time using "git checkout <branch name>".)
|
||||
|
||||
.. admonition:: Saving time and disk space when using ``git clone``
|
||||
:class: note
|
||||
|
||||
The complete git history of the LAMMPS project is quite large because
|
||||
it contains the entire commit history of the project since fall 2006,
|
||||
@ -60,7 +61,7 @@ between them at any time using "git checkout <branch name>".)
|
||||
files (mostly by accident). If you do not need access to the entire
|
||||
commit history (most people don't), you can speed up the "cloning"
|
||||
process and reduce local disk space requirements by using the
|
||||
``--depth`` git command line flag. That will create a "shallow clone"
|
||||
``--depth`` git command-line flag. That will create a "shallow clone"
|
||||
of the repository, which contains only a subset of the git history.
|
||||
Using a depth of 1000 is usually sufficient to include the head
|
||||
commits of the *develop*, the *release*, and the *maintenance*
|
||||
|
||||
@ -8,6 +8,8 @@ send an email to all of them at this address: "developers at
|
||||
lammps.org". General questions about LAMMPS should be posted in the
|
||||
`LAMMPS forum on MatSci <https://matsci.org/lammps/>`_.
|
||||
|
||||
.. We need to keep this file in sync with https://www.lammps.org/authors.html
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\small
|
||||
@ -27,7 +29,7 @@ lammps.org". General questions about LAMMPS should be posted in the
|
||||
* - `Steve Plimpton <sjp_>`_
|
||||
- SNL (retired)
|
||||
- sjplimp at gmail.com
|
||||
- MD kernels, parallel algorithms & scalability, code structure and design
|
||||
- original author, MD kernels, parallel algorithms & scalability, code structure and design
|
||||
* - `Aidan Thompson <at_>`_
|
||||
- SNL
|
||||
- athomps at sandia.gov
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 78 KiB |
@ -131,16 +131,15 @@ run LAMMPS in serial mode.
|
||||
|
||||
.. _lammps_python_api:
|
||||
|
||||
LAMMPS Python APIs
|
||||
==================
|
||||
LAMMPS Python API
|
||||
=================
|
||||
|
||||
The LAMMPS Python module enables calling the LAMMPS C library API from
|
||||
Python by dynamically loading functions in the LAMMPS shared library through
|
||||
the `Python ctypes module <https://docs.python.org/3/library/ctypes.html>`_.
|
||||
Because of the dynamic loading, it is **required** that LAMMPS is compiled
|
||||
in :ref:`"shared" mode <exe>`. The Python interface is object-oriented, but
|
||||
otherwise tries to be very similar to the C library API. Three different
|
||||
Python classes to run LAMMPS are available and they build on each other.
|
||||
otherwise tries to be very similar to the C library API.
|
||||
More information on this is in the :doc:`Python_head`
|
||||
section of the manual. Use of the LAMMPS Python module is described in
|
||||
:doc:`Python_module`.
|
||||
|
||||
@ -7,6 +7,7 @@ This section documents the following functions:
|
||||
- :cpp:func:`lammps_command`
|
||||
- :cpp:func:`lammps_commands_list`
|
||||
- :cpp:func:`lammps_commands_string`
|
||||
- :cpp:func:`lammps_expand`
|
||||
|
||||
--------------------
|
||||
|
||||
@ -79,3 +80,8 @@ Below is a short example using some of these functions.
|
||||
.. doxygenfunction:: lammps_commands_string
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_expand
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Compute, fixes, variables
|
||||
=========================
|
||||
Computes, fixes, variables
|
||||
==========================
|
||||
|
||||
This section documents accessing or modifying data stored by computes,
|
||||
fixes, or variables in LAMMPS using the following functions:
|
||||
@ -12,6 +12,10 @@ fixes, or variables in LAMMPS using the following functions:
|
||||
- :cpp:func:`lammps_set_string_variable`
|
||||
- :cpp:func:`lammps_set_internal_variable`
|
||||
- :cpp:func:`lammps_variable_info`
|
||||
- :cpp:func:`lammps_eval`
|
||||
- :cpp:func:`lammps_clearstep_compute`
|
||||
- :cpp:func:`lammps_addstep_compute_all`
|
||||
- :cpp:func:`lammps_addstep_compute`
|
||||
|
||||
-----------------------
|
||||
|
||||
@ -55,6 +59,26 @@ fixes, or variables in LAMMPS using the following functions:
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_eval
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_clearstep_compute
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_addstep_compute_all
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_addstep_compute
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenenum:: _LMP_DATATYPE_CONST
|
||||
|
||||
.. doxygenenum:: _LMP_STYLE_CONST
|
||||
|
||||
@ -45,6 +45,8 @@ class. See compute.h for details.
|
||||
+-----------------------+------------------------------------------------------------------+
|
||||
| pair_tally_callback | callback function for *tally*\ -style computes (optional). |
|
||||
+-----------------------+------------------------------------------------------------------+
|
||||
| modify_param | called when a compute_modify request is executed (optional) |
|
||||
+-----------------------+------------------------------------------------------------------+
|
||||
| memory_usage | tally memory usage (optional) |
|
||||
+-----------------------+------------------------------------------------------------------+
|
||||
|
||||
|
||||
@ -208,20 +208,21 @@ Build system (strict)
|
||||
|
||||
LAMMPS currently supports two build systems: one that is based on
|
||||
:doc:`traditional Makefiles <Build_make>` and one that is based on
|
||||
:doc:`CMake <Build_cmake>`. Therefore, your contribution must be
|
||||
compatible with and support both build systems.
|
||||
:doc:`CMake <Build_cmake>`. As of fall 2024, it is no longer required
|
||||
to support the traditional make build system. New packages may choose
|
||||
to only support building with CMake. Additions to existing packages
|
||||
must follow the requirements set by that package.
|
||||
|
||||
For a single pair of header and implementation files that are an
|
||||
independent feature, it is usually only required to add them to
|
||||
``src/.gitignore``.
|
||||
|
||||
For traditional make, if your contributed files or package depend on
|
||||
other LAMMPS style files or packages also being installed
|
||||
(e.g. because your file is a derived class from the other LAMMPS
|
||||
class), then an ``Install.sh`` file is also needed to check for those
|
||||
dependencies and modifications to ``src/Depend.sh`` to trigger the checks.
|
||||
See other README and Install.sh files in other directories as
|
||||
examples.
|
||||
other LAMMPS style files or packages also being installed (e.g. because
|
||||
your file is a derived class from the other LAMMPS class), then an
|
||||
``Install.sh`` file is also needed to check for those dependencies and
|
||||
modifications to ``src/Depend.sh`` to trigger the checks. See other
|
||||
README and Install.sh files in other directories as examples.
|
||||
|
||||
Similarly, for CMake support, changes may need to be made to
|
||||
``cmake/CMakeLists.txt``, some of the files in ``cmake/presets``, and
|
||||
|
||||
@ -46,7 +46,7 @@ Include files (varied)
|
||||
but instead should be initialized either in the initializer list of
|
||||
the constructor or explicitly assigned in the body of the constructor.
|
||||
If the member variable is relevant to the functionality of a class
|
||||
(for example when it stores a value from a command line argument), the
|
||||
(for example when it stores a value from a command-line argument), the
|
||||
member variable declaration is followed by a brief comment explaining
|
||||
its purpose and what its values can be. Class members that are
|
||||
pointers should always be initialized to ``nullptr`` in the
|
||||
|
||||
@ -994,6 +994,7 @@ Additional pair styles that are less commonly used.
|
||||
|
||||
* ``src/EXTRA-PAIR``: filenames -> commands
|
||||
* :doc:`pair_style <pair_style>`
|
||||
* ``examples/PACKAGES/dispersion``
|
||||
|
||||
----------
|
||||
|
||||
@ -2171,8 +2172,8 @@ the :doc:`Build extras <Build_extras>` page.
|
||||
* ``src/OPENMP/README``
|
||||
* :doc:`Accelerator packages <Speed_packages>`
|
||||
* :doc:`OPENMP package <Speed_omp>`
|
||||
* :doc:`Command line option -suffix/-sf omp <Run_options>`
|
||||
* :doc:`Command line option -package/-pk omp <Run_options>`
|
||||
* :doc:`Command-line option -suffix/-sf omp <Run_options>`
|
||||
* :doc:`Command-line option -package/-pk omp <Run_options>`
|
||||
* :doc:`package omp <package>`
|
||||
* Search the :doc:`commands <Commands_all>` pages (:doc:`fix <Commands_fix>`, :doc:`compute <Commands_compute>`,
|
||||
:doc:`pair <Commands_pair>`, :doc:`bond, angle, dihedral, improper <Commands_bond>`,
|
||||
@ -2789,14 +2790,15 @@ implements smoothed particle hydrodynamics (SPH) for liquids. See the
|
||||
related :ref:`MACHDYN package <PKG-MACHDYN>` package for smooth Mach dynamics
|
||||
(SMD) for solids.
|
||||
|
||||
This package contains ideal gas, Lennard-Jones equation of states,
|
||||
Tait, and full support for complete (i.e. internal-energy dependent)
|
||||
equations of state. It allows for plain or Monaghans XSPH integration
|
||||
of the equations of motion. It has options for density continuity or
|
||||
density summation to propagate the density field. It has
|
||||
:doc:`set <set>` command options to set the internal energy and density
|
||||
of particles from the input script and allows the same quantities to
|
||||
be output with thermodynamic output or to dump files via the :doc:`compute property/atom <compute_property_atom>` command.
|
||||
This package contains ideal gas, Lennard-Jones equation of states, Tait,
|
||||
and full support for complete (i.e. internal-energy dependent) equations
|
||||
of state. It allows for plain or Monaghans XSPH integration of the
|
||||
equations of motion. It has options for density continuity or density
|
||||
summation to propagate the density field. It has :doc:`set <set>`
|
||||
command options to set the internal energy and density of particles from
|
||||
the input script and allows the same quantities to be output with
|
||||
thermodynamic output or to dump files via the :doc:`compute
|
||||
property/atom <compute_property_atom>` command.
|
||||
|
||||
**Author:** Georg Ganzenmuller (Fraunhofer-Institute for High-Speed
|
||||
Dynamics, Ernst Mach Institute, Germany).
|
||||
@ -2809,6 +2811,17 @@ Dynamics, Ernst Mach Institute, Germany).
|
||||
* ``examples/PACKAGES/sph``
|
||||
* https://www.lammps.org/movies.html#sph
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that the SPH PDF guide file has not been updated for
|
||||
many years and thus does not reflect the current *syntax* of the
|
||||
SPH package commands. For that please refer to the LAMMPS manual.
|
||||
|
||||
.. note::
|
||||
|
||||
Please also note, that the :ref:`RHEO package <PKG-RHEO>` offers
|
||||
similar functionality in a more modern and flexible implementation.
|
||||
|
||||
----------
|
||||
|
||||
.. _PKG-SPIN:
|
||||
|
||||
@ -2,14 +2,8 @@ Per-atom properties
|
||||
===================
|
||||
|
||||
Similar to what is described in :doc:`Library_atoms`, the instances of
|
||||
:py:class:`lammps <lammps.lammps>`, :py:class:`PyLammps <lammps.PyLammps>`, or
|
||||
:py:class:`IPyLammps <lammps.IPyLammps>` can be used to extract atom quantities
|
||||
and modify some of them. The main difference between the interfaces is how the information
|
||||
is exposed.
|
||||
|
||||
While the :py:class:`lammps <lammps.lammps>` is just a thin layer that wraps C API calls,
|
||||
:py:class:`PyLammps <lammps.PyLammps>` and :py:class:`IPyLammps <lammps.IPyLammps>` expose
|
||||
information as objects and properties.
|
||||
:py:class:`lammps <lammps.lammps>` can be used to extract atom quantities
|
||||
and modify some of them.
|
||||
|
||||
In some cases the data returned is a direct reference to the original data
|
||||
inside LAMMPS cast to ``ctypes`` pointers. Where possible, the wrappers will
|
||||
@ -25,57 +19,41 @@ against invalid accesses.
|
||||
accordingly. These arrays can change sizes and order at every neighbor list
|
||||
rebuild and atom sort event as atoms are migrating between subdomains.
|
||||
|
||||
.. tabs::
|
||||
.. code-block:: python
|
||||
|
||||
.. tab:: lammps API
|
||||
from lammps import lammps
|
||||
|
||||
.. code-block:: python
|
||||
lmp = lammps()
|
||||
lmp.file("in.sysinit")
|
||||
|
||||
from lammps import lammps
|
||||
|
||||
lmp = lammps()
|
||||
lmp.file("in.sysinit")
|
||||
# Read/Write access via ctypes
|
||||
nlocal = lmp.extract_global("nlocal")
|
||||
x = lmp.extract_atom("x")
|
||||
|
||||
nlocal = lmp.extract_global("nlocal")
|
||||
x = lmp.extract_atom("x")
|
||||
for i in range(nlocal):
|
||||
print("(x,y,z) = (", x[i][0], x[i][1], x[i][2], ")")
|
||||
|
||||
for i in range(nlocal):
|
||||
print("(x,y,z) = (", x[i][0], x[i][1], x[i][2], ")")
|
||||
# Read/Write access via NumPy arrays
|
||||
atom_id = L.numpy.extract_atom("id")
|
||||
atom_type = L.numpy.extract_atom("type")
|
||||
x = L.numpy.extract_atom("x")
|
||||
v = L.numpy.extract_atom("v")
|
||||
f = L.numpy.extract_atom("f")
|
||||
|
||||
lmp.close()
|
||||
# set position in 2D simulation
|
||||
x[0] = (1.0, 0.0)
|
||||
|
||||
**Methods**:
|
||||
# set position in 3D simulation
|
||||
x[0] = (1.0, 0.0, 1.)
|
||||
|
||||
* :py:meth:`extract_atom() <lammps.lammps.extract_atom()>`: extract a per-atom quantity
|
||||
lmp.close()
|
||||
|
||||
**Numpy Methods**:
|
||||
|
||||
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
||||
**Methods**:
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
* :py:meth:`extract_atom() <lammps.lammps.extract_atom()>`: extract a per-atom quantity
|
||||
|
||||
All atoms in the current simulation can be accessed by using the :py:attr:`PyLammps.atoms <lammps.PyLammps.atoms>` property.
|
||||
Each element of this list is a :py:class:`Atom <lammps.Atom>` or :py:class:`Atom2D <lammps.Atom2D>` object. The attributes of
|
||||
these objects provide access to their data (id, type, position, velocity, force, etc.):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# access first atom
|
||||
L.atoms[0].id
|
||||
L.atoms[0].type
|
||||
|
||||
# access second atom
|
||||
L.atoms[1].position
|
||||
L.atoms[1].velocity
|
||||
L.atoms[1].force
|
||||
|
||||
Some attributes can be changed:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# set position in 2D simulation
|
||||
L.atoms[0].position = (1.0, 0.0)
|
||||
|
||||
# set position in 3D simulation
|
||||
L.atoms[0].position = (1.0, 0.0, 1.0)
|
||||
**Numpy Methods**:
|
||||
|
||||
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
||||
|
||||
@ -6,11 +6,10 @@ Creating or deleting a LAMMPS object
|
||||
====================================
|
||||
|
||||
With the Python interface the creation of a :cpp:class:`LAMMPS
|
||||
<LAMMPS_NS::LAMMPS>` instance is included in the constructors for the
|
||||
:py:class:`lammps <lammps.lammps>`, :py:class:`PyLammps <lammps.PyLammps>`,
|
||||
and :py:class:`IPyLammps <lammps.IPyLammps>` classes.
|
||||
Internally it will call either :cpp:func:`lammps_open` or :cpp:func:`lammps_open_no_mpi` from the C
|
||||
library API to create the class instance.
|
||||
<LAMMPS_NS::LAMMPS>` instance is included in the constructor for the
|
||||
:py:class:`lammps <lammps.lammps>` class. Internally it will call either
|
||||
:cpp:func:`lammps_open` or :cpp:func:`lammps_open_no_mpi` from the C library
|
||||
API to create the class instance.
|
||||
|
||||
All arguments are optional. The *name* argument allows loading a
|
||||
LAMMPS shared library that is named ``liblammps_machine.so`` instead of
|
||||
@ -26,108 +25,25 @@ to run the Python module like the library interface on a subset of the
|
||||
MPI ranks after splitting the communicator.
|
||||
|
||||
|
||||
Here are simple examples using all three Python interfaces:
|
||||
Here is a simple example using the LAMMPS Python interface:
|
||||
|
||||
.. tabs::
|
||||
.. code-block:: python
|
||||
|
||||
.. tab:: lammps API
|
||||
from lammps import lammps
|
||||
|
||||
.. code-block:: python
|
||||
# NOTE: argv[0] is set by the lammps class constructor
|
||||
args = ["-log", "none"]
|
||||
|
||||
from lammps import lammps
|
||||
# create LAMMPS instance
|
||||
lmp = lammps(cmdargs=args)
|
||||
|
||||
# NOTE: argv[0] is set by the lammps class constructor
|
||||
args = ["-log", "none"]
|
||||
# get and print numerical version code
|
||||
print("LAMMPS Version: ", lmp.version())
|
||||
|
||||
# create LAMMPS instance
|
||||
lmp = lammps(cmdargs=args)
|
||||
# explicitly close and delete LAMMPS instance (optional)
|
||||
lmp.close()
|
||||
|
||||
# get and print numerical version code
|
||||
print("LAMMPS Version: ", lmp.version())
|
||||
|
||||
# explicitly close and delete LAMMPS instance (optional)
|
||||
lmp.close()
|
||||
|
||||
.. tab:: PyLammps API
|
||||
|
||||
The :py:class:`PyLammps <lammps.PyLammps>` class is a wrapper around the
|
||||
:py:class:`lammps <lammps.lammps>` class and all of its lower level functions.
|
||||
By default, it will create a new instance of :py:class:`lammps <lammps.lammps>` passing
|
||||
along all arguments to the constructor of :py:class:`lammps <lammps.lammps>`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import PyLammps
|
||||
|
||||
# NOTE: argv[0] is set by the lammps class constructor
|
||||
args = ["-log", "none"]
|
||||
|
||||
# create LAMMPS instance
|
||||
L = PyLammps(cmdargs=args)
|
||||
|
||||
# get and print numerical version code
|
||||
print("LAMMPS Version: ", L.version())
|
||||
|
||||
# explicitly close and delete LAMMPS instance (optional)
|
||||
L.close()
|
||||
|
||||
:py:class:`PyLammps <lammps.PyLammps>` objects can also be created on top of an existing
|
||||
:py:class:`lammps <lammps.lammps>` object:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps, PyLammps
|
||||
...
|
||||
# create LAMMPS instance
|
||||
lmp = lammps(cmdargs=args)
|
||||
|
||||
# create PyLammps instance using previously created LAMMPS instance
|
||||
L = PyLammps(ptr=lmp)
|
||||
|
||||
This is useful if you have to create the :py:class:`lammps <lammps.lammps>`
|
||||
instance is a specific way, but want to take advantage of the
|
||||
:py:class:`PyLammps <lammps.PyLammps>` interface.
|
||||
|
||||
.. tab:: IPyLammps API
|
||||
|
||||
The :py:class:`IPyLammps <lammps.IPyLammps>` class is an extension of the
|
||||
:py:class:`PyLammps <lammps.PyLammps>` class. It has the same construction behavior. By
|
||||
default, it will create a new instance of :py:class:`lammps` passing
|
||||
along all arguments to the constructor of :py:class:`lammps`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import IPyLammps
|
||||
|
||||
# NOTE: argv[0] is set by the lammps class constructor
|
||||
args = ["-log", "none"]
|
||||
|
||||
# create LAMMPS instance
|
||||
L = IPyLammps(cmdargs=args)
|
||||
|
||||
# get and print numerical version code
|
||||
print("LAMMPS Version: ", L.version())
|
||||
|
||||
# explicitly close and delete LAMMPS instance (optional)
|
||||
L.close()
|
||||
|
||||
You can also initialize IPyLammps on top of an existing :py:class:`lammps` or :py:class:`PyLammps` object:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps, IPyLammps
|
||||
...
|
||||
# create LAMMPS instance
|
||||
lmp = lammps(cmdargs=args)
|
||||
|
||||
# create PyLammps instance using previously created LAMMPS instance
|
||||
L = PyLammps(ptr=lmp)
|
||||
|
||||
This is useful if you have to create the :py:class:`lammps <lammps.lammps>`
|
||||
instance is a specific way, but want to take advantage of the
|
||||
:py:class:`IPyLammps <lammps.IPyLammps>` interface.
|
||||
|
||||
In all of the above cases, same as with the :ref:`C library API <lammps_c_api>`, this will use the
|
||||
Same as with the :ref:`C library API <lammps_c_api>`, this will use the
|
||||
``MPI_COMM_WORLD`` communicator for the MPI library that LAMMPS was
|
||||
compiled with.
|
||||
|
||||
|
||||
@ -1,127 +1,123 @@
|
||||
Executing commands
|
||||
==================
|
||||
|
||||
Once an instance of the :py:class:`lammps <lammps.lammps>`,
|
||||
:py:class:`PyLammps <lammps.PyLammps>`, or
|
||||
:py:class:`IPyLammps <lammps.IPyLammps>` class is created, there are
|
||||
Once an instance of the :py:class:`lammps <lammps.lammps>` class is created, there are
|
||||
multiple ways to "feed" it commands. In a way that is not very different from
|
||||
running a LAMMPS input script, except that Python has many more facilities
|
||||
for structured programming than the LAMMPS input script syntax. Furthermore
|
||||
it is possible to "compute" what the next LAMMPS command should be.
|
||||
|
||||
.. tabs::
|
||||
Same as in the equivalent :doc:`C library functions <Library_execute>`,
|
||||
commands can be read from a file, a single string, a list of strings and a
|
||||
block of commands in a single multi-line string. They are processed under the
|
||||
same boundary conditions as the C library counterparts. The example below
|
||||
demonstrates the use of :py:func:`lammps.file()`, :py:func:`lammps.command()`,
|
||||
:py:func:`lammps.commands_list()`, and :py:func:`lammps.commands_string()`:
|
||||
|
||||
.. tab:: lammps API
|
||||
.. code-block:: python
|
||||
|
||||
Same as in the equivalent
|
||||
:doc:`C library functions <Library_execute>`, commands can be read from a file, a
|
||||
single string, a list of strings and a block of commands in a single
|
||||
multi-line string. They are processed under the same boundary conditions
|
||||
as the C library counterparts. The example below demonstrates the use
|
||||
of :py:func:`lammps.file()`, :py:func:`lammps.command()`,
|
||||
:py:func:`lammps.commands_list()`, and :py:func:`lammps.commands_string()`:
|
||||
from lammps import lammps
|
||||
lmp = lammps()
|
||||
|
||||
.. code-block:: python
|
||||
# read commands from file 'in.melt'
|
||||
lmp.file('in.melt')
|
||||
|
||||
from lammps import lammps
|
||||
lmp = lammps()
|
||||
# issue a single command
|
||||
lmp.command('variable zpos index 1.0')
|
||||
|
||||
# read commands from file 'in.melt'
|
||||
lmp.file('in.melt')
|
||||
# create 10 groups with 10 atoms each
|
||||
cmds = [f"group g{i} id {10*i+1}:{10*(i+1)}" for i in range(10)]
|
||||
lmp.commands_list(cmds)
|
||||
|
||||
# issue a single command
|
||||
lmp.command('variable zpos index 1.0')
|
||||
# run commands from a multi-line string
|
||||
block = """
|
||||
clear
|
||||
region box block 0 2 0 2 0 2
|
||||
create_box 1 box
|
||||
create_atoms 1 single 1.0 1.0 ${zpos}
|
||||
"""
|
||||
lmp.commands_string(block)
|
||||
|
||||
# create 10 groups with 10 atoms each
|
||||
cmds = ["group g{} id {}:{}".format(i,10*i+1,10*(i+1)) for i in range(10)]
|
||||
lmp.commands_list(cmds)
|
||||
For convenience, the :py:class:`lammps <lammps.lammps>` class also provides a
|
||||
command wrapper ``cmd`` that turns any LAMMPS command into a regular function
|
||||
call.
|
||||
|
||||
# run commands from a multi-line string
|
||||
block = """
|
||||
clear
|
||||
region box block 0 2 0 2 0 2
|
||||
create_box 1 box
|
||||
create_atoms 1 single 1.0 1.0 ${zpos}
|
||||
"""
|
||||
lmp.commands_string(block)
|
||||
For instance, the following LAMMPS command
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
Unlike the lammps API, the PyLammps/IPyLammps APIs allow running LAMMPS
|
||||
commands by calling equivalent member functions of :py:class:`PyLammps <lammps.PyLammps>`
|
||||
and :py:class:`IPyLammps <lammps.IPyLammps>` instances.
|
||||
region box block 0 10 0 5 -0.5 0.5
|
||||
|
||||
For instance, the following LAMMPS command
|
||||
would normally be executed with the following Python code:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
.. code-block:: python
|
||||
|
||||
region box block 0 10 0 5 -0.5 0.5
|
||||
from lammps import lammps
|
||||
|
||||
can be executed using with the lammps API with the following Python code if ``lmp`` is an
|
||||
instance of :py:class:`lammps <lammps.lammps>`:
|
||||
lmp = lammps()
|
||||
lmp.command("region box block 0 10 0 5 -0.5 0.5")
|
||||
|
||||
.. code-block:: python
|
||||
With the ``cmd`` wrapper, any LAMMPS command can be split up into arbitrary parts.
|
||||
These parts are then passed to a member function with the name of the :doc:`command <Commands_all>`.
|
||||
For the :doc:`region <region>` command that means the :code:`region()` method can be called.
|
||||
The arguments of the command can be passed as one string, or
|
||||
individually.
|
||||
|
||||
from lammps import lammps
|
||||
.. code-block:: python
|
||||
|
||||
lmp = lammps()
|
||||
lmp.command("region box block 0 10 0 5 -0.5 0.5")
|
||||
from lammps import lammps
|
||||
|
||||
With the PyLammps interface, any LAMMPS command can be split up into arbitrary parts.
|
||||
These parts are then passed to a member function with the name of the :doc:`command <Commands_all>`.
|
||||
For the :doc:`region <region>` command that means the :code:`region()` method can be called.
|
||||
The arguments of the command can be passed as one string, or
|
||||
individually.
|
||||
L = lammps()
|
||||
|
||||
.. code-block:: python
|
||||
# pass command parameters as one string
|
||||
L.cmd.region("box block 0 10 0 5 -0.5 0.5")
|
||||
|
||||
from lammps import PyLammps
|
||||
# OR pass them individually
|
||||
L.cmd.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||
|
||||
L = PyLammps()
|
||||
In the latter example, all parameters except the first are Python floating-point literals. The
|
||||
member function takes the entire parameter list and transparently merges it to a single command
|
||||
string.
|
||||
|
||||
# pass command parameters as one string
|
||||
L.region("box block 0 10 0 5 -0.5 0.5")
|
||||
The benefit of this approach is avoiding redundant command calls and easier
|
||||
parameterization. With `command`, `commands_list`, and `commands_string` the
|
||||
parameterization needed to be done manually by creating formatted command
|
||||
strings.
|
||||
|
||||
# OR pass them individually
|
||||
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||
.. code-block:: python
|
||||
|
||||
In the latter example, all parameters except the first are Python floating-point literals. The
|
||||
member function takes the entire parameter list and transparently merges it to a single command
|
||||
string.
|
||||
lmp.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||
|
||||
The benefit of this approach is avoiding redundant command calls and easier
|
||||
parameterization. In the lammps API parameterization needed to be done
|
||||
manually by creating formatted command strings.
|
||||
In contrast, methods of the `cmd` wrapper accept parameters directly and will convert
|
||||
them automatically to a final command string.
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: python
|
||||
|
||||
lmp.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||
L.cmd.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||
|
||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||
them automatically to a final command string.
|
||||
.. note::
|
||||
|
||||
.. code-block:: python
|
||||
When running in IPython you can use Tab-completion after ``L.cmd.`` to see
|
||||
all available LAMMPS commands.
|
||||
|
||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||
Using these facilities, the previous example shown above can be rewritten as follows:
|
||||
|
||||
Using these facilities, the example shown for the lammps API can be rewritten as follows:
|
||||
.. code-block:: python
|
||||
|
||||
.. code-block:: python
|
||||
from lammps import lammps
|
||||
L = lammps()
|
||||
|
||||
from lammps import PyLammps
|
||||
L = PyLammps()
|
||||
# read commands from file 'in.melt'
|
||||
L.file('in.melt')
|
||||
|
||||
# read commands from file 'in.melt'
|
||||
L.file('in.melt')
|
||||
# issue a single command
|
||||
L.cmd.variable('zpos', 'index', 1.0)
|
||||
|
||||
# issue a single command
|
||||
L.variable('zpos', 'index', 1.0)
|
||||
# create 10 groups with 10 atoms each
|
||||
for i in range(10):
|
||||
L.cmd.group(f"g{i}", "id", f"{10*i+1}:{10*(i+1)}")
|
||||
|
||||
# create 10 groups with 10 atoms each
|
||||
for i in range(10):
|
||||
L.group(f"g{i}", "id", f"{10*i+1}:{10*(i+1)}")
|
||||
|
||||
L.clear()
|
||||
L.region("box block", 0, 2, 0, 2, 0, 2)
|
||||
L.create_box(1, "box")
|
||||
L.create_atoms(1, "single", 1.0, 1.0, "${zpos}")
|
||||
L.cmd.clear()
|
||||
L.cmd.region("box block", 0, 2, 0, 2, 0, 2)
|
||||
L.cmd.create_box(1, "box")
|
||||
L.cmd.create_atoms(1, "single", 1.0, 1.0, "${zpos}")
|
||||
|
||||
@ -15,6 +15,7 @@ together.
|
||||
Python_call
|
||||
Python_formats
|
||||
Python_examples
|
||||
Python_jupyter
|
||||
Python_error
|
||||
Python_trouble
|
||||
|
||||
|
||||
45
doc/src/Python_jupyter.rst
Normal file
45
doc/src/Python_jupyter.rst
Normal file
@ -0,0 +1,45 @@
|
||||
Using LAMMPS in IPython notebooks and Jupyter
|
||||
=============================================
|
||||
|
||||
If the LAMMPS Python package is installed for the same Python interpreter as
|
||||
`IPython <ipython>`_, you can use LAMMPS directly inside of an IPython notebook inside of
|
||||
Jupyter. `Jupyter <juypter>`_ is a powerful integrated development environment (IDE) for
|
||||
many dynamic languages like Python, Julia and others, which operates inside of
|
||||
any web browser. Besides auto-completion and syntax highlighting it allows you
|
||||
to create formatted documents using Markup, mathematical formulas, graphics and
|
||||
animations intermixed with executable Python code. It is a great format for
|
||||
tutorials and showcasing your latest research.
|
||||
|
||||
The easiest way to install it is via ``pip``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install --user jupyter
|
||||
|
||||
To launch an instance of Jupyter simply run the following command inside your
|
||||
Python environment:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
jupyter notebook
|
||||
|
||||
Interactive Python Examples
|
||||
---------------------------
|
||||
|
||||
Examples of IPython notebooks can be found in the ``python/examples/ipython``
|
||||
subdirectory. They require LAMMPS to be compiled as shared library with PYTHON,
|
||||
PNG, JPEG and FFMPEG support.
|
||||
|
||||
To open these notebooks launch ``jupyter notebook index.ipynb`` inside this
|
||||
directory. The opened file provides an overview of the available examples.
|
||||
|
||||
- Example 1: Using LAMMPS with Python (``simple.ipynb``)
|
||||
- Example 2: Analyzing LAMMPS thermodynamic data (``thermo.ipynb``)
|
||||
- Example 3: Working with Per-Atom Data (``atoms.ipynb``)
|
||||
- Example 4: Working with LAMMPS variables (``variables.ipynb``)
|
||||
- Example 5: Validating a dihedral potential (``dihedrals/dihedral.ipynb``)
|
||||
- Example 6: Running a Monte Carlo relaxation (``montecarlo/mc.ipynb``)
|
||||
|
||||
.. note::
|
||||
|
||||
Typically clicking a link in Jupyter will open a new tab, which might be blocked by your pop-up blocker.
|
||||
@ -10,19 +10,11 @@ be installed into a Python system folder or a user folder with ``make
|
||||
install-python``. Components of the module can then loaded into a Python
|
||||
session with the ``import`` command.
|
||||
|
||||
There are multiple Python interface classes in the :py:mod:`lammps` module:
|
||||
.. warning::
|
||||
|
||||
- the :py:class:`lammps <lammps.lammps>` class. This is a wrapper around
|
||||
the C-library interface and its member functions try to replicate the
|
||||
:ref:`C-library API <lammps_c_api>` closely. This is the most
|
||||
feature-complete Python API.
|
||||
- the :py:class:`PyLammps <lammps.PyLammps>` class. This is a more high-level
|
||||
and more Python style class implemented on top of the
|
||||
:py:class:`lammps <lammps.lammps>` class.
|
||||
- the :py:class:`IPyLammps <lammps.IPyLammps>` class is derived from
|
||||
:py:class:`PyLammps <lammps.PyLammps>` and adds embedded graphics
|
||||
features to conveniently include LAMMPS into `Jupyter
|
||||
<https://jupyter.org/>`_ notebooks.
|
||||
Alternative interfaces such as :py:class:`PyLammps <lammps.PyLammps>` and
|
||||
:py:class:`IPyLammps <lammps.IPyLammps>` classes have been deprecated and
|
||||
will be removed in a future version of LAMMPS.
|
||||
|
||||
.. _mpi4py_url: https://mpi4py.readthedocs.io
|
||||
|
||||
@ -49,7 +41,7 @@ The ``lammps`` class API
|
||||
========================
|
||||
|
||||
The :py:class:`lammps <lammps.lammps>` class is the core of the LAMMPS
|
||||
Python interfaces. It is a wrapper around the :ref:`LAMMPS C library
|
||||
Python interface. It is a wrapper around the :ref:`LAMMPS C library
|
||||
API <lammps_c_api>` using the `Python ctypes module
|
||||
<https://docs.python.org/3/library/ctypes.html>`_ and a shared library
|
||||
compiled from the LAMMPS sources code. The individual methods in this
|
||||
@ -64,40 +56,7 @@ functions. Below is a detailed documentation of the API.
|
||||
.. autoclass:: lammps.numpy_wrapper::numpy_wrapper
|
||||
:members:
|
||||
|
||||
----------
|
||||
|
||||
The ``PyLammps`` class API
|
||||
==========================
|
||||
|
||||
The :py:class:`PyLammps <lammps.PyLammps>` class is a wrapper that creates a
|
||||
simpler, more "Pythonic" interface to common LAMMPS functionality. LAMMPS
|
||||
data structures are exposed through objects and properties. This makes Python
|
||||
scripts shorter and more concise. See the :doc:`PyLammps Tutorial
|
||||
<Howto_pylammps>` for an introduction on how to use this interface.
|
||||
|
||||
.. autoclass:: lammps.PyLammps
|
||||
:members:
|
||||
|
||||
.. autoclass:: lammps.AtomList
|
||||
:members:
|
||||
|
||||
.. autoclass:: lammps.Atom
|
||||
:members:
|
||||
|
||||
.. autoclass:: lammps.Atom2D
|
||||
:members:
|
||||
|
||||
----------
|
||||
|
||||
The ``IPyLammps`` class API
|
||||
===========================
|
||||
|
||||
The :py:class:`IPyLammps <lammps.PyLammps>` class is an extension of
|
||||
:py:class:`PyLammps <lammps.PyLammps>`, adding additional functions to
|
||||
quickly display visualizations such as images and videos inside of IPython.
|
||||
See the :doc:`PyLammps Tutorial <Howto_pylammps>` for examples.
|
||||
|
||||
.. autoclass:: lammps.IPyLammps
|
||||
.. autoclass:: lammps.ipython::wrapper
|
||||
:members:
|
||||
|
||||
----------
|
||||
|
||||
@ -4,95 +4,52 @@ Compute, fixes, variables
|
||||
This section documents accessing or modifying data from objects like
|
||||
computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
||||
|
||||
.. tabs::
|
||||
For :py:meth:`lammps.extract_compute() <lammps.lammps.extract_compute()>` and
|
||||
:py:meth:`lammps.extract_fix() <lammps.lammps.extract_fix()>`, the global, per-atom,
|
||||
or local data calculated by the compute or fix can be accessed. What is returned
|
||||
depends on whether the compute or fix calculates a scalar or vector or array.
|
||||
For a scalar, a single double value is returned. If the compute or fix calculates
|
||||
a vector or array, a pointer to the internal LAMMPS data is returned, which you can
|
||||
use via normal Python subscripting.
|
||||
|
||||
.. tab:: lammps API
|
||||
The one exception is that for a fix that calculates a
|
||||
global vector or array, a single double value from the vector or array
|
||||
is returned, indexed by I (vector) or I and J (array). I,J are
|
||||
zero-based indices.
|
||||
See the :doc:`Howto output <Howto_output>` page for a discussion of
|
||||
global, per-atom, and local data, and of scalar, vector, and array
|
||||
data types. See the doc pages for individual :doc:`computes <compute>`
|
||||
and :doc:`fixes <fix>` for a description of what they calculate and
|
||||
store.
|
||||
|
||||
For :py:meth:`lammps.extract_compute() <lammps.lammps.extract_compute()>` and
|
||||
:py:meth:`lammps.extract_fix() <lammps.lammps.extract_fix()>`, the global, per-atom,
|
||||
or local data calculated by the compute or fix can be accessed. What is returned
|
||||
depends on whether the compute or fix calculates a scalar or vector or array.
|
||||
For a scalar, a single double value is returned. If the compute or fix calculates
|
||||
a vector or array, a pointer to the internal LAMMPS data is returned, which you can
|
||||
use via normal Python subscripting.
|
||||
For :py:meth:`lammps.extract_variable() <lammps.lammps.extract_variable()>`,
|
||||
an :doc:`equal-style or atom-style variable <variable>` is evaluated and
|
||||
its result returned.
|
||||
|
||||
The one exception is that for a fix that calculates a
|
||||
global vector or array, a single double value from the vector or array
|
||||
is returned, indexed by I (vector) or I and J (array). I,J are
|
||||
zero-based indices.
|
||||
See the :doc:`Howto output <Howto_output>` page for a discussion of
|
||||
global, per-atom, and local data, and of scalar, vector, and array
|
||||
data types. See the doc pages for individual :doc:`computes <compute>`
|
||||
and :doc:`fixes <fix>` for a description of what they calculate and
|
||||
store.
|
||||
For equal-style variables a single ``c_double`` value is returned and the
|
||||
group argument is ignored. For atom-style variables, a vector of
|
||||
``c_double`` is returned, one value per atom, which you can use via normal
|
||||
Python subscripting. The values will be zero for atoms not in the
|
||||
specified group.
|
||||
|
||||
For :py:meth:`lammps.extract_variable() <lammps.lammps.extract_variable()>`,
|
||||
an :doc:`equal-style or atom-style variable <variable>` is evaluated and
|
||||
its result returned.
|
||||
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`,
|
||||
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`, and
|
||||
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>` are
|
||||
equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers.
|
||||
|
||||
For equal-style variables a single ``c_double`` value is returned and the
|
||||
group argument is ignored. For atom-style variables, a vector of
|
||||
``c_double`` is returned, one value per atom, which you can use via normal
|
||||
Python subscripting. The values will be zero for atoms not in the
|
||||
specified group.
|
||||
The :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>` method sets an
|
||||
existing string-style variable to a new string value, so that subsequent LAMMPS
|
||||
commands can access the variable.
|
||||
|
||||
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`,
|
||||
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`, and
|
||||
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>` are
|
||||
equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers.
|
||||
**Methods**:
|
||||
|
||||
The :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>` method sets an
|
||||
existing string-style variable to a new string value, so that subsequent LAMMPS
|
||||
commands can access the variable.
|
||||
* :py:meth:`lammps.extract_compute() <lammps.lammps.extract_compute()>`: extract value(s) from a compute
|
||||
* :py:meth:`lammps.extract_fix() <lammps.lammps.extract_fix()>`: extract value(s) from a fix
|
||||
* :py:meth:`lammps.extract_variable() <lammps.lammps.extract_variable()>`: extract value(s) from a variable
|
||||
* :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>`: set existing named string-style variable to value
|
||||
|
||||
**Methods**:
|
||||
**NumPy Methods**:
|
||||
|
||||
* :py:meth:`lammps.extract_compute() <lammps.lammps.extract_compute()>`: extract value(s) from a compute
|
||||
* :py:meth:`lammps.extract_fix() <lammps.lammps.extract_fix()>`: extract value(s) from a fix
|
||||
* :py:meth:`lammps.extract_variable() <lammps.lammps.extract_variable()>`: extract value(s) from a variable
|
||||
* :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>`: set existing named string-style variable to value
|
||||
|
||||
**NumPy Methods**:
|
||||
|
||||
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
||||
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
|
||||
PyLammps and IPyLammps classes currently do not add any additional ways of
|
||||
retrieving information out of computes and fixes. This information can still be accessed by using the lammps API:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.lmp.extract_compute(...)
|
||||
L.lmp.extract_fix(...)
|
||||
# OR
|
||||
L.lmp.numpy.extract_compute(...)
|
||||
L.lmp.numpy.extract_fix(...)
|
||||
|
||||
LAMMPS variables can be both defined and accessed via the :py:class:`PyLammps <lammps.PyLammps>` interface.
|
||||
|
||||
To define a variable you can use the :doc:`variable <variable>` command:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
L.variable("a index 2")
|
||||
|
||||
A dictionary of all variables is returned by the :py:attr:`PyLammps.variables <lammps.PyLammps.variables>` property:
|
||||
|
||||
you can access an individual variable by retrieving a variable object from the
|
||||
``L.variables`` dictionary by name
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
a = L.variables['a']
|
||||
|
||||
The variable value can then be easily read and written by accessing the value
|
||||
property of this object.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
print(a.value)
|
||||
a.value = 4
|
||||
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
||||
|
||||
@ -56,7 +56,7 @@ Below is an example output for Python version 3.8.5.
|
||||
|
||||
---------
|
||||
|
||||
LAMMPS can work together with Python in three ways. First, Python can
|
||||
LAMMPS can work together with Python in two ways. First, Python can
|
||||
wrap LAMMPS through the its :doc:`library interface <Library>`, so
|
||||
that a Python script can create one or more instances of LAMMPS and
|
||||
launch one or more simulations. In Python terms, this is referred to as
|
||||
@ -67,22 +67,7 @@ launch one or more simulations. In Python terms, this is referred to as
|
||||
|
||||
Launching LAMMPS via Python
|
||||
|
||||
|
||||
Second, the lower-level Python interface in the :py:class:`lammps Python
|
||||
class <lammps.lammps>` can be used indirectly through the provided
|
||||
:py:class:`PyLammps <lammps.PyLammps>` and :py:class:`IPyLammps
|
||||
<lammps.IPyLammps>` wrapper classes, also written in Python. These
|
||||
wrappers try to simplify the usage of LAMMPS in Python by providing a
|
||||
more object-based interface to common LAMMPS functionality. They also
|
||||
reduce the amount of code necessary to parameterize LAMMPS scripts
|
||||
through Python and make variables and computes directly accessible.
|
||||
|
||||
.. figure:: JPG/pylammps-invoke-lammps.png
|
||||
:figclass: align-center
|
||||
|
||||
Using the PyLammps / IPyLammps wrappers
|
||||
|
||||
Third, LAMMPS can use the Python interpreter, so that a LAMMPS input
|
||||
Second, LAMMPS can use the Python interpreter, so that a LAMMPS input
|
||||
script or styles can invoke Python code directly, and pass information
|
||||
back-and-forth between the input script and Python functions you write.
|
||||
This Python code can also call back to LAMMPS to query or change its
|
||||
|
||||
@ -2,14 +2,8 @@ System properties
|
||||
=================
|
||||
|
||||
Similar to what is described in :doc:`Library_properties`, the instances of
|
||||
:py:class:`lammps <lammps.lammps>`, :py:class:`PyLammps <lammps.PyLammps>`, or
|
||||
:py:class:`IPyLammps <lammps.IPyLammps>` can be used to extract different kinds
|
||||
of information about the active LAMMPS instance and also to modify some of it. The
|
||||
main difference between the interfaces is how the information is exposed.
|
||||
|
||||
While the :py:class:`lammps <lammps.lammps>` is just a thin layer that wraps C API calls,
|
||||
:py:class:`PyLammps <lammps.PyLammps>` and :py:class:`IPyLammps <lammps.IPyLammps>` expose
|
||||
information as objects and properties.
|
||||
:py:class:`lammps <lammps.lammps>` can be used to extract different kinds
|
||||
of information about the active LAMMPS instance and also to modify some of it.
|
||||
|
||||
In some cases the data returned is a direct reference to the original data
|
||||
inside LAMMPS cast to ``ctypes`` pointers. Where possible, the wrappers will
|
||||
@ -25,113 +19,38 @@ against invalid accesses.
|
||||
accordingly. These arrays can change sizes and order at every neighbor list
|
||||
rebuild and atom sort event as atoms are migrating between subdomains.
|
||||
|
||||
.. tabs::
|
||||
.. code-block:: python
|
||||
|
||||
.. tab:: lammps API
|
||||
from lammps import lammps
|
||||
|
||||
.. code-block:: python
|
||||
lmp = lammps()
|
||||
lmp.file("in.sysinit")
|
||||
|
||||
from lammps import lammps
|
||||
natoms = lmp.get_natoms()
|
||||
print(f"running simulation with {natoms} atoms")
|
||||
|
||||
lmp = lammps()
|
||||
lmp.file("in.sysinit")
|
||||
lmp.command("run 1000 post no");
|
||||
|
||||
natoms = lmp.get_natoms()
|
||||
print(f"running simulation with {natoms} atoms")
|
||||
for i in range(10):
|
||||
lmp.command("run 100 pre no post no")
|
||||
pe = lmp.get_thermo("pe")
|
||||
ke = lmp.get_thermo("ke")
|
||||
print(f"PE = {pe}\nKE = {ke}")
|
||||
|
||||
lmp.command("run 1000 post no");
|
||||
lmp.close()
|
||||
|
||||
for i in range(10):
|
||||
lmp.command("run 100 pre no post no")
|
||||
pe = lmp.get_thermo("pe")
|
||||
ke = lmp.get_thermo("ke")
|
||||
print(f"PE = {pe}\nKE = {ke}")
|
||||
**Methods**:
|
||||
|
||||
lmp.close()
|
||||
* :py:meth:`version() <lammps.lammps.version()>`: return the numerical version id, e.g. LAMMPS 2 Sep 2015 -> 20150902
|
||||
* :py:meth:`get_thermo() <lammps.lammps.get_thermo()>`: return current value of a thermo keyword
|
||||
* :py:meth:`last_thermo() <lammps.lammps.last_thermo()>`: return a dictionary of the last thermodynamic output
|
||||
* :py:meth:`get_natoms() <lammps.lammps.get_natoms()>`: total # of atoms as int
|
||||
* :py:meth:`reset_box() <lammps.lammps.reset_box()>`: reset the simulation box size
|
||||
* :py:meth:`extract_setting() <lammps.lammps.extract_setting()>`: return a global setting
|
||||
* :py:meth:`extract_global() <lammps.lammps.extract_global()>`: extract a global quantity
|
||||
* :py:meth:`extract_box() <lammps.lammps.extract_box()>`: extract box info
|
||||
* :py:meth:`create_atoms() <lammps.lammps.create_atoms()>`: create N atoms with IDs, types, x, v, and image flags
|
||||
|
||||
**Methods**:
|
||||
**Properties**:
|
||||
|
||||
* :py:meth:`version() <lammps.lammps.version()>`: return the numerical version id, e.g. LAMMPS 2 Sep 2015 -> 20150902
|
||||
* :py:meth:`get_thermo() <lammps.lammps.get_thermo()>`: return current value of a thermo keyword
|
||||
* :py:meth:`last_thermo() <lammps.lammps.last_thermo()>`: return a dictionary of the last thermodynamic output
|
||||
* :py:meth:`get_natoms() <lammps.lammps.get_natoms()>`: total # of atoms as int
|
||||
* :py:meth:`reset_box() <lammps.lammps.reset_box()>`: reset the simulation box size
|
||||
* :py:meth:`extract_setting() <lammps.lammps.extract_setting()>`: return a global setting
|
||||
* :py:meth:`extract_global() <lammps.lammps.extract_global()>`: extract a global quantity
|
||||
* :py:meth:`extract_box() <lammps.lammps.extract_box()>`: extract box info
|
||||
* :py:meth:`create_atoms() <lammps.lammps.create_atoms()>`: create N atoms with IDs, types, x, v, and image flags
|
||||
|
||||
**Properties**:
|
||||
|
||||
* :py:attr:`last_thermo_step <lammps.lammps.last_thermo_step>`: the last timestep thermodynamic output was computed
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
|
||||
In addition to the functions provided by :py:class:`lammps <lammps.lammps>`, :py:class:`PyLammps <lammps.PyLammps>` objects
|
||||
have several properties which allow you to query the system state:
|
||||
|
||||
L.system
|
||||
Is a dictionary describing the system such as the bounding box or number of atoms
|
||||
|
||||
L.system.xlo, L.system.xhi
|
||||
bounding box limits along x-axis
|
||||
|
||||
L.system.ylo, L.system.yhi
|
||||
bounding box limits along y-axis
|
||||
|
||||
L.system.zlo, L.system.zhi
|
||||
bounding box limits along z-axis
|
||||
|
||||
L.communication
|
||||
configuration of communication subsystem, such as the number of threads or processors
|
||||
|
||||
L.communication.nthreads
|
||||
number of threads used by each LAMMPS process
|
||||
|
||||
L.communication.nprocs
|
||||
number of MPI processes used by LAMMPS
|
||||
|
||||
L.fixes
|
||||
List of fixes in the current system
|
||||
|
||||
L.computes
|
||||
List of active computes in the current system
|
||||
|
||||
L.dump
|
||||
List of active dumps in the current system
|
||||
|
||||
L.groups
|
||||
List of groups present in the current system
|
||||
|
||||
**Retrieving the value of an arbitrary LAMMPS expressions**
|
||||
|
||||
LAMMPS expressions can be immediately evaluated by using the ``eval`` method. The
|
||||
passed string parameter can be any expression containing global :doc:`thermo` values,
|
||||
variables, compute or fix data (see :doc:`Howto_output`):
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result = L.eval("ke") # kinetic energy
|
||||
result = L.eval("pe") # potential energy
|
||||
|
||||
result = L.eval("v_t/2.0")
|
||||
|
||||
**Example**
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import PyLammps
|
||||
|
||||
L = PyLammps()
|
||||
L.file("in.sysinit")
|
||||
|
||||
print(f"running simulation with {L.system.natoms} atoms")
|
||||
|
||||
L.run(1000, "post no");
|
||||
|
||||
for i in range(10):
|
||||
L.run(100, "pre no post no")
|
||||
pe = L.eval("pe")
|
||||
ke = L.eval("ke")
|
||||
print(f"PE = {pe}\nKE = {ke}")
|
||||
* :py:attr:`last_thermo_step <lammps.lammps.last_thermo_step>`: the last timestep thermodynamic output was computed
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
Basics of running LAMMPS
|
||||
========================
|
||||
|
||||
LAMMPS is run from the command line, reading commands from a file via
|
||||
the ``-in`` command line flag, or from standard input. Using the ``-in
|
||||
LAMMPS is run from the command-line, reading commands from a file via
|
||||
the ``-in`` command-line flag, or from standard input. Using the ``-in
|
||||
in.file`` variant is recommended (see note below). The name of the
|
||||
LAMMPS executable is either ``lmp`` or ``lmp_<machine>`` with
|
||||
`<machine>` being the machine string used when compiling LAMMPS. This
|
||||
@ -25,7 +25,7 @@ build LAMMPS:
|
||||
You normally run the LAMMPS command in the directory where your input
|
||||
script is located. That is also where output files are produced by
|
||||
default, unless you provide specific other paths in your input script or
|
||||
on the command line. As in some of the examples above, the LAMMPS
|
||||
on the command-line. As in some of the examples above, the LAMMPS
|
||||
executable itself can be placed elsewhere.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -632,7 +632,7 @@ the ``-package omp`` command-line switch or the :doc:`package omp <package>` com
|
||||
|
||||
The :doc:`suffix <suffix>` command can also be used within an input
|
||||
script to set a suffix, or to turn off or back on any suffix setting
|
||||
made via the command line.
|
||||
made via the command-line.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -117,14 +117,19 @@ number of histogram counts is equal to the number of processors.
|
||||
|
||||
----------
|
||||
|
||||
The last section gives aggregate statistics (across all processors)
|
||||
for pairwise neighbors and special neighbors that LAMMPS keeps track
|
||||
of (see the :doc:`special_bonds <special_bonds>` command). The number
|
||||
of times neighbor lists were rebuilt is tallied, as is the number of
|
||||
potentially *dangerous* rebuilds. If atom movement triggered neighbor
|
||||
list rebuilding (see the :doc:`neigh_modify <neigh_modify>` command),
|
||||
then dangerous reneighborings are those that were triggered on the
|
||||
first timestep atom movement was checked for. If this count is
|
||||
The last section gives aggregate statistics (across all processors) for
|
||||
pairwise neighbors and special neighbors that LAMMPS keeps track of (see
|
||||
the :doc:`special_bonds <special_bonds>` command). This section will
|
||||
not always contain data, for example when there has not been a neighbor
|
||||
rebuild, or the neighbor list was constructed on the GPU or when a
|
||||
hybrid pair style was used and LAMMPS cannot determine a suitable (base)
|
||||
neighbor list to draw the statistics from.
|
||||
|
||||
The number of times neighbor lists were rebuilt is tallied, as is the
|
||||
number of potentially *dangerous* rebuilds. If atom movement triggered
|
||||
neighbor list rebuilding (see the :doc:`neigh_modify <neigh_modify>`
|
||||
command), then dangerous reneighborings are those that were triggered on
|
||||
the first timestep atom movement was checked for. If this count is
|
||||
non-zero you may wish to reduce the delay factor to ensure no force
|
||||
interactions are missed by atoms moving beyond the neighbor skin
|
||||
distance before a rebuild takes place.
|
||||
@ -178,3 +183,64 @@ with and without the communication and a Gflop rate is computed. The
|
||||
3d rate is with communication; the 1d rate is without (just the 1d
|
||||
FFTs). Thus you can estimate what fraction of your FFT time was spent
|
||||
in communication, roughly 75% in the example above.
|
||||
|
||||
Error message output
|
||||
====================
|
||||
|
||||
Depending on the error function arguments when it is called in the
|
||||
source code, there will be one to four lines of error output.
|
||||
|
||||
A single line
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
The line starts with "ERROR: ", followed by the error message and
|
||||
information about the location in the source where the error function
|
||||
was called in parenthesis on the right (here: line 131 of the file
|
||||
src/fix_print.cpp). Example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Fix print timestep variable nevery returned a bad timestep: 9900 (src/fix_print.cpp:131)
|
||||
|
||||
Two lines
|
||||
^^^^^^^^^
|
||||
|
||||
In addition to the single line output, also the last line of the input
|
||||
will be repeated. If a command is spread over multiple lines in the
|
||||
input using the continuation character '&', then the error will print
|
||||
the entire concatenated line. For readability all whitespace is
|
||||
compressed to single blanks. Example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Unrecognized fix style 'printf' (src/modify.cpp:924)
|
||||
Last input line: fix 0 all printf v_nevery "Step: $(step) ${step}"
|
||||
|
||||
Three lines
|
||||
^^^^^^^^^^^
|
||||
|
||||
In addition to the two line output from above, a third line is added
|
||||
that uses caret character markers '^' to indicate which "word" in the
|
||||
input failed. Example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Illegal fix print nevery value -100; must be > 0 (src/fix_print.cpp:41)
|
||||
Last input line: fix 0 all print -100 "Step: $(step) ${stepx}"
|
||||
^^^^
|
||||
|
||||
Four lines
|
||||
^^^^^^^^^^
|
||||
|
||||
The three line output is expanded to four lines, if the the input is
|
||||
modified through input pre-processing, e.g. when substituting
|
||||
variables. Now the last command is printed once in the original form and
|
||||
a second time after substitutions are applied. The caret character
|
||||
markers '^' are applied to the second version. Example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Illegal fix print nevery value -100; must be > 0 (src/fix_print.cpp:41)
|
||||
Last input line: fix 0 all print ${nevery} 'Step: $(step) ${step}'
|
||||
--> parsed line: fix 0 all print -100 "Step: $(step) ${step}"
|
||||
^^^^
|
||||
|
||||
@ -20,7 +20,7 @@ To run with 4 threads, you can type this:
|
||||
lmp -in in.lj.lmp -k on t 4 -sf kk
|
||||
|
||||
Alternately, you can also install a package with LAMMPS-GUI included and
|
||||
open the LAMMPS-GUI app (the package includes the command line version
|
||||
open the LAMMPS-GUI app (the package includes the command-line version
|
||||
of LAMMPS as well) and open the input file in the GUI and run it from
|
||||
there. For details on LAMMPS-GUI, see :doc:`Howto_lammps_gui`.
|
||||
|
||||
|
||||
@ -31,7 +31,8 @@ Coulombics. It has the following general features:
|
||||
(for Nvidia GPUs, AMD GPUs, Intel GPUs, and multicore CPUs).
|
||||
so that the same functionality is supported on a variety of hardware.
|
||||
|
||||
**Required hardware/software:**
|
||||
Required hardware/software
|
||||
""""""""""""""""""""""""""
|
||||
|
||||
To compile and use this package in CUDA mode, you currently need
|
||||
to have an NVIDIA GPU and install the corresponding NVIDIA CUDA
|
||||
@ -69,12 +70,14 @@ To compile and use this package in HIP mode, you have to have the AMD ROCm
|
||||
software installed. Versions of ROCm older than 3.5 are currently deprecated
|
||||
by AMD.
|
||||
|
||||
**Building LAMMPS with the GPU package:**
|
||||
Building LAMMPS with the GPU package
|
||||
""""""""""""""""""""""""""""""""""""
|
||||
|
||||
See the :ref:`Build extras <gpu>` page for
|
||||
instructions.
|
||||
|
||||
**Run with the GPU package from the command line:**
|
||||
Run with the GPU package from the command-line
|
||||
""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
|
||||
used by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||
@ -133,7 +136,8 @@ affect the setting for bonded interactions (LAMMPS default is "on").
|
||||
The "off" setting for pairwise interaction is currently required for
|
||||
GPU package pair styles.
|
||||
|
||||
**Or run with the GPU package by editing an input script:**
|
||||
Run with the GPU package by editing an input script
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
|
||||
tasks/node, and use of multiple MPI tasks/GPU is the same.
|
||||
@ -149,7 +153,8 @@ You must also use the :doc:`package gpu <package>` command to enable the
|
||||
GPU package, unless the ``-sf gpu`` or ``-pk gpu`` :doc:`command-line switches <Run_options>` were used. It specifies the number of
|
||||
GPUs/node to use, as well as other options.
|
||||
|
||||
**Speed-ups to expect:**
|
||||
Speed-up to expect
|
||||
""""""""""""""""""
|
||||
|
||||
The performance of a GPU versus a multicore CPU is a function of your
|
||||
hardware, which pair style is used, the number of atoms/GPU, and the
|
||||
@ -176,10 +181,13 @@ better with multiple OMP threads because the inter-process communication
|
||||
is higher for these styles with the GPU package in order to allow
|
||||
deterministic results.
|
||||
|
||||
**Guidelines for best performance:**
|
||||
Guidelines for best performance
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
* Using multiple MPI tasks per GPU will often give the best performance,
|
||||
as allowed my most multicore CPU/GPU configurations.
|
||||
* Using multiple MPI tasks (2-10) per GPU will often give the best
|
||||
performance, as allowed my most multicore CPU/GPU configurations.
|
||||
Using too many MPI tasks will result in worse performance due to
|
||||
growing overhead with the growing number of MPI tasks.
|
||||
* If the number of particles per MPI task is small (e.g. 100s of
|
||||
particles), it can be more efficient to run with fewer MPI tasks per
|
||||
GPU, even if you do not use all the cores on the compute node.
|
||||
@ -199,12 +207,13 @@ deterministic results.
|
||||
:doc:`angle <angle_style>`, :doc:`dihedral <dihedral_style>`,
|
||||
:doc:`improper <improper_style>`, and :doc:`long-range <kspace_style>`
|
||||
calculations will not be included in the "Pair" time.
|
||||
* Since only part of the pppm kspace style is GPU accelerated, it
|
||||
may be faster to only use GPU acceleration for Pair styles with
|
||||
long-range electrostatics. See the "pair/only" keyword of the
|
||||
package command for a shortcut to do that. The work between kspace
|
||||
on the CPU and non-bonded interactions on the GPU can be balanced
|
||||
through adjusting the coulomb cutoff without loss of accuracy.
|
||||
* Since only part of the pppm kspace style is GPU accelerated, it may be
|
||||
faster to only use GPU acceleration for Pair styles with long-range
|
||||
electrostatics. See the "pair/only" keyword of the :doc:`package
|
||||
command <package>` for a shortcut to do that. The distribution of
|
||||
work between kspace on the CPU and non-bonded interactions on the GPU
|
||||
can be balanced through adjusting the coulomb cutoff without loss of
|
||||
accuracy.
|
||||
* When the *mode* setting for the package gpu command is force/neigh,
|
||||
the time for neighbor list calculations on the GPU will be added into
|
||||
the "Pair" time, not the "Neigh" time. An additional breakdown of the
|
||||
@ -220,4 +229,6 @@ deterministic results.
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
None.
|
||||
When using :doc:`hybrid pair styles <pair_hybrid>`, the neighbor list
|
||||
must be generated on the host instead of the GPU and thus the potential
|
||||
GPU acceleration is reduced.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
INTEL package
|
||||
==================
|
||||
=============
|
||||
|
||||
The INTEL package is maintained by Mike Brown at Intel
|
||||
Corporation. It provides two methods for accelerating simulations,
|
||||
@ -13,18 +13,18 @@ twice, once on the CPU and once with an offload flag. This allows
|
||||
LAMMPS to run on the CPU cores and co-processor cores simultaneously.
|
||||
|
||||
Currently Available INTEL Styles
|
||||
"""""""""""""""""""""""""""""""""""""
|
||||
""""""""""""""""""""""""""""""""
|
||||
|
||||
* Angle Styles: charmm, harmonic
|
||||
* Bond Styles: fene, fourier, harmonic
|
||||
* Bond Styles: fene, harmonic
|
||||
* Dihedral Styles: charmm, fourier, harmonic, opls
|
||||
* Fixes: nve, npt, nvt, nvt/sllod, nve/asphere
|
||||
* Fixes: nve, npt, nvt, nvt/sllod, nve/asphere, electrode/conp, electrode/conq, electrode/thermo
|
||||
* Improper Styles: cvff, harmonic
|
||||
* Pair Styles: airebo, airebo/morse, buck/coul/cut, buck/coul/long,
|
||||
buck, dpd, eam, eam/alloy, eam/fs, gayberne, lj/charmm/coul/charmm,
|
||||
lj/charmm/coul/long, lj/cut, lj/cut/coul/long, lj/long/coul/long,
|
||||
rebo, sw, tersoff
|
||||
* K-Space Styles: pppm, pppm/disp
|
||||
rebo, snap, sw, tersoff
|
||||
* K-Space Styles: pppm, pppm/disp, pppm/electrode
|
||||
|
||||
.. warning::
|
||||
|
||||
@ -33,7 +33,7 @@ Currently Available INTEL Styles
|
||||
input requires it, LAMMPS will abort with an error message.
|
||||
|
||||
Speed-up to expect
|
||||
"""""""""""""""""""
|
||||
""""""""""""""""""
|
||||
|
||||
The speedup will depend on your simulation, the hardware, which
|
||||
styles are used, the number of atoms, and the floating-point
|
||||
@ -312,21 +312,21 @@ almost all cases.
|
||||
recommended, especially when running on a machine with Intel
|
||||
Hyper-Threading technology disabled.
|
||||
|
||||
Run with the INTEL package from the command line
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
Run with the INTEL package from the command-line
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
To enable INTEL optimizations for all available styles used in
|
||||
the input script, the ``-sf intel`` :doc:`command-line switch <Run_options>` can be used without any requirement for
|
||||
editing the input script. This switch will automatically append
|
||||
"intel" to styles that support it. It also invokes a default command:
|
||||
:doc:`package intel 1 <package>`. This package command is used to set
|
||||
options for the INTEL package. The default package command will
|
||||
specify that INTEL calculations are performed in mixed precision,
|
||||
that the number of OpenMP threads is specified by the OMP_NUM_THREADS
|
||||
environment variable, and that if co-processors are present and the
|
||||
binary was built with offload support, that 1 co-processor per node
|
||||
will be used with automatic balancing of work between the CPU and the
|
||||
co-processor.
|
||||
To enable INTEL optimizations for all available styles used in the input
|
||||
script, the ``-sf intel`` :doc:`command-line switch <Run_options>` can
|
||||
be used without any requirement for editing the input script. This
|
||||
switch will automatically append "intel" to styles that support it. It
|
||||
also invokes a default command: :doc:`package intel 1 <package>`. This
|
||||
package command is used to set options for the INTEL package. The
|
||||
default package command will specify that INTEL calculations are
|
||||
performed in mixed precision, that the number of OpenMP threads is
|
||||
specified by the OMP_NUM_THREADS environment variable, and that if
|
||||
co-processors are present and the binary was built with offload support,
|
||||
that 1 co-processor per node will be used with automatic balancing of
|
||||
work between the CPU and the co-processor.
|
||||
|
||||
You can specify different options for the INTEL package by using
|
||||
the ``-pk intel Nphi`` :doc:`command-line switch <Run_options>` with
|
||||
|
||||
@ -67,6 +67,14 @@ version 23 November 2023 and Kokkos version 4.2.
|
||||
To build with Kokkos support for AMD GPUs, the AMD ROCm toolkit
|
||||
software version 5.2.0 or later must be installed on your system.
|
||||
|
||||
.. admonition:: Intel Data Center GPU support
|
||||
:class: note
|
||||
|
||||
Support for Kokkos with Intel Data Center GPU accelerators (formerly
|
||||
known under the code name "Ponte Vecchio") in LAMMPS is still a work
|
||||
in progress. Only a subset of the functionality works correctly.
|
||||
Please contact the LAMMPS developers if you run into problems.
|
||||
|
||||
.. admonition:: CUDA and MPI library compatibility
|
||||
:class: note
|
||||
|
||||
@ -77,16 +85,18 @@ version 23 November 2023 and Kokkos version 4.2.
|
||||
rank. When running with multiple MPI ranks, you may see segmentation
|
||||
faults without GPU-aware MPI support. These can be avoided by adding
|
||||
the flags :doc:`-pk kokkos gpu/aware off <Run_options>` to the
|
||||
LAMMPS command line or by using the command :doc:`package kokkos
|
||||
LAMMPS command-line or by using the command :doc:`package kokkos
|
||||
gpu/aware off <package>` in the input file.
|
||||
|
||||
.. admonition:: Intel Data Center GPU support
|
||||
.. admonition:: Using multiple MPI ranks per GPU
|
||||
:class: note
|
||||
|
||||
Support for Kokkos with Intel Data Center GPU accelerators (formerly
|
||||
known under the code name "Ponte Vecchio") in LAMMPS is still a work
|
||||
in progress. Only a subset of the functionality works correctly.
|
||||
Please contact the LAMMPS developers if you run into problems.
|
||||
Unlike with the GPU package, there are limited benefits from using
|
||||
multiple MPI processes per GPU with KOKKOS. But when doing this it
|
||||
is **required** to enable CUDA MPS (`Multi-Process Service :: GPU
|
||||
Deployment and Management Documentation
|
||||
<https://docs.nvidia.com/deploy/mps/index.html>`_ ) to get acceptable
|
||||
performance.
|
||||
|
||||
Building LAMMPS with the KOKKOS package
|
||||
"""""""""""""""""""""""""""""""""""""""
|
||||
@ -365,13 +375,13 @@ one or more nodes, each with two GPUs:
|
||||
|
||||
.. note::
|
||||
|
||||
When using a GPU, you will achieve the best performance if your
|
||||
input script does not use fix or compute styles which are not yet
|
||||
When using a GPU, you will achieve the best performance if your input
|
||||
script does not use fix or compute styles which are not yet
|
||||
Kokkos-enabled. This allows data to stay on the GPU for multiple
|
||||
timesteps, without being copied back to the host CPU. Invoking a
|
||||
non-Kokkos fix or compute, or performing I/O for
|
||||
:doc:`thermo <thermo_style>` or :doc:`dump <dump>` output will cause data
|
||||
to be copied back to the CPU incurring a performance penalty.
|
||||
non-Kokkos fix or compute, or performing I/O for :doc:`thermo
|
||||
<thermo_style>` or :doc:`dump <dump>` output will cause data to be
|
||||
copied back to the CPU incurring a performance penalty.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -379,6 +389,56 @@ one or more nodes, each with two GPUs:
|
||||
kspace, etc., you must set the environment variable ``CUDA_LAUNCH_BLOCKING=1``.
|
||||
However, this will reduce performance and is not recommended for production runs.
|
||||
|
||||
Troubleshooting segmentation faults on GPUs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As noted above, KOKKOS by default assumes that the MPI library is
|
||||
GPU-aware. This is not always the case and can lead to segmentation
|
||||
faults when using more than one MPI process. Normally, LAMMPS will
|
||||
print a warning like "*Turning off GPU-aware MPI since it is not
|
||||
detected*", or an error message like "*Kokkos with GPU-enabled backend
|
||||
assumes GPU-aware MPI is available*", OR a **segmentation fault**. To
|
||||
confirm that a segmentation fault is caused by this, you can turn off
|
||||
the GPU-aware assumption via the :doc:`package kokkos command <package>`
|
||||
or the corresponding command-line flag.
|
||||
|
||||
If you still get a segmentation fault, despite running with only one MPI
|
||||
process or using the command-line flag to turn off expecting a GPU-aware
|
||||
MPI library, then using the CMake compile setting
|
||||
``-DKokkos_ENABLE_DEBUG=on`` or adding ``KOKKOS_DEBUG=yes`` to your
|
||||
machine makefile for building with traditional make will generate useful
|
||||
output that can be passed to the LAMMPS developers for further
|
||||
debugging.
|
||||
|
||||
Troubleshooting memory allocation on GPUs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
`Kokkos Tools <https://github.com/kokkos/kokkos-tools/>`_ provides a set
|
||||
of lightweight profiling and debugging utilities, which interface with
|
||||
instrumentation hooks (eg. `space-time-stack
|
||||
<https://github.com/kokkos/kokkos-tools/tree/develop/profiling/space-time-stack>`_)
|
||||
built directly into the Kokkos runtime. After compiling a dynamic LAMMPS
|
||||
library, you then have to set the environment variable ``KOKKOS_TOOLS_LIBS``
|
||||
before executing your LAMMPS Kokkos run. Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export KOKKOS_TOOLS_LIBS=${HOME}/kokkos-tools/src/tools/memory-events/kp_memory_event.so
|
||||
mpirun -np 4 lmp_kokkos_cuda_openmpi -in in.lj -k on g 4 -sf kk
|
||||
|
||||
Starting with the NVIDIA Pascal GPU architecture, CUDA supports
|
||||
`"Unified Virtual Memory" (UVM)
|
||||
<https://developer.nvidia.com/blog/unified-memory-cuda-beginners/>`_
|
||||
which enables allocating more memory than a GPU possesses by also using
|
||||
memory on the host CPU and then CUDA will transparently move data
|
||||
between CPU and GPU as needed. The resulting LAMMPS performance depends
|
||||
on `memory access pattern, data residency, and GPU memory
|
||||
oversubscription
|
||||
<https://developer.nvidia.com/blog/improving-gpu-memory-oversubscription-performance/>`_
|
||||
. The CMake option ``-DKokkos_ENABLE_CUDA_UVM=on`` or the makefile
|
||||
setting ``KOKKOS_CUDA_OPTIONS=enable_lambda,force_uvm`` enables using
|
||||
:ref:`UVM with Kokkos <kokkos>` when compiling LAMMPS.
|
||||
|
||||
Run with the KOKKOS package by editing an input script
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -423,7 +483,7 @@ in the ``kokkos-cuda.cmake`` CMake preset file.
|
||||
cmake -DKokkos_ENABLE_CUDA=yes -DKokkos_ENABLE_OPENMP=yes ../cmake
|
||||
|
||||
The suffix "/kk" is equivalent to "/kk/device", and for Kokkos CUDA,
|
||||
using the ``-sf kk`` in the command line gives the default CUDA version
|
||||
using the ``-sf kk`` in the command-line gives the default CUDA version
|
||||
everywhere. However, if the "/kk/host" suffix is added to a specific
|
||||
style in the input script, the Kokkos OpenMP (CPU) version of that
|
||||
specific style will be used instead. Set the number of OpenMP threads
|
||||
@ -439,7 +499,7 @@ For example, the command to run with 1 GPU and 8 OpenMP threads is then:
|
||||
|
||||
mpiexec -np 1 lmp_kokkos_cuda_openmpi -in in.lj -k on g 1 t 8 -sf kk
|
||||
|
||||
Conversely, if the ``-sf kk/host`` is used in the command line and then
|
||||
Conversely, if the ``-sf kk/host`` is used in the command-line and then
|
||||
the "/kk" or "/kk/device" suffix is added to a specific style in your
|
||||
input script, then only that specific style will run on the GPU while
|
||||
everything else will run on the CPU in OpenMP mode. Note that the
|
||||
@ -451,7 +511,7 @@ on the host CPU can overlap with a pair style running on the
|
||||
GPU. First compile with ``--default-stream per-thread`` added to ``CCFLAGS``
|
||||
in the Kokkos CUDA Makefile. Then explicitly use the "/kk/host"
|
||||
suffix for kspace and bonds, angles, etc. in the input file and the
|
||||
"kk" suffix (equal to "kk/device") on the command line. Also make
|
||||
"kk" suffix (equal to "kk/device") on the command-line. Also make
|
||||
sure the environment variable ``CUDA_LAUNCH_BLOCKING`` is not set to "1"
|
||||
so CPU/GPU overlap can occur.
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ Building LAMMPS with the OPENMP package
|
||||
See the :ref:`Build extras <openmp>` page for
|
||||
instructions.
|
||||
|
||||
Run with the OPENMP package from the command line
|
||||
Run with the OPENMP package from the command-line
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
These examples assume one or more 16-core nodes.
|
||||
|
||||
@ -17,7 +17,7 @@ Building LAMMPS with the OPT package
|
||||
|
||||
See the :ref:`Build extras <opt>` page for instructions.
|
||||
|
||||
Run with the OPT package from the command line
|
||||
Run with the OPT package from the command-line
|
||||
""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -501,7 +501,7 @@ Here are a few highlights of LAMMPS-GUI
|
||||
- Indicator for line that caused an error
|
||||
- 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'
|
||||
- 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
|
||||
|
||||
Parallelization
|
||||
@ -550,7 +550,7 @@ will be found automatically. 2) you can download the `Flatpak file
|
||||
*flatpak* command: ``flatpak install --user
|
||||
LAMMPS-Linux-x86_64-GUI-<version>.flatpak`` and run it with ``flatpak
|
||||
run org.lammps.lammps-gui``. The flatpak bundle also includes the
|
||||
command line version of LAMMPS and some LAMMPS tools like msi2lmp. The
|
||||
command-line version of LAMMPS and some LAMMPS tools like msi2lmp. The
|
||||
can be launched by using the ``--command`` flag. For example to run
|
||||
LAMMPS directly on the ``in.lj`` benchmark input you would type in the
|
||||
``bench`` folder: ``flatpak run --command=lmp -in in.lj`` The flatpak
|
||||
@ -608,10 +608,10 @@ would be the ``examples/COUPLE/plugin`` folder of the LAMMPS
|
||||
distribution.
|
||||
|
||||
When compiling LAMMPS-GUI with plugin support, there is an additional
|
||||
command line flag (``-p <path>`` or ``--pluginpath <path>``) which
|
||||
command-line flag (``-p <path>`` or ``--pluginpath <path>``) which
|
||||
allows to override the path to LAMMPS shared library used by the GUI.
|
||||
This is usually auto-detected on the first run and can be changed in the
|
||||
LAMMPS-GUI *Preferences* dialog. The command line flag allows to reset
|
||||
LAMMPS-GUI *Preferences* dialog. The command-line flag allows to reset
|
||||
this path to a valid value in case the original setting has become
|
||||
invalid. An empty path ("") as argument restores the default setting.
|
||||
|
||||
@ -656,7 +656,7 @@ it will create a compressed ``LAMMPS-Win10-amd64.zip`` zip file with the
|
||||
executables and required dependent .dll files. This zip file can be
|
||||
uncompressed and ``lammps-gui.exe`` run directly from there. The
|
||||
uncompressed folder can be added to the ``PATH`` environment and LAMMPS
|
||||
and LAMMPS-GUI can be launched from anywhere from the command line.
|
||||
and LAMMPS-GUI can be launched from anywhere from the command-line.
|
||||
|
||||
**MinGW64 Cross-compiler**
|
||||
|
||||
@ -876,7 +876,7 @@ the same ``LAMMPS_CACHING_DIR``. This script does the following:
|
||||
#. Start a simple local HTTP server using Python to host files for CMake
|
||||
|
||||
Afterwards, it will print out instruction on how to modify the CMake
|
||||
command line to make sure it uses the local HTTP server.
|
||||
commands to make sure it uses the local HTTP server.
|
||||
|
||||
To undo the environment changes and shutdown the local HTTP server,
|
||||
run the ``deactivate_caches`` command.
|
||||
@ -1025,7 +1025,7 @@ with those in the provided log file with the same number of processors
|
||||
in the same subdirectory. If the differences between the actual and
|
||||
reference values are within specified tolerances, the test is considered
|
||||
passed. For each test batch, that is, a set of example input scripts,
|
||||
the mpirun command, the LAMMPS command line arguments, and the
|
||||
the mpirun command, the LAMMPS command-line arguments, and the
|
||||
tolerances for individual thermo quantities can be specified in a
|
||||
configuration file in YAML format.
|
||||
|
||||
|
||||
94
doc/src/angle_mwlc.rst
Normal file
94
doc/src/angle_mwlc.rst
Normal file
@ -0,0 +1,94 @@
|
||||
.. index:: angle_style mwlc
|
||||
|
||||
angle_style mwlc command
|
||||
==========================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style mwlc
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style mwlc
|
||||
angle_coeff * 25 1 10 1
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
The *mwlc* angle style models a meltable wormlike chain and can be used
|
||||
to model non-linear bending elasticity of polymers, e.g. DNA. *mwlc*
|
||||
uses a potential that is a canonical-ensemble superposition of a
|
||||
non-melted and a melted state :ref:`(Farrell) <Farrell>`. The potential
|
||||
is
|
||||
|
||||
.. math::
|
||||
|
||||
E = -k_{B}T\,\log [q + q^{m}] + E_{0},
|
||||
|
||||
where the non-melted and melted partition functions are
|
||||
|
||||
.. math::
|
||||
q = \exp [-k_{1}(1+\cos{\theta})/k_{B}T]; \\
|
||||
q^{m} = \exp [-(\mu+k_{2}(1+\cos{\theta}))/k_{B}T].
|
||||
|
||||
:math:`k_1` is the bending elastic constant of the non-melted state,
|
||||
:math:`k_2` is the bending elastic constant of the melted state,
|
||||
:math:`\mu` is the melting energy, and
|
||||
:math:`T` is the reference temperature.
|
||||
The reference energy,
|
||||
|
||||
.. math::
|
||||
E_{0} = -k_{B}T\,\log [1 + \exp[-\mu/k_{B}T]],
|
||||
|
||||
ensures that E is zero for a fully extended chain.
|
||||
|
||||
This potential is a continuous version of the two-state potential
|
||||
introduced by :ref:`(Yan) <Yan>`.
|
||||
|
||||
The following coefficients must be defined for each angle type via the
|
||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
or :doc:`read_restart <read_restart>` commands:
|
||||
|
||||
* :math:`k_1` (energy)
|
||||
* :math:`k_2` (energy)
|
||||
* :math:`\mu` (energy)
|
||||
* :math:`T` (temperature)
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This angle style can only be used if LAMMPS was built with the
|
||||
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
|
||||
doc page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`angle_coeff <angle_coeff>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
none
|
||||
|
||||
----------
|
||||
|
||||
.. _Farrell:
|
||||
|
||||
**(Farrell)** `Farrell, Dobnikar, Podgornik, Curk, Phys Rev Lett, 133, 148101 (2024). <https://doi.org/10.1103/PhysRevLett.133.148101>`_
|
||||
|
||||
.. _Yan:
|
||||
|
||||
**(Yan)** `Yan, Marko, Phys Rev Lett, 93, 108108 (2004). <https://doi.org/10.1103/PhysRevLett.93.108108>`_
|
||||
@ -94,6 +94,7 @@ of (g,i,k,o,t) to indicate which accelerated styles exist.
|
||||
* :doc:`lepton <angle_lepton>` - angle potential from evaluating a string
|
||||
* :doc:`mesocnt <angle_mesocnt>` - piecewise harmonic and linear angle for bending-buckling of nanotubes
|
||||
* :doc:`mm3 <angle_mm3>` - anharmonic angle
|
||||
* :doc:`mwlc <angle_mwlc>` - meltable wormlike chain
|
||||
* :doc:`quartic <angle_quartic>` - angle with cubic and quartic terms
|
||||
* :doc:`spica <angle_spica>` - harmonic angle with repulsive SPICA pair style between 1-3 atoms
|
||||
* :doc:`table <angle_table>` - tabulated by angle
|
||||
|
||||
@ -132,8 +132,8 @@ or :doc:`read_restart <read_restart>` commands:
|
||||
* :math:`k_b` (force*distance/radians units)
|
||||
* :math:`f_{r,c}` (force units)
|
||||
* :math:`f_{s,c}` (force units)
|
||||
* :math:`\tau_{b,c}` (force*distance units)
|
||||
* :math:`\tau_{t,c}` (force*distance units)
|
||||
* :math:`\tau_{b,c}` (force*distance units)
|
||||
* :math:`\gamma_n` (force/velocity units)
|
||||
* :math:`\gamma_s` (force/velocity units)
|
||||
* :math:`\gamma_r` (force*distance/velocity units)
|
||||
@ -154,8 +154,11 @@ page on BPMs.
|
||||
|
||||
If the *break* keyword is set to *no*, LAMMPS assumes bonds should not break
|
||||
during a simulation run. This will prevent some unnecessary calculation.
|
||||
However, if a bond reaches a damage criterion greater than one,
|
||||
it will trigger an error.
|
||||
The recommended bond communication distance no longer depends on bond failure
|
||||
coefficients (which are ignored) but instead corresponds to the typical heuristic
|
||||
maximum strain used by typical non-bpm bond styles. Similar behavior to *break no*
|
||||
can also be attained by setting arbitrarily high values for all four failure
|
||||
coefficients. One cannot use *break no* with *smooth yes*.
|
||||
|
||||
If the *store/local* keyword is used, an internal fix will track bonds that
|
||||
break during the simulation. Whenever a bond breaks, data is processed
|
||||
|
||||
@ -117,10 +117,13 @@ page on BPMs.
|
||||
|
||||
If the *break* keyword is set to *no*, LAMMPS assumes bonds should not break
|
||||
during a simulation run. This will prevent some unnecessary calculation.
|
||||
However, if a bond reaches a strain greater than :math:`\epsilon_c`,
|
||||
it will trigger an error.
|
||||
The recommended bond communication distance no longer depends on the value of
|
||||
:math:`\epsilon_c` (which is ignored) but instead corresponds to the typical
|
||||
heuristic maximum strain used by typical non-bpm bond styles. Similar behavior
|
||||
to *break no* can also be attained by setting an arbitrarily high value of
|
||||
:math:`\epsilon_c`. One cannot use *break no* with *smooth yes*.
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
The *volume/factor* keyword toggles whether an additional multibody
|
||||
contribution is added to he force using the formulation in
|
||||
|
||||
@ -15,15 +15,12 @@ Syntax
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*mode* value = *single*, *multi*, or *multi/old* = communicate atoms within a single or multiple distances
|
||||
*mode* value = *single* or *multi* = communicate atoms within a single or multiple distances
|
||||
*cutoff* value = Rcut (distance units) = communicate atoms from this far away
|
||||
*cutoff/multi* collection value
|
||||
collection = atom collection or collection range (supports asterisk notation)
|
||||
value = Rcut (distance units) = communicate atoms for selected types from this far away
|
||||
*reduce/multi* arg = none = reduce number of communicated ghost atoms for multi style
|
||||
*cutoff/multi/old* type value
|
||||
type = atom type or type range (supports asterisk notation)
|
||||
value = Rcut (distance units) = communicate atoms for selected types from this far away
|
||||
*group* value = group-ID = only communicate atoms in the group
|
||||
*vel* value = *yes* or *no* = do or do not communicate velocity info with ghost atoms
|
||||
|
||||
@ -66,19 +63,16 @@ subdomain. The distance is by default the maximum of the neighbor
|
||||
cutoff across all atom type pairs.
|
||||
|
||||
For many systems this is an efficient algorithm, but for systems with
|
||||
widely varying cutoffs for different type pairs, the *multi* or *multi/old* mode can
|
||||
be faster. In *multi*, each atom is assigned to a collection which should
|
||||
correspond to a set of atoms with similar interaction cutoffs.
|
||||
See the :doc:`neighbor <neighbor>` command for a detailed description of collections.
|
||||
In this case, each atom collection is assigned its own distance
|
||||
cutoff for communication purposes, and fewer atoms will be
|
||||
communicated. in *multi/old*, a similar technique is used but atoms
|
||||
are grouped by atom type. See the :doc:`neighbor multi <neighbor>` and
|
||||
:doc:`neighbor multi/old <neighbor>` commands for
|
||||
widely varying cutoffs for different type pairs, the *multi* mode can be
|
||||
faster. In *multi*, each atom is assigned to a collection which should
|
||||
correspond to a set of atoms with similar interaction cutoffs. See the
|
||||
:doc:`neighbor <neighbor>` command for a detailed description of
|
||||
collections. In this case, each atom collection is assigned its own
|
||||
distance cutoff for communication purposes, and fewer atoms will be
|
||||
communicated. See the :doc:`neighbor multi <neighbor>` command for
|
||||
neighbor list construction options that may also be beneficial for
|
||||
simulations of this kind. The *multi* communication mode is only compatible
|
||||
with the *multi* neighbor style. The *multi/old* communication mode is comparable
|
||||
with both the *multi* and *multi/old* neighbor styles.
|
||||
simulations of this kind. The *multi* communication mode is only
|
||||
compatible with the *multi* neighbor style.
|
||||
|
||||
The *cutoff* keyword allows you to extend the ghost cutoff distance
|
||||
for communication mode *single*, which is the distance from the borders
|
||||
@ -108,14 +102,12 @@ simulation to account for potential changes in the number of
|
||||
collections. Custom cutoffs are preserved between runs but if
|
||||
collections are redefined, one may want to re-specify the communication
|
||||
cutoffs. For granular pair styles,the default cutoff is set to the sum
|
||||
of the current maximum atomic radii for each collection. The
|
||||
*cutoff/multi/old* option is similar to *cutoff/multi* except it
|
||||
operates on atom types as opposed to collections.
|
||||
of the current maximum atomic radii for each collection.
|
||||
|
||||
The *reduce/multi* option applies to *multi* and sets the communication
|
||||
cutoff for a particle equal to the maximum interaction distance between particles
|
||||
in the same collection. This reduces the number of
|
||||
ghost atoms that need to be communicated. This method is only compatible with the
|
||||
cutoff for a particle equal to the maximum interaction distance between
|
||||
particles in the same collection. This reduces the number of ghost atoms
|
||||
that need to be communicated. This method is only compatible with the
|
||||
*multi* neighbor style and requires a half neighbor list and Newton on.
|
||||
See the :doc:`neighbor multi <neighbor>` command for more information.
|
||||
|
||||
|
||||
@ -236,6 +236,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
|
||||
* :doc:`fep/ta <compute_fep_ta>` - compute free energies for a test area perturbation
|
||||
* :doc:`force/tally <compute_tally>` - force between two groups of atoms via the tally callback mechanism
|
||||
* :doc:`fragment/atom <compute_cluster_atom>` - fragment ID for each atom
|
||||
* :doc:`gaussian/grid/local <compute_gaussian_grid_local>` - local array of Gaussian atomic contributions on a regular grid
|
||||
* :doc:`global/atom <compute_global_atom>` - assign global values to each atom from arrays of global values
|
||||
* :doc:`group/group <compute_group_group>` - energy/force between two groups of atoms
|
||||
* :doc:`gyration <compute_gyration>` - radius of gyration of group of atoms
|
||||
|
||||
99
doc/src/compute_gaussian_grid_local.rst
Normal file
99
doc/src/compute_gaussian_grid_local.rst
Normal file
@ -0,0 +1,99 @@
|
||||
.. index:: compute gaussian/grid/local
|
||||
.. index:: compute gaussian/grid/local/kk
|
||||
|
||||
compute gaussian/grid/local command
|
||||
===================================
|
||||
|
||||
Accelerator Variants: *gaussian/grid/local/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute ID group-ID gaussian/grid/local grid nx ny nz rcutfac R_1 R_2 ... sigma_1 sigma_2
|
||||
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* gaussian/grid/local = style name of this compute command
|
||||
* *grid* values = nx, ny, nz, number of grid points in x, y, and z directions (positive integer)
|
||||
* *rcutfac* = scale factor applied to all cutoff radii (positive real)
|
||||
* *R_1, R_2,...* = list of cutoff radii, one for each type (distance units)
|
||||
* *sigma_1, sigma_2,...* = Gaussian widths, one for each type (distance units)
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute mygrid all gaussian/grid/local grid 40 40 40 4.0 0.5 0.5 0.4 0.4
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
Define a computation that calculates a Gaussian representation of the ionic
|
||||
structure. This representation is used for the efficient evaluation
|
||||
of quantities related to the structure factor in a grid-based workflow,
|
||||
such as the ML-DFT workflow MALA :ref:`(Ellis) <Ellis2021b>`, for which it was originally
|
||||
implemented. Usage of the workflow is described in a separate publication :ref:`(Fiedler) <Fiedler2023>`.
|
||||
|
||||
For each LAMMPS type, a separate sum of Gaussians is calculated, using
|
||||
a separate Gaussian broadening per type. The computation
|
||||
is always performed on the numerical grid, no atom-based version of this
|
||||
compute exists. The Gaussian representation can only be executed in a local
|
||||
fashion, thus the output array only contains rows for grid points
|
||||
that are local to the processor subdomain. The layout of the grid is the same
|
||||
as for the see :doc:`sna/grid/local <compute_sna_atom>` command.
|
||||
|
||||
Namely, the array contains one row for each of the
|
||||
local grid points, looping over the global index *ix* fastest,
|
||||
then *iy*, and *iz* slowest. Each row of the array contains
|
||||
the global indexes *ix*, *iy*, and *iz* first, followed by the *x*, *y*,
|
||||
and *z* coordinates of the grid point, followed by the values of the Gaussians
|
||||
(one floating point number per type per grid point).
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
|
||||
|
||||
----------
|
||||
|
||||
Output info
|
||||
"""""""""""
|
||||
|
||||
Compute *gaussian/grid/local* evaluates a local array.
|
||||
The array contains one row for each of the
|
||||
local grid points, looping over the global index *ix* fastest,
|
||||
then *iy*, and *iz* slowest. The array contains math :math:`ntypes+6` columns,
|
||||
where *ntypes* is the number of LAMMPS types. The first three columns are
|
||||
the global indexes *ix*, *iy*, and *iz*, followed by the *x*, *y*,
|
||||
and *z* coordinates of the grid point, followed by the *ntypes* columns
|
||||
containing the values of the Gaussians for each type.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
These computes are part of the ML-SNAP package. They are only enabled
|
||||
if LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`compute sna/grid/local <compute_sna_atom>`
|
||||
|
||||
----------
|
||||
|
||||
.. _Ellis2021b:
|
||||
|
||||
**(Ellis)** Ellis, Fiedler, Popoola, Modine, Stephens, Thompson, Cangi, Rajamanickam, `Phys. Rev. B, 104, 035120, (2021) <https://doi.org/10.1103/PhysRevB.104.035120>`_
|
||||
|
||||
.. _Fiedler2023:
|
||||
|
||||
**(Fiedler)** Fiedler, Modine, Schmerler, Vogel, Popoola, Thompson, Rajamanickam, and Cangi,
|
||||
`npj Comp. Mater., 9, 115 (2023) <https://doi.org/10.1038/s41524-023-01070-z>`_
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
.. index:: compute snav/atom
|
||||
.. index:: compute snap
|
||||
.. index:: compute sna/grid
|
||||
.. index:: compute sna/grid/kk
|
||||
.. index:: compute sna/grid/local
|
||||
.. index:: compute sna/grid/local/kk
|
||||
|
||||
compute sna/atom command
|
||||
========================
|
||||
@ -20,9 +22,14 @@ compute snap command
|
||||
compute sna/grid command
|
||||
========================
|
||||
|
||||
compute sna/grid/kk command
|
||||
===========================
|
||||
|
||||
compute sna/grid/local command
|
||||
==============================
|
||||
|
||||
Accelerator Variants: *sna/grid/local/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -33,17 +40,17 @@ Syntax
|
||||
compute ID group-ID snav/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID snap rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID snap rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID sna/grid nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID sna/grid/local nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID sna/grid grid nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
compute ID group-ID sna/grid/local grid nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
|
||||
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* sna/atom = style name of this compute command
|
||||
* rcutfac = scale factor applied to all cutoff radii (positive real)
|
||||
* rfac0 = parameter in distance to angle conversion (0 < rcutfac < 1)
|
||||
* twojmax = band limit for bispectrum components (non-negative integer)
|
||||
* R_1, R_2,... = list of cutoff radii, one for each type (distance units)
|
||||
* w_1, w_2,... = list of neighbor weights, one for each type
|
||||
* nx, ny, nz = number of grid points in x, y, and z directions (positive integer)
|
||||
* *rcutfac* = scale factor applied to all cutoff radii (positive real)
|
||||
* *rfac0* = parameter in distance to angle conversion (0 < rcutfac < 1)
|
||||
* *twojmax* = band limit for bispectrum components (non-negative integer)
|
||||
* *R_1, R_2,...* = list of cutoff radii, one for each type (distance units)
|
||||
* *w_1, w_2,...* = list of neighbor weights, one for each type
|
||||
* *grid* values = nx, ny, nz, number of grid points in x, y, and z directions (positive integer)
|
||||
* zero or more keyword/value pairs may be appended
|
||||
* keyword = *rmin0* or *switchflag* or *bzeroflag* or *quadraticflag* or *chem* or *bnormflag* or *wselfallflag* or *bikflag* or *switchinnerflag* or *sinner* or *dinner* or *dgradflag* or *nnn* or *wmode* or *delta*
|
||||
|
||||
@ -103,7 +110,7 @@ Examples
|
||||
compute snap all snap 1.4 0.95 6 2.0 1.0
|
||||
compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 chem 2 0 1
|
||||
compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 switchinnerflag 1 sinner 1.35 1.6 dinner 0.25 0.3
|
||||
compute bgrid all sna/grid/local 200 200 200 1.4 0.95 6 2.0 1.0
|
||||
compute bgrid all sna/grid/local grid 200 200 200 1.4 0.95 6 2.0 1.0
|
||||
compute bnnn all sna/atom 9.0 0.99363 8 0.5 1.0 rmin0 0.0 nnn 24 wmode 1 delta 0.2
|
||||
|
||||
Description
|
||||
@ -252,7 +259,8 @@ for finite-temperature Kohn-Sham density functional theory (:ref:`Ellis
|
||||
et al. <Ellis2021>`) Neighbor atoms not in the group do not contribute
|
||||
to the bispectrum components of the grid points. The distance cutoff
|
||||
:math:`R_{ii'}` assumes that *i* has the same type as the neighbor atom
|
||||
*i'*.
|
||||
*i'*. Both computes can be hardware accelerated with Kokkos by using the
|
||||
*sna/grid/kk* and *sna/grid/local/kk* commands, respectively.
|
||||
|
||||
Compute *sna/grid* calculates a global array containing bispectrum
|
||||
components for a regular grid of points.
|
||||
@ -463,6 +471,12 @@ fluctuations in the resulting local atomic environment fingerprint. The
|
||||
detailed formalism is given in the paper by Lafourcade et
|
||||
al. :ref:`(Lafourcade) <Lafourcade2023_2>`.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
|
||||
----------
|
||||
|
||||
Output info
|
||||
@ -654,7 +668,7 @@ of Angular Momentum, World Scientific, Singapore (1987).
|
||||
|
||||
.. _Ellis2021:
|
||||
|
||||
**(Ellis)** Ellis, Fiedler, Popoola, Modine, Stephens, Thompson, Cangi, Rajamanickam, Phys Rev B, 104, 035120, (2021)
|
||||
**(Ellis)** Ellis, Fiedler, Popoola, Modine, Stephens, Thompson, Cangi, Rajamanickam, `Phys. Rev. B, 104, 035120, (2021) <https://doi.org/10.1103/PhysRevB.104.035120>`_
|
||||
|
||||
.. _Lafourcade2023_2:
|
||||
|
||||
|
||||
@ -33,6 +33,12 @@ particle.
|
||||
See `this PDF guide <PDF/SPH_LAMMPS_userguide.pdf>`_ to using SPH in
|
||||
LAMMPS.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that the SPH PDF guide file has not been updated for
|
||||
many years and thus does not reflect the current *syntax* of the
|
||||
SPH package commands. For that please refer to the LAMMPS manual.
|
||||
|
||||
The value of the internal energy will be 0.0 for atoms not in the
|
||||
specified compute group.
|
||||
|
||||
|
||||
@ -32,6 +32,12 @@ kernel function interpolation using "pair style sph/rhosum".
|
||||
See `this PDF guide <PDF/SPH_LAMMPS_userguide.pdf>`_ to using SPH in
|
||||
LAMMPS.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that the SPH PDF guide file has not been updated for
|
||||
many years and thus does not reflect the current *syntax* of the
|
||||
SPH package commands. For that please refer to the LAMMPS manual.
|
||||
|
||||
The value of the SPH density will be 0.0 for atoms not in the
|
||||
specified compute group.
|
||||
|
||||
|
||||
@ -37,6 +37,12 @@ particles, i.e. a Smooth-Particle Hydrodynamics particle.
|
||||
See `this PDF guide <PDF/SPH_LAMMPS_userguide.pdf>`_ to using SPH in
|
||||
LAMMPS.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that the SPH PDF guide file has not been updated for
|
||||
many years and thus does not reflect the current *syntax* of the
|
||||
SPH package commands. For that please refer to the LAMMPS manual.
|
||||
|
||||
The value of the internal energy will be 0.0 for atoms not in the
|
||||
specified compute group.
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ This array can be output with :doc:`fix ave/time <fix_ave_time>`,
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute 1 all stress/spherical 0 0 0 0.1 10
|
||||
compute p all stress/spherical 0 0 0 0.1 10
|
||||
fix 2 all ave/time 100 1 100 c_p[*] file dump_p.out mode vector
|
||||
|
||||
The values calculated by this compute are "intensive". The stress
|
||||
|
||||
@ -184,11 +184,24 @@ temp/chunk calculation to a file is to use the
|
||||
The keyword/value option pairs are used in the following ways.
|
||||
|
||||
The *com* keyword can be used with a value of *yes* to subtract the
|
||||
velocity of the center-of-mass for each chunk from the velocity of the
|
||||
atoms in that chunk, before calculating either the global or per-chunk
|
||||
temperature. This can be useful if the atoms are streaming or
|
||||
velocity of the center-of-mass (VCM) for each chunk from the velocity of
|
||||
the atoms in that chunk, before calculating either the global or per-chunk
|
||||
temperature. This can be useful if the atoms are streaming or
|
||||
otherwise moving collectively, and you wish to calculate only the
|
||||
thermal temperature.
|
||||
thermal temperature. This per-chunk VCM bias can be used in other fixes and
|
||||
computes that can incorporate a temperature bias. If this compute is used
|
||||
as a temperature bias in other commands then this bias is subtracted from
|
||||
each atom, the command runs with the remaining thermal velocities, and
|
||||
then the bias is added back in. This includes thermostatting
|
||||
fixes like :doc:`fix nvt <fix_nh>`,
|
||||
:doc:`fix temp/rescale <fix_temp_rescale>`,
|
||||
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
|
||||
:doc:`fix langevin <fix_langevin>`, and computes like
|
||||
:doc:`compute stress/atom <compute_stress_atom>` and
|
||||
:doc:`compute pressure <compute_pressure>`. See the input script in
|
||||
examples/stress_vcm for an example of how to use the *com* keyword in
|
||||
conjunction with compute stress/atom to create a stress profile of a rigid
|
||||
body while removing the overall motion of the rigid body.
|
||||
|
||||
For the *bias* keyword, *bias-ID* refers to the ID of a temperature
|
||||
compute that removes a "bias" velocity from each atom. This also
|
||||
|
||||
@ -62,6 +62,18 @@ For all styles, by default, an interaction is only turned off (or on)
|
||||
if all the atoms involved are in the specified group. See the *any*
|
||||
keyword to change the behavior.
|
||||
|
||||
.. admonition:: Possible errors caused by using *delete_bonds*
|
||||
:class: warning
|
||||
|
||||
Since this command by default only *turns off* bonded interactions,
|
||||
their definitions are still present and subject to the limitations
|
||||
due to LAMMPS' domain decomposition based parallelization. That is,
|
||||
when a bond is turned off, the two constituent atoms may move apart
|
||||
and may reach a distance where they can lead to a "bond atoms missing"
|
||||
error and crash the simulation. Adding the *remove* keyword (see
|
||||
below) is required to fully remove those interactions and prevent
|
||||
the error.
|
||||
|
||||
Several of the styles (\ *atom*, *bond*, *angle*, *dihedral*, *improper*\ )
|
||||
take a *type* as an argument. The specified *type* can be a
|
||||
:doc:`type label <Howto_type_labels>`. Otherwise, the type should be an
|
||||
@ -98,15 +110,18 @@ of all interactions in the specified group is simply reported. This
|
||||
is useful for diagnostic purposes if bonds have been turned off by a
|
||||
bond-breaking potential during a previous run.
|
||||
|
||||
The default behavior of the delete_bonds command is to turn off
|
||||
interactions by toggling their type to a negative value, but not to
|
||||
permanently remove the interaction. For example, a bond_type of 2 is set to
|
||||
:math:`-2.` The neighbor list creation routines will not include such an
|
||||
interaction in their interaction lists. The default is also to not
|
||||
alter the list of 1--2, 1--3, or 1--4 neighbors computed by the
|
||||
:doc:`special_bonds <special_bonds>` command and used to weight pairwise
|
||||
force and energy calculations. This means that pairwise computations
|
||||
will proceed as if the bond (or angle, etc.) were still turned on.
|
||||
.. admonition:: Impact on special_bonds processing and exclusions
|
||||
:class: note
|
||||
|
||||
The default behavior of the delete_bonds command is to turn off
|
||||
interactions by toggling their type to a negative value, but not to
|
||||
permanently remove the interaction. For example, a bond_type of 2 is set to
|
||||
:math:`-2.` The neighbor list creation routines will not include such an
|
||||
interaction in their interaction lists. The default is also to not
|
||||
alter the list of 1--2, 1--3, or 1--4 neighbors computed by the
|
||||
:doc:`special_bonds <special_bonds>` command and used to weight pairwise
|
||||
force and energy calculations. This means that pairwise computations
|
||||
will proceed as if the bond (or angle, etc.) were still turned on.
|
||||
|
||||
Several keywords can be appended to the argument list to alter the
|
||||
default behaviors.
|
||||
@ -138,9 +153,11 @@ operation, after (optional) removal. It re-computes the pairwise 1--2,
|
||||
turned-off bonds the same as turned-on. Thus, turned-off bonds must
|
||||
be removed if you wish to change the weighting list.
|
||||
|
||||
Note that the choice of *remove* and *special* options affects how
|
||||
1--2, 1--3, 1--4 pairwise interactions will be computed across bonds that
|
||||
have been modified by the delete_bonds command.
|
||||
.. note::
|
||||
|
||||
The choice of *remove* and *special* options affects how 1--2,
|
||||
1--3, 1--4 pairwise interactions will be computed across bonds
|
||||
that have been modified by the delete_bonds command.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -681,7 +681,7 @@ MPEG or other movie file you can use:
|
||||
|
||||
* c) Use FFmpeg
|
||||
|
||||
FFmpeg is a command line tool that is available on many platforms and
|
||||
FFmpeg is a command-line tool that is available on many platforms and
|
||||
allows extremely flexible encoding and decoding of movies.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -237,6 +237,7 @@ accelerated styles exist.
|
||||
* :doc:`dt/reset <fix_dt_reset>` - reset the timestep based on velocity, forces
|
||||
* :doc:`edpd/source <fix_dpd_source>` - add heat source to eDPD simulations
|
||||
* :doc:`efield <fix_efield>` - impose electric field on system
|
||||
* :doc:`efield/lepton <fix_efield_lepton>` - impose electric field on system using a Lepton expression for the potential
|
||||
* :doc:`efield/tip4p <fix_efield>` - impose electric field on system with TIP4P molecules
|
||||
* :doc:`ehex <fix_ehex>` - enhanced heat exchange algorithm
|
||||
* :doc:`electrode/conp <fix_electrode>` - impose electric potential
|
||||
|
||||
@ -406,6 +406,8 @@ sub-style name. The angle styles that currently work with fix adapt are:
|
||||
+--------------------------------------------------------------------+--------------------+-------------+
|
||||
| :doc:`mm3 <angle_mm3>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+--------------------+-------------+
|
||||
| :doc:`mwlc <angle_mwlc>` | k1,k2,mu,T | type angles |
|
||||
+--------------------------------------------------------------------+--------------------+-------------+
|
||||
| :doc:`quartic <angle_quartic>` | k2,k3,k4,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+--------------------+-------------+
|
||||
| :doc:`spica <angle_spica>` | k,theta0 | type angles |
|
||||
|
||||
@ -45,8 +45,9 @@ Description
|
||||
|
||||
Add a force :math:`\vec{F} = q\vec{E}` to each charged atom in the group due to an
|
||||
external electric field being applied to the system. If the system
|
||||
contains point-dipoles, also add a torque on the dipoles due to the
|
||||
external electric field.
|
||||
contains point-dipoles, also add a torque :math:`\vec{T} = \vec{p} \times \vec{E}` on the dipoles due to the
|
||||
external electric field. This fix does not compute the dipole force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}`,
|
||||
and the :doc:`fix efield/lepton <fix_efield_lepton>` command should be used instead.
|
||||
|
||||
.. versionadded:: 28Mar2023
|
||||
|
||||
@ -68,6 +69,7 @@ For point-dipoles, equal-style variables can be used, but atom-style
|
||||
variables are not currently supported, since they imply a spatial
|
||||
gradient in the electric field which means additional terms with
|
||||
gradients of the field are required for the force and torque on dipoles.
|
||||
The :doc:`fix efield/lepton <fix_efield_lepton>` command should be used instead.
|
||||
|
||||
Equal-style variables can specify formulas with various mathematical
|
||||
functions, and include :doc:`thermo_style <thermo_style>` command
|
||||
@ -229,7 +231,7 @@ Fix style *efield/tip4p* can only be used with tip4p pair styles.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`fix addforce <fix_addforce>`
|
||||
:doc:`fix addforce <fix_addforce>`, :doc:`fix efield/lepton <fix_efield_lepton>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
143
doc/src/fix_efield_lepton.rst
Normal file
143
doc/src/fix_efield_lepton.rst
Normal file
@ -0,0 +1,143 @@
|
||||
.. index:: fix efield/lepton
|
||||
|
||||
fix efield/lepton command
|
||||
=========================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix ID group-ID efield/lepton V ...
|
||||
|
||||
* ID, group-ID are documented in the :doc:`fix <fix>` command
|
||||
* style = *efield/lepton*
|
||||
* V = electric potential (electric field * distance units)
|
||||
* V must be a Lepton expression (see below)
|
||||
* zero or more keyword/value pairs may be appended to args
|
||||
* keyword = *region* or *step*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*region* value = region-ID
|
||||
region-ID = ID of region atoms must be in to have effect
|
||||
*step* value = h
|
||||
h = step size for numerical differentiation (distance units)
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix ex all efield/lepton "-E*x; E=1"
|
||||
fix dexx all efield/lepton "-0.5*x^2" step 1
|
||||
fix yukawa all efield/lepton "A*exp(-B*r)/r; r=abs(sqrt(x^2+y^2+z^2)); A=1; B=1" step 1e-6
|
||||
fix infp all efield/lepton "-abs(x)" step 1
|
||||
|
||||
variable th equal 2*PI*ramp(0,1)
|
||||
fix erot all efield/lepton "-(x*cos(v_th)+y*sin(v_th))"
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: 4Feb2025
|
||||
|
||||
Add an electric potential :math:`V` that applies to a group of charged atoms a force :math:`\vec{F} = q \vec{E}`,
|
||||
and to dipoles a force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}` and torque :math:`\vec{T} = \vec{p} \times \vec{E}`,
|
||||
where :math:`\vec{E} = - \nabla V`. The fix also evaluates the electrostatic energy (:math:`U_{q} = q V` and :math:`U_{p} = - \vec{p} \cdot \vec{E}`)
|
||||
due to this potential when the :doc:`fix_modify energy yes <fix_modify>` command is specified (see below).
|
||||
|
||||
.. note::
|
||||
|
||||
This command should be used instead of :doc:`fix efield <fix_efield>` if you want to impose a non-uniform electric field on a system with dipoles
|
||||
since the latter does not include the dipole force term. If you only have charges or if the electric field gradient is negligible,
|
||||
:doc:`fix efield <fix_efield>` should be used since it is faster.
|
||||
|
||||
The `Lepton library <https://simtk.org/projects/lepton>`_, that the *efield/lepton* fix style interfaces with, evaluates
|
||||
the expression string at run time to compute the energy, forces, and torques. It creates an analytical representation
|
||||
of :math:`V` and :math:`\vec{E}`, while the gradient force is computed using a central difference scheme
|
||||
|
||||
.. math::
|
||||
|
||||
\vec{F} = \frac{|\vec{p}|}{2h} \left[ \vec{E}(\vec{x} + h \hat{p}) - \vec{E}(\vec{x} - h \hat{p}) \right] .
|
||||
|
||||
The Lepton expression must be either enclosed in quotes or must not contain any whitespace so that LAMMPS
|
||||
recognizes it as a single keyword. More on valid Lepton expressions below. The final Lepton expression must
|
||||
be a function of only :math:`x, y, z`, which refer to the current *unwrapped* coordinates of the atoms to ensure continuity.
|
||||
Special care must be taken when using this fix with periodic boundary conditions or box-changing commands.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: lepton_expression.rst
|
||||
|
||||
----------
|
||||
|
||||
If the *region* keyword is used, the atom must also be in the specified
|
||||
geometric :doc:`region <region>` in order to be affected by the potential.
|
||||
|
||||
The *step* keyword is required when :doc:`atom_style dipole <atom_style>` is used and the electric field is non-uniform.
|
||||
|
||||
----------
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential energy defined above to the global potential energy
|
||||
of the system as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The default setting for this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the contribution due to the added ***forces*** on charges and dipoles
|
||||
to both the global pressure and per-atom stress of the system via the
|
||||
:doc:`compute pressure <compute_pressure>` and :doc:`compute stress/atom
|
||||
<compute_stress_atom>` commands. The former can be accessed by
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify virial no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||
integrator the fix adding its forces. Default is the outermost level.
|
||||
|
||||
This fix computes a global scalar and a global 3-vector of forces,
|
||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
||||
The scalar is the potential energy discussed above.
|
||||
The vector is the total force added to the group of atoms.
|
||||
The scalar and vector values calculated by this fix are "extensive".
|
||||
|
||||
This fix cannot be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
The forces due to this fix are imposed during an energy minimization,
|
||||
invoked by the :doc:`minimize <minimize>` command. You should not
|
||||
specify force components with a variable that has time-dependence for
|
||||
use with a minimizer, since the minimizer increments the timestep as
|
||||
the iteration count during the minimization.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want the electric potential energy to be included in the
|
||||
total potential energy of the system (the quantity being minimized),
|
||||
you MUST enable the :doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
Fix style *efield/lepton* is part of the LEPTON 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 efield <fix_efield>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
none
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user