Compare commits
1225 Commits
stable_29S
...
patch_17Fe
| Author | SHA1 | Date | |
|---|---|---|---|
| 01bbb28418 | |||
| 7fe194e59e | |||
| f3e14e7b00 | |||
| 45b92e519d | |||
| d95f0b3cd5 | |||
| 793d76c546 | |||
| 12eeaee8a4 | |||
| 8b627f92f0 | |||
| 78b123fa4d | |||
| 47bb5f5ccd | |||
| e541f006eb | |||
| 08968cbdbf | |||
| 32cde04000 | |||
| 6d2f4343d9 | |||
| a7939b582a | |||
| 2951eb32a4 | |||
| 55703f9027 | |||
| d4bbb31270 | |||
| f53fbf09a6 | |||
| f3c055e637 | |||
| d9e06e326a | |||
| c2d59d5d5e | |||
| e3222a4bd0 | |||
| 618b3ec94f | |||
| 9a200c9b79 | |||
| c46dd3675a | |||
| b0c0251154 | |||
| c65dbd338b | |||
| 702a2dd3f6 | |||
| 5f47ff770c | |||
| baf443766a | |||
| f84790ba62 | |||
| 8431d72d75 | |||
| 5366621947 | |||
| f4ce0f0b1c | |||
| 37cd4ba2ea | |||
| 1a436c5aa9 | |||
| fbf95c2cbc | |||
| 1a6b627fa0 | |||
| 12f746046f | |||
| 3bc91386a0 | |||
| 1307371942 | |||
| b42aebc197 | |||
| 83beffbb9f | |||
| 810717bfe5 | |||
| 1ab5b9d7fd | |||
| 1c7e1faeff | |||
| 6887a16fa1 | |||
| 193dea6327 | |||
| 159f107abd | |||
| bae4e45978 | |||
| 9d518ee1e2 | |||
| 55a500cf8a | |||
| 4eedfeb774 | |||
| 78d149f118 | |||
| d85788305d | |||
| 4343e8194c | |||
| 096ea21dd9 | |||
| 8808b11d26 | |||
| 2fdadcfeb6 | |||
| 0113346e54 | |||
| 3cca41b72e | |||
| 69d3b1ebf3 | |||
| 0f5fbf1c42 | |||
| 06d4bb3faf | |||
| e9b11e3673 | |||
| a77680ac7b | |||
| 99c1b935b5 | |||
| eb2fe7d982 | |||
| 75dc7125e6 | |||
| e5dec93a1e | |||
| 922b240678 | |||
| a5fe8b0581 | |||
| a17bdf5652 | |||
| 81587527fe | |||
| de08307aba | |||
| 54f975ff52 | |||
| df02598fc1 | |||
| 6a0e93a18a | |||
| 5ab9b46b67 | |||
| a4244eb7ff | |||
| 04cff0b47b | |||
| a8dbb3a172 | |||
| ea94095bf6 | |||
| ecd072a286 | |||
| 1f6c4089bd | |||
| d750ef4890 | |||
| c32dca2009 | |||
| 4ea4bee30c | |||
| 61ff5250ee | |||
| e94854d54f | |||
| 9b1a267d85 | |||
| ab1e68eb42 | |||
| 4d5bb08ead | |||
| 60d03f34cc | |||
| 6366972ef4 | |||
| 44ded1c1fe | |||
| df00d2225a | |||
| 75f32a60a5 | |||
| c2ef4425c6 | |||
| 08b16f1f23 | |||
| a17a45c761 | |||
| ce83ca1efd | |||
| 861195130c | |||
| 75727ed5af | |||
| 8e2581042e | |||
| b01716472b | |||
| b75c306543 | |||
| 2445f85dde | |||
| 044ada9f2b | |||
| e4b5245f4d | |||
| 35a4c0f501 | |||
| 2dfeb96fda | |||
| 093c54d8ed | |||
| a7084c8fdb | |||
| 2548c49876 | |||
| 8209ae9513 | |||
| 59def25eb6 | |||
| d91c1ff1f0 | |||
| a2ff443838 | |||
| bae6526b5f | |||
| 50a7d4e7fc | |||
| ea0f31c997 | |||
| f45663bfc2 | |||
| 0ff3ee0227 | |||
| 293d529ee9 | |||
| c0bae49956 | |||
| c0ee491f18 | |||
| 6edb50b405 | |||
| 9bfd6375eb | |||
| 7d0b4cc131 | |||
| 8fbaaffd3e | |||
| 2137ad04fd | |||
| a56922edc9 | |||
| 75f389f70c | |||
| 22efbaf977 | |||
| 050ce421e9 | |||
| f804ea89b9 | |||
| 2a7823686d | |||
| 6bfb7a5521 | |||
| f550460ecd | |||
| 36c1db820f | |||
| 41da32d7de | |||
| 3ba85bc68d | |||
| 2627e404b0 | |||
| c6a17b900e | |||
| b7b7a74c52 | |||
| 82ac7c9e12 | |||
| efcb402fdc | |||
| d9c51ca124 | |||
| 172f88a0d5 | |||
| 8f07289ed7 | |||
| e15ca1eeef | |||
| 76c57d54c1 | |||
| 705bfc10a1 | |||
| 91614b64d2 | |||
| a6a2492282 | |||
| b2916339a4 | |||
| a124ee4f44 | |||
| dd416f61b5 | |||
| cfd720e1fc | |||
| 5d28d06a3c | |||
| f537a31c19 | |||
| 5142d8e968 | |||
| 9a81dc58a1 | |||
| d80ba0d57a | |||
| 7ee7d0c570 | |||
| 3707b327c0 | |||
| a8a76dbbe2 | |||
| 2e39971cbc | |||
| 579ac61b5b | |||
| fea41d5458 | |||
| af8d1bd768 | |||
| 65b198f986 | |||
| 4b22962ec1 | |||
| f8a4006da7 | |||
| dc0e013297 | |||
| 99cb494594 | |||
| b17d8b4494 | |||
| 213259b732 | |||
| 4bb7457d6e | |||
| 923b0cfc46 | |||
| a8632d5cb6 | |||
| ebeb29adf6 | |||
| 6ff157a099 | |||
| 33be5ff0b4 | |||
| cc0d91b222 | |||
| 571821694e | |||
| 02cadf1b71 | |||
| 6c98915a9c | |||
| 0bfc5269dd | |||
| 9014664c13 | |||
| c420f804d9 | |||
| a1d186b5fa | |||
| cd5d1f8a30 | |||
| 9323a09b39 | |||
| c464c40d67 | |||
| 7b3adb3f1a | |||
| c9de8fca1d | |||
| 75d0a5098f | |||
| bd4814a51e | |||
| 845ab2dd71 | |||
| d62e25decc | |||
| dad72a612a | |||
| 481bcfcd14 | |||
| ee98f023b6 | |||
| 17960c8183 | |||
| 9427eb800f | |||
| c1185acad7 | |||
| d6fa3a08cd | |||
| 8423ecb211 | |||
| 7978bf671d | |||
| 5c0c3df035 | |||
| fbecf0051e | |||
| a9481733a0 | |||
| c28b7c586a | |||
| 6258cf1b9d | |||
| e8ce01079d | |||
| f6d0be1257 | |||
| 96502ae49d | |||
| 1d51f2d151 | |||
| 2a3a7c387b | |||
| e5b129fe8d | |||
| 41c1c64be9 | |||
| e76c8bbaa3 | |||
| 4225c6c288 | |||
| 9feec51590 | |||
| d6a6f64576 | |||
| 17cb137f3e | |||
| bb89347bac | |||
| 7aa17fbdf7 | |||
| d3c45d3389 | |||
| ef96b51a25 | |||
| db4e69bf38 | |||
| ac815fdfba | |||
| e4fe0a37a1 | |||
| cd8b674f4b | |||
| 0bf941219f | |||
| d391ae845b | |||
| 265588d480 | |||
| 62ff23abe7 | |||
| 735d6926a1 | |||
| b3647d8e94 | |||
| a6ef114bfb | |||
| 293f4eb0ed | |||
| 2ed8e5cf02 | |||
| 415476983d | |||
| 9b6bb00d07 | |||
| d51017ff50 | |||
| d861dbe8e0 | |||
| 71a373cadb | |||
| 8ca1004c03 | |||
| 120662c438 | |||
| cdd23ac9c2 | |||
| 3297ed7c5f | |||
| 75a00f4d11 | |||
| 64dbce26dc | |||
| 35dbabd471 | |||
| 0b693e729d | |||
| c914fc6baf | |||
| 67af170929 | |||
| cb9ba8c0a3 | |||
| a80f7ed11f | |||
| aeb25b5a37 | |||
| 1d60e4c463 | |||
| 16810b84eb | |||
| f9a2006d73 | |||
| 88dadd0fff | |||
| cd16556256 | |||
| 81e7583a8d | |||
| f814dc5ff9 | |||
| 458ae4e38a | |||
| d854e58d00 | |||
| c93fba5e2d | |||
| 900ff39403 | |||
| 7aed8954a5 | |||
| ef2969dfbf | |||
| 79a9829e92 | |||
| 3e3cd4c94d | |||
| 3286fcb13a | |||
| c16caea13b | |||
| 384b715d8c | |||
| 12d708b97c | |||
| 44bc766060 | |||
| 06beb28d7d | |||
| 6506be9409 | |||
| ff3f762499 | |||
| f83271aa40 | |||
| 0d4bbf60e6 | |||
| 57def1a2d5 | |||
| 75d20c40ed | |||
| 3311b1344c | |||
| 3a6bd2e698 | |||
| 67dec40afa | |||
| 9c8431bf87 | |||
| 557e25d6fb | |||
| 4e89488f27 | |||
| d4ec931991 | |||
| 7387643b87 | |||
| 5e37f9d5a7 | |||
| 586cf6c3bf | |||
| e73158bd7e | |||
| 4104353d7a | |||
| 49dca516ea | |||
| 7c9b0c1e8e | |||
| 5c62dc0986 | |||
| c9776dad6f | |||
| dbe267cb88 | |||
| 0b24c5b498 | |||
| 06cb86dfb9 | |||
| 7aaa85c3a1 | |||
| 32a19d982a | |||
| 222ea31d8d | |||
| 7ee3171d16 | |||
| b45a6d7720 | |||
| a0e2a617e0 | |||
| 9d8394fe63 | |||
| c166549c74 | |||
| b8d4030983 | |||
| e283bfa1fa | |||
| b7dc1d9dd6 | |||
| 6e8d9cb532 | |||
| 0a8cbcef2b | |||
| 0a89e5bd24 | |||
| 4f0cde40fd | |||
| 4cd5c40374 | |||
| 7573e60a1e | |||
| c85cdb2732 | |||
| 7676f66674 | |||
| f5ad91f9fe | |||
| 0595e4d7cd | |||
| c4c3b545b2 | |||
| e22f62f6db | |||
| b890b564ca | |||
| ef13455d6b | |||
| 0099d2584b | |||
| 778879a0eb | |||
| 1792b3b0cf | |||
| d19f799585 | |||
| 576f2266ae | |||
| be7e6d0939 | |||
| 38bcc493b0 | |||
| 389c35a2d3 | |||
| 1c8f427e8a | |||
| 29b5c2659c | |||
| c1f7685c98 | |||
| 2e85233b11 | |||
| 752552e0f8 | |||
| a02e11040d | |||
| f0f4a8e6dc | |||
| 241a44f1af | |||
| e1d028ec88 | |||
| 5530927bd4 | |||
| af231d5447 | |||
| 8b89be6061 | |||
| a93e5baa73 | |||
| cb796e8b60 | |||
| dc6e558191 | |||
| 0eeb3b203c | |||
| 943fe487b5 | |||
| 1e7969c7b9 | |||
| aa71ea6c40 | |||
| e271a54802 | |||
| 11cc8a6a59 | |||
| ed702b9309 | |||
| dcb1ddb282 | |||
| 2213eb8d3f | |||
| 7afa22f045 | |||
| 698256f4fe | |||
| e0cde6270e | |||
| 240db21054 | |||
| 8aaae8e6ee | |||
| 40c140e56e | |||
| 878557dd48 | |||
| 1f81e2afad | |||
| 11d66f8f1d | |||
| e3dd2908d9 | |||
| b300a93b67 | |||
| 1f924e9fc1 | |||
| 9c9bc4790b | |||
| 8e0622d523 | |||
| 3ff2f53ead | |||
| e5416a9fee | |||
| 4aba9e9bb6 | |||
| 40abc0886c | |||
| d0f203127d | |||
| 12420181e1 | |||
| 8ae68d71dd | |||
| ede7787741 | |||
| f557bf6e20 | |||
| fd3884d705 | |||
| 1225b609d8 | |||
| 6a73fc0472 | |||
| 8439f87b76 | |||
| de404d1ed8 | |||
| 49412ce0f7 | |||
| a9a568aefa | |||
| 7e92809288 | |||
| b8ed590bde | |||
| 90726ca088 | |||
| 8c95a8db23 | |||
| c5a7f4c3ac | |||
| bb1c12d22b | |||
| f3c5593c50 | |||
| e5c517c8d8 | |||
| 9efa2369dd | |||
| c17a183816 | |||
| 863de683ee | |||
| 6d9764e140 | |||
| ca3be99e77 | |||
| e6e9aed385 | |||
| 8d53cd1e5d | |||
| def1072f0f | |||
| 7f2b505df3 | |||
| cf9429dc68 | |||
| 64d6a2fd1f | |||
| c97483c46f | |||
| 78df5c2258 | |||
| 27a6c63aeb | |||
| 88b42503f9 | |||
| 14e5474174 | |||
| 053d915fc4 | |||
| b781410f92 | |||
| 47b0c8b33e | |||
| 5594a38bb7 | |||
| 3262140b65 | |||
| 6357f19260 | |||
| 091f6164c8 | |||
| 30af0cb325 | |||
| 84765f4b81 | |||
| b39d1993bb | |||
| 6af36075ba | |||
| a653ee6b2c | |||
| 7018ba65be | |||
| d694b7cc1c | |||
| b7dba37e2e | |||
| 23f1c9de60 | |||
| 1185591c76 | |||
| b2adb4df47 | |||
| 3748a14582 | |||
| 93c7b6928f | |||
| 3b183bafbb | |||
| b53cda778c | |||
| 09944f5d7a | |||
| 3dcfc0dfc6 | |||
| 8f62cd79f4 | |||
| 586824be1b | |||
| cde7dd34fd | |||
| 2788bc666a | |||
| 9271323cc0 | |||
| 1bbf45784b | |||
| 6a442e1df4 | |||
| 6f6b384c55 | |||
| 2fec3eee6b | |||
| 5932a3f6f9 | |||
| cc4d7215f1 | |||
| cad9f6bf6e | |||
| 576e787839 | |||
| 8ed35832f4 | |||
| e06222099a | |||
| 192aa7fedb | |||
| c98f7b3e50 | |||
| 0576d525ad | |||
| 364d0be28c | |||
| c780768e91 | |||
| a2ab59b162 | |||
| ded48cc031 | |||
| 2533abb266 | |||
| 65204e5df0 | |||
| ecc0205436 | |||
| 6187431399 | |||
| 4d31e300c6 | |||
| f271d2180f | |||
| 8d34fb8e1f | |||
| 4bc85f07e3 | |||
| 06c45fbe68 | |||
| 2ee88dab7e | |||
| 97b5651633 | |||
| 8dd61144cb | |||
| f1daa22cdf | |||
| 461398bc0e | |||
| 88f8e41702 | |||
| 3246fd62a7 | |||
| a3a6077115 | |||
| 1c25c96aaa | |||
| f8ee6dc680 | |||
| dc9d539b6c | |||
| 4bf065ed1c | |||
| d04f428c1a | |||
| 2d4f030f11 | |||
| 884dcbe4fa | |||
| 902f9dd1fa | |||
| 9fbca5111d | |||
| 3748ddb1ae | |||
| 40c0925cb4 | |||
| b3fcda3214 | |||
| 676c5a3666 | |||
| 3efddc4fb6 | |||
| 5051055c76 | |||
| fd18403b0a | |||
| 80819f3793 | |||
| 4be0e0a4e5 | |||
| 26ebf97630 | |||
| 62cdf7ab2d | |||
| 1c38b7633f | |||
| dee995f918 | |||
| d6048ba576 | |||
| 5b57d662c3 | |||
| 813f756382 | |||
| 91633a4460 | |||
| 7c3deaa04b | |||
| b1d0dd65ea | |||
| d4cec8ebe7 | |||
| 5a39efff19 | |||
| ccdb939a40 | |||
| a887d880c6 | |||
| 72420bad3a | |||
| ff41864cd9 | |||
| cdc831bb89 | |||
| f3543a839e | |||
| 3eae7b4200 | |||
| af2e295ac2 | |||
| bb6d581ef8 | |||
| 1e73beca37 | |||
| 2b85799729 | |||
| 94ac1ad4a0 | |||
| 9159b37e47 | |||
| d33019d8e4 | |||
| 94d5c75fdf | |||
| 33aea05080 | |||
| 7db29112d8 | |||
| 913b1536d4 | |||
| 274b14618f | |||
| e23a2bfb55 | |||
| 87501347ad | |||
| 0603dc6323 | |||
| 86b696c78c | |||
| 56fd07d88e | |||
| 565c8d6589 | |||
| 8884acef24 | |||
| d7bb9b5f30 | |||
| b22c409079 | |||
| 626889f534 | |||
| d59458fa37 | |||
| 8f99d8d1d9 | |||
| 6e05aff3bf | |||
| 250a5921a3 | |||
| 2cdafb49a2 | |||
| e9f0351b67 | |||
| eff26ba0b3 | |||
| b1e7333348 | |||
| 7ab5d4edd4 | |||
| 4f34c4374b | |||
| 62f5f4d126 | |||
| abd3df0c5a | |||
| fc64fca3d9 | |||
| 6bd3ddf908 | |||
| e49b7d0514 | |||
| 0ab0e2747c | |||
| 7aeab56eb2 | |||
| fa8e2ccee8 | |||
| 5ead32f886 | |||
| 6140503158 | |||
| 14fc42833f | |||
| 3fc0ea3e80 | |||
| a975d0506a | |||
| e1e46b5322 | |||
| 146c6fe5ff | |||
| 0e4e830c79 | |||
| 0d44c56ccc | |||
| 7d48324f51 | |||
| facb49fc27 | |||
| 878dd746db | |||
| e2969d09e1 | |||
| 754610b9ee | |||
| d4149e9139 | |||
| 8f0dea91c7 | |||
| a5ee7ca73f | |||
| bea273fc3a | |||
| 40c04a210b | |||
| 021f6832d5 | |||
| 26492b13d5 | |||
| 5cee58a9c8 | |||
| 605d2b7ab2 | |||
| 1afdd3c011 | |||
| a323b00fef | |||
| ac57c44552 | |||
| 6314290558 | |||
| 021a59965e | |||
| f88009c626 | |||
| fa913c3e5b | |||
| a84c0a43bd | |||
| c48810c545 | |||
| ef186d9628 | |||
| 1238f1b273 | |||
| 274ffe1f48 | |||
| b0305a09e9 | |||
| 3d3b153b35 | |||
| d7c8cb3e48 | |||
| e36029293a | |||
| 8aee8cc427 | |||
| 8bc1f8b9ea | |||
| 085de6f857 | |||
| c72771ae1d | |||
| 6b28816c11 | |||
| 71edaca36c | |||
| 2d6e4d4d79 | |||
| 405fea44da | |||
| 859e0348ea | |||
| 1dd4a67771 | |||
| 262c103aaa | |||
| 9a90803b23 | |||
| 9307a376aa | |||
| ef90089d8d | |||
| 2ba5aeec31 | |||
| 4ecb894d9d | |||
| 637c6bf28a | |||
| fc0aa0e844 | |||
| 42df189abd | |||
| 2527eb5914 | |||
| 3dff9cf2c1 | |||
| 8847f359ba | |||
| 7651be3e02 | |||
| ecd51ba4fe | |||
| 718a9e2bae | |||
| c33e6538bb | |||
| 3bf171d753 | |||
| 30d3b2c209 | |||
| 47f578bcca | |||
| 65d31dfeb1 | |||
| c03cdfdf60 | |||
| 195455faa8 | |||
| 01ddfe95f0 | |||
| e75312ddf6 | |||
| ff919af3ef | |||
| 4d4c04dd7c | |||
| e0770a2ac0 | |||
| 3bc36070a9 | |||
| 8589ecd6c1 | |||
| b3d7904120 | |||
| 420c1097a9 | |||
| b2410ee70b | |||
| c0b827e006 | |||
| b61fc38711 | |||
| 4a05628938 | |||
| 8556b71949 | |||
| f1c52ddb5c | |||
| 597054edf3 | |||
| ddf97fa8fc | |||
| 2a68c6edba | |||
| ae0f4dcfc1 | |||
| 4d19895a88 | |||
| 2c5441257e | |||
| 9517467113 | |||
| 0b87039fbb | |||
| 2f6bf29adf | |||
| d365cc7dfc | |||
| b603346a0d | |||
| 51c627df76 | |||
| 073b586eee | |||
| 32a53a1ae3 | |||
| 615b7ceca2 | |||
| 946fd6fb55 | |||
| 68360b9335 | |||
| 1a4511bb8d | |||
| 62b236a7cd | |||
| 3d650a6bf7 | |||
| ef2e51b344 | |||
| 6b605e932b | |||
| a83329a1a7 | |||
| bb127603ff | |||
| a6ccdd72ec | |||
| 0931da9cad | |||
| a06c4767a0 | |||
| f135d8bb4e | |||
| a354a763bb | |||
| 780cf82bb0 | |||
| 2c8c33fb9a | |||
| b2dae36eb9 | |||
| 3d4b0121cb | |||
| 23d40a1d61 | |||
| b55ea05f3b | |||
| 4ac351eba6 | |||
| 74577fa584 | |||
| 7f17c55198 | |||
| 4b6090a8cb | |||
| 36e4e3e746 | |||
| 15f1c2d960 | |||
| 94b11964f8 | |||
| 5616336d5e | |||
| 29471bd425 | |||
| 7544f1bcf8 | |||
| 229ce0a61b | |||
| 377b5b4ab3 | |||
| d178a5ffa3 | |||
| ef30e3bd35 | |||
| 2b480f87f1 | |||
| d576b69dbc | |||
| d0a4c4467f | |||
| ed8c86d248 | |||
| 1c1cd60baf | |||
| 766f975b74 | |||
| 906e78c198 | |||
| 65fb78b6d5 | |||
| f733453f05 | |||
| 3b30fbb218 | |||
| 367c9dff05 | |||
| 25db8a21bc | |||
| ac6654cf0c | |||
| 16c50b3873 | |||
| 7c5640c1c9 | |||
| 49258e9301 | |||
| 03e3dfa94d | |||
| d1403c62c8 | |||
| ebb3dcd9ff | |||
| 07a25144ee | |||
| 136c15a8ba | |||
| a4ceda9706 | |||
| 5e7f2cf54f | |||
| 18c78e1625 | |||
| b3c5f6a4fd | |||
| 935c17f02e | |||
| 1a940e052e | |||
| aab4f71019 | |||
| 2cd862e4a2 | |||
| 8e89c7c654 | |||
| 825945f783 | |||
| 461a7afc22 | |||
| 3ec3085f39 | |||
| 564098e629 | |||
| 0909b4da92 | |||
| 7c80911f66 | |||
| 439f997a10 | |||
| 62fc7b6fa0 | |||
| 37dfc9e141 | |||
| b7bf60ea53 | |||
| b86a3a5d6b | |||
| 5241f93641 | |||
| 35ff47411b | |||
| 7f0b2334a5 | |||
| b95e12bb6c | |||
| eb3f928f31 | |||
| 1ad982aa85 | |||
| 50f39cd752 | |||
| e8f6024eae | |||
| fc4fdd09ef | |||
| a37a113044 | |||
| b8970366e0 | |||
| 7ba211a727 | |||
| a9c6f943e1 | |||
| 6479116419 | |||
| 515ef7bece | |||
| 80579593e0 | |||
| b044a2f88b | |||
| d3af16c1fd | |||
| 71d48bc48a | |||
| 91e6586e05 | |||
| 817e38fe68 | |||
| 278e531c14 | |||
| 175f967051 | |||
| 59c060cc0e | |||
| 0439671e86 | |||
| 628091c510 | |||
| a58242f24b | |||
| dfc68e3c75 | |||
| cf968ef286 | |||
| bb176318fe | |||
| 7a228eedd2 | |||
| 9caad2be4d | |||
| d5bfa09faa | |||
| 0bc9f887ec | |||
| 6b3ddb8a72 | |||
| 2e72d6b5a5 | |||
| bbbde3cc15 | |||
| 3887b08c1d | |||
| 64764cc7b0 | |||
| 4f0f791417 | |||
| c5d6a310d8 | |||
| 4395530756 | |||
| ac4f2b2a32 | |||
| 212d699078 | |||
| b15c02e3cd | |||
| ed5c0e74d4 | |||
| 9ae05facb8 | |||
| 440a517a5e | |||
| 7dbbb9a0e6 | |||
| adf1beea74 | |||
| e734eb837f | |||
| 608ad0bca0 | |||
| c8512249b7 | |||
| 4a048e3f57 | |||
| f72b532f0f | |||
| 95d08c6667 | |||
| 18a7c15441 | |||
| 9424571ce2 | |||
| 153e77864d | |||
| 4ea848b4e9 | |||
| 2e9cdfa6dc | |||
| 51bd05bb77 | |||
| addb087aac | |||
| c9da75ef85 | |||
| a329de81bf | |||
| 28d86578a3 | |||
| da3115be2c | |||
| bd053d6841 | |||
| b5e3d69c82 | |||
| c0c45be357 | |||
| 9895d8436a | |||
| a063209b2b | |||
| c911cd52bb | |||
| 11ee3759df | |||
| 4957c8e382 | |||
| cc3349728b | |||
| 45359847f2 | |||
| 1247f4d67b | |||
| f0318fb874 | |||
| 3376f3daa8 | |||
| 008013ddfb | |||
| fe9dfc6095 | |||
| 3d9e4638a7 | |||
| 3044923cbf | |||
| f783958e39 | |||
| 20fec49635 | |||
| 2a9a8adfc0 | |||
| 886d6702c4 | |||
| 5141a80142 | |||
| 30001f2698 | |||
| 4551bf4bc0 | |||
| 8bf016eaef | |||
| 52d99700ec | |||
| d0416757b7 | |||
| a782f8f8e0 | |||
| 29a44e7065 | |||
| 71a24580b8 | |||
| 8a9117d511 | |||
| 6f14cbf167 | |||
| 7abcdc8c4c | |||
| 47eab736bb | |||
| c08093f768 | |||
| 7960a2d7d2 | |||
| b6c610ada2 | |||
| 89808266dd | |||
| 4edd5238b1 | |||
| 0901540fda | |||
| 3cce6b46e2 | |||
| 7318aa49d8 | |||
| 614b751f5f | |||
| 228187978d | |||
| 5c9a4f4be0 | |||
| 69f5e1feac | |||
| bd9ad288b9 | |||
| d7d1c84b35 | |||
| ced96441ef | |||
| ad81dd3960 | |||
| b57c8bda51 | |||
| 8d6461ffcd | |||
| a796d6b824 | |||
| 7cc5092547 | |||
| 7d16078cf4 | |||
| 3869e3fce8 | |||
| 6ad03498c3 | |||
| e75757007e | |||
| 6e3fcce9e1 | |||
| d8db9dd3ac | |||
| ede188652b | |||
| a0b25acf35 | |||
| 85433e8bd1 | |||
| 682f862f43 | |||
| 2e362b1f3f | |||
| 8cd4460c62 | |||
| 89d70aeabf | |||
| 2857577dda | |||
| 597ee207b1 | |||
| 3ae0aae018 | |||
| 162789ad7f | |||
| 84666543d1 | |||
| 1cd0551197 | |||
| 81a5beb8cc | |||
| f9e99f1f4c | |||
| 241c816ad3 | |||
| 0e369fb9b5 | |||
| 5e102e1bfe | |||
| 87b63f768f | |||
| fc0e6af7dd | |||
| dd2ff737f1 | |||
| 11a4920b30 | |||
| f6fb392c4d | |||
| 26b368848b | |||
| 1e9da5a25b | |||
| 6145ef9cd2 | |||
| 702d861a58 | |||
| 064e7fde2f | |||
| f392b089a4 | |||
| cfdf9cee5d | |||
| e990a1cf61 | |||
| 8cf030e476 | |||
| 59d79ce176 | |||
| 5b40e4cb38 | |||
| ab30ed4ca9 | |||
| 83e58eadb7 | |||
| 6827f71f26 | |||
| 47523da16b | |||
| 222063e5cf | |||
| 20cd742b4a | |||
| fa412c13aa | |||
| 5140d26748 | |||
| 98cdfa1016 | |||
| ef04f6ca69 | |||
| 5a90bca49e | |||
| 64268de24b | |||
| 356dbab587 | |||
| cd526ad54c | |||
| 267bc7ae2d | |||
| d857685e74 | |||
| 2106075320 | |||
| e56cc9be00 | |||
| 27145d2789 | |||
| 3ad75c40ec | |||
| 2fba6b44e4 | |||
| 34d54247b6 | |||
| cc416b97f0 | |||
| 3f3d44bc25 | |||
| a1572ce9a5 | |||
| f4851e9103 | |||
| a1fb6902d5 | |||
| afad3f42d5 | |||
| c322064ff3 | |||
| c5617dc006 | |||
| 660bced187 | |||
| 69a3b5b215 | |||
| a922c91c1a | |||
| 06ef216e61 | |||
| c8dc6c5010 | |||
| 547b9850b9 | |||
| 56ce880b32 | |||
| f206eab338 | |||
| 74219585f3 | |||
| 5f7e56e1c2 | |||
| 9cfb822847 | |||
| 727a028a6f | |||
| 67673a6055 | |||
| 552d960b39 | |||
| 87cc67778b | |||
| ac8cf33a51 | |||
| 1f9ce77c85 | |||
| d207710b43 | |||
| 165708adeb | |||
| 643a7a1acb | |||
| 88631372ec | |||
| dd6f49a753 | |||
| 7b6a3c4307 | |||
| 1002763df3 | |||
| 1d1573c5f2 | |||
| 26cd988672 | |||
| a8f42bd534 | |||
| c22dae8d2c | |||
| 113c53a5da | |||
| 0bc6373386 | |||
| 77d830bf3a | |||
| a1ff9e35b7 | |||
| 0a98ff3c38 | |||
| 93d6e6dec9 | |||
| 2651e4650f | |||
| 9cf6b927cb | |||
| 96a45224de | |||
| 27c9ba465b | |||
| eedd953258 | |||
| cb77555fa6 | |||
| 510987dc80 | |||
| 7bed85ef19 | |||
| e79930dfb9 | |||
| 4faca6531a | |||
| a45dbb6510 | |||
| 1f4c50037b | |||
| a6cde11896 | |||
| 2290ade2f2 | |||
| 6d2b32f0b2 | |||
| 2ea4c71125 | |||
| 70cbb72e42 | |||
| a3e59082bf | |||
| 124f7760d8 | |||
| 0c57267a85 | |||
| eb6b73c752 | |||
| 54e2e58aec | |||
| cf4e671474 | |||
| 64b27fa28e | |||
| 1bbed2579b | |||
| c3629b5f01 | |||
| 5ad7e5a815 | |||
| 2e122ff62b | |||
| f558a5c06f | |||
| 5739621f5c | |||
| c8c3e8f661 | |||
| 3a4b68a464 | |||
| ed23a3aa69 | |||
| 018e37a2e9 | |||
| 7bdf52eac5 | |||
| ba44d6aba2 | |||
| dd6e3c1acc | |||
| 241e01edba | |||
| c5205be071 | |||
| a0fc74f1a9 | |||
| 3313d3bfa3 | |||
| fc42992cdf | |||
| 09bcfc2116 | |||
| ae0fa17132 | |||
| 83bc70bf05 | |||
| fb137b26bf | |||
| 46efae5998 | |||
| 6e8da80148 | |||
| cc11fa37b2 | |||
| 392ebf7db7 | |||
| b5061b69be | |||
| 30c146457a | |||
| 4b86dbd200 | |||
| e12fa57794 | |||
| 4fca127ea4 | |||
| d5b3ea263b | |||
| 5d5cc0ac55 | |||
| ef8aa4de90 | |||
| 3a3f07d91a | |||
| 2b27af1572 | |||
| 2c7b67203a | |||
| 0f442fddd9 | |||
| 6a9bb577cf | |||
| 4f17082d74 | |||
| 3661b8cd50 | |||
| a818be585d | |||
| 7372211d90 | |||
| c8ff66e07f | |||
| 059f450f1b | |||
| b8d6df6461 | |||
| 98d9b675f9 | |||
| 5c34fe4d5d | |||
| b3ca238a61 | |||
| ef84435b7c | |||
| a9bccee7b2 | |||
| aab3e085a2 | |||
| f643c2b98f | |||
| 50d997526c | |||
| 4260d31b85 | |||
| 7a1cf322e5 | |||
| 6c7b42a190 | |||
| ec1a55b35b | |||
| a539c317b3 | |||
| 3d86a0f5f6 | |||
| 891d4c278f | |||
| 5059bfe32b | |||
| d9288ae7e9 | |||
| bbfb2d2712 | |||
| 4aae11f8fb | |||
| 10a8a1b325 | |||
| 7801d112b3 | |||
| 9fc23a2bda | |||
| e3cb5a5e25 | |||
| 81492533e6 | |||
| 8b36061db4 | |||
| f17aeebbcd | |||
| 46eaa4888e | |||
| cc2d23de21 | |||
| 087c1b3a65 | |||
| 6f2076a9b8 | |||
| b2c4f08bbc | |||
| fcdabe0002 | |||
| 528050aa08 | |||
| 0c6707bf0c | |||
| e3e82df995 | |||
| 5128eb7b43 | |||
| af070aa351 | |||
| fc5920812f | |||
| f0940104f5 | |||
| 340207988c | |||
| 741cf9c7d5 | |||
| 9f2c5116fa | |||
| 0bdc6d47e0 | |||
| ee594a879b | |||
| 40f683c1a7 | |||
| 7cdd82dee2 | |||
| dd2b5b22d4 | |||
| 485796f387 | |||
| ab51c1bd3d | |||
| c6a15064b3 | |||
| 6e54295b38 | |||
| 9d96e10048 | |||
| dc2453a22b | |||
| 5246cedda6 | |||
| 203b779622 | |||
| 45ea2b0431 | |||
| 03f7bf6649 | |||
| c341c2c6a9 | |||
| 7110e1c15e | |||
| a6aa3fd3ee | |||
| 69a8dfe4d9 | |||
| dcaed72b6d | |||
| c6bdab8b4c | |||
| 2dcaa47b0e | |||
| 37bfe3d0ce | |||
| 373dbcd9ae | |||
| 35bef7b1d3 | |||
| 195fe81c60 | |||
| a8193f42b8 | |||
| 0cbf70a385 | |||
| 60c6669d68 | |||
| cf06620538 | |||
| 139dfd89e2 | |||
| cc2d08506e | |||
| bed1ff9a95 | |||
| 61c465c6f3 | |||
| 7e7b8acf4b | |||
| 05b368e1c6 | |||
| 912d55c46a | |||
| dcf4b75ca2 | |||
| 211df8b7b0 | |||
| 434c170097 | |||
| 01fb33cb5d | |||
| b5b2f5c03c | |||
| f20bd63edf | |||
| 277f7a7e51 | |||
| 05d2002db6 | |||
| f2755a8085 | |||
| f6cb693d6b | |||
| 1840c51960 | |||
| 359aa1d805 | |||
| 4d84ceb822 | |||
| 56cd66a6c3 | |||
| 15b3e875d5 | |||
| 32049c3484 | |||
| be3468ae07 | |||
| d69cb9e847 | |||
| 1e574b3e8a | |||
| 6447bd822c | |||
| 93cc1ae3bb | |||
| 5229a4e765 | |||
| a83797091b | |||
| 5b02f704cc | |||
| 422cab8878 | |||
| f641b1c659 | |||
| 342ca7ff1d | |||
| 914f035475 | |||
| cbc5a2933a | |||
| c9a8319a93 | |||
| 0ddf63acc9 | |||
| 9063466c03 | |||
| c3d34e8656 | |||
| 6227396afd | |||
| 1ba77e1629 | |||
| 41a3eccd1c | |||
| fe64649e49 | |||
| 6adac6b637 | |||
| 6e8091470c | |||
| 100da95e3a | |||
| d79b1b3145 | |||
| 9feab449fb | |||
| f80259dfae | |||
| 860a93aa8b | |||
| 61c71c6605 | |||
| bfa2ea1fba | |||
| cef100991f | |||
| 1adbd5f667 | |||
| c858703156 | |||
| b4acacf5cb | |||
| 19bc606a20 | |||
| 254dcdf665 | |||
| 86578554bb | |||
| dfe0e313d5 | |||
| 51cfbaa2ef | |||
| 3badb14b5a | |||
| 65a085c067 | |||
| 2b17796d73 | |||
| f9236fbb33 | |||
| 15c7792c33 | |||
| fa3c29dda6 | |||
| 0202b1169a | |||
| daa39d680c | |||
| c394df5658 | |||
| 30558c0cd6 | |||
| 932b3cabda | |||
| bf360ad50f | |||
| 68ddab0341 | |||
| 84c945f7fb | |||
| 31214de51a | |||
| 214725d1ee | |||
| 70cbc5e364 | |||
| ccbd24352e | |||
| 4f825db5ab | |||
| 826c4e1cd7 | |||
| 7c5a9841f7 | |||
| 165efcdb07 | |||
| ede892c83f | |||
| 8b9dd6b0c1 | |||
| 92d9efa1af | |||
| 904a2ef910 | |||
| 0904ffa813 | |||
| 0867299adb | |||
| b3fed4d1a9 | |||
| 79cbafd3c7 | |||
| f7752da97f | |||
| 0423a3e537 | |||
| b982542ae6 | |||
| 598e82d236 | |||
| 1ee8de42d9 | |||
| cd236776de | |||
| 0fc73c9d67 | |||
| b904d256cd | |||
| ac7c5592d7 | |||
| 0ed44e0b81 | |||
| 535384b235 | |||
| fed47b9ffc | |||
| 3ff8d8bf41 | |||
| 8520a71646 | |||
| abba1204a8 | |||
| 3a9796d9b3 | |||
| e57b391d40 | |||
| 5abddfe68d | |||
| 9011cfaa96 | |||
| dd6e5df356 | |||
| 7133311d2d | |||
| 999dd13924 | |||
| 4b656b3961 | |||
| 35f3aeb15a | |||
| d368c46ea9 | |||
| 57d674cc81 | |||
| 3a4652613d | |||
| 255cc85b32 | |||
| 65399a6193 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -83,7 +83,7 @@ src/library.* @sjplimp
|
||||
src/main.cpp @sjplimp
|
||||
src/min_*.* @sjplimp
|
||||
src/memory.* @sjplimp
|
||||
src/modify.* @sjplimp
|
||||
src/modify.* @sjplimp @stanmoore1
|
||||
src/molecule.* @sjplimp
|
||||
src/my_page.h @sjplimp
|
||||
src/my_pool_chunk.h @sjplimp
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -3,7 +3,7 @@ name: "CodeQL Code Analysis"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
|
||||
46
.github/workflows/compile-msvc.yml
vendored
Normal file
46
.github/workflows/compile-msvc.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# GitHub action to build LAMMPS on Windows with Visual C++
|
||||
name: "Native Windows Compilation and Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Windows Compilation Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Select Python version
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install numpy
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-D PKG_PYTHON=on \
|
||||
-S cmake -B build \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on \
|
||||
-D ENABLE_TESTING=on
|
||||
cmake --build build --config Release
|
||||
|
||||
- name: Run LAMMPS executable
|
||||
shell: bash
|
||||
run: |
|
||||
./build/Release/lmp.exe -h
|
||||
./build/Release/lmp.exe -in bench/in.lj
|
||||
|
||||
- name: Run Unit Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V -C Release
|
||||
2
.github/workflows/unittest-macos.yml
vendored
2
.github/workflows/unittest-macos.yml
vendored
@ -3,7 +3,7 @@ name: "Unittest for MacOS"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -37,8 +37,8 @@ vgcore.*
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
.clang-format
|
||||
.lammps_history
|
||||
.vs
|
||||
|
||||
#cmake
|
||||
/build*
|
||||
@ -49,3 +49,8 @@ Thumbs.db
|
||||
/Testing
|
||||
/cmake_install.cmake
|
||||
/lmp
|
||||
out/Debug
|
||||
out/RelWithDebInfo
|
||||
out/Release
|
||||
out/x86
|
||||
out/x64
|
||||
|
||||
@ -23,6 +23,10 @@ either a user mistake or a bug in the code. Bugs can be reported in
|
||||
the LAMMPS project
|
||||
[issue tracker on GitHub](https://github.com/lammps/lammps/issues).
|
||||
|
||||
To mitigate issues with using homoglyphs or bidirectional reordering in
|
||||
unicode, which have been demonstrated as a vector to obfuscate and hide
|
||||
malicious changes to the source code, all LAMMPS submissions are checked
|
||||
for unicode characters and only all-ASCII source code is accepted.
|
||||
|
||||
# Version Updates
|
||||
|
||||
|
||||
@ -19,6 +19,9 @@ set(SOVERSION 0)
|
||||
|
||||
get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
|
||||
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
|
||||
# collect all executables and shared libs in the top level build folder
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib)
|
||||
@ -81,22 +84,40 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
# set required compiler flags and compiler/CPU arch specific optimizations
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "/QxCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "/QxHost")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# we require C++11 without extensions
|
||||
# we require C++11 without extensions. Kokkos requires at least C++14 (currently)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
||||
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
# and prints lots of pointless warnings about "unsafe" functions
|
||||
if(MSVC)
|
||||
add_compile_options(/Zc:__cplusplus)
|
||||
add_compile_options(/wd4244)
|
||||
add_compile_options(/wd4267)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# export all symbols when building a .dll file on windows
|
||||
@ -115,10 +136,7 @@ endif()
|
||||
set(LAMMPS_BINARY lmp${LAMMPS_MACHINE})
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared library" OFF)
|
||||
if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared libraries" ON)
|
||||
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
|
||||
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
|
||||
|
||||
@ -265,28 +283,19 @@ if(BUILD_MPI)
|
||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||
include(MPI4WIN)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
else()
|
||||
find_package(MPI REQUIRED)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG)
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
else()
|
||||
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
|
||||
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
||||
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(lammps PRIVATE mpi_stubs)
|
||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_compile_definitions(lammps INTERFACE $<INSTALL_INTERFACE:LAMMPS_LIB_NO_MPI>)
|
||||
else()
|
||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||
endif()
|
||||
add_library(MPI::MPI_CXX ALIAS mpi_stubs)
|
||||
target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
|
||||
add_library(mpi_stubs INTERFACE)
|
||||
target_include_directories(mpi_stubs INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||
endif()
|
||||
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
@ -317,7 +326,6 @@ pkg_depends(ML-IAP ML-SNAP)
|
||||
pkg_depends(MPIIO MPI)
|
||||
pkg_depends(ATC MANYBODY)
|
||||
pkg_depends(LATBOLTZ MPI)
|
||||
pkg_depends(PHONON KSPACE)
|
||||
pkg_depends(SCAFACOS MPI)
|
||||
pkg_depends(DIELECTRIC KSPACE)
|
||||
pkg_depends(DIELECTRIC EXTRA-PAIR)
|
||||
@ -351,11 +359,13 @@ if(BUILD_OMP)
|
||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
||||
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
||||
# Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe.
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=4)
|
||||
set(LAMMPS_OMP_COMPAT_LEVEL 4)
|
||||
else()
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=3)
|
||||
set(LAMMPS_OMP_COMPAT_LEVEL 3)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=${LAMMPS_OMP_COMPAT_LEVEL})
|
||||
target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
|
||||
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
|
||||
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
|
||||
@ -468,9 +478,12 @@ foreach(HEADER cmath)
|
||||
endif(NOT FOUND_${HEADER})
|
||||
endforeach(HEADER)
|
||||
|
||||
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
||||
mark_as_advanced( MATH_LIBRARIES )
|
||||
target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
|
||||
# make the standard math library overrideable and autodetected (for systems that don't have it)
|
||||
find_library(STANDARD_MATH_LIB m DOC "Standard Math library")
|
||||
mark_as_advanced(STANDARD_MATH_LIB)
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(lammps PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
|
||||
######################################
|
||||
# Generate Basic Style files
|
||||
@ -566,11 +579,10 @@ if(PKG_ATC)
|
||||
if(LAMMPS_SIZES STREQUAL "BIGBIG")
|
||||
message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG")
|
||||
endif()
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES})
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(atc PRIVATE MPI::MPI_CXX)
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX)
|
||||
else()
|
||||
target_link_libraries(atc PRIVATE mpi_stubs)
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs)
|
||||
endif()
|
||||
target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR})
|
||||
target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
@ -584,22 +596,19 @@ endif()
|
||||
# packages which selectively include variants based on enabled styles
|
||||
# e.g. accelerator packages
|
||||
######################################################################
|
||||
foreach(PKG_WITH_INCL CORESHELL QEQ OPENMP DPD-SMOOTH KOKKOS OPT INTEL GPU)
|
||||
foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH PHONON QEQ OPENMP KOKKOS OPT INTEL GPU)
|
||||
if(PKG_${PKG_WITH_INCL})
|
||||
include(Packages/${PKG_WITH_INCL})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(PKG_PLUGIN)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
else()
|
||||
message(WARNING "Plugin loading will not work unless BUILD_SHARED_LIBS is enabled")
|
||||
endif()
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
endif()
|
||||
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
######################################################################
|
||||
@ -608,7 +617,7 @@ endif()
|
||||
# and after everything else that is compiled locally
|
||||
######################################################################
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
|
||||
target_link_libraries(lammps PRIVATE "wsock32;psapi")
|
||||
endif()
|
||||
|
||||
######################################################
|
||||
@ -669,6 +678,7 @@ endif()
|
||||
|
||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||
@ -688,6 +698,9 @@ foreach(_DEF ${LAMMPS_DEFINES})
|
||||
endforeach()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(NOT BUILD_MPI)
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
@ -727,7 +740,7 @@ install(
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||
find_package(PythonInterp) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
@ -786,11 +799,17 @@ if(ClangFormat_FOUND)
|
||||
endif()
|
||||
|
||||
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
||||
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(BUILD_IS_MULTI_CONFIG)
|
||||
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
||||
else()
|
||||
set(LAMMPS_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
include(FeatureSummary)
|
||||
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
|
||||
message(STATUS "<<< Build configuration >>>
|
||||
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
||||
Build type: ${CMAKE_BUILD_TYPE}
|
||||
Build type: ${LAMMPS_BUILD_TYPE}
|
||||
Install path: ${CMAKE_INSTALL_PREFIX}
|
||||
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
||||
###############################################################################
|
||||
|
||||
204
cmake/CMakeSettings.json
Normal file
204
cmake/CMakeSettings.json
Normal file
@ -0,0 +1,204 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug-MSVC",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Release-MSVC",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-Clang",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-OneAPI",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icx -DCMAKE_C_COMPILER=icx",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_MPI",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-Intel",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icl -DCMAKE_C_COMPILER=icl -DCMAKE_Fortran_COMPILER=ifort",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_MPI",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
33
cmake/Modules/ExternalCMakeProject.cmake
Normal file
33
cmake/Modules/ExternalCMakeProject.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
# Build a CMake based external library as subdirectory.
|
||||
# The sources will be unpacked to ${CMAKE_BINARY_DIR}/_deps/${target}-src
|
||||
# The binaries will be built in ${CMAKE_BINARY_DIR}/_deps/${target}-build
|
||||
#
|
||||
function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
|
||||
# change settings locally
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
get_filename_component(archive ${url} NAME)
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||
message(STATUS "Downloading ${url}")
|
||||
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
||||
message(STATUS "Unpacking and configuring ${archive}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||
file(GLOB TARGET_SOURCE "${CMAKE_BINARY_DIR}/_deps/src/${basedir}*")
|
||||
list(LENGTH TARGET_SOURCE _num)
|
||||
if(_num GREATER 1)
|
||||
message(FATAL_ERROR "Inconsistent ${target} library sources. "
|
||||
"Please delete ${CMAKE_BINARY_DIR}/_deps/src and re-run cmake")
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/${target}-src)
|
||||
file(RENAME ${TARGET_SOURCE} ${CMAKE_BINARY_DIR}/_deps/${target}-src)
|
||||
if(NOT (cmakefile STREQUAL ""))
|
||||
file(COPY ${cmakefile} DESTINATION ${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/)
|
||||
get_filename_component(_cmakefile ${cmakefile} NAME)
|
||||
file(RENAME "${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/${_cmakefile}"
|
||||
"${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/CMakeLists.txt")
|
||||
endif()
|
||||
add_subdirectory("${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}"
|
||||
"${CMAKE_BINARY_DIR}/_deps/${target}-build")
|
||||
endfunction(ExternalCMakeProject)
|
||||
@ -8,18 +8,19 @@
|
||||
#=============================================================================
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||
find_package(PythonInterp 3.6 QUIET) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
else()
|
||||
find_package(Python3 3.6 COMPONENTS Interpreter QUIET)
|
||||
find_package(Python 3.6 COMPONENTS Interpreter QUIET)
|
||||
endif()
|
||||
|
||||
# Use the Cython executable that lives next to the Python executable
|
||||
# if it is a local installation.
|
||||
if(Python3_EXECUTABLE)
|
||||
get_filename_component(_python_path ${Python3_EXECUTABLE} PATH)
|
||||
if(Python_EXECUTABLE)
|
||||
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
||||
find_program(Cythonize_EXECUTABLE
|
||||
NAMES cythonize3 cythonize cythonize.bat
|
||||
HINTS ${_python_path})
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
message(STATUS "Downloading and building Google Test library")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(GTEST_LIB_POSTFIX d)
|
||||
else()
|
||||
set(GTEST_LIB_POSTFIX)
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
|
||||
set(GTEST_MD5 "ecd1fa65e7de707cd5c00bdac56022cd" CACHE STRING "MD5 checksum of GTest tarball")
|
||||
mark_as_advanced(GTEST_URL)
|
||||
mark_as_advanced(GTEST_MD5)
|
||||
ExternalProject_Add(googletest
|
||||
URL ${GTEST_URL}
|
||||
URL_MD5 ${GTEST_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(googletest SOURCE_DIR)
|
||||
set(GTEST_INCLUDE_DIR ${SOURCE_DIR}/googletest/include)
|
||||
set(GMOCK_INCLUDE_DIR ${SOURCE_DIR}/googlemock/include)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
|
||||
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Get_Property(googletest BINARY_DIR)
|
||||
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
|
||||
# Prevent GoogleTest from overriding our compiler/linker options
|
||||
# when building with Visual Studio
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
find_package(Threads QUIET)
|
||||
|
||||
add_library(GTest::GTest UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTest PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GTest googletest)
|
||||
|
||||
add_library(GTest::GMock UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMock PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GMock googletest)
|
||||
|
||||
add_library(GTest::GTestMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTestMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GTestMain googletest)
|
||||
|
||||
add_library(GTest::GMockMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMockMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GMockMain googletest)
|
||||
@ -25,7 +25,7 @@ function(validate_option name values)
|
||||
endfunction(validate_option)
|
||||
|
||||
function(get_lammps_version version_header variable)
|
||||
file(READ ${version_header} line)
|
||||
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
||||
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
|
||||
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1" day "${line}")
|
||||
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\2" month "${line}")
|
||||
@ -85,7 +85,7 @@ endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
function(FetchPotentials pkgfolder potfolder)
|
||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||
if(EXISTS "${pkgfolder}/potentials.txt")
|
||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||
foreach(line ${linelist})
|
||||
string(FIND ${line} " " blank)
|
||||
|
||||
@ -1,50 +1,11 @@
|
||||
message(STATUS "Downloading and building OpenCL loader library")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.09.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "3b3882627964bd02e5c3b02065daac3c" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2022.01.04.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "8d3a801e87a2c6653bf0e27707063914" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
mark_as_advanced(OPENCL_LOADER_URL)
|
||||
mark_as_advanced(OPENCL_LOADER_MD5)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(opencl_loader
|
||||
URL ${OPENCL_LOADER_URL}
|
||||
URL_MD5 ${OPENCL_LOADER_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build"
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(opencl_loader SOURCE_DIR)
|
||||
set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Get_Property(opencl_loader BINARY_DIR)
|
||||
set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
find_package(Threads QUIET)
|
||||
if(NOT WIN32)
|
||||
set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}")
|
||||
else()
|
||||
set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject")
|
||||
endif()
|
||||
|
||||
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
|
||||
add_dependencies(OpenCL::OpenCL opencl_loader)
|
||||
|
||||
set_target_properties(OpenCL::OpenCL PROPERTIES
|
||||
IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}")
|
||||
|
||||
set(INSTALL_LIBOPENCL OFF CACHE BOOL "" FORCE)
|
||||
include(ExternalCMakeProject)
|
||||
ExternalCMakeProject(opencl_loader ${OPENCL_LOADER_URL} ${OPENCL_LOADER_MD5} opencl-loader . "")
|
||||
|
||||
add_library(OpenCL::OpenCL ALIAS OpenCL)
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
|
||||
|
||||
if(Zstd_FOUND)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
|
||||
if(Zstd_FOUND)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_ZSTD)
|
||||
target_link_libraries(lammps PRIVATE PkgConfig::Zstd)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -306,12 +306,12 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
|
||||
if(HIP_COMPILER STREQUAL "clang")
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
else()
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
endif()
|
||||
@ -422,13 +422,12 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
||||
RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h)
|
||||
|
||||
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
||||
|
||||
if(NOT BUILD_MPI)
|
||||
# mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path
|
||||
target_link_libraries(gpu PRIVATE mpi_stubs)
|
||||
else()
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
else()
|
||||
target_link_libraries(gpu PRIVATE mpi_stubs)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE})
|
||||
target_sources(lammps PRIVATE ${GPU_SOURCES})
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
########################################################################
|
||||
# As of version 3.3.0 Kokkos requires C++14
|
||||
if(CMAKE_CXX_STANDARD LESS 14)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
||||
endif()
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
@ -11,8 +11,14 @@ if(Kokkos_ENABLE_CUDA)
|
||||
endif()
|
||||
# Adding OpenMP compiler flags without the checks done for
|
||||
# BUILD_OMP can result in compile failures. Enforce consistency.
|
||||
if(Kokkos_ENABLE_OPENMP AND NOT BUILD_OMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
if(Kokkos_ENABLE_OPENMP)
|
||||
if(NOT BUILD_OMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
else()
|
||||
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
|
||||
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
########################################################################
|
||||
|
||||
@ -27,6 +33,8 @@ if(DOWNLOAD_KOKKOS)
|
||||
endforeach()
|
||||
message(STATUS "KOKKOS download requested - we will build our own")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>")
|
||||
# build KOKKOS downloaded libraries as static libraries but with PIC, if needed
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DBUILD_SHARED_LIBS=OFF")
|
||||
if(CMAKE_REQUEST_PIC)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS ${CMAKE_REQUEST_PIC})
|
||||
endif()
|
||||
@ -39,35 +47,48 @@ if(DOWNLOAD_KOKKOS)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
include(ExternalProject)
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "4c84698917c93a18985b311bb6caf84f" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.5.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "079323d973ae0e1c38c0a54a150c674e" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
mark_as_advanced(KOKKOS_URL)
|
||||
mark_as_advanced(KOKKOS_MD5)
|
||||
ExternalProject_Add(kokkos_build
|
||||
URL ${KOKKOS_URL}
|
||||
URL_MD5 ${KOKKOS_MD5}
|
||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
||||
)
|
||||
ExternalProject_get_property(kokkos_build INSTALL_DIR)
|
||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||
add_library(LAMMPS::KOKKOS UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::KOKKOS PROPERTIES
|
||||
add_library(LAMMPS::KOKKOSCORE UNKNOWN IMPORTED)
|
||||
add_library(LAMMPS::KOKKOSCONTAINERS UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::KOKKOSCORE PROPERTIES
|
||||
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscore.a"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
|
||||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||
set_target_properties(LAMMPS::KOKKOSCONTAINERS PROPERTIES
|
||||
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscontainers.a")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
|
||||
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
|
||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 3.4.01 REQUIRED CONFIG)
|
||||
find_package(Kokkos 3.5.00 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
|
||||
# build KOKKOS internal libraries as static libraries but with PIC, if needed
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(BUILD_SHARED_LIBS_WAS_ON YES)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
if(CMAKE_REQUEST_PIC)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
||||
|
||||
|
||||
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
|
||||
@ -75,6 +96,9 @@ else()
|
||||
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
|
||||
target_link_libraries(lammps PRIVATE kokkos)
|
||||
target_link_libraries(lmp PRIVATE kokkos)
|
||||
if(BUILD_SHARED_LIBS_WAS_ON)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
endif()
|
||||
target_compile_definitions(lammps PUBLIC $<BUILD_INTERFACE:LMP_KOKKOS>)
|
||||
|
||||
@ -109,6 +133,12 @@ if(PKG_KSPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(PKG_PHONON)
|
||||
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp)
|
||||
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/third_order_kokkos.cpp)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}")
|
||||
|
||||
# detects styles which have KOKKOS version
|
||||
|
||||
@ -7,8 +7,9 @@ endif()
|
||||
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
|
||||
if(DOWNLOAD_EIGEN3)
|
||||
message(STATUS "Eigen3 download requested - we will build our own")
|
||||
set(EIGEN3_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_MD5 "609286804b0f79be622ccf7f9ff2b660" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||
|
||||
set(EIGEN3_URL "${LAMMPS_THIRDPARTY_URL}/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_MD5 "4c527a9171d71a72a9d4186e65bea559" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||
mark_as_advanced(EIGEN3_URL)
|
||||
mark_as_advanced(EIGEN3_MD5)
|
||||
include(ExternalProject)
|
||||
|
||||
@ -46,12 +46,10 @@ if(DOWNLOAD_N2P2)
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -64,8 +62,8 @@ if(DOWNLOAD_N2P2)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
||||
set(N2P2_BUILD_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}} ${N2P2_CXX_STD}")
|
||||
set(N2P2_BUILD_OPTIONS INTERFACES=LAMMPS COMP=${N2P2_COMP} "PROJECT_OPTIONS=${N2P2_PROJECT_OPTIONS}" "PROJECT_DEBUG="
|
||||
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${MPI_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
|
||||
"PROJECT_AR=${N2P2_AR}")
|
||||
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${CMAKE_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
|
||||
"PROJECT_AR=${N2P2_AR}" "APP_CORE=nnp-convert" "APP_TRAIN=nnp-train" "APP=nnp-convert")
|
||||
# echo final flag for debugging
|
||||
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "4db54962fbd6adcf8c18d46e1798ceb5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
|
||||
# download library sources to build folder
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5})
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
|
||||
|
||||
# uncompress downloaded sources
|
||||
execute_process(
|
||||
@ -14,12 +14,19 @@ execute_process(
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE)
|
||||
file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp)
|
||||
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
|
||||
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
||||
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
||||
|
||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
|
||||
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
|
||||
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
||||
|
||||
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR})
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR})
|
||||
|
||||
|
||||
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
||||
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
|
||||
@ -32,7 +32,8 @@ if(DOWNLOAD_QUIP)
|
||||
foreach(flag ${LAPACK_LIBRARIES})
|
||||
set(temp "${temp} ${flag}")
|
||||
endforeach()
|
||||
set(temp "${temp}\n")
|
||||
# Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment
|
||||
set(temp "${temp} -L/_DUMMY_PATH_\n")
|
||||
set(temp "${temp}PYTHON=python\nPIP=pip\nEXTRA_LINKOPTS=\n")
|
||||
set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n")
|
||||
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
|
||||
|
||||
@ -12,41 +12,12 @@ if(DOWNLOAD_MSCG)
|
||||
mark_as_advanced(MSCG_URL)
|
||||
mark_as_advanced(MSCG_MD5)
|
||||
|
||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
||||
message(FATAL_ERROR "Cannot compile downloaded MSCG library due to a technical limitation")
|
||||
endif()
|
||||
include(ExternalCMakeProject)
|
||||
ExternalCMakeProject(mscg ${MSCG_URL} ${MSCG_MD5} MSCG-release src/CMake "")
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(mscg_build
|
||||
URL ${MSCG_URL}
|
||||
URL_MD5 ${MSCG_MD5}
|
||||
SOURCE_SUBDIR src/CMake
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
|
||||
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target mscg
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/libmscg.a
|
||||
)
|
||||
ExternalProject_get_property(mscg_build BINARY_DIR)
|
||||
ExternalProject_get_property(mscg_build SOURCE_DIR)
|
||||
file(MAKE_DIRECTORY ${SOURCE_DIR}/src)
|
||||
add_library(LAMMPS::MSCG UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::MSCG PROPERTIES
|
||||
IMPORTED_LOCATION "${BINARY_DIR}/libmscg.a"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src"
|
||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
|
||||
add_dependencies(LAMMPS::MSCG mscg_build)
|
||||
# set include and link library
|
||||
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/mscg-src/src")
|
||||
target_link_libraries(lammps PRIVATE mscg)
|
||||
else()
|
||||
find_package(MSCG)
|
||||
if(NOT MSCG_FOUND)
|
||||
|
||||
9
cmake/Modules/Packages/PHONON.cmake
Normal file
9
cmake/Modules/Packages/PHONON.cmake
Normal file
@ -0,0 +1,9 @@
|
||||
# fix phonon may only be installed if also the FFT wrappers from KSPACE are installed
|
||||
if(NOT PKG_KSPACE)
|
||||
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
|
||||
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.h)
|
||||
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
|
||||
get_target_property(LAMMPS_SOURCES lammps SOURCES)
|
||||
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.cpp)
|
||||
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
|
||||
endif()
|
||||
@ -54,8 +54,8 @@ if(DOWNLOAD_PLUMED)
|
||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
||||
endif()
|
||||
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.2/plumed-src-2.7.2.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "cfa0b4dd90a81c25d3302e8d97bfeaea" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.3/plumed-src-2.7.3.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "f00cc82edfefe6bb3df934911dbe32fb" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
|
||||
@ -3,7 +3,7 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
||||
else()
|
||||
find_package(Python REQUIRED COMPONENTS Development)
|
||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||
target_link_libraries(lammps PRIVATE Python::Python)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)
|
||||
|
||||
@ -25,7 +25,9 @@ if(BUILD_TOOLS)
|
||||
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
||||
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
||||
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
||||
target_link_libraries(msi2lmp PRIVATE ${MATH_LIBRARIES})
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
endif()
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
message(STATUS "Downloading and building YAML library")
|
||||
|
||||
include(ExternalProject)
|
||||
set(YAML_URL "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz" CACHE STRING "URL for libyaml tarball")
|
||||
set(YAML_MD5 "bb15429d8fb787e7d3f1c83ae129a999" CACHE STRING "MD5 checksum of libyaml tarball")
|
||||
mark_as_advanced(YAML_URL)
|
||||
mark_as_advanced(YAML_MD5)
|
||||
|
||||
# support cross-compilation to windows
|
||||
if(CMAKE_CROSSCOMPILING AND (CMAKE_SYSTEM_NAME STREQUAL "Windows"))
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||
set(YAML_CROSS_HOST --host=i686-mingw64)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set(YAML_CROSS_HOST --host=x86_64-mingw64)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported cross-compilation "
|
||||
" for ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}"
|
||||
" on ${CMAKE_HOST_SYSTEM}/${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(libyaml
|
||||
URL ${YAML_URL}
|
||||
URL_MD5 ${YAML_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build"
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${CONFIGURE_REQUEST_PIC}
|
||||
CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}
|
||||
--prefix=<INSTALL_DIR> --disable-shared ${YAML_CROSS_HOST}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(libyaml INSTALL_DIR)
|
||||
set(YAML_INCLUDE_DIR ${INSTALL_DIR}/include)
|
||||
set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
|
||||
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
|
||||
|
||||
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
|
||||
add_library(Yaml::Yaml UNKNOWN IMPORTED)
|
||||
set_target_properties(Yaml::Yaml PROPERTIES
|
||||
IMPORTED_LOCATION ${YAML_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${YAML_INCLUDE_DIR})
|
||||
add_dependencies(Yaml::Yaml libyaml)
|
||||
@ -24,10 +24,10 @@ if(GIT_FOUND AND EXISTS ${LAMMPS_DIR}/.git)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n")
|
||||
set(temp "${temp}bool LAMMPS_NS::LAMMPS::has_git_info() { return ${temp_git_info}; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_commit() { return \"${temp_git_commit}\"; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_branch() { return \"${temp_git_branch}\"; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${temp_git_describe}\"; }\n")
|
||||
set(temp "${temp}#endif\n\n")
|
||||
|
||||
message(STATUS "Generating lmpgitversion.h...")
|
||||
|
||||
@ -20,9 +20,14 @@
|
||||
{ include: [ "@\"kspace_.*.h\"", public, "\"style_kspace.h\"", public ] },
|
||||
{ include: [ "@\"nbin_.*.h\"", public, "\"style_nbin.h\"", public ] },
|
||||
{ include: [ "@\"npair_.*.h\"", public, "\"style_npair.h\"", public ] },
|
||||
{ include: [ "@\"nstenci_.*.h\"", public, "\"style_nstencil.h\"", public ] },
|
||||
{ include: [ "@\"nstencil_.*.h\"", public, "\"style_nstencil.h\"", public ] },
|
||||
{ include: [ "@\"ntopo_.*.h\"", public, "\"style_ntopo.h\"", public ] },
|
||||
{ include: [ "\"fmt/core.h\"", private, "\"fmt/format.h\"", public ] },
|
||||
{ include: [ "<float.h>", public, "<cfloat>", public ] },
|
||||
{ include: [ "\"float.h\"", public, "<cfloat>", public ] },
|
||||
{ include: [ "<limits.h>", public, "<climits>", public ] },
|
||||
{ include: [ "\"limits.h\"", public, "<climits>", public ] },
|
||||
{ include: [ "<stdio.h>", public, "<cstdio>", public ] },
|
||||
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/types.h>", public ] },
|
||||
{ include: [ "<bits/types/struct_tm.h>", private, "<ctime>", public ] },
|
||||
]
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX "g++" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(MPI_C "gcc" CACHE STRING "" FORCE)
|
||||
set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
@ -48,7 +48,6 @@ set(ALL_PACKAGES
|
||||
PHONON
|
||||
PLUGIN
|
||||
POEMS
|
||||
PYTHON
|
||||
QEQ
|
||||
REACTION
|
||||
REAXFF
|
||||
|
||||
64
cmake/presets/windows.cmake
Normal file
64
cmake/presets/windows.cmake
Normal file
@ -0,0 +1,64 @@
|
||||
set(WIN_PACKAGES
|
||||
ASPHERE
|
||||
BOCS
|
||||
BODY
|
||||
BROWNIAN
|
||||
CG-DNA
|
||||
CG-SDK
|
||||
CLASS2
|
||||
COLLOID
|
||||
COLVARS
|
||||
CORESHELL
|
||||
DIELECTRIC
|
||||
DIFFRACTION
|
||||
DIPOLE
|
||||
DPD-BASIC
|
||||
DPD-MESO
|
||||
DPD-REACT
|
||||
DPD-SMOOTH
|
||||
DRUDE
|
||||
EFF
|
||||
EXTRA-COMPUTE
|
||||
EXTRA-DUMP
|
||||
EXTRA-FIX
|
||||
EXTRA-MOLECULE
|
||||
EXTRA-PAIR
|
||||
FEP
|
||||
GRANULAR
|
||||
INTERLAYER
|
||||
KSPACE
|
||||
MANIFOLD
|
||||
MANYBODY
|
||||
MC
|
||||
MEAM
|
||||
MISC
|
||||
ML-IAP
|
||||
ML-SNAP
|
||||
MOFFF
|
||||
MOLECULE
|
||||
MOLFILE
|
||||
OPENMP
|
||||
ORIENT
|
||||
PERI
|
||||
PHONON
|
||||
POEMS
|
||||
PTM
|
||||
QEQ
|
||||
QTB
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
SPH
|
||||
SPIN
|
||||
SRD
|
||||
TALLY
|
||||
UEF
|
||||
YAFF)
|
||||
|
||||
foreach(PKG ${WIN_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
@ -230,7 +230,7 @@ $(VENV):
|
||||
)
|
||||
|
||||
$(MATHJAX):
|
||||
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 git://github.com/mathjax/MathJax.git $@
|
||||
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
|
||||
|
||||
$(ANCHORCHECK): $(VENV)
|
||||
@( \
|
||||
|
||||
@ -435,6 +435,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \
|
||||
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.cpp \
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
||||
@ -33,9 +33,9 @@ when necessary.
|
||||
## Pull Requests
|
||||
|
||||
ALL changes to the LAMMPS code and documentation, however trivial, MUST
|
||||
be submitted as a pull request to GitHub. All changes to the "master"
|
||||
be submitted as a pull request to GitHub. All changes to the "develop"
|
||||
branch must be made exclusively through merging pull requests. The
|
||||
"unstable" and "stable" branches, respectively are only to be updated
|
||||
"release" and "stable" branches, respectively are only to be updated
|
||||
upon patch or stable releases with fast-forward merges based on the
|
||||
associated tags. Pull requests may also be submitted to (long-running)
|
||||
feature branches created by LAMMPS developers inside the LAMMPS project,
|
||||
@ -123,16 +123,16 @@ and thus were this comment should be placed.
|
||||
|
||||
LAMMPS uses a continuous release development model with incremental
|
||||
changes, i.e. significant effort is made - including automated pre-merge
|
||||
testing - that the code in the branch "master" does not get easily
|
||||
testing - that the code in the branch "develop" does not get easily
|
||||
broken. These tests are run after every update to a pull request. More
|
||||
extensive and time consuming tests (including regression testing) are
|
||||
performed after code is merged to the "master" branch. There are patch
|
||||
performed after code is merged to the "develop" branch. There are patch
|
||||
releases of LAMMPS every 3-5 weeks at a point, when the LAMMPS
|
||||
developers feel, that a sufficient amount of changes have happened, and
|
||||
the post-merge testing has been successful. These patch releases are
|
||||
marked with a `patch_<version date>` tag and the "unstable" branch
|
||||
marked with a `patch_<version date>` tag and the "release" branch
|
||||
follows only these versions (and thus is always supposed to be of
|
||||
production quality, unlike "master", which may be temporary broken, in
|
||||
production quality, unlike "develop", which may be temporary broken, in
|
||||
the case of larger change sets or unexpected incompatibilities or side
|
||||
effects.
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH LAMMPS "29 September 2021" "2021-09-29"
|
||||
.TH LAMMPS "1" "17 February 2022" "2022-2-17"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH MSI2LMP "v3.9.9" "2018-11-05"
|
||||
.TH MSI2LMP "1" "v3.9.9" "2018-11-05"
|
||||
.SH NAME
|
||||
.B MSI2LMP
|
||||
\- Converter for Materials Studio files to LAMMPS
|
||||
|
||||
@ -1123,9 +1123,12 @@ Bibliography
|
||||
**(Sun)**
|
||||
Sun, J. Phys. Chem. B, 102, 7338-7364 (1998).
|
||||
|
||||
**(Surblys)**
|
||||
**(Surblys2019)**
|
||||
Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
**(Surblys2021)**
|
||||
Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
|
||||
**(Sutmann)**
|
||||
Sutmann, Arnold, Fahrenberger, et. al., Physical review / E 88(6), 063308 (2013)
|
||||
|
||||
|
||||
@ -150,6 +150,42 @@ for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the *-G*
|
||||
command line flag. A list of available generator settings for your
|
||||
specific CMake version is given when running ``cmake --help``.
|
||||
|
||||
.. _cmake_multiconfig:
|
||||
|
||||
Multi-configuration build systems
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Throughout this manual it is mostly assumed that LAMMPS is being built
|
||||
on a Unix-like operating system with "make" as the underlying "builder",
|
||||
since this is the most common case. In this case the build "configuration"
|
||||
is chose using ``-D CMAKE_BUILD_TYPE=<configuration>`` with ``<configuration>``
|
||||
being one of "Release", "Debug", "RelWithDebInfo", or "MinSizeRel".
|
||||
Some build tools, however, can also use or even require to have a so-called
|
||||
multi-configuration build system setup. For those the built type (or
|
||||
configuration) is chosen at compile time using the same build files. E.g.
|
||||
with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake --build build-multi --config Release
|
||||
|
||||
In that case the resulting binaries are not in the build folder directly
|
||||
but in sub-directories corresponding to the build type (i.e. Release in
|
||||
the example from above). Similarly, for running unit tests the
|
||||
configuration is selected with the *-C* flag:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ctest -C Debug
|
||||
|
||||
The CMake scripts in LAMMPS have basic support for being compiled using a
|
||||
multi-config build system, but not all of it has been ported. This is in
|
||||
particular applicable to compiling packages that require additional libraries
|
||||
that would be downloaded and compiled by CMake. The "windows" preset file
|
||||
tries to keep track of which packages can be compiled natively with the
|
||||
MSVC compilers out-of-the box. Not all of those external libraries are
|
||||
portable to Windows either.
|
||||
|
||||
|
||||
Installing CMake
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -185,6 +185,10 @@ The ``ctest`` command has many options, the most important ones are:
|
||||
- run subset of tests matching the regular expression <regex>
|
||||
* - -E <regex>
|
||||
- exclude subset of tests matching the regular expression <regex>
|
||||
* - -L <regex>
|
||||
- run subset of tests with a label matching the regular expression <regex>
|
||||
* - -LE <regex>
|
||||
- exclude subset of tests with a label matching the regular expression <regex>
|
||||
* - -N
|
||||
- dry-run: display list of tests without running them
|
||||
* - -T memcheck
|
||||
@ -299,6 +303,12 @@ will destroy the original file, if the generation run does not complete,
|
||||
so using *-g* is recommended unless the YAML file is fully tested
|
||||
and working.
|
||||
|
||||
Some of the force style tests are rather slow to run and some are very
|
||||
sensitive to small differences like CPU architecture, compiler
|
||||
toolchain, compiler optimization. Those tests are flagged with a "slow"
|
||||
and/or "unstable" label, and thus those tests can be selectively
|
||||
excluded with the ``-LE`` flag or selected with the ``-L`` flag.
|
||||
|
||||
.. admonition:: Recommendations and notes for YAML files
|
||||
:class: note
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ environments with restricted disk space capacity it may be needed to
|
||||
reduce the storage requirements. Here are some suggestions:
|
||||
|
||||
- Create a so-called shallow repository by cloning only the last commit
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=develop``.
|
||||
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
|
||||
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
|
||||
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).
|
||||
|
||||
@ -341,6 +341,18 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||
|
||||
When using the "-b " option, the KIM library is built using its native
|
||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||
``CMAKE`` environment variable if the cmake executable is named other
|
||||
than ``cmake`` on your system. Additional environment variables may be
|
||||
provided on the command line for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the gnu version 11 compilers
|
||||
to build KIM, one could use the following command line.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||
|
||||
Settings for debugging OpenKIM web queries discussed below need to
|
||||
be applied by adding them to the ``LMP_INC`` variable through
|
||||
editing the ``Makefile.machine`` you are using. For example:
|
||||
@ -560,11 +572,26 @@ They must be specified in uppercase.
|
||||
* - VEGA908
|
||||
- GPU
|
||||
- AMD GPU MI100 GFX908
|
||||
* - INTEL_GEN
|
||||
* - VEGA90A
|
||||
- GPU
|
||||
- Intel GPUs Gen9+
|
||||
- AMD GPU
|
||||
* - INTEL_DG1
|
||||
- GPU
|
||||
- Intel Iris XeMAX GPU
|
||||
* - INTEL_GEN9
|
||||
- GPU
|
||||
- Intel GPU Gen9
|
||||
* - INTEL_GEN11
|
||||
- GPU
|
||||
- Intel GPU Gen11
|
||||
* - INTEL_GEN12LP
|
||||
- GPU
|
||||
- Intel GPU Gen12LP
|
||||
* - INTEL_XEHP
|
||||
- GPU
|
||||
- Intel GPUs Xe-HP
|
||||
|
||||
This list was last updated for version 3.4.1 of the Kokkos library.
|
||||
This list was last updated for version 3.5.0 of the Kokkos library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
|
||||
@ -33,12 +33,15 @@ various tools and files. Some of them have to be installed (see below). For
|
||||
the rest the build process will attempt to download and install them into
|
||||
a python virtual environment and local folders.
|
||||
|
||||
A current version of the manual (latest patch release, aka unstable
|
||||
branch) is is available online at:
|
||||
`https://docs.lammps.org/Manual.html <https://docs.lammps.org/Manual.html>`_.
|
||||
A version of the manual corresponding to the ongoing development (aka master branch)
|
||||
is available online at: `https://docs.lammps.org/latest/
|
||||
<https://docs.lammps.org/latest/>`_
|
||||
A current version of the manual (latest patch release, that is the state
|
||||
of the *release* branch) is is available online at:
|
||||
`https://docs.lammps.org/ <https://docs.lammps.org/>`_.
|
||||
A version of the manual corresponding to the ongoing development (that is
|
||||
the state of the *develop* branch) is available online at:
|
||||
`https://docs.lammps.org/latest/ <https://docs.lammps.org/latest/>`_
|
||||
A version of the manual corresponding to the latest stable LAMMPS release
|
||||
(that is the state of the *stable* branch) is available online at:
|
||||
`https://docs.lammps.org/stable/ <https://docs.lammps.org/stable/>`_
|
||||
|
||||
Build using GNU make
|
||||
--------------------
|
||||
|
||||
@ -321,9 +321,7 @@ following settings:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_JPEG
|
||||
LMP_INC = -DLAMMPS_PNG
|
||||
LMP_INC = -DLAMMPS_FFMPEG
|
||||
LMP_INC = -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG <other LMP_INC settings>
|
||||
|
||||
JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them
|
||||
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
|
||||
@ -354,8 +352,10 @@ Read or write compressed files
|
||||
-----------------------------------------
|
||||
|
||||
If this option is enabled, large files can be read or written with
|
||||
gzip compression by several LAMMPS commands, including
|
||||
:doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and :doc:`dump <dump>`.
|
||||
compression by ``gzip`` or similar tools by several LAMMPS commands,
|
||||
including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
|
||||
:doc:`dump <dump>`. Currently supported compression tools are:
|
||||
``gzip``, ``bzip2``, ``zstd``, and ``lzma``.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -364,23 +364,23 @@ gzip compression by several LAMMPS commands, including
|
||||
.. code-block:: bash
|
||||
|
||||
-D WITH_GZIP=value # yes or no
|
||||
# default is yes if CMake can find gzip, else no
|
||||
-D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it
|
||||
# default is yes if CMake can find the gzip program, else no
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
LMP_INC = -DLAMMPS_GZIP <other LMP_INC settings>
|
||||
|
||||
This option requires that your operating system fully supports the "popen()"
|
||||
function in the standard runtime library and that a ``gzip`` executable can be
|
||||
found by LAMMPS during a run.
|
||||
This option requires that your operating system fully supports the
|
||||
"popen()" function in the standard runtime library and that a ``gzip``
|
||||
or other executable can be found by LAMMPS in the standard search path
|
||||
during a run.
|
||||
|
||||
.. note::
|
||||
|
||||
On some clusters with high-speed networks, using the "fork()" library
|
||||
call (required by "popen()") can interfere with the fast communication
|
||||
On clusters with high-speed networks, using the "fork()" library call
|
||||
(required by "popen()") can interfere with the fast communication
|
||||
library and lead to simulations using compressed output or input to
|
||||
hang or crash. For selected operations, compressed file I/O is also
|
||||
available using a compression library instead, which is what the
|
||||
@ -452,7 +452,7 @@ those systems:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG <other LMP_INC settings>
|
||||
|
||||
----------
|
||||
|
||||
@ -479,7 +479,7 @@ e.g. to Python. Of course, the calling code has to be set up to
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS <other LMP_INC settings>
|
||||
|
||||
.. note::
|
||||
|
||||
@ -520,7 +520,7 @@ executable, not the library.
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE <other LMP_INC settings>
|
||||
|
||||
After compilation with this flag set, the LAMMPS executable will stop
|
||||
and produce a core dump when a division by zero, overflow, illegal math
|
||||
|
||||
@ -4,6 +4,7 @@ Notes for building LAMMPS on Windows
|
||||
* :ref:`General remarks <generic>`
|
||||
* :ref:`Running Linux on Windows <linux>`
|
||||
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
||||
* :ref:`Using Visual Studio <msvc>`
|
||||
* :ref:`Using a cross-compiler <cross>`
|
||||
|
||||
----------
|
||||
@ -31,13 +32,13 @@ pre-compiled Windows binary packages are sufficient for your needs. If
|
||||
it is necessary for you to compile LAMMPS on a Windows machine
|
||||
(e.g. because it is your main desktop), please also consider using a
|
||||
virtual machine software and compile and run LAMMPS in a Linux virtual
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10
|
||||
installation - consider using the Windows subsystem for Linux. This
|
||||
optional Windows feature allows you to run the bash shell from Ubuntu
|
||||
from within Windows and from there on, you can pretty much use that
|
||||
shell like you are running on an Ubuntu Linux machine (e.g. installing
|
||||
software via apt-get and more). For more details on that, please see
|
||||
:doc:`this tutorial <Howto_wsl>`.
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10 or
|
||||
Windows 11 installation - consider using the Windows subsystem for
|
||||
Linux. This optional Windows feature allows you to run the bash shell
|
||||
from Ubuntu from within Windows and from there on, you can pretty much
|
||||
use that shell like you are running on an Ubuntu Linux machine
|
||||
(e.g. installing software via apt-get and more). For more details on
|
||||
that, please see :doc:`this tutorial <Howto_wsl>`.
|
||||
|
||||
.. _gnu:
|
||||
|
||||
@ -67,6 +68,40 @@ requiring changes to the LAMMPS source code, or figure out corrections
|
||||
yourself, please report them on the lammps-users mailing list, or file
|
||||
them as an issue or pull request on the LAMMPS GitHub project.
|
||||
|
||||
.. _msvc:
|
||||
|
||||
Using Microsoft Visual Studio
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Following the integration of the :doc:`platform namespace
|
||||
<Developer_platform>` into the LAMMPS code base, portability of LAMMPS
|
||||
to be compiled on Windows using Visual Studio has been significantly
|
||||
improved. This has been tested with Visual Studio 2019 (aka version
|
||||
16). Not all features and packages in LAMMPS are currently supported
|
||||
out of the box, but a preset ``cmake/presets/windows.cmake`` is provided
|
||||
that contains the packages that have been compiled successfully. You
|
||||
must use the CMake based build procedure, and either use the integrated
|
||||
CMake support of Visual Studio or use an external CMake installation to
|
||||
create build files for the Visual Studio build system. Please note that
|
||||
on launching Visual Studio it will scan the directory tree and likely
|
||||
miss the correct master ``CMakeLists.txt``. Try to open the
|
||||
``cmake/CMakeSettings.json`` and use those CMake configurations as a
|
||||
starting point. It is also possible to configure and compile LAMMPS
|
||||
from the command line with a CMake binary from `cmake.org <https://cmake.org>`_.
|
||||
|
||||
Please note, that for either approach CMake will create a so-called
|
||||
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
|
||||
the command lines for building and testing LAMMPS must be adjusted
|
||||
accordingly.
|
||||
|
||||
To support running in parallel you can compile with OpenMP enabled using
|
||||
the OPENMP package or install Microsoft MPI (including the SDK) and compile
|
||||
LAMMPS with MPI enabled.
|
||||
|
||||
This is work in progress and you should contact the LAMMPS developers
|
||||
via GitHub, the forum, or the mailing list, if you have questions or
|
||||
LAMMPS specific problems.
|
||||
|
||||
.. _cross:
|
||||
|
||||
Using a cross-compiler
|
||||
|
||||
@ -47,7 +47,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`displace_atoms <displace_atoms>`
|
||||
* :doc:`dump <dump>`
|
||||
* :doc:`dump_modify <dump_modify>`
|
||||
* :doc:`dynamical_matrix <dynamical_matrix>`
|
||||
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
|
||||
* :doc:`echo <echo>`
|
||||
* :doc:`fix <fix>`
|
||||
* :doc:`fix_modify <fix_modify>`
|
||||
@ -117,7 +117,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`thermo <thermo>`
|
||||
* :doc:`thermo_modify <thermo_modify>`
|
||||
* :doc:`thermo_style <thermo_style>`
|
||||
* :doc:`third_order <third_order>`
|
||||
* :doc:`third_order (k) <third_order>`
|
||||
* :doc:`timer <timer>`
|
||||
* :doc:`timestep <timestep>`
|
||||
* :doc:`uncompute <uncompute>`
|
||||
|
||||
@ -35,6 +35,7 @@ OPT.
|
||||
* :doc:`class2 (ko) <bond_class2>`
|
||||
* :doc:`fene (iko) <bond_fene>`
|
||||
* :doc:`fene/expand (o) <bond_fene_expand>`
|
||||
* :doc:`fene/nm <bond_fene>`
|
||||
* :doc:`gaussian <bond_gaussian>`
|
||||
* :doc:`gromos (o) <bond_gromos>`
|
||||
* :doc:`harmonic (iko) <bond_harmonic>`
|
||||
|
||||
@ -28,6 +28,7 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`angle <compute_angle>`
|
||||
* :doc:`angle/local <compute_angle_local>`
|
||||
* :doc:`angmom/chunk <compute_angmom_chunk>`
|
||||
* :doc:`ave/sphere/atom (k) <compute_ave_sphere_atom>`
|
||||
* :doc:`basal/atom <compute_basal_atom>`
|
||||
* :doc:`body/local <compute_body_local>`
|
||||
* :doc:`bond <compute_bond>`
|
||||
|
||||
@ -23,6 +23,7 @@ OPT.
|
||||
:columns: 5
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>`
|
||||
* :doc:`acks2/reaxff (k) <fix_acks2_reaxff>`
|
||||
* :doc:`adapt <fix_adapt>`
|
||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||
* :doc:`addforce <fix_addforce>`
|
||||
@ -103,6 +104,7 @@ OPT.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>`
|
||||
* :doc:`mdi/engine <fix_mdi_engine>`
|
||||
* :doc:`meso/move <fix_meso_move>`
|
||||
* :doc:`mol/swap <fix_mol_swap>`
|
||||
* :doc:`momentum (k) <fix_momentum>`
|
||||
* :doc:`momentum/chunk <fix_momentum>`
|
||||
* :doc:`move <fix_move>`
|
||||
@ -127,6 +129,7 @@ OPT.
|
||||
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
||||
* :doc:`npt/uef <fix_nh_uef>`
|
||||
* :doc:`numdiff <fix_numdiff>`
|
||||
* :doc:`numdiff/virial <fix_numdiff_virial>`
|
||||
* :doc:`nve (giko) <fix_nve>`
|
||||
* :doc:`nve/asphere (gi) <fix_nve_asphere>`
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
||||
|
||||
@ -119,10 +119,12 @@ OPT.
|
||||
* :doc:`granular <pair_granular>`
|
||||
* :doc:`gw <pair_gw>`
|
||||
* :doc:`gw/zbl <pair_gw>`
|
||||
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
|
||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hdnnp <pair_hdnnp>`
|
||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
||||
* :doc:`ilp/tmd <pair_ilp_tmd>`
|
||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||
* :doc:`lcbop <pair_lcbop>`
|
||||
@ -210,6 +212,7 @@ OPT.
|
||||
* :doc:`nm/cut (o) <pair_nm>`
|
||||
* :doc:`nm/cut/coul/cut (o) <pair_nm>`
|
||||
* :doc:`nm/cut/coul/long (o) <pair_nm>`
|
||||
* :doc:`nm/cut/split <pair_nm>`
|
||||
* :doc:`oxdna/coaxstk <pair_oxdna>`
|
||||
* :doc:`oxdna/excv <pair_oxdna>`
|
||||
* :doc:`oxdna/hbond <pair_oxdna>`
|
||||
@ -239,6 +242,7 @@ OPT.
|
||||
* :doc:`reaxff (ko) <pair_reaxff>`
|
||||
* :doc:`rebo (io) <pair_airebo>`
|
||||
* :doc:`resquared (go) <pair_resquared>`
|
||||
* :doc:`saip/metal <pair_saip_metal>`
|
||||
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
|
||||
* :doc:`smd/hertz <pair_smd_hertz>`
|
||||
* :doc:`smd/tlsph <pair_smd_tlsph>`
|
||||
@ -262,6 +266,7 @@ OPT.
|
||||
* :doc:`spin/neel <pair_spin_neel>`
|
||||
* :doc:`srp <pair_srp>`
|
||||
* :doc:`sw (giko) <pair_sw>`
|
||||
* :doc:`sw/mod (o) <pair_sw>`
|
||||
* :doc:`table (gko) <pair_table>`
|
||||
* :doc:`table/rx (k) <pair_table_rx>`
|
||||
* :doc:`tdpd <pair_mesodpd>`
|
||||
|
||||
@ -11,6 +11,7 @@ of time and requests from the LAMMPS user community.
|
||||
:maxdepth: 1
|
||||
|
||||
Developer_org
|
||||
Developer_cxx_vs_c_style
|
||||
Developer_parallel
|
||||
Developer_flow
|
||||
Developer_write
|
||||
@ -18,4 +19,5 @@ of time and requests from the LAMMPS user community.
|
||||
Developer_plugins
|
||||
Developer_unittest
|
||||
Classes
|
||||
Developer_platform
|
||||
Developer_utils
|
||||
|
||||
384
doc/src/Developer_cxx_vs_c_style.rst
Normal file
384
doc/src/Developer_cxx_vs_c_style.rst
Normal file
@ -0,0 +1,384 @@
|
||||
Code design
|
||||
-----------
|
||||
|
||||
This section discusses some of the code design choices in LAMMPS and
|
||||
overall strategy in order to assist developers to write new code that
|
||||
will fit well with the remaining code. Please see the section on
|
||||
:doc:`Requirements for contributed code <Modify_style>` for more
|
||||
specific recommendations and guidelines. While that section is
|
||||
organized more in the form of a checklist for code contributors, the
|
||||
focus here is on overall code design strategy, choices made between
|
||||
possible alternatives, and to discuss of some relevant C++ programming
|
||||
language constructs.
|
||||
|
||||
Historically, the basic design philosophy of the LAMMPS C++ code was
|
||||
that of a "C with classes" style. The was motivated by the desire to
|
||||
make it easier to modify LAMMPS for people without significant training
|
||||
in C++ programming and by trying to use data structures and code constructs
|
||||
that somewhat resemble the previous implementation(s) in Fortran.
|
||||
A contributing factor for this choice also was that at the time the
|
||||
implementation of C++ compilers was not always very mature and some of
|
||||
the advanced features contained bugs or were not functioning exactly
|
||||
as the standard required; plus there was some disagreement between
|
||||
compiler vendors about how to interpret the C++ standard documents.
|
||||
|
||||
However, C++ compilers have advanced a lot since then and with the
|
||||
transition to requiring the C++11 standard in 2020 as the minimum C++ language
|
||||
standard for LAMMPS, the decision was made to also replace some of the
|
||||
C-style constructs with equivalent C++ functionality, either from the
|
||||
C++ standard library or as custom classes or function, in order to
|
||||
improve readability of the code and to increase code reuse through
|
||||
abstraction of commonly used functionality.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that as of spring 2022 there is still a sizable chunk of
|
||||
legacy code in LAMMPS that has not yet been refactored to reflect these
|
||||
style conventions in full. LAMMPS has a large code base and many
|
||||
different contributors and there also is a hierarchy of precedence
|
||||
in which the code is adapted. Highest priority has the code in the
|
||||
``src`` folder, followed by code in packages in order of their popularity
|
||||
and complexity (simpler code is adapted sooner), followed by code
|
||||
in the ``lib`` folder. Source code that is downloaded during compilation
|
||||
is not subject to the conventions discussed here.
|
||||
|
||||
Object oriented code
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS is designed to be an object oriented code, that is each
|
||||
simulation is represented by an instance of the LAMMPS class. When
|
||||
running in parallel, of course, each MPI process will create such an
|
||||
instance. This can be seen in the ``main.cpp`` file where the core
|
||||
steps of running a LAMMPS simulation are the following 3 lines of code:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||
lammps->input->file();
|
||||
delete lammps;
|
||||
|
||||
The first line creates a LAMMPS class instance and passes the command
|
||||
line arguments and the global communicator to its constructor. The
|
||||
second line tells the LAMMPS instance to process the input (either from
|
||||
standard input or the provided input file) until the end. And the third
|
||||
line deletes that instance again. The remainder of the main.cpp file
|
||||
are for error handling, MPI configuration and other special features.
|
||||
|
||||
In the constructor of the LAMMPS class instance the basic LAMMPS class hierarchy
|
||||
is created as shown in :ref:`class-topology`. While processing the input further
|
||||
class instances are created, or deleted, or replaced and specific member functions
|
||||
of specific classes are called to trigger actions like creating atoms, computing
|
||||
forces, computing properties, propagating the system, or writing output.
|
||||
|
||||
Compositing and Inheritance
|
||||
===========================
|
||||
|
||||
LAMMPS makes extensive use of the object oriented programming (OOP)
|
||||
principles of *compositing* and *inheritance*. Classes like the
|
||||
``LAMMPS`` class are a **composite** containing pointers to instances of
|
||||
other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||
``Modify``, and so on. Each of these classes implement certain
|
||||
functionality by storing and manipulating data related to the simulation
|
||||
and providing member functions that trigger certain actions. Some of
|
||||
those classes like ``Force`` are a composite again containing instances
|
||||
of classes describing the force interactions or ``Modify`` containing
|
||||
and calling fixes and computes. In most cases (e.g. ``AtomVec``, ``Comm``,
|
||||
``Pair``, or ``Bond``) there is only one instance of those member classes
|
||||
allowed, but in a few cases (e.g. ``Region``, ``Fix``, ``Compute``, or
|
||||
``Dump``) there can be multiple instances and the parent class is
|
||||
maintaining a list of the pointers of instantiated classes instead
|
||||
of a single pointer.
|
||||
|
||||
Changing behavior or adjusting how LAMMPS handles a simulation is
|
||||
implemented via **inheritance** where different variants of the
|
||||
functionality are realized by creating *derived* classes that can share
|
||||
common functionality in their base class and provide a consistent
|
||||
interface where the derived classes replace (dummy or pure) functions in
|
||||
the base class. The higher level classes can then call those methods of
|
||||
the instantiated classes without having to know which specific derived
|
||||
class variant was instantiated. In the LAMMPS documentation those
|
||||
derived classes are usually referred to a "styles", e.g. pair styles,
|
||||
fix styles, atom styles and so on.
|
||||
|
||||
This is the origin of the flexibility of LAMMPS and facilitates for
|
||||
example to compute forces for very different non-bonded potential
|
||||
functions by having different pair styles (implemented as different
|
||||
classes derived from the ``Pair`` class) where the evaluation of the
|
||||
potential function is confined to the implementation of the individual
|
||||
classes. Whenever a new :doc:`pair_style` or :doc:`bond_style` or
|
||||
:doc:`comm_style` or similar command is processed in the LAMMPS input
|
||||
any existing class instance is deleted and a new instance created in
|
||||
it place.
|
||||
|
||||
Classes derived from ``Fix`` or ``Compute`` represent a different facet
|
||||
of LAMMPS' flexibility as there can be multiple instances of them an
|
||||
their member functions will be called at different phases of the time
|
||||
integration process (as explained in `Developer_flow`). This way
|
||||
multiple manipulations of the entire or parts of the system can be
|
||||
programmed (with fix styles) or different computations can be performed
|
||||
and accessed and further processed or output through a common interface
|
||||
(with compute styles).
|
||||
|
||||
Further code sharing is possible by creating derived classes from the
|
||||
derived classes (for instance to implement an accelerated version of a
|
||||
pair style) where then only a subset of the methods are replaced with
|
||||
the accelerated versions.
|
||||
|
||||
Polymorphism
|
||||
============
|
||||
|
||||
Polymorphism and dynamic dispatch are another OOP feature that play an
|
||||
important part of how LAMMPS selects which code to execute. In a nutshell,
|
||||
this is a mechanism where the decision of which member function to call
|
||||
from a class is determined at runtime and not when the code is compiled.
|
||||
To enable it, the function has to be declared as ``virtual`` and all
|
||||
corresponding functions in derived classes should be using the ``override``
|
||||
property. Below is a brief example.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
class Base {
|
||||
public:
|
||||
virtual ~Base() = default;
|
||||
void call();
|
||||
void normal();
|
||||
virtual void poly();
|
||||
};
|
||||
|
||||
void Base::call() {
|
||||
normal();
|
||||
poly();
|
||||
}
|
||||
|
||||
class Derived : public Base {
|
||||
public:
|
||||
~Derived() override = default;
|
||||
void normal();
|
||||
void poly() override;
|
||||
};
|
||||
|
||||
// [....]
|
||||
|
||||
Base *base1 = new Base();
|
||||
Base *base2 = new Derived();
|
||||
|
||||
base1->call();
|
||||
base2->call();
|
||||
|
||||
The difference in behavior of the ``normal()`` and the ``poly()`` member
|
||||
functions is in which of the two member functions is called when
|
||||
executing `base1->call()` and `base2->call()`. Without polymorphism, a
|
||||
function within the base class will call only member functions within
|
||||
the same scope, that is ``Base::call()`` will always call
|
||||
``Base::normal()``. But for the `base2->call()` the call for the
|
||||
virtual member function will be dispatched to ``Derived::poly()``
|
||||
instead. This mechanism allows to always call functions within the
|
||||
scope of the class type that was used to create the class instance, even
|
||||
if they are assigned to a pointer using the type of a base class. This
|
||||
is the desired behavior, and thanks to dynamic dispatch, LAMMPS can even
|
||||
use styles that are loaded at runtime from a shared object file with the
|
||||
:doc:`plugin command <plugin>`.
|
||||
|
||||
A special case of virtual functions are so-called pure functions. These
|
||||
are virtual functions that are initialized to 0 in the class declaration
|
||||
(see example below).
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
class Base {
|
||||
public:
|
||||
virtual void pure() = 0;
|
||||
};
|
||||
|
||||
This has the effect that it will no longer be possible to create an
|
||||
instance of the base class and that derived classes **must** implement
|
||||
these functions. Many of the functions listed with the various class
|
||||
styles in the section :doc:`Modify` are such pure functions. The
|
||||
motivation for this is to define the interface or API of the functions
|
||||
but defer the implementation to the derived classes.
|
||||
|
||||
However, there are downsides to this. For example, calls to virtual
|
||||
functions from within a constructor, will not be in the scope of the
|
||||
derived class and thus it is good practice to either avoid calling them
|
||||
or to provide an explicit scope like in ``Base::poly()``. Furthermore,
|
||||
any destructors in classes containing virtual functions should be
|
||||
declared virtual, too, so they are processed in the expected order
|
||||
before types are removed from dynamic dispatch.
|
||||
|
||||
.. admonition:: Important Notes
|
||||
|
||||
In order to be able to detect incompatibilities and to avoid unexpected
|
||||
behavior already at compile time, it is crucial that all member functions
|
||||
that are intended to replace a virtual or pure function use the ``override``
|
||||
property keyword. For the same reason it should be avoided to use overloads
|
||||
or default arguments for virtual functions as they lead to confusion over
|
||||
which function is supposed to override which and which arguments need to be
|
||||
declared.
|
||||
|
||||
Style Factories
|
||||
===============
|
||||
|
||||
In order to create class instances of the different styles, LAMMPS often
|
||||
uses a programming pattern called `Factory`. Those are functions that create
|
||||
an instance of a specific derived class, say ``PairLJCut`` and return a pointer
|
||||
to the type of the common base class of that style, ``Pair`` in this case.
|
||||
To associate the factory function with the style keyword, an ``std::map``
|
||||
class is used in which function pointers are indexed by their keyword
|
||||
(for example "lj/cut" for ``PairLJCut`` and "morse" ``PairMorse``).
|
||||
A couple of typedefs help to keep the code readable and a template function
|
||||
is used to implement the actual factory functions for the individual classes.
|
||||
|
||||
I/O and output formatting
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
C-style stdio versus C++ style iostreams
|
||||
========================================
|
||||
|
||||
LAMMPS chooses to use the "stdio" library of the standard C library for
|
||||
reading from and writing to files and console instead of C++
|
||||
"iostreams". This is mainly motivated by the better performance, better
|
||||
control over formatting, and less effort to achieve specific formatting.
|
||||
|
||||
Since mixing "stdio" and "iostreams" can lead to unexpected behavior using
|
||||
the latter is strongly discouraged. Also output to the screen should not
|
||||
use the predefined ``stdout`` FILE pointer, but rather the ``screen`` and
|
||||
``logfile`` FILE pointers managed by the LAMMPS class. Furthermore, output
|
||||
should only be done by MPI rank 0 (``comm->me == 0``) and output that is
|
||||
send to both ``screen`` and ``logfile`` should use the
|
||||
:cpp:func:`utils::logmesg() convenience function <LAMMPS_NS::utils::logmesg>`.
|
||||
|
||||
We also discourage the use for stringstreams as the bundled {fmt} library
|
||||
and the customized tokenizer classes can provide the same functionality
|
||||
in a cleaner way with better performance. This will also help to retain
|
||||
a consistent programming style despite the many different contributors.
|
||||
|
||||
Formatting with the {fmt} library
|
||||
===================================
|
||||
|
||||
The LAMMPS source code includes a copy of the `{fmt} library
|
||||
<https://fmt.dev>`_ which is preferred over formatting with the
|
||||
"printf()" family of functions. The primary reason is that it allows a
|
||||
typesafe default format for any type of supported data. This is
|
||||
particularly useful for formatting integers of a given size (32-bit or
|
||||
64-bit) which may require different format strings depending on compile
|
||||
time settings or compilers/operating systems. Furthermore, {fmt} gives
|
||||
better performance, has more functionality, a familiar formatting syntax
|
||||
that has similarities to ``format()`` in Python, and provides a facility
|
||||
that can be used to integrate format strings and a variable number of
|
||||
arguments into custom functions in a much simpler way that the varargs
|
||||
mechanism of the C library. Finally, {fmt} has been included into the
|
||||
C++20 language standard, so changes to adopt it are future proof.
|
||||
|
||||
Formatted strings are frequently created by calling the
|
||||
``fmt::format()`` function which will return a string as ``std::string``
|
||||
class instance. In contrast to the ``%`` placeholder in ``printf()``,
|
||||
the {fmt} library uses ``{}`` to embed format descriptors. In the
|
||||
simplest case, no additional characters are needed as {fmt} will choose
|
||||
the default format based on the data type of the argument. Alternatively
|
||||
The ``fmt::print()`` function may be used instead of ``printf()`` or
|
||||
``fprintf()``. In addition, several LAMMPS output functions, that
|
||||
originally accepted a single string as arguments have been overloaded to
|
||||
accept a format string with optional arguments as well (e.g.
|
||||
``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
|
||||
|
||||
Summary of the {fmt} format syntax
|
||||
==================================
|
||||
|
||||
The syntax of the format string is "{[<argument id>][:<format spec>]}",
|
||||
where either the argument id or the format spec (separated by a colon
|
||||
':') is optional. The argument id is usually a number starting from 0
|
||||
that is the index to the arguments following the format string. By
|
||||
default these are assigned in order (i.e. 0, 1, 2, 3, 4 etc.). The most
|
||||
common case for using argument id would be to use the same argument in
|
||||
multiple places in the format string without having to provide it as an
|
||||
argument multiple times. In LAMMPS the argument id is rarely used.
|
||||
|
||||
More common is the use of the format specifier, which starts with a
|
||||
colon. This may optionally be followed by a fill character (default is
|
||||
' '). If provided, the fill character **must** be followed by an
|
||||
alignment character ('<', '^', '>' for left, centered, or right
|
||||
alignment (default)). The alignment character may be used without a fill
|
||||
character. The next important format parameter would be the minimum
|
||||
width, which may be followed by a dot '.' and a precision for floating
|
||||
point numbers. The final character in the format string would be an
|
||||
indicator for the "presentation", i.e. 'd' for decimal presentation of
|
||||
integers, 'x' for hexadecimal, 'o' for octal, 'c' for character
|
||||
etc. This mostly follows the "printf()" scheme but without requiring an
|
||||
additional length parameter to distinguish between different integer
|
||||
widths. The {fmt} library will detect those and adapt the formatting
|
||||
accordingly. For floating point numbers there are correspondingly, 'g'
|
||||
for generic presentation, 'e' for exponential presentation, and 'f' for
|
||||
fixed point presentation.
|
||||
|
||||
Thus "{:8}" would represent *any* type argument using at least 8
|
||||
characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
||||
"{:>8}" as right aligned. If a specific presentation is selected, the
|
||||
argument type must be compatible or else the {fmt} formatting code will
|
||||
throw an exception. Some format string examples are given below:
|
||||
|
||||
.. code-block:: C
|
||||
|
||||
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
||||
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
||||
label, time_min, time, time_max, time_sq, tmp);
|
||||
utils::logmesg(lmp,"{:>6} = max # of 1-2 neighbors\n",maxall);
|
||||
utils::logmesg(lmp,"Lattice spacing in x,y,z = {:.8} {:.8} {:.8}\n",
|
||||
xlattice,ylattice,zlattice);
|
||||
|
||||
which will create the following output lines:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
CPU time: 0:02:16
|
||||
Pair | 2.0133 | 2.0133 | 2.0133 | 0.0 | 84.21
|
||||
4 = max # of 1-2 neighbors
|
||||
Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962
|
||||
|
||||
A special feature of the {fmt} library is that format parameters like
|
||||
the width or the precision may be also provided as arguments. In that
|
||||
case a nested format is used where a pair of curly braces (with an
|
||||
optional argument id) "{}" are used instead of the value, for example
|
||||
"{:{}d}" will consume two integer arguments, the first will be the value
|
||||
shown and the second the minimum width.
|
||||
|
||||
For more details and examples, please consult the `{fmt} syntax
|
||||
documentation <https://fmt.dev/latest/syntax.html>`_ website.
|
||||
|
||||
|
||||
Memory management
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Dynamical allocation of data and objects should be done with either the
|
||||
C++ commands "new" and "delete/delete[]" or using member functions of
|
||||
the ``Memory`` class, most commonly, ``Memory::create()``,
|
||||
``Memory::grow()``, and ``Memory::destroy()``. The use of ``malloc()``,
|
||||
``calloc()``, ``realloc()`` and ``free()`` directly is strongly
|
||||
discouraged. To simplify adapting legacy code into the LAMMPS code base
|
||||
the member functions ``Memory::smalloc()``, ``Memory::srealloc()``, and
|
||||
``Memory::sfree()`` are available.
|
||||
|
||||
Using those custom memory allocation functions is motivated by the
|
||||
following considerations:
|
||||
|
||||
- memory allocation failures on *any* MPI rank during a parallel run
|
||||
will trigger an immediate abort of the entire parallel calculation
|
||||
instead of stalling it
|
||||
- a failing "new" will trigger an exception which is also captured by
|
||||
LAMMPS and triggers a global abort
|
||||
- allocation of multi-dimensional arrays will be done in a C compatible
|
||||
fashion but so that the storage of the actual data is stored in one
|
||||
large consecutive block and thus when MPI communication is needed,
|
||||
only this storage needs to be communicated (similar to Fortran arrays)
|
||||
- the "destroy()" and "sfree()" functions may safely be called on NULL
|
||||
pointers
|
||||
- the "destroy()" functions will nullify the pointer variables making
|
||||
"use after free" errors easy to detect
|
||||
- it is possible to use a larger than default memory alignment (not on
|
||||
all operating systems, since the allocated storage pointers must be
|
||||
compatible with ``free()`` for technical reasons)
|
||||
|
||||
In the practical implementation of code this means that any pointer variables
|
||||
that are class members should be initialized to a ``nullptr`` value in their
|
||||
respective constructors. That way it would be safe to call ``Memory::destroy()``
|
||||
or ``delete[]`` on them before *any* allocation outside the constructor.
|
||||
This helps to prevent memory leaks.
|
||||
@ -7,6 +7,61 @@ typically document what a variable stores, what a small section of
|
||||
code does, or what a function does and its input/outputs. The topics
|
||||
on this page are intended to document code functionality at a higher level.
|
||||
|
||||
Reading and parsing of text and text files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It is frequently required for a class in LAMMPS to read in additional
|
||||
data from a file, most commonly potential parameters from a potential
|
||||
file for manybody potentials. LAMMPS provides several custom classes
|
||||
and convenience functions to simplify the process. This offers the
|
||||
following benefits:
|
||||
|
||||
- better code reuse and fewer lines of code needed to implement reading
|
||||
and parsing data from a file
|
||||
- better detection of format errors, incompatible data, and better error messages
|
||||
- exit with an error message instead of silently converting only part of the
|
||||
text to a number or returning a 0 on unrecognized text and thus reading incorrect values
|
||||
- re-entrant code through avoiding global static variables (as used by ``strtok()``)
|
||||
- transparent support for translating unsupported UTF-8 characters to their ASCII equivalents
|
||||
(the text to value conversion functions **only** accept ASCII characters)
|
||||
|
||||
In most cases (e.g. potential files) the same data is needed on all MPI
|
||||
ranks. Then it is best to do the reading and parsing only on MPI rank
|
||||
0, and communicate the data later with one or more ``MPI_Bcast()``
|
||||
calls. For reading generic text and potential parameter files the
|
||||
custom classes :cpp:class:`TextFileReader <LAMMPS_NS::TextFileReader>`
|
||||
and :cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>`
|
||||
are available. Those classes allow to read the file as individual lines
|
||||
for which they can return a tokenizer class (see below) for parsing the
|
||||
line, or they can return blocks of numbers as a vector directly. The
|
||||
documentation on `File reader classes <file-reader-classes>`_ contains
|
||||
an example for a typical case.
|
||||
|
||||
When reading per-atom data, the data in the file usually needs include
|
||||
an atom ID so it can be associated with a particular atom. In that case
|
||||
the data can be read in multi-line chunks and broadcast to all MPI ranks
|
||||
with :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>`. Those chunks are then
|
||||
split into lines, parsed, and applied only to atoms the MPI rank
|
||||
"owns".
|
||||
|
||||
For splitting a string (incrementally) into words and optionally
|
||||
converting those to numbers, the :cpp:class:`Tokenizer
|
||||
<LAMMPS_NS::Tokenizer>` and :cpp:class:`ValueTokenizer
|
||||
<LAMMPS_NS::ValueTokenizer>` can be used. Those provide a superset of
|
||||
the functionality of ``strtok()`` from the C-library and the latter also
|
||||
includes conversion to different types. Any errors while processing the
|
||||
string in those classes will result in an exception, which can be caught
|
||||
and the error processed as needed. Unlike the C-library functions
|
||||
``atoi()``, ``atof()``, ``strtol()``, or ``strtod()`` the conversion
|
||||
will check if the converted text is a valid integer of floating point
|
||||
number and will not silently return an unexpected or incorrect value.
|
||||
For example, ``atoi()`` will return 12 when converting "12.5" while the
|
||||
ValueTokenizer class will throw an :cpp:class:`InvalidIntegerException
|
||||
<LAMMPS_NS::InvalidIntegerException>` if
|
||||
:cpp:func:`ValueTokenizer::next_int()
|
||||
<LAMMPS_NS::ValueTokenizer::next_int>` is called on the same string.
|
||||
|
||||
Fix contributions to instantaneous energy, virial, and cumulative energy
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -225,7 +225,7 @@ follows:
|
||||
commands in an input script.
|
||||
|
||||
- The Force class computes various forces between atoms. The Pair
|
||||
parent class is for non-bonded or pair-wise forces, which in LAMMPS
|
||||
parent class is for non-bonded or pairwise forces, which in LAMMPS
|
||||
also includes many-body forces such as the Tersoff 3-body potential if
|
||||
those are computed by walking pairwise neighbor lists. The Bond,
|
||||
Angle, Dihedral, Improper parent classes are styles for bonded
|
||||
|
||||
155
doc/src/Developer_platform.rst
Normal file
155
doc/src/Developer_platform.rst
Normal file
@ -0,0 +1,155 @@
|
||||
Platform abstraction functions
|
||||
------------------------------
|
||||
|
||||
The ``platform`` sub-namespace inside the ``LAMMPS_NS`` namespace
|
||||
provides a collection of wrapper and convenience functions and utilities
|
||||
that perform common tasks for which platform specific code would be
|
||||
required or for which a more high-level abstraction would be convenient
|
||||
and reduce duplicated code. This reduces redundant implementations and
|
||||
encourages consistent behavior and thus has some overlap with the
|
||||
:doc:`"utils" sub-namespace <Developer_utils>`.
|
||||
|
||||
Time functions
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: cputime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: walltime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: usleep
|
||||
:project: progguide
|
||||
|
||||
Platform information functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: os_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compiler_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: cxx_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: openmp_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_vendor
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compress_info
|
||||
:project: progguide
|
||||
|
||||
|
||||
File and path functions and global constants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: filepathsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenvariable:: pathvarsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: is_console
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_is_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: current_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: chdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mkdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: rmdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: unlink
|
||||
:project: progguide
|
||||
|
||||
Standard I/O function wrappers
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: END_OF_FILE
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftell
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: fseek
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftruncate
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: popen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: pclose
|
||||
:project: progguide
|
||||
|
||||
Environment variable functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: putenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: unsetenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_pathenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: find_exe_path
|
||||
:project: progguide
|
||||
|
||||
Dynamically loaded object or library functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: dlopen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlclose
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlsym
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlerror
|
||||
:project: progguide
|
||||
|
||||
Compressed file I/O functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: has_compress_extension
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_read
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_write
|
||||
:project: progguide
|
||||
@ -7,7 +7,9 @@ a collection of convenience functions and utilities that perform common
|
||||
tasks that are required repeatedly throughout the LAMMPS code like
|
||||
reading or writing to files with error checking or translation of
|
||||
strings into specific types of numbers with checking for validity. This
|
||||
reduces redundant implementations and encourages consistent behavior.
|
||||
reduces redundant implementations and encourages consistent behavior and
|
||||
thus has some overlap with the :doc:`"platform" sub-namespace
|
||||
<Developer_platform>`.
|
||||
|
||||
I/O with status check and similar functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -19,18 +21,21 @@ In that case, the functions will stop with an error message, indicating
|
||||
the name of the problematic file, if possible unless the *error* argument
|
||||
is a NULL pointer.
|
||||
|
||||
The :cpp:func:`fgets_trunc` function will work similar for ``fgets()``
|
||||
but it will read in a whole line (i.e. until the end of line or end
|
||||
of file), but store only as many characters as will fit into the buffer
|
||||
including a final newline character and the terminating NULL byte.
|
||||
If the line in the file is longer it will thus be truncated in the buffer.
|
||||
This function is used by :cpp:func:`read_lines_from_file` to read individual
|
||||
lines but make certain they follow the size constraints.
|
||||
The :cpp:func:`utils::fgets_trunc() <LAMMPS_NS::utils::fgets_trunc>`
|
||||
function will work similar for ``fgets()`` but it will read in a whole
|
||||
line (i.e. until the end of line or end of file), but store only as many
|
||||
characters as will fit into the buffer including a final newline
|
||||
character and the terminating NULL byte. If the line in the file is
|
||||
longer it will thus be truncated in the buffer. This function is used
|
||||
by :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>` to read individual lines but
|
||||
make certain they follow the size constraints.
|
||||
|
||||
The :cpp:func:`read_lines_from_file` function will read the requested
|
||||
number of lines of a maximum length into a buffer and will return 0
|
||||
if successful or 1 if not. It also guarantees that all lines are
|
||||
terminated with a newline character and the entire buffer with a
|
||||
The :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>` function will read the
|
||||
requested number of lines of a maximum length into a buffer and will
|
||||
return 0 if successful or 1 if not. It also guarantees that all lines
|
||||
are terminated with a newline character and the entire buffer with a
|
||||
NULL character.
|
||||
|
||||
----------
|
||||
@ -54,33 +59,54 @@ String to number conversions with validity check
|
||||
|
||||
These functions should be used to convert strings to numbers. They are
|
||||
are strongly preferred over C library calls like ``atoi()`` or
|
||||
``atof()`` since they check if the **entire** provided string is a valid
|
||||
``atof()`` since they check if the **entire** string is a valid
|
||||
(floating-point or integer) number, and will error out instead of
|
||||
silently returning the result of a partial conversion or zero in cases
|
||||
where the string is not a valid number. This behavior allows to more
|
||||
easily detect typos or issues when processing input files.
|
||||
where the string is not a valid number. This behavior improves
|
||||
detecting typos or issues when processing input files.
|
||||
|
||||
Similarly the :cpp:func:`utils::logical() <LAMMPS_NS::utils::logical>` function
|
||||
will convert a string into a boolean and will only accept certain words.
|
||||
|
||||
The *do_abort* flag should be set to ``true`` in case this function
|
||||
is called only on a single MPI rank, as that will then trigger the
|
||||
a call to ``Error::one()`` for errors instead of ``Error::all()``
|
||||
and avoids a "hanging" calculation when run in parallel.
|
||||
|
||||
Please also see :cpp:func:`is_integer() <LAMMPS_NS::utils::is_integer>`
|
||||
and :cpp:func:`is_double() <LAMMPS_NS::utils::is_double>` for testing
|
||||
Please also see :cpp:func:`utils::is_integer() <LAMMPS_NS::utils::is_integer>`
|
||||
and :cpp:func:`utils::is_double() <LAMMPS_NS::utils::is_double>` for testing
|
||||
strings for compliance without conversion.
|
||||
|
||||
----------
|
||||
|
||||
.. doxygenfunction:: numeric
|
||||
.. doxygenfunction:: numeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: inumeric
|
||||
.. doxygenfunction:: numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: bnumeric
|
||||
.. doxygenfunction:: inumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: tnumeric
|
||||
.. doxygenfunction:: inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: bnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: tnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -95,6 +121,12 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: strdup
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: lowercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: uppercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: trim
|
||||
:project: progguide
|
||||
|
||||
@ -137,21 +169,6 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: is_double
|
||||
:project: progguide
|
||||
|
||||
File and path functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
Potential file functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -191,6 +208,9 @@ Convenience functions
|
||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: flush_buffers(LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: getsyserror
|
||||
:project: progguide
|
||||
|
||||
@ -323,11 +343,11 @@ This code example should produce the following output:
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::InvalidIntegerException
|
||||
:project: progguide
|
||||
:members: what
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::InvalidFloatException
|
||||
:project: progguide
|
||||
:members: what
|
||||
:members:
|
||||
|
||||
----------
|
||||
|
||||
@ -376,21 +396,26 @@ A typical code segment would look like this:
|
||||
|
||||
----------
|
||||
|
||||
.. file-reader-classes:
|
||||
|
||||
File reader classes
|
||||
-------------------
|
||||
|
||||
The purpose of the file reader classes is to simplify the recurring task
|
||||
of reading and parsing files. They can use the
|
||||
:cpp:class:`LAMMPS_NS::ValueTokenizer` class to process the read in
|
||||
text. The :cpp:class:`LAMMPS_NS::TextFileReader` is a more general
|
||||
version while :cpp:class:`LAMMPS_NS::PotentialFileReader` is specialized
|
||||
to implement the behavior expected for looking up and reading/parsing
|
||||
files with potential parameters in LAMMPS. The potential file reader
|
||||
class requires a LAMMPS instance, requires to be run on MPI rank 0 only,
|
||||
will use the :cpp:func:`LAMMPS_NS::utils::get_potential_file_path`
|
||||
function to look up and open the file, and will call the
|
||||
:cpp:class:`LAMMPS_NS::Error` class in case of failures to read or to
|
||||
convert numbers, so that LAMMPS will be aborted.
|
||||
:cpp:class:`ValueTokenizer <LAMMPS_NS::ValueTokenizer>` class to process
|
||||
the read in text. The :cpp:class:`TextFileReader
|
||||
<LAMMPS_NS::TextFileReader>` is a more general version while
|
||||
:cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>` is
|
||||
specialized to implement the behavior expected for looking up and
|
||||
reading/parsing files with potential parameters in LAMMPS. The
|
||||
potential file reader class requires a LAMMPS instance, requires to be
|
||||
run on MPI rank 0 only, will use the
|
||||
:cpp:func:`utils::get_potential_file_path
|
||||
<LAMMPS_NS::utils::get_potential_file_path>` function to look up and
|
||||
open the file, and will call the :cpp:class:`LAMMPS_NS::Error` class in
|
||||
case of failures to read or to convert numbers, so that LAMMPS will be
|
||||
aborted.
|
||||
|
||||
.. code-block:: C++
|
||||
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
||||
@ -465,10 +490,10 @@ provided, as that is used to determine whether a new page of memory
|
||||
must be used.
|
||||
|
||||
The :cpp:class:`MyPage <LAMMPS_NS::MyPage>` class offers two ways to
|
||||
reserve a chunk: 1) with :cpp:func:`get() <LAMMPS_NS::MyPage::get>` the
|
||||
chunk size needs to be known in advance, 2) with :cpp:func:`vget()
|
||||
reserve a chunk: 1) with :cpp:func:`MyPage::get() <LAMMPS_NS::MyPage::get>` the
|
||||
chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
|
||||
<LAMMPS_NS::MyPage::vget>` a pointer to the next chunk is returned, but
|
||||
its size is registered later with :cpp:func:`vgot()
|
||||
its size is registered later with :cpp:func:`MyPage::vgot()
|
||||
<LAMMPS_NS::MyPage::vgot>`.
|
||||
|
||||
.. code-block:: C++
|
||||
@ -571,4 +596,3 @@ the communication buffers.
|
||||
|
||||
.. doxygenunion:: LAMMPS_NS::ubuf
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -29,7 +29,9 @@ of code in the header before include guards:
|
||||
.. code-block:: c
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
FixStyle(print/vel,FixPrintVel)
|
||||
// clang-format off
|
||||
FixStyle(print/vel,FixPrintVel);
|
||||
// clang-format on
|
||||
#else
|
||||
/* the definition of the FixPrintVel class comes here */
|
||||
...
|
||||
@ -53,7 +55,7 @@ of each timestep. First of all, implement a constructor:
|
||||
if (narg < 4)
|
||||
error->all(FLERR,"Illegal fix print/vel command");
|
||||
|
||||
nevery = force->inumeric(FLERR,arg[3]);
|
||||
nevery = utils::inumeric(FLERR,arg[3],false,lmp);
|
||||
if (nevery <= 0)
|
||||
error->all(FLERR,"Illegal fix print/vel command");
|
||||
}
|
||||
|
||||
@ -1941,6 +1941,9 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
*Compute ID for fix numdiff does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
*Compute ID for fix numdiff/virial does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
*Compute ID for fix store/state does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
@ -3796,6 +3799,10 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
Self-explanatory. Efficient loop over all atoms for numerical
|
||||
difference requires consecutive atom IDs.
|
||||
|
||||
*Fix numdiff/virial must use group all*
|
||||
Virial contributions computed by this fix are
|
||||
computed on all atoms.
|
||||
|
||||
*Fix nve/asphere requires extended particles*
|
||||
This fix can only be used for particles with a shape setting.
|
||||
|
||||
@ -7772,9 +7779,6 @@ keyword to allow for additional bonds to be formed
|
||||
The system size must fit in a 32-bit integer to use this dump
|
||||
style.
|
||||
|
||||
*Too many atoms to dump sort*
|
||||
Cannot sort when running with more than 2\^31 atoms.
|
||||
|
||||
*Too many elements extracted from MEAM library.*
|
||||
Increase 'maxelt' in meam.h and recompile.
|
||||
|
||||
|
||||
@ -416,7 +416,7 @@ This will most likely cause errors in kinetic fluctuations.
|
||||
not defined for the specified atom style.
|
||||
|
||||
*Molecule has bond topology but no special bond settings*
|
||||
This means the bonded atoms will not be excluded in pair-wise
|
||||
This means the bonded atoms will not be excluded in pairwise
|
||||
interactions.
|
||||
|
||||
*Molecule template for create_atoms has multiple molecules*
|
||||
|
||||
@ -80,7 +80,7 @@ Lowercase directories
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| friction | frictional contact of spherical asperities between 2d surfaces |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| gcmc | Grand Canonical Monte Carlo (GCMC) via the fix gcmc command |
|
||||
| mc | Monte Carlo features via fix gcmc, widom and other commands |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| granregion | use of fix wall/region/gran as boundary on granular particles |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
@ -205,7 +205,7 @@ Uppercase directories
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| KAPPA | compute thermal conductivity via several methods |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| MC | using LAMMPS in a Monte Carlo mode to relax the energy of a system |
|
||||
| MC-LOOP | using LAMMPS in a Monte Carlo mode to relax the energy of a system in a input script loop |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| PACKAGES | examples for specific packages and contributed commands |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
|
||||
@ -491,11 +491,6 @@ NPT ensemble using Nose-Hoover thermostat:
|
||||
**(Schroeder)** Schroeder and Steinhauser, J Chem Phys, 133,
|
||||
154511 (2010).
|
||||
|
||||
.. _Jiang2:
|
||||
|
||||
**(Jiang)** Jiang, Hardy, Phillips, MacKerell, Schulten, and Roux,
|
||||
J Phys Chem Lett, 2, 87-92 (2011).
|
||||
|
||||
.. _Thole2:
|
||||
|
||||
**(Thole)** Chem Phys, 59, 341 (1981).
|
||||
|
||||
@ -7,11 +7,11 @@ LAMMPS GitHub tutorial
|
||||
|
||||
This document describes the process of how to use GitHub to integrate
|
||||
changes or additions you have made to LAMMPS into the official LAMMPS
|
||||
distribution. It uses the process of updating this very tutorial as
|
||||
an example to describe the individual steps and options. You need to
|
||||
be familiar with git and you may want to have a look at the
|
||||
`git book <http://git-scm.com/book/>`_ to reacquaint yourself with some
|
||||
of the more advanced git features used below.
|
||||
distribution. It uses the process of updating this very tutorial as an
|
||||
example to describe the individual steps and options. You need to be
|
||||
familiar with git and you may want to have a look at the `git book
|
||||
<http://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||
more advanced git features used below.
|
||||
|
||||
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
||||
on GitHub is the preferred option for integrating contributed features
|
||||
@ -37,15 +37,15 @@ username or e-mail address and password.
|
||||
**Forking the repository**
|
||||
|
||||
To get changes into LAMMPS, you need to first fork the `lammps/lammps`
|
||||
repository on GitHub. At the time of writing, *master* is the preferred
|
||||
repository on GitHub. At the time of writing, *develop* is the preferred
|
||||
target branch. Thus go to `LAMMPS on GitHub <https://github.com/lammps/lammps>`_
|
||||
and make sure branch is set to "master", as shown in the figure below.
|
||||
and make sure branch is set to "develop", as shown in the figure below.
|
||||
|
||||
.. image:: JPG/tutorial_branch.png
|
||||
:align: center
|
||||
|
||||
If it is not, use the button to change it to *master*\ . Once it is, use the
|
||||
fork button to create a fork.
|
||||
If it is not, use the button to change it to *develop*. Once it is, use
|
||||
the fork button to create a fork.
|
||||
|
||||
.. image:: JPG/tutorial_fork.png
|
||||
:align: center
|
||||
@ -64,11 +64,12 @@ LAMMPS development.
|
||||
**Adding changes to your own fork**
|
||||
|
||||
Additions to the upstream version of LAMMPS are handled using *feature
|
||||
branches*\ . For every new feature, a so-called feature branch is
|
||||
branches*. For every new feature, a so-called feature branch is
|
||||
created, which contains only those modification relevant to one specific
|
||||
feature. For example, adding a single fix would consist of creating a
|
||||
branch with only the fix header and source file and nothing else. It is
|
||||
explained in more detail here: `feature branch workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
explained in more detail here: `feature branch workflow
|
||||
<https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
|
||||
**Feature branches**
|
||||
|
||||
@ -94,8 +95,8 @@ The above command copies ("clones") the git repository to your local
|
||||
machine to a directory with the name you chose. If none is given, it will
|
||||
default to "lammps". Typical names are "mylammps" or something similar.
|
||||
|
||||
You can use this local clone to make changes and
|
||||
test them without interfering with the repository on GitHub.
|
||||
You can use this local clone to make changes and test them without
|
||||
interfering with the repository on GitHub.
|
||||
|
||||
To pull changes from upstream into this copy, you can go to the directory
|
||||
and use git pull:
|
||||
@ -103,28 +104,46 @@ and use git pull:
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd mylammps
|
||||
$ git checkout master
|
||||
$ git pull https://github.com/lammps/lammps
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
|
||||
You can also add this URL as a remote:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git remote add lammps_upstream https://www.github.com/lammps/lammps
|
||||
$ git remote add upstream https://www.github.com/lammps/lammps
|
||||
|
||||
At this point, you typically make a feature branch from the updated master
|
||||
From then on you can update your upstream branches with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
|
||||
and then refer to the upstream repository branches with
|
||||
`upstream/develop` or `upstream/release` and so on.
|
||||
|
||||
At this point, you typically make a feature branch from the updated
|
||||
branch for the feature you want to work on. This tutorial contains the
|
||||
workflow that updated this tutorial, and hence we will call the branch
|
||||
"github-tutorial-update":
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout -b github-tutorial-update master
|
||||
$ git fetch upstream
|
||||
$ git checkout -b github-tutorial-update upstream/develop
|
||||
|
||||
Now that we have changed branches, we can make our changes to our local
|
||||
repository. Just remember that if you want to start working on another,
|
||||
unrelated feature, you should switch branches!
|
||||
|
||||
.. note::
|
||||
|
||||
Committing changes to the *develop*, *release*, or *stable* branches
|
||||
is strongly discouraged. While it may be convenient initially, it
|
||||
will create more work in the long run. Various texts and tutorials
|
||||
on using git effectively discuss the motivation for using feature
|
||||
branches instead.
|
||||
|
||||
**After changes are made**
|
||||
|
||||
After everything is done, add the files to the branch and commit them:
|
||||
@ -287,28 +306,32 @@ After each push, the automated checks are run again.
|
||||
|
||||
LAMMPS developers may add labels to your pull request to assign it to
|
||||
categories (mostly for bookkeeping purposes), but a few of them are
|
||||
important: needs_work, work_in_progress, test-for-regression, and
|
||||
full-regression-test. The first two indicate, that your pull request
|
||||
is not considered to be complete. With "needs_work" the burden is on
|
||||
exclusively on you; while "work_in_progress" can also mean, that a
|
||||
LAMMPS developer may want to add changes. Please watch the comments
|
||||
to the pull requests. The two "test" labels are used to trigger
|
||||
extended tests before the code is merged. This is sometimes done by
|
||||
LAMMPS developers, if they suspect that there may be some subtle
|
||||
side effects from your changes. It is not done by default, because
|
||||
those tests are very time consuming.
|
||||
important: *needs_work*, *work_in_progress*, *run_tests*,
|
||||
*test_for_regression*, and *ready_for_merge*. The first two indicate,
|
||||
that your pull request is not considered to be complete. With
|
||||
"needs_work" the burden is on exclusively on you; while
|
||||
"work_in_progress" can also mean, that a LAMMPS developer may want to
|
||||
add changes. Please watch the comments to the pull requests. The two
|
||||
"test" labels are used to trigger extended tests before the code is
|
||||
merged. This is sometimes done by LAMMPS developers, if they suspect
|
||||
that there may be some subtle side effects from your changes. It is not
|
||||
done by default, because those tests are very time consuming. The
|
||||
*ready_for_merge* label is usually attached when the LAMMPS developer
|
||||
assigned to the pull request considers this request complete and to
|
||||
trigger a final full test evaluation.
|
||||
|
||||
**Reviews**
|
||||
|
||||
As of Summer 2018, a pull request needs at least 1 approving review
|
||||
from a LAMMPS developer with write access to the repository.
|
||||
In case your changes touch code that certain developers are associated
|
||||
with, they are auto-requested by the GitHub software. Those associations
|
||||
are set in the file
|
||||
`.github/CODEOWNERS <https://github.com/lammps/lammps/blob/master/.github/CODEOWNERS>`_
|
||||
Thus if you want to be automatically notified to review when anybody
|
||||
changes files or packages, that you have contributed to LAMMPS, you can
|
||||
add suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
As of Fall 2021, a pull request needs to pass all automatic tests and at
|
||||
least 1 approving review from a LAMMPS developer with write access to
|
||||
the repository before it is eligible for merging. In case your changes
|
||||
touch code that certain developers are associated with, they are
|
||||
auto-requested by the GitHub software. Those associations are set in
|
||||
the file `.github/CODEOWNERS
|
||||
<https://github.com/lammps/lammps/blob/develop/.github/CODEOWNERS>`_ Thus
|
||||
if you want to be automatically notified to review when anybody changes
|
||||
files or packages, that **you** have contributed to LAMMPS, you can add
|
||||
suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
|
||||
Otherwise, you can also manually request reviews from specific developers,
|
||||
or LAMMPS developers - in their assessment of your pull request - may
|
||||
@ -329,7 +352,7 @@ LAMMPS developer (including him/herself) or c) Axel Kohlmeyer (akohlmey).
|
||||
After the review, the developer can choose to implement changes directly
|
||||
or suggest them to you.
|
||||
* Case c) means that the pull request has been assigned to the developer
|
||||
overseeing the merging of pull requests into the master branch.
|
||||
overseeing the merging of pull requests into the *develop* branch.
|
||||
|
||||
In this case, Axel assigned the tutorial to Steve:
|
||||
|
||||
@ -351,11 +374,11 @@ Sometimes, however, you might not feel comfortable having other people
|
||||
push changes into your own branch, or maybe the maintainers are not sure
|
||||
their idea was the right one. In such a case, they can make changes,
|
||||
reassign you as the assignee, and file a "reverse pull request", i.e.
|
||||
file a pull request in your GitHub repository to include changes in the
|
||||
branch, that you have submitted as a pull request yourself. In that
|
||||
case, you can choose to merge their changes back into your branch,
|
||||
possibly make additional changes or corrections and proceed from there.
|
||||
It looks something like this:
|
||||
file a pull request in **your** forked GitHub repository to include
|
||||
changes in the branch, that you have submitted as a pull request
|
||||
yourself. In that case, you can choose to merge their changes back into
|
||||
your branch, possibly make additional changes or corrections and proceed
|
||||
from there. It looks something like this:
|
||||
|
||||
.. image:: JPG/tutorial_reverse_pull_request.png
|
||||
:align: center
|
||||
@ -419,7 +442,7 @@ This merge also shows up on the lammps GitHub page:
|
||||
|
||||
**After a merge**
|
||||
|
||||
When everything is fine, the feature branch is merged into the master branch:
|
||||
When everything is fine, the feature branch is merged into the *develop* branch:
|
||||
|
||||
.. image:: JPG/tutorial_merged.png
|
||||
:align: center
|
||||
@ -433,8 +456,8 @@ branch!
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout master
|
||||
$ git pull master
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
$ git branch -d github-tutorial-update
|
||||
|
||||
If you do not pull first, it is not really a problem but git will warn
|
||||
@ -442,6 +465,7 @@ you at the next statement that you are deleting a local branch that
|
||||
was not yet fully merged into HEAD. This is because git does not yet
|
||||
know your branch just got merged into LAMMPS upstream. If you
|
||||
first delete and then pull, everything should still be fine.
|
||||
You can display all branches that are fully merged by:
|
||||
|
||||
Finally, if you delete the branch locally, you might want to push this
|
||||
to your remote(s) as well:
|
||||
@ -453,14 +477,14 @@ to your remote(s) as well:
|
||||
**Recent changes in the workflow**
|
||||
|
||||
Some changes to the workflow are not captured in this tutorial. For
|
||||
example, in addition to the master branch, to which all new features
|
||||
should be submitted, there is now also an "unstable" and a "stable"
|
||||
branch; these have the same content as "master", but are only updated
|
||||
after a patch release or stable release was made.
|
||||
Furthermore, the naming of the patches now follow the pattern
|
||||
"patch_<Day><Month><Year>" to simplify comparisons between releases.
|
||||
Finally, all patches and submissions are subject to automatic testing
|
||||
and code checks to make sure they at the very least compile.
|
||||
example, in addition to the *develop* branch, to which all new features
|
||||
should be submitted, there is also a *release* and a *stable* branch;
|
||||
these have the same content as *develop*, but are only updated after a
|
||||
patch release or stable release was made. Furthermore, the naming of
|
||||
the patches now follow the pattern "patch_<Day><Month><Year>" to
|
||||
simplify comparisons between releases. Finally, all patches and
|
||||
submissions are subject to automatic testing and code checks to make
|
||||
sure they at the very least compile.
|
||||
|
||||
A discussion of the LAMMPS developer GitHub workflow can be found in the file
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/master/doc/github-development-workflow.md>`_
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||
|
||||
@ -545,6 +545,6 @@ Feedback and Contributing
|
||||
-------------------------
|
||||
|
||||
If you find this Python interface useful, please feel free to provide feedback
|
||||
and ideas on how to improve it to Richard Berger (richard.berger@temple.edu). We also
|
||||
and ideas on how to improve it to Richard Berger (richard.berger@outlook.com). We also
|
||||
want to encourage people to write tutorial style IPython notebooks showcasing LAMMPS usage
|
||||
and maybe their latest research results.
|
||||
|
||||
@ -2,8 +2,8 @@ Thermostats
|
||||
===========
|
||||
|
||||
Thermostatting means controlling the temperature of particles in an MD
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling the
|
||||
pressure. Since the pressure includes a kinetic component due to
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling
|
||||
the pressure. Since the pressure includes a kinetic component due to
|
||||
particle velocities, both these operations require calculation of the
|
||||
temperature. Typically a target temperature (T) and/or pressure (P)
|
||||
is specified by the user, and the thermostat or barostat attempts to
|
||||
@ -26,11 +26,13 @@ can be invoked via the *dpd/tstat* pair style:
|
||||
* :doc:`pair_style dpd/tstat <pair_dpd>`
|
||||
|
||||
:doc:`Fix nvt <fix_nh>` only thermostats the translational velocity of
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this, except
|
||||
that it subtracts out a velocity bias due to a deforming box and
|
||||
integrates the SLLOD equations of motion. See the :doc:`Howto nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere <fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>` thermostat not only translation
|
||||
velocities but also rotational velocities for spherical and aspherical
|
||||
particles.
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this,
|
||||
except that it subtracts out a velocity bias due to a deforming box
|
||||
and integrates the SLLOD equations of motion. See the :doc:`Howto
|
||||
nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere
|
||||
<fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>`
|
||||
thermostat not only translation velocities but also rotational
|
||||
velocities for spherical and aspherical particles.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -40,25 +42,31 @@ particles.
|
||||
e.g. molecular systems. The latter can be tricky to do correctly.
|
||||
|
||||
DPD thermostatting alters pairwise interactions in a manner analogous
|
||||
to the per-particle thermostatting of :doc:`fix langevin <fix_langevin>`.
|
||||
to the per-particle thermostatting of :doc:`fix langevin
|
||||
<fix_langevin>`.
|
||||
|
||||
Any of the thermostatting fixes can be instructed to use custom temperature
|
||||
computes that remove bias which has two effects: first, the current
|
||||
calculated temperature, which is compared to the requested target temperature,
|
||||
is calculated with the velocity bias removed; second, the thermostat adjusts
|
||||
only the thermal temperature component of the particle's velocities, which are
|
||||
the velocities with the bias removed. The removed bias is then added back
|
||||
to the adjusted velocities. See the doc pages for the individual
|
||||
fixes and for the :doc:`fix_modify <fix_modify>` command for
|
||||
instructions on how to assign a temperature compute to a
|
||||
thermostatting fix. For example, you can apply a thermostat to only
|
||||
the x and z components of velocity by using it in conjunction with
|
||||
:doc:`compute temp/partial <compute_temp_partial>`. Of you could
|
||||
thermostat only the thermal temperature of a streaming flow of
|
||||
particles without affecting the streaming velocity, by using
|
||||
:doc:`compute temp/profile <compute_temp_profile>`.
|
||||
Any of the thermostatting fixes can be instructed to use custom
|
||||
temperature computes that remove bias which has two effects: first,
|
||||
the current calculated temperature, which is compared to the requested
|
||||
target temperature, is calculated with the velocity bias removed;
|
||||
second, the thermostat adjusts only the thermal temperature component
|
||||
of the particle's velocities, which are the velocities with the bias
|
||||
removed. The removed bias is then added back to the adjusted
|
||||
velocities. See the doc pages for the individual fixes and for the
|
||||
:doc:`fix_modify <fix_modify>` command for instructions on how to
|
||||
assign a temperature compute to a thermostatting fix.
|
||||
|
||||
Below is a list of some custom temperature computes that can be used like that:
|
||||
For example, you can apply a thermostat only to atoms in a spatial
|
||||
region by using it in conjunction with :doc:`compute temp/region
|
||||
<compute_temp_region>`. Or you can apply a thermostat to only the x
|
||||
and z components of velocity by using it with :doc:`compute
|
||||
temp/partial <compute_temp_partial>`. Of you could thermostat only
|
||||
the thermal temperature of a streaming flow of particles without
|
||||
affecting the streaming velocity, by using :doc:`compute temp/profile
|
||||
<compute_temp_profile>`.
|
||||
|
||||
Below is a list of custom temperature computes that can be used like
|
||||
that:
|
||||
|
||||
* :doc:`compute_temp_asphere`
|
||||
* :doc:`compute_temp_body`
|
||||
@ -72,8 +80,6 @@ Below is a list of some custom temperature computes that can be used like that:
|
||||
* :doc:`compute_temp_rotate`
|
||||
* :doc:`compute_temp_sphere`
|
||||
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Only the nvt fixes perform time integration, meaning they update
|
||||
@ -86,17 +92,17 @@ Below is a list of some custom temperature computes that can be used like that:
|
||||
* :doc:`fix nve/sphere <fix_nve_sphere>`
|
||||
* :doc:`fix nve/asphere <fix_nve_asphere>`
|
||||
|
||||
Thermodynamic output, which can be setup via the
|
||||
:doc:`thermo_style <thermo_style>` command, often includes temperature
|
||||
values. As explained on the page for the
|
||||
:doc:`thermo_style <thermo_style>` command, the default temperature is
|
||||
setup by the thermo command itself. It is NOT the temperature
|
||||
associated with any thermostatting fix you have defined or with any
|
||||
compute you have defined that calculates a temperature. The doc pages
|
||||
for the thermostatting fixes explain the ID of the temperature compute
|
||||
they create. Thus if you want to view these temperatures, you need to
|
||||
specify them explicitly via the :doc:`thermo_style custom <thermo_style>` command. Or you can use the
|
||||
:doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
Thermodynamic output, which can be setup via the :doc:`thermo_style
|
||||
<thermo_style>` command, often includes temperature values. As
|
||||
explained on the page for the :doc:`thermo_style <thermo_style>`
|
||||
command, the default temperature is setup by the thermo command
|
||||
itself. It is NOT the temperature associated with any thermostatting
|
||||
fix you have defined or with any compute you have defined that
|
||||
calculates a temperature. The doc pages for the thermostatting fixes
|
||||
explain the ID of the temperature compute they create. Thus if you
|
||||
want to view these temperatures, you need to specify them explicitly
|
||||
via the :doc:`thermo_style custom <thermo_style>` command. Or you can
|
||||
use the :doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
temperature compute is used for default thermodynamic output.
|
||||
|
||||
----------
|
||||
|
||||
@ -9,7 +9,8 @@ has several advantages:
|
||||
command.
|
||||
* You can create your own development branches to add code to LAMMPS.
|
||||
* You can submit your new features back to GitHub for inclusion in
|
||||
LAMMPS.
|
||||
LAMMPS. For that you should first create your own :doc:`fork on
|
||||
GitHub <Howto_github>`.
|
||||
|
||||
You must have `git <git_>`_ installed on your system to use the
|
||||
commands explained below to communicate with the git servers on
|
||||
@ -20,35 +21,56 @@ provides `limited support for subversion clients <svn_>`_.
|
||||
|
||||
As of October 2016, the official home of public LAMMPS development is
|
||||
on GitHub. The previously advertised LAMMPS git repositories on
|
||||
git.lammps.org and bitbucket.org are now deprecated or offline.
|
||||
git.lammps.org and bitbucket.org are now offline or deprecated.
|
||||
|
||||
.. _git: https://git-scm.com
|
||||
.. _svn: https://help.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github
|
||||
|
||||
You can follow LAMMPS development on 3 different git branches:
|
||||
You can follow the LAMMPS development on 3 different git branches:
|
||||
|
||||
* **stable** : this branch is updated with every stable release
|
||||
* **unstable** : this branch is updated with every patch release
|
||||
* **master** : this branch continuously follows ongoing development
|
||||
* **stable** : this branch is updated from the *release* branch with
|
||||
every stable release version and also has selected bug fixes and updates
|
||||
back-ported from the *develop* branch
|
||||
* **release** : this branch is updated with every patch release;
|
||||
updates are always "fast forward" merges from *develop*
|
||||
* **develop** : this branch follows the ongoing development and
|
||||
is updated with every merge commit of a pull request
|
||||
|
||||
To access the git repositories on your box, use the clone command to
|
||||
create a local copy of the LAMMPS repository with a command like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone -b unstable https://github.com/lammps/lammps.git mylammps
|
||||
$ git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||
|
||||
where "mylammps" is the name of the directory you wish to create on
|
||||
your machine and "unstable" is one of the 3 branches listed above.
|
||||
your machine and "release" is one of the 3 branches listed above.
|
||||
(Note that you actually download all 3 branches; you can switch
|
||||
between them at any time using "git checkout <branch name>".)
|
||||
|
||||
.. admonition:: Saving time and disk space when using ``git clone``
|
||||
|
||||
The complete git history of the LAMMPS project is quite large because
|
||||
it contains the entire commit history of the project since fall 2006,
|
||||
which includes the time when LAMMPS was managed with subversion.
|
||||
This includes a few commits that have added and removed some large
|
||||
files (mostly by accident). If you do not need access to the entire
|
||||
commit history (most people don't), you can speed up the "cloning"
|
||||
process and reduce local disk space requirements by using the
|
||||
*--depth* git command line flag. That will create a "shallow clone"
|
||||
of the repository containing only a subset of the git history. Using
|
||||
a depth of 1000 is usually sufficient to include the head commits of
|
||||
the *develop* and the *release* branches. To include the head commit
|
||||
of the *stable* branch you may need a depth of up to 10000. If you
|
||||
later need more of the git history, you can always convert the
|
||||
shallow clone into a "full clone".
|
||||
|
||||
Once the command completes, your directory will contain the same files
|
||||
as if you unpacked a current LAMMPS tarball, with the exception, that
|
||||
the HTML documentation files are not included. They can be fetched
|
||||
from the LAMMPS website by typing ``make fetch`` in the doc directory.
|
||||
Or they can be generated from the content provided in doc/src by
|
||||
typing ``make html`` from the doc directory.
|
||||
Or they can be generated from the content provided in ``doc/src`` by
|
||||
typing ``make html`` from the ``doc`` directory.
|
||||
|
||||
After initial cloning, as bug fixes and new features are added to
|
||||
LAMMPS you can stay up-to-date by typing the following git commands
|
||||
@ -56,9 +78,9 @@ from within the "mylammps" directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout unstable # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout master # to choose the branch to follow
|
||||
$ git checkout release # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout develop # to choose the branch to follow
|
||||
$ git pull
|
||||
|
||||
Doing a "pull" will not change any files you have added to the LAMMPS
|
||||
@ -81,7 +103,7 @@ Stable versions and what tagID to use for a particular stable version
|
||||
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
||||
Note that this command will print some warnings, because in order to get
|
||||
back to the latest revision and to be able to update with ``git pull``
|
||||
again, you will need to do ``git checkout unstable`` (or
|
||||
again, you will need to do ``git checkout release`` (or
|
||||
check out any other desired branch) first.
|
||||
|
||||
Once you have updated your local files with a ``git pull`` (or ``git
|
||||
@ -137,9 +159,9 @@ changed. How to do this depends on the build system you are using.
|
||||
.. admonition:: Git protocols
|
||||
:class: note
|
||||
|
||||
The servers at github.com support the "git://" and "https://" access
|
||||
protocols for anonymous, read-only access. If you have a suitably
|
||||
configured GitHub account, you may also use SSH protocol with the
|
||||
The servers at github.com support the "https://" access protocol for
|
||||
anonymous, read-only access. If you have a suitably configured GitHub
|
||||
account, you may also use SSH protocol with the
|
||||
URL "git@github.com:lammps/lammps.git".
|
||||
|
||||
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
||||
|
||||
@ -8,7 +8,7 @@ University:
|
||||
* Aidan Thompson, athomps at sandia.gov
|
||||
* Stan Moore, stamoor at sandia.gov
|
||||
* Axel Kohlmeyer, akohlmey at gmail.com
|
||||
* Richard Berger, richard.berger at temple.edu
|
||||
* Richard Berger, richard.berger at outlook.com
|
||||
|
||||
.. _sjp: http://www.cs.sandia.gov/~sjplimp
|
||||
.. _lws: https://www.lammps.org
|
||||
|
||||
@ -16,7 +16,7 @@ source code design, the program structure, the spatial decomposition
|
||||
approach, the neighbor finding, basic communications algorithms, and how
|
||||
users and developers have contributed to LAMMPS is:
|
||||
|
||||
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. (accepted 09/2021), DOI:10.1016/j.cpc.2021.108171 <https://doi.org/10.1016/j.cpc.2021.108171>`_
|
||||
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. 271, 108171 (2022) <https://doi.org/10.1016/j.cpc.2021.108171>`_
|
||||
|
||||
So a project using LAMMPS or a derivative application that uses LAMMPS
|
||||
as a simulation engine should cite this paper. The paper is expected to
|
||||
|
||||
@ -19,7 +19,7 @@ software and open-source distribution, see `www.gnu.org <gnuorg_>`_
|
||||
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
|
||||
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
||||
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/develop/LICENSE
|
||||
|
||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ functions. They do not directly call the LAMMPS library.
|
||||
- :cpp:func:`lammps_fix_external_set_virial_peratom`
|
||||
- :cpp:func:`lammps_fix_external_set_vector_length`
|
||||
- :cpp:func:`lammps_fix_external_set_vector`
|
||||
- :cpp:func:`lammps_flush_buffers`
|
||||
- :cpp:func:`lammps_free`
|
||||
- :cpp:func:`lammps_is_running`
|
||||
- :cpp:func:`lammps_force_timeout`
|
||||
@ -72,6 +73,11 @@ where such memory buffers were allocated that require the use of
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_flush_buffers
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_free
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -7,26 +7,34 @@ correctly and reliably at all times. You can follow its development
|
||||
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
|
||||
|
||||
Whenever we fix a bug or update or add a feature, it will be merged into
|
||||
the `master` branch of the git repository. When a sufficient number of
|
||||
the *develop* branch of the git repository. When a sufficient number of
|
||||
changes have accumulated *and* the software passes a set of automated
|
||||
tests, we release it in the next *patch* release, which are made every
|
||||
few weeks. Info on patch releases are on `this website page
|
||||
few weeks. The *release* branch of the git repository is updated with
|
||||
every such release. Info on patch releases are on `this website page
|
||||
<https://www.lammps.org/bug.html>`_.
|
||||
|
||||
Once or twice a year, only bug fixes and small, non-intrusive changes are
|
||||
included for a period of time, and the code is subjected to more detailed
|
||||
Once or twice a year, we apply only bug fixes and small, non-intrusive
|
||||
changes to the *develop* branch and the code is subjected to more detailed
|
||||
and thorough testing than the default automated testing. The latest
|
||||
patch release after such a period is then labeled as a *stable* version.
|
||||
patch release after such a period is then also labeled as a *stable* version
|
||||
and the *stable* branch is updated with it. Between stable releases
|
||||
we occasionally release some updates to the stable release containing
|
||||
only bug fixes and updates back-ported from *develop* but no new features
|
||||
and update the *stable* branch accordingly.
|
||||
|
||||
Each version of LAMMPS contains all the features and bug-fixes up to
|
||||
and including its version date.
|
||||
Each version of LAMMPS contains all the documented features up to and
|
||||
including its version date.
|
||||
|
||||
The version date is printed to the screen and logfile every time you
|
||||
run LAMMPS. It is also in the file src/version.h and in the LAMMPS
|
||||
directory name created when you unpack a tarball. And it is on the
|
||||
first page of the :doc:`manual <Manual>`.
|
||||
|
||||
* If you browse the HTML pages on the LAMMPS WWW site, they always
|
||||
describe the most current patch release of LAMMPS.
|
||||
* If you browse the HTML pages on the LAMMPS WWW site, they will by
|
||||
default describe the most current patch release version of LAMMPS.
|
||||
In the navigation bar on the bottom left, there is the option to
|
||||
view instead the documentation for the most recent *stable* version
|
||||
or the latest version from the current development branch.
|
||||
* If you browse the HTML pages included in your tarball, they
|
||||
describe the version you have, which may be older.
|
||||
|
||||
@ -12,24 +12,24 @@ includes some optional methods to enable its use with rRESPA.
|
||||
|
||||
Here is a brief description of the class methods in pair.h:
|
||||
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| compute | workhorse routine that computes pairwise interactions |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| settings | reads the input script line with arguments you define |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one i,j type pair |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| init_one | perform initialization for one i,j type pair |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| init_style | initialization specific to this pair style |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| write & read_restart | write/read i,j pair coeffs to restart files |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| write & read_restart_settings | write/read global settings to restart files |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| single | force and energy of a single pairwise interaction between 2 atoms |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| compute | workhorse routine that computes pairwise interactions |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| settings | reads the input script line with arguments you define |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one i,j type pair |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| init_one | perform initialization for one i,j type pair |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| init_style | initialization specific to this pair style |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| write & read_restart | write/read i,j pair coeffs to restart files |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| write & read_restart_settings | write/read global settings to restart files |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| single | force/r and energy of a single pairwise interaction between 2 atoms |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
|
||||
The inner/middle/outer routines are optional.
|
||||
|
||||
@ -305,6 +305,40 @@ you are uncertain, please ask.
|
||||
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
||||
convenience function where possible.
|
||||
|
||||
- Usage of C++11 `virtual`, `override`, `final` keywords: Please follow the
|
||||
`C++ Core Guideline C.128 <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override>`_.
|
||||
That means, you should only use `virtual` to declare a new virtual
|
||||
function, `override` to indicate you are overriding an existing virtual
|
||||
function, and `final` to prevent any further overriding.
|
||||
|
||||
- Trivial destructors: Prefer not writing destructors when they are empty and `default`.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// don't write destructors for A or B like this
|
||||
class A : protected Pointers {
|
||||
public:
|
||||
A();
|
||||
~A() override {}
|
||||
};
|
||||
|
||||
class B : protected Pointers {
|
||||
public:
|
||||
B();
|
||||
~B() override = default;
|
||||
};
|
||||
|
||||
// instead, let the compiler create the implicit default destructor by not writing it
|
||||
class A : protected Pointers {
|
||||
public:
|
||||
A();
|
||||
};
|
||||
|
||||
class B : protected Pointers {
|
||||
public:
|
||||
B();
|
||||
};
|
||||
|
||||
- Header files, especially those defining a "style", should only use
|
||||
the absolute minimum number of include files and **must not** contain
|
||||
any ``using`` statements. Typically that would be only the header for
|
||||
|
||||
@ -1880,6 +1880,12 @@ MPIIO library. It adds :doc:`dump styles <dump>` with a "mpiio" in
|
||||
their style name. Restart files with an ".mpiio" suffix are also
|
||||
written and read in parallel.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
|
||||
**Install:**
|
||||
|
||||
The MPIIO package requires that LAMMPS is build in :ref:`MPI parallel mode <serial>`.
|
||||
|
||||
@ -106,7 +106,7 @@ individual ranks. Here is an example output for this section:
|
||||
----------
|
||||
|
||||
The third section above lists the number of owned atoms (Nlocal),
|
||||
ghost atoms (Nghost), and pair-wise neighbors stored per processor.
|
||||
ghost atoms (Nghost), and pairwise neighbors stored per processor.
|
||||
The max and min values give the spread of these values across
|
||||
processors with a 10-bin histogram showing the distribution. The total
|
||||
number of histogram counts is equal to the number of processors.
|
||||
@ -114,7 +114,7 @@ number of histogram counts is equal to the number of processors.
|
||||
----------
|
||||
|
||||
The last section gives aggregate statistics (across all processors)
|
||||
for pair-wise neighbors and special neighbors that LAMMPS keeps track
|
||||
for pairwise neighbors and special neighbors that LAMMPS keeps track
|
||||
of (see the :doc:`special_bonds <special_bonds>` command). The number
|
||||
of times neighbor lists were rebuilt is tallied, as is the number of
|
||||
potentially *dangerous* rebuilds. If atom movement triggered neighbor
|
||||
|
||||
@ -14,7 +14,7 @@ Intel Xeon Phi co-processors.
|
||||
|
||||
The `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS
|
||||
website gives performance results for the various accelerator
|
||||
packages discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
packages discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
page, for several of the standard LAMMPS benchmark problems, as a
|
||||
function of problem size and number of compute nodes, on different
|
||||
hardware platforms.
|
||||
|
||||
@ -214,7 +214,7 @@ threads/task as Nt. The product of these two values should be N, i.e.
|
||||
The default for the :doc:`package kokkos <package>` command when
|
||||
running on KNL is to use "half" neighbor lists and set the Newton flag
|
||||
to "on" for both pairwise and bonded interactions. This will typically
|
||||
be best for many-body potentials. For simpler pair-wise potentials, it
|
||||
be best for many-body potentials. For simpler pairwise potentials, it
|
||||
may be faster to use a "full" neighbor list with Newton flag to "off".
|
||||
Use the "-pk kokkos" :doc:`command-line switch <Run_options>` to change
|
||||
the default :doc:`package kokkos <package>` options. See its page for
|
||||
|
||||
@ -277,17 +277,34 @@ at ens-lyon.fr, alain.dequidt at uca.fr
|
||||
eam database tool
|
||||
-----------------------------
|
||||
|
||||
The tools/eam_database directory contains a Fortran program that will
|
||||
generate EAM alloy setfl potential files for any combination of 16
|
||||
elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti,
|
||||
Zr. The files can then be used with the :doc:`pair_style eam/alloy <pair_eam>` command.
|
||||
The tools/eam_database directory contains a Fortran and a Python program
|
||||
that will generate EAM alloy setfl potential files for any combination
|
||||
of the 17 elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg,
|
||||
Co, Ti, Zr, Cr. The files can then be used with the :doc:`pair_style
|
||||
eam/alloy <pair_eam>` command.
|
||||
|
||||
The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov,
|
||||
and is based on his paper:
|
||||
The Fortran version of the tool was authored by Xiaowang Zhou (Sandia),
|
||||
xzhou at sandia.gov, with updates from Lucas Hale (NIST) lucas.hale at
|
||||
nist.gov and is based on his paper:
|
||||
|
||||
X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69,
|
||||
144113 (2004).
|
||||
|
||||
The parameters for Cr were taken from:
|
||||
|
||||
Lin Z B, Johnson R A and Zhigilei L V, Phys. Rev. B 77 214108 (2008).
|
||||
|
||||
The Python version of the tool was authored by Germain Clavier
|
||||
(TU Eindhoven) g.m.g.c.clavier at tue.nl or germain.clavier at gmail.com
|
||||
|
||||
.. note::
|
||||
|
||||
The parameters in the database are only optimized for individual
|
||||
elements. The mixed parameters for interactions between different
|
||||
elements generated by this tool are derived from simple mixing rules
|
||||
and are thus inferior to parameterizations that are specifically
|
||||
optimized for specific mixtures and combinations of elements.
|
||||
|
||||
----------
|
||||
|
||||
.. _eamgn:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
hardware, as discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
@ -13,5 +13,5 @@ You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
See the :doc:`Accelerator packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
|
||||
@ -56,23 +56,7 @@ radian\^2.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
These accelerated styles are part of the GPU, INTEL, KOKKOS,
|
||||
OPENMP and OPT packages, respectively. They are only enabled if
|
||||
LAMMPS was built with those packages. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -64,34 +64,44 @@ These are the 4 coefficients for the :math:`E_a` formula:
|
||||
radians internally; hence the various :math:`K` are effectively energy
|
||||
per radian\^2 or radian\^3 or radian\^4.
|
||||
|
||||
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
|
||||
command in the input script lists 4 coefficients, the first of which
|
||||
is "bb" to indicate they are BondBond coefficients. In a data file,
|
||||
these coefficients should be listed under a "BondBond Coeffs" heading
|
||||
and you must leave out the "bb", i.e. only list 3 coefficients after
|
||||
the angle type.
|
||||
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff
|
||||
<angle_coeff>` command in the input script lists 4 coefficients, the
|
||||
first of which is "bb" to indicate they are BondBond coefficients. In
|
||||
a data file, these coefficients should be listed under a "BondBond
|
||||
Coeffs" heading and you must leave out the "bb", i.e. only list 3
|
||||
coefficients after the angle type.
|
||||
|
||||
* bb
|
||||
* :math:`M` (energy/distance\^2)
|
||||
* :math:`r_1` (distance)
|
||||
* :math:`r_2` (distance)
|
||||
|
||||
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
|
||||
command in the input script lists 5 coefficients, the first of which
|
||||
is "ba" to indicate they are BondAngle coefficients. In a data file,
|
||||
these coefficients should be listed under a "BondAngle Coeffs" heading
|
||||
and you must leave out the "ba", i.e. only list 4 coefficients after
|
||||
the angle type.
|
||||
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff
|
||||
<angle_coeff>` command in the input script lists 5 coefficients, the
|
||||
first of which is "ba" to indicate they are BondAngle coefficients.
|
||||
In a data file, these coefficients should be listed under a "BondAngle
|
||||
Coeffs" heading and you must leave out the "ba", i.e. only list 4
|
||||
coefficients after the angle type.
|
||||
|
||||
* ba
|
||||
* :math:`N_1` (energy/distance\^2)
|
||||
* :math:`N_2` (energy/distance\^2)
|
||||
* :math:`N_1` (energy/distance)
|
||||
* :math:`N_2` (energy/distance)
|
||||
* :math:`r_1` (distance)
|
||||
* :math:`r_2` (distance)
|
||||
|
||||
The :math:`\theta_0` value in the :math:`E_{ba}` formula is not specified,
|
||||
since it is the same value from the :math:`E_a` formula.
|
||||
|
||||
.. note::
|
||||
|
||||
It is important that the order of the I,J,K atoms in each angle
|
||||
listed in the Angles section of the data file read by the
|
||||
:doc:`read_data <read_data>` command be consistent with the order
|
||||
of the :math:`r_1` and :math:`r_2` BondBond and BondAngle
|
||||
coefficients. This is because the terms in the formulas for
|
||||
:math:`E_{bb}` and :math:`E_{ba}` will use the I,J atoms to compute
|
||||
:math:`r_{ij}` and the J,K atoms to compute :math:`r_{jk}`.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
@ -319,28 +319,9 @@ styles; see the :doc:`Modify <Modify>` doc page.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *kk* suffix are functionally the same as the
|
||||
corresponding style without the suffix. They have been optimized to
|
||||
run faster, depending on your available hardware, as discussed in on
|
||||
the :doc:`Speed packages <Speed_packages>` doc page. The accelerated
|
||||
styles take the same arguments and should produce the same results,
|
||||
except for round-off and precision issues.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
Note that other acceleration packages in LAMMPS, specifically the GPU,
|
||||
INTEL, OPENMP, and OPT packages do not use accelerated atom
|
||||
styles.
|
||||
|
||||
The accelerated styles are part of the KOKKOS package. They are only
|
||||
enabled if LAMMPS was built with those packages. See the :doc:`Build
|
||||
package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line
|
||||
switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -383,7 +383,7 @@ multiple groups, its weight is the product of the weight factors.
|
||||
|
||||
This weight style is useful in combination with pair style
|
||||
:doc:`hybrid <pair_hybrid>`, e.g. when combining a more costly many-body
|
||||
potential with a fast pair-wise potential. It is also useful when
|
||||
potential with a fast pairwise potential. It is also useful when
|
||||
using :doc:`run_style respa <run_style>` where some portions of the
|
||||
system have many bonded interactions and others none. It assumes that
|
||||
the computational cost for each group remains constant over time.
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
.. index:: bond_style fene
|
||||
.. index:: bond_style fene/nm
|
||||
.. index:: bond_style fene/intel
|
||||
.. index:: bond_style fene/kk
|
||||
.. index:: bond_style fene/omp
|
||||
@ -8,12 +9,16 @@ bond_style fene command
|
||||
|
||||
Accelerator Variants: *fene/intel*, *fene/kk*, *fene/omp*
|
||||
|
||||
bond_style fene/nm command
|
||||
==========================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
bond_style fene
|
||||
bond_style fene/nm
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -23,6 +28,9 @@ Examples
|
||||
bond_style fene
|
||||
bond_coeff 1 30.0 1.5 1.0 1.0
|
||||
|
||||
bond_style fene/nm
|
||||
bond_coeff 1 2.25344 1.5 1.0 1.12246 2 6
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
@ -38,16 +46,36 @@ term is attractive, the second Lennard-Jones term is repulsive. The
|
||||
first term extends to :math:`R_0`, the maximum extent of the bond. The second
|
||||
term is cutoff at :math:`2^\frac{1}{6} \sigma`, the minimum of the LJ potential.
|
||||
|
||||
The following coefficients must be defined for each bond type via the
|
||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
or :doc:`read_restart <read_restart>` commands:
|
||||
The *fene/nm* bond style substitutes the standard LJ potential with the generalized LJ potential
|
||||
in the same form as in pair style :doc:`nm/cut <pair_nm>`. The bond energy is then given by
|
||||
|
||||
.. math::
|
||||
|
||||
E = -0.5 K r_0^2 \ln \left[ 1 - \left(\frac{r}{R_0}\right)^2\right] + \frac{E_0}{(n-m)} \left[ m \left(\frac{r_0}{r}\right)^n - n \left(\frac{r_0}{r}\right)^m \right]
|
||||
|
||||
Similar to the *fene* style, the generalized Lennard-Jones is cut off at
|
||||
the potential minimum, :math:`r_0`, to be repulsive only. The following
|
||||
coefficients must be defined for each bond type via the :doc:`bond_coeff
|
||||
<bond_coeff>` command as in the example above, or in the data file or
|
||||
restart files read by the :doc:`read_data <read_data>` or
|
||||
:doc:`read_restart <read_restart>` commands:
|
||||
|
||||
* :math:`K` (energy/distance\^2)
|
||||
* :math:`R_0` (distance)
|
||||
* :math:`\epsilon` (energy)
|
||||
* :math:`\sigma` (distance)
|
||||
|
||||
For the *fene/nm* style, the following coefficients are used. Please
|
||||
note, that the standard LJ potential and thus the regular FENE potential
|
||||
is recovered for (n=12 m=6) and :math:`r_0 = 2^\frac{1}{6} \sigma`.
|
||||
|
||||
* :math:`K` (energy/distance\^2)
|
||||
* :math:`R_0` (distance)
|
||||
* :math:`E_0` (energy)
|
||||
* :math:`r_0` (distance)
|
||||
* :math:`n` (unitless)
|
||||
* :math:`m` (unitless)
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
@ -57,9 +85,10 @@ or :doc:`read_restart <read_restart>` commands:
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This bond style can only be used if LAMMPS was built with the MOLECULE
|
||||
package. See the :doc:`Build package <Build_package>` page for more
|
||||
info.
|
||||
The *fene* bond style can only be used if LAMMPS was built with the MOLECULE
|
||||
package; the *fene/nm* bond style can only be used if LAMMPS was built
|
||||
with the EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
|
||||
page for more info.
|
||||
|
||||
You typically should specify :doc:`special_bonds fene <special_bonds>`
|
||||
or :doc:`special_bonds lj/coul 0 1 1 <special_bonds>` to use this bond
|
||||
@ -68,7 +97,8 @@ style. LAMMPS will issue a warning it that's not the case.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`
|
||||
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`,
|
||||
:doc:`pair style lj/cut <pair_lj>`, :doc:`pair style nm/cut <pair_nm>`.
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -87,6 +87,7 @@ accelerated styles exist.
|
||||
* :doc:`class2 <bond_class2>` - COMPASS (class 2) bond
|
||||
* :doc:`fene <bond_fene>` - FENE (finite-extensible non-linear elastic) bond
|
||||
* :doc:`fene/expand <bond_fene_expand>` - FENE bonds with variable size particles
|
||||
* :doc:`fene/nm <bond_fene>` - FENE bonds with a generalized Lennard-Jones potential
|
||||
* :doc:`gaussian <bond_gaussian>` - multicentered Gaussian-based bond potential
|
||||
* :doc:`gromos <bond_gromos>` - GROMOS force field bond
|
||||
* :doc:`harmonic <bond_harmonic>` - harmonic bond
|
||||
|
||||
@ -174,6 +174,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
|
||||
* :doc:`angle <compute_angle>` - energy of each angle sub-style
|
||||
* :doc:`angle/local <compute_angle_local>` - theta and energy of each angle
|
||||
* :doc:`angmom/chunk <compute_angmom_chunk>` - angular momentum for each chunk
|
||||
* :doc:`ave/sphere/atom <compute_ave_sphere_atom>` - compute local density and temperature around each atom
|
||||
* :doc:`basal/atom <compute_basal_atom>` - calculates the hexagonal close-packed "c" lattice vector of each atom
|
||||
* :doc:`body/local <compute_body_local>` - attributes of body sub-particles
|
||||
* :doc:`bond <compute_bond>` - energy of each bond sub-style
|
||||
|
||||
101
doc/src/compute_ave_sphere_atom.rst
Normal file
101
doc/src/compute_ave_sphere_atom.rst
Normal file
@ -0,0 +1,101 @@
|
||||
.. index:: compute ave/sphere/atom
|
||||
.. index:: compute ave/sphere/atom/kk
|
||||
|
||||
compute ave/sphere/atom command
|
||||
================================
|
||||
|
||||
Accelerator Variants: *ave/sphere/atom/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
compute ID group-ID ave/sphere/atom keyword values ...
|
||||
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* ave/sphere/atom = style name of this compute command
|
||||
* one or more keyword/value pairs may be appended
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
keyword = *cutoff*
|
||||
*cutoff* value = distance cutoff
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute 1 all ave/sphere/atom
|
||||
|
||||
compute 1 all ave/sphere/atom cutoff 5.0
|
||||
comm_modify cutoff 5.0
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Define a computation that calculates the local density and temperature
|
||||
for each atom and neighbors inside a spherical cutoff.
|
||||
|
||||
The optional keyword *cutoff* defines the distance cutoff
|
||||
used when searching for neighbors. The default value is the cutoff
|
||||
specified by the pair style. If no pair style is defined, then a cutoff
|
||||
must be defined using this keyword. If the specified cutoff is larger than
|
||||
that of the pair_style plus neighbor skin (or no pair style is defined),
|
||||
the *comm_modify cutoff* option must also be set to match that of the
|
||||
*cutoff* keyword.
|
||||
|
||||
The neighbor list needed to compute this quantity is constructed each
|
||||
time the calculation is performed (i.e. each time a snapshot of atoms
|
||||
is dumped). Thus it can be inefficient to compute/dump this quantity
|
||||
too frequently.
|
||||
|
||||
.. note::
|
||||
|
||||
If you have a bonded system, then the settings of
|
||||
:doc:`special_bonds <special_bonds>` command can remove pairwise
|
||||
interactions between atoms in the same bond, angle, or dihedral. This
|
||||
is the default setting for the :doc:`special_bonds <special_bonds>`
|
||||
command, and means those pairwise interactions do not appear in the
|
||||
neighbor list. Because this fix uses the neighbor list, it also means
|
||||
those pairs will not be included in the order parameter. This
|
||||
difficulty can be circumvented by writing a dump file, and using the
|
||||
:doc:`rerun <rerun>` command to compute the order parameter for
|
||||
snapshots in the dump file. The rerun script can use a
|
||||
:doc:`special_bonds <special_bonds>` command that includes all pairs in
|
||||
the neighbor list.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
|
||||
----------
|
||||
|
||||
Output info
|
||||
"""""""""""
|
||||
|
||||
This compute calculates a per-atom array with two columns: density and temperature.
|
||||
|
||||
These values can be accessed by any command that uses per-atom values
|
||||
from a compute as input. See the :doc:`Howto output <Howto_output>` doc
|
||||
page for an overview of LAMMPS output options.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the EXTRA-COMPUTE package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`comm_modify <comm_modify>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The option defaults are *cutoff* = pair style cutoff
|
||||
|
||||
@ -13,7 +13,7 @@ Syntax
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* bond/local = style name of this compute command
|
||||
* one or more values may be appended
|
||||
* value = *dist* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
|
||||
* value = *dist* or *dx* or *dy* or *dz* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -21,6 +21,7 @@ Syntax
|
||||
*engpot* = bond potential energy
|
||||
*force* = bond force
|
||||
|
||||
*dx*,\ *dy*,\ *dz* = components of pairwise distance
|
||||
*fx*,\ *fy*,\ *fz* = components of bond force
|
||||
*engvib* = bond kinetic energy of vibration
|
||||
*engrot* = bond kinetic energy of rotation
|
||||
@ -63,6 +64,9 @@ whether the 2 atoms represent a simple diatomic molecule, or are part
|
||||
of some larger molecule.
|
||||
|
||||
The value *dist* is the current length of the bond.
|
||||
The values *dx*, *dy*, and *dz* are the xyz components of the
|
||||
*distance* between the pair of atoms. This value is always the
|
||||
distance from the atom of lower to the one with the higher id.
|
||||
|
||||
The value *engpot* is the potential energy for the bond,
|
||||
based on the current separation of the pair of atoms in the bond.
|
||||
|
||||
@ -89,13 +89,20 @@ included in the calculation.
|
||||
.. warning::
|
||||
|
||||
The compute *heat/flux* has been reported to produce unphysical
|
||||
values for angle, dihedral and improper contributions
|
||||
values for angle, dihedral, improper and constraint force contributions
|
||||
when used with :doc:`compute stress/atom <compute_stress_atom>`,
|
||||
as discussed in :ref:`(Surblys) <Surblys2>` and :ref:`(Boone) <Boone>`.
|
||||
You are strongly advised to
|
||||
as discussed in :ref:`(Surblys2019) <Surblys3>`, :ref:`(Boone) <Boone>`
|
||||
and :ref:`(Surblys2021) <Surblys4>`. You are strongly advised to
|
||||
use :doc:`compute centroid/stress/atom <compute_stress_atom>`,
|
||||
which has been implemented specifically for such cases.
|
||||
|
||||
.. warning::
|
||||
|
||||
Due to an implementation detail, the :math:`y` and :math:`z`
|
||||
components of heat flux from :doc:`fix rigid <fix_rigid>`
|
||||
contribution when computed via :doc:`compute stress/atom <compute_stress_atom>`
|
||||
are highly unphysical and should not be used.
|
||||
|
||||
The Green-Kubo formulas relate the ensemble average of the
|
||||
auto-correlation of the heat flux :math:`\mathbf{J}`
|
||||
to the thermal conductivity :math:`\kappa`:
|
||||
@ -232,10 +239,14 @@ none
|
||||
|
||||
----------
|
||||
|
||||
.. _Surblys2:
|
||||
.. _Surblys3:
|
||||
|
||||
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
.. _Boone:
|
||||
|
||||
**(Boone)** Boone, Babaei, Wilmer, J Chem Theory Comput, 15, 5579--5587 (2019).
|
||||
|
||||
.. _Surblys4:
|
||||
|
||||
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
|
||||
@ -13,11 +13,12 @@ Syntax
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* pair/local = style name of this compute command
|
||||
* one or more values may be appended
|
||||
* value = *dist* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
|
||||
* value = *dist* or *dx* or *dy* or *dz* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*dist* = pairwise distance
|
||||
*dx*,\ *dy*,\ *dz* = components of pairwise distance
|
||||
*eng* = pairwise energy
|
||||
*force* = pairwise force
|
||||
*fx*,\ *fy*,\ *fz* = components of pairwise force
|
||||
@ -56,6 +57,9 @@ force cutoff distance for that interaction, as defined by the
|
||||
commands.
|
||||
|
||||
The value *dist* is the distance between the pair of atoms.
|
||||
The values *dx*, *dy*, and *dz* are the xyz components of the
|
||||
*distance* between the pair of atoms. This value is always the
|
||||
distance from the atom of lower to the one with the higher id.
|
||||
|
||||
The value *eng* is the interaction energy for the pair of atoms.
|
||||
|
||||
@ -89,10 +93,10 @@ from the second of the two sub-styles. If the referenced *pN*
|
||||
is not computed for the specific pairwise interaction (based on
|
||||
atom types), then the output will be 0.0.
|
||||
|
||||
The value *dist* will be in distance :doc:`units <units>`. The value
|
||||
*eng* will be in energy :doc:`units <units>`. The values *force*, *fx*,
|
||||
*fy*, and *fz* will be in force :doc:`units <units>`. The values *pN*
|
||||
will be in whatever units the pair style defines.
|
||||
The value *dist*, *dx*, *dy* and *dz* will be in distance :doc:`units <units>`.
|
||||
The value *eng* will be in energy :doc:`units <units>`.
|
||||
The values *force*, *fx*, *fy*, and *fz* will be in force :doc:`units <units>`.
|
||||
The values *pN* will be in whatever units the pair style defines.
|
||||
|
||||
The optional *cutoff* keyword determines how the force cutoff distance
|
||||
for an interaction is determined. For the default setting of *type*,
|
||||
|
||||
@ -141,7 +141,7 @@ Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`compute temp <compute_temp>`, :doc:`compute stress/atom <compute_stress_atom>`,
|
||||
:doc:`thermo_style <thermo_style>`,
|
||||
:doc:`thermo_style <thermo_style>`, :doc:`fix numdiff/virial <fix_numdiff_virial>`,
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -61,7 +61,7 @@ Restrictions
|
||||
This compute currently calculates the pressure tensor contributions
|
||||
for pair styles only (i.e. no bond, angle, dihedral, etc. contributions
|
||||
and in the presence of bonded interactions, the result will be incorrect
|
||||
due to exclusions for special bonds) and requires pair-wise force
|
||||
due to exclusions for special bonds) and requires pairwise force
|
||||
calculations not available for most many-body pair styles. K-space
|
||||
calculations are also excluded. Note that this pressure compute outputs
|
||||
the configurational terms only; the kinetic contribution is not included
|
||||
|
||||
@ -87,6 +87,10 @@ Tersoff 3-body interaction) is assigned in equal portions to each atom
|
||||
in the set. E.g. 1/4 of the dihedral virial to each of the 4 atoms,
|
||||
or 1/3 of the fix virial due to SHAKE constraints applied to atoms in
|
||||
a water molecule via the :doc:`fix shake <fix_shake>` command.
|
||||
As an exception, the virial contribution from
|
||||
constraint forces in :doc:`fix rigid <fix_rigid>` on each atom
|
||||
is computed from the constraint force acting on the corresponding atom
|
||||
and its position, i.e. the total virial is not equally distributed.
|
||||
|
||||
In case of compute *centroid/stress/atom*, the virial contribution is:
|
||||
|
||||
@ -103,13 +107,25 @@ atom :math:`I` due to the interaction and the relative position
|
||||
:math:`\mathbf{r}_{I0}` of the atom :math:`I` to the geometric center
|
||||
of the interacting atoms, i.e. centroid, is used. As the geometric
|
||||
center is different for each interaction, the :math:`\mathbf{r}_{I0}`
|
||||
also differs. The sixth and seventh terms, Kspace and :doc:`fix
|
||||
<fix>` contribution respectively, are computed identical to compute
|
||||
*stress/atom*. Although the total system virial is the same as
|
||||
also differs. The sixth term, Kspace contribution,
|
||||
is computed identically to compute *stress/atom*.
|
||||
The seventh term is handed differently depending on
|
||||
if the constraint forces are due to :doc:`fix shake <fix_shake>`
|
||||
or :doc:`fix rigid <fix_rigid>`.
|
||||
In case of SHAKE constraints, each distance constraint is
|
||||
handed as a pairwise interaction.
|
||||
E.g. in case of a water molecule, two OH and one HH distance
|
||||
constraints are treated as three pairwise interactions.
|
||||
In case of :doc:`fix rigid <fix_rigid>`,
|
||||
all constraint forces in the molecule are treated
|
||||
as a single many-body interaction with a single centroid position.
|
||||
In case of water molecule, the formula expression would become
|
||||
identical to that of the three-body angle interaction.
|
||||
Although the total system virial is the same as
|
||||
compute *stress/atom*, compute *centroid/stress/atom* is know to
|
||||
result in more consistent heat flux values for angle, dihedrals and
|
||||
improper contributions when computed via :doc:`compute heat/flux
|
||||
<compute_heat_flux>`.
|
||||
result in more consistent heat flux values for angle, dihedrals,
|
||||
improper and constraint force contributions
|
||||
when computed via :doc:`compute heat/flux <compute_heat_flux>`.
|
||||
|
||||
If no extra keywords are listed, the kinetic contribution all of the
|
||||
virial contribution terms are included in the per-atom stress tensor.
|
||||
@ -134,7 +150,8 @@ contribution for the cluster interaction is divided evenly among those
|
||||
atoms.
|
||||
|
||||
Details of how compute *centroid/stress/atom* obtains the virial for
|
||||
individual atoms is given in :ref:`(Surblys) <Surblys1>`, where the
|
||||
individual atoms are given in :ref:`(Surblys2019) <Surblys1>` and
|
||||
:ref:`(Surblys2021) <Surblys2>`, where the
|
||||
idea is that the virial of the atom :math:`I` is the result of only
|
||||
the force :math:`\mathbf{F}_I` on the atom due to the interaction and
|
||||
its positional vector :math:`\mathbf{r}_{I0}`, relative to the
|
||||
@ -235,10 +252,10 @@ between the pair of particles. All bond styles are supported. All
|
||||
angle, dihedral, improper styles are supported with the exception of
|
||||
INTEL and KOKKOS variants of specific styles. It also does not
|
||||
support models with long-range Coulombic or dispersion forces,
|
||||
i.e. the kspace_style command in LAMMPS. It also does not support the
|
||||
following fixes which add rigid-body constraints: :doc:`fix shake
|
||||
<fix_shake>`, :doc:`fix rattle <fix_shake>`, :doc:`fix rigid
|
||||
<fix_rigid>`, :doc:`fix rigid/small <fix_rigid>`.
|
||||
i.e. the kspace_style command in LAMMPS. It also does not implement the
|
||||
following fixes which add rigid-body constraints:
|
||||
:doc:`fix rigid/* <fix_rigid>` and the OpenMP accelerated version of :doc:`fix rigid/small <fix_rigid>`,
|
||||
while all other :doc:`fix rigid/*/small <fix_rigid>` are implemented.
|
||||
|
||||
LAMMPS will generate an error if one of these options is included in
|
||||
your model. Extension of centroid stress calculations to these force
|
||||
@ -270,4 +287,8 @@ none
|
||||
|
||||
.. _Surblys1:
|
||||
|
||||
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
.. _Surblys2:
|
||||
|
||||
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
|
||||
@ -20,8 +20,10 @@ Syntax
|
||||
cutoff = delete one atom from pairs of atoms within the cutoff (distance units)
|
||||
group1-ID = one atom in pair must be in this group
|
||||
group2-ID = other atom in pair must be in this group
|
||||
*porosity* args = region-ID fraction seed
|
||||
*porosity* args = group-ID region-ID fraction seed
|
||||
group-ID = group within which to perform deletions
|
||||
region-ID = region within which to perform deletions
|
||||
or NULL to only impose the group criterion
|
||||
fraction = delete this fraction of atoms
|
||||
seed = random number seed (positive integer)
|
||||
|
||||
@ -43,7 +45,8 @@ Examples
|
||||
delete_atoms region sphere compress no
|
||||
delete_atoms overlap 0.3 all all
|
||||
delete_atoms overlap 0.5 solvent colloid
|
||||
delete_atoms porosity cube 0.1 482793 bond yes
|
||||
delete_atoms porosity all cube 0.1 482793 bond yes
|
||||
delete_atoms porosity polymer cube 0.1 482793 bond yes
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -76,12 +79,17 @@ have occurred that no atom pairs within the cutoff will remain
|
||||
minimum number of atoms will be deleted, or that the same atoms will
|
||||
be deleted when running on different numbers of processors.
|
||||
|
||||
For style *porosity* a specified *fraction* of atoms are deleted
|
||||
within the specified region. For example, if fraction is 0.1, then
|
||||
10% of the atoms will be deleted. The atoms to delete are chosen
|
||||
randomly. There is no guarantee that the exact fraction of atoms will
|
||||
be deleted, or that the same atoms will be deleted when running on
|
||||
different numbers of processors.
|
||||
For style *porosity* a specified *fraction* of atoms are deleted which
|
||||
are both in the specified group and within the specified region. The
|
||||
region-ID can be specified as NULL to only impose the group criterion.
|
||||
Likewise, specifying the group-ID as *all* will only impose the region
|
||||
criterion.
|
||||
|
||||
For example, if fraction is 0.1, then 10% of the eligible atoms will
|
||||
be deleted. The atoms to delete are chosen randomly. There is no
|
||||
guarantee that the exact fraction of atoms will be deleted, or that
|
||||
the same atoms will be deleted when running on different numbers of
|
||||
processors.
|
||||
|
||||
If the *compress* keyword is set to *yes*, then after atoms are
|
||||
deleted, then atom IDs are re-assigned so that they run from 1 to the
|
||||
@ -89,8 +97,8 @@ number of atoms in the system. Note that this is not done for
|
||||
molecular systems (see the :doc:`atom_style <atom_style>` command),
|
||||
regardless of the *compress* setting, since it would foul up the bond
|
||||
connectivity that has already been assigned. However, the
|
||||
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this command to
|
||||
accomplish the same thing.
|
||||
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this
|
||||
command to accomplish the same thing.
|
||||
|
||||
Note that the re-assignment of IDs is not really a compression, where
|
||||
gaps in atom IDs are removed by decrementing atom IDs that are larger.
|
||||
@ -100,15 +108,15 @@ the :doc:`create_atoms <create_atoms>` command explains.
|
||||
|
||||
A molecular system with fixed bonds, angles, dihedrals, or improper
|
||||
interactions, is one where the topology of the interactions is
|
||||
typically defined in the data file read by the
|
||||
:doc:`read_data <read_data>` command, and where the interactions
|
||||
themselves are defined with the :doc:`bond_style <bond_style>`,
|
||||
:doc:`angle_style <angle_style>`, etc commands. If you delete atoms
|
||||
from such a system, you must be careful not to end up with bonded
|
||||
interactions that are stored by remaining atoms but which include
|
||||
deleted atoms. This will cause LAMMPS to generate a "missing atoms"
|
||||
error when the bonded interaction is computed. The *bond* and *mol*
|
||||
keywords offer two ways to do that.
|
||||
typically defined in the data file read by the :doc:`read_data
|
||||
<read_data>` command, and where the interactions themselves are
|
||||
defined with the :doc:`bond_style <bond_style>`, :doc:`angle_style
|
||||
<angle_style>`, etc commands. If you delete atoms from such a system,
|
||||
you must be careful not to end up with bonded interactions that are
|
||||
stored by remaining atoms but which include deleted atoms. This will
|
||||
cause LAMMPS to generate a "missing atoms" error when the bonded
|
||||
interaction is computed. The *bond* and *mol* keywords offer two ways
|
||||
to do that.
|
||||
|
||||
It the *bond* keyword is set to *yes* then any bond or angle or
|
||||
dihedral or improper interaction that includes a deleted atom is also
|
||||
|
||||
@ -137,7 +137,7 @@ Examples
|
||||
dump myDump all atom/gz 100 dump.atom.gz
|
||||
dump myDump all atom/zstd 100 dump.atom.zst
|
||||
dump 2 subgroup atom 50 dump.run.bin
|
||||
dump 2 subgroup atom 50 dump.run.mpiio.bin
|
||||
dump 2 subgroup atom/mpiio 50 dump.run.mpiio.bin
|
||||
dump 4a all custom 100 dump.myforce.* id type x y vx fx
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke
|
||||
@ -169,11 +169,12 @@ or multiple smaller files).
|
||||
|
||||
.. note::
|
||||
|
||||
Because periodic boundary conditions are enforced only on
|
||||
timesteps when neighbor lists are rebuilt, the coordinates of an atom
|
||||
written to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the timesteps
|
||||
dump snapshots are written. See the :doc:`dump_modify pbc <dump_modify>` command if you with to force coordinates to be
|
||||
Because periodic boundary conditions are enforced only on timesteps
|
||||
when neighbor lists are rebuilt, the coordinates of an atom written
|
||||
to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the
|
||||
timesteps dump snapshots are written. See the :doc:`dump_modify
|
||||
pbc <dump_modify>` command if you with to force coordinates to be
|
||||
strictly inside the simulation box.
|
||||
|
||||
.. note::
|
||||
@ -189,20 +190,21 @@ or multiple smaller files).
|
||||
multiple processors, each of which owns a subset of the atoms.
|
||||
|
||||
For the *atom*, *custom*, *cfg*, and *local* styles, sorting is off by
|
||||
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting by
|
||||
atom ID is on by default. See the :doc:`dump_modify <dump_modify>` doc
|
||||
page for details.
|
||||
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting
|
||||
by atom ID is on by default. See the :doc:`dump_modify <dump_modify>`
|
||||
doc page for details.
|
||||
|
||||
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles are identical
|
||||
in command syntax to the corresponding styles without "gz", however,
|
||||
they generate compressed files using the zlib library. Thus the filename
|
||||
suffix ".gz" is mandatory. This is an alternative approach to writing
|
||||
compressed files via a pipe, as done by the regular dump styles, which
|
||||
may be required on clusters where the interface to the high-speed network
|
||||
disallows using the fork() library call (which is needed for a pipe).
|
||||
For the remainder of this doc page, you should thus consider the *atom*
|
||||
and *atom/gz* styles (etc) to be inter-changeable, with the exception
|
||||
of the required filename suffix.
|
||||
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles
|
||||
are identical in command syntax to the corresponding styles without
|
||||
"gz", however, they generate compressed files using the zlib
|
||||
library. Thus the filename suffix ".gz" is mandatory. This is an
|
||||
alternative approach to writing compressed files via a pipe, as done
|
||||
by the regular dump styles, which may be required on clusters where
|
||||
the interface to the high-speed network disallows using the fork()
|
||||
library call (which is needed for a pipe). For the remainder of this
|
||||
doc page, you should thus consider the *atom* and *atom/gz* styles
|
||||
(etc) to be inter-changeable, with the exception of the required
|
||||
filename suffix.
|
||||
|
||||
Similarly, the *atom/zstd*, *cfg/zstd*, *custom/zstd*, *local/zstd*,
|
||||
and *xyz/zstd* styles are identical to the gz styles, but use the Zstd
|
||||
@ -219,6 +221,11 @@ you should thus consider the *atom* and *atom/mpiio* styles (etc) to
|
||||
be inter-changeable. The one exception is how the filename is
|
||||
specified for the MPI-IO styles, as explained below.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
The precision of values output to text-based dump files can be
|
||||
controlled by the :doc:`dump_modify format <dump_modify>` command and
|
||||
its options.
|
||||
@ -275,10 +282,11 @@ This bounding box is convenient for many visualization programs. The
|
||||
meaning of the 6 character flags for "xx yy zz" is the same as above.
|
||||
|
||||
Note that the first two numbers on each line are now xlo_bound instead
|
||||
of xlo, etc, since they represent a bounding box. See the :doc:`Howto triclinic <Howto_triclinic>` page for a geometric description
|
||||
of triclinic boxes, as defined by LAMMPS, simple formulas for how the
|
||||
6 bounding box extents (xlo_bound,xhi_bound,etc) are calculated from
|
||||
the triclinic parameters, and how to transform those parameters to and
|
||||
of xlo, etc, since they represent a bounding box. See the :doc:`Howto
|
||||
triclinic <Howto_triclinic>` page for a geometric description of
|
||||
triclinic boxes, as defined by LAMMPS, simple formulas for how the 6
|
||||
bounding box extents (xlo_bound,xhi_bound,etc) are calculated from the
|
||||
triclinic parameters, and how to transform those parameters to and
|
||||
from other commonly used triclinic representations.
|
||||
|
||||
The "ITEM: ATOMS" line in each snapshot lists column descriptors for
|
||||
@ -310,23 +318,24 @@ written to the dump file. This local data is typically calculated by
|
||||
each processor based on the atoms it owns, but there may be zero or
|
||||
more entities per atom, e.g. a list of bond distances. An explanation
|
||||
of the possible dump local attributes is given below. Note that by
|
||||
using input from the :doc:`compute property/local <compute_property_local>` command with dump local,
|
||||
it is possible to generate information on bonds, angles, etc that can
|
||||
be cut and pasted directly into a data file read by the
|
||||
:doc:`read_data <read_data>` command.
|
||||
using input from the :doc:`compute property/local
|
||||
<compute_property_local>` command with dump local, it is possible to
|
||||
generate information on bonds, angles, etc that can be cut and pasted
|
||||
directly into a data file read by the :doc:`read_data <read_data>`
|
||||
command.
|
||||
|
||||
Style *cfg* has the same command syntax as style *custom* and writes
|
||||
extended CFG format files, as used by the
|
||||
`AtomEye <http://li.mit.edu/Archive/Graphics/A/>`_ visualization
|
||||
package. Since the extended CFG format uses a single snapshot of the
|
||||
system per file, a wildcard "\*" must be included in the filename, as
|
||||
discussed below. The list of atom attributes for style *cfg* must
|
||||
begin with either "mass type xs ys zs" or "mass type xsu ysu zsu"
|
||||
since these quantities are needed to write the CFG files in the
|
||||
appropriate format (though the "mass" and "type" fields do not appear
|
||||
explicitly in the file). Any remaining attributes will be stored as
|
||||
"auxiliary properties" in the CFG files. Note that you will typically
|
||||
want to use the :doc:`dump_modify element <dump_modify>` command with
|
||||
extended CFG format files, as used by the `AtomEye
|
||||
<http://li.mit.edu/Archive/Graphics/A/>`_ visualization package.
|
||||
Since the extended CFG format uses a single snapshot of the system per
|
||||
file, a wildcard "\*" must be included in the filename, as discussed
|
||||
below. The list of atom attributes for style *cfg* must begin with
|
||||
either "mass type xs ys zs" or "mass type xsu ysu zsu" since these
|
||||
quantities are needed to write the CFG files in the appropriate format
|
||||
(though the "mass" and "type" fields do not appear explicitly in the
|
||||
file). Any remaining attributes will be stored as "auxiliary
|
||||
properties" in the CFG files. Note that you will typically want to
|
||||
use the :doc:`dump_modify element <dump_modify>` command with
|
||||
CFG-formatted files, to associate element names with atom types, so
|
||||
that AtomEye can render atoms appropriately. When unwrapped
|
||||
coordinates *xsu*, *ysu*, and *zsu* are requested, the nominal AtomEye
|
||||
@ -452,6 +461,11 @@ use the :doc:`read_dump <read_dump>` command or perform other
|
||||
post-processing, just as if the dump file was not written using
|
||||
MPI-IO.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
Note that MPI-IO dump files are one large file which all processors
|
||||
write to. You thus cannot use the "%" wildcard character described
|
||||
above in the filename since that specifies generation of multiple
|
||||
@ -708,8 +722,9 @@ are part of the MPIIO package. They are only enabled if LAMMPS was
|
||||
built with that package. See the :doc:`Build package <Build_package>`
|
||||
doc page for more info.
|
||||
|
||||
The *xtc* style is part of the MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
The *xtc* and *dcd* styles are part of the EXTRA-DUMP package. They
|
||||
are only enabled if LAMMPS was built with that package. See the
|
||||
:doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -6,6 +6,8 @@ dump image command
|
||||
dump movie command
|
||||
==================
|
||||
|
||||
(see below for :ref:`dump_modify options <dump_modify_image>` specific to dump image/movie)
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -15,7 +17,7 @@ Syntax
|
||||
|
||||
* ID = user-assigned name for the dump
|
||||
* group-ID = ID of the group of atoms to be imaged
|
||||
* style = *image* or *movie* = style of dump command (other styles *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
|
||||
* style = *image* or *movie* = style of dump command (other styles such as *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
|
||||
* N = dump every this many timesteps
|
||||
* file = name of file to write image to
|
||||
* color = atom attribute that determines color of each atom
|
||||
@ -79,6 +81,69 @@ Syntax
|
||||
seed = random # seed (positive integer)
|
||||
dfactor = strength of shading from 0.0 to 1.0
|
||||
|
||||
|
||||
.. _dump_modify_image:
|
||||
|
||||
dump_modify options for dump image/movie
|
||||
========================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
dump_modify dump-ID keyword values ...
|
||||
|
||||
* these keywords apply only to the *image* and *movie* styles and are documented on this page
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
|
||||
* see the :doc:`dump modify <dump_modify>` doc page for more general keywords
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*acolor* args = type color
|
||||
type = atom type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*adiam* args = type diam
|
||||
type = atom type or range of types (see below)
|
||||
diam = diameter of atoms of that type (distance units)
|
||||
*amap* args = lo hi style delta N entry1 entry2 ... entryN
|
||||
lo = number or *min* = lower bound of range of color map
|
||||
hi = number or *max* = upper bound of range of color map
|
||||
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
|
||||
"c" for continuous
|
||||
"d" for discrete
|
||||
"s" for sequential
|
||||
"a" for absolute
|
||||
"f" for fractional
|
||||
delta = binsize (only used for style "s", otherwise ignored)
|
||||
binsize = range is divided into bins of this width
|
||||
N = # of subsequent entries
|
||||
entry = value color (for continuous style)
|
||||
value = number or *min* or *max* = single value within range
|
||||
color = name of color used for that value
|
||||
entry = lo hi color (for discrete style)
|
||||
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
|
||||
color = name of color used for that subset of values
|
||||
entry = color (for sequential style)
|
||||
color = name of color used for a bin of values
|
||||
*backcolor* arg = color
|
||||
color = name of color for background
|
||||
*bcolor* args = type color
|
||||
type = bond type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*bdiam* args = type diam
|
||||
type = bond type or range of types (see below)
|
||||
diam = diameter of bonds of that type (distance units)
|
||||
*boxcolor* arg = color
|
||||
color = name of color for simulation box lines and processor sub-domain lines
|
||||
*color* args = name R G B
|
||||
name = name of color
|
||||
R,G,B = red/green/blue numeric values from 0.0 to 1.0
|
||||
*bitrate* arg = rate
|
||||
rate = target bitrate for movie in kbps
|
||||
*framerate* arg = fps
|
||||
fps = frames per second for movie
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -91,6 +156,8 @@ Examples
|
||||
dump m1 all movie 1000 movie.avi type type size 640 480
|
||||
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720
|
||||
|
||||
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
@ -145,10 +212,10 @@ is used.
|
||||
Similarly, the format of the resulting movie is chosen with the
|
||||
*movie* dump style. This is handled by the underlying FFmpeg converter
|
||||
and thus details have to be looked up in the `FFmpeg documentation
|
||||
<http://ffmpeg.org/ffmpeg.html>`_.
|
||||
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
|
||||
Additional settings of the movie compression like bitrate and
|
||||
framerate can be set using the :doc:`dump_modify <dump_modify>` command.
|
||||
<http://ffmpeg.org/ffmpeg.html>`_. Typical examples are: .avi, .mpg,
|
||||
.m4v, .mp4, .mkv, .flv, .mov, .gif Additional settings of the movie
|
||||
compression like bitrate and framerate can be set using the
|
||||
dump_modify command as described below.
|
||||
|
||||
To write out JPEG and PNG format files, you must build LAMMPS with
|
||||
support for the corresponding JPEG or PNG library. To convert images
|
||||
@ -210,19 +277,20 @@ to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. This mapping can be changed by the
|
||||
:doc:`dump_modify acolor <dump_modify>` command.
|
||||
"dump_modify acolor" command, as described below.
|
||||
|
||||
If *type* is specified for the *diameter* setting then the diameter of
|
||||
each atom is determined by its atom type. By default all types have
|
||||
diameter 1.0. This mapping can be changed by the :doc:`dump_modify adiam <dump_modify>` command.
|
||||
diameter 1.0. This mapping can be changed by the "dump_modify adiam"
|
||||
command, as described below.
|
||||
|
||||
If *element* is specified for the *color* and/or *diameter* setting,
|
||||
then the color and/or diameter of each atom is determined by which
|
||||
element it is, which in turn is specified by the element-to-type
|
||||
mapping specified by the "dump_modify element" command. By default
|
||||
every atom type is C (carbon). Every element has a color and diameter
|
||||
associated with it, which is the same as the colors and sizes used by
|
||||
the `AtomEye <atomeye_>`_ visualization package.
|
||||
mapping specified by the "dump_modify element" command, as described
|
||||
below. By default every atom type is C (carbon). Every element has a
|
||||
color and diameter associated with it, which is the same as the colors
|
||||
and sizes used by the `AtomEye <atomeye_>`_ visualization package.
|
||||
|
||||
.. _atomeye: http://li.mit.edu/Archive/Graphics/A/
|
||||
|
||||
@ -232,13 +300,13 @@ settings, they are interpreted in the following way.
|
||||
If "vx", for example, is used as the *color* setting, then the color
|
||||
of the atom will depend on the x-component of its velocity. The
|
||||
association of a per-atom value with a specific color is determined by
|
||||
a "color map", which can be specified via the
|
||||
:doc:`dump_modify <dump_modify>` command. The basic idea is that the
|
||||
atom-attribute will be within a range of values, and every value
|
||||
within the range is mapped to a specific color. Depending on how the
|
||||
color map is defined, that mapping can take place via interpolation so
|
||||
that a value of -3.2 is halfway between "red" and "blue", or
|
||||
discretely so that the value of -3.2 is "orange".
|
||||
a "color map", which can be specified via the dump_modify command, as
|
||||
described below. The basic idea is that the atom-attribute will be
|
||||
within a range of values, and every value within the range is mapped
|
||||
to a specific color. Depending on how the color map is defined, that
|
||||
mapping can take place via interpolation so that a value of -3.2 is
|
||||
halfway between "red" and "blue", or discretely so that the value of
|
||||
-3.2 is "orange".
|
||||
|
||||
If "vx", for example, is used as the *diameter* setting, then the atom
|
||||
will be rendered using the x-component of its velocity as the
|
||||
@ -251,9 +319,10 @@ diameter, which can be used as the *diameter* setting.
|
||||
|
||||
The various keywords listed above control how the image is rendered.
|
||||
As listed below, all of the keywords have defaults, most of which you
|
||||
will likely not need to change. The :doc:`dump modify <dump_modify>`
|
||||
also has options specific to the dump image style, particularly for
|
||||
assigning colors to atoms, bonds, and other image features.
|
||||
will likely not need to change. As described below, the dump modify
|
||||
command also has options specific to the dump image style,
|
||||
particularly for assigning colors to atoms, bonds, and other image
|
||||
features.
|
||||
|
||||
----------
|
||||
|
||||
@ -295,7 +364,7 @@ types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for bond types > 6. This mapping can be changed by
|
||||
the :doc:`dump_modify bcolor <dump_modify>` command.
|
||||
the "dump_modify bcolor" command, as described below.
|
||||
|
||||
The bond *width* value can be a numeric value or *atom* or *type* (or
|
||||
*none* as indicated above).
|
||||
@ -310,7 +379,8 @@ of the 2 atoms in the bond.
|
||||
|
||||
If *type* is specified for the *width* value then the diameter of each
|
||||
bond is determined by its bond type. By default all types have
|
||||
diameter 0.5. This mapping can be changed by the :doc:`dump_modify bdiam <dump_modify>` command.
|
||||
diameter 0.5. This mapping can be changed by the "dump_modify bdiam" command,
|
||||
as described below.
|
||||
|
||||
----------
|
||||
|
||||
@ -330,7 +400,7 @@ mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
change this via the dump_modify command.
|
||||
|
||||
The line *width* can only be a numeric value, which specifies that all
|
||||
lines will be drawn as cylinders with that diameter, e.g. 1.0, which
|
||||
@ -357,7 +427,7 @@ default the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
change this via the dump_modify command.
|
||||
|
||||
----------
|
||||
|
||||
@ -390,7 +460,7 @@ particle. By default the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
change this via the dump_modify command.
|
||||
|
||||
----------
|
||||
|
||||
@ -414,7 +484,7 @@ the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
change this via the dump_modify command.
|
||||
|
||||
----------
|
||||
|
||||
@ -488,7 +558,8 @@ are rendered as thin cylinders in the image. If *no* is set, then the
|
||||
box boundaries are not drawn and the *diam* setting is ignored. If
|
||||
*yes* is set, the 12 edges of the box are drawn, with a diameter that
|
||||
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
|
||||
2d). The color of the box boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
|
||||
2d). The color of the box boundaries can be set with the "dump_modify
|
||||
boxcolor" command.
|
||||
|
||||
The *axes* keyword determines if and how the coordinate axes are
|
||||
rendered as thin cylinders in the image. If *no* is set, then the
|
||||
@ -507,7 +578,8 @@ set (default), then the sub-domain boundaries are not drawn and the
|
||||
*diam* setting is ignored. If *yes* is set, the 12 edges of each
|
||||
processor sub-domain are drawn, with a diameter that is a fraction of
|
||||
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
|
||||
of the sub-domain boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
|
||||
of the sub-domain boundaries can be set with the "dump_modify
|
||||
boxcolor" command.
|
||||
|
||||
----------
|
||||
|
||||
@ -607,9 +679,272 @@ Play the movie:
|
||||
|
||||
----------
|
||||
|
||||
See the :doc:`Modify <Modify>` page for information on how to add
|
||||
new compute and fix styles to LAMMPS to calculate per-atom quantities
|
||||
which could then be output into dump files.
|
||||
Dump_modify keywords for dump image and dump movie
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The following dump_modify keywords apply only to the dump image and
|
||||
dump movie styles. Any keyword that works with dump image also works
|
||||
with dump movie, since the movie is simply a collection of images.
|
||||
Some of the keywords only affect the dump movie style. The
|
||||
descriptions give details.
|
||||
|
||||
----------
|
||||
|
||||
The *acolor* keyword can be used with the dump image command, when its
|
||||
atom color setting is *type*, to set the color that atoms of each type
|
||||
will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Ntypes = the
|
||||
number of atom types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of atom
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
|
||||
the number of atom types, then an asterisk with no numeric values
|
||||
means all types from 1 to N. A leading asterisk means all types from
|
||||
1 to n (inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
"dump_modify color" command, as described below. Or it can be two or
|
||||
more colors separated by a "/" character, e.g. red/green/blue. In the
|
||||
former case, that color is assigned to all the specified atom types.
|
||||
In the latter case, the list of colors are assigned in a round-robin
|
||||
fashion to each of the specified atom types.
|
||||
|
||||
----------
|
||||
|
||||
The *adiam* keyword can be used with the dump image command, when its
|
||||
atom diameter setting is *type*, to set the size that atoms of each
|
||||
type will be drawn in the image. The specified *type* should be an
|
||||
integer from 1 to Ntypes. As with the *acolor* keyword, a wildcard
|
||||
asterisk can be used as part of the *type* argument to specify a range
|
||||
of atom types. The specified *diam* is the size in whatever distance
|
||||
:doc:`units <units>` the input script is using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *amap* keyword can be used with the dump image command, with its
|
||||
*atom* keyword, when its atom setting is an atom-attribute, to setup a
|
||||
color map. The color map is used to assign a specific RGB
|
||||
(red/green/blue) color value to an individual atom when it is drawn,
|
||||
based on the atom's attribute, which is a numeric value, e.g. its
|
||||
x-component of velocity if the atom-attribute "vx" was specified.
|
||||
|
||||
The basic idea of a color map is that the atom-attribute will be
|
||||
within a range of values, and that range is associated with a series
|
||||
of colors (e.g. red, blue, green). An atom's specific value (vx =
|
||||
-3.2) can then mapped to the series of colors (e.g. halfway between
|
||||
red and blue), and a specific color is determined via an interpolation
|
||||
procedure.
|
||||
|
||||
There are many possible options for the color map, enabled by the
|
||||
*amap* keyword. Here are the details.
|
||||
|
||||
The *lo* and *hi* settings determine the range of values allowed for
|
||||
the atom attribute. If numeric values are used for *lo* and/or *hi*,
|
||||
then values that are lower/higher than that value are set to the
|
||||
value. I.e. the range is static. If *lo* is specified as *min* or
|
||||
*hi* as *max* then the range is dynamic, and the lower and/or
|
||||
upper bound will be calculated each time an image is drawn, based
|
||||
on the set of atoms being visualized.
|
||||
|
||||
The *style* setting is two letters, such as "ca". The first letter is
|
||||
either "c" for continuous, "d" for discrete, or "s" for sequential.
|
||||
The second letter is either "a" for absolute, or "f" for fractional.
|
||||
|
||||
A continuous color map is one in which the color changes continuously
|
||||
from value to value within the range. A discrete color map is one in
|
||||
which discrete colors are assigned to sub-ranges of values within the
|
||||
range. A sequential color map is one in which discrete colors are
|
||||
assigned to a sequence of sub-ranges of values covering the entire
|
||||
range.
|
||||
|
||||
An absolute color map is one in which the values to which colors are
|
||||
assigned are specified explicitly as values within the range. A
|
||||
fractional color map is one in which the values to which colors are
|
||||
assigned are specified as a fractional portion of the range. For
|
||||
example if the range is from -10.0 to 10.0, and the color red is to be
|
||||
assigned to atoms with a value of 5.0, then for an absolute color map
|
||||
the number 5.0 would be used. But for a fractional map, the number
|
||||
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
|
||||
|
||||
The *delta* setting must be specified for all styles, but is only used
|
||||
for the sequential style; otherwise the value is ignored. It
|
||||
specifies the bin size to use within the range for assigning
|
||||
consecutive colors to. For example, if the range is from -10.0 to
|
||||
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
|
||||
the range. The first will be from -10.0 <= color1 < -9.0, then second
|
||||
from -9.0 <= color2 < -8.0, etc.
|
||||
|
||||
The *N* setting is how many entries follow. The format of the entries
|
||||
depends on whether the color map style is continuous, discrete or
|
||||
sequential. In all cases the *color* setting can be any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
For continuous color maps, each entry has a *value* and a *color*\ .
|
||||
The *value* is either a number within the range of values or *min* or
|
||||
*max*\ . The *value* of the first entry must be *min* and the *value*
|
||||
of the last entry must be *max*\ . Any entries in between must have
|
||||
increasing values. Note that numeric values can be specified either
|
||||
as absolute numbers or as fractions (0.0 to 1.0) of the range,
|
||||
depending on the "a" or "f" in the style setting for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. X will fall
|
||||
between 2 of the entry values. The color of the atom is linearly
|
||||
interpolated (in each of the RGB values) between the 2 colors
|
||||
associated with those entries. For example, if X = -5.0 and the 2
|
||||
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
|
||||
atom's color will be halfway between "red" and "blue", which happens
|
||||
to be "purple".
|
||||
|
||||
For discrete color maps, each entry has a *lo* and *hi* value and a
|
||||
*color*\ . The *lo* and *hi* settings are either numbers within the
|
||||
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
|
||||
and *hi* settings of the last entry must be *min* and *max*\ . Other
|
||||
entries can have any *lo* and *hi* values and the sub-ranges of
|
||||
different values can overlap. Note that numeric *lo* and *hi* values
|
||||
can be specified either as absolute numbers or as fractions (0.0 to
|
||||
1.0) of the range, depending on the "a" or "f" in the style setting
|
||||
for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. The entries
|
||||
are scanned from first to last. The first time that *lo* <= X <=
|
||||
*hi*, X is assigned the color associated with that entry. You can
|
||||
think of the last entry as assigning a default color (since it will
|
||||
always be matched by X), and the earlier entries as colors that
|
||||
override the default. Also note that no interpolation of a color RGB
|
||||
is done. All atoms will be drawn with one of the colors in the list
|
||||
of entries.
|
||||
|
||||
For sequential color maps, each entry has only a *color*\ . Here is how
|
||||
the entries are used to determine the color of an individual atom,
|
||||
given the value X of its atom attribute. The range is partitioned
|
||||
into N bins of width *binsize*\ . Thus X will fall in a specific bin
|
||||
from 1 to N, say the Mth bin. If it falls on a boundary between 2
|
||||
bins, it is considered to be in the higher of the 2 bins. Each bin is
|
||||
assigned a color from the E entries. If E < N, then the colors are
|
||||
repeated. For example if 2 entries with colors red and green are
|
||||
specified, then the odd numbered bins will be red and the even bins
|
||||
green. The color of the atom is the color of its bin. Note that the
|
||||
sequential color map is really a shorthand way of defining a discrete
|
||||
color map without having to specify where all the bin boundaries are.
|
||||
|
||||
Here is an example of using a sequential color map to color all the
|
||||
atoms in individual molecules with a different color. See the
|
||||
examples/pour/in.pour.2d.molecule input script for an example of how
|
||||
this is used.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable colors string &
|
||||
"red green blue yellow white &
|
||||
purple pink orange lime gray"
|
||||
variable mol atom mol%10
|
||||
dump 1 all image 250 image.*.jpg v_mol type &
|
||||
zoom 1.6 adiam 1.5
|
||||
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
|
||||
|
||||
In this case, 10 colors are defined, and molecule IDs are
|
||||
mapped to one of the colors, even if there are 1000s of molecules.
|
||||
|
||||
----------
|
||||
|
||||
The *backcolor* sets the background color of the images. The color
|
||||
name can be any of the 140 pre-defined colors (see below) or a color
|
||||
name defined by the dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *bcolor* keyword can be used with the dump image command, with its
|
||||
*bond* keyword, when its color setting is *type*, to set the color
|
||||
that bonds of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Nbondtypes = the
|
||||
number of bond types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of bond
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
|
||||
the number of bond types, then an asterisk with no numeric values
|
||||
means all types from 1 to N. A leading asterisk means all types from
|
||||
1 to n (inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified bond types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified bond types.
|
||||
|
||||
----------
|
||||
|
||||
The *bdiam* keyword can be used with the dump image command, with its
|
||||
*bond* keyword, when its diam setting is *type*, to set the diameter
|
||||
that bonds of each type will be drawn in the image. The specified
|
||||
*type* should be an integer from 1 to Nbondtypes. As with the
|
||||
*bcolor* keyword, a wildcard asterisk can be used as part of the
|
||||
*type* argument to specify a range of bond types. The specified
|
||||
*diam* is the size in whatever distance :doc:`units <units>` you are
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *bitrate* keyword can be used with the :doc:`dump movie
|
||||
<dump_image>` command to define the size of the resulting movie file
|
||||
and its quality via setting how many kbits per second are to be used
|
||||
for the movie file. Higher bitrates require less compression and will
|
||||
result in higher quality movies. The quality is also determined by
|
||||
the compression format and encoder. The default setting is 2000
|
||||
kbit/s, which will result in average quality with older compression
|
||||
formats.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all movie file formats supported by dump movie allow the
|
||||
bitrate to be set. If not, the setting is silently ignored.
|
||||
|
||||
----------
|
||||
|
||||
The *boxcolor* keyword sets the color of the simulation box drawn
|
||||
around the atoms in each image as well as the color of processor
|
||||
sub-domain boundaries. See the "dump image box" command for how to
|
||||
specify that a box be drawn via the *box* keyword, and the sub-domain
|
||||
boundaries via the *subbox* keyword. The color name can be any of the
|
||||
140 pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *color* keyword allows definition of a new color name, in addition
|
||||
to the 140-predefined colors (see below), and associates 3
|
||||
red/green/blue RGB values with that color name. The color name can
|
||||
then be used with any other dump_modify keyword that takes a color
|
||||
name as a value. The RGB values should each be floating point values
|
||||
between 0.0 and 1.0 inclusive.
|
||||
|
||||
When a color name is converted to RGB values, the user-defined color
|
||||
names are searched first, then the 140 pre-defined color names. This
|
||||
means you can also use the *color* keyword to overwrite one of the
|
||||
pre-defined color names with new RBG values.
|
||||
|
||||
----------
|
||||
|
||||
The *framerate* keyword can be used with the :doc:`dump movie
|
||||
<dump_image>` command to define the duration of the resulting movie
|
||||
file. Movie files written by the dump *movie* command have a default
|
||||
frame rate of 24 frames per second and the images generated will be
|
||||
converted at that rate. Thus a sequence of 1000 dump images will
|
||||
result in a movie of about 42 seconds. To make a movie run longer you
|
||||
can either generate images more frequently or lower the frame rate.
|
||||
To speed a movie up, you can do the inverse. Using a frame rate
|
||||
higher than 24 is not recommended, as it will result in simply
|
||||
dropping the rendered images. It is more efficient to dump images less
|
||||
frequently.
|
||||
|
||||
----------
|
||||
|
||||
@ -664,7 +999,7 @@ Related commands
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The defaults for the keywords are as follows:
|
||||
The defaults for the dump image and dump movie keywords are as follows:
|
||||
|
||||
* adiam = not specified (use diameter setting)
|
||||
* atom = yes
|
||||
@ -682,3 +1017,101 @@ The defaults for the keywords are as follows:
|
||||
* subbox no 0.0
|
||||
* shiny = 1.0
|
||||
* ssao = no
|
||||
|
||||
----------
|
||||
|
||||
The defaults for the dump_modify keywords specific to dump image and dump movie are as follows:
|
||||
|
||||
* acolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* adiam = \* 1.0
|
||||
* amap = min max cf 0.0 2 min blue max red
|
||||
* backcolor = black
|
||||
* bcolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* bdiam = \* 0.5
|
||||
* bitrate = 2000
|
||||
* boxcolor = yellow
|
||||
* color = 140 color names are pre-defined as listed below
|
||||
* framerate = 24
|
||||
|
||||
----------
|
||||
|
||||
These are the standard 109 element names that LAMMPS pre-defines for
|
||||
use with the dump image and dump_modify commands.
|
||||
|
||||
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
|
||||
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
|
||||
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
|
||||
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
|
||||
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
|
||||
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
|
||||
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
|
||||
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
|
||||
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
|
||||
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
|
||||
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
|
||||
|
||||
----------
|
||||
|
||||
These are the 140 colors that LAMMPS pre-defines for use with the dump
|
||||
image and dump_modify commands. Additional colors can be defined with
|
||||
the dump_modify color command. The 3 numbers listed for each name are
|
||||
the RGB (red/green/blue) values. Divide each value by 255 to get the
|
||||
equivalent 0.0 to 1.0 value.
|
||||
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
dump_modify command
|
||||
===================
|
||||
|
||||
:doc:`dump_modify <dump_image>` command for image/movie options
|
||||
===============================================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -12,14 +15,16 @@ Syntax
|
||||
|
||||
* dump-ID = ID of dump to modify
|
||||
* one or more keyword/value pairs may be appended
|
||||
|
||||
* these keywords apply to various dump styles
|
||||
* keyword = *append* or *at* or *buffer* or *delay* or *element* or *every* or *fileper* or *first* or *flush* or *format* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
|
||||
* keyword = *append* or *at* or *balance* or *buffer* or *delay* or *element* or *every* or *every/time* or *fileper* or *first* or *flush* or *format* or *header* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*append* arg = *yes* or *no*
|
||||
*at* arg = N
|
||||
N = index of frame written upon first dump
|
||||
*balance* arg = *yes* or *no*
|
||||
*buffer* arg = *yes* or *no*
|
||||
*delay* arg = Dstep
|
||||
Dstep = delay output until this timestep
|
||||
@ -28,6 +33,9 @@ Syntax
|
||||
*every* arg = N
|
||||
N = dump every this many timesteps
|
||||
N can be a variable (see below)
|
||||
*every/time* arg = Delta
|
||||
Delta = dump every this interval in simulation time (time units)
|
||||
Delta can be a variable (see below)
|
||||
*fileper* arg = Np
|
||||
Np = write one file for every this many processors
|
||||
*first* arg = *yes* or *no*
|
||||
@ -35,6 +43,9 @@ Syntax
|
||||
*format* args = *line* string, *int* string, *float* string, M string, or *none*
|
||||
string = C-style format string
|
||||
M = integer from 1 to N, where N = # of per-atom quantities being output
|
||||
*header* arg = *yes* or *no*
|
||||
*yes* to write the header
|
||||
*no* to not write the header
|
||||
*image* arg = *yes* or *no*
|
||||
*label* arg = string
|
||||
string = character string (e.g. BONDS) to use in header of dump local file
|
||||
@ -66,56 +77,11 @@ Syntax
|
||||
*unwrap* arg = *yes* or *no*
|
||||
|
||||
* these keywords apply only to the *image* and *movie* :doc:`styles <dump_image>`
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate* or *header*
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*acolor* args = type color
|
||||
type = atom type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*adiam* args = type diam
|
||||
type = atom type or range of types (see below)
|
||||
diam = diameter of atoms of that type (distance units)
|
||||
*amap* args = lo hi style delta N entry1 entry2 ... entryN
|
||||
lo = number or *min* = lower bound of range of color map
|
||||
hi = number or *max* = upper bound of range of color map
|
||||
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
|
||||
"c" for continuous
|
||||
"d" for discrete
|
||||
"s" for sequential
|
||||
"a" for absolute
|
||||
"f" for fractional
|
||||
delta = binsize (only used for style "s", otherwise ignored)
|
||||
binsize = range is divided into bins of this width
|
||||
N = # of subsequent entries
|
||||
entry = value color (for continuous style)
|
||||
value = number or *min* or *max* = single value within range
|
||||
color = name of color used for that value
|
||||
entry = lo hi color (for discrete style)
|
||||
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
|
||||
color = name of color used for that subset of values
|
||||
entry = color (for sequential style)
|
||||
color = name of color used for a bin of values
|
||||
*backcolor* arg = color
|
||||
color = name of color for background
|
||||
*bcolor* args = type color
|
||||
type = bond type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*bdiam* args = type diam
|
||||
type = bond type or range of types (see below)
|
||||
diam = diameter of bonds of that type (distance units)
|
||||
*boxcolor* arg = color
|
||||
color = name of color for simulation box lines and processor sub-domain lines
|
||||
*color* args = name R G B
|
||||
name = name of color
|
||||
R,G,B = red/green/blue numeric values from 0.0 to 1.0
|
||||
*bitrate* arg = rate
|
||||
rate = target bitrate for movie in kbps
|
||||
*framerate* arg = fps
|
||||
fps = frames per second for movie
|
||||
*header* arg = *yes* or *no*
|
||||
*yes* to write the header
|
||||
*no* to not write the header
|
||||
see the :doc:`dump image <dump_image>` doc page for details
|
||||
|
||||
* these keywords apply only to the */gz* and */zstd* dump styles
|
||||
* keyword = *compression_level*
|
||||
@ -126,7 +92,7 @@ Syntax
|
||||
level = integer specifying the compression level that should be used (see below for supported levels)
|
||||
|
||||
* these keywords apply only to the */zstd* dump styles
|
||||
* keyword = *compression_level*
|
||||
* keyword = *checksum*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -144,7 +110,6 @@ Examples
|
||||
dump_modify xtcdump precision 10000 sfactor 0.1
|
||||
dump_modify 1 every 1000 nfile 20
|
||||
dump_modify 1 every v_myVar
|
||||
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -163,8 +128,9 @@ which allow for use of MPI-IO.
|
||||
|
||||
----------
|
||||
|
||||
These keywords apply to various dump styles, including the :doc:`dump image <dump_image>` and :doc:`dump movie <dump_image>` styles. The
|
||||
description gives details.
|
||||
Unless otherwise noted, the following keywords apply to all the
|
||||
various dump styles, including the :doc:`dump image <dump_image>` and
|
||||
:doc:`dump movie <dump_image>` styles.
|
||||
|
||||
----------
|
||||
|
||||
@ -235,11 +201,19 @@ will be accepted.
|
||||
|
||||
----------
|
||||
|
||||
The *every* keyword changes the dump frequency originally specified by
|
||||
the :doc:`dump <dump>` command to a new value. The every keyword can be
|
||||
specified in one of two ways. It can be a numeric value in which case
|
||||
it must be > 0. Or it can be an :doc:`equal-style variable <variable>`,
|
||||
which should be specified as v_name, where name is the variable name.
|
||||
The *every* keyword can be used with any dump style except the *dcd*
|
||||
and *xtc* styles. It does two things. It specifies that the interval
|
||||
between dump snapshots will be set in timesteps, which is the default
|
||||
if the *every* or *every/time* keywords are not used. See the
|
||||
*every/time* keyword for how to specify the interval in simulation
|
||||
time, i.e. in time units of the :doc:`units <units>` command. The
|
||||
*every* keyword also sets the interval value, which overrides the dump
|
||||
frequency originally specified by the :doc:`dump <dump>` command.
|
||||
|
||||
The *every* keyword can be specified in one of two ways. It can be a
|
||||
numeric value in which case it must be > 0. Or it can be an
|
||||
:doc:`equal-style variable <variable>`, which should be specified as
|
||||
v_name, where name is the variable name.
|
||||
|
||||
In this case, the variable is evaluated at the beginning of a run to
|
||||
determine the next timestep at which a dump snapshot will be written
|
||||
@ -248,11 +222,12 @@ determine the next timestep, etc. Thus the variable should return
|
||||
timestep values. See the stagger() and logfreq() and stride() math
|
||||
functions for :doc:`equal-style variables <variable>`, as examples of
|
||||
useful functions to use in this context. Other similar math functions
|
||||
could easily be added as options for :doc:`equal-style variables <variable>`. Also see the next() function, which allows
|
||||
use of a file-style variable which reads successive values from a
|
||||
file, each time the variable is evaluated. Used with the *every*
|
||||
keyword, if the file contains a list of ascending timesteps, you can
|
||||
output snapshots whenever you wish.
|
||||
could easily be added as options for :doc:`equal-style variables
|
||||
<variable>`. Also see the next() function, which allows use of a
|
||||
file-style variable which reads successive values from a file, each
|
||||
time the variable is evaluated. Used with the *every* keyword, if the
|
||||
file contains a list of ascending timesteps, you can output snapshots
|
||||
whenever you wish.
|
||||
|
||||
Note that when using the variable option with the *every* keyword, you
|
||||
need to use the *first* option if you want an initial snapshot written
|
||||
@ -293,14 +268,103 @@ in file tmp.times:
|
||||
|
||||
----------
|
||||
|
||||
The *every/time* keyword can be used with any dump style except the
|
||||
*dcd* and *xtc* styles. It does two things. It specifies that the
|
||||
interval between dump snapshots will be set in simulation time,
|
||||
i.e. in time units of the :doc:`units <units>` command. This can be
|
||||
useful when the timestep size varies during a simulation run, e.g. by
|
||||
use of the :doc:`fix dt/reset <fix_dt_reset>` command. The default is
|
||||
to specify the interval in timesteps; see the *every* keyword. The
|
||||
*every/time* command also sets the interval value.
|
||||
|
||||
.. note::
|
||||
|
||||
If you wish dump styles *atom*, *custom*, *local*, or *xyz* to
|
||||
include the simulation time as a field in the header portion of
|
||||
each snapshot, you also need to use the dump_modify *time* keyword
|
||||
with a setting of *yes*. See its documentation below.
|
||||
|
||||
Note that since snapshots are output on simulation steps, each
|
||||
snapshot will be written on the first timestep whose associated
|
||||
simulation time is >= the exact snapshot time value.
|
||||
|
||||
As with the *every* option, the *Delta* value can be specified in one
|
||||
of two ways. It can be a numeric value in which case it must be >
|
||||
0.0. Or it can be an :doc:`equal-style variable <variable>`, which
|
||||
should be specified as v_name, where name is the variable name.
|
||||
|
||||
In this case, the variable is evaluated at the beginning of a run to
|
||||
determine the next simulation time at which a dump snapshot will be
|
||||
written out. On that timestep the variable will be evaluated again to
|
||||
determine the next simulation time, etc. Thus the variable should
|
||||
return values in time units. Note the current timestep or simulation
|
||||
time can be used in an :doc:`equal-style variables <variable>` since
|
||||
they are both thermodynamic keywords. Also see the next() function,
|
||||
which allows use of a file-style variable which reads successive
|
||||
values from a file, each time the variable is evaluated. Used with
|
||||
the *every/time* keyword, if the file contains a list of ascending
|
||||
simulation times, you can output snapshots whenever you wish.
|
||||
|
||||
Note that when using the variable option with the *every/time*
|
||||
keyword, you need to use the *first* option if you want an initial
|
||||
snapshot written to the dump file. The *every/time* keyword cannot be
|
||||
used with the dump *dcd* style.
|
||||
|
||||
For example, the following commands will write snapshots at successive
|
||||
simulation times which grow by a factor of 1.5 with each interval.
|
||||
The dt value used in the variable is to avoid a zero result when the
|
||||
initial simulation time is 0.0.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable increase equal 1.5*(time+dt)
|
||||
dump 1 all atom 100 tmp.dump
|
||||
dump_modify 1 every/time v_increase first yes
|
||||
|
||||
The following commands would write snapshots at the times listed in
|
||||
file tmp.times:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable f file tmp.times
|
||||
variable s equal next(f)
|
||||
dump 1 all atom 100 tmp.dump
|
||||
dump_modify 1 every/time v_s
|
||||
|
||||
.. note::
|
||||
|
||||
When using a file-style variable with the *every/time* keyword, the
|
||||
file of timesteps must list a first time that is beyond the time
|
||||
associated with the current timestep (e.g. it cannot be 0.0). And
|
||||
it must list one or more times beyond the length of the run you
|
||||
perform. This is because the dump command will generate an error
|
||||
if the next time it reads from the file is not a value greater than
|
||||
the current time. Thus if you wanted output at times 0,15,100 of a
|
||||
run of length 100 in simulation time, the file should contain the
|
||||
values 15,100,101 and you should also use the dump_modify first
|
||||
command. Any final value > 100 could be used in place of 101.
|
||||
|
||||
----------
|
||||
|
||||
The *first* keyword determines whether a dump snapshot is written on
|
||||
the very first timestep after the dump command is invoked. This will
|
||||
always occur if the current timestep is a multiple of N, the frequency
|
||||
specified in the :doc:`dump <dump>` command, including timestep 0. But
|
||||
if this is not the case, a dump snapshot will only be written if the
|
||||
setting of this keyword is *yes*\ . If it is *no*, which is the
|
||||
always occur if the current timestep is a multiple of $N$, the
|
||||
frequency specified in the :doc:`dump <dump>` command or
|
||||
:doc:`dump_modify every <dump_modify>` command, including timestep 0.
|
||||
It will also always occur if the current simulation time is a multiple
|
||||
of *Delta*, the time interval specified in the doc:`dump_modify
|
||||
every/time <dump_modify>` command.
|
||||
|
||||
But if this is not the case, a dump snapshot will only be written if
|
||||
the setting of this keyword is *yes*\ . If it is *no*, which is the
|
||||
default, then it will not be written.
|
||||
|
||||
Note that if the argument to the :doc:`dump_modify every
|
||||
<dump_modify>` doc:`dump_modify every/time <dump_modify>` commands is
|
||||
a variable and not a numeric value, then specifying *first yes* is the
|
||||
only way to write a dump snapshot on the first timestep after the dump
|
||||
command is invoked.
|
||||
|
||||
----------
|
||||
|
||||
The *flush* keyword determines whether a flush operation is invoked
|
||||
@ -380,6 +444,13 @@ The *fileper* keyword is documented below with the *nfile* keyword.
|
||||
|
||||
----------
|
||||
|
||||
The *header* keyword toggles whether the dump file will include a
|
||||
header. Excluding a header will reduce the size of the dump file for
|
||||
fixes such as :doc:`fix pair/tracker <fix_pair_tracker>` which do not
|
||||
require the information typically written to the header.
|
||||
|
||||
----------
|
||||
|
||||
The *image* keyword applies only to the dump *atom* style. If the
|
||||
image value is *yes*, 3 flags are appended to each atom's coords which
|
||||
are the absolute box image of the atom in each dimension. For
|
||||
@ -592,9 +663,19 @@ The dump *local* style cannot be sorted by atom ID, since there are
|
||||
typically multiple lines of output per atom. Some dump styles, such
|
||||
as *dcd* and *xtc*, require sorting by atom ID to format the output
|
||||
file correctly. If multiple processors are writing the dump file, via
|
||||
the "%" wildcard in the dump filename, then sorting cannot be
|
||||
the "%" wildcard in the dump filename and the *nfile* or *fileper*
|
||||
keywords are set to non-default values (i.e. the number of dump file
|
||||
pieces is not equal to the number of procs), then sorting cannot be
|
||||
performed.
|
||||
|
||||
In a parallel run, the per-processor dump file pieces can have
|
||||
significant imbalance in number of lines of per-atom info. The *balance*
|
||||
keyword determines whether the number of lines in each processor
|
||||
snapshot are balanced to be nearly the same. A balance value of *no*
|
||||
means no balancing will be done, while *yes* means balancing will be
|
||||
performed. This balancing preserves dump sorting order. For a serial
|
||||
run, this option is ignored since the output is already balanced.
|
||||
|
||||
.. note::
|
||||
|
||||
Unless it is required by the dump style, sorting dump file
|
||||
@ -670,16 +751,20 @@ threshold criterion is met. Otherwise it is not met.
|
||||
|
||||
----------
|
||||
|
||||
The *time* keyword only applies to the dump *atom*, *custom*, and
|
||||
*local* styles (and their COMPRESS package versions *atom/gz*,
|
||||
*custom/gz* and *local/gz*\ ). If set to *yes*, each frame will will
|
||||
contain two extra lines before the "ITEM: TIMESTEP" entry:
|
||||
The *time* keyword only applies to the dump *atom*, *custom*, *local*,
|
||||
and *xyz* styles (and their COMPRESS package versions *atom/gz*,
|
||||
*custom/gz* and *local/gz*\ ). For the first 3 styles, if set to
|
||||
*yes*, each frame will will contain two extra lines before the "ITEM:
|
||||
TIMESTEP" entry:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ITEM: TIME
|
||||
\<elapsed time\>
|
||||
|
||||
For the *xyz* style, the simulation time is included on the same line
|
||||
as the timestep value.
|
||||
|
||||
This will output the current elapsed simulation time in current
|
||||
time units equivalent to the :doc:`thermo keyword <thermo_style>` *time*\ .
|
||||
This is to simplify post-processing of trajectories using a variable time
|
||||
@ -715,303 +800,35 @@ box size stored with the snapshot.
|
||||
|
||||
----------
|
||||
|
||||
These keywords apply only to the :doc:`dump image <dump_image>` and
|
||||
:doc:`dump movie <dump_image>` styles. Any keyword that affects an
|
||||
image, also affects a movie, since the movie is simply a collection of
|
||||
images. Some of the keywords only affect the :doc:`dump movie <dump_image>` style. The descriptions give details.
|
||||
The COMPRESS package offers both GZ and Zstd compression variants of
|
||||
styles atom, custom, local, cfg, and xyz. When using these styles the
|
||||
compression level can be controlled by the :code:`compression_level`
|
||||
keyword. File names with these styles have to end in either
|
||||
:code:`.gz` or :code:`.zst`.
|
||||
|
||||
----------
|
||||
|
||||
The *acolor* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, when its atom color setting is *type*, to set the color that
|
||||
atoms of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Ntypes = the
|
||||
number of atom types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of atom
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
|
||||
number of atom types, then an asterisk with no numeric values means
|
||||
all types from 1 to N. A leading asterisk means all types from 1 to n
|
||||
(inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified atom types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified atom types.
|
||||
|
||||
----------
|
||||
|
||||
The *adiam* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, when its atom diameter setting is *type*, to set the size
|
||||
that atoms of each type will be drawn in the image. The specified
|
||||
*type* should be an integer from 1 to Ntypes. As with the *acolor*
|
||||
keyword, a wildcard asterisk can be used as part of the *type*
|
||||
argument to specify a range of atom types. The specified *diam* is
|
||||
the size in whatever distance :doc:`units <units>` the input script is
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *amap* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *atom* keyword, when its atom setting is an
|
||||
atom-attribute, to setup a color map. The color map is used to assign
|
||||
a specific RGB (red/green/blue) color value to an individual atom when
|
||||
it is drawn, based on the atom's attribute, which is a numeric value,
|
||||
e.g. its x-component of velocity if the atom-attribute "vx" was
|
||||
specified.
|
||||
|
||||
The basic idea of a color map is that the atom-attribute will be
|
||||
within a range of values, and that range is associated with a series
|
||||
of colors (e.g. red, blue, green). An atom's specific value (vx =
|
||||
-3.2) can then mapped to the series of colors (e.g. halfway between
|
||||
red and blue), and a specific color is determined via an interpolation
|
||||
procedure.
|
||||
|
||||
There are many possible options for the color map, enabled by the
|
||||
*amap* keyword. Here are the details.
|
||||
|
||||
The *lo* and *hi* settings determine the range of values allowed for
|
||||
the atom attribute. If numeric values are used for *lo* and/or *hi*,
|
||||
then values that are lower/higher than that value are set to the
|
||||
value. I.e. the range is static. If *lo* is specified as *min* or
|
||||
*hi* as *max* then the range is dynamic, and the lower and/or
|
||||
upper bound will be calculated each time an image is drawn, based
|
||||
on the set of atoms being visualized.
|
||||
|
||||
The *style* setting is two letters, such as "ca". The first letter is
|
||||
either "c" for continuous, "d" for discrete, or "s" for sequential.
|
||||
The second letter is either "a" for absolute, or "f" for fractional.
|
||||
|
||||
A continuous color map is one in which the color changes continuously
|
||||
from value to value within the range. A discrete color map is one in
|
||||
which discrete colors are assigned to sub-ranges of values within the
|
||||
range. A sequential color map is one in which discrete colors are
|
||||
assigned to a sequence of sub-ranges of values covering the entire
|
||||
range.
|
||||
|
||||
An absolute color map is one in which the values to which colors are
|
||||
assigned are specified explicitly as values within the range. A
|
||||
fractional color map is one in which the values to which colors are
|
||||
assigned are specified as a fractional portion of the range. For
|
||||
example if the range is from -10.0 to 10.0, and the color red is to be
|
||||
assigned to atoms with a value of 5.0, then for an absolute color map
|
||||
the number 5.0 would be used. But for a fractional map, the number
|
||||
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
|
||||
|
||||
The *delta* setting must be specified for all styles, but is only used
|
||||
for the sequential style; otherwise the value is ignored. It
|
||||
specifies the bin size to use within the range for assigning
|
||||
consecutive colors to. For example, if the range is from -10.0 to
|
||||
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
|
||||
the range. The first will be from -10.0 <= color1 < -9.0, then second
|
||||
from -9.0 <= color2 < -8.0, etc.
|
||||
|
||||
The *N* setting is how many entries follow. The format of the entries
|
||||
depends on whether the color map style is continuous, discrete or
|
||||
sequential. In all cases the *color* setting can be any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
For continuous color maps, each entry has a *value* and a *color*\ .
|
||||
The *value* is either a number within the range of values or *min* or
|
||||
*max*\ . The *value* of the first entry must be *min* and the *value*
|
||||
of the last entry must be *max*\ . Any entries in between must have
|
||||
increasing values. Note that numeric values can be specified either
|
||||
as absolute numbers or as fractions (0.0 to 1.0) of the range,
|
||||
depending on the "a" or "f" in the style setting for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. X will fall
|
||||
between 2 of the entry values. The color of the atom is linearly
|
||||
interpolated (in each of the RGB values) between the 2 colors
|
||||
associated with those entries. For example, if X = -5.0 and the 2
|
||||
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
|
||||
atom's color will be halfway between "red" and "blue", which happens
|
||||
to be "purple".
|
||||
|
||||
For discrete color maps, each entry has a *lo* and *hi* value and a
|
||||
*color*\ . The *lo* and *hi* settings are either numbers within the
|
||||
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
|
||||
and *hi* settings of the last entry must be *min* and *max*\ . Other
|
||||
entries can have any *lo* and *hi* values and the sub-ranges of
|
||||
different values can overlap. Note that numeric *lo* and *hi* values
|
||||
can be specified either as absolute numbers or as fractions (0.0 to
|
||||
1.0) of the range, depending on the "a" or "f" in the style setting
|
||||
for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. The entries
|
||||
are scanned from first to last. The first time that *lo* <= X <=
|
||||
*hi*, X is assigned the color associated with that entry. You can
|
||||
think of the last entry as assigning a default color (since it will
|
||||
always be matched by X), and the earlier entries as colors that
|
||||
override the default. Also note that no interpolation of a color RGB
|
||||
is done. All atoms will be drawn with one of the colors in the list
|
||||
of entries.
|
||||
|
||||
For sequential color maps, each entry has only a *color*\ . Here is how
|
||||
the entries are used to determine the color of an individual atom,
|
||||
given the value X of its atom attribute. The range is partitioned
|
||||
into N bins of width *binsize*\ . Thus X will fall in a specific bin
|
||||
from 1 to N, say the Mth bin. If it falls on a boundary between 2
|
||||
bins, it is considered to be in the higher of the 2 bins. Each bin is
|
||||
assigned a color from the E entries. If E < N, then the colors are
|
||||
repeated. For example if 2 entries with colors red and green are
|
||||
specified, then the odd numbered bins will be red and the even bins
|
||||
green. The color of the atom is the color of its bin. Note that the
|
||||
sequential color map is really a shorthand way of defining a discrete
|
||||
color map without having to specify where all the bin boundaries are.
|
||||
|
||||
Here is an example of using a sequential color map to color all the
|
||||
atoms in individual molecules with a different color. See the
|
||||
examples/pour/in.pour.2d.molecule input script for an example of how
|
||||
this is used.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable colors string &
|
||||
"red green blue yellow white &
|
||||
purple pink orange lime gray"
|
||||
variable mol atom mol%10
|
||||
dump 1 all image 250 image.*.jpg v_mol type &
|
||||
zoom 1.6 adiam 1.5
|
||||
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
|
||||
|
||||
In this case, 10 colors are defined, and molecule IDs are
|
||||
mapped to one of the colors, even if there are 1000s of molecules.
|
||||
|
||||
----------
|
||||
|
||||
The *backcolor* sets the background color of the images. The color
|
||||
name can be any of the 140 pre-defined colors (see below) or a color
|
||||
name defined by the dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *bcolor* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *bond* keyword, when its color setting is *type*, to
|
||||
set the color that bonds of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Nbondtypes = the
|
||||
number of bond types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of bond
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
|
||||
number of bond types, then an asterisk with no numeric values means
|
||||
all types from 1 to N. A leading asterisk means all types from 1 to n
|
||||
(inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified bond types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified bond types.
|
||||
|
||||
----------
|
||||
|
||||
The *bdiam* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *bond* keyword, when its diam setting is *type*, to
|
||||
set the diameter that bonds of each type will be drawn in the image.
|
||||
The specified *type* should be an integer from 1 to Nbondtypes. As
|
||||
with the *bcolor* keyword, a wildcard asterisk can be used as part of
|
||||
the *type* argument to specify a range of bond types. The specified
|
||||
*diam* is the size in whatever distance :doc:`units <units>` you are
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *bitrate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the size of the resulting
|
||||
movie file and its quality via setting how many kbits per second are
|
||||
to be used for the movie file. Higher bitrates require less
|
||||
compression and will result in higher quality movies. The quality is
|
||||
also determined by the compression format and encoder. The default
|
||||
setting is 2000 kbit/s, which will result in average quality with
|
||||
older compression formats.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all movie file formats supported by dump movie allow the
|
||||
bitrate to be set. If not, the setting is silently ignored.
|
||||
|
||||
----------
|
||||
|
||||
The *boxcolor* keyword sets the color of the simulation box drawn
|
||||
around the atoms in each image as well as the color of processor
|
||||
sub-domain boundaries. See the "dump image box" command for how to
|
||||
specify that a box be drawn via the *box* keyword, and the sub-domain
|
||||
boundaries via the *subbox* keyword. The color name can be any of the
|
||||
140 pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *color* keyword allows definition of a new color name, in addition
|
||||
to the 140-predefined colors (see below), and associates 3
|
||||
red/green/blue RGB values with that color name. The color name can
|
||||
then be used with any other dump_modify keyword that takes a color
|
||||
name as a value. The RGB values should each be floating point values
|
||||
between 0.0 and 1.0 inclusive.
|
||||
|
||||
When a color name is converted to RGB values, the user-defined color
|
||||
names are searched first, then the 140 pre-defined color names. This
|
||||
means you can also use the *color* keyword to overwrite one of the
|
||||
pre-defined color names with new RBG values.
|
||||
|
||||
----------
|
||||
|
||||
The *framerate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the duration of the resulting
|
||||
movie file. Movie files written by the dump *movie* command have a
|
||||
default frame rate of 24 frames per second and the images generated
|
||||
will be converted at that rate. Thus a sequence of 1000 dump images
|
||||
will result in a movie of about 42 seconds. To make a movie run
|
||||
longer you can either generate images more frequently or lower the
|
||||
frame rate. To speed a movie up, you can do the inverse. Using a
|
||||
frame rate higher than 24 is not recommended, as it will result in
|
||||
simply dropping the rendered images. It is more efficient to dump
|
||||
images less frequently.
|
||||
|
||||
----------
|
||||
|
||||
The *header* keyword toggles whether the dump file will include a header.
|
||||
Excluding a header will reduce the size of the dump file for fixes such as
|
||||
:doc:`fix pair/tracker <fix_pair_tracker>` which do not require the information
|
||||
typically written to the header.
|
||||
|
||||
----------
|
||||
|
||||
The COMPRESS package offers both GZ and Zstd compression variants of styles
|
||||
atom, custom, local, cfg, and xyz. When using these styles the compression
|
||||
level can be controlled by the :code:`compression_level` parameter. File names
|
||||
with these styles have to end in either :code:`.gz` or :code:`.zst`.
|
||||
|
||||
GZ supports compression levels from -1 (default), 0 (no compression), and 1 to
|
||||
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9 as
|
||||
default compression level.
|
||||
GZ supports compression levels from -1 (default), 0 (no compression),
|
||||
and 1 to
|
||||
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9
|
||||
as default compression level.
|
||||
|
||||
Zstd offers a wider range of compression levels, including negative
|
||||
levels that sacrifice compression for performance. 0 is the
|
||||
default, positive levels are 1 to 22, with 22 being the most expensive
|
||||
levels that sacrifice compression for performance. 0 is the default,
|
||||
positive levels are 1 to 22, with 22 being the most expensive
|
||||
compression. Zstd promises higher compression/decompression speeds for
|
||||
similar compression ratios. For more details see
|
||||
`http://facebook.github.io/zstd/`.
|
||||
|
||||
In addition, Zstd compressed files can have a checksum of the entire
|
||||
contents. The Zstd enabled dump styles enable this feature by default and it
|
||||
can be disabled with the :code:`checksum` parameter.
|
||||
In addition, Zstd compressed files can include a checksum of the
|
||||
entire contents. The Zstd enabled dump styles enable this feature by
|
||||
default and it can be disabled with the :code:`checksum` keyword.
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
none
|
||||
|
||||
Not all *dump_modify* options can be applied to all dump styles.
|
||||
Details are in the discussions of the individual options.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
@ -1024,6 +841,7 @@ Default
|
||||
The option defaults are
|
||||
|
||||
* append = no
|
||||
* balance = no
|
||||
* buffer = yes for dump styles *atom*, *custom*, *loca*, and *xyz*
|
||||
* element = "C" for every atom type
|
||||
* every = whatever it was set to via the :doc:`dump <dump>` command
|
||||
@ -1046,100 +864,7 @@ The option defaults are
|
||||
* units = no
|
||||
* unwrap = no
|
||||
|
||||
* acolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* adiam = \* 1.0
|
||||
* amap = min max cf 0.0 2 min blue max red
|
||||
* backcolor = black
|
||||
* bcolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* bdiam = \* 0.5
|
||||
* bitrate = 2000
|
||||
* boxcolor = yellow
|
||||
* color = 140 color names are pre-defined as listed below
|
||||
* framerate = 24
|
||||
|
||||
* compression_level = 9 (gz variants)
|
||||
* compression_level = 0 (zstd variants)
|
||||
* checksum = yes (zstd variants)
|
||||
|
||||
----------
|
||||
|
||||
These are the standard 109 element names that LAMMPS pre-defines for
|
||||
use with the :doc:`dump image <dump_image>` and dump_modify commands.
|
||||
|
||||
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
|
||||
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
|
||||
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
|
||||
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
|
||||
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
|
||||
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
|
||||
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
|
||||
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
|
||||
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
|
||||
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
|
||||
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
|
||||
|
||||
----------
|
||||
|
||||
These are the 140 colors that LAMMPS pre-defines for use with the
|
||||
:doc:`dump image <dump_image>` and dump_modify commands. Additional
|
||||
colors can be defined with the dump_modify color command. The 3
|
||||
numbers listed for each name are the RGB (red/green/blue) values.
|
||||
Divide each value by 255 to get the equivalent 0.0 to 1.0 value.
|
||||
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
.. index:: dynamical_matrix
|
||||
.. index:: dynamical_matrix/kk
|
||||
|
||||
dynamical_matrix command
|
||||
========================
|
||||
|
||||
Accelerator Variants: dynamical_matrix/kk
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -56,6 +59,12 @@ If the style eskm is selected, the dynamical matrix will be in units of
|
||||
inverse squared femtoseconds. These units will then conveniently leave
|
||||
frequencies in THz.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
|
||||
@ -166,6 +166,7 @@ page are followed by one or more of (g,i,k,o,t) to indicate which
|
||||
accelerated styles exist.
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>` - apply cosine-shaped acceleration to atoms
|
||||
* :doc:`acks2/reaxff <fix_acks2_reaxff>` - apply ACKS2 charge equilibration
|
||||
* :doc:`adapt <fix_adapt>` - change a simulation parameter over time
|
||||
* :doc:`adapt/fep <fix_adapt_fep>` - enhanced version of fix adapt
|
||||
* :doc:`addforce <fix_addforce>` - add a force to each atom
|
||||
@ -246,6 +247,7 @@ accelerated styles exist.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>` - restrain atoms to a manifold during minimization
|
||||
* :doc:`mdi/engine <fix_mdi_engine>` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI)
|
||||
* :doc:`meso/move <fix_meso_move>` - move mesoscopic SPH/SDPD particles in a prescribed fashion
|
||||
* :doc:`mol/swap <fix_mol_swap>` - Monte Carlo atom type swapping with a molecule
|
||||
* :doc:`momentum <fix_momentum>` - zero the linear and/or angular momentum of a group of atoms
|
||||
* :doc:`momentum/chunk <fix_momentum>` - zero the linear and/or angular momentum of a chunk of atoms
|
||||
* :doc:`move <fix_move>` - move atoms in a prescribed fashion
|
||||
@ -269,7 +271,8 @@ accelerated styles exist.
|
||||
* :doc:`npt/eff <fix_nh_eff>` - NPT for nuclei and electrons in the electron force field model
|
||||
* :doc:`npt/sphere <fix_npt_sphere>` - NPT for spherical particles
|
||||
* :doc:`npt/uef <fix_nh_uef>` - NPT style time integration with diagonal flow
|
||||
* :doc:`numdiff <fix_numdiff>` - compute derivatives of per-atom data from finite differences
|
||||
* :doc:`numdiff <fix_numdiff>` - numerically approximate atomic forces using finite energy differences
|
||||
* :doc:`numdiff/virial <fix_numdiff_virial>` - numerically approximate virial stress tensor using finite energy differences
|
||||
* :doc:`nve <fix_nve>` - constant NVE time integration
|
||||
* :doc:`nve/asphere <fix_nve_asphere>` - NVE for aspherical particles
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>` - NVE for aspherical particles without forces
|
||||
|
||||
118
doc/src/fix_acks2_reaxff.rst
Normal file
118
doc/src/fix_acks2_reaxff.rst
Normal file
@ -0,0 +1,118 @@
|
||||
.. index:: fix acks2/reaxff
|
||||
.. index:: fix acks2/reaxff/kk
|
||||
|
||||
fix acks2/reaxff command
|
||||
========================
|
||||
|
||||
Accelerator Variants: *acks2/reaxff/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID acks2/reaxff Nevery cutlo cuthi tolerance params args
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* acks2/reaxff = style name of this fix command
|
||||
* Nevery = perform ACKS2 every this many steps
|
||||
* cutlo,cuthi = lo and hi cutoff for Taper radius
|
||||
* tolerance = precision to which charges will be equilibrated
|
||||
* params = reaxff or a filename
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 reaxff
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Perform the atom-condensed Kohn-Sham DFT to second order (ACKS2) charge
|
||||
equilibration method as described in :ref:`(Verstraelen) <Verstraelen>`.
|
||||
ACKS2 impedes unphysical long-range charge transfer sometimes seen with
|
||||
QEq (e.g. for dissociation of molecules), at increased computational
|
||||
cost. It is typically used in conjunction with the ReaxFF force field
|
||||
model as implemented in the :doc:`pair_style reaxff <pair_reaxff>`
|
||||
command, but it can be used with any potential in LAMMPS, so long as it
|
||||
defines and uses charges on each atom. For more technical details about
|
||||
the charge equilibration performed by fix acks2/reaxff, see the
|
||||
:ref:`(O'Hearn) <O'Hearn>` paper.
|
||||
|
||||
The ACKS2 method minimizes the electrostatic energy of the system by
|
||||
adjusting the partial charge on individual atoms based on interactions
|
||||
with their neighbors. It requires some parameters for each atom type.
|
||||
If the *params* setting above is the word "reaxff", then these are
|
||||
extracted from the :doc:`pair_style reaxff <pair_reaxff>` command and
|
||||
the ReaxFF force field file it reads in. If a file name is specified
|
||||
for *params*\ , then the parameters are taken from the specified file
|
||||
and the file must contain one line for each atom type. The latter form
|
||||
must be used when performing QeQ with a non-ReaxFF potential. The lines
|
||||
should be formatted as follows:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
bond_softness
|
||||
itype chi eta gamma bcut
|
||||
|
||||
where the first line is the global parameter *bond_softness*. The
|
||||
remaining 1 to Ntypes lines include *itype*, the atom type from 1 to
|
||||
Ntypes, *chi*, the electronegativity in eV, *eta*, the self-Coulomb
|
||||
potential in eV, *gamma*, the valence orbital exponent, and *bcut*, the
|
||||
bond cutoff distance. Note that these 4 quantities are also in the
|
||||
ReaxFF potential file, except that eta is defined here as twice the eta
|
||||
value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units
|
||||
of this fix are hard-coded to be A, eV, and electronic charge.
|
||||
|
||||
**Restart, fix_modify, output, run start/stop, minimize info:**
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. No global scalar or vector or per-atom quantities are
|
||||
stored by this fix for access by various :doc:`output commands
|
||||
<Howto_output>`. No parameter of this fix can be used with the
|
||||
*start/stop* keywords of the :doc:`run <run>` command.
|
||||
|
||||
This fix is invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the REAXFF package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
This fix does not correctly handle interactions involving multiple
|
||||
periodic images of the same atom. Hence, it should not be used for
|
||||
periodic cell dimensions less than 10 angstroms.
|
||||
|
||||
This fix may be used in combination with :doc:`fix efield <fix_efield>`
|
||||
and will apply the external electric field during charge equilibration,
|
||||
but there may be only one fix efield instance used, it may only use a
|
||||
constant electric field, and the electric field vector may only have
|
||||
components in non-periodic directions.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`pair_style reaxff <pair_reaxff>`, :doc:`fix qeq/reaxff <fix_qeq_reaxff>`
|
||||
|
||||
**Default:** none
|
||||
|
||||
----------
|
||||
|
||||
.. _O'Hearn:
|
||||
|
||||
**(O'Hearn)** O'Hearn, Alperen, Aktulga, SIAM J. Sci. Comput., 42(1), C1-C22 (2020).
|
||||
|
||||
.. _Verstraelen:
|
||||
|
||||
**(Verstraelen)** Verstraelen, Ayers, Speybroeck, Waroquier, J. Chem. Phys. 138, 074108 (2013).
|
||||
@ -99,7 +99,7 @@ invoked by the :doc:`minimize <minimize>` command.
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the MISC package. It is only enabled if
|
||||
This fix is part of the EXTRA-FIX package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
|
||||
@ -73,51 +73,51 @@ is the same after the swap as it was before the swap, even though the
|
||||
atom masses have changed.
|
||||
|
||||
The *semi-grand* keyword can be set to *yes* to switch to the
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh) <Sadigh>`. This
|
||||
means that the total number of each particle type does not need to be
|
||||
conserved. The default is *no*, which means that the only kind of swap
|
||||
allowed exchanges an atom of one type with an atom of a different
|
||||
given type. In other words, the relative mole fractions of the swapped
|
||||
atoms remains constant. Whereas in the semi-grand canonical ensemble,
|
||||
the composition of the system can change. Note that when using
|
||||
*semi-grand*, atoms in the fix group whose type is not listed
|
||||
in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch
|
||||
the selected atom (if eligible) to one of the other listed types
|
||||
with equal probability. Acceptance of each attempt depends upon the Metropolis criterion.
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh)
|
||||
<Sadigh>`. This means that the total number of each particle type does
|
||||
not need to be conserved. The default is *no*, which means that the
|
||||
only kind of swap allowed exchanges an atom of one type with an atom
|
||||
of a different given type. In other words, the relative mole fractions
|
||||
of the swapped atoms remains constant. Whereas in the semi-grand
|
||||
canonical ensemble, the composition of the system can change. Note
|
||||
that when using *semi-grand*, atoms in the fix group whose type is not
|
||||
listed in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch the selected atom (if
|
||||
eligible) to one of the other listed types with equal
|
||||
probability. Acceptance of each attempt depends upon the Metropolis
|
||||
criterion.
|
||||
|
||||
The *mu* keyword allows users to specify chemical
|
||||
potentials. This is required and allowed only when using *semi-grand*\ .
|
||||
All chemical potentials are absolute, so there is one for
|
||||
each swap type listed following the *types* keyword.
|
||||
In semi-grand canonical ensemble simulations the chemical composition
|
||||
of the system is controlled by the difference in these values. So
|
||||
shifting all values by a constant amount will have no effect
|
||||
on the simulation.
|
||||
The *mu* keyword allows users to specify chemical potentials. This is
|
||||
required and allowed only when using *semi-grand*\ . All chemical
|
||||
potentials are absolute, so there is one for each swap type listed
|
||||
following the *types* keyword. In semi-grand canonical ensemble
|
||||
simulations the chemical composition of the system is controlled by
|
||||
the difference in these values. So shifting all values by a constant
|
||||
amount will have no effect on the simulation.
|
||||
|
||||
This command may optionally use the *region* keyword to define swap
|
||||
volume. The specified region must have been previously defined with a
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\ .
|
||||
Swap attempts occur only between atoms that are both within the
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\
|
||||
. Swap attempts occur only between atoms that are both within the
|
||||
specified region. Swaps are not otherwise attempted.
|
||||
|
||||
You should ensure you do not swap atoms belonging to a molecule, or
|
||||
LAMMPS will soon generate an error when it tries to find those atoms.
|
||||
LAMMPS will warn you if any of the atoms eligible for swapping have a
|
||||
non-zero molecule ID, but does not check for this at the time of
|
||||
LAMMPS will eventually generate an error when it tries to find those
|
||||
atoms. LAMMPS will warn you if any of the atoms eligible for swapping
|
||||
have a non-zero molecule ID, but does not check for this at the time of
|
||||
swapping.
|
||||
|
||||
If not using *semi-grand* this fix checks to ensure all atoms of the
|
||||
given types have the same atomic charge. LAMMPS does not enforce this
|
||||
in general, but it is needed for this fix to simplify the
|
||||
swapping procedure. Successful swaps will swap the atom type and charge
|
||||
of the swapped atoms. Conversely, when using *semi-grand*, it is assumed that all the atom
|
||||
types involved in switches have the same charge. Otherwise, charge
|
||||
would not be conserved. As a consequence, no checks on atomic charges are
|
||||
performed, and successful switches update the atom type but not the
|
||||
atom charge. While it is possible to use *semi-grand* with groups of
|
||||
atoms that have different charges, these charges will not be changed when the
|
||||
atom types change.
|
||||
in general, but it is needed for this fix to simplify the swapping
|
||||
procedure. Successful swaps will swap the atom type and charge of the
|
||||
swapped atoms. Conversely, when using *semi-grand*, it is assumed that
|
||||
all the atom types involved in switches have the same
|
||||
charge. Otherwise, charge would not be conserved. As a consequence, no
|
||||
checks on atomic charges are performed, and successful switches update
|
||||
the atom type but not the atom charge. While it is possible to use
|
||||
*semi-grand* with groups of atoms that have different charges, these
|
||||
charges will not be changed when the atom types change.
|
||||
|
||||
Since this fix computes total potential energies before and after
|
||||
proposed swaps, so even complicated potential energy calculations are
|
||||
@ -133,23 +133,24 @@ OK, including the following:
|
||||
Some fixes have an associated potential energy. Examples of such fixes
|
||||
include: :doc:`efield <fix_efield>`, :doc:`gravity <fix_gravity>`,
|
||||
:doc:`addforce <fix_addforce>`, :doc:`langevin <fix_langevin>`,
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen <fix_temp_berendsen>`,
|
||||
:doc:`temp/rescale <fix_temp_rescale>`, and :doc:`wall fixes <fix_wall>`.
|
||||
For that energy to be included in the total potential energy of the
|
||||
system (the quantity used when performing GCMC moves),
|
||||
you MUST enable the :doc:`fix_modify <fix_modify>` *energy* option for
|
||||
that fix. The doc pages for individual :doc:`fix <fix>` commands
|
||||
specify if this should be done.
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen
|
||||
<fix_temp_berendsen>`, :doc:`temp/rescale <fix_temp_rescale>`, and
|
||||
:doc:`wall fixes <fix_wall>`. For that energy to be included in the
|
||||
total potential energy of the system (the quantity used when
|
||||
performing GCMC moves), you MUST enable the :doc:`fix_modify
|
||||
<fix_modify>` *energy* option for that fix. The doc pages for
|
||||
individual :doc:`fix <fix>` commands specify if this should be done.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
|
||||
number generator seed, the next timestep for MC exchanges, the number
|
||||
of exchange attempts and successes etc. See
|
||||
the :doc:`read_restart <read_restart>` command for info on how to
|
||||
re-specify a fix in an input script that reads a restart file, so that
|
||||
the operation of the fix continues in an uninterrupted fashion.
|
||||
This fix writes the state of the fix to :doc:`binary restart files
|
||||
<restart>`. This includes information about the random number
|
||||
generator seed, the next timestep for MC exchanges, the number of
|
||||
exchange attempts and successes etc. See the :doc:`read_restart
|
||||
<read_restart>` command for info on how to re-specify a fix in an
|
||||
input script that reads a restart file, so that the operation of the
|
||||
fix continues in an uninterrupted fashion.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -165,12 +166,13 @@ by various :doc:`output commands <Howto_output>`. The vector values are
|
||||
the following global cumulative quantities:
|
||||
|
||||
* 1 = swap attempts
|
||||
* 2 = swap successes
|
||||
* 2 = swap accepts
|
||||
|
||||
The vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
@ -184,7 +186,8 @@ Related commands
|
||||
|
||||
:doc:`fix nvt <fix_nh>`, :doc:`neighbor <neighbor>`,
|
||||
:doc:`fix deposit <fix_deposit>`, :doc:`fix evaporate <fix_evaporate>`,
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`,
|
||||
:doc:`fix mol/swap <fix_mol_swap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user