{"id":308822,"date":"2020-08-21T15:00:30","date_gmt":"2020-08-21T15:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308822"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308822","title":{"rendered":"\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u043d\u0430 CUDA. \u0427\u0430\u0441\u0442\u044c III: \u0412\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/516118\/\">\u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443, \u0433\u0434\u0435 \u0437\u0430\u043a\u043e\u043d\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/post\/508396\/\">\u0442\u0438\u043f\u0430 \u0447\u0430\u0441\u0442\u0438\u0446<\/a> \u0438\u043b\u0438 \u043e\u0442 \u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/post\/509878\/\">\u0437\u0430\u0440\u044f\u0434\u0430<\/a>. \u0414\u043b\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 (\u0430\u0442\u043e\u043c\u0430\u043c\u0438) \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043b\u0438 \u0430\u0442\u043e\u043c\u044b \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442 (\u0442\u043e\u0447\u043d\u0435\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043b\u0438 \u043e\u043d\u0438 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0434\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b68\/591\/a7e\/b68591a7e78c95af570af778e469f77f.jpg\" alt=\"image\"><br \/>  \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043e\u0434\u043e\u0440\u043e\u0434 \u0441 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u043d\u0435\u0436\u0435\u043b\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434 \u0441 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u043e\u043c \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u0412\u041d\u0423\u0422\u0420\u0418\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 (intramolecular) \u0438 \u041c\u0415\u0416\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 (intermolecular) \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041c\u0435\u0436\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0438 \u041a\u0443\u043b\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u043d\u044b\u043c\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430\u043c\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0447\u044c \u0448\u043b\u0430 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u2013 \u044d\u0442\u043e \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 (\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435) \u0441\u0432\u044f\u0437\u0438. \u0425\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u043e\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0430\u0442\u043e\u043c\u0430\u043c\u0438, \u0442.\u0435., \u043f\u043e \u0441\u0443\u0442\u0438, \u0442\u0435\u043c \u0436\u0435 \u043f\u0430\u0440\u043d\u044b\u043c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u043c. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0430\u0440\u043d\u044b\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432, \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0447\u0430\u0441\u0442\u0438\u0446, \u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043f\u0430\u0440\u044b \u0447\u0430\u0441\u0442\u0438\u0446 (\u043f\u043e \u0438\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c). \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u2014 \u044d\u0442\u043e \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/41d\/883\/392\/41d883392e6a88e6bb68f4a651d45a23.svg\" alt=\"$U=\\frac12k(r-r_0)^2,$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0433\u0434\u0435 r \u2013 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438, k \u2013 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u0441\u0442\u0438 \u0441\u0432\u044f\u0437\u0438, \u0430 r<sub>0<\/sub> \u2013 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0441\u0432\u044f\u0437\u0438; \u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BE%D1%82%D0%B5%D0%BD%D1%86%D0%B8%D0%B0%D0%BB_%D0%9C%D0%BE%D1%80%D0%B7%D0%B5\" rel=\"nofollow\">\u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u041c\u043e\u0440\u0437\u0435<\/a>:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9d9\/99f\/ad9\/9d999fad9ba5e7e372ad9bf9c13539bb.svg\" alt=\"$U=D(1-\\exp(-\\alpha(r-r_0)))^2,$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0433\u0434\u0435 D \u2013 \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044f\u043c\u044b, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u03b1 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044f\u043c\u044b. <br \/>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u2013 \u044d\u0442\u043e \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b. \u041e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u043a \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0443\u0433\u043e\u043b\u043a\u043e\u043c, \u0432\u0435\u0434\u044c \u0441\u0438\u043b\u044b \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u0441\u0442\u0430\u0442\u0438\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u043e\u043d\u0430\u043c\u0438 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0433\u043b\u0443 H-O-H \u0440\u0430\u0432\u043d\u043e\u043c\u0443 180\u00b0? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043e \u043d\u0435 \u0432\u0441\u0435. \u0418\u0437 \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u0445\u0438\u043c\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 2 \u043d\u0435\u043f\u043e\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u044b, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438 \u0438\u0441\u043a\u0430\u0436\u0430\u0435\u0442 \u0443\u0433\u043e\u043b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5c0\/180\/fb9\/5c0180fb934bfb309ed3a4de54f5f59e.png\" alt=\"image\"><br \/>  \u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0432\u0432\u043e\u0434\u044f\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u043a \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u044b \u0438\u043b\u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u0438 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445\u00bb \u0443\u0433\u043b\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0430, \u0442.\u0435. \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u043e\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 3\u0445 \u0447\u0430\u0441\u0442\u0438\u0446. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0441\u0438\u043d\u0443\u0441:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ffc\/c5f\/1da\/ffcc5f1da2cfa835c4f44347ac868756.svg\" alt=\"$U=\\frac12k(\\theta-\\theta_0)^2,$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0433\u0434\u0435 \u03b8 \u2013 \u0443\u0433\u043e\u043b \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0446, k \u2013 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u0441\u0442\u0438, \u0430 \u03b8<sub>0<\/sub> \u2013 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0443\u0433\u043e\u043b.<br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/studref.com\/539482\/matematika_himiya_fizik\/konformatsii_konformery\" rel=\"nofollow\">\u0442\u043e\u0440\u0441\u0438\u043e\u043d\u043d\u044b\u0435 \u0443\u0433\u043b\u044b<\/a>, \u043d\u043e \u043e\u043d\u0438 \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u0447\u0435\u043c \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b.<br \/>  \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 \u2014 \u0434\u0435\u043b\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435. \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0435\u0439 \u0445\u0440\u0430\u043d\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0438\u0446 \u0438 \u0442\u0438\u043f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u0432\u044b\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0441\u0432\u044f\u0437\u0435\u0439 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0441\u0435\u0431\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0436\u0438\u0437\u043d\u044c \u0437\u0430\u0434\u0430\u0447\u0443: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b runtime. \u042d\u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u0438\u0437 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0418\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/lammps.sandia.gov\/\" rel=\"nofollow\">LAMMPS<\/a>, <a href=\"https:\/\/www.scd.stfc.ac.uk\/Pages\/DL_POLY.aspx\" rel=\"nofollow\">DL_POLY<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/www.gromacs.org\/\" rel=\"nofollow\">GROMACS <\/a>, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<br \/>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:   <\/p>\n<pre><code class=\"cpp\">    \/\/bonds:     int nBond;      \t\t\/\/ number of bonds     int mxBond;          \t\/\/ maximal number of bonds     int4* bonds;    \t\t\/\/ array of bonds      int* nbonds;    \t\t\/\/ count of bond for a given atom     int* neighToBind;   \t\/\/ a neighbor of a given atom for binding     int* canBind;       \t\/\/ flags that atom[iat] can be bind     int* r2Min;         \t\/\/ distances for the nearest neighbor (used for binding)     int* parents;       \t\/\/ indexes of one of the atom bonded with a given     cudaBond* bondTypes; \t     int** def_bonds;    \t\/\/ array[nSpec][nSpec] of default bond types     int** bindBonds;    \t\/\/ array[nSpec][nSpec] bond types created by binding     float** bindR2;        \/\/ square of binding distance [nSpec][nSpec]      \/\/angles:     int nAngle;    \t\t\/\/ number of angles     int mxAngle;     int4* angles;   \t\t\/\/ array of angles       int* nangles;        \t\/\/ number of angles for given atom     int* oldTypes;           cudaAngle* angleTypes;      int* specAngles;    \t\/\/ [nSp] angle type formed by given species <\/code><\/pre>\n<p>  \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0443\u0433\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u043f\u043e\u043b\u044f <b>nBond<\/b> \u0438 <b>mxBond<\/b>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435. \u041c\u0430\u0441\u0441\u0438\u0432 <b>bonds<\/b> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0430\u0442\u043e\u043c\u043e\u0432, \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438 \u0438 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0438 (\u0435\u0441\u043b\u0438 \u043d\u0430\u0441 \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430, \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u0441\u0432\u044f\u0437\u0438). \u041c\u0430\u0441\u0441\u0438\u0432 <b>angles <\/b>\u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0442\u043e\u043c\u043e\u0432, \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 \u0443\u0433\u043e\u043b, \u0438 \u0442\u0438\u043f \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0430. \u041c\u0430\u0441\u0441\u0438\u0432\u044b <b>bondTypes <\/b>\u0438 <b>angleTypes <\/b>\u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0443\u0433\u043b\u043e\u0432. \u0412\u043e\u0442 \u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:  <\/p>\n<pre><code class=\"cpp\">struct cudaBond {     int type;  \t\t\/\/ potential type     int spec1, spec2; \t\/\/ type of atoms that connected by this bond type     int new_type[2];      \t\/\/ bond type after mutation     int new_spec1[2], new_spec2[2];     int mxEx, mnEx;     \t\/\/ flags: maximum or minimum of bond length exists      float p0, p1, p2, p3, p4;    \/\/ potential parameters     float r2min, r2max;          \/\/ square of minimal and maximal bond length     float (*force_eng)(float r2, float r, float &amp;eng, cudaBond *bond); \/\/ return energy       int count;     \t\t \/\/ quantity of such bonds     float rSumm;       \t \/\/ summ of lentghs (for mean length calculation)     int rCount;         \t \/\/ number of measured lengths (for mean length calculation)     int ltSumm, ltCount;    \/\/ for calculation of lifetime };  struct cudaAngle {     int type; \t\t\/\/ potential type     float p0, p1, p2;    \t\/\/ potential parameters      void (*force_eng)(int4* angle, cudaAngle* type, cudaMD* md, float&amp; eng); }; <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 <b>type <\/b>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0443 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430, <b>new_type<\/b>, <b>new_spec1 <\/b>\u0438 <b>new_spec <\/b>\u2013 \u044d\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0442\u0438\u043f\u0430 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0430\u0442\u043e\u043c\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f (\u043e\u0431\u043e\u0440\u0432\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u0441\u0432\u044f\u0437\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430). \u042d\u0442\u0438 \u043f\u043e\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u0434\u0432\u0443\u043c\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u043e\u0440\u043e\u0447\u0435 <b>r2min<\/b><sup>1\/2<\/sup>, \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 <b>r2max<\/b><sup>1\/2<\/sup>. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u2013 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432\u0441\u0435\u0445 \u0441\u0432\u044f\u0437\u0435\u0439, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0445 \u043e\u0431\u0440\u044b\u0432\u0430 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043e\u0440\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0430\u0442\u043e\u043c\u043e\u0432. \u041f\u043e\u044f\u0441\u043d\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u043e\u0439 \u0436\u0435 \u0432\u043e\u0434\u044b. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u0430, \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u044b \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0430\u043c\u0438 \u043e\u0431\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u0430 \u0438 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0430. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u0440\u044f\u0434\u044b \u043d\u0430 \u0430\u0442\u043e\u043c\u0430\u0445 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u0430 \u0438 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0435 (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0430 \u043a \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043b\u044e\u0441, \u03b4+, \u0430 \u043d\u0430 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0435 \u2013 2\u03b4-). \u0415\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u044c, \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0435\u0440\u0435\u0442 \u0441\u0435\u0431\u0435 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d, \u0430 \u0432\u043e\u0434\u043e\u0440\u043e\u0434 \u2013 \u0435\u0433\u043e \u043e\u0442\u0434\u0430\u0441\u0442. \u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u0438\u0446\u044b H<sup>+<\/sup> \u0438 O<sup>&#8212;<\/sup>. \u0418\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 5 \u0442\u0438\u043f\u043e\u0432 \u0447\u0430\u0441\u0442\u0438\u0446, \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0438\u0445: H, H<sup>+<\/sup>, O, O<sup>&#8212;<\/sup>, O<sup>2-<\/sup>. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0442\u043e\u0440\u0432\u0435\u043c \u043e\u0431\u0430 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u0430 \u043e\u0442 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b \u0432\u043e\u0434\u044b. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0435\u0430\u043a\u0446\u0438\u0438:<br \/>  H<sub>2<\/sub>O -&gt; H<sup>+<\/sup> + OH<sup>&#8212;<\/sup><br \/>  \u0438<br \/>  OH<sup>&#8212;<\/sup> -&gt; H<sup>+<\/sup> + O<sup>2-<\/sup>.<br \/>  \u0417\u043d\u0430\u0442\u043e\u043a\u0438 \u0445\u0438\u043c\u0438\u0438 \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u044f\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0434\u043b\u044f \u0432\u043e\u0434\u044b \u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u0442\u043e \u0441\u0442\u0430\u0434\u0438\u044f \u0440\u0430\u0441\u043f\u0430\u0434\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f (\u0432 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0430 \u0438\u0437 10<sup>7<\/sup> \u0434\u0438\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0438\u043e\u043d\u044b, \u0434\u0430 \u0438 \u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e). \u041d\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0442\u0430\u043a\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u043d\u0443 \u0441\u0432\u044f\u0437\u044c \u0432 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0435 \u0432\u043e\u0434\u044b, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u2013 \u0432\u0442\u043e\u0440\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u044d\u0442\u043e\u0439 \u0436\u0435 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b. \u0418 \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0431\u0435 \u0441\u0432\u044f\u0437\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u0442\u044c. \u0422\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0430\u0442\u043e\u043c\u044b \u0432 H<sup>+<\/sup> \u0438 O<sup>&#8212;<\/sup>, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432 H<sup>+<\/sup> \u0438 O<sup>2-<\/sup>. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 O \u0438 \u043e\u0431\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0435\u0433\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0432 O<sup>&#8212;<\/sup>, \u0447\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e. \u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c. \u0411\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0432\u044f\u0437\u044c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ws\/wb\/76\/wswb76ve4fnck3lrrpd4tzg-jyw.png\"><br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u0430\u0442\u043e\u043c\u043e\u0432 \u0442\u0438\u043f\u0443 \u0441\u0432\u044f\u0437\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 (\u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430), \u0434\u0430\u043b\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0430\u0442\u043e\u043c\u0430\u043c\u0438 (r<sup>2<\/sup>) \u0438, \u0435\u0441\u043b\u0438 \u0441\u0432\u044f\u0437\u044c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u0438\u043d\u0443, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435 \u0432\u044b\u0448\u043b\u0438 \u043b\u0438 \u043c\u044b \u0437\u0430 \u044d\u0442\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0448\u043b\u0438, \u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0451 \u0438 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0438\u043f\u044b \u0430\u0442\u043e\u043c\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>atomicCAS <\/i>\u2013 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0442\u0438\u043f \u0430\u0442\u043e\u043c\u0430 \u0441 \u0442\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439. \u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u0430\u0442\u043e\u043c\u0430 \u0443\u0436\u0435 \u0431\u044b\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e, \u043a \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430 \u0441\u0432\u044f\u0437\u0438. \u041d\u0430\u0438\u0445\u0443\u0434\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0442\u043e\u043c\u0430 \u043c\u044b \u0443\u0441\u043f\u0435\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c, \u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u2013 \u043d\u0435\u0442. \u041e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u0443\u0436\u0435 \u043f\u043e\u0437\u0434\u043d\u043e, \u0432\u0435\u0434\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0442\u043e\u043c, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0443\u0436\u0435 \u043c\u043e\u0433\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441 \u043d\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041a\u0430\u043a\u043e\u0439 \u0436\u0435 \u0432\u044b\u0445\u043e\u0434? \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u0438\u0442\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u0440\u0432\u0451\u043c\/\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0432\u044f\u0437\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0430 \u043d\u0435 \u0442\u043e\u0433\u043e, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0437\u044f\u043b\u0438\u0441\u044c \u0432\u043d\u0430\u0447\u0430\u043b\u0435. \u041d\u0430\u0445\u043e\u0434\u0438\u043c, \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0431\u044b\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0442\u043e\u043c\u043e\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u043c \u0432\u0442\u043e\u0440\u044b\u043c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0451 \u043f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u0447\u0442\u043e \u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0443\u044e. \u0415\u0441\u043b\u0438 \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0438\u043f \u0430\u0442\u043e\u043c\u0430 \u0441\u043d\u043e\u0432\u0430 \u0443\u0441\u043f\u0435\u043b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u2013 \u0441\u043d\u043e\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u0436\u0435 \u0441\u0445\u0435\u043c\u0443. \u0422\u0443\u0442 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u2013 \u0440\u0432\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0442\u043e\u0439 \u0436\u0435 \u0434\u043b\u0438\u043d\u0435 \u0438 \u0442.\u0434., \u0430 \u0447\u0430\u0441\u0442\u0438\u0446\u044b, \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0445\u043e\u0434\u0435 \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a\u0438\u0435 \u043d\u0443\u0436\u043d\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0437\u0430\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043c\u044b \u043a\u0430\u043a \u0431\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u043d\u0435\u0433\u043e, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u041a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">__global__ void apply_bonds(int iStep, int bndPerBlock, int bndPerThread, cudaMD* md) {     int def;     int id1, id2;       \/\/ atom indexes     int old, old_spec2, spec1, spec2, new_spec1, new_spec2;     \/\/ atom types     int new_bond_type;          int save_lt, need_r, loop;    \/\/ flags to save lifetime, to need to calculate r^2 and to be in \u2018while\u2019 loop     int mnmx;   \/\/ flag minimum or maximum     int action; \/\/ flag: 0 - do nothing, 1 - delete bond, 2 - transform bond     cudaBond *old_bnd, *cur_bnd;\t\/\/ old bond type, current bond type     float dx, dy, dz, r2, r;     float f, eng = 0.0f;     __shared__ float shEng; #ifdef DEBUG_MODE     int cnt;    \/\/ count of change spec2 loops #endif       if (threadIdx.x == 0)     {         shEng = 0.0f;     }     __syncthreads();      int id0 = blockIdx.x * bndPerBlock + threadIdx.x * bndPerThread;     int N = min(id0 + bndPerThread, md-&gt;nBond);     int iBnd;      for (iBnd = id0; iBnd &lt; N; iBnd++)       if (md-&gt;bonds[iBnd].z)  \/\/ the bond is not broken       {           \/\/ atom indexes           id1 = md-&gt;bonds[iBnd].x;           id2 = md-&gt;bonds[iBnd].y;            \/\/ atom types           spec1 = md-&gt;types[id1];           spec2 = md-&gt;types[id2];            old_bnd = &amp;(md-&gt;bondTypes[md-&gt;bonds[iBnd].z]);           cur_bnd = old_bnd;            save_lt = 0;           need_r = 1;           loop = 1; #ifdef DEBUG_MODE           cnt = 0; #endif                      if ((cur_bnd-&gt;spec1 == spec1)&amp;&amp;(cur_bnd-&gt;spec2 == spec2))           {               \/\/ok           }           else               if ((cur_bnd-&gt;spec1 == spec2) &amp;&amp; (cur_bnd-&gt;spec2 == spec1))               {                   invert_bond(id1, id2, spec1, spec2, &amp;(md-&gt;bonds[iBnd]));                   \/\/... then ok               }               else \/\/ atom types do not correspond to bond types               {                   save_lt = 1;               }            \/\/ end initial stage           while (loop)           {              if (save_lt)                     {                   def = md-&gt;def_bonds[spec1][spec2];                   if (def == 0)     \/\/ these atom types do not form a bond                   { #ifdef DEBUG_MODE                       printf(&quot;probably, something goes wrong\\n&quot;); #endif                       action = 1;   \/\/ delete                       break;                   }                   else                   {                       \/\/! change bond type and go on                       if (def &lt; 0)                         {                           invert_bond(id1, id2, spec1, spec2, &amp;(md-&gt;bonds[iBnd]));                           def = -def;                       }                        md-&gt;bonds[iBnd].z = def;                       cur_bnd = &amp;(md-&gt;bondTypes[def]);                   }              }  \/\/ end if (save_lt)               \/\/ calculate distance (only once)              if (need_r)              {                 dx = md-&gt;xyz[id1].x - md-&gt;xyz[id2].x;                 dy = md-&gt;xyz[id1].y - md-&gt;xyz[id2].y;                 dz = md-&gt;xyz[id1].z - md-&gt;xyz[id2].z;                 delta_periodic(dx, dy, dz, md);                 r2 = dx * dx + dy * dy + dz * dz;                 need_r = 0;              }               action = 0;   \/\/ 0 - just cultivate bond 1 - delete bond 2 - transform bond              if ((cur_bnd-&gt;mxEx) &amp;&amp; (r2 &gt; cur_bnd-&gt;r2max))              {                  mnmx = 1;                  if (cur_bnd-&gt;new_type[mnmx] == 0)  \/\/ delete bond                    action = 1;                 else                    action = 2;   \/\/ modify bond              }              else if ((cur_bnd-&gt;mnEx) &amp;&amp; (r2 &lt; cur_bnd-&gt;r2min))              {                  mnmx = 0;                  action = 2;   \/\/ at minimum only bond modification possible              }              \/\/ end select action               \/\/ try to change atom types (if needed)              if (action)              {                  save_lt = 1;                  new_spec1 = cur_bnd-&gt;new_spec1[mnmx];                  new_spec2 = cur_bnd-&gt;new_spec2[mnmx];                   \/\/the first atom                  old = atomicCAS(&amp;(md-&gt;types[id1]), spec1, new_spec1);                  if (old != spec1)                  {                      spec1 = old;                      spec2 = md-&gt;types[id2];   \/\/ refresh type of the 2nd atom                       \/\/ return to begin of the \u2018while\u2019 loop                  }                  else      \/\/ types[id1] have been changed                  { #ifdef USE_NEWANG   \/\/ save changes in atom type                      atomicCAS(&amp;(md-&gt;oldTypes[id1]), -1, spec1); #endif                      old_spec2 = spec2;                      while ((old = atomicCAS(&amp;(md-&gt;types[id2]), old_spec2, new_spec2)) != old_spec2)                      {                          \/\/! the worst variant: this thread changes atom 1, other thread changes atom 2                          \/\/ imagine that we had A-old bond with the same behavior                          def = md-&gt;def_bonds[spec1][old]; #ifdef DEBUG_MODE                          if (def == 0)                          {                              printf(&quot;UBEH[001]: in apply_bonds, change atom types. There are no bond types between Species[%d] and [%d]\\n&quot;, spec1, old);                              break;                          } #endif                          if (def &lt; 0)  \/\/ spec1 -&gt; new_spec2 spec2 -&gt; newSpec1                          {                              cur_bnd = &amp;(md-&gt;bondTypes[-def]);                              new_spec2 = cur_bnd-&gt;new_spec1[mnmx];                          }                          else \/\/ direct order                          {                              cur_bnd = &amp;(md-&gt;bondTypes[def]);                              new_spec2 = cur_bnd-&gt;new_spec2[mnmx];                          }                          old_spec2 = old; #ifdef DEBUG_MODE                          cnt++;                          if (cnt &gt; 10)                          {                              printf(&quot;UBEH[002]: too many atempst to change spec2 = %d\\n&quot;, spec2);                              break;                          } #endif                      } #ifdef USE_NEWANG   \/\/ save changes in atom type                      atomicCAS(&amp;(md-&gt;oldTypes[id2]), -1, spec2); #endif                      loop = 0;                  }                   \/\/end change types               } \/\/ end if (action)              else                loop = 0;    \/\/ action == 0, out of cycle            }  \/\/ end while(loop)             if (action == 2)           {               new_bond_type = cur_bnd-&gt;new_type[mnmx];               if (new_bond_type &lt; 0)               {                   md-&gt;bonds[iBnd].x = id2;                   md-&gt;bonds[iBnd].y = id1;                   new_bond_type = -new_bond_type;               }               md-&gt;bonds[iBnd].z = new_bond_type;               cur_bnd = &amp;(md-&gt;bondTypes[new_bond_type]);           }            \/\/ perform calculations and save mean bond length           if (action != 1)  \/\/ not delete           {               r = sqrt(r2);               f = cur_bnd-&gt;force_eng(r2, r, eng, cur_bnd);               atomicAdd(&amp;(md-&gt;frs[id1].x), f * dx);               atomicAdd(&amp;(md-&gt;frs[id2].x), -f * dx);               atomicAdd(&amp;(md-&gt;frs[id1].y), f * dy);               atomicAdd(&amp;(md-&gt;frs[id2].y), -f * dy);               atomicAdd(&amp;(md-&gt;frs[id1].z), f * dz);               atomicAdd(&amp;(md-&gt;frs[id2].z), -f * dz);                              atomicAdd(&amp;(cur_bnd-&gt;rSumm), r);               atomicAdd(&amp;(cur_bnd-&gt;rCount), 1);           }           else      \/\/delete bond           { \t\t\/\/ decrease the number of bonds for atoms               atomicSub(&amp;(md-&gt;nbonds[id1]), 1);               atomicSub(&amp;(md-&gt;nbonds[id2]), 1);               md-&gt;bonds[iBnd].z = 0;                \/\/ change parents               exclude_parents(id1, id2, md);           }            if (save_lt)           {               keep_bndlifetime(iStep, &amp;(md-&gt;bonds[iBnd]), old_bnd);               if (action != 1) \/\/ not delete                 atomicAdd(&amp;(cur_bnd-&gt;count), 1);               atomicSub(&amp;(old_bnd-&gt;count), 1);           }         } \/\/ end main loop        \/\/ split energy to shared and then to global memory       atomicAdd(&amp;shEng, eng);       __syncthreads();       if (threadIdx.x == 0)           atomicAdd(&amp;(md-&gt;engBond), shEng); } <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0442\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u043d\u0435\u0434\u043e\u0441\u043c\u043e\u0442\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u0441\u0445\u0435\u043c\u0443, \u043d\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0435\u0449\u0451 \u0432 \u043e\u0434\u0438\u043d \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u0442 \u043f\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u0441\u0432\u044f\u0437\u0435\u0439, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a. \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u0438\u043f\u0430 \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0442\u043e\u043c\u043e\u0432 \u0432 \u0441\u0432\u044f\u0437\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0432\u044f\u0437\u044c O-H \u0438 H-O \u2013 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0441\u0432\u044f\u0437\u044c, \u043d\u043e \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0430\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0441 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u043a\u043e\u043c), \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>invert_bond<\/i>, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f, \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <i>delta_periodic <\/i>\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043a \u0440\u0430\u0437\u043d\u0438\u0446\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u044f\u0437\u0438, \u043d\u043e \u0438 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b (\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <b>USE_NEWANG<\/b>), \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u0430\u0442\u043e\u043c\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u0442\u0438\u043f (\u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u0430\u043b\u0435\u0435). \u0414\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0430\u0442\u043e\u043c\u043e\u0432 \u0441\u0432\u044f\u0437\u044c\u044e, \u043c\u0430\u0441\u0441\u0438\u0432 parents \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0430\u0442\u043e\u043c\u043e\u0432 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c (\u044d\u0442\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043d\u043e \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e). \u0415\u0441\u043b\u0438 \u043c\u044b \u0440\u0432\u0435\u043c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u0432\u044f\u0437\u044c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 parents \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0430\u0442\u043e\u043c\u043e\u0432, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>exclude_parents<\/i>:  <\/p>\n<pre><code class=\"cpp\">__device__ void exclude_parents(int id1, int id2, cudaMD* md) \/\/ exclude id1 and id2 from parents of each other (if they are) \/\/  and seek other parents if able {     \/\/ flags to clear parent     int clear_1 = 0;         int clear_2 = 0;      int i, flag;          if (md-&gt;parents[id1] == id2)          clear_1 = 1;     if (md-&gt;parents[id2] == id1)         clear_2 = 1;      i = 0;     while ((i &lt; md-&gt;nBond) &amp;&amp; (clear_1 || clear_2))     {         if (md-&gt;bonds[i].z != 0)         {             flag = 0;             if (clear_1)             {                 if (md-&gt;bonds[i].x == id1)                 {                     md-&gt;parents[id1] = md-&gt;bonds[i].y;                     flag = 1;                 }                 else if (md-&gt;bonds[i].y == id1)                 {                     md-&gt;parents[id1] = md-&gt;bonds[i].y;                     flag = 1;                 }                  if (flag)                 {                     clear_1 = 0;                     i++;                     continue;                 }             }             if (clear_2)             {                 if (md-&gt;bonds[i].x == id2)                 {                     md-&gt;parents[id2] = md-&gt;bonds[i].y;                     flag = 1;                 }                 else if (md-&gt;bonds[i].y == id2)                 {                     md-&gt;parents[id2] = md-&gt;bonds[i].y;                     flag = 1;                 }                  if (flag)                 {                     clear_2 = 0;                     i++;                     continue;                 }             }         }         i++;     }      \/\/ be on the safe side     if (clear_1)    \t         md-&gt;parents[id1] = -1;     if (clear_2)         md-&gt;parents[id2] = -1;  } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u0442 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0441\u0432\u044f\u0437\u0435\u0439. \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u0438 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u0430\u0442\u043e\u043c\u044b, \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438:  <\/p>\n<pre><code class=\"cpp\">__device__ void try_to_bind(float r2, int id1, int id2, int spec1, int spec2, cudaMD *md) {     int r2Int;      \/\/  (int)r2 * const      \/\/ save parents to exclude re-linking     if (md-&gt;parents[id1] == id2)         return;     if (md-&gt;parents[id2] == id1)         return;      if (md-&gt;bindBonds[spec1][spec2] != 0)     {         if (r2 &lt; md-&gt;bindR2[spec1][spec2])         {             r2Int = (int)(r2 * 100);             if (atomicMin(&amp;(md-&gt;r2Min[id1]), r2Int) &gt; r2Int)    \/\/ replace was sucessfull             {                 md-&gt;neighToBind[id1] = id2 + 1;     \/\/ as 0 is reserved for no neighbour                 md-&gt;canBind[id1] = 1;             }              \/\/ similar for the second atom             if (atomicMin(&amp;(md-&gt;r2Min[id2]), r2Int) &gt; r2Int)    \/\/ replace was sucessfull             {                 md-&gt;neighToBind[id2] = id1 + 1;     \/\/ as 0 is reserved for no bind                 md-&gt;canBind[id2] = 1;             }         }     } } <\/code><\/pre>\n<p>  \u0412 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 <b>bindBonds <\/b>\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043c\u043e\u0433\u0443\u0442 \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0430\u0442\u043e\u043c\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u0438 \u0435\u0441\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u2013 \u0442\u043e \u043a\u0430\u043a\u0443\u044e. \u0412 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 <b>bindR2 <\/b>\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0430\u0442\u043e\u043c\u0430\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435, \u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435\u0442 \u043b\u0438 \u0443 \u0430\u0442\u043e\u043c\u043e\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043f\u043e\u0431\u043b\u0438\u0436\u0435. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0434\u043e \u0441\u043e\u0441\u0435\u0434\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 <b>r2Min <\/b>(\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f int \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, 100). \u0415\u0441\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043e\u0441\u0435\u0434 \u2013 \u043d\u0430\u0438\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439, \u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 neighToBind \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0444\u043b\u0430\u0433 <b>canBind<\/b>. \u0415\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0430 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e. \u0414\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445 \u043e\u0431\u0445\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u0430\u043c \u0430\u0442\u043e\u043c\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <i>cell_list <\/i>\u0438\u043b\u0438 <i>all_pair<\/i>, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/508396\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>. \u0421\u0430\u043c\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"cpp\">__global__ void create_bonds(int iStep, int atPerBlock, int atPerThread, cudaMD* md) \/\/ connect atoms which are selected to form bonds {     int id1, id2, nei;    \t\/\/ neighbour index     int btype, bind;    \t\/\/ bond type index and bond index     cudaBond* bnd;     int spec1, spec2;   \t\/\/ species indexes          int id0 = blockIdx.x * atPerBlock + threadIdx.x * atPerThread;     int N = min(id0 + atPerThread, md-&gt;nAt);     int iat;      for (iat = id0; iat &lt; N; iat++)     {         nei = md-&gt;neighToBind[iat];         if (nei)    \/\/ neighbour exists         {             nei--;  \/\/ (nei = spec_index + 1)             if (iat &lt; nei)             {                 id1 = iat;                 id2 = nei;             }             else             {                 id1 = nei;                 id2 = iat;             }                          \/\/ try to lock the first atom             if (atomicCAS(&amp;(md-&gt;canBind[id1]), 1, 0) == 0)  \/\/ the atom is already used                 continue;              \/\/ try to lock the second atom             if (atomicCAS(&amp;(md-&gt;canBind[id2]), 1, 0) == 0)  \/\/ the atom is already used             {                 \/\/ unlock the first one back                 atomicExch(&amp;(md-&gt;canBind[id1]), 1);                 continue;             }              \/\/ create bond iat-nei             bind = atomicAdd(&amp;(md-&gt;nBond), 1); #ifdef DEBUG_MODE             if (bind &gt;= md-&gt;mxBond)             {                 printf(&quot;UBEH[003]: Exceed maximal number of bonds, %d\\n&quot;, md-&gt;mxBond);             } #endif             spec1 = md-&gt;types[id1];             spec2 = md-&gt;types[id2]; #ifdef USE_NEWANG   \/\/ save that we have changed atom type             atomicCAS(&amp;(md-&gt;oldTypes[id1]), -1, spec1);             atomicCAS(&amp;(md-&gt;oldTypes[id2]), -1, spec2); #endif             btype = md-&gt;bindBonds[spec1][spec2];                          if (btype &lt; 0)             {                 \/\/ invert atoms order                 md-&gt;bonds[bind].x = id2;                 md-&gt;bonds[bind].y = id1;                 md-&gt;bonds[bind].z = -btype;                 bnd = &amp;(md-&gt;bondTypes[-btype]);                 \/\/ change atom types according the formed bond                 md-&gt;types[id1] = bnd-&gt;spec2;                 md-&gt;types[id2] = bnd-&gt;spec1;             }             else              {                 md-&gt;bonds[bind].x = id1;                 md-&gt;bonds[bind].y = id2;                 md-&gt;bonds[bind].z = btype;                 bnd = &amp;(md-&gt;bondTypes[btype]);                 \/\/ change atom types according the formed bond                 md-&gt;types[id1] = bnd-&gt;spec1;                 md-&gt;types[id2] = bnd-&gt;spec2;             }                          atomicAdd((&amp;bnd-&gt;count), 1);             md-&gt;bonds[bind].w = iStep;  \/\/ keep time of the bond creation for lifetime calculation              atomicAdd(&amp;(md-&gt;nbonds[id1]), 1);             atomicAdd(&amp;(md-&gt;nbonds[id2]), 1);             \/\/ replace parents if none:             atomicCAS(&amp;(md-&gt;parents[id1]), -1, id2);             atomicCAS(&amp;(md-&gt;parents[id2]), -1, id1);         }      }     \/\/ end loop by atoms } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0430\u0442\u043e\u043c, \u0437\u0430\u0442\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0438, \u0435\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0430, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0434\u0451\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0430\u0442\u043e\u043c\u043e\u0432 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0442\u043e\u043c \u0432 \u043f\u0430\u0440\u0435, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u2013 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0442\u043e\u043c \u0432 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u0440\u0435, \u043e\u0431\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0437\u0430\u0432\u0430\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u044c. \u041d\u0443 \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0435 \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043c\u0435\u0442\u0438\u043b\u0438 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>apply_bonds<\/i>:  <\/p>\n<pre><code class=\"cpp\">__global__ void clear_bonds(cudaMD* md) \/\/ clear bonds with .z == 0 {     int i = 0;     int j = md-&gt;nBond - 1;      while (i &lt; j)     {         while ((md-&gt;bonds[j].z == 0) &amp;&amp; (j &gt; i))             j--;         while ((md-&gt;bonds[i].z != 0) &amp;&amp; (i &lt; j))             i++;         if (i &lt; j)         {             md-&gt;bonds[i] = md-&gt;bonds[j];             md-&gt;bonds[j].z = 0;             i++;             j--;         }     }      if ((i == j) &amp;&amp; (md-&gt;bonds[i].z == 0))         md-&gt;nBond = j;     else         md-&gt;nBond = j + 1; } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u00ab\u0437\u0430\u043d\u0443\u043b\u0435\u043d\u043d\u044b\u0435\u00bb \u0441\u0432\u044f\u0437\u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u043e\u0434 \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439, \u043d\u043e \u044f \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0435\u0441\u0435\u0442 \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442. \u0415\u0449\u0451 \u0437\u0430 \u0431\u043e\u0440\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u043d\u0435\u0440\u0433\u0438\u044e \u0441\u0432\u044f\u0437\u0438 \u0438 \u0441\u0438\u043b\u044b \u043d\u0430 \u0430\u0442\u043e\u043c\u0430\u0445, \u0442\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u043e\u043b\u044f <b>force_eng <\/b>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <b>cudaBond<\/b>, \u043d\u043e \u043e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043f\u0430\u0440\u043d\u044b\u0445 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h2>\u0412\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b<\/h2>\n<p>  \u0421 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438 \u044f \u0432\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0445 \u0443\u0433\u043b\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u0430\u0442\u043e\u043c\u043e\u0432, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0438\u043f \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0442\u043e\u043c \u0432 \u0435\u0433\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u0435. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439: \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0438 \u0442\u0438\u043f \u0430\u0442\u043e\u043c\u0430, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 <b>oldTypes[]<\/b>. \u0420\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0440\u0430\u0432\u0435\u043d \u0447\u0438\u0441\u043b\u0443 \u0430\u0442\u043e\u043c\u043e\u0432, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d -1. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442 \u0442\u0438\u043f \u0430\u0442\u043e\u043c\u0430, \u043e\u043d\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 -1 \u043d\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0423 \u0432\u0441\u0435\u0445 \u0430\u0442\u043e\u043c\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u0442\u0438\u043f, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0443\u0433\u043b\u044b \u0438 \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0432\u044f\u0437\u044f\u043c \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u043e\u043c\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0433\u043b\u044b:  <\/p>\n<pre><code class=\"cpp\">__global__ void refresh_angles(int iStep, int atPerBlock, int atPerThread, cudaMD *md) \/\/ delete old angles and create new ones for atoms which change their type { \tint i, j, n, t, ang; \tint nei[8];\t\t\/\/ bonded neighbors of given atom \tint cnt;\t\t \t \tint id0 = blockIdx.x * atPerBlock + threadIdx.x * atPerThread; \tint N = min(id0 + atPerThread, md-&gt;nAt); \t \tint iat; \tfor (iat = id0; iat &lt; N; iat++) \t\tif (md-&gt;oldTypes[iat] != -1) \t\t{ \t\t\ti = 0; \t\t\tn = md-&gt;nangles[iat]; \t\t\twhile (n &amp;&amp; (i &lt; md-&gt;nAngle)) \t\t\t{ \t\t\t\tif (md-&gt;angles[i].w) \t\t\t\t\tif (md-&gt;angles[i].x == iat) \t\t\t\t\t{ \t\t\t\t\t\tn--; \t\t\t\t\t\tmd-&gt;angles[i].w = 0; \t\t\t\t\t} \t\t\t\ti++; \t\t\t}  \t\t\t\/\/ create new angles \t\t\tt = md-&gt;specAngles[md-&gt;types[iat]];\t\t\/\/ get type of angle, which formed by current atom type \t\t\tif (t &amp;&amp; (md-&gt;nbonds[iat] &gt; 1))\t\t\/\/ atom type supports angle creating and number of bonds is enough \t\t\t{ \t\t\t\t\/\/ search of neighbors by bonds \t\t\t\ti = 0; cnt = 0; \t\t\t\tn = md-&gt;nbonds[iat]; \t\t\t\twhile (n &amp;&amp; (i &lt; md-&gt;nBond)) \t\t\t\t{ \t\t\t\t\tif (md-&gt;bonds[i].z)\t\t\/\/ if bond isn't deleted \t\t\t\t\t{ \t\t\t\t\t\tif (md-&gt;bonds[i].x == iat) \t\t\t\t\t\t{ \t\t\t\t\t\t\tnei[cnt] = md-&gt;bonds[i].y; \t\t\t\t\t\t\tcnt++; \t\t\t\t\t\t\tn--; \t\t\t\t\t\t} \t\t\t\t\t\telse if (md-&gt;bonds[i].y == iat) \t\t\t\t\t\t{ \t\t\t\t\t\t\tnei[cnt] = md-&gt;bonds[i].x; \t\t\t\t\t\t\tcnt++; \t\t\t\t\t\t\tn--; \t\t\t\t\t\t} \t\t\t\t\t} \t\t\t\t\ti++; \t\t\t\t}  \t\t\t\t\/\/ add new angles based on found neighbors: \t\t\t\tfor (i = 0; i &lt; cnt-1; i++) \t\t\t\t\tfor (j = i + 1; j &lt; cnt; j++) \t\t\t\t\t{ \t\t\t\t\t\tang = atomicAdd(&amp;(md-&gt;nAngle), 1); \t\t\t\t\t\tmd-&gt;angles[ang].x = iat; \t\t\t\t\t\tmd-&gt;angles[ang].y = nei[i]; \t\t\t\t\t\tmd-&gt;angles[ang].z = nei[j]; \t\t\t\t\t\tmd-&gt;angles[ang].w = t; \t\t\t\t\t}  \t\t\t\tn = (cnt * (cnt - 1)) \/ 2; \t\t\t} \t\t\tmd-&gt;nangles[iat] = n;  \t\t\t\/\/ reset flag \t\t\tmd-&gt;oldTypes[iat] = -1; \t\t}\t } <\/code><\/pre>\n<p>  \u041c\u0430\u0441\u0441\u0438\u0432 specAngles \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0445 \u0443\u0433\u043b\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0430\u0442\u043e\u043c\u0430. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0438 \u0441\u0438\u043b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0433\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">__global__ void apply_angles(int iStep, int angPerBlock, int angPerThread, cudaMD* md) \/\/ apply valence angle potentials { \tcudaAngle* ang;  \t\/\/ energies of angle potential\t \tfloat eng; \t__shared__ float shEng;  \tif (threadIdx.x == 0) \t\tshEng = 0.0f; \t__syncthreads();  \tint id0 = blockIdx.x * angPerBlock + threadIdx.x * angPerThread; \tint N = min(id0 + angPerThread, md-&gt;nAngle);  \tint i; \tfor (i = id0; i &lt; N; i++) \t\tif (md-&gt;angles[i].w) \t\t{ \t\t\tang = &amp;(md-&gt;angleTypes[md-&gt;angles[i].w]); \t\t\tang-&gt;force_eng(&amp;(md-&gt;angles[i]), ang, md, eng); \t\t}  \t\/\/ split energy to shared and then to global memory \tatomicAdd(&amp;shEng, eng); \t__syncthreads(); \tif (threadIdx.x == 0) \t\tatomicAdd(&amp;(md-&gt;engAngl), shEng); }<\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430 \u0442\u0430\u043a\u0438\u0445 \u0443\u0433\u043b\u043e\u0432, \u0434\u0430\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 <b>force_eng <\/b>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <b>cudaAngle<\/b>:  <\/p>\n<pre><code class=\"cpp\">__device__ void angle_hcos(int4* angle, cudaAngle* type, cudaMD* md, float&amp; eng) \/\/ harmonic cosine valent angle potential: \/\/ U = k \/ 2 * (cos(th)-cos(th0))^ { \tfloat k = type-&gt;p0; \tfloat cos0 = type-&gt;p1;  \t\/\/ indexes of central atom and ligands: \tint c = angle-&gt;x; \tint l1 = angle-&gt;y; \tint l2 = angle-&gt;z;  \t\/\/ vector ij \tfloat xij = md-&gt;xyz[l1].x - md-&gt;xyz[c].x; \tfloat yij = md-&gt;xyz[l1].y - md-&gt;xyz[c].y; \tfloat zij = md-&gt;xyz[l1].z - md-&gt;xyz[c].z; \tdelta_periodic(xij, yij, zij, md); \tfloat r2ij = xij * xij + yij * yij + zij * zij; \tfloat rij = sqrt(r2ij);  \t\/\/ vector ik \tfloat xik = md-&gt;xyz[l2].x - md-&gt;xyz[c].x; \tfloat yik = md-&gt;xyz[l2].y - md-&gt;xyz[c].y; \tfloat zik = md-&gt;xyz[l2].z - md-&gt;xyz[c].z; \tdelta_periodic(xik, yik, zik, md); \tfloat r2ik = xik * xik + yik * yik + zik * zik; \tfloat rik = sqrt(r2ik);  \tfloat cos_th = (xij * xik + yij * yik + zij * zik) \/ rij \/ rik; \tfloat dCos = cos_th - cos0; \/\/ delta cosinus  \tfloat c1 = -k * dCos; \tfloat c2 = 1.0 \/ rij \/ rik;  \tatomicAdd(&amp;(md-&gt;frs[c].x), -c1 * (xik * c2 + xij * c2 - cos_th * (xij \/ r2ij + xik \/ r2ik))); \tatomicAdd(&amp;(md-&gt;frs[c].y), -c1 * (yik * c2 + yij * c2 - cos_th * (yij \/ r2ij + yik \/ r2ik))); \tatomicAdd(&amp;(md-&gt;frs[c].z), -c1 * (zik * c2 + zij * c2 - cos_th * (zij \/ r2ij + zik \/ r2ik)));  \tatomicAdd(&amp;(md-&gt;frs[l1].x), c1 * (xik * c2 - cos_th * xij \/ r2ij)); \tatomicAdd(&amp;(md-&gt;frs[l1].y), c1 * (yik * c2 - cos_th * yij \/ r2ij)); \tatomicAdd(&amp;(md-&gt;frs[l1].z), c1 * (zik * c2 - cos_th * zij \/ r2ij));  \tatomicAdd(&amp;(md-&gt;frs[l2].x), c1 * (xij * c2 - cos_th * xik \/ r2ik)); \tatomicAdd(&amp;(md-&gt;frs[l2].y), c1 * (yij * c2 - cos_th * yik \/ r2ik)); \tatomicAdd(&amp;(md-&gt;frs[l2].z), c1 * (zij * c2 - cos_th * zik \/ r2ik));  \teng += 0.5 * k * dCos * dCos; } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u00ab\u0437\u0430\u043d\u0443\u043b\u0435\u043d\u043d\u044b\u0445\u00bb \u0443\u0433\u043b\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u043e\u043d\u0430 \u043d\u0438\u0447\u0435\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <i>clear_bonds<\/i>.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/h2>\n<p>  \u041d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044f \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u043e\u043b\u0435\u043a\u0443\u043b \u0432\u043e\u0434\u044b \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043e\u043d\u043e\u0432. \u041f\u0430\u0440\u043d\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0437\u0430\u0434\u0430\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0432 \u0444\u043e\u0440\u043c\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430 \u0411\u0443\u043a\u0438\u043d\u0433\u0435\u043c\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430, \u0441 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u043d\u044b\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0440\u0430\u0432\u043d\u044b\u043c \u0434\u043b\u0438\u043d\u0435 \u0441\u0432\u044f\u0437\u0438 H-O \u0432 \u0432\u043e\u0434\u0435, 0.96 \u00c5. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043d\u0430 \u0441 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u0441 \u0432\u0435\u0440\u0448\u0438\u043d\u043e\u0439 \u0432 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u0435. \u041f\u043e\u0441\u043b\u0435 100\u2019000 \u0448\u0430\u0433\u043e\u0432 \u0438\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u043e\u043d\u043e\u0432 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f (\u0441\u043b\u0435\u0432\u0430) \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f (\u0441\u043f\u0440\u0430\u0432\u0430) \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<br \/>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ez\/8g\/tz\/ez8gtznbin-xblmgquotluzon-s.png\"><br \/>  \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442: \u043f\u0443\u0441\u0442\u044c \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u0441\u0435 \u0430\u0442\u043e\u043c\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0438\u0441\u044c \u0440\u044f\u0434\u043e\u043c \u0441 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u043d\u0438 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0441\u0432\u044f\u0437\u044c. \u041f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0430\u0442\u043e\u043c\u0430\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0441\u0432\u044f\u0437\u044c \u043b\u0438\u0431\u043e \u0441\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u0430\u0442\u043e\u043c\u043e\u043c, \u043b\u0438\u0431\u043e \u0441 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u043e\u0439. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0430\u043c\u043e\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f, \u0433\u0434\u0435 \u0430\u0442\u043e\u043c\u044b \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0438:<br \/>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pw\/40\/5e\/pw405emggczrkjth6rbre0-zphe.png\"><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438<\/h2>\n<p>  1. \u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u2013 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0445\u043e\u0442\u044f \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u044d\u043d\u0435\u0440\u0433\u0438\u044f \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043f\u043b\u043e\u0442\u044b. \u0417\u0434\u0435\u0441\u044c \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0443\u0447\u0442\u0435\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0447\u0430\u0441\u0442\u0438\u0446.<br \/>  2. \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u044e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u043c\u043e\u0433\u0443\u0442 \u0435\u0449\u0451 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0436\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0430\u0440\u043d\u044b\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0438 \u041a\u0443\u043b\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0430\u0442\u043e\u043c\u043e\u0432 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043c\u0435\u0436\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043d\u043e \u044d\u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0449\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u0441\u0443\u043c\u043c\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430\u043c\u0438 \u0434\u0430\u0432\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<br \/>  3. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u0438\u0446 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u043d\u043e \u0434\u0430\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0441\u043e\u0440\u0435\u0432\u043d\u0443\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p>  \u041d\u0443 \u0438 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443:  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/153169\/\">\u041a\u043e\u0441\u043c\u0438\u043a\u0438<\/a>;<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/442128\/\">\u0416\u0438\u0437\u043d\u044c \u043d\u0430 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u0445<\/a>.<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/516118\/\"> https:\/\/habr.com\/ru\/post\/516118\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/516118\/\">\u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443, \u0433\u0434\u0435 \u0437\u0430\u043a\u043e\u043d\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/post\/508396\/\">\u0442\u0438\u043f\u0430 \u0447\u0430\u0441\u0442\u0438\u0446<\/a> \u0438\u043b\u0438 \u043e\u0442 \u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/post\/509878\/\">\u0437\u0430\u0440\u044f\u0434\u0430<\/a>. \u0414\u043b\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0447\u0430\u0441\u0442\u0438\u0446\u0430\u043c\u0438 (\u0430\u0442\u043e\u043c\u0430\u043c\u0438) \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043b\u0438 \u0430\u0442\u043e\u043c\u044b \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442 (\u0442\u043e\u0447\u043d\u0435\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043b\u0438 \u043e\u043d\u0438 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0434\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b68\/591\/a7e\/b68591a7e78c95af570af778e469f77f.jpg\" alt=\"image\"><br \/>  \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043e\u0434\u043e\u0440\u043e\u0434 \u0441 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u043d\u0435\u0436\u0435\u043b\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u0438\u0441\u043b\u043e\u0440\u043e\u0434 \u0441 \u0432\u043e\u0434\u043e\u0440\u043e\u0434\u043e\u043c \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u0412\u041d\u0423\u0422\u0420\u0418\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 (intramolecular) \u0438 \u041c\u0415\u0416\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 (intermolecular) \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041c\u0435\u0436\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0438 \u041a\u0443\u043b\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u043d\u044b\u043c\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430\u043c\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0447\u044c \u0448\u043b\u0430 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u043e\u043c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-308822","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308822"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308822\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}