Merge pull request #3177 from akohlmey/collected-small-changes

Collected small changes and fixes
This commit is contained in:
Axel Kohlmeyer
2022-03-18 19:22:40 -04:00
committed by GitHub
131 changed files with 181823 additions and 180624 deletions

6
.gitattributes vendored
View File

@ -3,3 +3,9 @@
.github export-ignore
.lgtm.yml export-ignore
SECURITY.md export-ignore
* text=auto
*.jpg -text
*.pdf -text
*.gz -text
*.png -text
*.ps -text

View File

@ -1,98 +1,98 @@
# COMB parameters for various elements (Si, Cu, Hf, Ti, Zr, U, O) and mixtures (their oxides and alloys)
# Edited by Tzu-Ray Shan from MSE, Univ. FL in Apr 2010
#
# Elements currently available: Si, Cu, Hf, Ti, Zr, U, O
# Oxides currently available: Si-O, Cu-O, Hf-O, Ti-O
#
# Si parameter set from (JG Yu, SB Sinnott, SR Phillpot, Phys. Rev. B 75 085311 2007)
# ,and (TR Shan, BD Devine, SR Phillpot, SB Sinnott, to be sub to Phys. Rev. B)
# O parameter set from (TR Shan, BD Devine, SB Sinnott, SR Phillpot, Phys. Rev. B 81 125328 2010)
# Cu parameter set from (BD Devine, TR Shan, SB Sinnott, SR Phillpot, to be sub to Phys. Rev. B)
# Hf parameter set from (TR Shan, BD Devine, SB Sinnott, SR Phillpot, Phys. Rev. B 81 125328 2010)
# Ti parameter set from (TR Shan, SR Phillpot, SB Sinnott, in preparation)
# U parameter set from (Y Li, TR Shan, SB Sinnott, SR Phillpot, in preparation)
# Zr parameter set from (T Iwasaki, J. Mater. Res. 20 5 1300 2005)
#
# Multiple entries can be added to this file, LAMMPS reads the ones it needs
# Only M-O are added in the potential table, using mixing rules to generate desired alloy (A-B) parameters
# 8 entries for a desired A-B type: AAA, BBB, AAB, ABA, ABB, BAA, BBA, BBA
# 27 entries for a system containing three elements A, B and C
# These entries are in LAMMPS "metal" units
#
Hf Hf Hf 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.90 0.10 2.069563 2.069563 707.53 707.53 0 0 0.008 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
Ti Ti Ti 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.40 0.10 2.082408 2.082408 546.386 546.386 0 0 0.0084 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 2.46820415900968 0 0.151351003255176 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0.0
O O O 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.8 0.2 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.0
Cu Cu Cu 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.95 0.05 2.794608 2.794608 952.693 952.693 0.077 0.0095 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 -2.0
Si Si Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.90 0.10 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0.0
Zr Zr Zr 1 0 1 0 1 0 0.929 0.929 39.9454 39.9454 3.8 0.31 1.857 1.857 382.6 382.6 0 0 0 0 0 0 1 1 1 1 -4 4 1.64 -1.5 -4 4 1.64 -1.5 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
U U U 1 0 1 0 4.346966 0.77617 0.832 0.832 162.6 162.6 3.9 0.15 1.835 1.835 795.6 795.6 0 0 0 0 0 0 1 1 1 1 -4 4 2 -2 -4 4 2 -2 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
#
Si O O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.25 2.4799 5.36 1830.8 3326.69 0 0 0 109.47 0.3122 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
O Si Si 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 2.80 0.25 5.36 2.4799 3326.69 1830.8 0 0 0 143.73 2.6 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
Si O Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.25 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
O Si O 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 3.20 0.25 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
Si Si O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.80 0.25 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
O O Si 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.25 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0
#
Si Cu Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si Si 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
Si Cu Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si Cu 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
Si Si Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.70 0.10 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
Cu Cu Si 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.70 0.10 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
#
Si O Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.10 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
Cu O Si 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.10 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
Si Cu O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si O 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
O Si Cu 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 2.80 0.10 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
O Cu Si 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.10 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
#
Cu O O 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.110 2.794608 5.36 952.693 3326.69 0 0 0 360 3.0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 -1.0
O Cu Cu 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.110 5.36 2.794608 3326.69 952.693 0 0 0 109.47 2.98 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
Cu O Cu 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.110 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
O Cu O 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.110 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
Cu Cu O 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.90 0.05 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
O O Cu 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.20 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0
#
Si Hf Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si Si 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
Si Hf Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si Hf 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
Si Si Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 3.26 0.15 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
Hf Hf Si 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.26 0.15 2.069563 2.069563 707.53 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.13952 0 0.00941 0 0.719131 -3.92875 -3.92875 4.83958 4.83958 12 0
#
Si O Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 3.196 0.21 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
Hf O Si 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.196 0.21 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.719131 -3.92875 -3.922011 4.83958 0.971086 12 0.16
Si Hf O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si O 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
O Si Hf 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 3.196 0.21 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
O Hf Si 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.196 0.21 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.16
#
Hf O O 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.29 0.12 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.922011 4.83958 0.971086 12 0.30
O Hf Hf 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.29 0.12 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.30
Hf O Hf 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.29 0.12 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.922011 4.83958 0.971086 12 0.30
O Hf O 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.29 0.12 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.30
Hf Hf O 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.29 0.12 2.069563 2.069563 707.53 707.53 0 0 0 0 0 0.0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.30
O O Hf 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 3.29 0.12 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0.0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.30
#
Ti O O 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 90 0.403105 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0.0
O Ti Ti 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 130.54 0.202777 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0.0
Ti O Ti 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0.0
O Ti O 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0.0
Ti Ti O 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.25 0.10 2.082408 2.082408 546.386 546.386 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0.0
O O Ti 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.20 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.0
#
Ti Cu Cu 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti Ti 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
Ti Cu Ti 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti Cu 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
Ti Ti Cu 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.40 0.10 2.082408 2.082408 546.386 546.386 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0
Cu Cu Ti 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.90 0.05 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
#
Ti O Cu 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0
Cu O Ti 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.10 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
Ti Cu O 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti O 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
O Ti Cu 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0
O Cu Ti 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.10 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
# COMB parameters for various elements (Si, Cu, Hf, Ti, Zr, U, O) and mixtures (their oxides and alloys)
# Edited by Tzu-Ray Shan from MSE, Univ. FL in Apr 2010
#
# Elements currently available: Si, Cu, Hf, Ti, Zr, U, O
# Oxides currently available: Si-O, Cu-O, Hf-O, Ti-O
#
# Si parameter set from (JG Yu, SB Sinnott, SR Phillpot, Phys. Rev. B 75 085311 2007)
# ,and (TR Shan, BD Devine, SR Phillpot, SB Sinnott, to be sub to Phys. Rev. B)
# O parameter set from (TR Shan, BD Devine, SB Sinnott, SR Phillpot, Phys. Rev. B 81 125328 2010)
# Cu parameter set from (BD Devine, TR Shan, SB Sinnott, SR Phillpot, to be sub to Phys. Rev. B)
# Hf parameter set from (TR Shan, BD Devine, SB Sinnott, SR Phillpot, Phys. Rev. B 81 125328 2010)
# Ti parameter set from (TR Shan, SR Phillpot, SB Sinnott, in preparation)
# U parameter set from (Y Li, TR Shan, SB Sinnott, SR Phillpot, in preparation)
# Zr parameter set from (T Iwasaki, J. Mater. Res. 20 5 1300 2005)
#
# Multiple entries can be added to this file, LAMMPS reads the ones it needs
# Only M-O are added in the potential table, using mixing rules to generate desired alloy (A-B) parameters
# 8 entries for a desired A-B type: AAA, BBB, AAB, ABA, ABB, BAA, BBA, BBA
# 27 entries for a system containing three elements A, B and C
# These entries are in LAMMPS "metal" units
#
Hf Hf Hf 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.90 0.10 2.069563 2.069563 707.53 707.53 0 0 0.008 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
Ti Ti Ti 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.40 0.10 2.082408 2.082408 546.386 546.386 0 0 0.0084 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 2.46820415900968 0 0.151351003255176 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0.0
O O O 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.8 0.2 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.0
Cu Cu Cu 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.95 0.05 2.794608 2.794608 952.693 952.693 0.077 0.0095 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 -2.0
Si Si Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.90 0.10 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0.0
Zr Zr Zr 1 0 1 0 1 0 0.929 0.929 39.9454 39.9454 3.8 0.31 1.857 1.857 382.6 382.6 0 0 0 0 0 0 1 1 1 1 -4 4 1.64 -1.5 -4 4 1.64 -1.5 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
U U U 1 0 1 0 4.346966 0.77617 0.832 0.832 162.6 162.6 3.9 0.15 1.835 1.835 795.6 795.6 0 0 0 0 0 0 1 1 1 1 -4 4 2 -2 -4 4 2 -2 0 3.139520d0 0 0.009410d0 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.0
#
Si O O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.25 2.4799 5.36 1830.8 3326.69 0 0 0 109.47 0.3122 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
O Si Si 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 2.80 0.25 5.36 2.4799 3326.69 1830.8 0 0 0 143.73 2.6 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
Si O Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.25 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
O Si O 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 3.20 0.25 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
Si Si O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.80 0.25 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
O O Si 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.25 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0
#
Si Cu Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si Si 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
Si Cu Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si Cu 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
Si Si Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 2.70 0.10 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
Cu Cu Si 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.70 0.10 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
#
Si O Cu 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 2.80 0.10 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
Cu O Si 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.10 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
Si Cu O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.681711 471.18 146.987 2.70 0.10 2.4799 2.794608 1830.8 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -6 2 0.1677645 -0.161007 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 0.72571 2.999911 0.274649 12 0
Cu Si O 1 0 1 0 1 0.140835 1.681711 1.7322 146.987 471.18 2.70 0.10 2.794608 2.4799 952.693 1830.8 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 1.651725 -1.658949 0 5.946437 0 0 0 0.454784 0.72571 -0.499378 0.274649 2.999911 12 0
O Si Cu 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 2.80 0.10 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
O Cu Si 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.10 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
#
Cu O O 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.110 2.794608 5.36 952.693 3326.69 0 0 0 360 3.0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 -1.0
O Cu Cu 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.110 5.36 2.794608 3326.69 952.693 0 0 0 109.47 2.98 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
Cu O Cu 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.110 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
O Cu O 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.110 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0
Cu Cu O 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.90 0.05 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
O O Cu 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.20 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0
#
Si Hf Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si Si 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
Si Hf Si 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si Hf 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
Si Si Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 1.7322 471.18 471.18 3.26 0.15 2.4799 2.4799 1830.8 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 1.651725 -1.658949 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -0.499378 2.999911 2.999911 12 0
Hf Hf Si 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.26 0.15 2.069563 2.069563 707.53 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.13952 0 0.00941 0 0.719131 -3.92875 -3.92875 4.83958 4.83958 12 0
#
Si O Hf 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 2.68 471.18 260.893 3.196 0.21 2.4799 5.36 1830.8 3326.69 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -1.8349 5.5046 0.00148 -0.00112 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.922011 2.999911 0.971086 12 0
Hf O Si 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.196 0.21 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.719131 -3.92875 -3.922011 4.83958 0.971086 12 0.16
Si Hf O 3 100390 16.218 -0.59826 0.78734 1.0999E-06 1.7322 0.959614 471.18 55.9421 3.26 0.15 2.4799 2.069563 1830.8 707.53 0 0 0 0 0 0 1 1 1 1 -4 4 1.651725 -1.658949 -4 4 0.26152 -0.25918 0 3.625144859 0 0.087067714 0 0.772871 -0.499378 -3.92875 2.999911 4.83958 12 0
Hf Si O 1 0 1 0 1.011011 0.046511 0.959614 1.7322 55.9421 471.18 3.26 0.15 2.069563 2.4799 707.53 1830.8 0 0 0 0 0 0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 1.651725 -1.658949 0 3.13952 0 0.00941 0 0.719131 -3.92875 -0.499378 4.83958 2.999911 12 0
O Si Hf 1 6.6 1 -0.229 1 2 2.68 1.7322 260.893 471.18 3.196 0.21 5.36 2.4799 3326.69 1830.8 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 1.651725 -1.658949 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -0.499378 0.971086 2.999911 12 0
O Hf Si 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.196 0.21 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.16
#
Hf O O 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.29 0.12 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.922011 4.83958 0.971086 12 0.30
O Hf Hf 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.29 0.12 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.30
Hf O Hf 1 0 1 0 1.011011 0.046511 0.959614 2.68 55.9421 260.893 3.29 0.12 2.069563 5.36 707.53 3326.69 0 0 0 0 0 0.14 1 1 1 1 -4 4 0.26152 -0.25918 -1.8349 5.5046 0.00148 -0.00112 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.922011 4.83958 0.971086 12 0.30
O Hf O 1 6.6 1 -0.229 1 2 2.68 0.959614 260.893 55.9421 3.29 0.12 5.36 2.069563 3326.69 707.53 0 0 0 0 0 0.14 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -4 4 0.26152 -0.25918 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.92875 0.971086 4.83958 12 0.30
Hf Hf O 1 0 1 0 1.011011 0.046511 0.959614 0.959614 55.9421 55.9421 3.29 0.12 2.069563 2.069563 707.53 707.53 0 0 0 0 0 0.0 1 1 1 1 -4 4 0.26152 -0.25918 -4 4 0.26152 -0.25918 0 3.13952 0 0.00941 0 0.679131 -3.92875 -3.92875 4.83958 4.83958 12 0.30
O O Hf 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 3.29 0.12 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0.0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.30
#
Ti O O 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 90 0.403105 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0.0
O Ti Ti 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 130.54 0.202777 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0.0
Ti O Ti 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0.0
O Ti O 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0.0
Ti Ti O 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.25 0.10 2.082408 2.082408 546.386 546.386 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0.0
O O Ti 1 6.6 1 -0.229 1 2 2.68 2.68 260.893 260.893 2.80 0.20 5.36 5.36 3326.69 3326.69 0 0 0 0 0 0 1 1 1 1 -1.8349 5.5046 0.00148 -0.00112 -1.8349 5.5046 0.00148 -0.00112 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 -3.922011 0.971086 0.971086 12 0.0
#
Ti Cu Cu 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti Ti 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
Ti Cu Ti 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti Cu 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
Ti Ti Cu 1 0 1 0 1.255016 0.089078 1.226342 1.226342 99.3916 99.3916 3.40 0.10 2.082408 2.082408 546.386 546.386 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -4 4 2.508854 -2.511416 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.392632 1.78349 1.78349 12 0
Cu Cu Ti 1 0 1 0 1 0.140835 1.681711 1.681711 146.987 146.987 2.90 0.05 2.794608 2.794608 952.693 952.693 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -6 2 0.1677645 -0.161007 0 5.946437 0 0 0 0.454784 0.72571 0.72571 0.274649 0.274649 12 0
#
Ti O Cu 1 0 1 0 1.255016 0.089078 1.226342 2.68 99.3916 260.893 3.25 0.10 2.082408 5.36 546.386 3326.69 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -4 4 2.508854 -2.511416 -1.8349 5.5046 0.00148 -0.00112 0 1.943430774 0 0.254695274 0 0.873685 0.392632 -3.922011 1.78349 0.971086 12 0
Cu O Ti 1 0 1 0 1 0.140835 1.681711 2.68 146.987 260.893 2.40 0.10 2.794608 5.36 952.693 3326.69 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -6 2 0.1677645 -0.161007 -1.8349 5.5046 0.00148 -0.00112 0 5.946437 0 0 0 0.454784 0.72571 -3.922011 0.274649 0.971086 12 0
Ti Cu O 1 0 1 0 1.255016 0.089078 1.226342 1.681711 99.3916 146.987 3.40 0.15 2.082408 2.794608 546.386 952.693 0 0 0 0 0 0 1 1 1 1 -4 4 2.508854 -2.511416 -6 2 0.1677645 -0.161007 0 1.943430774 0 0.254695274 0 0.873685 0.392632 0.72571 1.78349 0.274649 12 0
Cu Ti O 1 0 1 0 1 0.140835 1.681711 1.226342 146.987 99.3916 3.40 0.15 2.794608 2.082408 952.693 546.386 0 0 0 0 0 0 1 1 1 1 -6 2 0.1677645 -0.161007 -4 4 2.508854 -2.511416 0 5.946437 0 0 0 0.454784 0.72571 0.392632 0.274649 1.78349 12 0
O Ti Cu 1 6.6 1 -0.229 1 2 2.68 1.226342 260.893 99.3916 3.25 0.10 5.36 2.082408 3326.69 546.386 0 0 0 0 0 8.45 0.088406 0.969934 0.296577 1.326746 -1.8349 5.5046 0.00148 -0.00112 -4 4 2.508854 -2.511416 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.392632 0.971086 1.78349 12 0
O Cu Ti 1 6.6 1 -0.229 1 2 2.68 1.681711 260.893 146.987 2.40 0.10 5.36 2.794608 3326.69 952.693 0 0 0 0 0 0 0.15867 1.106214 0.533319 1.857837 -1.8349 5.5046 0.00148 -0.00112 -6 2 0.1677645 -0.161007 5.63441383 7.689598017 4.51426991 1.330079082 0 2.243072 -3.922011 0.72571 0.971086 0.274649 12 0

View File

@ -51,6 +51,7 @@ if(DOWNLOAD_QUIP)
GIT_TAG origin/public
GIT_SHALLOW YES
GIT_PROGRESS YES
GIT_SUBMODULES "src/fox;src/GAP"
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
CONFIGURE_COMMAND env QUIP_ARCH=lammps make config
BUILD_COMMAND env QUIP_ARCH=lammps make libquip

View File

@ -261,4 +261,4 @@ in case the new code is intended to be later included in LAMMPS directly.
A plugin may be registered under an existing style name. In that case
the plugin will override the existing code. This can be used to modify
the behavior of existing styles or to debug new versions of them without
having to recompile/reinstall all of LAMMPS.
having to re-compile or re-install all of LAMMPS.

View File

@ -165,5 +165,4 @@ changed. How to do this depends on the build system you are using.
URL "git@github.com:lammps/lammps.git".
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
(Temple U, akohlmey at gmail.com) and Richard Berger (Temple U,
richard.berger at temple.edu).
(Temple U, akohlmey at gmail.com).

View File

@ -143,7 +143,7 @@ control the induced charge solver and the initial values of the interface elemen
*polarize/bem/gmres* or *polarize/bem/icc* compute a global 2-element vector
which can be accessed by various :doc:`output commands <Howto_output>`.
The first element is the number of iterations when the solver terminates
(of which the upperbound is set by *iter_max*). The second element is the RMS error.
(of which the upper bound is set by *iter_max*). The second element is the RMS error.
Restrictions

View File

@ -20,6 +20,9 @@ Examples
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
pair_style python 10.0
pair_coeff * * py_pot.HarmonicCut A B
pair_style hybrid/overlay coul/long 12.0 python 12.0
pair_coeff * * coul/long
pair_coeff * * python py_pot.LJCutSPCE OW NULL
@ -159,23 +162,82 @@ Following the *LJCutMelt* example, here are the two functions:
to be multiplied by delta x, delta y, and delta z to conveniently obtain
the three components of the force vector between these two atoms.
Below is a more complex example using *real* units and defines an interaction
equivalent to:
.. code-block:: LAMMPS
units real
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
This uses the default geometric mixing. The equivalent input with pair
style *python* is:
.. code-block:: LAMMPS
units real
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
Note that while for pair style *harmonic/cut* the cutoff is implicitly
set to the minimum of the harmonic potential, for pair style python a
global cutoff must be set and it must be equal or larger to the implicit
cutoff of the potential in python, which has to explicitly return zero
force and energy beyond the cutoff. Also, the mixed parameters have to
be explicitly provided. The corresponding python code is:
.. code-block:: python
class Harmonic(LAMMPSPairPotential):
def __init__(self):
super(Harmonic,self).__init__()
self.units = 'real'
# set coeffs: K, r0
self.coeff = {'A' : {'A' : (0.2,9.0),
'B' : (math.sqrt(0.2*0.4),9.0)},
'B' : {'A' : (math.sqrt(0.2*0.4),9.0),
'B' : (0.4,9.0)}}
def compute_force(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r < coeff[1]):
return 2.0*delta*coeff[0]/r
else:
return 0.0
def compute_energy(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r < coeff[1]):
return delta*delta*coeff[0]
else:
return 0.0
----------
.. note::
.. admonition:: Performance Impact
:class: note
The evaluation of scripted python code will slow down the
computation pairwise interactions quite significantly. However, this
can be largely worked around through using the python pair style not
for the actual simulation, but to generate tabulated potentials on the
fly using the :doc:`pair_write <pair_write>` command. Please see below
for an example LAMMPS input of how to build a table file:
The evaluation of scripted python code will slow down the computation
of pairwise interactions quite significantly. However, this performance
penalty can be worked around through using the python pair style not
for the actual simulation, but to generate tabulated potentials using
the :doc:`pair_write <pair_write>` command. This will also enable
GPU or multi-thread acceleration through the GPU, KOKKOS, or OPENMP
package versions of the *table* pair style. Please see below for a
LAMMPS input example demonstrating how to build a table file:
.. code-block:: LAMMPS
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
shell rm -f melt.table
pair_write 1 1 2000 rsq 0.01 2.5 lj1_lj2.table lj
shell rm -f lj.table
pair_write 1 1 2000 rsq 0.01 2.5 lj.table lj
Note that it is strongly recommended to try to **delete** the potential
table file before generating it. Since the *pair_write* command will
@ -190,7 +252,7 @@ to be assigned to the LAMMPS atom types like this:
.. code-block:: LAMMPS
pair_style table linear 2000
pair_coeff 1 1 melt.table lj
pair_coeff 1 1 lj.table lj
This can also be done for more complex systems. Please see the
*examples/python* folders for a few more examples.

View File

@ -20,8 +20,9 @@ Syntax
dir1,dir2 = one or more directories to create
*mv* args = old new
old = old filename
new = new filename
*rm* args = file1 file2 ...
new = new filename or destination folder
*rm* args = [-f] file1 file2 ...
-f = turn off warnings (optional)
file1,file2 = one or more filenames to delete
*rmdir* args = dir1 dir2 ...
dir1,dir2 = one or more directories to delete
@ -36,8 +37,8 @@ Examples
shell cd sub1
shell cd ..
shell mkdir tmp1 tmp2 tmp3
shell rmdir tmp1
shell mkdir tmp1 tmp2/tmp3
shell rmdir tmp1 tmp2
shell mv log.lammps hold/log.1
shell rm TMP/file1 TMP/file2
shell putenv LAMMPS_POTENTIALS=../../potentials
@ -50,34 +51,39 @@ Description
Execute a shell command. A few simple file-based shell commands are
supported directly, in Unix-style syntax. Any command not listed
above is passed as-is to the C-library system() call, which invokes
the command in a shell.
the command in a shell. To use the external executable instead of
the built-in version one needs to use a full path, for example
*/bin/rm* instead of *rm*. The built-in commands will also work
on operating systems, that do not - by default - provide the
corresponding external executables (like *mkdir* on Windows).
This is means to invoke other commands from your input script. For
example, you can move files around in preparation for the next section
of the input script. Or you can run a program that pre-processes data
for input into LAMMPS. Or you can run a program that post-processes
LAMMPS output data.
This command provides a ways to invoke custom commands or executables
from your input script. For example, you can move files around in
preparation for the next section of the input script. Or you can run a
program that pre-processes data for input into LAMMPS. Or you can run a
program that post-processes LAMMPS output data.
With the exception of *cd*, all commands, including ones invoked via a
system() call, are executed by only a single processor, so that
files/directories are not being manipulated by multiple processors.
files/directories are not being manipulated by multiple processors
concurrently which may result in unexpected errors or corrupted files.
The *cd* command executes the Unix "cd" command to change the working
directory. All subsequent LAMMPS commands that read/write files will
use the new directory. All processors execute this command.
The *cd* command changes the current working directory similar to
the ``cd`` command. All subsequent LAMMPS commands that read/write files
will use the new directory. All processors execute this command.
The *mkdir* command executes the Unix "mkdir" command to create one or
more directories.
The *mkdir* command creates directories similar to the Unix ``mkdir -p``
command. That is, it will attempt to create the entire path of
sub-directories if they do not exist yet.
The *mv* command executes the Unix "mv" command to rename a file and/or
move it to a new directory.
The *mv* command renames a file and/or moves it to a new directory.
It cannot rename files across filesystem boundaries or between drives.
The *rm* command executes the Unix "rm" command to remove one or more
files.
The *rm* command deletes file similar to the Unix ``rm`` command.
The *rmdir* command executes the Unix "rmdir" command to remove one or
more directories. A directory must be empty to be successfully
removed.
The *rmdir* command deletes directories similar to Unix ``rmdir`` command.
If a directory is not empty, its contents are also removed recursively
similar to the Unix ``rm -r`` command.
The *putenv* command defines or updates an environment variable directly.
Since this command does not pass through the shell, no shell variable
@ -107,9 +113,9 @@ with 3 arguments: file1 10 file2.
Restrictions
""""""""""""
LAMMPS does not detect errors or print warnings when any of these
commands execute. E.g. if the specified directory does not exist,
executing the *cd* command will silently do nothing.
LAMMPS will do a best effort to detect errors and print suitable
warnings, but due to the nature of delegating commands to the C-library
system() call, this is not always reliable.
Related commands
""""""""""""""""

View File

@ -1,72 +1,72 @@
# DESCRIPTION: haynes-schockley
echo both
units metal
variable V equal 5000.0
variable n0 equal 0.085
variable dn equal 2.0*${n0}
variable dt equal 0.0005
variable s equal 10
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block -50 50 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc convective_drift_diffusion Cu_cddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 100 1 1 simRegion f p p
fix_modify AtC material all Cu
fix_modify AtC mesh create_nodeset lbc -50.0 -50.0 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 50.0 50.0 -INF INF -INF INF
# fix a temperature
fix_modify AtC initial temperature all 300.0
#fix_modify AtC initial electron_temperature all 300.0
fix_modify AtC fix electron_temperature all 300.
#fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5.0 300. 300.
fix_modify AtC initial electron_density all gaussian 0 0 0 1 0 0 5.0 ${dn} ${n0}
#fix_modify AtC fix electron_density all ${n0}
# isolate system:
# diffusion: dn/dx = 0
# drift : n = 0
fix_modify AtC fix electron_density lbc ${n0}
fix_modify AtC fix electron_density rbc ${n0}
fix_modify AtC fix temperature lbc 300.0
fix_modify AtC fix temperature rbc 300.0
fix_modify AtC fix electron_temperature lbc 300.0
fix_modify AtC fix electron_temperature rbc 300.0
fix_modify AtC fix electric_potential all 0.
fix_modify AtC extrinsic electron_integration implicit
# electron velocity
fix_modify AtC initial electron_velocity x all 0.
#fix_modify AtC fix electron_velocity x all 0.
fix_modify AtC initial electron_velocity y all 0.
fix_modify AtC fix electron_velocity y all 0
fix_modify AtC initial electron_velocity z all 0.
fix_modify AtC fix electron_velocity z all 0.
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output convective_pulseFE $s text binary
thermo $s
#run 100
# free electric field and allow shielding
fix_modify AtC unfix electric_potential all
fix_modify AtC fix electric_potential lbc -$V
fix_modify AtC fix electric_potential rbc 0
fix_modify AtC source electric_potential all ${n0}
fix_modify AtC extrinsic electron_integration implicit 10
run 100
# DESCRIPTION: haynes-schockley
echo both
units metal
variable V equal 5000.0
variable n0 equal 0.085
variable dn equal 2.0*${n0}
variable dt equal 0.0005
variable s equal 10
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block -50 50 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc convective_drift_diffusion Cu_cddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 100 1 1 simRegion f p p
fix_modify AtC material all Cu
fix_modify AtC mesh create_nodeset lbc -50.0 -50.0 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 50.0 50.0 -INF INF -INF INF
# fix a temperature
fix_modify AtC initial temperature all 300.0
#fix_modify AtC initial electron_temperature all 300.0
fix_modify AtC fix electron_temperature all 300.
#fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5.0 300. 300.
fix_modify AtC initial electron_density all gaussian 0 0 0 1 0 0 5.0 ${dn} ${n0}
#fix_modify AtC fix electron_density all ${n0}
# isolate system:
# diffusion: dn/dx = 0
# drift : n = 0
fix_modify AtC fix electron_density lbc ${n0}
fix_modify AtC fix electron_density rbc ${n0}
fix_modify AtC fix temperature lbc 300.0
fix_modify AtC fix temperature rbc 300.0
fix_modify AtC fix electron_temperature lbc 300.0
fix_modify AtC fix electron_temperature rbc 300.0
fix_modify AtC fix electric_potential all 0.
fix_modify AtC extrinsic electron_integration implicit
# electron velocity
fix_modify AtC initial electron_velocity x all 0.
#fix_modify AtC fix electron_velocity x all 0.
fix_modify AtC initial electron_velocity y all 0.
fix_modify AtC fix electron_velocity y all 0
fix_modify AtC initial electron_velocity z all 0.
fix_modify AtC fix electron_velocity z all 0.
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output convective_pulseFE $s text binary
thermo $s
#run 100
# free electric field and allow shielding
fix_modify AtC unfix electric_potential all
fix_modify AtC fix electric_potential lbc -$V
fix_modify AtC fix electric_potential rbc 0
fix_modify AtC source electric_potential all ${n0}
fix_modify AtC extrinsic electron_integration implicit 10
run 100

View File

@ -1,66 +1,66 @@
# needs description
# DESCRIPTION: haynes-schockley
# poisson eqn for E-field: epsilon phi,xx = -e (n - p + N_D - N_A)
# w/ E = phi,x
echo both
units metal
variable dt equal 0.0000001
variable s equal 1
variable L equal 10.0
variable N equal 40
variable T equal 30000.0
variable E equal 0.5
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block 0 $L 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion-schrodinger Si_ddm_schrodinger.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create $N 1 1 simRegion f p p
variable a equal $L-0.1
variable b equal $L+0.1
fix_modify AtC mesh create_nodeset lbc -0.1 0.1 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc $a $b -INF INF -INF INF
# ics/bcs : density consistent with wave function
fix_modify AtC initial temperature all 300.0
fix_modify AtC fix temperature all 300.0
fix_modify AtC initial electron_temperature all $T
fix_modify AtC fix electron_temperature all $T
fix_modify AtC initial electron_density all 0.0
#fix_modify AtC fix electron_density lbc 0
#fix_modify AtC fix electron_density rbc 0
fix_modify AtC initial electric_potential all 0.0
fix_modify AtC initial electron_wavefunction all 0.0
fix_modify AtC fix electron_wavefunction lbc 0
fix_modify AtC fix electron_wavefunction rbc 0
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output ddm_schrodingerFE $s text
fix_modify AtC extrinsic electron_integration implicit 1
fix_modify AtC extrinsic schrodinger_poisson_solver self_consistency 1 # 100
fix_modify AtC unfix electric_potential all
# ends zero
fix_modify AtC fix electric_potential lbc 0
fix_modify AtC fix electric_potential rbc 0
run 1
# ends from gradient
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 0
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 0
run 1
# needs description
# DESCRIPTION: haynes-schockley
# poisson eqn for E-field: epsilon phi,xx = -e (n - p + N_D - N_A)
# w/ E = phi,x
echo both
units metal
variable dt equal 0.0000001
variable s equal 1
variable L equal 10.0
variable N equal 40
variable T equal 30000.0
variable E equal 0.5
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block 0 $L 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion-schrodinger Si_ddm_schrodinger.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create $N 1 1 simRegion f p p
variable a equal $L-0.1
variable b equal $L+0.1
fix_modify AtC mesh create_nodeset lbc -0.1 0.1 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc $a $b -INF INF -INF INF
# ics/bcs : density consistent with wave function
fix_modify AtC initial temperature all 300.0
fix_modify AtC fix temperature all 300.0
fix_modify AtC initial electron_temperature all $T
fix_modify AtC fix electron_temperature all $T
fix_modify AtC initial electron_density all 0.0
#fix_modify AtC fix electron_density lbc 0
#fix_modify AtC fix electron_density rbc 0
fix_modify AtC initial electric_potential all 0.0
fix_modify AtC initial electron_wavefunction all 0.0
fix_modify AtC fix electron_wavefunction lbc 0
fix_modify AtC fix electron_wavefunction rbc 0
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output ddm_schrodingerFE $s text
fix_modify AtC extrinsic electron_integration implicit 1
fix_modify AtC extrinsic schrodinger_poisson_solver self_consistency 1 # 100
fix_modify AtC unfix electric_potential all
# ends zero
fix_modify AtC fix electric_potential lbc 0
fix_modify AtC fix electric_potential rbc 0
run 1
# ends from gradient
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 0
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 0
run 1

View File

@ -1,75 +1,75 @@
#needs description
echo both
units metal
variable E equal 0.1
variable L equal 10.0
#variable N equal 100
variable N equal 80
variable T equal 1000
variable n0 equal 0.0001
variable dn equal 2.0*${n0}
variable dt equal 0.0000001
variable s equal 1
timestep ${dt}
atom_style atomic
lattice fcc 1.0
variable a equal 0.5*$L
region simRegion block -$a $a 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion-schrodinger SiGe_ddm_schrodinger.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create $N 1 1 simRegion f p p
variable a equal 0.2*$L+0.001
fix_modify AtC mesh create_elementset well -$a $a -INF INF -INF INF
fix_modify AtC mesh create_nodeset well -$a $a -INF INF -INF INF
fix_modify AtC material well Ge
variable b equal $a-0.002
fix_modify AtC mesh create_nodeset lbc -$a -$b -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc $b $a -INF INF -INF INF
# ics/bcs
fix_modify AtC initial temperature all 300.0
fix_modify AtC fix temperature all 300.0
#
fix_modify AtC initial electron_temperature all $T
fix_modify AtC fix electron_temperature all $T
#
fix_modify AtC initial electron_density all 0.0
#fix_modify AtC fix electron_density all -0.001
#fix_modify AtC fix electron_density well 0.002
#
fix_modify AtC initial electric_potential all 0.0
#fix_modify AtC fix electric_potential lbc 0.5
#fix_modify AtC fix electric_potential rbc 0.5
fix_modify AtC fix electric_potential lbc 0.0
fix_modify AtC fix electric_potential rbc 0.0
#
fix_modify AtC initial electron_wavefunction all 0.0
fix_modify AtC fix electron_wavefunction lbc 0.0
fix_modify AtC fix electron_wavefunction rbc 0.0
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output finite_wellFE $s text
fix_modify AtC extrinsic electron_integration implicit 3
fix_modify AtC extrinsic schrodinger_poisson_solver self_consistency 3 # 30
variable m equal 1*$s
# (A) no field
run $m
# (B) fixed boundary field
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 1
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 1
run $m
#needs description
echo both
units metal
variable E equal 0.1
variable L equal 10.0
#variable N equal 100
variable N equal 80
variable T equal 1000
variable n0 equal 0.0001
variable dn equal 2.0*${n0}
variable dt equal 0.0000001
variable s equal 1
timestep ${dt}
atom_style atomic
lattice fcc 1.0
variable a equal 0.5*$L
region simRegion block -$a $a 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion-schrodinger SiGe_ddm_schrodinger.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create $N 1 1 simRegion f p p
variable a equal 0.2*$L+0.001
fix_modify AtC mesh create_elementset well -$a $a -INF INF -INF INF
fix_modify AtC mesh create_nodeset well -$a $a -INF INF -INF INF
fix_modify AtC material well Ge
variable b equal $a-0.002
fix_modify AtC mesh create_nodeset lbc -$a -$b -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc $b $a -INF INF -INF INF
# ics/bcs
fix_modify AtC initial temperature all 300.0
fix_modify AtC fix temperature all 300.0
#
fix_modify AtC initial electron_temperature all $T
fix_modify AtC fix electron_temperature all $T
#
fix_modify AtC initial electron_density all 0.0
#fix_modify AtC fix electron_density all -0.001
#fix_modify AtC fix electron_density well 0.002
#
fix_modify AtC initial electric_potential all 0.0
#fix_modify AtC fix electric_potential lbc 0.5
#fix_modify AtC fix electric_potential rbc 0.5
fix_modify AtC fix electric_potential lbc 0.0
fix_modify AtC fix electric_potential rbc 0.0
#
fix_modify AtC initial electron_wavefunction all 0.0
fix_modify AtC fix electron_wavefunction lbc 0.0
fix_modify AtC fix electron_wavefunction rbc 0.0
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output finite_wellFE $s text
fix_modify AtC extrinsic electron_integration implicit 3
fix_modify AtC extrinsic schrodinger_poisson_solver self_consistency 3 # 30
variable m equal 1*$s
# (A) no field
run $m
# (B) fixed boundary field
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 1
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 1
run $m

View File

@ -1,65 +1,65 @@
# needs description
# DESCRIPTION: haynes-schockley
# continuity eqn: n,t = J,x + (G-R) = D n,xx + mu (n E),x + G - 1/tau (n - n_0)
# w/ J = D n,x + mu n phi,x
# poisson eqn for E-field: epsilon phi,xx = -e (n - p + N_D - N_A)
# w/ E = phi,x
# NOTE: does not conserve electrons even with fixed E field and zero mobility
# if J=0 --> n,x = mu/D n phi,x
echo both
units metal
variable E equal 10.0
variable n0 equal 0.0001
variable dn equal 2.0*${n0}
variable dt equal 0.0000001
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block -50 50 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion Si_ddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 100 1 1 simRegion f p p
fix_modify AtC mesh create_nodeset lbc -50.1 -49.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 49.9 50.1 -INF INF -INF INF
# fix a temperature
fix_modify AtC initial temperature all 300.0
fix_modify AtC initial electron_temperature all 300.0
fix_modify AtC initial electron_density all gaussian 0 0 0 1 0 0 5.0 ${dn} ${n0}
# isolate system:
# diffusion: dn/dx = 0
# drift : n = 0
fix_modify AtC fix electron_density lbc ${n0}
fix_modify AtC fix electron_density rbc ${n0}
fix_modify AtC fix electric_potential all linear 0 0 0 $E 0 0 1
variable perm equal 0.06
variable nD equal 1.0e-4
fix_modify AtC source electric_potential all ${nD}
variable s equal 10
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output no_atoms_ddmFE $s text
fix_modify AtC extrinsic electron_integration implicit
run 40
# free electric field and allow shielding
fix_modify AtC unfix electric_potential all
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 1
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 1
fix_modify AtC extrinsic electron_integration implicit 10
run 40
# needs description
# DESCRIPTION: haynes-schockley
# continuity eqn: n,t = J,x + (G-R) = D n,xx + mu (n E),x + G - 1/tau (n - n_0)
# w/ J = D n,x + mu n phi,x
# poisson eqn for E-field: epsilon phi,xx = -e (n - p + N_D - N_A)
# w/ E = phi,x
# NOTE: does not conserve electrons even with fixed E field and zero mobility
# if J=0 --> n,x = mu/D n phi,x
echo both
units metal
variable E equal 10.0
variable n0 equal 0.0001
variable dn equal 2.0*${n0}
variable dt equal 0.0000001
timestep ${dt}
atom_style atomic
lattice fcc 1.0
region simRegion block -50 50 0 1 0 1
boundary f p p
create_box 1 simRegion
mass 1 1.0 # need to keep this
atom_modify sort 0 1
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion Si_ddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 100 1 1 simRegion f p p
fix_modify AtC mesh create_nodeset lbc -50.1 -49.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 49.9 50.1 -INF INF -INF INF
# fix a temperature
fix_modify AtC initial temperature all 300.0
fix_modify AtC initial electron_temperature all 300.0
fix_modify AtC initial electron_density all gaussian 0 0 0 1 0 0 5.0 ${dn} ${n0}
# isolate system:
# diffusion: dn/dx = 0
# drift : n = 0
fix_modify AtC fix electron_density lbc ${n0}
fix_modify AtC fix electron_density rbc ${n0}
fix_modify AtC fix electric_potential all linear 0 0 0 $E 0 0 1
variable perm equal 0.06
variable nD equal 1.0e-4
fix_modify AtC source electric_potential all ${nD}
variable s equal 10
thermo $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify format 1 %5i format 2 %7.2g
fix_modify AtC output no_atoms_ddmFE $s text
fix_modify AtC extrinsic electron_integration implicit
run 40
# free electric field and allow shielding
fix_modify AtC unfix electric_potential all
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 1
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 1
fix_modify AtC extrinsic electron_integration implicit 10
run 40

View File

@ -1,79 +1,79 @@
# needs description
#AtC drift diffusion Coupling
# DESCRIPTION:
# electric potential solved over whole domain
# all others only over the lower half
# temperature is fixed over whole domain
# NOTE the vacuum can fully masked out by making the material
# have null electron_density in Ar_ddm.mat
echo both
units metal
variable s equal 100
variable T equal 20
variable n equal 0.000004
variable tol equal 0.1
variable W equal 1000
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region FE block -8 8 -6 6 0 3
region MD block -7 7 -6 0 0 3
region FREE block -4 4 -6 0 0 3
boundary f f p
# create atoms
create_box 1 FE
mass 1 39.95
atom_modify sort 0 1
timestep 0.002
thermo $s
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion Ar_ddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 4 4 1 FE f f p
variable a equal $W+${tol}
fix_modify AtC mesh create_elementset wire -$a $a -INF ${tol} -INF INF
fix_modify AtC mesh create_elementset gap -$a $a -${tol} INF -INF INF
# void is the complement of the wire nodeset
variable a equal $W-${tol}
fix_modify AtC mesh create_nodeset void -$a $a ${tol} INF -INF INF
fix_modify AtC mesh output null_material_ddmMESH binary
fix_modify AtC control thermal none
# fix a temperature
fix_modify AtC initial temperature all $T
fix_modify AtC initial electron_temperature all $T
fix_modify AtC initial electron_density all $n
fix_modify AtC initial electric_potential all 0.0
fix_modify AtC initial temperature void 0.0
fix_modify AtC initial electron_density void 0.0
fix_modify AtC initial electric_potential void 0.0
# create vacuum
fix_modify AtC material gap Vacuum
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output null_material_ddmFE $s full_text binary
fix_modify AtC extrinsic electron_integration implicit
#
fix_modify AtC mesh create_nodeset lbc -8.1 -7.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 7.9 8.1 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc $T
fix_modify AtC fix electron_temperature rbc $T
fix_modify AtC fix electron_density lbc $n
fix_modify AtC fix electric_potential lbc 0.0
variable m equal $s*10
run $m
# needs description
#AtC drift diffusion Coupling
# DESCRIPTION:
# electric potential solved over whole domain
# all others only over the lower half
# temperature is fixed over whole domain
# NOTE the vacuum can fully masked out by making the material
# have null electron_density in Ar_ddm.mat
echo both
units metal
variable s equal 100
variable T equal 20
variable n equal 0.000004
variable tol equal 0.1
variable W equal 1000
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region FE block -8 8 -6 6 0 3
region MD block -7 7 -6 0 0 3
region FREE block -4 4 -6 0 0 3
boundary f f p
# create atoms
create_box 1 FE
mass 1 39.95
atom_modify sort 0 1
timestep 0.002
thermo $s
# ID group atc PhysicsType ParameterFile
fix AtC all atc drift_diffusion Ar_ddm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 4 4 1 FE f f p
variable a equal $W+${tol}
fix_modify AtC mesh create_elementset wire -$a $a -INF ${tol} -INF INF
fix_modify AtC mesh create_elementset gap -$a $a -${tol} INF -INF INF
# void is the complement of the wire nodeset
variable a equal $W-${tol}
fix_modify AtC mesh create_nodeset void -$a $a ${tol} INF -INF INF
fix_modify AtC mesh output null_material_ddmMESH binary
fix_modify AtC control thermal none
# fix a temperature
fix_modify AtC initial temperature all $T
fix_modify AtC initial electron_temperature all $T
fix_modify AtC initial electron_density all $n
fix_modify AtC initial electric_potential all 0.0
fix_modify AtC initial temperature void 0.0
fix_modify AtC initial electron_density void 0.0
fix_modify AtC initial electric_potential void 0.0
# create vacuum
fix_modify AtC material gap Vacuum
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output null_material_ddmFE $s full_text binary
fix_modify AtC extrinsic electron_integration implicit
#
fix_modify AtC mesh create_nodeset lbc -8.1 -7.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 7.9 8.1 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc $T
fix_modify AtC fix electron_temperature rbc $T
fix_modify AtC fix electron_density lbc $n
fix_modify AtC fix electric_potential lbc 0.0
variable m equal $s*10
run $m

View File

@ -1,91 +1,91 @@
# needs description
#AtC Thermal Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.5
#pair_coeff 1 1 0.010323166 3.405 13.5
pair_coeff 1 1 .238 3.405 13.5
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum glc_velocity
fix_modify AtC filter type exponential
fix_modify AtC filter scale 1000.0
fix_modify AtC filter on
# run to extension
#fix_modify AtC output bar1dFE 50 text
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1dFE 500 text
# run to equilibrium
timestep 5
thermo 100
run 10000
# needs description
#AtC Thermal Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.5
#pair_coeff 1 1 0.010323166 3.405 13.5
pair_coeff 1 1 .238 3.405 13.5
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum glc_velocity
fix_modify AtC filter type exponential
fix_modify AtC filter scale 1000.0
fix_modify AtC filter on
# run to extension
#fix_modify AtC output bar1dFE 50 text
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1dFE 500 text
# run to equilibrium
timestep 5
thermo 100
run 10000

View File

@ -1,116 +1,116 @@
# needs description
echo both
units metal
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 2 simRegion
create_atoms 1 region mdRegion
mass * 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.5
#pair_coeff * * .238 3.405 13.5
pair_coeff * * 0.010323166 3.405 13.5
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_damped.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
variable v equal 0.00000004e3
variable n equal 1000
variable dt equal 0.005
variable u equal $v*$n*${dt}
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc $v
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
fix_modify AtC boundary ghosts
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum glc_velocity
#fix_modify AtC filter type exponential
#fix_modify AtC filter scale 1.0
#fix_modify AtC filter on
# run to extension
timestep 0.005
thermo 100
thermo_style custom step cpu ke pe
run 0
variable pe0 equal pe
variable pe equal pe-${pe0}
thermo_style custom step cpu ke pe v_pe f_AtC[1] f_AtC[2] f_AtC[4] f_AtC[5]
run $n
fix_modify AtC output bar1d_dampedFE 500 text
dump CONFIG all custom 500 bar1d_damped.dmp id type x y z vx vy vz
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc $u
# run to equilibrium
thermo 100
log bar1d_damped.log
run 2000
fix_modify AtC material all cubic # M damping
run 2000
fix_modify AtC material all damped # K damping
run 2000
# ATC: CB stiffness: 7.56717 Einstein freq: 0.355649 from Ar_CauchyBorn.mat
# real to metal 1 kcal/mol = 0.04336 eV
variable kCal2eV equal 0.04336
variable fconv equal 1./0.000103643 # NOTE old routine was doing calculations in lammps units, not atc units, so this conversion is necessary for bmark to pass
#variable k equal 1.e-3 # 7.56717*${kCal2eV} NOTE <<<
#variable k equal 0.75*0.355649e3*${kCal2eV}
variable k equal 0.5*39.95*${fconv} # NOTE it was set to above, should have been 2 above, but there was a bug so this value is here for bmark
#variable g equal 0.75*0.355649e3*${kCal2eV}
variable g equal 1.e-3*${fconv} # NOTE it should be above, but there was a bug so this value is here for bmark
variable m equal 2. #0.5*39.95
fix_modify AtC boundary_dynamics damped_harmonic $k $g $m
run 2000
# needs description
echo both
units metal
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 2 simRegion
create_atoms 1 region mdRegion
mass * 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.5
#pair_coeff * * .238 3.405 13.5
pair_coeff * * 0.010323166 3.405 13.5
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_damped.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
variable v equal 0.00000004e3
variable n equal 1000
variable dt equal 0.005
variable u equal $v*$n*${dt}
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc $v
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
fix_modify AtC boundary ghosts
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum glc_velocity
#fix_modify AtC filter type exponential
#fix_modify AtC filter scale 1.0
#fix_modify AtC filter on
# run to extension
timestep 0.005
thermo 100
thermo_style custom step cpu ke pe
run 0
variable pe0 equal pe
variable pe equal pe-${pe0}
thermo_style custom step cpu ke pe v_pe f_AtC[1] f_AtC[2] f_AtC[4] f_AtC[5]
run $n
fix_modify AtC output bar1d_dampedFE 500 text
dump CONFIG all custom 500 bar1d_damped.dmp id type x y z vx vy vz
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc $u
# run to equilibrium
thermo 100
log bar1d_damped.log
run 2000
fix_modify AtC material all cubic # M damping
run 2000
fix_modify AtC material all damped # K damping
run 2000
# ATC: CB stiffness: 7.56717 Einstein freq: 0.355649 from Ar_CauchyBorn.mat
# real to metal 1 kcal/mol = 0.04336 eV
variable kCal2eV equal 0.04336
variable fconv equal 1./0.000103643 # NOTE old routine was doing calculations in lammps units, not atc units, so this conversion is necessary for bmark to pass
#variable k equal 1.e-3 # 7.56717*${kCal2eV} NOTE <<<
#variable k equal 0.75*0.355649e3*${kCal2eV}
variable k equal 0.5*39.95*${fconv} # NOTE it was set to above, should have been 2 above, but there was a bug so this value is here for bmark
#variable g equal 0.75*0.355649e3*${kCal2eV}
variable g equal 1.e-3*${fconv} # NOTE it should be above, but there was a bug so this value is here for bmark
variable m equal 2. #0.5*39.95
fix_modify AtC boundary_dynamics damped_harmonic $k $g $m
run 2000

View File

@ -1,98 +1,98 @@
# needs description
#AtC Thermal Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
#fix_modify AtC control lumped_lambda_solve on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
fix_modify AtC control momentum flux interpolate
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_fluxFE 10 text
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1d_fluxFE 500 text
# run to equilibrium
timestep 5
thermo 100
run 10000
# needs description
#AtC Thermal Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -9 9 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0
#velocity internal create 40. 87287 mom yes loop geom
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
#fix_modify AtC output follow_ex.fe 50
fix_modify AtC internal_quadrature off
#fix_modify AtC control lumped_lambda_solve on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
fix_modify AtC control momentum flux interpolate
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_fluxFE 10 text
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1d_fluxFE 500 text
# run to equilibrium
timestep 5
thermo 100
run 10000

View File

@ -1,99 +1,99 @@
# needs description
#AtC Elastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -8 8 -3 3 -3 3
region mdRegion block -6 6 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region atomRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.5
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
fix_modify AtC time_integration fractional_step
fix_modify AtC internal_atom_integrate off
fix iNVE internal nve
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum flux interpolate
#fix_modify AtC control momentum hoover # tested in this mode
#fix_modify AtC filter type exponential
#fix_modify AtC filter scale 1000.0
#fix_modify AtC filter on
# run to extension
#fix_modify AtC output bar1d_frac_step_initFE 50 text binary
#dump D1 all atom 50 bar1d_frac_step_init.dmp
timestep 5
thermo 100
run 1000
# reset time
fix_modify AtC reset_time 0.
reset_timestep 0
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1d_frac_stepFE 500 text #binary
#fix_modify AtC output index step
#undump D1
#dump D1 all atom 500 bar1d_frac_step.dmp
# run to equilibrium
timestep 5
thermo 100
run 5000
# needs description
#AtC Elastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# create atoms
region simRegion block -12 12 -3 3 -3 3
region atomRegion block -8 8 -3 3 -3 3
region mdRegion block -6 6 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region atomRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.5
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC initial displacement y all 0.0
fix_modify AtC initial displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC initial velocity y all 0.0
fix_modify AtC initial velocity z all 0.0
fix_modify AtC time_integration fractional_step
fix_modify AtC internal_atom_integrate off
fix iNVE internal nve
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# specify atom types
#fix_modify AtC boundary Lghost
#fix_modify AtC boundary Rghost
fix_modify AtC boundary ghosts
fix_modify AtC internal_quadrature off
fix_modify AtC control localized_lambda on
fix_modify AtC control momentum flux interpolate
#fix_modify AtC control momentum hoover # tested in this mode
#fix_modify AtC filter type exponential
#fix_modify AtC filter scale 1000.0
#fix_modify AtC filter on
# run to extension
#fix_modify AtC output bar1d_frac_step_initFE 50 text binary
#dump D1 all atom 50 bar1d_frac_step_init.dmp
timestep 5
thermo 100
run 1000
# reset time
fix_modify AtC reset_time 0.
reset_timestep 0
# change nodes to fixed
fix_modify AtC fix velocity x rbc 0.
fix_modify AtC fix displacement x rbc 0.0002
fix_modify AtC output bar1d_frac_stepFE 500 text #binary
#fix_modify AtC output index step
#undump D1
#dump D1 all atom 500 bar1d_frac_step.dmp
# run to equilibrium
timestep 5
thermo 100
run 5000

View File

@ -1,101 +1,101 @@
# Computes elastic waves propagating in and out of a finite temperature region
#AtC ThermoElastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
region simRegion block -12 12 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0, NOTE next for lines commented out for restart
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
fix_modify AtC internal_atom_integrate off
fix iNVE internal nve
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# turn on multiscale
fix_modify AtC control momentum ghost_flux
# new boundary conditions
fix_modify AtC fix velocity x rbc 0.00000004
#fix_modify AtC output follow_ex.fe 50
#fix_modify AtC localized_lambda on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
#fix_modify AtC control momentum flux
#fix_modify AtC control momentum ghost_flux
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_ghost_fluxFE 500 text
#dump D1 all atom 100 bar1d_ghost_flux.dmp
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC unfix velocity x rbc
#fix_modify AtC fix displacement x rbc 0.0002
#fix_modify AtC output bar1d_fluxFE 500 text binary
# run to equilibrium
timestep 5
thermo 100
run 3000
# Computes elastic waves propagating in and out of a finite temperature region
#AtC ThermoElastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
region simRegion block -12 12 -3 3 -3 3
region mdRegion block -8 8 -3 3 -3 3
boundary f p p
create_box 1 simRegion
create_atoms 1 region mdRegion
mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0, NOTE next for lines commented out for restart
pair_style lj/cut 13.
#pair_coeff 1 1 0.010323166 3.405 13.
pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc elastic Ar_elastic.mat
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
fix_modify AtC internal_atom_integrate off
fix iNVE internal nve
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# turn on multiscale
fix_modify AtC control momentum ghost_flux
# new boundary conditions
fix_modify AtC fix velocity x rbc 0.00000004
#fix_modify AtC output follow_ex.fe 50
#fix_modify AtC localized_lambda on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
#fix_modify AtC control momentum flux
#fix_modify AtC control momentum ghost_flux
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_ghost_fluxFE 500 text
#dump D1 all atom 100 bar1d_ghost_flux.dmp
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC unfix velocity x rbc
#fix_modify AtC fix displacement x rbc 0.0002
#fix_modify AtC output bar1d_fluxFE 500 text binary
# run to equilibrium
timestep 5
thermo 100
run 3000

View File

@ -1,139 +1,139 @@
# Computes elastic waves propagating in and out of a finite temperature region
#AtC ThermoElastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# NOTE following 3 lines added for restart
boundary f p p
pair_style lj/cut 13.
read_data temp.init
region simRegion block -12 12 -3 3 -3 3
# create atoms, NOTE commented out for restart
#region mdRegion block -8 8 -3 3 -3 3
#boundary f p p
#region mdBox block -9 9 -3 3 -3 3
#create_box 1 mdBox
#create_atoms 1 region mdRegion
#mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0, NOTE next for lines commented out for restart
#velocity internal create 40. 87287 mom yes loop geom
#pair_style lj/cut 13.
##pair_coeff 1 1 0.010323166 3.405 13.
#pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
#write_restart tinit.dat
# zero initial momentum
fix AtC internal atc elastic Ar_thermo_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
fix_modify AtC fix displacement x all 0.
fix_modify AtC fix displacement y all 0.
fix_modify AtC fix displacement z all 0.
fix_modify AtC fix velocity x all 0.
fix_modify AtC fix velocity y all 0.
fix_modify AtC fix velocity z all 0.
fix_modify AtC control momentum glc_velocity
#fix_modify AtC output bar1d_thermo_elastic_initializeFE 1 text #binary
timestep 0
thermo 1
run 1
unfix AtC
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc thermo_elastic Ar_thermo_elastic.mat
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
fix_modify AtC fix temperature all 20.
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# rescale thermostat for initial atomic temperatures
fix_modify AtC control thermal rescale 10
fix_modify AtC control momentum ghost_flux
fix_modify AtC output bar1d_thermo_elasticFE 100 text #binary
timestep 5
thermo 100
run 1000
# free all nodes
#fix_modify AtC unfix displacement x all
#fix_modify AtC unfix velocity x all
fix_modify AtC unfix temperature all
# new boundary conditions
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix temperature lbc 20.
#fix_modify AtC output follow_ex.fe 50
#fix_modify AtC localized_lambda on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
#fix_modify AtC control momentum flux
#fix_modify AtC control momentum ghost_flux
fix_modify AtC control thermal flux
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_thermo_elasticFE 500 text
#dump D1 all custom 100 bar1d_thermo_elastic.dmp id type x y z vx vy vz
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC unfix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.0002
#fix_modify AtC output bar1d_fluxFE 500 text binary
# run to equilibrium
timestep 5
thermo 100
run 3000
# Computes elastic waves propagating in and out of a finite temperature region
#AtC ThermoElastic Coupling
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.2582305 origin 0.25 0.25 0.25
# NOTE following 3 lines added for restart
boundary f p p
pair_style lj/cut 13.
read_data temp.init
region simRegion block -12 12 -3 3 -3 3
# create atoms, NOTE commented out for restart
#region mdRegion block -8 8 -3 3 -3 3
#boundary f p p
#region mdBox block -9 9 -3 3 -3 3
#create_box 1 mdBox
#create_atoms 1 region mdRegion
#mass 1 39.95
# specify interal/ghost atoms
region mdInternal block -6 6 -3 3 -3 3
region leftghost block -8 -6 -3 3 -3 3
region rightghost block 6 8 -3 3 -3 3
group internal region mdInternal
group Lghost region leftghost
group Rghost region rightghost
group ghosts union Lghost Rghost
# velocities have Vcm = 0, NOTE next for lines commented out for restart
#velocity internal create 40. 87287 mom yes loop geom
#pair_style lj/cut 13.
##pair_coeff 1 1 0.010323166 3.405 13.
#pair_coeff 1 1 .2381 3.405 13.
neighbor 5. bin
neigh_modify every 10 delay 0 check no
#write_restart tinit.dat
# zero initial momentum
fix AtC internal atc elastic Ar_thermo_elastic.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
fix_modify AtC fix displacement x all 0.
fix_modify AtC fix displacement y all 0.
fix_modify AtC fix displacement z all 0.
fix_modify AtC fix velocity x all 0.
fix_modify AtC fix velocity y all 0.
fix_modify AtC fix velocity z all 0.
fix_modify AtC control momentum glc_velocity
#fix_modify AtC output bar1d_thermo_elastic_initializeFE 1 text #binary
timestep 0
thermo 1
run 1
unfix AtC
# define layer
# ID group atc PhysicsType ParameterFile
fix AtC internal atc thermo_elastic Ar_thermo_elastic.mat
fix_modify AtC boundary ghosts
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 simRegion f p p
fix_modify AtC mesh create_faceset obndy box -6.0 6.0 -INF INF -INF INF outward
fix_modify AtC internal_quadrature off
# initial conditions
fix_modify AtC initial displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC initial velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
fix_modify AtC fix temperature all 20.
# set node sets and bcs
# ID mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
#fix_modify AtC fix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.
fix_modify AtC fix displacement x lbc 0.
fix_modify AtC fix velocity x lbc 0.
# rescale thermostat for initial atomic temperatures
fix_modify AtC control thermal rescale 10
fix_modify AtC control momentum ghost_flux
fix_modify AtC output bar1d_thermo_elasticFE 100 text #binary
timestep 5
thermo 100
run 1000
# free all nodes
#fix_modify AtC unfix displacement x all
#fix_modify AtC unfix velocity x all
fix_modify AtC unfix temperature all
# new boundary conditions
fix_modify AtC fix velocity x rbc 0.00000004
fix_modify AtC fix temperature lbc 20.
#fix_modify AtC output follow_ex.fe 50
#fix_modify AtC localized_lambda on
#fix_modify AtC momentum control glc_velocity
#fix_modify AtC momentum control flux faceset obndy
#fix_modify AtC control momentum flux
#fix_modify AtC control momentum ghost_flux
fix_modify AtC control thermal flux
#fix_modify AtC filter scale 1000.0
# run to extension
compute myTemp internal temp
compute atomStress internal stress/atom NULL
compute avgStress internal reduce sum c_atomStress[1] c_atomStress[2] c_atomStress[3]
variable myPres equal -(c_avgStress[1]+c_avgStress[2]+c_avgStress[3])/(3*vol)
thermo_style custom step c_myTemp v_myPres pe
fix_modify AtC output bar1d_thermo_elasticFE 500 text
#dump D1 all custom 100 bar1d_thermo_elastic.dmp id type x y z vx vy vz
timestep 5
thermo 100
run 1000
# change nodes to fixed
fix_modify AtC unfix velocity x rbc 0.
#fix_modify AtC fix displacement x rbc 0.0002
#fix_modify AtC output bar1d_fluxFE 500 text binary
# run to equilibrium
timestep 5
thermo 100
run 3000

View File

@ -1,80 +1,80 @@
echo both
units metal
atom_style atomic
atom_modify map hash
boundary p p p
variable l equal 3
variable l2 equal 0.5*$l
variable L equal 10
variable L2 equal 0.5*$L
variable h equal $L
lattice fcc 4.08 origin 0.25 0.25 0.25
region BOX block -${l2} ${l2} -${L2} ${L2} -${l2} ${l2}
create_box 1 BOX
create_atoms 1 region BOX
pair_style eam
pair_coeff * * Au_u3.eam
mass * 196.97
### NOTE change to CB -linear
fix PP all atc field Au_elastic.mat
fix_modify PP mesh create 1 $h 1 BOX p f p
fix_modify PP fields add displacement velocity potential_energy cauchy_born_energy # kinetic_energy
fix_modify PP gradients add displacement
fix_modify PP set reference_potential_energy
fix_modify PP output counter step
fix_modify PP output eam_energyPP 1 text
fix ATC all atc elastic Au_elastic.mat
fix_modify ATC mesh create 1 $h 1 BOX p f p
fix_modify ATC internal_quadrature off
fix_modify ATC control momentum none
#fix_modify ATC consistent_fe_initialization on
fix_modify ATC output counter step
fix_modify ATC output eam_energyFE 1 text binary
fix_modify ATC material all Au_cubic
dump CONFIG all custom 1 eam_energy.dmp id type x y z
thermo 1
timestep 0 # 1.e-20 # 0
variable e0 equal pe
variable L0 equal ly
run 0
variable pe equal pe-${e0}
variable dL equal ly-${L0}
variable strain equal v_dL/${L0}
variable x equal y[1]
variable x2 equal y[2]
variable v equal vy[1]
thermo_style custom step etotal v_pe ke f_ATC[1] f_ATC[2] v_x v_v v_x2 ly v_dL v_strain
thermo_modify format 2 %15.8g
###############################################################################
log eam_energy.log
run 1
velocity all set 0 0.1 0 units box
fix_modify ATC fix velocity y all 0.1
run 1
velocity all set 0 0.2 0 units box
fix_modify ATC fix velocity y all 0.2
run 1
velocity all set 0 0.3 0 units box
fix_modify ATC fix velocity y all 0.3
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.01 0 0
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.0201 0 0
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.030301 0 0
run 1
echo both
units metal
atom_style atomic
atom_modify map hash
boundary p p p
variable l equal 3
variable l2 equal 0.5*$l
variable L equal 10
variable L2 equal 0.5*$L
variable h equal $L
lattice fcc 4.08 origin 0.25 0.25 0.25
region BOX block -${l2} ${l2} -${L2} ${L2} -${l2} ${l2}
create_box 1 BOX
create_atoms 1 region BOX
pair_style eam
pair_coeff * * Au_u3.eam
mass * 196.97
### NOTE change to CB -linear
fix PP all atc field Au_elastic.mat
fix_modify PP mesh create 1 $h 1 BOX p f p
fix_modify PP fields add displacement velocity potential_energy cauchy_born_energy # kinetic_energy
fix_modify PP gradients add displacement
fix_modify PP set reference_potential_energy
fix_modify PP output counter step
fix_modify PP output eam_energyPP 1 text
fix ATC all atc elastic Au_elastic.mat
fix_modify ATC mesh create 1 $h 1 BOX p f p
fix_modify ATC internal_quadrature off
fix_modify ATC control momentum none
#fix_modify ATC consistent_fe_initialization on
fix_modify ATC output counter step
fix_modify ATC output eam_energyFE 1 text binary
fix_modify ATC material all Au_cubic
dump CONFIG all custom 1 eam_energy.dmp id type x y z
thermo 1
timestep 0 # 1.e-20 # 0
variable e0 equal pe
variable L0 equal ly
run 0
variable pe equal pe-${e0}
variable dL equal ly-${L0}
variable strain equal v_dL/${L0}
variable x equal y[1]
variable x2 equal y[2]
variable v equal vy[1]
thermo_style custom step etotal v_pe ke f_ATC[1] f_ATC[2] v_x v_v v_x2 ly v_dL v_strain
thermo_modify format 2 %15.8g
###############################################################################
log eam_energy.log
run 1
velocity all set 0 0.1 0 units box
fix_modify ATC fix velocity y all 0.1
run 1
velocity all set 0 0.2 0 units box
fix_modify ATC fix velocity y all 0.2
run 1
velocity all set 0 0.3 0 units box
fix_modify ATC fix velocity y all 0.3
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.01 0 0
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.0201 0 0
run 1
change_box all y scale 1.01 remap
fix_modify ATC fix displacement y all linear 0 0 0 0 0.030301 0 0
run 1

View File

@ -1,74 +1,74 @@
# needs description
echo both
units metal
# PARAMETERS-----------------------------
variable s equal 1
variable L equal 10
variable e equal 4
variable E equal 0.0001
variable V equal $E*$L
# END -----------------------------------
atom_style atomic
lattice diamond 1.0
boundary f p p
region box block -$L $L 0 1 0 1
create_box 1 box
group box region box
atom_modify sort 0 1
timestep 0.0
mass * 12.01
# coupling
### NOTE ATC: material cnt does not provide all interfaces for charge_density physics and will be treated as null
fix AtC box atc electrostatic-equilibrium CNT.mat
fix_modify AtC internal_quadrature off
#fix_modify AtC atom_weight constant internal 1.0 NOTE penultimate is a group
fix_modify AtC atom_weight constant box 1.0
fix_modify AtC omit atomic_charge
fix_modify AtC mesh create $e 1 1 box f p p
#fix_modify AtC control momentum flux
fix_modify AtC mesh create_elementset all -INF INF -INF INF -INF INF
# bcs/ics conditions
fix_modify AtC fix displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC fix velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
fix_modify AtC mesh create_nodeset lbc -10 -10 INF INF INF INF
fix_modify AtC mesh create_nodeset rbc 10 10 INF INF INF INF
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 $V
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 $V
# run
thermo_style custom step cpu etotal ke
thermo $s
fix_modify AtC output electron_densityFE $s text
fix_modify AtC output index step
log electron_density.log
# run default material
print "default material - table linear"
run $s
# run CNT1 material
print "CNT1 material - analytical linear"
fix_modify AtC material all CNT1
run $s
# run CNT2 material
print "CNT2 material - analytical exponetial"
fix_modify AtC material all CNT2
run $s
# run CNT material
print "CNT material - table DOS"
fix_modify AtC material all CNT
#variable E equal 10*$E
#fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 $V
#fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 $V
run $s
# needs description
echo both
units metal
# PARAMETERS-----------------------------
variable s equal 1
variable L equal 10
variable e equal 4
variable E equal 0.0001
variable V equal $E*$L
# END -----------------------------------
atom_style atomic
lattice diamond 1.0
boundary f p p
region box block -$L $L 0 1 0 1
create_box 1 box
group box region box
atom_modify sort 0 1
timestep 0.0
mass * 12.01
# coupling
### NOTE ATC: material cnt does not provide all interfaces for charge_density physics and will be treated as null
fix AtC box atc electrostatic-equilibrium CNT.mat
fix_modify AtC internal_quadrature off
#fix_modify AtC atom_weight constant internal 1.0 NOTE penultimate is a group
fix_modify AtC atom_weight constant box 1.0
fix_modify AtC omit atomic_charge
fix_modify AtC mesh create $e 1 1 box f p p
#fix_modify AtC control momentum flux
fix_modify AtC mesh create_elementset all -INF INF -INF INF -INF INF
# bcs/ics conditions
fix_modify AtC fix displacement x all 0.0
fix_modify AtC fix displacement y all 0.0
fix_modify AtC fix displacement z all 0.0
fix_modify AtC fix velocity x all 0.0
fix_modify AtC fix velocity y all 0.0
fix_modify AtC fix velocity z all 0.0
fix_modify AtC mesh create_nodeset lbc -10 -10 INF INF INF INF
fix_modify AtC mesh create_nodeset rbc 10 10 INF INF INF INF
fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 $V
fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 $V
# run
thermo_style custom step cpu etotal ke
thermo $s
fix_modify AtC output electron_densityFE $s text
fix_modify AtC output index step
log electron_density.log
# run default material
print "default material - table linear"
run $s
# run CNT1 material
print "CNT1 material - analytical linear"
fix_modify AtC material all CNT1
run $s
# run CNT2 material
print "CNT2 material - analytical exponetial"
fix_modify AtC material all CNT2
run $s
# run CNT material
print "CNT material - table DOS"
fix_modify AtC material all CNT
#variable E equal 10*$E
#fix_modify AtC fix electric_potential lbc linear 0 0 0 $E 0 0 $V
#fix_modify AtC fix electric_potential rbc linear 0 0 0 $E 0 0 $V
run $s

View File

@ -1,56 +1,56 @@
echo both
units real
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdRegion block -12 12 -3 3 -3 3
region mdInternal block -10 10 -3 3 -3 3
# create atoms
boundary f p p
create_box 1 mdRegion
create_atoms 1 region mdRegion
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
# specify interal/ghost atoms
group internal region mdInternal
velocity internal create 40 87287 mom yes loop geom # <<< NOTE
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC1d_hex.mesh
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# turn on thermostat
fix_modify AtC extrinsic exchange off
fix_modify AtC control thermal rescale 10
# equilibrate MD field
timestep 5.0
thermo 10
#output
fix_modify AtC output gaussianIC1d_hexFE 10 text
# change thermostat
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
# run with FE
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
reset_timestep 0
run 100 # 400
echo both
units real
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdRegion block -12 12 -3 3 -3 3
region mdInternal block -10 10 -3 3 -3 3
# create atoms
boundary f p p
create_box 1 mdRegion
create_atoms 1 region mdRegion
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
# specify interal/ghost atoms
group internal region mdInternal
velocity internal create 40 87287 mom yes loop geom # <<< NOTE
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC1d_hex.mesh
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# turn on thermostat
fix_modify AtC extrinsic exchange off
fix_modify AtC control thermal rescale 10
# equilibrate MD field
timestep 5.0
thermo 10
#output
fix_modify AtC output gaussianIC1d_hexFE 10 text
# change thermostat
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
# run with FE
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
reset_timestep 0
run 100 # 400

View File

@ -1,69 +1,69 @@
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdRegion cylinder z 0. 0. ${l2} -$w $w
region mdInternal cylinder z 0. 0. $l -$w $w
boundary f f f
pair_style lj/cut 13.5
read_data circle_temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
group ghost subtract all internal
fix AtC internal atc two_temperature Ar_ttm.mat
# computational geometry
fix_modify AtC mesh read gaussianIC2d_hex.mesh
#fix_modify AtC mesh read gaussianIC2d_hex.exo
#fix_modify AtC mesh read gaussianIC2d_hex2.exo
#fix_modify AtC mesh read gaussianIC2d_hex2.mesh
fix_modify AtC mesh write parsed_gaussianIC2d_hex.mesh
fix_modify AtC mesh output gaussianIC2d_hexMESH
fix_modify AtC boundary ghost
# numerical parameters
fix_modify AtC time_integration fractional_step
fix_modify AtC internal_quadrature off
# initial conditions
fix_modify AtC fix temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# thermostat
fix_modify AtC control thermal rescale 10
fix_modify AtC extrinsic exchange off
# run to equilibrate
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 400
# boundary conditions
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
# numerical parameters
fix_modify AtC extrinsic electron_integration explicit 10
# thermostat
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
# output
fix_modify AtC output gaussianIC2d_hexFE 10 full_text binary
dump D1 all atom 10 gaussianIC2d_hex.dmp
# relax the system
run 1000
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdRegion cylinder z 0. 0. ${l2} -$w $w
region mdInternal cylinder z 0. 0. $l -$w $w
boundary f f f
pair_style lj/cut 13.5
read_data circle_temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
group ghost subtract all internal
fix AtC internal atc two_temperature Ar_ttm.mat
# computational geometry
fix_modify AtC mesh read gaussianIC2d_hex.mesh
#fix_modify AtC mesh read gaussianIC2d_hex.exo
#fix_modify AtC mesh read gaussianIC2d_hex2.exo
#fix_modify AtC mesh read gaussianIC2d_hex2.mesh
fix_modify AtC mesh write parsed_gaussianIC2d_hex.mesh
fix_modify AtC mesh output gaussianIC2d_hexMESH
fix_modify AtC boundary ghost
# numerical parameters
fix_modify AtC time_integration fractional_step
fix_modify AtC internal_quadrature off
# initial conditions
fix_modify AtC fix temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# thermostat
fix_modify AtC control thermal rescale 10
fix_modify AtC extrinsic exchange off
# run to equilibrate
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 400
# boundary conditions
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
# numerical parameters
fix_modify AtC extrinsic electron_integration explicit 10
# thermostat
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
# output
fix_modify AtC output gaussianIC2d_hexFE 10 full_text binary
dump D1 all atom 10 gaussianIC2d_hex.dmp
# relax the system
run 1000

View File

@ -1,37 +1,37 @@
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_hex20_uniform.mesh
fix_modify AtC output gaussianIC2d_hex20_uniformFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_hex20_uniform.mesh
fix_modify AtC output gaussianIC2d_hex20_uniformFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100

View File

@ -1,37 +1,37 @@
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_hex27_uniform.mesh
fix_modify AtC output gaussianIC2d_hex27_uniformFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_hex27_uniform.mesh
fix_modify AtC output gaussianIC2d_hex27_uniformFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100

View File

@ -1,40 +1,40 @@
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_tet.mesh
#fix_modify AtC mesh read gaussianIC2d_tet.exo
fix_modify AtC mesh write parsed_gaussianIC2d_tet.mesh
fix_modify AtC mesh output parsed_gaussianIC2d_tetMESH
fix_modify AtC output gaussianIC2d_tetFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100
echo both
units real
atom_style atomic
variable L equal 12
variable l2 equal 6
variable l equal 4
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region mdInternal block -$l $l -$l $l -$w $w
boundary f f f # p
pair_style lj/cut 13.5
read_data temp.init
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
mass 1 39.95
pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
fix AtC internal atc two_temperature Ar_ttm.mat
fix_modify AtC mesh read gaussianIC2d_tet.mesh
#fix_modify AtC mesh read gaussianIC2d_tet.exo
fix_modify AtC mesh write parsed_gaussianIC2d_tet.mesh
fix_modify AtC mesh output parsed_gaussianIC2d_tetMESH
fix_modify AtC output gaussianIC2d_tetFE 10 full_text
fix_modify AtC initial temperature all 20.0
# NOTE this is only gaussian in x
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix temperature 11 20.0
fix_modify AtC fix temperature 12 20.0
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
timestep 1.0
thermo 10
run 100

View File

@ -1,32 +1,32 @@
echo both
units real
atom_style atomic
# correct mass density = 1.0120
# NOTE the mesh is not currently periodic, so the density estimate is off by a factor of 2
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc hardy
fix_modify AtC kernel quartic_cylinder 5.0
fix_modify AtC mesh read gaussianIC2d_hex.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output kernel2d_hexFE 1 full_text binary
#dump CONFIG all custom 1 kernel2d_hexMD.dmp id type x y z
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2
echo both
units real
atom_style atomic
# correct mass density = 1.0120
# NOTE the mesh is not currently periodic, so the density estimate is off by a factor of 2
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc hardy
fix_modify AtC kernel quartic_cylinder 5.0
fix_modify AtC mesh read gaussianIC2d_hex.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output kernel2d_hexFE 1 full_text binary
#dump CONFIG all custom 1 kernel2d_hexMD.dmp id type x y z
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2

View File

@ -1,28 +1,28 @@
echo both
units real
atom_style atomic
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc hardy
fix_modify AtC kernel quartic_sphere 5.0
fix_modify AtC mesh read gaussianIC2d_tet.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output kernel2d_tetFE 1 full_text binary
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2
echo both
units real
atom_style atomic
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc hardy
fix_modify AtC kernel quartic_sphere 5.0
fix_modify AtC mesh read gaussianIC2d_tet.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output kernel2d_tetFE 1 full_text binary
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2

View File

@ -1,29 +1,29 @@
echo both
units real
atom_style atomic
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc field
fix_modify AtC mesh read gaussianIC2d_tet.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output mesh2d_tetFE 1 full_text binary
dump CONFIG all custom 10 mesh2d_tet.dmp id type x y z
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2
echo both
units real
atom_style atomic
variable L equal 6
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
region BOX block -$L $L -$L $L -$w $w
boundary f f p
create_box 1 BOX
create_atoms 1 region BOX
mass 1 39.95
pair_style lj/cut 13.5
pair_coeff 1 1 .238 3.405 13.5
group internal region BOX
fix AtC internal atc field
fix_modify AtC mesh read gaussianIC2d_tet.mesh
fix_modify AtC fields add mass_density
fix_modify AtC output mesh2d_tetFE 1 full_text binary
dump CONFIG all custom 10 mesh2d_tet.dmp id type x y z
thermo_style custom step cpu temp
timestep 0.0
thermo 1
run 2

View File

@ -1,101 +1,101 @@
# this input can be used to generate the benchmark for in.gaussianIC2d_hex_uniform
echo both
units real
atom_style atomic
variable l equal 8
variable g equal 2
variable lg equal $l+$g
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
boundary f f f
# region to create atoms
region bigCyl cylinder z 0. 0. ${lg} -$w $w
region offsetPlane block -${lg} $g -${lg} ${lg} -$w $w
region mdRegion intersect 2 bigCyl offsetPlane
#create_box 1 mdRegion
pair_style lj/cut 13.5
read_data semicircle.init
# region for internal atoms
region mdInternalCyl cylinder z 0. 0. $l -$w $w
region leftHalfPlane block INF 0. INF INF INF INF
region mdInternal intersect 2 mdInternalCyl leftHalfPlane
# region for coupling ghosts
region rightHalfPlane block 0. INF INF INF INF INF
region mdGhost union 2 rightHalfPlane mdInternal side out
#create_atoms 1 region mdRegion
#create_atoms 1 region mdInternal
#create_atoms 2 region mdGhost
#region outerGhost intersect 2 rightHalfPlane mdRegion
#create_atoms 3 region outerGhost
#pair_style lj/cut 13.5
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
#mass 1 39.95
#pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
group ghost region mdGhost
#velocity internal create 40 102486 mom yes rot yes dist gaussian
#write_restart semicircle_init.rst
# ATC commands
fix AtC internal atc thermal Ar_ttm.mat
fix_modify AtC boundary ghost
fix_modify AtC mesh read semicircle.mesh f f p
fix_modify AtC mesh nodeset_to_elementset 2 hole min
fix_modify AtC internal_quadrature off
fix_modify AtC time_integration fractional_step
# initial conditions
fix_modify AtC fix temperature all 20.
fix_modify AtC control thermal rescale 10
fix_modify AtC control tolerance 1.e-14 # tolerance needed to produce consistent parallel and serial results
# initial output
#fix_modify AtC mesh output semicircle_mesh
#fix_modify AtC output semicircle_init 100 text binary
#dump D1 all atom 100 semicircle_init.dmp
# run
timestep 5.0
thermo 100
run 500
# boundary conditions
fix_modify AtC unfix temperature all
fix_modify AtC fix temperature 1 20.
fix_modify AtC control thermal flux
fix_modify AtC control localized_lambda on
# NOTE appears to be a problem with the temporal ramp function
variable delta_t equal 1000*5.
fix_modify AtC source temperature hole temporal_ramp 0. 0.0000000001 ${delta_t}
# equilibrate filter
fix_modify AtC filter type exponential
fix_modify AtC filter scale 1000.
fix_modify AtC filter on
# equilibration output
fix_modify AtC output semicircleFE 100 full_text #binary
#undump D1
#dump D1 all atom 100 semicircle_equil.dmp
# run
fix_modify AtC reset_time 0.
reset_timestep 0
thermo 100
run 1000
# heat source
# NOTE second run omitted as it causes diffs in parallel execution after just one timestep, not sure why
#fix_modify AtC source temperature hole 0.0000000001
#fix_modify AtC output semicircleFE 1 full_text #binary
#undump D1
#dump D1 all atom 100 semicircle.dmp
#run 1#000
# this input can be used to generate the benchmark for in.gaussianIC2d_hex_uniform
echo both
units real
atom_style atomic
variable l equal 8
variable g equal 2
variable lg equal $l+$g
variable w equal 2
lattice fcc 5.405 origin 0.25 0.25 0.25
boundary f f f
# region to create atoms
region bigCyl cylinder z 0. 0. ${lg} -$w $w
region offsetPlane block -${lg} $g -${lg} ${lg} -$w $w
region mdRegion intersect 2 bigCyl offsetPlane
#create_box 1 mdRegion
pair_style lj/cut 13.5
read_data semicircle.init
# region for internal atoms
region mdInternalCyl cylinder z 0. 0. $l -$w $w
region leftHalfPlane block INF 0. INF INF INF INF
region mdInternal intersect 2 mdInternalCyl leftHalfPlane
# region for coupling ghosts
region rightHalfPlane block 0. INF INF INF INF INF
region mdGhost union 2 rightHalfPlane mdInternal side out
#create_atoms 1 region mdRegion
#create_atoms 1 region mdInternal
#create_atoms 2 region mdGhost
#region outerGhost intersect 2 rightHalfPlane mdRegion
#create_atoms 3 region outerGhost
#pair_style lj/cut 13.5
fix ZWALLS all wall/reflect zlo EDGE zhi EDGE
#mass 1 39.95
#pair_coeff 1 1 .238 3.405 13.5
group internal region mdInternal
group ghost region mdGhost
#velocity internal create 40 102486 mom yes rot yes dist gaussian
#write_restart semicircle_init.rst
# ATC commands
fix AtC internal atc thermal Ar_ttm.mat
fix_modify AtC boundary ghost
fix_modify AtC mesh read semicircle.mesh f f p
fix_modify AtC mesh nodeset_to_elementset 2 hole min
fix_modify AtC internal_quadrature off
fix_modify AtC time_integration fractional_step
# initial conditions
fix_modify AtC fix temperature all 20.
fix_modify AtC control thermal rescale 10
fix_modify AtC control tolerance 1.e-14 # tolerance needed to produce consistent parallel and serial results
# initial output
#fix_modify AtC mesh output semicircle_mesh
#fix_modify AtC output semicircle_init 100 text binary
#dump D1 all atom 100 semicircle_init.dmp
# run
timestep 5.0
thermo 100
run 500
# boundary conditions
fix_modify AtC unfix temperature all
fix_modify AtC fix temperature 1 20.
fix_modify AtC control thermal flux
fix_modify AtC control localized_lambda on
# NOTE appears to be a problem with the temporal ramp function
variable delta_t equal 1000*5.
fix_modify AtC source temperature hole temporal_ramp 0. 0.0000000001 ${delta_t}
# equilibrate filter
fix_modify AtC filter type exponential
fix_modify AtC filter scale 1000.
fix_modify AtC filter on
# equilibration output
fix_modify AtC output semicircleFE 100 full_text #binary
#undump D1
#dump D1 all atom 100 semicircle_equil.dmp
# run
fix_modify AtC reset_time 0.
reset_timestep 0
thermo 100
run 1000
# heat source
# NOTE second run omitted as it causes diffs in parallel execution after just one timestep, not sure why
#fix_modify AtC source temperature hole 0.0000000001
#fix_modify AtC output semicircleFE 1 full_text #binary
#undump D1
#dump D1 all atom 100 semicircle.dmp
#run 1#000

View File

@ -1,56 +1,56 @@
# needs description
#AtC thermal Coupling
#
echo both
units real
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region feRegion block -10 10 -1 1 -1 1
boundary f p p
create_box 1 feRegion
mass 1 39.95 # need to keep this
atom_modify sort 0 1
region dummyRegion block -100 -99 -1 1 -1 1
group dummy region dummyRegion
# ID group atc PhysicsType ParameterFile
fix AtC dummy atc thermal Ar_thermal.mat
timestep 5.0
# ID part keywords nx ny nz region
fix_modify AtC mesh create 10 1 1 feRegion f p p
# fix end temperatures and an internal source
fix_modify AtC initial temperature all 20.0
fix_modify AtC source temperature all 0.0000000000632
fix_modify AtC mesh create_nodeset lbc -10.1 -9.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 9.9 10.1 -INF INF -INF INF
fix_modify AtC fix temperature lbc 20.
fix_modify AtC fix temperature rbc 20.
fix_modify AtC mesh create_elementset middle -4.1 4.1 -INF INF -INF INF
fix_modify AtC material middle Ar2
thermo_style custom step cpu f_AtC[1] f_AtC[2]
fix_modify AtC output no_atomsFE 1000 text binary
thermo 100
run 10000
fix_modify AtC remove_source temperature all
fix_modify AtC unfix temperature rbc
fix_modify AtC fix temperature all 20.
run 1
fix_modify AtC unfix temperature all
reset_timestep 0
# fix one end temperature and the a source at the other
fix_modify AtC fix temperature lbc 20.
fix_modify AtC mesh create_faceset rbcFace plane x 10.0
fix_modify AtC fix_flux temperature rbcFace 0.000000001
fix_modify AtC output no_atoms_flux_FE 1000 text binary # NOTE not used
thermo 100
run 10000
# needs description
#AtC thermal Coupling
#
echo both
units real
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region feRegion block -10 10 -1 1 -1 1
boundary f p p
create_box 1 feRegion
mass 1 39.95 # need to keep this
atom_modify sort 0 1
region dummyRegion block -100 -99 -1 1 -1 1
group dummy region dummyRegion
# ID group atc PhysicsType ParameterFile
fix AtC dummy atc thermal Ar_thermal.mat
timestep 5.0
# ID part keywords nx ny nz region
fix_modify AtC mesh create 10 1 1 feRegion f p p
# fix end temperatures and an internal source
fix_modify AtC initial temperature all 20.0
fix_modify AtC source temperature all 0.0000000000632
fix_modify AtC mesh create_nodeset lbc -10.1 -9.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 9.9 10.1 -INF INF -INF INF
fix_modify AtC fix temperature lbc 20.
fix_modify AtC fix temperature rbc 20.
fix_modify AtC mesh create_elementset middle -4.1 4.1 -INF INF -INF INF
fix_modify AtC material middle Ar2
thermo_style custom step cpu f_AtC[1] f_AtC[2]
fix_modify AtC output no_atomsFE 1000 text binary
thermo 100
run 10000
fix_modify AtC remove_source temperature all
fix_modify AtC unfix temperature rbc
fix_modify AtC fix temperature all 20.
run 1
fix_modify AtC unfix temperature all
reset_timestep 0
# fix one end temperature and the a source at the other
fix_modify AtC fix temperature lbc 20.
fix_modify AtC mesh create_faceset rbcFace plane x 10.0
fix_modify AtC fix_flux temperature rbcFace 0.000000001
fix_modify AtC output no_atoms_flux_FE 1000 text binary # NOTE not used
thermo 100
run 10000

View File

@ -1,87 +1,87 @@
# needs description
#AtC Two temperature Coupling
# DESCRIPTION:
# delete elements from the mesh
# heating and then relaxation
echo both
units metal
variable INF equal 1000
variable T equal 20
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region FE block -8 8 -6 6 0 3
region MD block -7 7 -6 0 0 3
region FREE block -4 4 -6 0 0 3
boundary f f p
# create atoms
#create_box 1 FE
#create_atoms 1 region MD
#group internal region FREE
#mass 1 39.95
#read_data cutout.data
#pair_coeff * * .238 3.405 13.5
#velocity internal create 40 87287 mom yes loop geom
#fix NVE internal nve
#thermo 100
#dump CONFIG all atom 100 cutout.dump
##run 1000
#unfix NVE
#write_restart cutout.rst
pair_style lj/cut 13.5
read_data cutout.init
group internal region FREE
group ghost subtract all internal
timestep 0.002
thermo 20
# allow initial state to relax
fix NVT internal nvt temp $T $T 10 drag 0.2
fix RESCALE internal temp/rescale 25 $T $T 0.05 1.0
run 200
unfix RESCALE
run 800
unfix NVT
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 8 6 1 FE f f p
fix_modify AtC mesh create_elementset wire -4 4 -INF 0 -INF INF
fix_modify AtC mesh create_nodeset gap -4 4 -0 INF -INF INF
fix_modify AtC mesh create_elementset gap -4 4 -0 INF -INF INF
fix_modify AtC mesh delete_elements gap
fix_modify AtC mesh create_faceset bndy box -4 4 -INF 0 -INF INF
fix_modify AtC control thermal flux faceset bndy
# fix a temperature
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all 30.0
fix_modify AtC initial temperature gap 0.0
# relaxation
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output cutoutFE 10 text
fix_modify AtC extrinsic electron_integration implicit
# heating
fix_modify AtC mesh create_nodeset lbc -8 -8 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 8 8 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc 20.
fix_modify AtC fix electron_temperature rbc 20.
fix_modify AtC source electron_temperature wire 0.001
run 200
# relaxation
fix_modify AtC remove_source electron_temperature wire
run 200
# needs description
#AtC Two temperature Coupling
# DESCRIPTION:
# delete elements from the mesh
# heating and then relaxation
echo both
units metal
variable INF equal 1000
variable T equal 20
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region FE block -8 8 -6 6 0 3
region MD block -7 7 -6 0 0 3
region FREE block -4 4 -6 0 0 3
boundary f f p
# create atoms
#create_box 1 FE
#create_atoms 1 region MD
#group internal region FREE
#mass 1 39.95
#read_data cutout.data
#pair_coeff * * .238 3.405 13.5
#velocity internal create 40 87287 mom yes loop geom
#fix NVE internal nve
#thermo 100
#dump CONFIG all atom 100 cutout.dump
##run 1000
#unfix NVE
#write_restart cutout.rst
pair_style lj/cut 13.5
read_data cutout.init
group internal region FREE
group ghost subtract all internal
timestep 0.002
thermo 20
# allow initial state to relax
fix NVT internal nvt temp $T $T 10 drag 0.2
fix RESCALE internal temp/rescale 25 $T $T 0.05 1.0
run 200
unfix RESCALE
run 800
unfix NVT
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 8 6 1 FE f f p
fix_modify AtC mesh create_elementset wire -4 4 -INF 0 -INF INF
fix_modify AtC mesh create_nodeset gap -4 4 -0 INF -INF INF
fix_modify AtC mesh create_elementset gap -4 4 -0 INF -INF INF
fix_modify AtC mesh delete_elements gap
fix_modify AtC mesh create_faceset bndy box -4 4 -INF 0 -INF INF
fix_modify AtC control thermal flux faceset bndy
# fix a temperature
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all 30.0
fix_modify AtC initial temperature gap 0.0
# relaxation
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output cutoutFE 10 text
fix_modify AtC extrinsic electron_integration implicit
# heating
fix_modify AtC mesh create_nodeset lbc -8 -8 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 8 8 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc 20.
fix_modify AtC fix electron_temperature rbc 20.
fix_modify AtC source electron_temperature wire 0.001
run 200
# relaxation
fix_modify AtC remove_source electron_temperature wire
run 200

View File

@ -1,94 +1,94 @@
#AtC Two temperature Coupling
# DESCRIPTION:
# full overlap of MD and FE regions w/ free ends & lateral periodic bcs
# initial gaussian electron temperature profile and uniform phonon temperature
# results in fast exchange followed by slower diffusion and finally relaxation
# to equilibrium
#
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3,
# where N = 4 for fcc,
# s = 3.405 A (Wagner)
# a = 5.25 A (Ashcroft & Mermin, p. 70)
# to create restart :
# write_restart temp.bin
# then : restart2data temp.bin temp.init
#if {restart}
boundary f p p
pair_style lj/cut 13.5
read_data temp.init
#endif
lattice fcc 5.405 origin 0.25 0.25 0.25
region feRegion block -10 10 -3 3 -3 3
region mdRegion block -12 12 -3 3 -3 3
region mdInternal block -10 10 -3 3 -3 3
# create atoms, NOTE commented out for restart
#if !{restart}
#boundary f p p
#create_box 1 mdRegion
#create_atoms 1 region mdRegion
#mass 1 39.95
#pair_style lj/cut 13.5
#pair_coeff 1 1 .238 3.405 13.5
#velocity internal create 40 87287 mom yes loop geom
#endif
# specify interal/ghost atoms
group internal region mdInternal
# do not define ghosts if outside fe region
#group ghost subtract all internal
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 10 1 1 feRegion f p p
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# turn on thermostat
fix_modify AtC extrinsic exchange off
fix_modify AtC control thermal rescale 10
# equilibrate MD field
timestep 5.0
#timestep 0.1
thermo 10
#if !{restart}
#run 1000
#endif
# write restart file (for atoms)
#if !{restart}
#write_restart gaussianT0.dat
#endif
#output
fix_modify AtC output gaussianIC_ttmFE 10 text
# change thermostat
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
# run with FE
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
reset_timestep 0
run 400
#AtC Two temperature Coupling
# DESCRIPTION:
# full overlap of MD and FE regions w/ free ends & lateral periodic bcs
# initial gaussian electron temperature profile and uniform phonon temperature
# results in fast exchange followed by slower diffusion and finally relaxation
# to equilibrium
#
echo both
units real
atom_style atomic
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3,
# where N = 4 for fcc,
# s = 3.405 A (Wagner)
# a = 5.25 A (Ashcroft & Mermin, p. 70)
# to create restart :
# write_restart temp.bin
# then : restart2data temp.bin temp.init
#if {restart}
boundary f p p
pair_style lj/cut 13.5
read_data temp.init
#endif
lattice fcc 5.405 origin 0.25 0.25 0.25
region feRegion block -10 10 -3 3 -3 3
region mdRegion block -12 12 -3 3 -3 3
region mdInternal block -10 10 -3 3 -3 3
# create atoms, NOTE commented out for restart
#if !{restart}
#boundary f p p
#create_box 1 mdRegion
#create_atoms 1 region mdRegion
#mass 1 39.95
#pair_style lj/cut 13.5
#pair_coeff 1 1 .238 3.405 13.5
#velocity internal create 40 87287 mom yes loop geom
#endif
# specify interal/ghost atoms
group internal region mdInternal
# do not define ghosts if outside fe region
#group ghost subtract all internal
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 10 1 1 feRegion f p p
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC initial temperature all 20.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
fix_modify AtC fix electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# turn on thermostat
fix_modify AtC extrinsic exchange off
fix_modify AtC control thermal rescale 10
# equilibrate MD field
timestep 5.0
#timestep 0.1
thermo 10
#if !{restart}
#run 1000
#endif
# write restart file (for atoms)
#if !{restart}
#write_restart gaussianT0.dat
#endif
#output
fix_modify AtC output gaussianIC_ttmFE 10 text
# change thermostat
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
fix_modify AtC extrinsic exchange on
fix_modify AtC extrinsic electron_integration explicit 10
# run with FE
thermo_style custom step temp pe f_AtC[2] f_AtC[4]
reset_timestep 0
run 400

View File

@ -1,61 +1,61 @@
# needs description
#AtC Two temperature Coupling
# DESCRIPTION:
# no atoms and FE regions with periodic boundary conditions.
# heating and then relaxation
echo both
#units real
units metal
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region simRegion block -14 14 -3 3 -3 3
region feRegion block -12 12 -3 3 -3 3
# need to create atoms or lammps throws an error
region mdRegion block -12 12 -3 3 -3 3
boundary f p p
create_box 1 mdRegion
mass 1 39.95 # need to keep this
atom_modify sort 0 1
region dummyRegion block -100 -99 -1 1 -1 1
group dummy region dummyRegion
# ID group atc PhysicsType ParameterFile
fix AtC dummy atc two_temperature Cu_ttm.mat
timestep 0.002
thermo 20
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 feRegion f p p
# fix a temperature
fix_modify AtC initial temperature all 20.0
#fix_modify AtC initial electron_temperature all 30.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# relaxation
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output no_atomsFE 10 text
#fix_modify AtC extrinsic electron_integration subcycle 100
fix_modify AtC extrinsic electron_integration implicit
run 400
# heating
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc 20.
fix_modify AtC fix electron_temperature rbc 20.
#fix_modify AtC extrinsic exchange off
#fix_modify AtC fix temperature lbc 20.
#fix_modify AtC fix temperature rbc 20.
#fix_modify AtC extrinsic electron_integration lockstep
#fix_modify AtC source electron_temperature all 1000.0
fix_modify AtC source electron_temperature all 0.521981
run 400
# relaxation
fix_modify AtC remove_source electron_temperature all
run 400
# needs description
#AtC Two temperature Coupling
# DESCRIPTION:
# no atoms and FE regions with periodic boundary conditions.
# heating and then relaxation
echo both
#units real
units metal
atom_style atomic
lattice fcc 5.405 origin 0.25 0.25 0.25
region simRegion block -14 14 -3 3 -3 3
region feRegion block -12 12 -3 3 -3 3
# need to create atoms or lammps throws an error
region mdRegion block -12 12 -3 3 -3 3
boundary f p p
create_box 1 mdRegion
mass 1 39.95 # need to keep this
atom_modify sort 0 1
region dummyRegion block -100 -99 -1 1 -1 1
group dummy region dummyRegion
# ID group atc PhysicsType ParameterFile
fix AtC dummy atc two_temperature Cu_ttm.mat
timestep 0.002
thermo 20
# ID part keywords nx ny nz region
fix_modify AtC mesh create 12 1 1 feRegion f p p
# fix a temperature
fix_modify AtC initial temperature all 20.0
#fix_modify AtC initial electron_temperature all 30.0
fix_modify AtC initial electron_temperature all gaussian 0 0 0 1 0 0 5 20 20
# relaxation
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4]
fix_modify AtC output no_atomsFE 10 text
#fix_modify AtC extrinsic electron_integration subcycle 100
fix_modify AtC extrinsic electron_integration implicit
run 400
# heating
fix_modify AtC mesh create_nodeset lbc -12.1 -11.9 -INF INF -INF INF
fix_modify AtC mesh create_nodeset rbc 11.9 12.1 -INF INF -INF INF
fix_modify AtC fix electron_temperature lbc 20.
fix_modify AtC fix electron_temperature rbc 20.
#fix_modify AtC extrinsic exchange off
#fix_modify AtC fix temperature lbc 20.
#fix_modify AtC fix temperature rbc 20.
#fix_modify AtC extrinsic electron_integration lockstep
#fix_modify AtC source electron_temperature all 1000.0
fix_modify AtC source electron_temperature all 0.521981
run 400
# relaxation
fix_modify AtC remove_source electron_temperature all
run 400

View File

@ -1,66 +1,66 @@
#AtC Two temperature Coupling
# DESCRIPTION:
# full overlap of MD and FE regions with full periodic boundary conditions.
# initial electron and phonon temperatures are different and then allowed to
# relax.
#
units real
atom_style atomic
boundary p p p
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3,
# where N = 4 for fcc,
# s = 3.405 A (Wagner)
# a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
pair_style lj/cut 13.5
read_data uniform_exchange.init
region simRegion block -12 12 -3 3 -3 3
region feRegion block -12 12 -3 3 -3 3
# create atoms
region mdRegion block -12 12 -3 3 -3 3
# specify interal/ghost atoms
region mdInternal block -12 12 -3 3 -3 3
group internal region mdInternal
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 4 1 1 feRegion p p p
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC fix electron_temperature all 30.0
timestep 5.0
# output
thermo_style custom step pe temp f_AtC[2] f_AtC[4]
thermo 10
# equilibrate MD field
fix_modify AtC control thermal rescale 13
run 500
# relax
fix_modify AtC output uniform_exchangeFE 100 text
fix_modify AtC filter type exponential
fix_modify AtC filter scale 5.0e2
fix_modify AtC filter on
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
# run with FE
run 5000
#AtC Two temperature Coupling
# DESCRIPTION:
# full overlap of MD and FE regions with full periodic boundary conditions.
# initial electron and phonon temperatures are different and then allowed to
# relax.
#
units real
atom_style atomic
boundary p p p
# create domain
#lattice type reduced density rho* = 4*(sigma/a)^3,
# where N = 4 for fcc,
# s = 3.405 A (Wagner)
# a = 5.25 A (Ashcroft & Mermin, p. 70)
lattice fcc 5.405 origin 0.25 0.25 0.25
pair_style lj/cut 13.5
read_data uniform_exchange.init
region simRegion block -12 12 -3 3 -3 3
region feRegion block -12 12 -3 3 -3 3
# create atoms
region mdRegion block -12 12 -3 3 -3 3
# specify interal/ghost atoms
region mdInternal block -12 12 -3 3 -3 3
group internal region mdInternal
neighbor 5. bin
neigh_modify every 10 delay 0 check no
# ID group atc PhysicsType ParameterFile
fix AtC internal atc two_temperature Ar_ttm.mat
# ID part keywords nx ny nz region
fix_modify AtC mesh create 4 1 1 feRegion p p p
# fix a temperature
fix_modify AtC fix temperature all 20.0
fix_modify AtC fix electron_temperature all 30.0
timestep 5.0
# output
thermo_style custom step pe temp f_AtC[2] f_AtC[4]
thermo 10
# equilibrate MD field
fix_modify AtC control thermal rescale 13
run 500
# relax
fix_modify AtC output uniform_exchangeFE 100 text
fix_modify AtC filter type exponential
fix_modify AtC filter scale 5.0e2
fix_modify AtC filter on
fix_modify AtC unfix temperature all
fix_modify AtC unfix electron_temperature all
fix_modify AtC control thermal flux
# run with FE
run 5000

View File

@ -1,119 +1,119 @@
Created by AJB
102 atoms
3 atom types
-500.0 500.0 xlo xhi
-500.0 500.0 ylo yhi
-500.0 500.0 zlo zhi
Masses
1 12.01070 # C nuclei
2 1.000794 # H nuclei
3 1.000000 # electron
Atoms
1 1 6.00 0 0.000000 0.223271 2.836177 0.99547
2 1 6.00 0 0.000000 -0.611326 1.278041 3.303884
3 1 6.00 0 0.000000 -0.645795 -1.544681 2.608294
4 1 6.00 0 0.000000 -2.509122 -1.980433 0.419368
5 1 6.00 0 0.000000 -1.674732 -0.422977 -1.889518
6 1 6.00 0 0.000000 -1.640226 2.39965 -1.193097
7 1 6.00 0 0.000000 2.018681 -2.373515 1.79163
8 1 6.00 0 0.000000 2.887596 2.006776 0.178976
9 1 6.00 0 0.000000 0.98999 -1.251962 -2.705445
10 1 6.00 0 0.000000 2.853997 -0.815965 -0.517029
11 2 1.00 0 0.000000 -3.029741 -0.739677 -3.479893
12 2 1.00 0 0.000000 -4.456466 -1.425024 1.003463
13 2 1.00 0 0.000000 -2.581253 -4.027951 -0.074795
14 2 1.00 0 0.000000 -1.252983 -2.67657 4.28622
15 2 1.00 0 0.000000 -2.524731 1.891635 3.93955
16 2 1.00 0 0.000000 0.703394 1.61118 4.917143
17 2 1.00 0 0.000000 0.247516 4.887701 1.501501
18 2 1.00 0 0.000000 2.027034 -4.428006 1.321731
19 2 1.00 0 0.000000 3.379737 -2.105382 3.378244
20 2 1.00 0 0.000000 4.790758 -1.418428 -1.109855
21 2 1.00 0 0.000000 -1.077541 3.552194 -2.865467
22 2 1.00 0 0.000000 -3.572149 3.033181 -0.63782
23 2 1.00 0 0.000000 1.599389 -0.164293 -4.40463
24 2 1.00 0 0.000000 0.980069 -3.286423 -3.255167
25 2 1.00 0 0.000000 4.264224 2.353276 1.736734
26 2 1.00 0 0.000000 3.530575 3.152347 -1.469016
27 3 0.00 1 0.332948 0.223271 2.836177 0.99547
28 3 0.00 -1 0.332948 0.223271 2.836177 0.99547
29 3 0.00 1 0.332948 -0.611326 1.278041 3.303884
30 3 0.00 -1 0.332948 -0.611326 1.278041 3.303884
31 3 0.00 1 0.332948 -0.645795 -1.544681 2.608294
32 3 0.00 -1 0.332948 -0.645795 -1.544681 2.608294
33 3 0.00 1 0.332948 -2.509122 -1.980433 0.419368
34 3 0.00 -1 0.332948 -2.509122 -1.980433 0.419368
35 3 0.00 1 0.332948 -1.674732 -0.422977 -1.889518
36 3 0.00 -1 0.332948 -1.674732 -0.422977 -1.889518
37 3 0.00 1 0.332948 -1.640226 2.39965 -1.193097
38 3 0.00 -1 0.332948 -1.640226 2.39965 -1.193097
39 3 0.00 1 0.332948 2.018681 -2.373515 1.79163
40 3 0.00 -1 0.332948 2.018681 -2.373515 1.79163
41 3 0.00 1 0.332948 2.887596 2.006776 0.178976
42 3 0.00 -1 0.332948 2.887596 2.006776 0.178976
43 3 0.00 1 0.332948 0.98999 -1.251962 -2.705445
44 3 0.00 -1 0.332948 0.98999 -1.251962 -2.705445
45 3 0.00 1 0.332948 2.853997 -0.815965 -0.517029
46 3 0.00 -1 0.332948 2.853997 -0.815965 -0.517029
47 3 0.00 1 1.258000 -0.194028 2.057109 2.149677
48 3 0.00 -1 1.258000 -0.194028 2.057109 2.149677
49 3 0.00 1 1.258000 -0.628561 -0.13332 2.956089
50 3 0.00 -1 1.258000 -0.628561 -0.13332 2.956089
51 3 0.00 1 1.258000 -1.577458 -1.762557 1.513831
52 3 0.00 -1 1.258000 -1.577458 -1.762557 1.513831
53 3 0.00 1 1.258000 -2.091927 -1.201705 -0.735075
54 3 0.00 -1 1.258000 -2.091927 -1.201705 -0.735075
55 3 0.00 1 1.258000 -0.708477 2.617913 -0.098814
56 3 0.00 -1 1.258000 -0.708477 2.617913 -0.098814
57 3 0.00 1 1.258000 -1.657479 0.988336 -1.541308
58 3 0.00 -1 1.258000 -1.657479 0.988336 -1.541308
59 3 0.00 1 1.258000 0.686443 -1.959098 2.199962
60 3 0.00 -1 1.258000 0.686443 -1.959098 2.199962
61 3 0.00 1 1.258000 1.555434 2.421476 0.587223
62 3 0.00 -1 1.258000 1.555434 2.421476 0.587223
63 3 0.00 1 1.258000 -0.342371 -0.83747 -2.297482
64 3 0.00 -1 1.258000 -0.342371 -0.83747 -2.297482
65 3 0.00 1 1.258000 2.436339 -1.59474 0.637301
66 3 0.00 -1 1.258000 2.436339 -1.59474 0.637301
67 3 0.00 1 1.258000 2.870796 0.595405 -0.169027
68 3 0.00 -1 1.258000 2.870796 0.595405 -0.169027
69 3 0.00 1 1.258000 1.921993 -1.033964 -1.611237
70 3 0.00 -1 1.258000 1.921993 -1.033964 -1.611237
71 3 0.00 1 1.543000 -2.632724 -0.646884 -3.013913
72 3 0.00 -1 1.543000 -2.632724 -0.646884 -3.013913
73 3 0.00 1 1.543000 -3.885894 -1.587759 0.832324
74 3 0.00 -1 1.543000 -3.885894 -1.587759 0.832324
75 3 0.00 1 1.543000 -2.560118 -3.428028 0.069995
76 3 0.00 -1 1.543000 -2.560118 -3.428028 0.069995
77 3 0.00 1 1.543000 -1.075077 -2.344927 3.794588
78 3 0.00 -1 1.543000 -1.075077 -2.344927 3.794588
79 3 0.00 1 1.543000 -1.964103 1.711852 3.7533
80 3 0.00 -1 1.543000 -1.964103 1.711852 3.7533
81 3 0.00 1 1.543000 0.318181 1.513571 4.444458
82 3 0.00 -1 1.543000 0.318181 1.513571 4.444458
83 3 0.00 1 1.543000 0.240412 4.286604 1.353234
84 3 0.00 -1 1.543000 0.240412 4.286604 1.353234
85 3 0.00 1 1.543000 2.024586 -3.82604 1.459412
86 3 0.00 -1 1.543000 2.024586 -3.82604 1.459412
87 3 0.00 1 1.543000 2.980948 -2.183945 2.913367
88 3 0.00 -1 1.543000 2.980948 -2.183945 2.913367
89 3 0.00 1 1.543000 4.223287 -1.241907 -0.936157
90 3 0.00 -1 1.543000 4.223287 -1.241907 -0.936157
91 3 0.00 1 1.543000 -1.242407 3.214498 -2.375463
92 3 0.00 -1 1.543000 -1.242407 3.214498 -2.375463
93 3 0.00 1 1.543000 -3.006096 2.847556 -0.800517
94 3 0.00 -1 1.543000 -3.006096 2.847556 -0.800517
95 3 0.00 1 1.543000 1.420835 -0.48298 -3.906769
96 3 0.00 -1 1.543000 1.420835 -0.48298 -3.906769
97 3 0.00 1 1.543000 0.982976 -2.690326 -3.094098
98 3 0.00 -1 1.543000 0.982976 -2.690326 -3.094098
99 3 0.00 1 1.543000 3.860872 2.251751 1.280311
100 3 0.00 -1 1.543000 3.860872 2.251751 1.280311
101 3 0.00 1 1.543000 3.342182 2.816694 -0.986155
102 3 0.00 -1 1.543000 3.342182 2.816694 -0.986155
Created by AJB
102 atoms
3 atom types
-500.0 500.0 xlo xhi
-500.0 500.0 ylo yhi
-500.0 500.0 zlo zhi
Masses
1 12.01070 # C nuclei
2 1.000794 # H nuclei
3 1.000000 # electron
Atoms
1 1 6.00 0 0.000000 0.223271 2.836177 0.99547
2 1 6.00 0 0.000000 -0.611326 1.278041 3.303884
3 1 6.00 0 0.000000 -0.645795 -1.544681 2.608294
4 1 6.00 0 0.000000 -2.509122 -1.980433 0.419368
5 1 6.00 0 0.000000 -1.674732 -0.422977 -1.889518
6 1 6.00 0 0.000000 -1.640226 2.39965 -1.193097
7 1 6.00 0 0.000000 2.018681 -2.373515 1.79163
8 1 6.00 0 0.000000 2.887596 2.006776 0.178976
9 1 6.00 0 0.000000 0.98999 -1.251962 -2.705445
10 1 6.00 0 0.000000 2.853997 -0.815965 -0.517029
11 2 1.00 0 0.000000 -3.029741 -0.739677 -3.479893
12 2 1.00 0 0.000000 -4.456466 -1.425024 1.003463
13 2 1.00 0 0.000000 -2.581253 -4.027951 -0.074795
14 2 1.00 0 0.000000 -1.252983 -2.67657 4.28622
15 2 1.00 0 0.000000 -2.524731 1.891635 3.93955
16 2 1.00 0 0.000000 0.703394 1.61118 4.917143
17 2 1.00 0 0.000000 0.247516 4.887701 1.501501
18 2 1.00 0 0.000000 2.027034 -4.428006 1.321731
19 2 1.00 0 0.000000 3.379737 -2.105382 3.378244
20 2 1.00 0 0.000000 4.790758 -1.418428 -1.109855
21 2 1.00 0 0.000000 -1.077541 3.552194 -2.865467
22 2 1.00 0 0.000000 -3.572149 3.033181 -0.63782
23 2 1.00 0 0.000000 1.599389 -0.164293 -4.40463
24 2 1.00 0 0.000000 0.980069 -3.286423 -3.255167
25 2 1.00 0 0.000000 4.264224 2.353276 1.736734
26 2 1.00 0 0.000000 3.530575 3.152347 -1.469016
27 3 0.00 1 0.332948 0.223271 2.836177 0.99547
28 3 0.00 -1 0.332948 0.223271 2.836177 0.99547
29 3 0.00 1 0.332948 -0.611326 1.278041 3.303884
30 3 0.00 -1 0.332948 -0.611326 1.278041 3.303884
31 3 0.00 1 0.332948 -0.645795 -1.544681 2.608294
32 3 0.00 -1 0.332948 -0.645795 -1.544681 2.608294
33 3 0.00 1 0.332948 -2.509122 -1.980433 0.419368
34 3 0.00 -1 0.332948 -2.509122 -1.980433 0.419368
35 3 0.00 1 0.332948 -1.674732 -0.422977 -1.889518
36 3 0.00 -1 0.332948 -1.674732 -0.422977 -1.889518
37 3 0.00 1 0.332948 -1.640226 2.39965 -1.193097
38 3 0.00 -1 0.332948 -1.640226 2.39965 -1.193097
39 3 0.00 1 0.332948 2.018681 -2.373515 1.79163
40 3 0.00 -1 0.332948 2.018681 -2.373515 1.79163
41 3 0.00 1 0.332948 2.887596 2.006776 0.178976
42 3 0.00 -1 0.332948 2.887596 2.006776 0.178976
43 3 0.00 1 0.332948 0.98999 -1.251962 -2.705445
44 3 0.00 -1 0.332948 0.98999 -1.251962 -2.705445
45 3 0.00 1 0.332948 2.853997 -0.815965 -0.517029
46 3 0.00 -1 0.332948 2.853997 -0.815965 -0.517029
47 3 0.00 1 1.258000 -0.194028 2.057109 2.149677
48 3 0.00 -1 1.258000 -0.194028 2.057109 2.149677
49 3 0.00 1 1.258000 -0.628561 -0.13332 2.956089
50 3 0.00 -1 1.258000 -0.628561 -0.13332 2.956089
51 3 0.00 1 1.258000 -1.577458 -1.762557 1.513831
52 3 0.00 -1 1.258000 -1.577458 -1.762557 1.513831
53 3 0.00 1 1.258000 -2.091927 -1.201705 -0.735075
54 3 0.00 -1 1.258000 -2.091927 -1.201705 -0.735075
55 3 0.00 1 1.258000 -0.708477 2.617913 -0.098814
56 3 0.00 -1 1.258000 -0.708477 2.617913 -0.098814
57 3 0.00 1 1.258000 -1.657479 0.988336 -1.541308
58 3 0.00 -1 1.258000 -1.657479 0.988336 -1.541308
59 3 0.00 1 1.258000 0.686443 -1.959098 2.199962
60 3 0.00 -1 1.258000 0.686443 -1.959098 2.199962
61 3 0.00 1 1.258000 1.555434 2.421476 0.587223
62 3 0.00 -1 1.258000 1.555434 2.421476 0.587223
63 3 0.00 1 1.258000 -0.342371 -0.83747 -2.297482
64 3 0.00 -1 1.258000 -0.342371 -0.83747 -2.297482
65 3 0.00 1 1.258000 2.436339 -1.59474 0.637301
66 3 0.00 -1 1.258000 2.436339 -1.59474 0.637301
67 3 0.00 1 1.258000 2.870796 0.595405 -0.169027
68 3 0.00 -1 1.258000 2.870796 0.595405 -0.169027
69 3 0.00 1 1.258000 1.921993 -1.033964 -1.611237
70 3 0.00 -1 1.258000 1.921993 -1.033964 -1.611237
71 3 0.00 1 1.543000 -2.632724 -0.646884 -3.013913
72 3 0.00 -1 1.543000 -2.632724 -0.646884 -3.013913
73 3 0.00 1 1.543000 -3.885894 -1.587759 0.832324
74 3 0.00 -1 1.543000 -3.885894 -1.587759 0.832324
75 3 0.00 1 1.543000 -2.560118 -3.428028 0.069995
76 3 0.00 -1 1.543000 -2.560118 -3.428028 0.069995
77 3 0.00 1 1.543000 -1.075077 -2.344927 3.794588
78 3 0.00 -1 1.543000 -1.075077 -2.344927 3.794588
79 3 0.00 1 1.543000 -1.964103 1.711852 3.7533
80 3 0.00 -1 1.543000 -1.964103 1.711852 3.7533
81 3 0.00 1 1.543000 0.318181 1.513571 4.444458
82 3 0.00 -1 1.543000 0.318181 1.513571 4.444458
83 3 0.00 1 1.543000 0.240412 4.286604 1.353234
84 3 0.00 -1 1.543000 0.240412 4.286604 1.353234
85 3 0.00 1 1.543000 2.024586 -3.82604 1.459412
86 3 0.00 -1 1.543000 2.024586 -3.82604 1.459412
87 3 0.00 1 1.543000 2.980948 -2.183945 2.913367
88 3 0.00 -1 1.543000 2.980948 -2.183945 2.913367
89 3 0.00 1 1.543000 4.223287 -1.241907 -0.936157
90 3 0.00 -1 1.543000 4.223287 -1.241907 -0.936157
91 3 0.00 1 1.543000 -1.242407 3.214498 -2.375463
92 3 0.00 -1 1.543000 -1.242407 3.214498 -2.375463
93 3 0.00 1 1.543000 -3.006096 2.847556 -0.800517
94 3 0.00 -1 1.543000 -3.006096 2.847556 -0.800517
95 3 0.00 1 1.543000 1.420835 -0.48298 -3.906769
96 3 0.00 -1 1.543000 1.420835 -0.48298 -3.906769
97 3 0.00 1 1.543000 0.982976 -2.690326 -3.094098
98 3 0.00 -1 1.543000 0.982976 -2.690326 -3.094098
99 3 0.00 1 1.543000 3.860872 2.251751 1.280311
100 3 0.00 -1 1.543000 3.860872 2.251751 1.280311
101 3 0.00 1 1.543000 3.342182 2.816694 -0.986155
102 3 0.00 -1 1.543000 3.342182 2.816694 -0.986155

View File

@ -1,118 +1,118 @@
Created by AJB
101 atoms
3 atom types
-50.0 50.0 xlo xhi
-50.0 50.0 ylo yhi
-50.0 50.0 zlo zhi
Masses
1 12.01070 # C nuclei
2 1.000794 # H nuclei
3 1.000000 # electron
Atoms
1 1 6.00 0 0.000000 0.224230 2.918607 1.015812
2 1 6.00 0 0.000000 -0.634450 1.314460 3.390303
3 1 6.00 0 0.000000 -0.670162 -1.590173 2.675707
4 1 6.00 0 0.000000 -2.586695 -2.037708 0.422846
5 1 6.00 0 0.000000 -1.729127 -0.435706 -1.953488
6 1 6.00 0 0.000000 -1.692867 2.468206 -1.236000
7 1 6.00 0 0.000000 2.071281 -2.442011 1.834504
8 1 6.00 0 0.000000 2.965108 2.063979 0.175607
9 1 6.00 0 0.000000 1.013015 -1.288254 -2.791737
10 1 6.00 0 0.000000 2.931847 -0.840220 -0.540904
11 2 1.00 0 0.000000 -3.237070 -0.788493 -3.724286
12 2 1.00 0 0.000000 -4.691469 -1.429253 1.056080
13 2 1.00 0 0.000000 -2.657034 -4.253233 -0.113602
14 2 1.00 0 0.000000 -1.345725 -2.850372 4.543752
15 2 1.00 0 0.000000 -2.707861 1.976434 4.071194
16 2 1.00 0 0.000000 0.794230 1.672161 5.131751
17 2 1.00 0 0.000000 0.251667 5.202465 1.579125
18 2 1.00 0 0.000000 2.074796 -4.663951 1.320307
19 2 1.00 0 0.000000 3.542471 -2.144066 3.551451
20 2 1.00 0 0.000000 5.087753 -1.511020 -1.201338
21 2 1.00 0 0.000000 -1.077021 3.711707 -3.045901
22 2 1.00 0 0.000000 -3.783389 3.148492 -0.629227
23 2 1.00 0 0.000000 1.671766 -0.104421 -4.626344
24 2 1.00 0 0.000000 0.999815 -3.491890 -3.379184
25 2 1.00 0 0.000000 4.450647 2.434018 1.865941
26 2 1.00 0 0.000000 3.654660 3.300997 -1.612081
27 3 0.00 -1 0.328405 -0.634804 1.315020 3.391634
28 3 0.00 -1 0.328107 -0.670512 -1.590826 2.676675
29 3 0.00 -1 0.328405 -2.587889 -2.038591 0.422899
30 3 0.00 -1 0.328107 -1.729909 -0.435889 -1.954405
31 3 0.00 -1 0.328405 -1.693676 2.469262 -1.236661
32 3 0.00 -1 0.328405 2.072091 -2.443067 1.835165
33 3 0.00 -1 0.328405 2.966303 2.064861 0.175553
34 3 0.00 -1 0.328405 1.013370 -1.288814 -2.793067
35 3 0.00 -1 0.328108 2.932965 -0.840567 -0.541247
36 3 0.00 -1 1.326096 -0.210743 2.123398 2.223462
37 3 0.00 -1 1.326096 -0.657351 -0.127988 3.052304
38 3 0.00 -1 1.326093 -1.646634 -1.826737 1.548546
39 3 0.00 -1 1.326095 -2.175416 -1.250260 -0.762988
40 3 0.00 -1 1.326093 -0.747076 2.708081 -0.120938
41 3 0.00 -1 1.326095 -1.722464 1.033139 -1.603613
42 3 0.00 -1 1.326092 0.713852 -2.031645 2.263933
43 3 0.00 -1 1.326092 1.613424 2.503259 0.594420
44 3 0.00 -1 1.326098 -0.351222 -0.870483 -2.392027
45 3 0.00 -1 1.326100 2.512477 -1.657113 0.657756
46 3 0.00 -1 1.326099 2.965428 0.626295 -0.182887
47 3 0.00 -1 1.326101 1.976186 -1.072464 -1.686660
48 3 0.00 -1 1.603792 -2.952851 -0.722000 -3.390526
49 3 0.00 -1 1.558563 -4.265445 -1.534526 0.932369
50 3 0.00 -1 1.558562 -2.625986 -3.810249 -0.010226
51 3 0.00 -1 1.603792 -1.218394 -2.612849 4.191661
52 3 0.00 -1 1.558507 -2.300135 1.839753 3.919625
53 3 0.00 -1 1.558620 0.522041 1.594565 4.774310
54 3 0.00 -1 1.603792 0.246496 4.772002 1.472951
55 3 0.00 -1 1.558582 2.062319 -4.217199 1.410516
56 3 0.00 -1 1.558537 3.245048 -2.186529 3.208486
57 3 0.00 -1 1.603791 4.681408 -1.384588 -1.076860
58 3 0.00 -1 1.558565 -1.184793 3.454906 -2.684898
59 3 0.00 -1 1.558559 -3.365733 3.001032 -0.737405
60 3 0.00 -1 1.558551 1.538708 -0.326106 -4.250794
61 3 0.00 -1 1.558563 0.997214 -3.055912 -3.245768
62 3 0.00 -1 1.558524 4.144833 2.349324 1.538532
63 3 0.00 -1 1.558594 3.503398 3.047996 -1.264247
64 3 0.00 1 0.328107 0.224244 2.919790 1.016104
65 3 0.00 1 0.328405 -0.634804 1.315020 3.391634
66 3 0.00 1 0.328107 -0.670512 -1.590826 2.676675
67 3 0.00 1 0.328405 -2.587889 -2.038591 0.422899
68 3 0.00 1 0.328107 -1.729909 -0.435889 -1.954405
69 3 0.00 1 0.328405 -1.693676 2.469262 -1.236661
70 3 0.00 1 0.328405 2.072091 -2.443067 1.835165
71 3 0.00 1 0.328405 2.966303 2.064861 0.175553
72 3 0.00 1 0.328405 1.013370 -1.288814 -2.793067
73 3 0.00 1 0.328108 2.932965 -0.840567 -0.541247
74 3 0.00 1 1.326096 -0.210743 2.123398 2.223462
75 3 0.00 1 1.326096 -0.657351 -0.127988 3.052304
76 3 0.00 1 1.326093 -1.646634 -1.826737 1.548546
77 3 0.00 1 1.326094 -2.175416 -1.250259 -0.762988
78 3 0.00 1 1.326094 -0.747076 2.708081 -0.120938
79 3 0.00 1 1.326096 -1.722464 1.033139 -1.603613
80 3 0.00 1 1.326092 0.713852 -2.031645 2.263933
81 3 0.00 1 1.326092 1.613424 2.503259 0.594420
82 3 0.00 1 1.326098 -0.351222 -0.870483 -2.392027
83 3 0.00 1 1.326100 2.512477 -1.657113 0.657756
84 3 0.00 1 1.326099 2.965428 0.626295 -0.182887
85 3 0.00 1 1.326101 1.976186 -1.072464 -1.686660
86 3 0.00 1 1.603792 -2.952851 -0.722000 -3.390526
87 3 0.00 1 1.558563 -4.265445 -1.534526 0.932369
88 3 0.00 1 1.558562 -2.625986 -3.810249 -0.010226
89 3 0.00 1 1.603792 -1.218394 -2.612849 4.191661
90 3 0.00 1 1.558507 -2.300135 1.839753 3.919625
91 3 0.00 1 1.558620 0.522041 1.594565 4.774310
92 3 0.00 1 1.603792 0.246496 4.772002 1.472951
93 3 0.00 1 1.558582 2.062319 -4.217199 1.410516
94 3 0.00 1 1.558537 3.245048 -2.186529 3.208486
95 3 0.00 1 1.603791 4.681408 -1.384588 -1.076860
96 3 0.00 1 1.558565 -1.184793 3.454906 -2.684898
97 3 0.00 1 1.558559 -3.365733 3.001032 -0.737405
98 3 0.00 1 1.558551 1.538708 -0.326106 -4.250794
99 3 0.00 1 1.558563 0.997214 -3.055912 -3.245768
100 3 0.00 1 1.558524 4.144833 2.349324 1.538532
101 3 0.00 1 1.558594 3.503398 3.047996 -1.264247
Created by AJB
101 atoms
3 atom types
-50.0 50.0 xlo xhi
-50.0 50.0 ylo yhi
-50.0 50.0 zlo zhi
Masses
1 12.01070 # C nuclei
2 1.000794 # H nuclei
3 1.000000 # electron
Atoms
1 1 6.00 0 0.000000 0.224230 2.918607 1.015812
2 1 6.00 0 0.000000 -0.634450 1.314460 3.390303
3 1 6.00 0 0.000000 -0.670162 -1.590173 2.675707
4 1 6.00 0 0.000000 -2.586695 -2.037708 0.422846
5 1 6.00 0 0.000000 -1.729127 -0.435706 -1.953488
6 1 6.00 0 0.000000 -1.692867 2.468206 -1.236000
7 1 6.00 0 0.000000 2.071281 -2.442011 1.834504
8 1 6.00 0 0.000000 2.965108 2.063979 0.175607
9 1 6.00 0 0.000000 1.013015 -1.288254 -2.791737
10 1 6.00 0 0.000000 2.931847 -0.840220 -0.540904
11 2 1.00 0 0.000000 -3.237070 -0.788493 -3.724286
12 2 1.00 0 0.000000 -4.691469 -1.429253 1.056080
13 2 1.00 0 0.000000 -2.657034 -4.253233 -0.113602
14 2 1.00 0 0.000000 -1.345725 -2.850372 4.543752
15 2 1.00 0 0.000000 -2.707861 1.976434 4.071194
16 2 1.00 0 0.000000 0.794230 1.672161 5.131751
17 2 1.00 0 0.000000 0.251667 5.202465 1.579125
18 2 1.00 0 0.000000 2.074796 -4.663951 1.320307
19 2 1.00 0 0.000000 3.542471 -2.144066 3.551451
20 2 1.00 0 0.000000 5.087753 -1.511020 -1.201338
21 2 1.00 0 0.000000 -1.077021 3.711707 -3.045901
22 2 1.00 0 0.000000 -3.783389 3.148492 -0.629227
23 2 1.00 0 0.000000 1.671766 -0.104421 -4.626344
24 2 1.00 0 0.000000 0.999815 -3.491890 -3.379184
25 2 1.00 0 0.000000 4.450647 2.434018 1.865941
26 2 1.00 0 0.000000 3.654660 3.300997 -1.612081
27 3 0.00 -1 0.328405 -0.634804 1.315020 3.391634
28 3 0.00 -1 0.328107 -0.670512 -1.590826 2.676675
29 3 0.00 -1 0.328405 -2.587889 -2.038591 0.422899
30 3 0.00 -1 0.328107 -1.729909 -0.435889 -1.954405
31 3 0.00 -1 0.328405 -1.693676 2.469262 -1.236661
32 3 0.00 -1 0.328405 2.072091 -2.443067 1.835165
33 3 0.00 -1 0.328405 2.966303 2.064861 0.175553
34 3 0.00 -1 0.328405 1.013370 -1.288814 -2.793067
35 3 0.00 -1 0.328108 2.932965 -0.840567 -0.541247
36 3 0.00 -1 1.326096 -0.210743 2.123398 2.223462
37 3 0.00 -1 1.326096 -0.657351 -0.127988 3.052304
38 3 0.00 -1 1.326093 -1.646634 -1.826737 1.548546
39 3 0.00 -1 1.326095 -2.175416 -1.250260 -0.762988
40 3 0.00 -1 1.326093 -0.747076 2.708081 -0.120938
41 3 0.00 -1 1.326095 -1.722464 1.033139 -1.603613
42 3 0.00 -1 1.326092 0.713852 -2.031645 2.263933
43 3 0.00 -1 1.326092 1.613424 2.503259 0.594420
44 3 0.00 -1 1.326098 -0.351222 -0.870483 -2.392027
45 3 0.00 -1 1.326100 2.512477 -1.657113 0.657756
46 3 0.00 -1 1.326099 2.965428 0.626295 -0.182887
47 3 0.00 -1 1.326101 1.976186 -1.072464 -1.686660
48 3 0.00 -1 1.603792 -2.952851 -0.722000 -3.390526
49 3 0.00 -1 1.558563 -4.265445 -1.534526 0.932369
50 3 0.00 -1 1.558562 -2.625986 -3.810249 -0.010226
51 3 0.00 -1 1.603792 -1.218394 -2.612849 4.191661
52 3 0.00 -1 1.558507 -2.300135 1.839753 3.919625
53 3 0.00 -1 1.558620 0.522041 1.594565 4.774310
54 3 0.00 -1 1.603792 0.246496 4.772002 1.472951
55 3 0.00 -1 1.558582 2.062319 -4.217199 1.410516
56 3 0.00 -1 1.558537 3.245048 -2.186529 3.208486
57 3 0.00 -1 1.603791 4.681408 -1.384588 -1.076860
58 3 0.00 -1 1.558565 -1.184793 3.454906 -2.684898
59 3 0.00 -1 1.558559 -3.365733 3.001032 -0.737405
60 3 0.00 -1 1.558551 1.538708 -0.326106 -4.250794
61 3 0.00 -1 1.558563 0.997214 -3.055912 -3.245768
62 3 0.00 -1 1.558524 4.144833 2.349324 1.538532
63 3 0.00 -1 1.558594 3.503398 3.047996 -1.264247
64 3 0.00 1 0.328107 0.224244 2.919790 1.016104
65 3 0.00 1 0.328405 -0.634804 1.315020 3.391634
66 3 0.00 1 0.328107 -0.670512 -1.590826 2.676675
67 3 0.00 1 0.328405 -2.587889 -2.038591 0.422899
68 3 0.00 1 0.328107 -1.729909 -0.435889 -1.954405
69 3 0.00 1 0.328405 -1.693676 2.469262 -1.236661
70 3 0.00 1 0.328405 2.072091 -2.443067 1.835165
71 3 0.00 1 0.328405 2.966303 2.064861 0.175553
72 3 0.00 1 0.328405 1.013370 -1.288814 -2.793067
73 3 0.00 1 0.328108 2.932965 -0.840567 -0.541247
74 3 0.00 1 1.326096 -0.210743 2.123398 2.223462
75 3 0.00 1 1.326096 -0.657351 -0.127988 3.052304
76 3 0.00 1 1.326093 -1.646634 -1.826737 1.548546
77 3 0.00 1 1.326094 -2.175416 -1.250259 -0.762988
78 3 0.00 1 1.326094 -0.747076 2.708081 -0.120938
79 3 0.00 1 1.326096 -1.722464 1.033139 -1.603613
80 3 0.00 1 1.326092 0.713852 -2.031645 2.263933
81 3 0.00 1 1.326092 1.613424 2.503259 0.594420
82 3 0.00 1 1.326098 -0.351222 -0.870483 -2.392027
83 3 0.00 1 1.326100 2.512477 -1.657113 0.657756
84 3 0.00 1 1.326099 2.965428 0.626295 -0.182887
85 3 0.00 1 1.326101 1.976186 -1.072464 -1.686660
86 3 0.00 1 1.603792 -2.952851 -0.722000 -3.390526
87 3 0.00 1 1.558563 -4.265445 -1.534526 0.932369
88 3 0.00 1 1.558562 -2.625986 -3.810249 -0.010226
89 3 0.00 1 1.603792 -1.218394 -2.612849 4.191661
90 3 0.00 1 1.558507 -2.300135 1.839753 3.919625
91 3 0.00 1 1.558620 0.522041 1.594565 4.774310
92 3 0.00 1 1.603792 0.246496 4.772002 1.472951
93 3 0.00 1 1.558582 2.062319 -4.217199 1.410516
94 3 0.00 1 1.558537 3.245048 -2.186529 3.208486
95 3 0.00 1 1.603791 4.681408 -1.384588 -1.076860
96 3 0.00 1 1.558565 -1.184793 3.454906 -2.684898
97 3 0.00 1 1.558559 -3.365733 3.001032 -0.737405
98 3 0.00 1 1.558551 1.538708 -0.326106 -4.250794
99 3 0.00 1 1.558563 0.997214 -3.055912 -3.245768
100 3 0.00 1 1.558524 4.144833 2.349324 1.538532
101 3 0.00 1 1.558594 3.503398 3.047996 -1.264247

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,63 +1,63 @@
# After running LAMMPS with this input script a number of dump files is created.
# To extract the data from there I used grep script:
# grep '^2 ' *cfg > LammpsResult.dat
# After that after removing some text from LammpsResult.dat,
# the data can be viewed by lebedeva00.plot
#
# Author: Zbigniew Koziol, National Center for Nuclear Research, Poland
# Email: softquake@gmail.com
# ---------- Start simulation ---------------------
clear
units metal
dimension 3
boundary f f f
atom_style atomic
# ========================== Create Atomistic Structure ===========================
region whole block 0 20 0 20 0 10
create_box 2 whole
read_data 2particles.dat add append
region graphite block INF INF INF INF 0 10 units box
group graphite type 1 2
group graphene1 type 1
group graphene2 type 2
pair_style hybrid/overlay lebedeva/z 20
pair_coeff * * none
pair_coeff 1 2 lebedeva/z CC.Lebedeva C C
mass 1 12.01 # Carbon
mass 2 12.01 # Carbon
neighbor 0.3 bin
neigh_modify delay 1 check yes
compute peratom all pe/atom
dump 1 all custom 1 dump_lebedeva_*.cfg id x y z c_peratom fx fy fz
dump_modify 1 pad 3
thermo 10
thermo_style custom step pe press temp
thermo_modify lost ignore
label STEP_LOOP
variable MYSTEP loop 0 400 pad # in degrees
variable DELTA_STEP equal 0.05
displace_atoms graphene2 move ${DELTA_STEP} ${DELTA_STEP} 0
run 1
next MYSTEP
jump SELF STEP_LOOP
print "all done"
# After running LAMMPS with this input script a number of dump files is created.
# To extract the data from there I used grep script:
# grep '^2 ' *cfg > LammpsResult.dat
# After that after removing some text from LammpsResult.dat,
# the data can be viewed by lebedeva00.plot
#
# Author: Zbigniew Koziol, National Center for Nuclear Research, Poland
# Email: softquake@gmail.com
# ---------- Start simulation ---------------------
clear
units metal
dimension 3
boundary f f f
atom_style atomic
# ========================== Create Atomistic Structure ===========================
region whole block 0 20 0 20 0 10
create_box 2 whole
read_data 2particles.dat add append
region graphite block INF INF INF INF 0 10 units box
group graphite type 1 2
group graphene1 type 1
group graphene2 type 2
pair_style hybrid/overlay lebedeva/z 20
pair_coeff * * none
pair_coeff 1 2 lebedeva/z CC.Lebedeva C C
mass 1 12.01 # Carbon
mass 2 12.01 # Carbon
neighbor 0.3 bin
neigh_modify delay 1 check yes
compute peratom all pe/atom
dump 1 all custom 1 dump_lebedeva_*.cfg id x y z c_peratom fx fy fz
dump_modify 1 pad 3
thermo 10
thermo_style custom step pe press temp
thermo_modify lost ignore
label STEP_LOOP
variable MYSTEP loop 0 400 pad # in degrees
variable DELTA_STEP equal 0.05
displace_atoms graphene2 move ${DELTA_STEP} ${DELTA_STEP} 0
run 1
next MYSTEP
jump SELF STEP_LOOP
print "all done"

View File

@ -11,6 +11,7 @@ units cgs
dimension 3
boundary p p f
atom_style atomic
processors * 1 *
#-------------------------------------------------------------------------#
# Set up the simulation box
@ -464,11 +465,11 @@ pair_style lj/cut 1.2
pair_coeff * * 0.0 0.0
timestep 0.025
unfix FL
if "$(is_defined(dump,mydump))" then "undump mydump"
reset_timestep 0
#dump mydump all atom 10000 run.lammpstrj
#variable total_force equal 0.2
#variable node_force equal "v_total_force / 178"
#fix drag all addforce 0.0 0.0 0.0

File diff suppressed because it is too large Load Diff

View File

@ -1,130 +1,130 @@
# Ti-O cubic spline potential where O is in the dilute limit. DATE: 2016-06-05 CONTRIBUTOR: Pinchao Zhang, Dallas R. Trinkle
meam/spline 2 Ti O
spline3eq
13
-20 0
1.742692837 3.744277175966 99.4865081627958
2.05580176725 0.910839730906 10.8702523265355
2.3689106975 0.388045896634 -1.55322418749562
2.68201962775 -0.018840906533 2.43630041329215
2.995128558 -0.248098929639 2.67912713976835
3.30823748825 -0.264489550297 -0.125056384603077
3.6213464185 -0.227196189283 1.10662555360438
3.93445534875 -0.129293090176 -0.592053676745914
4.247564279 -0.059685366933 -0.470123414607672
4.56067320925 -0.031100025561 -0.0380739973059663
4.8737821395 -0.013847363202 -0.0711547960695406
5.18689106975 -0.003203412728 -0.081768292420175
5.5 0 -0.0571422964883619
spline3eq
5
0.155001355787331 0
1.9 0.533321679606674 0
2.8 0.456402081843862 -1.60311717015859
3.7 -0.324281383502201 1.19940299483249
4.6 -0.474029826906675 1.47909794595154
5.5 0 -2.49521499855605
spline3eq
13
0 0
1.742692837 0 0
2.05580176725 0 0
2.3689106975 0 0
2.68201962775 0 0
2.995128558 0 0
3.30823748825 0 0
3.6213464185 0 0
3.93445534875 0 0
4.247564279 0 0
4.56067320925 0 0
4.8737821395 0 0
5.18689106975 0 0
5.5 0 0
spline3eq
11
-1 0
2.055801767 1.7475279661 -525.869786904802
2.2912215903 -5.8677963945 252.796316927755
2.5266414136 -8.3376288737 71.7318388721015
2.7620612369 -5.8398712842 -1.93587742753693
2.9974810602 -3.1140648231 -39.2999192667503
3.2329008835 -1.7257245065 14.3424136002004
3.4683207068 -0.4428977017 -29.4925534559498
3.7037405301 -0.1466643003 -3.18010534572236
3.9391603534 -0.2095507945 3.33490838803603
4.1745801767 -0.1442384563 3.71918691359508
4.41 0 -9.66717019857564
spline3eq
5
-61.9827585211652 0
1.9 11.2293641315584 0
2.8 -27.9976343076148 122.648031332411
3.7 -8.32979773113248 -54.3340881766381
4.6 -1.00863195297399 3.23150064581724
5.5 0 -5.3514242228123
spline3eq
4
0.00776934946045395 0.105197706160344
-55.14233165 -0.29745568008 0.00152870603877451
-44.7409899033333 -0.15449458722 0.00038933722543571
-34.3396481566667 0.05098657168 0.00038124926922248
-23.93830641 0.57342694704 0.0156639264890892
spline3eq
5
-0.00676745157022662 -0.0159520381982146
-23.9928 0.297607384684645 0
-15.9241175 0.216691597077105 -0.0024248755353942
-7.855435 0.0637598673719069 0.00306245895013358
0.213247499999998 -0.00183450621970427 -0.00177588407633909
8.28193 -0.111277018874367 0
spline3eq
10
2.77327511656661 0
2.055801767 -0.1485215264 72.2010867146919
2.31737934844444 1.6845304918 -47.2744689053404
2.57895692988889 2.0113365977 -15.1859578405326
2.84053451133333 1.1444092747 3.33978204841873
3.10211209277778 0.2861606803 2.587867603808
3.36368967422222 -0.3459281126 6.14070694084556
3.62526725566667 -0.6257480601 3.7397696717154
3.88684483711111 -0.6119510826 4.64749084871402
4.14842241855556 -0.3112059651 2.83275746415936
4.41 0 -15.0612086827734
spline3eq
5
12.3315547862781 0
1.9 2.62105440156724 0
2.8 10.2850803058354 -25.439802988016
3.7 3.23933763743897 -7.20203673434025
4.6 -5.79049355858613 39.5509978688682
5.5 0 -41.221771373642
spline3eq
8
8.33642274810572 -60.4024574736564
-1 0.07651409193 -110.652321293778
-0.724509054371429 0.14155824541 44.8853405500508
-0.449018108742857 0.75788697341 -25.3065115342002
-0.173527163114286 0.63011570378 -2.48510144915082
0.101963782514286 0.09049597305 2.68769386908235
0.377454728142857 -0.35741586657 -1.01558570129633
0.652945673771428 -0.65293217647 13.4224786001212
0.9284366194 -6.00912190653 -452.752542694929
spline3eq
5
0.137191606537625 -1.55094230968985
-1 0.0513843442016519 0
-0.5 0.0179024412245673 -2.44986494990154
0 -0.260650876879273 3.91774583656401
0.5 -0.190163791764901 -4.84414871911743
1 -0.763795416646599 0
spline3eq
8
0 0
-1 0 0
-0.724509054371429 0 0
-0.449018108742857 0 0
-0.173527163114286 0 0
0.101963782514286 0 0
0.377454728142857 0 0
0.652945673771428 0 0
0.9284366194 0 0
# Ti-O cubic spline potential where O is in the dilute limit. DATE: 2016-06-05 CONTRIBUTOR: Pinchao Zhang, Dallas R. Trinkle
meam/spline 2 Ti O
spline3eq
13
-20 0
1.742692837 3.744277175966 99.4865081627958
2.05580176725 0.910839730906 10.8702523265355
2.3689106975 0.388045896634 -1.55322418749562
2.68201962775 -0.018840906533 2.43630041329215
2.995128558 -0.248098929639 2.67912713976835
3.30823748825 -0.264489550297 -0.125056384603077
3.6213464185 -0.227196189283 1.10662555360438
3.93445534875 -0.129293090176 -0.592053676745914
4.247564279 -0.059685366933 -0.470123414607672
4.56067320925 -0.031100025561 -0.0380739973059663
4.8737821395 -0.013847363202 -0.0711547960695406
5.18689106975 -0.003203412728 -0.081768292420175
5.5 0 -0.0571422964883619
spline3eq
5
0.155001355787331 0
1.9 0.533321679606674 0
2.8 0.456402081843862 -1.60311717015859
3.7 -0.324281383502201 1.19940299483249
4.6 -0.474029826906675 1.47909794595154
5.5 0 -2.49521499855605
spline3eq
13
0 0
1.742692837 0 0
2.05580176725 0 0
2.3689106975 0 0
2.68201962775 0 0
2.995128558 0 0
3.30823748825 0 0
3.6213464185 0 0
3.93445534875 0 0
4.247564279 0 0
4.56067320925 0 0
4.8737821395 0 0
5.18689106975 0 0
5.5 0 0
spline3eq
11
-1 0
2.055801767 1.7475279661 -525.869786904802
2.2912215903 -5.8677963945 252.796316927755
2.5266414136 -8.3376288737 71.7318388721015
2.7620612369 -5.8398712842 -1.93587742753693
2.9974810602 -3.1140648231 -39.2999192667503
3.2329008835 -1.7257245065 14.3424136002004
3.4683207068 -0.4428977017 -29.4925534559498
3.7037405301 -0.1466643003 -3.18010534572236
3.9391603534 -0.2095507945 3.33490838803603
4.1745801767 -0.1442384563 3.71918691359508
4.41 0 -9.66717019857564
spline3eq
5
-61.9827585211652 0
1.9 11.2293641315584 0
2.8 -27.9976343076148 122.648031332411
3.7 -8.32979773113248 -54.3340881766381
4.6 -1.00863195297399 3.23150064581724
5.5 0 -5.3514242228123
spline3eq
4
0.00776934946045395 0.105197706160344
-55.14233165 -0.29745568008 0.00152870603877451
-44.7409899033333 -0.15449458722 0.00038933722543571
-34.3396481566667 0.05098657168 0.00038124926922248
-23.93830641 0.57342694704 0.0156639264890892
spline3eq
5
-0.00676745157022662 -0.0159520381982146
-23.9928 0.297607384684645 0
-15.9241175 0.216691597077105 -0.0024248755353942
-7.855435 0.0637598673719069 0.00306245895013358
0.213247499999998 -0.00183450621970427 -0.00177588407633909
8.28193 -0.111277018874367 0
spline3eq
10
2.77327511656661 0
2.055801767 -0.1485215264 72.2010867146919
2.31737934844444 1.6845304918 -47.2744689053404
2.57895692988889 2.0113365977 -15.1859578405326
2.84053451133333 1.1444092747 3.33978204841873
3.10211209277778 0.2861606803 2.587867603808
3.36368967422222 -0.3459281126 6.14070694084556
3.62526725566667 -0.6257480601 3.7397696717154
3.88684483711111 -0.6119510826 4.64749084871402
4.14842241855556 -0.3112059651 2.83275746415936
4.41 0 -15.0612086827734
spline3eq
5
12.3315547862781 0
1.9 2.62105440156724 0
2.8 10.2850803058354 -25.439802988016
3.7 3.23933763743897 -7.20203673434025
4.6 -5.79049355858613 39.5509978688682
5.5 0 -41.221771373642
spline3eq
8
8.33642274810572 -60.4024574736564
-1 0.07651409193 -110.652321293778
-0.724509054371429 0.14155824541 44.8853405500508
-0.449018108742857 0.75788697341 -25.3065115342002
-0.173527163114286 0.63011570378 -2.48510144915082
0.101963782514286 0.09049597305 2.68769386908235
0.377454728142857 -0.35741586657 -1.01558570129633
0.652945673771428 -0.65293217647 13.4224786001212
0.9284366194 -6.00912190653 -452.752542694929
spline3eq
5
0.137191606537625 -1.55094230968985
-1 0.0513843442016519 0
-0.5 0.0179024412245673 -2.44986494990154
0 -0.260650876879273 3.91774583656401
0.5 -0.190163791764901 -4.84414871911743
1 -0.763795416646599 0
spline3eq
8
0 0
-1 0 0
-0.724509054371429 0 0
-0.449018108742857 0 0
-0.173527163114286 0 0
0.101963782514286 0 0
0.377454728142857 0 0
0.652945673771428 0 0
0.9284366194 0 0

View File

@ -1,40 +1,40 @@
variable T equal 0.8
variable p_solid equal 0.05
read_data data.mop
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 1 2 0.5 1.0
pair_coeff 2 2 0.0 0.0
neigh_modify delay 0
group liquid type 1
group solid type 2
region bottom block INF INF INF INF INF 7.0
group bottom region bottom
group solid_bottom intersect solid bottom
group solid_up subtract solid solid_bottom
variable faSolid equal ${p_solid}*lx*ly/count(solid_up)
fix piston_up solid_up aveforce NULL NULL -${faSolid}
fix freeze_up solid_up setforce 0.0 0.0 NULL
fix freeze_bottom solid_bottom setforce 0.0 0.0 0.0
fix nvesol solid nve
compute Tliq liquid temp
fix nvtliq liquid nvt temp $T $T 0.5
fix_modify nvtliq temp Tliq
thermo 1000
thermo_modify flush yes temp Tliq
fix fxbal all balance 1000 1.05 shift z 10 1.05
compute mopz0 all stress/mop z center kin conf
fix mopz0t all ave/time 1 1 1 c_mopz0[*] file mopz0.time
compute moppz liquid stress/mop/profile z 0.0 0.1 kin conf
fix moppzt all ave/time 1 1 1 c_moppz[*] ave running overwrite file moppz.time mode vector
run 0
variable T equal 0.8
variable p_solid equal 0.05
read_data data.mop
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 1 2 0.5 1.0
pair_coeff 2 2 0.0 0.0
neigh_modify delay 0
group liquid type 1
group solid type 2
region bottom block INF INF INF INF INF 7.0
group bottom region bottom
group solid_bottom intersect solid bottom
group solid_up subtract solid solid_bottom
variable faSolid equal ${p_solid}*lx*ly/count(solid_up)
fix piston_up solid_up aveforce NULL NULL -${faSolid}
fix freeze_up solid_up setforce 0.0 0.0 NULL
fix freeze_bottom solid_bottom setforce 0.0 0.0 0.0
fix nvesol solid nve
compute Tliq liquid temp
fix nvtliq liquid nvt temp $T $T 0.5
fix_modify nvtliq temp Tliq
thermo 1000
thermo_modify flush yes temp Tliq
fix fxbal all balance 1000 1.05 shift z 10 1.05
compute mopz0 all stress/mop z center kin conf
fix mopz0t all ave/time 1 1 1 c_mopz0[*] file mopz0.time
compute moppz liquid stress/mop/profile z 0.0 0.1 kin conf
fix moppzt all ave/time 1 1 1 c_moppz[*] ave running overwrite file moppz.time mode vector
run 0

View File

@ -1,66 +1,66 @@
map file: styrene growth
1 edgeIDs
30 equivalences
16 createIDs
InitiatorIDs
4
13
EdgeIDs
30
CreateIDs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Equivalences
1 45
2 46
3 44
4 43
5 42
6 41
7 40
8 39
9 38
10 37
11 36
12 35
13 34
14 33
15 32
16 31
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 25
26 26
27 27
28 28
29 29
30 30
map file: styrene growth
1 edgeIDs
30 equivalences
16 createIDs
InitiatorIDs
4
13
EdgeIDs
30
CreateIDs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Equivalences
1 45
2 46
3 44
4 43
5 42
6 41
7 40
8 39
9 38
10 37
11 36
12 35
13 34
14 33
15 32
16 31
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 25
26 26
27 27
28 28
29 29
30 30

View File

@ -1,456 +1,456 @@
molecule template: end of chain plus polymerized styrene
46 atoms
48 bonds
81 angles
121 dihedrals
35 impropers
1 fragments
Fragments
create_fit 34 44
Types
1 1
2 2
3 1
4 5
5 1
6 2
7 1
8 2
9 1
10 2
11 1
12 2
13 2
14 6
15 2
16 2
17 1
18 2
19 1
20 5
21 1
22 2
23 1
24 2
25 1
26 2
27 1
28 2
29 2
30 6
31 1
32 2
33 1
34 5
35 1
36 2
37 1
38 2
39 1
40 2
41 1
42 2
43 2
44 6
45 2
46 2
Charges
1 -0.129000
2 0.123700
3 0.026600
4 -0.018200
5 -0.129000
6 0.123700
7 -0.173400
8 0.140300
9 -0.113400
10 0.128800
11 -0.173400
12 0.140300
13 0.051600
14 -0.069600
15 0.035400
16 0.035400
17 -0.129000
18 0.123700
19 0.026600
20 -0.018200
21 -0.129000
22 0.123700
23 -0.173400
24 0.140300
25 -0.113400
26 0.128800
27 -0.173400
28 0.140300
29 0.051600
30 -0.069600
31 -0.129000
32 0.123700
33 0.026600
34 -0.018200
35 -0.129000
36 0.123700
37 -0.173400
38 0.140300
39 -0.113400
40 0.128800
41 -0.173400
42 0.140300
43 0.051600
44 -0.069600
45 0.035400
46 0.035400
Coords
1 24.130699 1.043900 -1.309300
2 25.062700 1.582900 -1.309300
3 22.900700 1.753900 -1.309300
4 22.900700 3.253900 -1.309300
5 21.670700 1.043900 -1.309300
6 20.738701 1.582900 -1.309300
7 21.670700 -0.376100 -1.309300
8 20.738701 -0.915100 -1.309300
9 22.900700 -1.086100 -1.309300
10 22.900700 -2.163100 -1.309300
11 24.130699 -0.376100 -1.309300
12 25.062700 -0.915100 -1.309300
13 23.766701 3.658900 -0.952300
14 21.622700 3.802900 -1.871300
15 21.672701 4.544900 -1.970300
16 20.979700 2.979900 -2.165300
17 13.465800 0.682500 -1.658900
18 14.397800 1.221500 -1.658900
19 12.235800 1.392500 -1.658900
20 12.235800 2.892500 -1.658900
21 11.005800 0.682500 -1.658900
22 10.073800 1.221500 -1.658900
23 11.005800 -0.737500 -1.658900
24 10.073800 -1.276500 -1.658900
25 12.235800 -1.447500 -1.658900
26 12.235800 -2.524500 -1.658900
27 13.465800 -0.737500 -1.658900
28 14.397800 -1.276500 -1.658900
29 13.101800 3.297500 -1.301900
30 10.957800 3.441500 -2.220900
31 18.663500 0.855500 -1.372100
32 19.595501 1.394500 -1.372100
33 17.433500 1.565500 -1.372100
34 17.433500 3.065500 -1.372100
35 16.203501 0.855500 -1.372100
36 15.271500 1.394500 -1.372100
37 16.203501 -0.564500 -1.372100
38 15.271500 -1.103500 -1.372100
39 17.433500 -1.274500 -1.372100
40 17.433500 -2.351500 -1.372100
41 18.663500 -0.564500 -1.372100
42 19.595501 -1.103500 -1.372100
43 18.299500 3.470500 -1.015100
44 16.155500 3.614500 -1.934100
45 16.205500 4.356500 -2.033100
46 15.512500 2.791500 -2.228100
Bonds
1 1 1 2
2 2 1 3
3 2 1 11
4 11 3 4
5 2 3 5
6 12 13 4
7 13 4 14
8 1 5 6
9 2 5 7
10 1 7 8
11 2 7 9
12 1 9 10
13 2 9 11
14 1 11 12
15 10 15 14
16 10 16 14
17 9 14 34
18 1 17 18
19 2 17 19
20 2 17 27
21 7 19 20
22 2 19 21
23 8 29 20
24 9 30 20
25 9 44 20
26 1 21 22
27 2 21 23
28 1 23 24
29 2 23 25
30 1 25 26
31 2 25 27
32 1 27 28
33 1 31 32
34 2 31 33
35 2 31 41
36 7 33 34
37 2 33 35
38 8 43 34
39 9 44 34
40 1 35 36
41 2 35 37
42 1 37 38
43 2 37 39
44 1 39 40
45 2 39 41
46 1 41 42
47 10 45 44
48 10 46 44
Angles
1 1 3 1 2
2 1 11 1 2
3 2 3 1 11
4 17 1 3 4
5 2 1 3 5
6 17 5 3 4
7 18 3 4 13
8 19 3 4 14
9 20 13 4 14
10 1 3 5 6
11 2 3 5 7
12 1 7 5 6
13 1 5 7 8
14 2 5 7 9
15 1 9 7 8
16 1 7 9 10
17 2 7 9 11
18 1 11 9 10
19 2 1 11 9
20 1 1 11 12
21 1 9 11 12
22 21 15 14 4
23 21 16 14 4
24 22 4 14 34
25 15 15 14 16
26 14 15 14 34
27 14 16 14 34
28 1 19 17 18
29 1 27 17 18
30 2 19 17 27
31 9 17 19 20
32 2 17 19 21
33 9 21 19 20
34 10 19 20 29
35 11 19 20 30
36 11 19 20 44
37 12 29 20 30
38 12 29 20 44
39 13 30 20 44
40 1 19 21 22
41 2 19 21 23
42 1 23 21 22
43 1 21 23 24
44 2 21 23 25
45 1 25 23 24
46 1 23 25 26
47 2 23 25 27
48 1 27 25 26
49 2 17 27 25
50 1 17 27 28
51 1 25 27 28
52 1 33 31 32
53 1 41 31 32
54 2 33 31 41
55 9 31 33 34
56 2 31 33 35
57 9 35 33 34
58 11 33 34 14
59 12 43 34 14
60 13 14 34 44
61 10 33 34 43
62 11 33 34 44
63 12 43 34 44
64 1 33 35 36
65 2 33 35 37
66 1 37 35 36
67 1 35 37 38
68 2 35 37 39
69 1 39 37 38
70 1 37 39 40
71 2 37 39 41
72 1 41 39 40
73 2 31 41 39
74 1 31 41 42
75 1 39 41 42
76 16 20 44 34
77 14 45 44 20
78 14 46 44 20
79 14 45 44 34
80 14 46 44 34
81 15 45 44 46
Dihedrals
1 20 2 1 3 4
2 2 5 3 1 2
3 21 11 1 3 4
4 4 11 1 3 5
5 2 9 11 1 2
6 5 2 1 11 12
7 4 3 1 11 9
8 2 3 1 11 12
9 22 1 3 4 13
10 23 1 3 4 14
11 22 5 3 4 13
12 23 5 3 4 14
13 2 1 3 5 6
14 4 1 3 5 7
15 20 6 5 3 4
16 21 7 5 3 4
17 24 3 4 14 15
18 24 3 4 14 16
19 25 3 4 14 34
20 26 13 4 14 15
21 26 13 4 14 16
22 27 13 4 14 34
23 2 3 5 7 8
24 4 3 5 7 9
25 5 6 5 7 8
26 2 9 7 5 6
27 2 5 7 9 10
28 4 5 7 9 11
29 5 8 7 9 10
30 2 11 9 7 8
31 4 7 9 11 1
32 2 7 9 11 12
33 2 1 11 9 10
34 5 10 9 11 12
35 28 4 14 34 33
36 29 4 14 34 43
37 30 4 14 34 44
38 31 15 14 34 33
39 32 15 14 34 43
40 33 15 14 34 44
41 31 16 14 34 33
42 32 16 14 34 43
43 33 16 14 34 44
44 10 18 17 19 20
45 2 21 19 17 18
46 11 27 17 19 20
47 4 27 17 19 21
48 2 25 27 17 18
49 5 18 17 27 28
50 4 19 17 27 25
51 2 19 17 27 28
52 12 17 19 20 29
53 13 17 19 20 30
54 13 17 19 20 44
55 12 21 19 20 29
56 13 21 19 20 30
57 13 21 19 20 44
58 2 17 19 21 22
59 4 17 19 21 23
60 10 22 21 19 20
61 11 23 21 19 20
62 34 34 44 20 19
63 31 45 44 20 19
64 31 46 44 20 19
65 35 34 44 20 29
66 32 45 44 20 29
67 32 46 44 20 29
68 36 34 44 20 30
69 33 45 44 20 30
70 33 46 44 20 30
71 2 19 21 23 24
72 4 19 21 23 25
73 5 22 21 23 24
74 2 25 23 21 22
75 2 21 23 25 26
76 4 21 23 25 27
77 5 24 23 25 26
78 2 27 25 23 24
79 4 23 25 27 17
80 2 23 25 27 28
81 2 17 27 25 26
82 5 26 25 27 28
83 10 32 31 33 34
84 2 35 33 31 32
85 11 41 31 33 34
86 4 41 31 33 35
87 2 39 41 31 32
88 5 32 31 41 42
89 4 33 31 41 39
90 2 33 31 41 42
91 13 31 33 34 14
92 12 31 33 34 43
93 13 31 33 34 44
94 13 35 33 34 14
95 12 35 33 34 43
96 13 35 33 34 44
97 2 31 33 35 36
98 4 31 33 35 37
99 10 36 35 33 34
100 11 37 35 33 34
101 36 20 44 34 14
102 33 45 44 34 14
103 33 46 44 34 14
104 34 20 44 34 33
105 31 45 44 34 33
106 31 46 44 34 33
107 35 20 44 34 43
108 32 45 44 34 43
109 32 46 44 34 43
110 2 33 35 37 38
111 4 33 35 37 39
112 5 36 35 37 38
113 2 39 37 35 36
114 2 35 37 39 40
115 4 35 37 39 41
116 5 38 37 39 40
117 2 41 39 37 38
118 4 37 39 41 31
119 2 37 39 41 42
120 2 31 41 39 40
121 5 40 39 41 42
Impropers
1 1 3 1 11 2
2 8 1 3 5 4
3 9 3 4 13 14
4 1 3 5 7 6
5 1 5 7 9 8
6 1 7 9 11 10
7 1 1 11 9 12
8 1 19 17 27 18
9 5 17 19 21 20
10 1 19 21 23 22
11 1 21 23 25 24
12 1 23 25 27 26
13 1 17 27 25 28
14 1 33 31 41 32
15 5 31 33 35 34
16 1 33 35 37 36
17 1 35 37 39 38
18 1 37 39 41 40
19 1 31 41 39 42
20 1 15 14 16 4
21 1 15 14 4 34
22 1 16 14 4 34
23 1 15 14 16 34
24 1 19 20 29 30
25 1 19 20 29 44
26 1 19 20 30 44
27 1 29 20 30 44
28 1 33 34 43 14
29 1 33 34 14 44
30 1 43 34 14 44
31 1 33 34 43 44
32 1 45 44 34 20
33 1 46 44 34 20
34 1 45 44 46 20
35 1 45 44 46 34
molecule template: end of chain plus polymerized styrene
46 atoms
48 bonds
81 angles
121 dihedrals
35 impropers
1 fragments
Fragments
create_fit 34 44
Types
1 1
2 2
3 1
4 5
5 1
6 2
7 1
8 2
9 1
10 2
11 1
12 2
13 2
14 6
15 2
16 2
17 1
18 2
19 1
20 5
21 1
22 2
23 1
24 2
25 1
26 2
27 1
28 2
29 2
30 6
31 1
32 2
33 1
34 5
35 1
36 2
37 1
38 2
39 1
40 2
41 1
42 2
43 2
44 6
45 2
46 2
Charges
1 -0.129000
2 0.123700
3 0.026600
4 -0.018200
5 -0.129000
6 0.123700
7 -0.173400
8 0.140300
9 -0.113400
10 0.128800
11 -0.173400
12 0.140300
13 0.051600
14 -0.069600
15 0.035400
16 0.035400
17 -0.129000
18 0.123700
19 0.026600
20 -0.018200
21 -0.129000
22 0.123700
23 -0.173400
24 0.140300
25 -0.113400
26 0.128800
27 -0.173400
28 0.140300
29 0.051600
30 -0.069600
31 -0.129000
32 0.123700
33 0.026600
34 -0.018200
35 -0.129000
36 0.123700
37 -0.173400
38 0.140300
39 -0.113400
40 0.128800
41 -0.173400
42 0.140300
43 0.051600
44 -0.069600
45 0.035400
46 0.035400
Coords
1 24.130699 1.043900 -1.309300
2 25.062700 1.582900 -1.309300
3 22.900700 1.753900 -1.309300
4 22.900700 3.253900 -1.309300
5 21.670700 1.043900 -1.309300
6 20.738701 1.582900 -1.309300
7 21.670700 -0.376100 -1.309300
8 20.738701 -0.915100 -1.309300
9 22.900700 -1.086100 -1.309300
10 22.900700 -2.163100 -1.309300
11 24.130699 -0.376100 -1.309300
12 25.062700 -0.915100 -1.309300
13 23.766701 3.658900 -0.952300
14 21.622700 3.802900 -1.871300
15 21.672701 4.544900 -1.970300
16 20.979700 2.979900 -2.165300
17 13.465800 0.682500 -1.658900
18 14.397800 1.221500 -1.658900
19 12.235800 1.392500 -1.658900
20 12.235800 2.892500 -1.658900
21 11.005800 0.682500 -1.658900
22 10.073800 1.221500 -1.658900
23 11.005800 -0.737500 -1.658900
24 10.073800 -1.276500 -1.658900
25 12.235800 -1.447500 -1.658900
26 12.235800 -2.524500 -1.658900
27 13.465800 -0.737500 -1.658900
28 14.397800 -1.276500 -1.658900
29 13.101800 3.297500 -1.301900
30 10.957800 3.441500 -2.220900
31 18.663500 0.855500 -1.372100
32 19.595501 1.394500 -1.372100
33 17.433500 1.565500 -1.372100
34 17.433500 3.065500 -1.372100
35 16.203501 0.855500 -1.372100
36 15.271500 1.394500 -1.372100
37 16.203501 -0.564500 -1.372100
38 15.271500 -1.103500 -1.372100
39 17.433500 -1.274500 -1.372100
40 17.433500 -2.351500 -1.372100
41 18.663500 -0.564500 -1.372100
42 19.595501 -1.103500 -1.372100
43 18.299500 3.470500 -1.015100
44 16.155500 3.614500 -1.934100
45 16.205500 4.356500 -2.033100
46 15.512500 2.791500 -2.228100
Bonds
1 1 1 2
2 2 1 3
3 2 1 11
4 11 3 4
5 2 3 5
6 12 13 4
7 13 4 14
8 1 5 6
9 2 5 7
10 1 7 8
11 2 7 9
12 1 9 10
13 2 9 11
14 1 11 12
15 10 15 14
16 10 16 14
17 9 14 34
18 1 17 18
19 2 17 19
20 2 17 27
21 7 19 20
22 2 19 21
23 8 29 20
24 9 30 20
25 9 44 20
26 1 21 22
27 2 21 23
28 1 23 24
29 2 23 25
30 1 25 26
31 2 25 27
32 1 27 28
33 1 31 32
34 2 31 33
35 2 31 41
36 7 33 34
37 2 33 35
38 8 43 34
39 9 44 34
40 1 35 36
41 2 35 37
42 1 37 38
43 2 37 39
44 1 39 40
45 2 39 41
46 1 41 42
47 10 45 44
48 10 46 44
Angles
1 1 3 1 2
2 1 11 1 2
3 2 3 1 11
4 17 1 3 4
5 2 1 3 5
6 17 5 3 4
7 18 3 4 13
8 19 3 4 14
9 20 13 4 14
10 1 3 5 6
11 2 3 5 7
12 1 7 5 6
13 1 5 7 8
14 2 5 7 9
15 1 9 7 8
16 1 7 9 10
17 2 7 9 11
18 1 11 9 10
19 2 1 11 9
20 1 1 11 12
21 1 9 11 12
22 21 15 14 4
23 21 16 14 4
24 22 4 14 34
25 15 15 14 16
26 14 15 14 34
27 14 16 14 34
28 1 19 17 18
29 1 27 17 18
30 2 19 17 27
31 9 17 19 20
32 2 17 19 21
33 9 21 19 20
34 10 19 20 29
35 11 19 20 30
36 11 19 20 44
37 12 29 20 30
38 12 29 20 44
39 13 30 20 44
40 1 19 21 22
41 2 19 21 23
42 1 23 21 22
43 1 21 23 24
44 2 21 23 25
45 1 25 23 24
46 1 23 25 26
47 2 23 25 27
48 1 27 25 26
49 2 17 27 25
50 1 17 27 28
51 1 25 27 28
52 1 33 31 32
53 1 41 31 32
54 2 33 31 41
55 9 31 33 34
56 2 31 33 35
57 9 35 33 34
58 11 33 34 14
59 12 43 34 14
60 13 14 34 44
61 10 33 34 43
62 11 33 34 44
63 12 43 34 44
64 1 33 35 36
65 2 33 35 37
66 1 37 35 36
67 1 35 37 38
68 2 35 37 39
69 1 39 37 38
70 1 37 39 40
71 2 37 39 41
72 1 41 39 40
73 2 31 41 39
74 1 31 41 42
75 1 39 41 42
76 16 20 44 34
77 14 45 44 20
78 14 46 44 20
79 14 45 44 34
80 14 46 44 34
81 15 45 44 46
Dihedrals
1 20 2 1 3 4
2 2 5 3 1 2
3 21 11 1 3 4
4 4 11 1 3 5
5 2 9 11 1 2
6 5 2 1 11 12
7 4 3 1 11 9
8 2 3 1 11 12
9 22 1 3 4 13
10 23 1 3 4 14
11 22 5 3 4 13
12 23 5 3 4 14
13 2 1 3 5 6
14 4 1 3 5 7
15 20 6 5 3 4
16 21 7 5 3 4
17 24 3 4 14 15
18 24 3 4 14 16
19 25 3 4 14 34
20 26 13 4 14 15
21 26 13 4 14 16
22 27 13 4 14 34
23 2 3 5 7 8
24 4 3 5 7 9
25 5 6 5 7 8
26 2 9 7 5 6
27 2 5 7 9 10
28 4 5 7 9 11
29 5 8 7 9 10
30 2 11 9 7 8
31 4 7 9 11 1
32 2 7 9 11 12
33 2 1 11 9 10
34 5 10 9 11 12
35 28 4 14 34 33
36 29 4 14 34 43
37 30 4 14 34 44
38 31 15 14 34 33
39 32 15 14 34 43
40 33 15 14 34 44
41 31 16 14 34 33
42 32 16 14 34 43
43 33 16 14 34 44
44 10 18 17 19 20
45 2 21 19 17 18
46 11 27 17 19 20
47 4 27 17 19 21
48 2 25 27 17 18
49 5 18 17 27 28
50 4 19 17 27 25
51 2 19 17 27 28
52 12 17 19 20 29
53 13 17 19 20 30
54 13 17 19 20 44
55 12 21 19 20 29
56 13 21 19 20 30
57 13 21 19 20 44
58 2 17 19 21 22
59 4 17 19 21 23
60 10 22 21 19 20
61 11 23 21 19 20
62 34 34 44 20 19
63 31 45 44 20 19
64 31 46 44 20 19
65 35 34 44 20 29
66 32 45 44 20 29
67 32 46 44 20 29
68 36 34 44 20 30
69 33 45 44 20 30
70 33 46 44 20 30
71 2 19 21 23 24
72 4 19 21 23 25
73 5 22 21 23 24
74 2 25 23 21 22
75 2 21 23 25 26
76 4 21 23 25 27
77 5 24 23 25 26
78 2 27 25 23 24
79 4 23 25 27 17
80 2 23 25 27 28
81 2 17 27 25 26
82 5 26 25 27 28
83 10 32 31 33 34
84 2 35 33 31 32
85 11 41 31 33 34
86 4 41 31 33 35
87 2 39 41 31 32
88 5 32 31 41 42
89 4 33 31 41 39
90 2 33 31 41 42
91 13 31 33 34 14
92 12 31 33 34 43
93 13 31 33 34 44
94 13 35 33 34 14
95 12 35 33 34 43
96 13 35 33 34 44
97 2 31 33 35 36
98 4 31 33 35 37
99 10 36 35 33 34
100 11 37 35 33 34
101 36 20 44 34 14
102 33 45 44 34 14
103 33 46 44 34 14
104 34 20 44 34 33
105 31 45 44 34 33
106 31 46 44 34 33
107 35 20 44 34 43
108 32 45 44 34 43
109 32 46 44 34 43
110 2 33 35 37 38
111 4 33 35 37 39
112 5 36 35 37 38
113 2 39 37 35 36
114 2 35 37 39 40
115 4 35 37 39 41
116 5 38 37 39 40
117 2 41 39 37 38
118 4 37 39 41 31
119 2 37 39 41 42
120 2 31 41 39 40
121 5 40 39 41 42
Impropers
1 1 3 1 11 2
2 8 1 3 5 4
3 9 3 4 13 14
4 1 3 5 7 6
5 1 5 7 9 8
6 1 7 9 11 10
7 1 1 11 9 12
8 1 19 17 27 18
9 5 17 19 21 20
10 1 19 21 23 22
11 1 21 23 25 24
12 1 23 25 27 26
13 1 17 27 25 28
14 1 33 31 41 32
15 5 31 33 35 34
16 1 33 35 37 36
17 1 35 37 39 38
18 1 37 39 41 40
19 1 31 41 39 42
20 1 15 14 16 4
21 1 15 14 4 34
22 1 16 14 4 34
23 1 15 14 16 34
24 1 19 20 29 30
25 1 19 20 29 44
26 1 19 20 30 44
27 1 29 20 30 44
28 1 33 34 43 14
29 1 33 34 14 44
30 1 43 34 14 44
31 1 33 34 43 44
32 1 45 44 34 20
33 1 46 44 34 20
34 1 45 44 46 20
35 1 45 44 46 34

View File

@ -1,48 +1,48 @@
# use bond/react 'create atoms' feature to add 30 new styrene monomers to chain
units real
boundary p p p
atom_style full
kspace_style pppm 1.0e-4
pair_style lj/class2/coul/long 8.5
angle_style class2
bond_style class2
dihedral_style class2
improper_style class2
variable T equal 530
read_data trimer.data &
extra/bond/per/atom 5 &
extra/angle/per/atom 15 &
extra/dihedral/per/atom 15 &
extra/improper/per/atom 25 &
extra/special/per/atom 25
molecule mol1 grow_styrene_pre.data_template
molecule mol2 grow_styrene_post.data_template
fix myrxns all bond/react stabilization yes statted_grp .03 &
react rxn1 all 1 0 3.0 mol1 mol2 grow_styrene.map &
modify_create fit create_fit overlap 2.0 &
stabilize_steps 100 max_rxn 30
fix 1 statted_grp_REACT nvt temp $T $T 100
fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1
thermo_style custom step temp press density f_myrxns[1]
thermo 100
run 8000
# write_data final.data nofix
# use bond/react 'create atoms' feature to add 30 new styrene monomers to chain
units real
boundary p p p
atom_style full
kspace_style pppm 1.0e-4
pair_style lj/class2/coul/long 8.5
angle_style class2
bond_style class2
dihedral_style class2
improper_style class2
variable T equal 530
read_data trimer.data &
extra/bond/per/atom 5 &
extra/angle/per/atom 15 &
extra/dihedral/per/atom 15 &
extra/improper/per/atom 25 &
extra/special/per/atom 25
molecule mol1 grow_styrene_pre.data_template
molecule mol2 grow_styrene_post.data_template
fix myrxns all bond/react stabilization yes statted_grp .03 &
react rxn1 all 1 0 3.0 mol1 mol2 grow_styrene.map &
modify_create fit create_fit overlap 2.0 &
stabilize_steps 100 max_rxn 30
fix 1 statted_grp_REACT nvt temp $T $T 100
fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1
thermo_style custom step temp press density f_myrxns[1]
thermo 100
run 8000
# write_data final.data nofix

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +1,79 @@
proc vmd_draw_arrow {mol start end} {
set middle [vecadd $start [vecscale 0.9 [vecsub $end $start]]]
graphics $mol cylinder $start $middle radius 0.05
graphics $mol cone $middle $end radius 0.01 color 3
}
proc vmd_draw_vector {args} {
set usage {"draw vector {x1 y1 z1} {x2 y2 z2} [scale <s>] [resolution <res>] [radius <r>] [filled <yes/no>]"}
# defaults
set scale 2.0
set res 50
set radius 0.1
set filled yes
if {[llength $args] < 3} {
error "wrong # args: should be $usage"
}
set mol [lindex $args 0]
set center [lindex $args 1]
set vector [lindex $args 2]
if {[llength $center] != 3 || [llength $vector] != 3} {
error "wrong type of args: should be $usage"
}
foreach {flag value} [lrange $args 3 end] {
switch -glob $flag {
scale {set scale $value}
res* {set res $value}
rad* {set radius $value}
fill* {set filled $value}
default {error "unknown option '$flag': should be $usage" }
}
}
set vechalf [vecscale [expr $scale * 0.5] $vector]
return [list \
[graphics $mol color yellow]\
[graphics $mol cylinder [vecsub $center $vechalf]\
[vecadd $center [vecscale 0.7 $vechalf]] \
radius $radius resolution $res filled $filled] \
[graphics $mol color orange]\
[graphics $mol cone [vecadd $center [vecscale 0.6 $vechalf]] \
[vecadd $center $vechalf] radius [expr $radius * 2.5] \
resolution $res]]
}
proc vmd_draw_spin {args} {
global molid
graphics $molid delete all
set frame [molinfo $molid get frame]
set natoms [molinfo $molid get numatoms]
for {set i 0} {$i < $natoms} {incr i} {
set sel [atomselect top "index $i"]
# set sel [atomselect top "index 1200"]
set coords [lindex [$sel get {x y z}] $molid]
set velocities [lindex [$sel get {vx vy vz}] $molid]
draw vector $coords $velocities
set uvx [lindex [$sel get {vx}] $molid]
set uvy [lindex [$sel get {vy}] $molid]
set uvz [lindex [$sel get {vz}] $molid]
$sel set user [vecadd [vecadd [vecscale $uvy $uvy] [vecscale $uvz $uvz] ] [vecscale $uvx $uvx]]
$sel set user $uvy
#draw vector $coords {0.0 uvy 0.0}
}
#pbc box -color 3
}
proc enable_trace {} {
global vmd_frame
trace variable vmd_frame([molinfo top]) w vmd_draw_spin
}
set molid [mol addfile {/home/jtranch/Documents/lammps/src/dump.lammpstrj} type {lammpstrj} autobonds off first 0 last -1 step 1 waitfor all]
scale by 0.5
animate style Loop
enable_trace
proc vmd_draw_arrow {mol start end} {
set middle [vecadd $start [vecscale 0.9 [vecsub $end $start]]]
graphics $mol cylinder $start $middle radius 0.05
graphics $mol cone $middle $end radius 0.01 color 3
}
proc vmd_draw_vector {args} {
set usage {"draw vector {x1 y1 z1} {x2 y2 z2} [scale <s>] [resolution <res>] [radius <r>] [filled <yes/no>]"}
# defaults
set scale 2.0
set res 50
set radius 0.1
set filled yes
if {[llength $args] < 3} {
error "wrong # args: should be $usage"
}
set mol [lindex $args 0]
set center [lindex $args 1]
set vector [lindex $args 2]
if {[llength $center] != 3 || [llength $vector] != 3} {
error "wrong type of args: should be $usage"
}
foreach {flag value} [lrange $args 3 end] {
switch -glob $flag {
scale {set scale $value}
res* {set res $value}
rad* {set radius $value}
fill* {set filled $value}
default {error "unknown option '$flag': should be $usage" }
}
}
set vechalf [vecscale [expr $scale * 0.5] $vector]
return [list \
[graphics $mol color yellow]\
[graphics $mol cylinder [vecsub $center $vechalf]\
[vecadd $center [vecscale 0.7 $vechalf]] \
radius $radius resolution $res filled $filled] \
[graphics $mol color orange]\
[graphics $mol cone [vecadd $center [vecscale 0.6 $vechalf]] \
[vecadd $center $vechalf] radius [expr $radius * 2.5] \
resolution $res]]
}
proc vmd_draw_spin {args} {
global molid
graphics $molid delete all
set frame [molinfo $molid get frame]
set natoms [molinfo $molid get numatoms]
for {set i 0} {$i < $natoms} {incr i} {
set sel [atomselect top "index $i"]
# set sel [atomselect top "index 1200"]
set coords [lindex [$sel get {x y z}] $molid]
set velocities [lindex [$sel get {vx vy vz}] $molid]
draw vector $coords $velocities
set uvx [lindex [$sel get {vx}] $molid]
set uvy [lindex [$sel get {vy}] $molid]
set uvz [lindex [$sel get {vz}] $molid]
$sel set user [vecadd [vecadd [vecscale $uvy $uvy] [vecscale $uvz $uvz] ] [vecscale $uvx $uvx]]
$sel set user $uvy
#draw vector $coords {0.0 uvy 0.0}
}
#pbc box -color 3
}
proc enable_trace {} {
global vmd_frame
trace variable vmd_frame([molinfo top]) w vmd_draw_spin
}
set molid [mol addfile {/home/jtranch/Documents/lammps/src/dump.lammpstrj} type {lammpstrj} autobonds off first 0 last -1 step 1 waitfor all]
scale by 0.5
animate style Loop
enable_trace

View File

@ -1,12 +1,12 @@
block_size 1
start_frame 1
n_frames 19
nonbonded_cutoff 10.0
basis_type 0
primary_output_style 0
output_solution_flag 1
output_spline_coeffs_flag 1
pair_nonbonded_bspline_basis_order 6
pair_nonbonded_basis_set_resolution 0.7
pair_nonbonded_output_binwidth 0.1
matrix_type 0
block_size 1
start_frame 1
n_frames 19
nonbonded_cutoff 10.0
basis_type 0
primary_output_style 0
output_solution_flag 1
output_spline_coeffs_flag 1
pair_nonbonded_bspline_basis_order 6
pair_nonbonded_basis_set_resolution 0.7
pair_nonbonded_output_binwidth 0.1
matrix_type 0

View File

@ -1,21 +1,21 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
python end_of_step_callback here """
from __future__ import print_function
@ -32,19 +32,19 @@ def post_force_callback(lmp, v):
print("### POST_FORCE ###", t)
"""
fix 1 all nve
fix 1 all nve
fix 2 all python/invoke 50 end_of_step end_of_step_callback
fix 3 all python/invoke 50 post_force post_force_callback
#dump id all atom 50 dump.melt
#dump id all atom 50 dump.melt
#dump 2 all image 25 image.*.jpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 2 pad 3
#dump 2 all image 25 image.*.jpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 2 pad 3
#dump 3 all movie 25 movie.mpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 3 pad 3
#dump 3 all movie 25 movie.mpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 3 pad 3
thermo 50
run 250
thermo 50
run 250

View File

@ -1,22 +1,22 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 2 0 2 0 2
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc 0.8442
region box block 0 2 0 2 0 2
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.1 bin
neighbor 0.1 bin
neigh_modify every 20 delay 0 check no
neigh_modify every 20 delay 0 check no
python post_force_callback here """
from __future__ import print_function
@ -55,18 +55,18 @@ def post_force_callback(lmp, v):
print(e)
"""
fix 1 all nve
fix 1 all nve
fix 3 all python/invoke 50 post_force post_force_callback
#dump id all atom 1 dump.melt
#dump id all atom 1 dump.melt
#dump 2 all image 1 image.*.jpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 2 pad 3
#dump 2 all image 1 image.*.jpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 2 pad 3
#dump 3 all movie 1 movie.mpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 3 pad 3
#dump 3 all movie 1 movie.mpg type type &
# axes yes 0.8 0.02 view 60 -30
#dump_modify 3 pad 3
thermo 1
run 100
thermo 1
run 100

View File

@ -1,23 +1,23 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all python/move py_nve.NVE
fix 1 all python/move py_nve.NVE
thermo 50
run 250
thermo 50
run 250

View File

@ -1,23 +1,23 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all python/move py_nve.NVE_Opt
fix 1 all python/move py_nve.NVE_Opt
thermo 50
run 250
thermo 50
run 250

View File

@ -1,27 +1,27 @@
units real
atom_style full
units real
atom_style full
read_data data.spce
read_data data.spce
pair_style hybrid/overlay coul/cut 12.0 python 12.0
pair_style hybrid/overlay coul/cut 12.0 python 12.0
pair_coeff * * coul/cut
pair_coeff * * python py_pot.LJCutSPCE OW NULL
pair_coeff * * coul/cut
pair_coeff * * python py_pot.LJCutSPCE OW NULL
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
special_bonds lj/coul 0.0 0.0 1.0
neighbor 2.0 bin
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
# create combined lj/coul table for all atom types
# generate tabulated potential from python variant

View File

@ -0,0 +1,84 @@
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
region box block -5 5 -5 5 -5 5
create_box 2 box
create_atoms 1 box
set type 1 type/ratio 2 0.5 424662346
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
write_restart repulsive.restart
clear
read_restart repulsive.restart
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
fix 1 all nve
thermo 50
run 250 post no
clear
read_restart repulsive.restart
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
clear
read_restart repulsive.restart
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
pair_coeff 1 2 python.dat PYTH_A_B
pair_coeff 2 2 python.dat PYTH_B_B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat

View File

@ -1,29 +1,29 @@
# 3d Lennard-Jones hybrid
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 2 box
create_atoms 1 box
mass * 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 2 box
create_atoms 1 box
mass * 1.0
region half block -0.1 4.9 0 10 0 10
set region half type 2
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_coeff * 2 lj/cut 1.0 1.0
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
write_data hybrid.data
write_restart hybrid.restart
@ -32,32 +32,32 @@ clear
read_restart hybrid.restart
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_coeff * 2 lj/cut 1.0 1.0
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
clear
units lj
atom_style atomic
units lj
atom_style atomic
read_data hybrid.data
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_style hybrid lj/cut 2.5 python 2.5
pair_coeff * * python py_pot.LJCutMelt lj NULL
pair_coeff * 2 lj/cut 1.0 1.0
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
shell rm hybrid.data hybrid.restart

View File

@ -1,25 +1,25 @@
units real
atom_style full
units real
atom_style full
read_data data.spce
read_data data.spce
pair_style python 12.0
pair_coeff * * py_pot.LJCutSPCE OW HW
pair_style python 12.0
pair_coeff * * py_pot.LJCutSPCE OW HW
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
special_bonds lj/coul 0.0 0.0 1.0
neighbor 2.0 bin
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
# create only lj/cut table for the oxygen atoms from python
shell rm -f spce.table
@ -27,7 +27,7 @@ pair_write 1 1 2000 rsq 0.1 12 spce.table OW-OW
# switch to tabulated potential with long-range coulomb as overlay
pair_style hybrid/overlay coul/long 12.0 table linear 2000
kspace_style pppm 1.0e-6
kspace_style pppm 1.0e-6
pair_coeff * * coul/long
pair_coeff 1 1 table spce.table OW-OW

View File

@ -1,26 +1,26 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
write_data melt.data
write_restart melt.restart
@ -29,30 +29,30 @@ clear
read_restart melt.restart
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
clear
units lj
atom_style atomic
units lj
atom_style atomic
read_data melt.data
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
shell rm melt.data melt.restart

View File

@ -1,28 +1,28 @@
units real
atom_style full
units real
atom_style full
read_data data.spce
read_data data.spce
pair_style hybrid/overlay coul/long 12.0 python 12.0
kspace_style pppm 1.0e-6
pair_style hybrid/overlay coul/long 12.0 python 12.0
kspace_style pppm 1.0e-6
pair_coeff * * coul/long
pair_coeff * * python py_pot.LJCutSPCE OW NULL
pair_coeff * * coul/long
pair_coeff * * python py_pot.LJCutSPCE OW NULL
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
special_bonds lj/coul 0.0 0.0 1.0
neighbor 2.0 bin
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
thermo 10
run 100

View File

@ -1,18 +1,18 @@
# 3d Lennard-Jones melt
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass * 1.0
velocity all create 3.0 87287
velocity all create 3.0 87287
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj
# generate tabulated potential from python variant
pair_write 1 1 2000 rsq 0.01 2.5 lj_1_1.table LJ
@ -20,13 +20,13 @@ pair_write 1 1 2000 rsq 0.01 2.5 lj_1_1.table LJ
pair_style table linear 2000
pair_coeff 1 1 lj_1_1.table LJ
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 1 all nve
thermo 50
run 250
thermo 50
run 250
shell rm lj_1_1.table

View File

@ -1,25 +1,25 @@
# 3d Lennard-Jones melt with Python functions added
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 1.44 87287 loop geom
velocity all create 1.44 87287 loop geom
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes
fix 1 all nve
fix 1 all nve
run 10
run 10
# 1st Python function
# example of catching a syntax error

View File

@ -0,0 +1,235 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.001 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.139 | 4.139 | 4.139 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 17.4414 on 1 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.977 | 4.977 | 4.977 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 23.4715 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.138 | 4.138 | 4.138 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 0.843376 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair table, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.552 | 4.552 | 4.552 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.1
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29842 422330.9 0 423824.49 251997.21
500 126.87418 422312.08 0 423824.46 252053.48
Loop time of 1.57415 on 1 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:43

View File

@ -0,0 +1,235 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.000 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.225 | 3.225 | 3.225 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423843.22 0 423878.98 249277.9
50 79.665061 422928.03 0 423877.66 248995.64
100 108.5878 422583.81 0 423878.21 250822.76
150 130.90607 422317.45 0 423877.89 251949.08
200 120.05458 422447.24 0 423878.33 252105.09
250 135.76605 422259.47 0 423877.84 252077.41
Loop time of 4.70112 on 4 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 3.666 | 3.667 | 3.667 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.41
300 119.63404 422452.21 0 423878.28 251958.74
350 129.35013 422336.12 0 423878 252069.99
400 123.04377 422411.48 0 423878.19 252024.23
450 126.01375 422375.98 0 423878.1 252019.19
500 126.91094 422365.34 0 423878.15 252012.59
Loop time of 6.20423 on 4 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 3.227 | 3.227 | 3.229 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.41
300 119.63404 422452.21 0 423878.28 251958.74
350 129.35013 422336.12 0 423878 252069.99
400 123.04377 422411.48 0 423878.19 252024.23
450 126.01375 422375.98 0 423878.1 252019.19
500 126.91094 422365.34 0 423878.15 252012.59
Loop time of 0.257048 on 4 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair table, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.257 | 3.257 | 3.257 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.38
300 119.63401 422452.21 0 423878.28 251958.73
350 129.35009 422336.11 0 423878 252069.98
400 123.04383 422411.48 0 423878.19 252024.21
450 126.01378 422375.98 0 423878.1 252019.16
500 126.91078 422365.34 0 423878.15 252012.57
Loop time of 0.497624 on 4 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:11

View File

@ -0,0 +1,288 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.000 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- GPU package (short-range, long-range and three-body potentials):
@Article{Brown11,
author = {W. M. Brown, P. Wang, S. J. Plimpton, A. N. Tharrington},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces},
journal = {Comp.~Phys.~Comm.},
year = 2011,
volume = 182,
pages = {898--911}
}
@Article{Brown12,
author = {W. M. Brown, A. Kohlmeyer, S. J. Plimpton, A. N. Tharrington},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh},
journal = {Comp.~Phys.~Comm.},
year = 2012,
volume = 183,
pages = {449--459}
}
@Article{Brown13,
author = {W. M. Brown, Y. Masako},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers Three-Body Potentials},
journal = {Comp.~Phys.~Comm.},
year = 2013,
volume = 184,
pages = {2785--2793}
}
@Article{Trung15,
author = {T. D. Nguyen, S. J. Plimpton},
title = {Accelerating dissipative particle dynamics simulations for soft matter systems},
journal = {Comput.~Mater.~Sci.},
year = 2015,
volume = 100,
pages = {173--180}
}
@Article{Trung17,
author = {T. D. Nguyen},
title = {GPU-accelerated Tersoff potentials for massively parallel Molecular Dynamics simulations},
journal = {Comp.~Phys.~Comm.},
year = 2017,
volume = 212,
pages = {113--122}
}
@Article{Nikolskiy19,
author = {V. Nikolskiy, V. Stegailov},
title = {GPU acceleration of four-site water models in LAMMPS},
journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic},
year = 2019
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.612 | 4.612 | 4.612 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 21.1837 on 1 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 5.451 | 5.451 | 5.451 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 28.5184 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.611 | 4.611 | 4.611 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 1.1146 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 2.965 | 2.965 | 2.965 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.09
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29841 422330.9 0 423824.49 251997.2
500 126.87418 422312.08 0 423824.45 252053.48
Loop time of 0.389958 on 1 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:54

View File

@ -0,0 +1,268 @@
LAMMPS (17 Feb 2022)
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.001 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.024 | 6.024 | 6.024 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 18.9294 on 4 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 7.626 | 7.626 | 7.626 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 24.3294 on 4 procs for 250 steps with 4000 atoms
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut/omp, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Last active /omp style is pair_style harmonic/cut/omp
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut/omp, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.023 | 6.023 | 6.023 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 0.219199 on 4 procs for 250 steps with 4000 atoms
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Last active /omp style is pair_style table/omp
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair table/omp, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.056 | 6.056 | 6.056 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.1
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29842 422330.9 0 423824.49 251997.21
500 126.87418 422312.08 0 423824.46 252053.48
Loop time of 0.374806 on 4 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:44

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import math
class LAMMPSPairPotential(object):
def __init__(self):
@ -10,6 +11,34 @@ class LAMMPSPairPotential(object):
if (units != self.units):
raise Exception("Conflicting units: %s vs. %s" % (self.units,units))
class Harmonic(LAMMPSPairPotential):
def __init__(self):
super(Harmonic,self).__init__()
self.units = 'real'
# set coeffs: K, r0
self.coeff = {'A' : {'A' : (0.2,9.0),
'B' : (math.sqrt(0.2*0.4),9.0)},
'B' : {'A' : (math.sqrt(0.2*0.4),9.0),
'B' : (0.4,9.0)}}
def compute_force(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r <= coeff[1]):
return 2.0*delta*coeff[0]/r
else:
return 0.0
def compute_energy(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r <= coeff[1]):
return delta*delta*coeff[0]
else:
return 0.0
class LJCutMelt(LAMMPSPairPotential):
def __init__(self):
super(LJCutMelt,self).__init__()

File diff suppressed because it is too large Load Diff

View File

@ -206,7 +206,7 @@ void ComputeStressCartesian::init_list(int /* id */, NeighList *ptr)
void ComputeStressCartesian::compute_array()
{
int i, j, ii, jj, inum, jnum, itype, jtype;
int bin, bin1, bin2, bin3;
int bin, bin1, bin2;
tagint itag, jtag;
double xtmp, ytmp, ztmp, delx, dely, delz;
double rsq, fpair, factor_coul, factor_lj;
@ -266,7 +266,6 @@ void ComputeStressCartesian::compute_array()
Pair *pair = force->pair;
double **cutsq = force->pair->cutsq;
double risq, rjsq;
double xi1, xi2, xj1, xj2;
for (ii = 0; ii < inum; ii++) {
@ -362,7 +361,7 @@ void ComputeStressCartesian::compute_pressure_1d(double fpair, double xi, double
double dely, double delz)
{
int bin_s, bin_e, bin_step, bin, bin_limit;
double xa, xb, l_sum;
double xa, xb;
if (xi < domain->boxlo[dir1])
xi += (domain->boxhi[dir1] - domain->boxlo[dir1]);
@ -456,8 +455,8 @@ void ComputeStressCartesian::compute_pressure_1d(double fpair, double xi, double
}
}
void ComputeStressCartesian::compute_pressure_2d(double fpair, double xi, double yi, double xj,
double yj, double delx, double dely, double delz)
void ComputeStressCartesian::compute_pressure_2d(double fpair, double xi, double yi, double /*xj*/,
double /*yj*/, double delx, double dely, double delz)
{
int bin1, bin2, next_bin1, next_bin2;
double la = 0.0, lb = 0.0, l_sum = 0.0;

View File

@ -189,7 +189,6 @@ void ComputeStressSpherical::compute_array()
double r, vr, vt, vp, theta;
double **x = atom->x;
double **v = atom->v;
double *mass = atom->mass;
tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
@ -247,10 +246,6 @@ void ComputeStressSpherical::compute_array()
Pair *pair = force->pair;
double **cutsq = force->pair->cutsq;
double risq, rjsq;
double dir1i, dir2i, dir3i, dir1j, dir2j, dir3j;
double xi, yi, zi, xj, yj, zj;
double qi[3], l1, l2, l3, l4, R1, R2, Fa, Fb, l_sum;
double rij, f, ririj, sqr, la, lb, sql0, lambda0;
double rsqxy, ririjxy, sqrixy, sqlxy0, A, B, C;

View File

@ -99,8 +99,8 @@ void PairHarmonicCut::compute(int eflag, int vflag)
if (rsq < cutsq[itype][jtype]) {
const double r = sqrt(rsq);
const double delta = cut[itype][jtype] - r;
const double philj = factor_lj * delta * k[itype][jtype];
const double fpair = delta * philj / r;
const double prefactor = factor_lj * delta * k[itype][jtype];
const double fpair = 2.0 * prefactor / r;
fxtmp += delx * fpair;
fytmp += dely * fpair;
@ -111,7 +111,10 @@ void PairHarmonicCut::compute(int eflag, int vflag)
f[j][2] -= delz * fpair;
}
if (evflag) ev_tally(i, j, nlocal, newton_pair, philj, 0.0, fpair, delx, dely, delz);
if (evflag) {
const double philj = prefactor * delta;
ev_tally(i, j, nlocal, newton_pair, philj, 0.0, fpair, delx, dely, delz);
}
}
}
f[i][0] += fxtmp;
@ -186,10 +189,10 @@ double PairHarmonicCut::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
cut[i][j] = mix_distance(cut[i][i], cut[j][j]);
cut[j][i] = cut[i][j];
k[i][j] = mix_energy(k[i][i], k[j][j], cut[i][i], cut[j][j]);
k[j][i] = k[i][j];
}
k[j][i] = k[i][j];
cut[j][i] = cut[i][j];
return cut[i][j];
}
@ -296,8 +299,8 @@ double PairHarmonicCut::single(int /*i*/, int /*j*/, int itype, int jtype, doubl
}
const double r = sqrt(rsq);
const double delta = cut[itype][jtype] - r;
const double philj = factor_lj * delta * k[itype][jtype];
fforce = delta * philj / r;
const double philj = factor_lj * delta * delta * k[itype][jtype];
fforce = 2.0 * philj / (r * delta);
return philj;
}

View File

@ -233,55 +233,62 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) :
else
itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
double scalefactor = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
if (itype < 0 || itype > ntypes)
error->all(FLERR, "Illegal fix lb/fluid command: scaleGamma");
if ((itype < 0) || (itype > ntypes))
error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
if (itype)
Gamma[itype] = scalefactor;
else
for (int it = 1; it <= atom->ntypes; it++) Gamma[it] = scalefactor;
iarg += 3;
} else if (strcmp(arg[iarg], "dx") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
dx_lb = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
setdx = 0;
} else if (strcmp(arg[iarg], "dm") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
dm_lb = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "a0") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
a_0_real = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
seta0 = 0;
} else if (strcmp(arg[iarg], "noise") == 0) {
if ((iarg + 3) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
noisestress = 1;
T = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
seed = atoi(arg[iarg + 2]);
seed = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
iarg += 3;
} else if (strcmp(arg[iarg], "stencil") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
n_stencil = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "read_restart") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
readrestart = 1;
int nlength = strlen(arg[iarg + 1]) + 16;
char *filename = new char[nlength];
strcpy(filename, arg[iarg + 1]);
char *filename = utils::strdup(arg[iarg + 1]);
MPI_File_open(world, filename, MPI_MODE_RDONLY, MPI_INFO_NULL, &pFileRead);
delete[] filename;
iarg += 2;
} else if (strcmp(arg[iarg], "write_restart") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
printrestart = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "zwall_velocity") == 0) {
if ((iarg + 3) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
if (domain->periodicity[2] != 0)
error->all(FLERR, "fix lb/fluid error: setting \
a z wall velocity without implementing fixed BCs in z");
error->all(FLERR, "setting a z wall velocity without implementing fixed BCs in z");
vwbt = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
vwtp = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
iarg += 3;
} else if (strcmp(arg[iarg], "pressurebcx") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
pressure = 1;
rhofactor = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "bodyforce") == 0) {
if ((iarg + 4) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
bodyforcex = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
bodyforcey = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
bodyforcez = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
@ -290,6 +297,7 @@ a z wall velocity without implementing fixed BCs in z");
numvel = 19;
iarg += 1;
} else if (strcmp(arg[iarg], "dumpxdmf") == 0) {
if ((iarg + 4) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
dump_interval = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
dump_file_name_xdmf = std::string(arg[iarg + 2]) + std::string(".xdmf");
dump_file_name_raw = std::string(arg[iarg + 2]) + std::string(".raw");
@ -299,9 +307,11 @@ a z wall velocity without implementing fixed BCs in z");
lin_init = 1;
iarg += 1;
} else if (strcmp(arg[iarg], "dof") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
setdof = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "npits") == 0) {
if ((iarg + 6) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
npits = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
h_p = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
l_p = utils::inumeric(FLERR, arg[iarg + 3], false, lmp);
@ -312,10 +322,11 @@ a z wall velocity without implementing fixed BCs in z");
sw = 1;
iarg += 1;
} else if (strcmp(arg[iarg], "wp") == 0) {
if ((iarg + 2) > narg) error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
w_p = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else
error->all(FLERR, "Illegal fix lb/fluid command");
error->all(FLERR, "Illegal fix lb/fluid command: {}", arg[iarg]);
}
//-------------------------------------------------------------------------
@ -2339,59 +2350,59 @@ void FixLbFluid::SetupBuffers(void)
//==========================================================================
// Output fluid density and velocity to file in XDMF format
//==========================================================================
void FixLbFluid::dump(const int step)
void FixLbFluid::dump(const bigint step)
{
static int frameindex = 0;
static bigint frameindex = 0;
if (dump_interval && step % dump_interval == 0) {
// Write XDMF grid entry for time step
if (me == 0) {
long int block = (long int) fluid_global_n0[0] * fluid_global_n0[1] * fluid_global_n0[2] *
sizeof(MPI_DOUBLE);
long int offset = frameindex * block * (1 + 3);
bigint block =
(bigint) fluid_global_n0[0] * fluid_global_n0[1] * fluid_global_n0[2] * sizeof(double);
bigint offset = frameindex * block * (1 + 3);
double time = dump_time_index ? update->ntimestep * dt_lb : frameindex;
fprintf(dump_file_handle_xdmf,
" <Grid Name=\"%d\">\n"
" <Time Value=\"%f\"/>\n\n"
" <Topology TopologyType=\"3DCoRectMesh\" Dimensions=\"%d %d %d\"/>\n"
" <Geometry GeometryType=\"ORIGIN_DXDYDZ\">\n"
" <DataItem Dimensions=\"3\">\n"
" %f %f %f\n"
" </DataItem>\n"
" <DataItem Dimensions=\"3\">\n"
" %f %f %f\n"
" </DataItem>\n"
" </Geometry>\n\n",
step, time, fluid_global_n0[2], fluid_global_n0[1], fluid_global_n0[0],
domain->boxlo[2], domain->boxlo[1], domain->boxlo[0], dx_lb, dx_lb, dx_lb);
fprintf(dump_file_handle_xdmf,
" <Attribute Name=\"density\">\n"
" <DataItem ItemType=\"Function\" Function=\"$0 * %f\" Dimensions=\"%d %d "
"%d\">\n"
" <DataItem Precision=\"%zd\" Format=\"Binary\" Seek=\"%ld\" "
"Dimensions=\"%d %d %d\">\n"
" %s\n"
" </DataItem>\n"
" </DataItem>\n"
" </Attribute>\n\n",
dm_lb / (dx_lb * dx_lb * dx_lb), fluid_global_n0[2], fluid_global_n0[1],
fluid_global_n0[0], sizeof(MPI_DOUBLE), offset, fluid_global_n0[2],
fluid_global_n0[1], fluid_global_n0[0], dump_file_name_raw.c_str());
fprintf(dump_file_handle_xdmf,
" <Attribute Name=\"velocity\" AttributeType=\"Vector\">\n"
" <DataItem ItemType=\"Function\" Function=\"$0 * %f\" Dimensions=\"%d %d "
"%d 3\">\n"
" <DataItem Precision=\"%zd\" Format=\"Binary\" Seek=\"%ld\" "
"Dimensions=\"%d %d %d 3\">\n"
" %s\n"
" </DataItem>\n"
" </DataItem>\n"
" </Attribute>\n\n",
dx_lb / dt_lb, fluid_global_n0[2], fluid_global_n0[1], fluid_global_n0[0],
sizeof(MPI_DOUBLE), offset + block * 1, fluid_global_n0[2], fluid_global_n0[1],
fluid_global_n0[0], dump_file_name_raw.c_str());
fprintf(dump_file_handle_xdmf, " </Grid>\n\n");
fmt::print(dump_file_handle_xdmf,
" <Grid Name=\"{}\">\n"
" <Time Value=\"{:f}\"/>\n\n"
" <Topology TopologyType=\"3DCoRectMesh\" Dimensions=\"{} {} {}\"/>\n"
" <Geometry GeometryType=\"ORIGIN_DXDYDZ\">\n"
" <DataItem Dimensions=\"3\">\n"
" {:f} {:f} {:f}\n"
" </DataItem>\n"
" <DataItem Dimensions=\"3\">\n"
" {:f} {:f} {:f}\n"
" </DataItem>\n"
" </Geometry>\n\n",
step, time, fluid_global_n0[2], fluid_global_n0[1], fluid_global_n0[0],
domain->boxlo[2], domain->boxlo[1], domain->boxlo[0], dx_lb, dx_lb, dx_lb);
fmt::print(dump_file_handle_xdmf,
" <Attribute Name=\"density\">\n"
" <DataItem ItemType=\"Function\" Function=\"$0 * {:f}\" "
"Dimensions=\"{} {} {}\">\n"
" <DataItem Precision=\"{}\" Format=\"Binary\" Seek=\"{}\" "
"Dimensions=\"{} {} {}\">\n"
" {}\n"
" </DataItem>\n"
" </DataItem>\n"
" </Attribute>\n\n",
dm_lb / (dx_lb * dx_lb * dx_lb), fluid_global_n0[2], fluid_global_n0[1],
fluid_global_n0[0], sizeof(double), offset, fluid_global_n0[2],
fluid_global_n0[1], fluid_global_n0[0], dump_file_name_raw.c_str());
fmt::print(dump_file_handle_xdmf,
" <Attribute Name=\"velocity\" AttributeType=\"Vector\">\n"
" <DataItem ItemType=\"Function\" Function=\"$0 * {:f}\" "
"Dimensions=\"{} {} {} 3\">\n"
" <DataItem Precision=\"{}\" Format=\"Binary\" Seek=\"{}\" "
"Dimensions=\"{} {} {} 3\">\n"
" {}\n"
" </DataItem>\n"
" </DataItem>\n"
" </Attribute>\n\n",
dx_lb / dt_lb, fluid_global_n0[2], fluid_global_n0[1], fluid_global_n0[0],
sizeof(double), offset + block * 1, fluid_global_n0[2], fluid_global_n0[1],
fluid_global_n0[0], dump_file_name_raw.c_str());
fmt::print(dump_file_handle_xdmf, " </Grid>\n\n");
frameindex++;
}
@ -3658,7 +3669,8 @@ void FixLbFluid::initializeGeometry()
// initializeGeometry defines the local lattice
// structure through the sublattice array
// --------------------------------------------
int geodump = 0;
#define GEODUMP 0
int i, j, k;
int boxlims[3][2]; // absolute subvolume coordinates
@ -3705,61 +3717,61 @@ void FixLbFluid::initializeGeometry()
}
}
// Output local geometry to data files labeled with processor number
// Type dump
if (geodump) {
auto datfile = fmt::format("subgeom_{}_end_type.dmp", me);
FILE *outfile = fopen(datfile.c_str(), "w");
if (!outfile)
error->one(FLERR, " file {} could not be opened: {}", datfile, utils::getsyserror());
// Output local geometry to data files labeled with processor number
// Type dump
#if GEODUMP
auto datfile = fmt::format("subgeom_{}_end_type.dmp", me);
FILE *outfile = fopen(datfile.c_str(), "w");
if (!outfile)
error->one(FLERR, " file {} could not be opened: {}", datfile, utils::getsyserror());
fmt::print(outfile, "\n me: {} px: {} py: {} pz: {}\n", me, comm->myloc[0], comm->myloc[1],
comm->myloc[2]);
fmt::print(outfile, "\n me: {} px: {} py: {} pz: {}\n", me, comm->myloc[0], comm->myloc[1],
comm->myloc[2]);
for (i = 0; i < subNbx; i++) {
fmt::print(outfile, "i={}\n", i);
for (k = subNbz - 1; k > -1; k--) {
if (k == subNbz - 2 || k == 0) {
for (j = 0; j < subNby + 2; j++) fputs("---", outfile);
fputs("\n", outfile);
}
for (j = 0; j < subNby; j++) {
fmt::print(outfile, " {} ", sublattice[i][j][k].type);
if (j == 0 || j == subNby - 2) fputs(" | ", outfile);
if (j == subNby - 1) fputs("\n", outfile);
}
for (i = 0; i < subNbx; i++) {
fmt::print(outfile, "i={}\n", i);
for (k = subNbz - 1; k > -1; k--) {
if (k == subNbz - 2 || k == 0) {
for (j = 0; j < subNby + 2; j++) fputs("---", outfile);
fputs("\n", outfile);
}
fputs(" \n \n", outfile);
}
fputs("\n", outfile);
fclose(outfile);
// Orientation dump
datfile = fmt::format("subgeom_{}_end_ori.dmp", me);
outfile = fopen(datfile.c_str(), "w");
if (!outfile)
error->one(FLERR, " file {} could not be opened: {}", datfile, utils::getsyserror());
fmt::print("\nme: {}\n", me);
for (i = 0; i < subNbx; i++) {
fmt::print("i={}\n", i);
for (k = subNbz - 1; k > -1; k--) {
if (k == subNbz - 2 || k == 0) {
for (j = 0; j < subNby + 2; j++) fputs("---", outfile);
fputs("\bn", outfile);
}
for (j = 0; j < subNby; j++) {
fmt::print(outfile, " {} ", sublattice[i][j][k].orientation);
if (j == 0 || j == subNby - 2) fputs(" | ", outfile);
if (j == subNby - 1) fputs("\n", outfile);
}
for (j = 0; j < subNby; j++) {
fmt::print(outfile, " {} ", sublattice[i][j][k].type);
if (j == 0 || j == subNby - 2) fputs(" | ", outfile);
if (j == subNby - 1) fputs("\n", outfile);
}
fputs(" \n \n", outfile);
}
fputs("\n", outfile);
fclose(outfile);
fputs(" \n \n", outfile);
}
fputs("\n", outfile);
fclose(outfile);
// Orientation dump
datfile = fmt::format("subgeom_{}_end_ori.dmp", me);
outfile = fopen(datfile.c_str(), "w");
if (!outfile)
error->one(FLERR, " file {} could not be opened: {}", datfile, utils::getsyserror());
fmt::print("\nme: {}\n", me);
for (i = 0; i < subNbx; i++) {
fmt::print("i={}\n", i);
for (k = subNbz - 1; k > -1; k--) {
if (k == subNbz - 2 || k == 0) {
for (j = 0; j < subNby + 2; j++) fputs("---", outfile);
fputs("\bn", outfile);
}
for (j = 0; j < subNby; j++) {
fmt::print(outfile, " {} ", sublattice[i][j][k].orientation);
if (j == 0 || j == subNby - 2) fputs(" | ", outfile);
if (j == subNby - 1) fputs("\n", outfile);
}
}
fputs(" \n \n", outfile);
}
fputs("\n", outfile);
fclose(outfile);
#endif
}
void FixLbFluid::addslit(int &x0, const int HS, const int HP, const int LE, const int SW)

View File

@ -51,7 +51,7 @@ class FixLbFluid : public Fix {
double compute_scalar() override;
double compute_vector(int) override;
void dump(int);
void dump(const bigint);
private:
double viscosity, densityinit_real, a_0_real, T;

View File

@ -524,7 +524,6 @@ double PairMesoCNT::init_one(int /* i */, int /* j */)
void PairMesoCNT::bond_neigh()
{
int nlocal = atom->nlocal;
int nghost = atom->nghost;
int **bondlist = neighbor->bondlist;
int nbondlist = neighbor->nbondlist;

View File

@ -75,11 +75,8 @@ void MLIAPModelNN::read_coeffs(char *coefffilename)
utils::getsyserror());
}
char line[MAXLINE], *ptr, *tstr;
int eof = 0;
int n;
int nwords = 0;
char line[MAXLINE], *ptr;
int n, eof = 0, nwords = 0;
while (nwords == 0) {
if (comm->me == 0) {
ptr = fgets(line, MAXLINE, fpcoeff);

View File

@ -197,7 +197,6 @@ void PairPACE::compute(int eflag, int vflag)
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
const int jtype = type[j];
j &= NEIGHMASK;
delx = x[j][0] - xtmp;
dely = x[j][1] - ytmp;

View File

@ -17,12 +17,14 @@
------------------------------------------------------------------------- */
#include "sna.h"
#include <cmath>
#include "comm.h"
#include "error.h"
#include "math_const.h"
#include "math_special.h"
#include "memory.h"
#include "error.h"
#include "comm.h"
#include <cmath>
using namespace std;
using namespace LAMMPS_NS;

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,25 +17,26 @@
#include "angle_charmm.h"
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::DEG2RAD;
using MathConst::RAD2DEG;
#define SMALL 0.001
static constexpr double SMALL = 0.001;
/* ---------------------------------------------------------------------- */
AngleCharmm::AngleCharmm(LAMMPS *lmp) : Angle(lmp) {}
AngleCharmm::AngleCharmm(LAMMPS *_lmp) : Angle(_lmp) {}
/* ---------------------------------------------------------------------- */
@ -55,15 +55,15 @@ AngleCharmm::~AngleCharmm()
void AngleCharmm::compute(int eflag, int vflag)
{
int i1,i2,i3,n,type;
double delx1,dely1,delz1,delx2,dely2,delz2;
double eangle,f1[3],f3[3];
double dtheta,tk;
double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22;
double delxUB,delyUB,delzUB,rsqUB,rUB,dr,rk,forceUB;
int i1, i2, i3, n, type;
double delx1, dely1, delz1, delx2, dely2, delz2;
double eangle, f1[3], f3[3];
double dtheta, tk;
double rsq1, rsq2, r1, r2, c, s, a, a11, a12, a22;
double delxUB, delyUB, delzUB, rsqUB, rUB, dr, rk, forceUB;
eangle = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -84,7 +84,7 @@ void AngleCharmm::compute(int eflag, int vflag)
dely1 = x[i1][1] - x[i2][1];
delz1 = x[i1][2] - x[i2][2];
rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
rsq1 = delx1 * delx1 + dely1 * dely1 + delz1 * delz1;
r1 = sqrt(rsq1);
// 2nd bond
@ -93,7 +93,7 @@ void AngleCharmm::compute(int eflag, int vflag)
dely2 = x[i3][1] - x[i2][1];
delz2 = x[i3][2] - x[i2][2];
rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
rsq2 = delx2 * delx2 + dely2 * dely2 + delz2 * delz2;
r2 = sqrt(rsq2);
// Urey-Bradley bond
@ -102,7 +102,7 @@ void AngleCharmm::compute(int eflag, int vflag)
delyUB = x[i3][1] - x[i1][1];
delzUB = x[i3][2] - x[i1][2];
rsqUB = delxUB*delxUB + delyUB*delyUB + delzUB*delzUB;
rsqUB = delxUB * delxUB + delyUB * delyUB + delzUB * delzUB;
rUB = sqrt(rsqUB);
// Urey-Bradley force & energy
@ -110,42 +110,44 @@ void AngleCharmm::compute(int eflag, int vflag)
dr = rUB - r_ub[type];
rk = k_ub[type] * dr;
if (rUB > 0.0) forceUB = -2.0*rk/rUB;
else forceUB = 0.0;
if (rUB > 0.0)
forceUB = -2.0 * rk / rUB;
else
forceUB = 0.0;
if (eflag) eangle = rk*dr;
if (eflag) eangle = rk * dr;
// angle (cos and sin)
c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
s = sqrt(1.0 - c*c);
s = sqrt(1.0 - c * c);
if (s < SMALL) s = SMALL;
s = 1.0/s;
s = 1.0 / s;
// harmonic force & energy
dtheta = acos(c) - theta0[type];
tk = k[type] * dtheta;
if (eflag) eangle += tk*dtheta;
if (eflag) eangle += tk * dtheta;
a = -2.0 * tk * s;
a11 = a*c / rsq1;
a12 = -a / (r1*r2);
a22 = a*c / rsq2;
a11 = a * c / rsq1;
a12 = -a / (r1 * r2);
a22 = a * c / rsq2;
f1[0] = a11*delx1 + a12*delx2 - delxUB*forceUB;
f1[1] = a11*dely1 + a12*dely2 - delyUB*forceUB;
f1[2] = a11*delz1 + a12*delz2 - delzUB*forceUB;
f1[0] = a11 * delx1 + a12 * delx2 - delxUB * forceUB;
f1[1] = a11 * dely1 + a12 * dely2 - delyUB * forceUB;
f1[2] = a11 * delz1 + a12 * delz2 - delzUB * forceUB;
f3[0] = a22*delx2 + a12*delx1 + delxUB*forceUB;
f3[1] = a22*dely2 + a12*dely1 + delyUB*forceUB;
f3[2] = a22*delz2 + a12*delz1 + delzUB*forceUB;
f3[0] = a22 * delx2 + a12 * delx1 + delxUB * forceUB;
f3[1] = a22 * dely2 + a12 * dely1 + delyUB * forceUB;
f3[2] = a22 * delz2 + a12 * delz1 + delzUB * forceUB;
// apply force to each of 3 atoms
@ -167,8 +169,9 @@ void AngleCharmm::compute(int eflag, int vflag)
f[i3][2] += f3[2];
}
if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
delx1,dely1,delz1,delx2,dely2,delz2);
if (evflag)
ev_tally(i1, i2, i3, nlocal, newton_bond, eangle, f1, f3, delx1, dely1, delz1, delx2, dely2,
delz2);
}
}
@ -177,14 +180,14 @@ void AngleCharmm::compute(int eflag, int vflag)
void AngleCharmm::allocate()
{
allocated = 1;
int n = atom->nangletypes;
const int np1 = atom->nangletypes + 1;
memory->create(k,n+1,"angle:k");
memory->create(theta0,n+1,"angle:theta0");
memory->create(k_ub,n+1,"angle:k_ub");
memory->create(r_ub,n+1,"angle:r_ub");
memory->create(setflag,n+1,"angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(k, np1, "angle:k");
memory->create(theta0, np1, "angle:theta0");
memory->create(k_ub, np1, "angle:k_ub");
memory->create(r_ub, np1, "angle:r_ub");
memory->create(setflag, np1, "angle:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -193,30 +196,30 @@ void AngleCharmm::allocate()
void AngleCharmm::coeff(int narg, char **arg)
{
if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
if (narg != 5) error->all(FLERR, "Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double theta0_one = utils::numeric(FLERR,arg[2],false,lmp);
double k_ub_one = utils::numeric(FLERR,arg[3],false,lmp);
double r_ub_one = utils::numeric(FLERR,arg[4],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double theta0_one = utils::numeric(FLERR, arg[2], false, lmp);
double k_ub_one = utils::numeric(FLERR, arg[3], false, lmp);
double r_ub_one = utils::numeric(FLERR, arg[4], false, lmp);
// convert theta0 from degrees to radians
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
theta0[i] = theta0_one/180.0 * MY_PI;
theta0[i] = DEG2RAD * theta0_one;
k_ub[i] = k_ub_one;
r_ub[i] = r_ub_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */
@ -232,10 +235,10 @@ double AngleCharmm::equilibrium_angle(int i)
void AngleCharmm::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nangletypes,fp);
fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp);
fwrite(&k_ub[1],sizeof(double),atom->nangletypes,fp);
fwrite(&r_ub[1],sizeof(double),atom->nangletypes,fp);
fwrite(&k[1], sizeof(double), atom->nangletypes, fp);
fwrite(&theta0[1], sizeof(double), atom->nangletypes, fp);
fwrite(&k_ub[1], sizeof(double), atom->nangletypes, fp);
fwrite(&r_ub[1], sizeof(double), atom->nangletypes, fp);
}
/* ----------------------------------------------------------------------
@ -247,15 +250,15 @@ void AngleCharmm::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
utils::sfread(FLERR, &k_ub[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
utils::sfread(FLERR, &r_ub[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k_ub[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r_ub[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nangletypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&k_ub[1], atom->nangletypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r_ub[1], atom->nangletypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1;
}
@ -267,8 +270,7 @@ void AngleCharmm::read_restart(FILE *fp)
void AngleCharmm::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g %g %g %g\n",
i,k[i],theta0[i]/MY_PI*180.0,k_ub[i],r_ub[i]);
fprintf(fp, "%d %g %g %g %g\n", i, k[i], RAD2DEG * theta0[i], k_ub[i], r_ub[i]);
}
/* ---------------------------------------------------------------------- */
@ -280,23 +282,23 @@ double AngleCharmm::single(int type, int i1, int i2, int i3)
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1,dely1,delz1);
double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image(delx2,dely2,delz2);
double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2);
domain->minimum_image(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
double delxUB = x[i3][0] - x[i1][0];
double delyUB = x[i3][1] - x[i1][1];
double delzUB = x[i3][2] - x[i1][2];
domain->minimum_image(delxUB,delyUB,delzUB);
double rUB = sqrt(delxUB*delxUB + delyUB*delyUB + delzUB*delzUB);
domain->minimum_image(delxUB, delyUB, delzUB);
double rUB = sqrt(delxUB * delxUB + delyUB * delyUB + delzUB * delzUB);
double c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
double c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -305,5 +307,5 @@ double AngleCharmm::single(int type, int i1, int i2, int i3)
double dr = rUB - r_ub[type];
double rk = k_ub[type] * dr;
return (tk*dtheta + rk*dr);
return (tk * dtheta + rk * dr);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -14,25 +13,23 @@
#include "angle_cosine.h"
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
#define SMALL 0.001
using MathConst::MY_PI;
/* ---------------------------------------------------------------------- */
AngleCosine::AngleCosine(LAMMPS *lmp) : Angle(lmp) {}
AngleCosine::AngleCosine(LAMMPS *_lmp) : Angle(_lmp) {}
/* ---------------------------------------------------------------------- */
@ -48,13 +45,13 @@ AngleCosine::~AngleCosine()
void AngleCosine::compute(int eflag, int vflag)
{
int i1,i2,i3,n,type;
double delx1,dely1,delz1,delx2,dely2,delz2;
double eangle,f1[3],f3[3];
double rsq1,rsq2,r1,r2,c,a,a11,a12,a22;
int i1, i2, i3, n, type;
double delx1, dely1, delz1, delx2, dely2, delz2;
double eangle, f1[3], f3[3];
double rsq1, rsq2, r1, r2, c, a, a11, a12, a22;
eangle = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -75,7 +72,7 @@ void AngleCosine::compute(int eflag, int vflag)
dely1 = x[i1][1] - x[i2][1];
delz1 = x[i1][2] - x[i2][2];
rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
rsq1 = delx1 * delx1 + dely1 * dely1 + delz1 * delz1;
r1 = sqrt(rsq1);
// 2nd bond
@ -84,31 +81,31 @@ void AngleCosine::compute(int eflag, int vflag)
dely2 = x[i3][1] - x[i2][1];
delz2 = x[i3][2] - x[i2][2];
rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
rsq2 = delx2 * delx2 + dely2 * dely2 + delz2 * delz2;
r2 = sqrt(rsq2);
// c = cosine of angle
c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
// force & energy
if (eflag) eangle = k[type]*(1.0+c);
if (eflag) eangle = k[type] * (1.0 + c);
a = k[type];
a11 = a*c / rsq1;
a12 = -a / (r1*r2);
a22 = a*c / rsq2;
a11 = a * c / rsq1;
a12 = -a / (r1 * r2);
a22 = a * c / rsq2;
f1[0] = a11*delx1 + a12*delx2;
f1[1] = a11*dely1 + a12*dely2;
f1[2] = a11*delz1 + a12*delz2;
f3[0] = a22*delx2 + a12*delx1;
f3[1] = a22*dely2 + a12*dely1;
f3[2] = a22*delz2 + a12*delz1;
f1[0] = a11 * delx1 + a12 * delx2;
f1[1] = a11 * dely1 + a12 * dely2;
f1[2] = a11 * delz1 + a12 * delz2;
f3[0] = a22 * delx2 + a12 * delx1;
f3[1] = a22 * dely2 + a12 * dely1;
f3[2] = a22 * delz2 + a12 * delz1;
// apply force to each of 3 atoms
@ -130,8 +127,9 @@ void AngleCosine::compute(int eflag, int vflag)
f[i3][2] += f3[2];
}
if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
delx1,dely1,delz1,delx2,dely2,delz2);
if (evflag)
ev_tally(i1, i2, i3, nlocal, newton_bond, eangle, f1, f3, delx1, dely1, delz1, delx2, dely2,
delz2);
}
}
@ -140,11 +138,11 @@ void AngleCosine::compute(int eflag, int vflag)
void AngleCosine::allocate()
{
allocated = 1;
int n = atom->nangletypes;
const int np1 = atom->nangletypes + 1;
memory->create(k,n+1,"angle:k");
memory->create(setflag,n+1,"angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(k, np1, "angle:k");
memory->create(setflag, np1, "angle:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -153,13 +151,13 @@ void AngleCosine::allocate()
void AngleCosine::coeff(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Incorrect args for angle coefficients");
if (narg != 2) error->all(FLERR, "Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -168,7 +166,7 @@ void AngleCosine::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */
@ -184,7 +182,7 @@ double AngleCosine::equilibrium_angle(int /*i*/)
void AngleCosine::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nangletypes,fp);
fwrite(&k[1], sizeof(double), atom->nangletypes, fp);
}
/* ----------------------------------------------------------------------
@ -195,8 +193,9 @@ void AngleCosine::read_restart(FILE *fp)
{
allocate();
if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world);
if (comm->me == 0)
utils::sfread(FLERR, &k[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
MPI_Bcast(&k[1], atom->nangletypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1;
}
@ -207,8 +206,7 @@ void AngleCosine::read_restart(FILE *fp)
void AngleCosine::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g\n",i,k[i]);
for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp, "%d %g\n", i, k[i]);
}
/* ---------------------------------------------------------------------- */
@ -220,19 +218,19 @@ double AngleCosine::single(int type, int i1, int i2, int i3)
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1,dely1,delz1);
double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image(delx2,dely2,delz2);
double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2);
domain->minimum_image(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
double c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
double c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
return k[type]*(1.0+c);
return k[type] * (1.0 + c);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,25 +17,24 @@
#include "angle_cosine_squared.h"
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
#define SMALL 0.001
using MathConst::DEG2RAD;
using MathConst::RAD2DEG;
/* ---------------------------------------------------------------------- */
AngleCosineSquared::AngleCosineSquared(LAMMPS *lmp) : Angle(lmp)
AngleCosineSquared::AngleCosineSquared(LAMMPS *_lmp) : Angle(_lmp)
{
k = nullptr;
theta0 = nullptr;
@ -57,14 +55,14 @@ AngleCosineSquared::~AngleCosineSquared()
void AngleCosineSquared::compute(int eflag, int vflag)
{
int i1,i2,i3,n,type;
double delx1,dely1,delz1,delx2,dely2,delz2;
double eangle,f1[3],f3[3];
double dcostheta,tk;
double rsq1,rsq2,r1,r2,c,a,a11,a12,a22;
int i1, i2, i3, n, type;
double delx1, dely1, delz1, delx2, dely2, delz2;
double eangle, f1[3], f3[3];
double dcostheta, tk;
double rsq1, rsq2, r1, r2, c, a, a11, a12, a22;
eangle = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -85,7 +83,7 @@ void AngleCosineSquared::compute(int eflag, int vflag)
dely1 = x[i1][1] - x[i2][1];
delz1 = x[i1][2] - x[i2][2];
rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
rsq1 = delx1 * delx1 + dely1 * dely1 + delz1 * delz1;
r1 = sqrt(rsq1);
// 2nd bond
@ -94,13 +92,13 @@ void AngleCosineSquared::compute(int eflag, int vflag)
dely2 = x[i3][1] - x[i2][1];
delz2 = x[i3][2] - x[i2][2];
rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
rsq2 = delx2 * delx2 + dely2 * dely2 + delz2 * delz2;
r2 = sqrt(rsq2);
// angle (cos and sin)
c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -110,19 +108,19 @@ void AngleCosineSquared::compute(int eflag, int vflag)
dcostheta = c - cos(theta0[type]);
tk = k[type] * dcostheta;
if (eflag) eangle = tk*dcostheta;
if (eflag) eangle = tk * dcostheta;
a = 2.0 * tk;
a11 = a*c / rsq1;
a12 = -a / (r1*r2);
a22 = a*c / rsq2;
a11 = a * c / rsq1;
a12 = -a / (r1 * r2);
a22 = a * c / rsq2;
f1[0] = a11*delx1 + a12*delx2;
f1[1] = a11*dely1 + a12*dely2;
f1[2] = a11*delz1 + a12*delz2;
f3[0] = a22*delx2 + a12*delx1;
f3[1] = a22*dely2 + a12*dely1;
f3[2] = a22*delz2 + a12*delz1;
f1[0] = a11 * delx1 + a12 * delx2;
f1[1] = a11 * dely1 + a12 * dely2;
f1[2] = a11 * delz1 + a12 * delz2;
f3[0] = a22 * delx2 + a12 * delx1;
f3[1] = a22 * dely2 + a12 * dely1;
f3[2] = a22 * delz2 + a12 * delz1;
// apply force to each of 3 atoms
@ -144,8 +142,9 @@ void AngleCosineSquared::compute(int eflag, int vflag)
f[i3][2] += f3[2];
}
if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
delx1,dely1,delz1,delx2,dely2,delz2);
if (evflag)
ev_tally(i1, i2, i3, nlocal, newton_bond, eangle, f1, f3, delx1, dely1, delz1, delx2, dely2,
delz2);
}
}
@ -154,13 +153,13 @@ void AngleCosineSquared::compute(int eflag, int vflag)
void AngleCosineSquared::allocate()
{
allocated = 1;
int n = atom->nangletypes;
const int np1 = atom->nangletypes + 1;
memory->create(k,n+1,"angle:k");
memory->create(theta0,n+1,"angle:theta0");
memory->create(k, np1, "angle:k");
memory->create(theta0, np1, "angle:theta0");
memory->create(setflag,n+1,"angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "angle:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -169,26 +168,26 @@ void AngleCosineSquared::allocate()
void AngleCosineSquared::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
if (narg != 3) error->all(FLERR, "Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double theta0_one = utils::numeric(FLERR,arg[2],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double theta0_one = utils::numeric(FLERR, arg[2], false, lmp);
// convert theta0 from degrees to radians
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
theta0[i] = theta0_one/180.0 * MY_PI;
theta0[i] = DEG2RAD * theta0_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */
@ -204,8 +203,8 @@ double AngleCosineSquared::equilibrium_angle(int i)
void AngleCosineSquared::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nangletypes,fp);
fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp);
fwrite(&k[1], sizeof(double), atom->nangletypes, fp);
fwrite(&theta0[1], sizeof(double), atom->nangletypes, fp);
}
/* ----------------------------------------------------------------------
@ -217,11 +216,11 @@ void AngleCosineSquared::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nangletypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1;
}
@ -233,7 +232,7 @@ void AngleCosineSquared::read_restart(FILE *fp)
void AngleCosineSquared::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],theta0[i]/MY_PI*180.0);
fprintf(fp, "%d %g %g\n", i, k[i], RAD2DEG * theta0[i]);
}
/* ---------------------------------------------------------------------- */
@ -245,21 +244,21 @@ double AngleCosineSquared::single(int type, int i1, int i2, int i3)
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1,dely1,delz1);
double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image(delx2,dely2,delz2);
double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2);
domain->minimum_image(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
double c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
double c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
double dcostheta = c - cos(theta0[type]);
double tk = k[type] * dcostheta;
return tk*dcostheta;
return tk * dcostheta;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -14,25 +13,26 @@
#include "angle_harmonic.h"
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::DEG2RAD;
using MathConst::RAD2DEG;
#define SMALL 0.001
static constexpr double SMALL = 0.001;
/* ---------------------------------------------------------------------- */
AngleHarmonic::AngleHarmonic(LAMMPS *lmp) : Angle(lmp)
AngleHarmonic::AngleHarmonic(LAMMPS *_lmp) : Angle(_lmp)
{
k = nullptr;
theta0 = nullptr;
@ -53,14 +53,14 @@ AngleHarmonic::~AngleHarmonic()
void AngleHarmonic::compute(int eflag, int vflag)
{
int i1,i2,i3,n,type;
double delx1,dely1,delz1,delx2,dely2,delz2;
double eangle,f1[3],f3[3];
double dtheta,tk;
double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22;
int i1, i2, i3, n, type;
double delx1, dely1, delz1, delx2, dely2, delz2;
double eangle, f1[3], f3[3];
double dtheta, tk;
double rsq1, rsq2, r1, r2, c, s, a, a11, a12, a22;
eangle = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -81,7 +81,7 @@ void AngleHarmonic::compute(int eflag, int vflag)
dely1 = x[i1][1] - x[i2][1];
delz1 = x[i1][2] - x[i2][2];
rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
rsq1 = delx1 * delx1 + dely1 * dely1 + delz1 * delz1;
r1 = sqrt(rsq1);
// 2nd bond
@ -90,39 +90,39 @@ void AngleHarmonic::compute(int eflag, int vflag)
dely2 = x[i3][1] - x[i2][1];
delz2 = x[i3][2] - x[i2][2];
rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
rsq2 = delx2 * delx2 + dely2 * dely2 + delz2 * delz2;
r2 = sqrt(rsq2);
// angle (cos and sin)
c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
s = sqrt(1.0 - c*c);
s = sqrt(1.0 - c * c);
if (s < SMALL) s = SMALL;
s = 1.0/s;
s = 1.0 / s;
// force & energy
dtheta = acos(c) - theta0[type];
tk = k[type] * dtheta;
if (eflag) eangle = tk*dtheta;
if (eflag) eangle = tk * dtheta;
a = -2.0 * tk * s;
a11 = a*c / rsq1;
a12 = -a / (r1*r2);
a22 = a*c / rsq2;
a11 = a * c / rsq1;
a12 = -a / (r1 * r2);
a22 = a * c / rsq2;
f1[0] = a11*delx1 + a12*delx2;
f1[1] = a11*dely1 + a12*dely2;
f1[2] = a11*delz1 + a12*delz2;
f3[0] = a22*delx2 + a12*delx1;
f3[1] = a22*dely2 + a12*dely1;
f3[2] = a22*delz2 + a12*delz1;
f1[0] = a11 * delx1 + a12 * delx2;
f1[1] = a11 * dely1 + a12 * dely2;
f1[2] = a11 * delz1 + a12 * delz2;
f3[0] = a22 * delx2 + a12 * delx1;
f3[1] = a22 * dely2 + a12 * dely1;
f3[2] = a22 * delz2 + a12 * delz1;
// apply force to each of 3 atoms
@ -144,8 +144,9 @@ void AngleHarmonic::compute(int eflag, int vflag)
f[i3][2] += f3[2];
}
if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
delx1,dely1,delz1,delx2,dely2,delz2);
if (evflag)
ev_tally(i1, i2, i3, nlocal, newton_bond, eangle, f1, f3, delx1, dely1, delz1, delx2, dely2,
delz2);
}
}
@ -154,13 +155,13 @@ void AngleHarmonic::compute(int eflag, int vflag)
void AngleHarmonic::allocate()
{
allocated = 1;
int n = atom->nangletypes;
const int np1 = atom->nangletypes + 1;
memory->create(k,n+1,"angle:k");
memory->create(theta0,n+1,"angle:theta0");
memory->create(k, np1, "angle:k");
memory->create(theta0, np1, "angle:theta0");
memory->create(setflag,n+1,"angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "angle:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -169,26 +170,26 @@ void AngleHarmonic::allocate()
void AngleHarmonic::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
if (narg != 3) error->all(FLERR, "Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double theta0_one = utils::numeric(FLERR,arg[2],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double theta0_one = utils::numeric(FLERR, arg[2], false, lmp);
// convert theta0 from degrees to radians
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
theta0[i] = theta0_one/180.0 * MY_PI;
theta0[i] = DEG2RAD * theta0_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */
@ -204,8 +205,8 @@ double AngleHarmonic::equilibrium_angle(int i)
void AngleHarmonic::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nangletypes,fp);
fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp);
fwrite(&k[1], sizeof(double), atom->nangletypes, fp);
fwrite(&theta0[1], sizeof(double), atom->nangletypes, fp);
}
/* ----------------------------------------------------------------------
@ -217,11 +218,11 @@ void AngleHarmonic::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nangletypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1;
}
@ -233,7 +234,7 @@ void AngleHarmonic::read_restart(FILE *fp)
void AngleHarmonic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],theta0[i]/MY_PI*180.0);
fprintf(fp, "%d %g %g\n", i, k[i], RAD2DEG * theta0[i]);
}
/* ---------------------------------------------------------------------- */
@ -245,21 +246,21 @@ double AngleHarmonic::single(int type, int i1, int i2, int i3)
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1,dely1,delz1);
double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image(delx2,dely2,delz2);
double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2);
domain->minimum_image(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
double c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
double c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
double dtheta = acos(c) - theta0[type];
double tk = k[type] * dtheta;
return tk*dtheta;
return tk * dtheta;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,33 +17,33 @@
#include "angle_table.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "tokenizer.h"
#include "neighbor.h"
#include "table_file_reader.h"
#include "tokenizer.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::DEG2RAD;
using MathConst::MY_PI;
using MathConst::RAD2DEG;
enum{LINEAR,SPLINE};
enum { LINEAR, SPLINE };
#define SMALL 0.001
#define TINY 1.E-10
#define TINY 1.E-10
/* ---------------------------------------------------------------------- */
AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp)
AngleTable::AngleTable(LAMMPS *_lmp) : Angle(_lmp)
{
writedata = 0;
ntables = 0;
@ -69,14 +68,14 @@ AngleTable::~AngleTable()
void AngleTable::compute(int eflag, int vflag)
{
int i1,i2,i3,n,type;
double eangle,f1[3],f3[3];
double delx1,dely1,delz1,delx2,dely2,delz2;
double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22;
double theta,u,mdu; //mdu: minus du, -du/dx=f
int i1, i2, i3, n, type;
double eangle, f1[3], f3[3];
double delx1, dely1, delz1, delx2, dely2, delz2;
double rsq1, rsq2, r1, r2, c, s, a, a11, a12, a22;
double theta, u, mdu; //mdu: minus du, -du/dx=f
eangle = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -97,7 +96,7 @@ void AngleTable::compute(int eflag, int vflag)
dely1 = x[i1][1] - x[i2][1];
delz1 = x[i1][2] - x[i2][2];
rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
rsq1 = delx1 * delx1 + dely1 * dely1 + delz1 * delz1;
r1 = sqrt(rsq1);
// 2nd bond
@ -106,39 +105,39 @@ void AngleTable::compute(int eflag, int vflag)
dely2 = x[i3][1] - x[i2][1];
delz2 = x[i3][2] - x[i2][2];
rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
rsq2 = delx2 * delx2 + dely2 * dely2 + delz2 * delz2;
r2 = sqrt(rsq2);
// angle (cos and sin)
c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
s = sqrt(1.0 - c*c);
s = sqrt(1.0 - c * c);
if (s < SMALL) s = SMALL;
s = 1.0/s;
s = 1.0 / s;
// tabulated force & energy
theta = acos(c);
uf_lookup(type,theta,u,mdu);
uf_lookup(type, theta, u, mdu);
if (eflag) eangle = u;
a = mdu * s;
a11 = a*c / rsq1;
a12 = -a / (r1*r2);
a22 = a*c / rsq2;
a11 = a * c / rsq1;
a12 = -a / (r1 * r2);
a22 = a * c / rsq2;
f1[0] = a11*delx1 + a12*delx2;
f1[1] = a11*dely1 + a12*dely2;
f1[2] = a11*delz1 + a12*delz2;
f3[0] = a22*delx2 + a12*delx1;
f3[1] = a22*dely2 + a12*dely1;
f3[2] = a22*delz2 + a12*delz1;
f1[0] = a11 * delx1 + a12 * delx2;
f1[1] = a11 * dely1 + a12 * dely2;
f1[2] = a11 * delz1 + a12 * delz2;
f3[0] = a22 * delx2 + a12 * delx1;
f3[1] = a22 * dely2 + a12 * dely1;
f3[2] = a22 * delz2 + a12 * delz1;
// apply force to each of 3 atoms
@ -160,8 +159,9 @@ void AngleTable::compute(int eflag, int vflag)
f[i3][2] += f3[2];
}
if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
delx1,dely1,delz1,delx2,dely2,delz2);
if (evflag)
ev_tally(i1, i2, i3, nlocal, newton_bond, eangle, f1, f3, delx1, dely1, delz1, delx2, dely2,
delz2);
}
}
@ -170,13 +170,13 @@ void AngleTable::compute(int eflag, int vflag)
void AngleTable::allocate()
{
allocated = 1;
int n = atom->nangletypes;
const int np1 = atom->nangletypes + 1;
memory->create(theta0,n+1,"angle:theta0");
memory->create(tabindex,n+1,"angle:tabindex");
memory->create(theta0, np1, "angle:theta0");
memory->create(tabindex, np1, "angle:tabindex");
memory->create(setflag,n+1,"angle:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "angle:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -185,14 +185,17 @@ void AngleTable::allocate()
void AngleTable::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal angle_style command");
if (narg != 2) error->all(FLERR, "Illegal angle_style command");
if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
else error->all(FLERR,"Unknown table style in angle style table");
if (strcmp(arg[0], "linear") == 0)
tabstyle = LINEAR;
else if (strcmp(arg[0], "spline") == 0)
tabstyle = SPLINE;
else
error->all(FLERR, "Unknown table style in angle style table");
tablength = utils::inumeric(FLERR,arg[1],false,lmp);
if (tablength < 2) error->all(FLERR,"Illegal number of angle table entries");
tablength = utils::inumeric(FLERR, arg[1], false, lmp);
if (tablength < 2) error->all(FLERR, "Illegal number of angle table entries");
// delete old tables, since cannot just change settings
@ -200,8 +203,8 @@ void AngleTable::settings(int narg, char **arg)
memory->sfree(tables);
if (allocated) {
memory->destroy(setflag);
memory->destroy(tabindex);
memory->destroy(setflag);
memory->destroy(tabindex);
}
allocated = 0;
@ -215,36 +218,35 @@ void AngleTable::settings(int narg, char **arg)
void AngleTable::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Illegal angle_coeff command");
if (narg != 3) error->all(FLERR, "Illegal angle_coeff command");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
int me;
MPI_Comm_rank(world,&me);
tables = (Table *)
memory->srealloc(tables,(ntables+1)*sizeof(Table),"angle:tables");
MPI_Comm_rank(world, &me);
tables = (Table *) memory->srealloc(tables, (ntables + 1) * sizeof(Table), "angle:tables");
Table *tb = &tables[ntables];
null_table(tb);
if (me == 0) read_table(tb,arg[1],arg[2]);
if (me == 0) read_table(tb, arg[1], arg[2]);
bcast_table(tb);
// error check on table parameters
if (tb->ninput <= 1) error->one(FLERR,"Invalid angle table length");
if (tb->ninput <= 1) error->one(FLERR, "Invalid angle table length");
double alo,ahi;
double alo, ahi;
alo = tb->afile[0];
ahi = tb->afile[tb->ninput-1];
if (fabs(alo-0.0) > TINY || fabs(ahi-180.0) > TINY)
error->all(FLERR,"Angle table must range from 0 to 180 degrees");
ahi = tb->afile[tb->ninput - 1];
if (fabs(alo - 0.0) > TINY || fabs(ahi - 180.0) > TINY)
error->all(FLERR, "Angle table must range from 0 to 180 degrees");
// convert theta from degrees to radians
for (int i = 0; i < tb->ninput; i++) {
tb->afile[i] *= MY_PI/180.0;
tb->ffile[i] *= 180.0/MY_PI;
tb->afile[i] *= DEG2RAD;
tb->ffile[i] *= RAD2DEG;
}
// spline read-in and compute a,e,f vectors within table
@ -263,7 +265,7 @@ void AngleTable::coeff(int narg, char **arg)
}
ntables++;
if (count == 0) error->all(FLERR,"Illegal angle_coeff command");
if (count == 0) error->all(FLERR, "Illegal angle_coeff command");
}
/* ----------------------------------------------------------------------
@ -301,8 +303,8 @@ void AngleTable::read_restart(FILE *fp)
void AngleTable::write_restart_settings(FILE *fp)
{
fwrite(&tabstyle,sizeof(int),1,fp);
fwrite(&tablength,sizeof(int),1,fp);
fwrite(&tabstyle, sizeof(int), 1, fp);
fwrite(&tablength, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -312,11 +314,11 @@ void AngleTable::write_restart_settings(FILE *fp)
void AngleTable::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &tabstyle, sizeof(int), 1, fp, nullptr, error);
utils::sfread(FLERR, &tablength, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&tabstyle,1,MPI_INT,0,world);
MPI_Bcast(&tablength,1,MPI_INT,0,world);
MPI_Bcast(&tabstyle, 1, MPI_INT, 0, world);
MPI_Bcast(&tablength, 1, MPI_INT, 0, world);
}
/* ---------------------------------------------------------------------- */
@ -328,23 +330,23 @@ double AngleTable::single(int type, int i1, int i2, int i3)
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
double delz1 = x[i1][2] - x[i2][2];
domain->minimum_image(delx1,dely1,delz1);
double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
domain->minimum_image(delx1, dely1, delz1);
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
double delx2 = x[i3][0] - x[i2][0];
double dely2 = x[i3][1] - x[i2][1];
double delz2 = x[i3][2] - x[i2][2];
domain->minimum_image(delx2,dely2,delz2);
double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2);
domain->minimum_image(delx2, dely2, delz2);
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
double c = delx1*delx2 + dely1*dely2 + delz1*delz2;
c /= r1*r2;
double c = delx1 * delx2 + dely1 * dely2 + delz1 * delz2;
c /= r1 * r2;
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
double theta = acos(c);
double u=0.0;
u_lookup(type,theta,u);
double u = 0.0;
u_lookup(type, theta, u);
return u;
}
@ -385,11 +387,9 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
{
TableFileReader reader(lmp, file, "angle");
char * line = reader.find_section_start(keyword);
char *line = reader.find_section_start(keyword);
if (!line) {
error->one(FLERR,"Did not find keyword in table file");
}
if (!line) { error->one(FLERR, "Did not find keyword in table file"); }
// read args on 2nd line of section
// allocate table arrays for file values
@ -419,10 +419,9 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
// warn if data was read incompletely, e.g. columns were missing
if (cerror) {
std::string str = fmt::format("{} of {} lines in table were incomplete or could not be parsed completely", cerror, tb->ninput);
error->warning(FLERR,str.c_str());
}
if (cerror)
error->warning(FLERR, "{} of {} lines in table incomplete or could not be parsed", cerror,
tb->ninput);
}
/* ----------------------------------------------------------------------
@ -432,22 +431,22 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
void AngleTable::spline_table(Table *tb)
{
memory->create(tb->e2file,tb->ninput,"angle:e2file");
memory->create(tb->f2file,tb->ninput,"angle:f2file");
memory->create(tb->e2file, tb->ninput, "angle:e2file");
memory->create(tb->f2file, tb->ninput, "angle:f2file");
double ep0 = - tb->ffile[0];
double epn = - tb->ffile[tb->ninput-1];
spline(tb->afile,tb->efile,tb->ninput,ep0,epn,tb->e2file);
double ep0 = -tb->ffile[0];
double epn = -tb->ffile[tb->ninput - 1];
spline(tb->afile, tb->efile, tb->ninput, ep0, epn, tb->e2file);
if (tb->fpflag == 0) {
tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->afile[1] - tb->afile[0]);
tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
(tb->afile[tb->ninput-1] - tb->afile[tb->ninput-2]);
tb->fphi = (tb->ffile[tb->ninput - 1] - tb->ffile[tb->ninput - 2]) /
(tb->afile[tb->ninput - 1] - tb->afile[tb->ninput - 2]);
}
double fp0 = tb->fplo;
double fpn = tb->fphi;
spline(tb->afile,tb->ffile,tb->ninput,fp0,fpn,tb->f2file);
spline(tb->afile, tb->ffile, tb->ninput, fp0, fpn, tb->f2file);
}
/* ----------------------------------------------------------------------
@ -458,44 +457,44 @@ void AngleTable::compute_table(Table *tb)
{
// delta = table spacing in angle for N-1 bins
int tlm1 = tablength-1;
int tlm1 = tablength - 1;
tb->delta = MY_PI / tlm1;
tb->invdelta = 1.0/tb->delta;
tb->deltasq6 = tb->delta*tb->delta / 6.0;
tb->invdelta = 1.0 / tb->delta;
tb->deltasq6 = tb->delta * tb->delta / 6.0;
// N-1 evenly spaced bins in angle from 0 to PI
// ang,e,f = value at lower edge of bin
// de,df values = delta values of e,f
// ang,e,f are N in length so de,df arrays can compute difference
memory->create(tb->ang,tablength,"angle:ang");
memory->create(tb->e,tablength,"angle:e");
memory->create(tb->de,tablength,"angle:de");
memory->create(tb->f,tablength,"angle:f");
memory->create(tb->df,tablength,"angle:df");
memory->create(tb->e2,tablength,"angle:e2");
memory->create(tb->f2,tablength,"angle:f2");
memory->create(tb->ang, tablength, "angle:ang");
memory->create(tb->e, tablength, "angle:e");
memory->create(tb->de, tablength, "angle:de");
memory->create(tb->f, tablength, "angle:f");
memory->create(tb->df, tablength, "angle:df");
memory->create(tb->e2, tablength, "angle:e2");
memory->create(tb->f2, tablength, "angle:f2");
double a;
for (int i = 0; i < tablength; i++) {
a = i*tb->delta;
a = i * tb->delta;
tb->ang[i] = a;
tb->e[i] = splint(tb->afile,tb->efile,tb->e2file,tb->ninput,a);
tb->f[i] = splint(tb->afile,tb->ffile,tb->f2file,tb->ninput,a);
tb->e[i] = splint(tb->afile, tb->efile, tb->e2file, tb->ninput, a);
tb->f[i] = splint(tb->afile, tb->ffile, tb->f2file, tb->ninput, a);
}
for (int i = 0; i < tlm1; i++) {
tb->de[i] = tb->e[i+1] - tb->e[i];
tb->df[i] = tb->f[i+1] - tb->f[i];
tb->de[i] = tb->e[i + 1] - tb->e[i];
tb->df[i] = tb->f[i + 1] - tb->f[i];
}
// get final elements from linear extrapolation
tb->de[tlm1] = 2.0*tb->de[tlm1-1] - tb->de[tlm1-2];
tb->df[tlm1] = 2.0*tb->df[tlm1-1] - tb->df[tlm1-2];
tb->de[tlm1] = 2.0 * tb->de[tlm1 - 1] - tb->de[tlm1 - 2];
tb->df[tlm1] = 2.0 * tb->df[tlm1 - 1] - tb->df[tlm1 - 2];
double ep0 = - tb->f[0];
double epn = - tb->f[tlm1];
spline(tb->ang,tb->e,tablength,ep0,epn,tb->e2);
spline(tb->ang,tb->f,tablength,tb->fplo,tb->fphi,tb->f2);
double ep0 = -tb->f[0];
double epn = -tb->f[tlm1];
spline(tb->ang, tb->e, tablength, ep0, epn, tb->e2);
spline(tb->ang, tb->f, tablength, tb->fplo, tb->fphi, tb->f2);
}
/* ----------------------------------------------------------------------
@ -522,19 +521,19 @@ void AngleTable::param_extract(Table *tb, char *line)
tb->fpflag = 1;
tb->fplo = values.next_double();
tb->fphi = values.next_double();
tb->fplo *= (180.0/MY_PI)*(180.0/MY_PI);
tb->fphi *= (180.0/MY_PI)*(180.0/MY_PI);
tb->fplo *= RAD2DEG * RAD2DEG;
tb->fphi *= RAD2DEG * RAD2DEG;
} else if (word == "EQ") {
tb->theta0 = values.next_double()/180.0*MY_PI;
tb->theta0 = DEG2RAD * values.next_double();
} else {
error->one(FLERR,"Invalid keyword in angle table parameters");
error->one(FLERR, "Invalid keyword in angle table parameters");
}
}
} catch(TokenizerException &e) {
} catch (TokenizerException &e) {
error->one(FLERR, e.what());
}
if (tb->ninput == 0) error->one(FLERR,"Angle table parameters did not set N");
if (tb->ninput == 0) error->one(FLERR, "Angle table parameters did not set N");
}
/* ----------------------------------------------------------------------
@ -545,80 +544,84 @@ void AngleTable::param_extract(Table *tb, char *line)
void AngleTable::bcast_table(Table *tb)
{
MPI_Bcast(&tb->ninput,1,MPI_INT,0,world);
MPI_Bcast(&tb->ninput, 1, MPI_INT, 0, world);
int me;
MPI_Comm_rank(world,&me);
MPI_Comm_rank(world, &me);
if (me > 0) {
memory->create(tb->afile,tb->ninput,"angle:afile");
memory->create(tb->efile,tb->ninput,"angle:efile");
memory->create(tb->ffile,tb->ninput,"angle:ffile");
memory->create(tb->afile, tb->ninput, "angle:afile");
memory->create(tb->efile, tb->ninput, "angle:efile");
memory->create(tb->ffile, tb->ninput, "angle:ffile");
}
MPI_Bcast(tb->afile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->efile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->ffile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->afile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(tb->efile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(tb->ffile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(&tb->fpflag,1,MPI_INT,0,world);
MPI_Bcast(&tb->fpflag, 1, MPI_INT, 0, world);
if (tb->fpflag) {
MPI_Bcast(&tb->fplo,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->fphi,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->fplo, 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&tb->fphi, 1, MPI_DOUBLE, 0, world);
}
MPI_Bcast(&tb->theta0,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->theta0, 1, MPI_DOUBLE, 0, world);
}
/* ----------------------------------------------------------------------
spline and splint routines modified from Numerical Recipes
------------------------------------------------------------------------- */
void AngleTable::spline(double *x, double *y, int n,
double yp1, double ypn, double *y2)
void AngleTable::spline(double *x, double *y, int n, double yp1, double ypn, double *y2)
{
int i,k;
double p,qn,sig,un;
int i, k;
double p, qn, sig, un;
double *u = new double[n];
if (yp1 > 0.99e300) y2[0] = u[0] = 0.0;
if (yp1 > 0.99e300)
y2[0] = u[0] = 0.0;
else {
y2[0] = -0.5;
u[0] = (3.0/(x[1]-x[0])) * ((y[1]-y[0]) / (x[1]-x[0]) - yp1);
u[0] = (3.0 / (x[1] - x[0])) * ((y[1] - y[0]) / (x[1] - x[0]) - yp1);
}
for (i = 1; i < n-1; i++) {
sig = (x[i]-x[i-1]) / (x[i+1]-x[i-1]);
p = sig*y2[i-1] + 2.0;
y2[i] = (sig-1.0) / p;
u[i] = (y[i+1]-y[i]) / (x[i+1]-x[i]) - (y[i]-y[i-1]) / (x[i]-x[i-1]);
u[i] = (6.0*u[i] / (x[i+1]-x[i-1]) - sig*u[i-1]) / p;
for (i = 1; i < n - 1; i++) {
sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
p = sig * y2[i - 1] + 2.0;
y2[i] = (sig - 1.0) / p;
u[i] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
}
if (ypn > 0.99e300) qn = un = 0.0;
if (ypn > 0.99e300)
qn = un = 0.0;
else {
qn = 0.5;
un = (3.0/(x[n-1]-x[n-2])) * (ypn - (y[n-1]-y[n-2]) / (x[n-1]-x[n-2]));
un = (3.0 / (x[n - 1] - x[n - 2])) * (ypn - (y[n - 1] - y[n - 2]) / (x[n - 1] - x[n - 2]));
}
y2[n-1] = (un-qn*u[n-2]) / (qn*y2[n-2] + 1.0);
for (k = n-2; k >= 0; k--) y2[k] = y2[k]*y2[k+1] + u[k];
y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
for (k = n - 2; k >= 0; k--) y2[k] = y2[k] * y2[k + 1] + u[k];
delete [] u;
delete[] u;
}
/* ---------------------------------------------------------------------- */
double AngleTable::splint(double *xa, double *ya, double *y2a, int n, double x)
{
int klo,khi,k;
double h,b,a,y;
int klo, khi, k;
double h, b, a, y;
klo = 0;
khi = n-1;
while (khi-klo > 1) {
k = (khi+klo) >> 1;
if (xa[k] > x) khi = k;
else klo = k;
khi = n - 1;
while (khi - klo > 1) {
k = (khi + klo) >> 1;
if (xa[k] > x)
khi = k;
else
klo = k;
}
h = xa[khi]-xa[klo];
a = (xa[khi]-x) / h;
b = (x-xa[klo]) / h;
y = a*ya[klo] + b*ya[khi] + ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
h = xa[khi] - xa[klo];
a = (xa[khi] - x) / h;
b = (x - xa[klo]) / h;
y = a * ya[klo] + b * ya[khi] +
((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0;
return y;
}
@ -628,31 +631,29 @@ double AngleTable::splint(double *xa, double *ya, double *y2a, int n, double x)
void AngleTable::uf_lookup(int type, double x, double &u, double &f)
{
if (!std::isfinite(x)) {
error->one(FLERR,"Illegal angle in angle style table");
}
if (!std::isfinite(x)) { error->one(FLERR, "Illegal angle in angle style table"); }
double fraction,a,b;
double fraction, a, b;
const Table *tb = &tables[tabindex[type]];
// invdelta is based on tablength-1
int itable = static_cast<int> (x * tb->invdelta);
int itable = static_cast<int>(x * tb->invdelta);
if (itable < 0) itable = 0;
if (itable >= tablength) itable = tablength-1;
if (itable >= tablength) itable = tablength - 1;
if (tabstyle == LINEAR) {
fraction = (x - tb->ang[itable]) * tb->invdelta;
u = tb->e[itable] + fraction*tb->de[itable];
f = tb->f[itable] + fraction*tb->df[itable];
u = tb->e[itable] + fraction * tb->de[itable];
f = tb->f[itable] + fraction * tb->df[itable];
} else if (tabstyle == SPLINE) {
fraction = (x - tb->ang[itable]) * tb->invdelta;
b = (x - tb->ang[itable]) * tb->invdelta;
a = 1.0 - b;
u = a * tb->e[itable] + b * tb->e[itable+1] +
((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * tb->deltasq6;
f = a * tb->f[itable] + b * tb->f[itable+1] +
((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * tb->deltasq6;
u = a * tb->e[itable] + b * tb->e[itable + 1] +
((a * a * a - a) * tb->e2[itable] + (b * b * b - b) * tb->e2[itable + 1]) * tb->deltasq6;
f = a * tb->f[itable] + b * tb->f[itable + 1] +
((a * a * a - a) * tb->f2[itable] + (b * b * b - b) * tb->f2[itable + 1]) * tb->deltasq6;
}
}
@ -662,26 +663,24 @@ void AngleTable::uf_lookup(int type, double x, double &u, double &f)
void AngleTable::u_lookup(int type, double x, double &u)
{
if (!std::isfinite(x)) {
error->one(FLERR,"Illegal angle in angle style table");
}
if (!std::isfinite(x)) { error->one(FLERR, "Illegal angle in angle style table"); }
double fraction,a,b;
double fraction, a, b;
const Table *tb = &tables[tabindex[type]];
int itable = static_cast<int> ( x * tb->invdelta);
int itable = static_cast<int>(x * tb->invdelta);
if (itable < 0) itable = 0;
if (itable >= tablength) itable = tablength-1;
if (itable >= tablength) itable = tablength - 1;
if (tabstyle == LINEAR) {
fraction = (x - tb->ang[itable]) * tb->invdelta;
u = tb->e[itable] + fraction*tb->de[itable];
u = tb->e[itable] + fraction * tb->de[itable];
} else if (tabstyle == SPLINE) {
fraction = (x - tb->ang[itable]) * tb->invdelta;
b = (x - tb->ang[itable]) * tb->invdelta;
a = 1.0 - b;
u = a * tb->e[itable] + b * tb->e[itable+1] +
((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * tb->deltasq6;
u = a * tb->e[itable] + b * tb->e[itable + 1] +
((a * a * a - a) * tb->e2[itable] + (b * b * b - b) * tb->e2[itable + 1]) * tb->deltasq6;
}
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -46,12 +45,12 @@ BondFENE::~BondFENE()
void BondFENE::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
double rsq,r0sq,rlogarg,sr2,sr6;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
double rsq, r0sq, rlogarg, sr2, sr6;
ebond = sr6 = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -71,54 +70,54 @@ void BondFENE::compute(int eflag, int vflag)
// force from log term
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
r0sq = r0[type] * r0[type];
rlogarg = 1.0 - rsq/r0sq;
rlogarg = 1.0 - rsq / r0sq;
// if r -> r0, then rlogarg < 0.0 which is an error
// issue a warning and reset rlogarg = epsilon
// if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {} {} {}",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
error->warning(FLERR, "FENE bond too long: {} {} {} {}", update->ntimestep, atom->tag[i1],
atom->tag[i2], sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR, "Bad FENE bond");
rlogarg = 0.1;
}
fbond = -k[type]/rlogarg;
fbond = -k[type] / rlogarg;
// force from LJ term
if (rsq < MY_CUBEROOT2*sigma[type]*sigma[type]) {
sr2 = sigma[type]*sigma[type]/rsq;
sr6 = sr2*sr2*sr2;
fbond += 48.0*epsilon[type]*sr6*(sr6-0.5)/rsq;
if (rsq < MY_CUBEROOT2 * sigma[type] * sigma[type]) {
sr2 = sigma[type] * sigma[type] / rsq;
sr6 = sr2 * sr2 * sr2;
fbond += 48.0 * epsilon[type] * sr6 * (sr6 - 0.5) / rsq;
}
// energy
if (eflag) {
ebond = -0.5 * k[type]*r0sq*log(rlogarg);
if (rsq < MY_CUBEROOT2*sigma[type]*sigma[type])
ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
ebond = -0.5 * k[type] * r0sq * log(rlogarg);
if (rsq < MY_CUBEROOT2 * sigma[type] * sigma[type])
ebond += 4.0 * epsilon[type] * sr6 * (sr6 - 1.0) + epsilon[type];
}
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -127,14 +126,14 @@ void BondFENE::compute(int eflag, int vflag)
void BondFENE::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(k,n+1,"bond:k");
memory->create(r0,n+1,"bond:r0");
memory->create(epsilon,n+1,"bond:epsilon");
memory->create(sigma,n+1,"bond:sigma");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(k, np1, "bond:k");
memory->create(r0, np1, "bond:r0");
memory->create(epsilon, np1, "bond:epsilon");
memory->create(sigma, np1, "bond:sigma");
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -143,16 +142,16 @@ void BondFENE::allocate()
void BondFENE::coeff(int narg, char **arg)
{
if (narg != 5) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 5) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double r0_one = utils::numeric(FLERR,arg[2],false,lmp);
double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp);
double sigma_one = utils::numeric(FLERR,arg[4],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double r0_one = utils::numeric(FLERR, arg[2], false, lmp);
double epsilon_one = utils::numeric(FLERR, arg[3], false, lmp);
double sigma_one = utils::numeric(FLERR, arg[4], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -164,7 +163,7 @@ void BondFENE::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -175,10 +174,8 @@ void BondFENE::init_style()
{
// special bonds should be 0 1 1
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0) {
if (comm->me == 0)
error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene");
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0) {
if (comm->me == 0) error->warning(FLERR, "Use special bonds = 0,1,1 with bond style fene");
}
}
@ -186,7 +183,7 @@ void BondFENE::init_style()
double BondFENE::equilibrium_distance(int i)
{
return 0.97*sigma[i];
return 0.97 * sigma[i];
}
/* ----------------------------------------------------------------------
@ -195,10 +192,10 @@ double BondFENE::equilibrium_distance(int i)
void BondFENE::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&epsilon[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&sigma[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&k[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&epsilon[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&sigma[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -210,15 +207,15 @@ void BondFENE::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &epsilon[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &sigma[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&epsilon[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&epsilon[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&sigma[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -230,36 +227,34 @@ void BondFENE::read_restart(FILE *fp)
void BondFENE::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g %g\n",i,k[i],r0[i],epsilon[i],sigma[i]);
fprintf(fp, "%d %g %g %g %g\n", i, k[i], r0[i], epsilon[i], sigma[i]);
}
/* ---------------------------------------------------------------------- */
double BondFENE::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondFENE::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r0sq = r0[type] * r0[type];
double rlogarg = 1.0 - rsq/r0sq;
double rlogarg = 1.0 - rsq / r0sq;
// if r -> r0, then rlogarg < 0.0 which is an error
// issue a warning and reset rlogarg = epsilon
// if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {:.8}",
update->ntimestep,sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
error->warning(FLERR, "FENE bond too long: {} {:.8}", update->ntimestep, sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR, "Bad FENE bond");
rlogarg = 0.1;
}
double eng = -0.5 * k[type]*r0sq*log(rlogarg);
fforce = -k[type]/rlogarg;
if (rsq < MY_CUBEROOT2*sigma[type]*sigma[type]) {
double sr2,sr6;
sr2 = sigma[type]*sigma[type]/rsq;
sr6 = sr2*sr2*sr2;
eng += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
fforce += 48.0*epsilon[type]*sr6*(sr6-0.5)/rsq;
double eng = -0.5 * k[type] * r0sq * log(rlogarg);
fforce = -k[type] / rlogarg;
if (rsq < MY_CUBEROOT2 * sigma[type] * sigma[type]) {
double sr2, sr6;
sr2 = sigma[type] * sigma[type] / rsq;
sr6 = sr2 * sr2 * sr2;
eng += 4.0 * epsilon[type] * sr6 * (sr6 - 1.0) + epsilon[type];
fforce += 48.0 * epsilon[type] * sr6 * (sr6 - 0.5) / rsq;
}
return eng;
@ -270,7 +265,7 @@ double BondFENE::single(int type, double rsq, int /*i*/, int /*j*/,
void *BondFENE::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str,"kappa")==0) return (void*) k;
if (strcmp(str,"r0")==0) return (void*) r0;
if (strcmp(str, "kappa") == 0) return (void *) k;
if (strcmp(str, "r0") == 0) return (void *) r0;
return nullptr;
}

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class BondFENE : public Bond {
public:
BondFENE(class LAMMPS *lmp) : Bond(lmp) {}
BondFENE(class LAMMPS *_lmp) : Bond(_lmp) {}
~BondFENE() override;
void compute(int, int) override;
void coeff(int, char **) override;

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -46,13 +45,13 @@ BondFENEExpand::~BondFENEExpand()
void BondFENEExpand::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
double rsq,r0sq,rlogarg,sr2,sr6;
double r,rshift,rshiftsq;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
double rsq, r0sq, rlogarg, sr2, sr6;
double r, rshift, rshiftsq;
ebond = sr6 = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -72,57 +71,57 @@ void BondFENEExpand::compute(int eflag, int vflag)
// force from log term
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
r = sqrt(rsq);
rshift = r - shift[type];
rshiftsq = rshift*rshift;
rshiftsq = rshift * rshift;
r0sq = r0[type] * r0[type];
rlogarg = 1.0 - rshiftsq/r0sq;
rlogarg = 1.0 - rshiftsq / r0sq;
// if r -> r0, then rlogarg < 0.0 which is an error
// issue a warning and reset rlogarg = epsilon
// if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {} {} {:.8}",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
error->warning(FLERR, "FENE bond too long: {} {} {} {:.8}", update->ntimestep, atom->tag[i1],
atom->tag[i2], sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR, "Bad FENE bond");
rlogarg = 0.1;
}
fbond = -k[type]*rshift/rlogarg/r;
fbond = -k[type] * rshift / rlogarg / r;
// force from LJ term
if (rshiftsq < MY_CUBEROOT2*sigma[type]*sigma[type]) {
sr2 = sigma[type]*sigma[type]/rshiftsq;
sr6 = sr2*sr2*sr2;
fbond += 48.0*epsilon[type]*sr6*(sr6-0.5)/rshift/r;
if (rshiftsq < MY_CUBEROOT2 * sigma[type] * sigma[type]) {
sr2 = sigma[type] * sigma[type] / rshiftsq;
sr6 = sr2 * sr2 * sr2;
fbond += 48.0 * epsilon[type] * sr6 * (sr6 - 0.5) / rshift / r;
}
// energy
if (eflag) {
ebond = -0.5 * k[type]*r0sq*log(rlogarg);
if (rshiftsq < MY_CUBEROOT2*sigma[type]*sigma[type])
ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
ebond = -0.5 * k[type] * r0sq * log(rlogarg);
if (rshiftsq < MY_CUBEROOT2 * sigma[type] * sigma[type])
ebond += 4.0 * epsilon[type] * sr6 * (sr6 - 1.0) + epsilon[type];
}
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -131,15 +130,15 @@ void BondFENEExpand::compute(int eflag, int vflag)
void BondFENEExpand::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(k,n+1,"bond:k");
memory->create(r0,n+1,"bond:r0");
memory->create(epsilon,n+1,"bond:epsilon");
memory->create(sigma,n+1,"bond:sigma");
memory->create(shift,n+1,"bond:shift");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(k, np1, "bond:k");
memory->create(r0, np1, "bond:r0");
memory->create(epsilon, np1, "bond:epsilon");
memory->create(sigma, np1, "bond:sigma");
memory->create(shift, np1, "bond:shift");
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -148,17 +147,17 @@ void BondFENEExpand::allocate()
void BondFENEExpand::coeff(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 6) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double r0_one = utils::numeric(FLERR,arg[2],false,lmp);
double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp);
double sigma_one = utils::numeric(FLERR,arg[4],false,lmp);
double shift_one = utils::numeric(FLERR,arg[5],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double r0_one = utils::numeric(FLERR, arg[2], false, lmp);
double epsilon_one = utils::numeric(FLERR, arg[3], false, lmp);
double sigma_one = utils::numeric(FLERR, arg[4], false, lmp);
double shift_one = utils::numeric(FLERR, arg[5], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -171,7 +170,7 @@ void BondFENEExpand::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -182,10 +181,9 @@ void BondFENEExpand::init_style()
{
// special bonds should be 0 1 1
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0) {
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0) {
if (comm->me == 0)
error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene/expand");
error->warning(FLERR, "Use special bonds = 0,1,1 with bond style fene/expand");
}
}
@ -193,7 +191,7 @@ void BondFENEExpand::init_style()
double BondFENEExpand::equilibrium_distance(int i)
{
return 0.97*sigma[i] + shift[i];
return 0.97 * sigma[i] + shift[i];
}
/* ----------------------------------------------------------------------
@ -202,11 +200,11 @@ double BondFENEExpand::equilibrium_distance(int i)
void BondFENEExpand::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&epsilon[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&sigma[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&shift[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&k[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&epsilon[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&sigma[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&shift[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -218,17 +216,17 @@ void BondFENEExpand::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &epsilon[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &sigma[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &shift[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&epsilon[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&sigma[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&shift[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&epsilon[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&sigma[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&shift[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -240,39 +238,37 @@ void BondFENEExpand::read_restart(FILE *fp)
void BondFENEExpand::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g %g %g\n",i,k[i],r0[i],epsilon[i],sigma[i],shift[i]);
fprintf(fp, "%d %g %g %g %g %g\n", i, k[i], r0[i], epsilon[i], sigma[i], shift[i]);
}
/* ---------------------------------------------------------------------- */
double BondFENEExpand::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondFENEExpand::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r = sqrt(rsq);
double rshift = r - shift[type];
double rshiftsq = rshift*rshift;
double rshiftsq = rshift * rshift;
double r0sq = r0[type] * r0[type];
double rlogarg = 1.0 - rshiftsq/r0sq;
double rlogarg = 1.0 - rshiftsq / r0sq;
// if r -> r0, then rlogarg < 0.0 which is an error
// issue a warning and reset rlogarg = epsilon
// if r > 2*r0 something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {:.8}",
update->ntimestep,sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
error->warning(FLERR, "FENE bond too long: {} {:.8}", update->ntimestep, sqrt(rsq));
if (rlogarg <= -3.0) error->one(FLERR, "Bad FENE bond");
rlogarg = 0.1;
}
double eng = -0.5 * k[type]*r0sq*log(rlogarg);
fforce = -k[type]*rshift/rlogarg/r;
if (rshiftsq < MY_CUBEROOT2*sigma[type]*sigma[type]) {
double sr2,sr6;
sr2 = sigma[type]*sigma[type]/rshiftsq;
sr6 = sr2*sr2*sr2;
eng += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
fforce += 48.0*epsilon[type]*sr6*(sr6-0.5)/rshift/r;
double eng = -0.5 * k[type] * r0sq * log(rlogarg);
fforce = -k[type] * rshift / rlogarg / r;
if (rshiftsq < MY_CUBEROOT2 * sigma[type] * sigma[type]) {
double sr2, sr6;
sr2 = sigma[type] * sigma[type] / rshiftsq;
sr6 = sr2 * sr2 * sr2;
eng += 4.0 * epsilon[type] * sr6 * (sr6 - 1.0) + epsilon[type];
fforce += 48.0 * epsilon[type] * sr6 * (sr6 - 0.5) / rshift / r;
}
return eng;

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class BondFENEExpand : public Bond {
public:
BondFENEExpand(class LAMMPS *lmp) : Bond(lmp) {}
BondFENEExpand(class LAMMPS *_lmp) : Bond(_lmp) {}
~BondFENEExpand() override;
void compute(int, int) override;
void coeff(int, char **) override;

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,20 +17,20 @@
#include "bond_gromos.h"
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cstring>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
BondGromos::BondGromos(LAMMPS *lmp) : Bond(lmp)
BondGromos::BondGromos(LAMMPS *_lmp) : Bond(_lmp)
{
reinitflag = 1;
}
@ -51,11 +50,11 @@ BondGromos::~BondGromos()
void BondGromos::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
ebond = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -73,30 +72,30 @@ void BondGromos::compute(int eflag, int vflag)
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];
const double rsq = delx*delx + dely*dely + delz*delz;
const double dr = rsq - r0[type]*r0[type];
const double kdr = k[type]*dr;
const double rsq = delx * delx + dely * dely + delz * delz;
const double dr = rsq - r0[type] * r0[type];
const double kdr = k[type] * dr;
// force & energy
fbond = -4.0 * kdr;
if (eflag) ebond = kdr*dr;
if (eflag) ebond = kdr * dr;
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -105,13 +104,13 @@ void BondGromos::compute(int eflag, int vflag)
void BondGromos::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(k,n+1,"bond:k");
memory->create(r0,n+1,"bond:r0");
memory->create(k, np1, "bond:k");
memory->create(r0, np1, "bond:r0");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -120,14 +119,14 @@ void BondGromos::allocate()
void BondGromos::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 3) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double r0_one = utils::numeric(FLERR,arg[2],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double r0_one = utils::numeric(FLERR, arg[2], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -137,7 +136,7 @@ void BondGromos::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -155,8 +154,8 @@ double BondGromos::equilibrium_distance(int i)
void BondGromos::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&k[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -168,11 +167,11 @@ void BondGromos::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -183,18 +182,16 @@ void BondGromos::read_restart(FILE *fp)
void BondGromos::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],r0[i]);
for (int i = 1; i <= atom->nbondtypes; i++) fprintf(fp, "%d %g %g\n", i, k[i], r0[i]);
}
/* ---------------------------------------------------------------------- */
double BondGromos::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondGromos::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double dr = rsq - r0[type]*r0[type];
fforce = -4.0*k[type] * dr;
return k[type]*dr*dr;
double dr = rsq - r0[type] * r0[type];
fforce = -4.0 * k[type] * dr;
return k[type] * dr * dr;
}
/* ----------------------------------------------------------------------
@ -203,7 +200,7 @@ double BondGromos::single(int type, double rsq, int /*i*/, int /*j*/,
void *BondGromos::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str,"kappa")==0) return (void*) k;
if (strcmp(str,"r0")==0) return (void*) r0;
if (strcmp(str, "kappa") == 0) return (void *) k;
if (strcmp(str, "r0") == 0) return (void *) r0;
return nullptr;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -14,21 +13,21 @@
#include "bond_harmonic.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
BondHarmonic::BondHarmonic(LAMMPS *lmp) : Bond(lmp)
BondHarmonic::BondHarmonic(LAMMPS *_lmp) : Bond(_lmp)
{
reinitflag = 1;
}
@ -48,12 +47,12 @@ BondHarmonic::~BondHarmonic()
void BondHarmonic::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
double rsq,r,dr,rk;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
double rsq, r, dr, rk;
ebond = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -71,33 +70,35 @@ void BondHarmonic::compute(int eflag, int vflag)
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
r = sqrt(rsq);
dr = r - r0[type];
rk = k[type] * dr;
// force & energy
if (r > 0.0) fbond = -2.0*rk/r;
else fbond = 0.0;
if (r > 0.0)
fbond = -2.0 * rk / r;
else
fbond = 0.0;
if (eflag) ebond = rk*dr;
if (eflag) ebond = rk * dr;
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -106,13 +107,13 @@ void BondHarmonic::compute(int eflag, int vflag)
void BondHarmonic::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(k,n+1,"bond:k");
memory->create(r0,n+1,"bond:r0");
memory->create(k, np1, "bond:k");
memory->create(r0, np1, "bond:r0");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -121,14 +122,14 @@ void BondHarmonic::allocate()
void BondHarmonic::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 3) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double r0_one = utils::numeric(FLERR,arg[2],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double r0_one = utils::numeric(FLERR, arg[2], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -138,7 +139,7 @@ void BondHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -156,8 +157,8 @@ double BondHarmonic::equilibrium_distance(int i)
void BondHarmonic::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&k[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -169,11 +170,11 @@ void BondHarmonic::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -184,21 +185,19 @@ void BondHarmonic::read_restart(FILE *fp)
void BondHarmonic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g\n",i,k[i],r0[i]);
for (int i = 1; i <= atom->nbondtypes; i++) fprintf(fp, "%d %g %g\n", i, k[i], r0[i]);
}
/* ---------------------------------------------------------------------- */
double BondHarmonic::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondHarmonic::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r = sqrt(rsq);
double dr = r - r0[type];
double rk = k[type] * dr;
fforce = 0;
if (r > 0.0) fforce = -2.0*rk/r;
return rk*dr;
if (r > 0.0) fforce = -2.0 * rk / r;
return rk * dr;
}
/* ----------------------------------------------------------------------
@ -207,9 +206,7 @@ double BondHarmonic::single(int type, double rsq, int /*i*/, int /*j*/,
void *BondHarmonic::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str,"kappa")==0) return (void*) k;
if (strcmp(str,"r0")==0) return (void*) r0;
if (strcmp(str, "kappa") == 0) return (void *) k;
if (strcmp(str, "r0") == 0) return (void *) r0;
return nullptr;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,21 +17,20 @@
#include "bond_morse.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
BondMorse::BondMorse(LAMMPS *lmp) : Bond(lmp) {}
BondMorse::BondMorse(LAMMPS *_lmp) : Bond(_lmp) {}
/* ---------------------------------------------------------------------- */
@ -50,12 +48,12 @@ BondMorse::~BondMorse()
void BondMorse::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
double rsq,r,dr,ralpha;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
double rsq, r, dr, ralpha;
ebond = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -73,33 +71,35 @@ void BondMorse::compute(int eflag, int vflag)
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
r = sqrt(rsq);
dr = r - r0[type];
ralpha = exp(-alpha[type]*dr);
ralpha = exp(-alpha[type] * dr);
// force & energy
if (r > 0.0) fbond = -2.0*d0[type]*alpha[type]*(1-ralpha)*ralpha/r;
else fbond = 0.0;
if (r > 0.0)
fbond = -2.0 * d0[type] * alpha[type] * (1 - ralpha) * ralpha / r;
else
fbond = 0.0;
if (eflag) ebond = d0[type]*(1-ralpha)*(1-ralpha);
if (eflag) ebond = d0[type] * (1 - ralpha) * (1 - ralpha);
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -108,13 +108,13 @@ void BondMorse::compute(int eflag, int vflag)
void BondMorse::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(d0,n+1,"bond:d0");
memory->create(alpha,n+1,"bond:alpha");
memory->create(r0,n+1,"bond:r0");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(d0, np1, "bond:d0");
memory->create(alpha, np1, "bond:alpha");
memory->create(r0, np1, "bond:r0");
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -123,15 +123,15 @@ void BondMorse::allocate()
void BondMorse::coeff(int narg, char **arg)
{
if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 4) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double d0_one = utils::numeric(FLERR,arg[1],false,lmp);
double alpha_one = utils::numeric(FLERR,arg[2],false,lmp);
double r0_one = utils::numeric(FLERR,arg[3],false,lmp);
double d0_one = utils::numeric(FLERR, arg[1], false, lmp);
double alpha_one = utils::numeric(FLERR, arg[2], false, lmp);
double r0_one = utils::numeric(FLERR, arg[3], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -142,7 +142,7 @@ void BondMorse::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -160,9 +160,9 @@ double BondMorse::equilibrium_distance(int i)
void BondMorse::write_restart(FILE *fp)
{
fwrite(&d0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&alpha[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&d0[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&alpha[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -174,13 +174,13 @@ void BondMorse::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &d0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &alpha[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&d0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&alpha[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&d0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&alpha[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -192,20 +192,19 @@ void BondMorse::read_restart(FILE *fp)
void BondMorse::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g\n",i,d0[i],alpha[i],r0[i]);
fprintf(fp, "%d %g %g %g\n", i, d0[i], alpha[i], r0[i]);
}
/* ---------------------------------------------------------------------- */
double BondMorse::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondMorse::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r = sqrt(rsq);
double dr = r - r0[type];
double ralpha = exp(-alpha[type]*dr);
double ralpha = exp(-alpha[type] * dr);
fforce = 0;
if (r > 0.0) fforce = -2.0*d0[type]*alpha[type]*(1-ralpha)*ralpha/r;
return d0[type]*(1-ralpha)*(1-ralpha);
if (r > 0.0) fforce = -2.0 * d0[type] * alpha[type] * (1 - ralpha) * ralpha / r;
return d0[type] * (1 - ralpha) * (1 - ralpha);
}
/* ---------------------------------------------------------------------- */
@ -213,6 +212,6 @@ double BondMorse::single(int type, double rsq, int /*i*/, int /*j*/,
void *BondMorse::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str,"r0")==0) return (void*) r0;
if (strcmp(str, "r0") == 0) return (void *) r0;
return nullptr;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,21 +21,22 @@
#include "comm.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "memory.h"
#include "neighbor.h"
#include "pair.h"
#include <cmath>
#include "math_const.h"
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::MY_CUBEROOT2;
/* ---------------------------------------------------------------------- */
BondQuartic::BondQuartic(LAMMPS *lmp) : Bond(lmp), k(nullptr),
b1(nullptr), b2(nullptr), rc(nullptr), u0(nullptr) {}
BondQuartic::BondQuartic(LAMMPS *_lmp) :
Bond(_lmp), k(nullptr), b1(nullptr), b2(nullptr), rc(nullptr), u0(nullptr)
{
}
/* ---------------------------------------------------------------------- */
@ -56,17 +56,16 @@ BondQuartic::~BondQuartic()
void BondQuartic::compute(int eflag, int vflag)
{
int i1,i2,n,m,type,itype,jtype;
double delx,dely,delz,ebond,fbond,evdwl,fpair;
double r,rsq,dr,r2,ra,rb,sr2,sr6;
int i1, i2, n, m, type, itype, jtype;
double delx, dely, delz, ebond, fbond, evdwl, fpair;
double r, rsq, dr, r2, ra, rb, sr2, sr6;
ebond = evdwl = sr6 = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
// insure pair->ev_tally() will use 1-4 virial contribution
if (vflag_global == VIRIAL_FDOTR)
force->pair->vflag_either = force->pair->vflag_global = 1;
if (vflag_global == VIRIAL_FDOTR) force->pair->vflag_either = force->pair->vflag_global = 1;
double **cutsq = force->pair->cutsq;
double **x = atom->x;
@ -90,7 +89,7 @@ void BondQuartic::compute(int eflag, int vflag)
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
// if bond breaks, set type to 0
// both in temporary bondlist and permanent bond_type
@ -98,15 +97,13 @@ void BondQuartic::compute(int eflag, int vflag)
// negate bond_type twice if other atom stores it
// if other proc owns 2nd atom, other proc will also break bond
if (rsq > rc[type]*rc[type]) {
if (rsq > rc[type] * rc[type]) {
bondlist[n][2] = 0;
for (m = 0; m < atom->num_bond[i1]; m++)
if (atom->bond_atom[i1][m] == atom->tag[i2])
atom->bond_type[i1][m] = 0;
if (atom->bond_atom[i1][m] == atom->tag[i2]) atom->bond_type[i1][m] = 0;
if (i2 < atom->nlocal)
for (m = 0; m < atom->num_bond[i2]; m++)
if (atom->bond_atom[i2][m] == atom->tag[i1])
atom->bond_type[i2][m] = 0;
if (atom->bond_atom[i2][m] == atom->tag[i1]) atom->bond_type[i2][m] = 0;
continue;
}
@ -116,37 +113,37 @@ void BondQuartic::compute(int eflag, int vflag)
r = sqrt(rsq);
dr = r - rc[type];
r2 = dr*dr;
r2 = dr * dr;
ra = dr - b1[type];
rb = dr - b2[type];
fbond = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb);
fbond = -k[type] / r * (r2 * (ra + rb) + 2.0 * dr * ra * rb);
if (rsq < MY_CUBEROOT2) {
sr2 = 1.0/rsq;
sr6 = sr2*sr2*sr2;
fbond += 48.0*sr6*(sr6-0.5)/rsq;
sr2 = 1.0 / rsq;
sr6 = sr2 * sr2 * sr2;
fbond += 48.0 * sr6 * (sr6 - 0.5) / rsq;
}
if (eflag) {
ebond = k[type]*r2*ra*rb + u0[type];
if (rsq < MY_CUBEROOT2) ebond += 4.0*sr6*(sr6-1.0) + 1.0;
ebond = k[type] * r2 * ra * rb + u0[type];
if (rsq < MY_CUBEROOT2) ebond += 4.0 * sr6 * (sr6 - 1.0) + 1.0;
}
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
// subtract out pairwise contribution from 2 atoms via pair->single()
// required since special_bond = 1,1,1
@ -156,22 +153,22 @@ void BondQuartic::compute(int eflag, int vflag)
jtype = atom->type[i2];
if (rsq < cutsq[itype][jtype]) {
evdwl = -force->pair->single(i1,i2,itype,jtype,rsq,1.0,1.0,fpair);
evdwl = -force->pair->single(i1, i2, itype, jtype, rsq, 1.0, 1.0, fpair);
fpair = -fpair;
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fpair;
f[i1][1] += dely*fpair;
f[i1][2] += delz*fpair;
f[i1][0] += delx * fpair;
f[i1][1] += dely * fpair;
f[i1][2] += delz * fpair;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fpair;
f[i2][1] -= dely*fpair;
f[i2][2] -= delz*fpair;
f[i2][0] -= delx * fpair;
f[i2][1] -= dely * fpair;
f[i2][2] -= delz * fpair;
}
if (evflag) force->pair->ev_tally(i1,i2,nlocal,newton_bond,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag)
force->pair->ev_tally(i1, i2, nlocal, newton_bond, evdwl, 0.0, fpair, delx, dely, delz);
}
}
}
@ -181,16 +178,16 @@ void BondQuartic::compute(int eflag, int vflag)
void BondQuartic::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(k,n+1,"bond:k");
memory->create(b1,n+1,"bond:b1");
memory->create(b2,n+1,"bond:b2");
memory->create(rc,n+1,"bond:rc");
memory->create(u0,n+1,"bond:u0");
memory->create(k, np1, "bond:k");
memory->create(b1, np1, "bond:b1");
memory->create(b2, np1, "bond:b2");
memory->create(rc, np1, "bond:rc");
memory->create(u0, np1, "bond:u0");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -199,17 +196,17 @@ void BondQuartic::allocate()
void BondQuartic::coeff(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
if (narg != 6) error->all(FLERR, "Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
double b1_one = utils::numeric(FLERR,arg[2],false,lmp);
double b2_one = utils::numeric(FLERR,arg[3],false,lmp);
double rc_one = utils::numeric(FLERR,arg[4],false,lmp);
double u0_one = utils::numeric(FLERR,arg[5],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
double b1_one = utils::numeric(FLERR, arg[2], false, lmp);
double b2_one = utils::numeric(FLERR, arg[3], false, lmp);
double rc_one = utils::numeric(FLERR, arg[4], false, lmp);
double u0_one = utils::numeric(FLERR, arg[5], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -222,7 +219,7 @@ void BondQuartic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -232,19 +229,16 @@ void BondQuartic::coeff(int narg, char **arg)
void BondQuartic::init_style()
{
if (force->pair == nullptr || force->pair->single_enable == 0)
error->all(FLERR,"Pair style does not support bond_style quartic");
error->all(FLERR, "Pair style does not support bond_style quartic");
if (force->angle || force->dihedral || force->improper)
error->all(FLERR,
"Bond style quartic cannot be used with 3,4-body interactions");
error->all(FLERR, "Bond style quartic cannot be used with 3,4-body interactions");
if (atom->molecular == Atom::TEMPLATE)
error->all(FLERR,
"Bond style quartic cannot be used with atom style template");
error->all(FLERR, "Bond style quartic cannot be used with atom style template");
// special bonds must be 1 1 1
if (force->special_lj[1] != 1.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)
error->all(FLERR,"Bond style quartic requires special_bonds = 1,1,1");
if (force->special_lj[1] != 1.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0)
error->all(FLERR, "Bond style quartic requires special_bonds = 1,1,1");
}
/* ----------------------------------------------------------------------
@ -262,11 +256,11 @@ double BondQuartic::equilibrium_distance(int /*i*/)
void BondQuartic::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&b1[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&b2[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&rc[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&u0[1],sizeof(double),atom->nbondtypes,fp);
fwrite(&k[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&b1[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&b2[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&rc[1], sizeof(double), atom->nbondtypes, fp);
fwrite(&u0[1], sizeof(double), atom->nbondtypes, fp);
}
/* ----------------------------------------------------------------------
@ -278,17 +272,17 @@ void BondQuartic::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &b1[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &b2[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &rc[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
utils::sfread(FLERR, &u0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&b1[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&b2[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&rc[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&u0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&b1[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&b2[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&rc[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&u0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
}
@ -300,15 +294,14 @@ void BondQuartic::read_restart(FILE *fp)
void BondQuartic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g %g %g\n",i,k[i],b1[i],b2[i],rc[i],u0[i]);
fprintf(fp, "%d %g %g %g %g %g\n", i, k[i], b1[i], b2[i], rc[i], u0[i]);
}
/* ---------------------------------------------------------------------- */
double BondQuartic::single(int type, double rsq, int i, int j,
double &fforce)
double BondQuartic::single(int type, double rsq, int i, int j, double &fforce)
{
double r,dr,r2,ra,rb,sr2,sr6;
double r, dr, r2, ra, rb, sr2, sr6;
if (type <= 0) return 0.0;
double eng = 0.0;
@ -321,7 +314,7 @@ double BondQuartic::single(int type, double rsq, int i, int j,
if (rsq < force->pair->cutsq[itype][jtype]) {
double tmp;
eng = -force->pair->single(i,j,itype,jtype,rsq,1.0,1.0,tmp);
eng = -force->pair->single(i, j, itype, jtype, rsq, 1.0, 1.0, tmp);
}
// quartic bond
@ -330,18 +323,18 @@ double BondQuartic::single(int type, double rsq, int i, int j,
r = sqrt(rsq);
dr = r - rc[type];
r2 = dr*dr;
r2 = dr * dr;
ra = dr - b1[type];
rb = dr - b2[type];
eng += k[type]*r2*ra*rb + u0[type];
fforce = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb);
eng += k[type] * r2 * ra * rb + u0[type];
fforce = -k[type] / r * (r2 * (ra + rb) + 2.0 * dr * ra * rb);
if (rsq < MY_CUBEROOT2) {
sr2 = 1.0/rsq;
sr6 = sr2*sr2*sr2;
eng += 4.0*sr6*(sr6-1.0) + 1.0;
fforce += 48.0*sr6*(sr6-0.5)/rsq;
sr2 = 1.0 / rsq;
sr6 = sr2 * sr2 * sr2;
eng += 4.0 * sr6 * (sr6 - 1.0) + 1.0;
fforce += 48.0 * sr6 * (sr6 - 0.5) / rsq;
}
return eng;

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -32,13 +31,13 @@
using namespace LAMMPS_NS;
enum{NONE,LINEAR,SPLINE};
enum { NONE, LINEAR, SPLINE };
#define BIGNUM 1.0e300
/* ---------------------------------------------------------------------- */
BondTable::BondTable(LAMMPS *lmp) : Bond(lmp)
BondTable::BondTable(LAMMPS *_lmp) : Bond(_lmp)
{
writedata = 0;
ntables = 0;
@ -63,13 +62,13 @@ BondTable::~BondTable()
void BondTable::compute(int eflag, int vflag)
{
int i1,i2,n,type;
double delx,dely,delz,ebond,fbond;
double rsq,r;
double u,mdu;
int i1, i2, n, type;
double delx, dely, delz, ebond, fbond;
double rsq, r;
double u, mdu;
ebond = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -87,30 +86,30 @@ void BondTable::compute(int eflag, int vflag)
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
r = sqrt(rsq);
// force & energy
uf_lookup(type,r,u,mdu);
fbond = mdu/r;
uf_lookup(type, r, u, mdu);
fbond = mdu / r;
ebond = u;
// apply force to each of 2 atoms
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fbond;
f[i1][1] += dely*fbond;
f[i1][2] += delz*fbond;
f[i1][0] += delx * fbond;
f[i1][1] += dely * fbond;
f[i1][2] += delz * fbond;
}
if (newton_bond || i2 < nlocal) {
f[i2][0] -= delx*fbond;
f[i2][1] -= dely*fbond;
f[i2][2] -= delz*fbond;
f[i2][0] -= delx * fbond;
f[i2][1] -= dely * fbond;
f[i2][2] -= delz * fbond;
}
if (evflag) ev_tally(i1,i2,nlocal,newton_bond,ebond,fbond,delx,dely,delz);
if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz);
}
}
@ -119,30 +118,32 @@ void BondTable::compute(int eflag, int vflag)
void BondTable::allocate()
{
allocated = 1;
int n = atom->nbondtypes;
const int np1 = atom->nbondtypes + 1;
memory->create(tabindex,n+1,"bond:tabindex");
memory->create(r0,n+1,"bond:r0");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(tabindex, np1, "bond:tabindex");
memory->create(r0, np1, "bond:r0");
memory->create(setflag, np1, "bond:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void BondTable::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal bond_style command");
if (narg != 2) error->all(FLERR, "Illegal bond_style command");
tabstyle = NONE;
if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
else error->all(FLERR,"Unknown table style in bond style table");
if (strcmp(arg[0], "linear") == 0)
tabstyle = LINEAR;
else if (strcmp(arg[0], "spline") == 0)
tabstyle = SPLINE;
else
error->all(FLERR, "Unknown table style in bond style table");
tablength = utils::inumeric(FLERR,arg[1],false,lmp);
if (tablength < 2) error->all(FLERR,"Illegal number of bond table entries");
tablength = utils::inumeric(FLERR, arg[1], false, lmp);
if (tablength < 2) error->all(FLERR, "Illegal number of bond table entries");
// delete old tables, since cannot just change settings
@ -150,8 +151,8 @@ void BondTable::settings(int narg, char **arg)
memory->sfree(tables);
if (allocated) {
memory->destroy(setflag);
memory->destroy(tabindex);
memory->destroy(setflag);
memory->destroy(tabindex);
}
allocated = 0;
@ -165,28 +166,27 @@ void BondTable::settings(int narg, char **arg)
void BondTable::coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Illegal bond_coeff command");
if (narg != 3) error->all(FLERR, "Illegal bond_coeff command");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
int me;
MPI_Comm_rank(world,&me);
tables = (Table *)
memory->srealloc(tables,(ntables+1)*sizeof(Table),"bond:tables");
MPI_Comm_rank(world, &me);
tables = (Table *) memory->srealloc(tables, (ntables + 1) * sizeof(Table), "bond:tables");
Table *tb = &tables[ntables];
null_table(tb);
if (me == 0) read_table(tb,arg[1],arg[2]);
if (me == 0) read_table(tb, arg[1], arg[2]);
bcast_table(tb);
// error check on table parameters
if (tb->ninput <= 1) error->one(FLERR,"Invalid bond table length");
if (tb->ninput <= 1) error->one(FLERR, "Invalid bond table length");
tb->lo = tb->rfile[0];
tb->hi = tb->rfile[tb->ninput-1];
if (tb->lo >= tb->hi) error->all(FLERR,"Bond table values are not increasing");
tb->hi = tb->rfile[tb->ninput - 1];
if (tb->lo >= tb->hi) error->all(FLERR, "Bond table values are not increasing");
// spline read-in and compute r,e,f vectors within table
@ -204,7 +204,7 @@ void BondTable::coeff(int narg, char **arg)
}
ntables++;
if (count == 0) error->all(FLERR,"Illegal bond_coeff command");
if (count == 0) error->all(FLERR, "Illegal bond_coeff command");
}
/* ----------------------------------------------------------------------
@ -242,8 +242,8 @@ void BondTable::read_restart(FILE *fp)
void BondTable::write_restart_settings(FILE *fp)
{
fwrite(&tabstyle,sizeof(int),1,fp);
fwrite(&tablength,sizeof(int),1,fp);
fwrite(&tabstyle, sizeof(int), 1, fp);
fwrite(&tablength, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -253,23 +253,22 @@ void BondTable::write_restart_settings(FILE *fp)
void BondTable::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &tabstyle, sizeof(int), 1, fp, nullptr, error);
utils::sfread(FLERR, &tablength, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&tabstyle,1,MPI_INT,0,world);
MPI_Bcast(&tablength,1,MPI_INT,0,world);
MPI_Bcast(&tabstyle, 1, MPI_INT, 0, world);
MPI_Bcast(&tablength, 1, MPI_INT, 0, world);
}
/* ---------------------------------------------------------------------- */
double BondTable::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondTable::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r = sqrt(rsq);
double u;
double mdu;
uf_lookup(type,r,u,mdu);
fforce = mdu/r;
uf_lookup(type, r, u, mdu);
fforce = mdu / r;
return u;
}
@ -311,20 +310,18 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
TableFileReader reader(lmp, file, "bond");
double emin = BIGNUM;
char * line = reader.find_section_start(keyword);
char *line = reader.find_section_start(keyword);
if (!line) {
error->one(FLERR,"Did not find keyword in table file");
}
if (!line) { error->one(FLERR, "Did not find keyword in table file"); }
// read args on 2nd line of section
// allocate table arrays for file values
line = reader.next_line();
param_extract(tb,line);
memory->create(tb->rfile,tb->ninput,"bond:rfile");
memory->create(tb->efile,tb->ninput,"bond:efile");
memory->create(tb->ffile,tb->ninput,"bond:ffile");
param_extract(tb, line);
memory->create(tb->rfile, tb->ninput, "bond:rfile");
memory->create(tb->efile, tb->ninput, "bond:efile");
memory->create(tb->ffile, tb->ninput, "bond:ffile");
// read r,e,f table values from file
@ -359,33 +356,37 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
// skip two end points since do not have surrounding secants
// inflection point is where curvature changes sign
double r,e,f,rprev,rnext,eprev,enext,fleft,fright;
double r, e, f, rprev, rnext, eprev, enext, fleft, fright;
int ferror = 0;
for (int i = 1; i < tb->ninput-1; i++) {
for (int i = 1; i < tb->ninput - 1; i++) {
r = tb->rfile[i];
rprev = tb->rfile[i-1];
rnext = tb->rfile[i+1];
rprev = tb->rfile[i - 1];
rnext = tb->rfile[i + 1];
e = tb->efile[i];
eprev = tb->efile[i-1];
enext = tb->efile[i+1];
eprev = tb->efile[i - 1];
enext = tb->efile[i + 1];
f = tb->ffile[i];
fleft = - (e-eprev) / (r-rprev);
fright = - (enext-e) / (rnext-r);
fleft = -(e - eprev) / (r - rprev);
fright = -(enext - e) / (rnext - r);
if (f < fleft && f < fright) ferror++;
if (f > fleft && f > fright) ferror++;
}
if (ferror) {
error->warning(FLERR, "{} of {} force values in table are inconsistent with -dE/dr.\n"
"WARNING: Should only be flagged at inflection points",ferror,tb->ninput);
error->warning(FLERR,
"{} of {} force values in table are inconsistent with -dE/dr.\n"
"WARNING: Should only be flagged at inflection points",
ferror, tb->ninput);
}
// warn if data was read incompletely, e.g. columns were missing
if (cerror) {
error->warning(FLERR, "{} of {} lines in table were incomplete or could not be"
" parsed completely",cerror,tb->ninput);
error->warning(FLERR,
"{} of {} lines in table were incomplete or could not be"
" parsed completely",
cerror, tb->ninput);
}
}
@ -396,23 +397,22 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
void BondTable::spline_table(Table *tb)
{
memory->create(tb->e2file,tb->ninput,"bond:e2file");
memory->create(tb->f2file,tb->ninput,"bond:f2file");
memory->create(tb->e2file, tb->ninput, "bond:e2file");
memory->create(tb->f2file, tb->ninput, "bond:f2file");
double ep0 = - tb->ffile[0];
double epn = - tb->ffile[tb->ninput-1];
spline(tb->rfile,tb->efile,tb->ninput,ep0,epn,tb->e2file);
double ep0 = -tb->ffile[0];
double epn = -tb->ffile[tb->ninput - 1];
spline(tb->rfile, tb->efile, tb->ninput, ep0, epn, tb->e2file);
if (tb->fpflag == 0) {
tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->rfile[1] - tb->rfile[0]);
tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
(tb->rfile[tb->ninput-1] - tb->rfile[tb->ninput-2]);
tb->fphi = (tb->ffile[tb->ninput - 1] - tb->ffile[tb->ninput - 2]) /
(tb->rfile[tb->ninput - 1] - tb->rfile[tb->ninput - 2]);
}
double fp0 = tb->fplo;
double fpn = tb->fphi;
spline(tb->rfile,tb->ffile,tb->ninput,fp0,fpn,tb->f2file);
spline(tb->rfile, tb->ffile, tb->ninput, fp0, fpn, tb->f2file);
}
/* ----------------------------------------------------------------------
@ -422,45 +422,45 @@ void BondTable::spline_table(Table *tb)
void BondTable::compute_table(Table *tb)
{
// delta = table spacing for N-1 bins
int tlm1 = tablength-1;
int tlm1 = tablength - 1;
tb->delta = (tb->hi - tb->lo)/ tlm1;
tb->invdelta = 1.0/tb->delta;
tb->deltasq6 = tb->delta*tb->delta / 6.0;
tb->delta = (tb->hi - tb->lo) / tlm1;
tb->invdelta = 1.0 / tb->delta;
tb->deltasq6 = tb->delta * tb->delta / 6.0;
// N-1 evenly spaced bins in r from min to max
// r,e,f = value at lower edge of bin
// de,df values = delta values of e,f
// r,e,f are N in length so de,df arrays can compute difference
memory->create(tb->r,tablength,"bond:r");
memory->create(tb->e,tablength,"bond:e");
memory->create(tb->de,tablength,"bond:de");
memory->create(tb->f,tablength,"bond:f");
memory->create(tb->df,tablength,"bond:df");
memory->create(tb->e2,tablength,"bond:e2");
memory->create(tb->f2,tablength,"bond:f2");
memory->create(tb->r, tablength, "bond:r");
memory->create(tb->e, tablength, "bond:e");
memory->create(tb->de, tablength, "bond:de");
memory->create(tb->f, tablength, "bond:f");
memory->create(tb->df, tablength, "bond:df");
memory->create(tb->e2, tablength, "bond:e2");
memory->create(tb->f2, tablength, "bond:f2");
double a;
for (int i = 0; i < tablength; i++) {
a = tb->lo + i*tb->delta;
a = tb->lo + i * tb->delta;
tb->r[i] = a;
tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,a);
tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,a);
tb->e[i] = splint(tb->rfile, tb->efile, tb->e2file, tb->ninput, a);
tb->f[i] = splint(tb->rfile, tb->ffile, tb->f2file, tb->ninput, a);
}
for (int i = 0; i < tlm1; i++) {
tb->de[i] = tb->e[i+1] - tb->e[i];
tb->df[i] = tb->f[i+1] - tb->f[i];
tb->de[i] = tb->e[i + 1] - tb->e[i];
tb->df[i] = tb->f[i + 1] - tb->f[i];
}
// get final elements from linear extrapolation
tb->de[tlm1] = 2.0*tb->de[tlm1-1] - tb->de[tlm1-2];
tb->df[tlm1] = 2.0*tb->df[tlm1-1] - tb->df[tlm1-2];
tb->de[tlm1] = 2.0 * tb->de[tlm1 - 1] - tb->de[tlm1 - 2];
tb->df[tlm1] = 2.0 * tb->df[tlm1 - 1] - tb->df[tlm1 - 2];
double ep0 = - tb->f[0];
double epn = - tb->f[tlm1];
spline(tb->r,tb->e,tablength,ep0,epn,tb->e2);
spline(tb->r,tb->f,tablength,tb->fplo,tb->fphi,tb->f2);
double ep0 = -tb->f[0];
double epn = -tb->f[tlm1];
spline(tb->r, tb->e, tablength, ep0, epn, tb->e2);
spline(tb->r, tb->f, tablength, tb->fplo, tb->fphi, tb->f2);
}
/* ----------------------------------------------------------------------
@ -490,14 +490,14 @@ void BondTable::param_extract(Table *tb, char *line)
} else if (word == "EQ") {
tb->r0 = values.next_double();
} else {
error->one(FLERR,"Invalid keyword in bond table parameters");
error->one(FLERR, "Invalid keyword in bond table parameters");
}
}
} catch(TokenizerException &e) {
} catch (TokenizerException &e) {
error->one(FLERR, e.what());
}
if (tb->ninput == 0) error->one(FLERR,"Bond table parameters did not set N");
if (tb->ninput == 0) error->one(FLERR, "Bond table parameters did not set N");
}
/* ----------------------------------------------------------------------
@ -508,25 +508,25 @@ void BondTable::param_extract(Table *tb, char *line)
void BondTable::bcast_table(Table *tb)
{
MPI_Bcast(&tb->ninput,1,MPI_INT,0,world);
MPI_Bcast(&tb->r0,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->ninput, 1, MPI_INT, 0, world);
MPI_Bcast(&tb->r0, 1, MPI_DOUBLE, 0, world);
int me;
MPI_Comm_rank(world,&me);
MPI_Comm_rank(world, &me);
if (me > 0) {
memory->create(tb->rfile,tb->ninput,"angle:rfile");
memory->create(tb->efile,tb->ninput,"angle:efile");
memory->create(tb->ffile,tb->ninput,"angle:ffile");
memory->create(tb->rfile, tb->ninput, "angle:rfile");
memory->create(tb->efile, tb->ninput, "angle:efile");
memory->create(tb->ffile, tb->ninput, "angle:ffile");
}
MPI_Bcast(tb->rfile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->efile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->ffile,tb->ninput,MPI_DOUBLE,0,world);
MPI_Bcast(tb->rfile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(tb->efile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(tb->ffile, tb->ninput, MPI_DOUBLE, 0, world);
MPI_Bcast(&tb->fpflag,1,MPI_INT,0,world);
MPI_Bcast(&tb->fpflag, 1, MPI_INT, 0, world);
if (tb->fpflag) {
MPI_Bcast(&tb->fplo,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->fphi,1,MPI_DOUBLE,0,world);
MPI_Bcast(&tb->fplo, 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&tb->fphi, 1, MPI_DOUBLE, 0, world);
}
}
@ -534,54 +534,58 @@ void BondTable::bcast_table(Table *tb)
spline and splint routines modified from Numerical Recipes
------------------------------------------------------------------------- */
void BondTable::spline(double *x, double *y, int n,
double yp1, double ypn, double *y2)
void BondTable::spline(double *x, double *y, int n, double yp1, double ypn, double *y2)
{
int i,k;
double p,qn,sig,un;
int i, k;
double p, qn, sig, un;
double *u = new double[n];
if (yp1 > 0.99e300) y2[0] = u[0] = 0.0;
if (yp1 > 0.99e300)
y2[0] = u[0] = 0.0;
else {
y2[0] = -0.5;
u[0] = (3.0/(x[1]-x[0])) * ((y[1]-y[0]) / (x[1]-x[0]) - yp1);
u[0] = (3.0 / (x[1] - x[0])) * ((y[1] - y[0]) / (x[1] - x[0]) - yp1);
}
for (i = 1; i < n-1; i++) {
sig = (x[i]-x[i-1]) / (x[i+1]-x[i-1]);
p = sig*y2[i-1] + 2.0;
y2[i] = (sig-1.0) / p;
u[i] = (y[i+1]-y[i]) / (x[i+1]-x[i]) - (y[i]-y[i-1]) / (x[i]-x[i-1]);
u[i] = (6.0*u[i] / (x[i+1]-x[i-1]) - sig*u[i-1]) / p;
for (i = 1; i < n - 1; i++) {
sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
p = sig * y2[i - 1] + 2.0;
y2[i] = (sig - 1.0) / p;
u[i] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
}
if (ypn > 0.99e300) qn = un = 0.0;
if (ypn > 0.99e300)
qn = un = 0.0;
else {
qn = 0.5;
un = (3.0/(x[n-1]-x[n-2])) * (ypn - (y[n-1]-y[n-2]) / (x[n-1]-x[n-2]));
un = (3.0 / (x[n - 1] - x[n - 2])) * (ypn - (y[n - 1] - y[n - 2]) / (x[n - 1] - x[n - 2]));
}
y2[n-1] = (un-qn*u[n-2]) / (qn*y2[n-2] + 1.0);
for (k = n-2; k >= 0; k--) y2[k] = y2[k]*y2[k+1] + u[k];
y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
for (k = n - 2; k >= 0; k--) y2[k] = y2[k] * y2[k + 1] + u[k];
delete [] u;
delete[] u;
}
/* ---------------------------------------------------------------------- */
double BondTable::splint(double *xa, double *ya, double *y2a, int n, double x)
{
int klo,khi,k;
double h,b,a,y;
int klo, khi, k;
double h, b, a, y;
klo = 0;
khi = n-1;
while (khi-klo > 1) {
k = (khi+klo) >> 1;
if (xa[k] > x) khi = k;
else klo = k;
khi = n - 1;
while (khi - klo > 1) {
k = (khi + klo) >> 1;
if (xa[k] > x)
khi = k;
else
klo = k;
}
h = xa[khi]-xa[klo];
a = (xa[khi]-x) / h;
b = (x-xa[klo]) / h;
y = a*ya[klo] + b*ya[khi] + ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
h = xa[khi] - xa[klo];
a = (xa[khi] - x) / h;
b = (x - xa[klo]) / h;
y = a * ya[klo] + b * ya[khi] +
((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0;
return y;
}
@ -592,30 +596,28 @@ double BondTable::splint(double *xa, double *ya, double *y2a, int n, double x)
void BondTable::uf_lookup(int type, double x, double &u, double &f)
{
if (!std::isfinite(x)) {
error->one(FLERR,"Illegal bond in bond style table");
}
if (!std::isfinite(x)) { error->one(FLERR, "Illegal bond in bond style table"); }
double fraction,a,b;
double fraction, a, b;
const Table *tb = &tables[tabindex[type]];
const int itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
const int itable = static_cast<int>((x - tb->lo) * tb->invdelta);
if (itable < 0)
error->one(FLERR,"Bond length < table inner cutoff: type {} length {:.8}",type,x);
error->one(FLERR, "Bond length < table inner cutoff: type {} length {:.8}", type, x);
else if (itable >= tablength)
error->one(FLERR,"Bond length > table outer cutoff: type {} length {:.8}",type,x);
error->one(FLERR, "Bond length > table outer cutoff: type {} length {:.8}", type, x);
if (tabstyle == LINEAR) {
fraction = (x - tb->r[itable]) * tb->invdelta;
u = tb->e[itable] + fraction*tb->de[itable];
f = tb->f[itable] + fraction*tb->df[itable];
u = tb->e[itable] + fraction * tb->de[itable];
f = tb->f[itable] + fraction * tb->df[itable];
} else if (tabstyle == SPLINE) {
fraction = (x - tb->r[itable]) * tb->invdelta;
b = (x - tb->r[itable]) * tb->invdelta;
a = 1.0 - b;
u = a * tb->e[itable] + b * tb->e[itable+1] +
((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * tb->deltasq6;
f = a * tb->f[itable] + b * tb->f[itable+1] +
((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * tb->deltasq6;
u = a * tb->e[itable] + b * tb->e[itable + 1] +
((a * a * a - a) * tb->e2[itable] + (b * b * b - b) * tb->e2[itable + 1]) * tb->deltasq6;
f = a * tb->f[itable] + b * tb->f[itable + 1] +
((a * a * a - a) * tb->f2[itable] + (b * b * b - b) * tb->f2[itable + 1]) * tb->deltasq6;
}
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -32,13 +31,13 @@
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::DEG2RAD;
#define TOLERANCE 0.05
static constexpr double TOLERANCE = 0.05;
/* ---------------------------------------------------------------------- */
DihedralCharmm::DihedralCharmm(LAMMPS *lmp) : Dihedral(lmp)
DihedralCharmm::DihedralCharmm(LAMMPS *_lmp) : Dihedral(_lmp)
{
weightflag = 0;
writedata = 1;
@ -63,19 +62,19 @@ DihedralCharmm::~DihedralCharmm()
void DihedralCharmm::compute(int eflag, int vflag)
{
int i1,i2,i3,i4,i,m,n,type;
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
double edihedral,f1[3],f2[3],f3[3],f4[3];
double ax,ay,az,bx,by,bz,rasq,rbsq,rgsq,rg,rginv,ra2inv,rb2inv,rabinv;
double df,df1,ddf1,fg,hg,fga,hgb,gaa,gbb;
double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
double c,s,p,sx2,sy2,sz2;
int itype,jtype;
double delx,dely,delz,rsq,r2inv,r6inv;
double forcecoul,forcelj,fpair,ecoul,evdwl;
int i1, i2, i3, i4, i, m, n, type;
double vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, vb3x, vb3y, vb3z, vb2xm, vb2ym, vb2zm;
double edihedral, f1[3], f2[3], f3[3], f4[3];
double ax, ay, az, bx, by, bz, rasq, rbsq, rgsq, rg, rginv, ra2inv, rb2inv, rabinv;
double df, df1, ddf1, fg, hg, fga, hgb, gaa, gbb;
double dtfx, dtfy, dtfz, dtgx, dtgy, dtgz, dthx, dthy, dthz;
double c, s, p, sx2, sy2, sz2;
int itype, jtype;
double delx, dely, delz, rsq, r2inv, r6inv;
double forcecoul, forcelj, fpair, ecoul, evdwl;
edihedral = evdwl = ecoul = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
// insure pair->ev_tally() will use 1-4 virial contribution
@ -121,31 +120,30 @@ void DihedralCharmm::compute(int eflag, int vflag)
vb3y = x[i4][1] - x[i3][1];
vb3z = x[i4][2] - x[i3][2];
ax = vb1y*vb2zm - vb1z*vb2ym;
ay = vb1z*vb2xm - vb1x*vb2zm;
az = vb1x*vb2ym - vb1y*vb2xm;
bx = vb3y*vb2zm - vb3z*vb2ym;
by = vb3z*vb2xm - vb3x*vb2zm;
bz = vb3x*vb2ym - vb3y*vb2xm;
ax = vb1y * vb2zm - vb1z * vb2ym;
ay = vb1z * vb2xm - vb1x * vb2zm;
az = vb1x * vb2ym - vb1y * vb2xm;
bx = vb3y * vb2zm - vb3z * vb2ym;
by = vb3z * vb2xm - vb3x * vb2zm;
bz = vb3x * vb2ym - vb3y * vb2xm;
rasq = ax*ax + ay*ay + az*az;
rbsq = bx*bx + by*by + bz*bz;
rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
rasq = ax * ax + ay * ay + az * az;
rbsq = bx * bx + by * by + bz * bz;
rgsq = vb2xm * vb2xm + vb2ym * vb2ym + vb2zm * vb2zm;
rg = sqrt(rgsq);
rginv = ra2inv = rb2inv = 0.0;
if (rg > 0) rginv = 1.0/rg;
if (rasq > 0) ra2inv = 1.0/rasq;
if (rbsq > 0) rb2inv = 1.0/rbsq;
rabinv = sqrt(ra2inv*rb2inv);
if (rg > 0) rginv = 1.0 / rg;
if (rasq > 0) ra2inv = 1.0 / rasq;
if (rbsq > 0) rb2inv = 1.0 / rbsq;
rabinv = sqrt(ra2inv * rb2inv);
c = (ax*bx + ay*by + az*bz)*rabinv;
s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
c = (ax * bx + ay * by + az * bz) * rabinv;
s = rg * rabinv * (ax * vb3x + ay * vb3y + az * vb3z);
// error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE))
problem(FLERR, i1, i2, i3, i4);
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) problem(FLERR, i1, i2, i3, i4);
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -155,13 +153,13 @@ void DihedralCharmm::compute(int eflag, int vflag)
ddf1 = df1 = 0.0;
for (i = 0; i < m; i++) {
ddf1 = p*c - df1*s;
df1 = p*s + df1*c;
ddf1 = p * c - df1 * s;
df1 = p * s + df1 * c;
p = ddf1;
}
p = p*cos_shift[type] + df1*sin_shift[type];
df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
p = p * cos_shift[type] + df1 * sin_shift[type];
df1 = df1 * cos_shift[type] - ddf1 * sin_shift[type];
df1 *= -m;
p += 1.0;
@ -172,40 +170,40 @@ void DihedralCharmm::compute(int eflag, int vflag)
if (eflag) edihedral = k[type] * p;
fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
fga = fg*ra2inv*rginv;
hgb = hg*rb2inv*rginv;
gaa = -ra2inv*rg;
gbb = rb2inv*rg;
fg = vb1x * vb2xm + vb1y * vb2ym + vb1z * vb2zm;
hg = vb3x * vb2xm + vb3y * vb2ym + vb3z * vb2zm;
fga = fg * ra2inv * rginv;
hgb = hg * rb2inv * rginv;
gaa = -ra2inv * rg;
gbb = rb2inv * rg;
dtfx = gaa*ax;
dtfy = gaa*ay;
dtfz = gaa*az;
dtgx = fga*ax - hgb*bx;
dtgy = fga*ay - hgb*by;
dtgz = fga*az - hgb*bz;
dthx = gbb*bx;
dthy = gbb*by;
dthz = gbb*bz;
dtfx = gaa * ax;
dtfy = gaa * ay;
dtfz = gaa * az;
dtgx = fga * ax - hgb * bx;
dtgy = fga * ay - hgb * by;
dtgz = fga * az - hgb * bz;
dthx = gbb * bx;
dthy = gbb * by;
dthz = gbb * bz;
df = -k[type] * df1;
sx2 = df*dtgx;
sy2 = df*dtgy;
sz2 = df*dtgz;
sx2 = df * dtgx;
sy2 = df * dtgy;
sz2 = df * dtgz;
f1[0] = df*dtfx;
f1[1] = df*dtfy;
f1[2] = df*dtfz;
f1[0] = df * dtfx;
f1[1] = df * dtfy;
f1[2] = df * dtfz;
f2[0] = sx2 - f1[0];
f2[1] = sy2 - f1[1];
f2[2] = sz2 - f1[2];
f4[0] = df*dthx;
f4[1] = df*dthy;
f4[2] = df*dthz;
f4[0] = df * dthx;
f4[1] = df * dthy;
f4[2] = df * dthz;
f3[0] = -sx2 - f4[0];
f3[1] = -sy2 - f4[1];
@ -238,8 +236,8 @@ void DihedralCharmm::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb1x, vb1y, vb1z, vb2x,
vb2y, vb2z, vb3x, vb3y, vb3z);
// 1-4 LJ and Coulomb interactions
// tally energy/virial in pair, using newton_bond as newton flag
@ -251,34 +249,36 @@ void DihedralCharmm::compute(int eflag, int vflag)
delx = x[i1][0] - x[i4][0];
dely = x[i1][1] - x[i4][1];
delz = x[i1][2] - x[i4][2];
rsq = delx*delx + dely*dely + delz*delz;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
rsq = delx * delx + dely * dely + delz * delz;
r2inv = 1.0 / rsq;
r6inv = r2inv * r2inv * r2inv;
if (implicit) forcecoul = qqrd2e * q[i1]*q[i4]*r2inv;
else forcecoul = qqrd2e * q[i1]*q[i4]*sqrt(r2inv);
forcelj = r6inv * (lj14_1[itype][jtype]*r6inv - lj14_2[itype][jtype]);
fpair = weight[type] * (forcelj+forcecoul)*r2inv;
if (implicit)
forcecoul = qqrd2e * q[i1] * q[i4] * r2inv;
else
forcecoul = qqrd2e * q[i1] * q[i4] * sqrt(r2inv);
forcelj = r6inv * (lj14_1[itype][jtype] * r6inv - lj14_2[itype][jtype]);
fpair = weight[type] * (forcelj + forcecoul) * r2inv;
if (eflag) {
ecoul = weight[type] * forcecoul;
evdwl = r6inv * (lj14_3[itype][jtype]*r6inv - lj14_4[itype][jtype]);
evdwl = r6inv * (lj14_3[itype][jtype] * r6inv - lj14_4[itype][jtype]);
evdwl *= weight[type];
}
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fpair;
f[i1][1] += dely*fpair;
f[i1][2] += delz*fpair;
f[i1][0] += delx * fpair;
f[i1][1] += dely * fpair;
f[i1][2] += delz * fpair;
}
if (newton_bond || i4 < nlocal) {
f[i4][0] -= delx*fpair;
f[i4][1] -= dely*fpair;
f[i4][2] -= delz*fpair;
f[i4][0] -= delx * fpair;
f[i4][1] -= dely * fpair;
f[i4][2] -= delz * fpair;
}
if (evflag) force->pair->ev_tally(i1,i4,nlocal,newton_bond,
evdwl,ecoul,fpair,delx,dely,delz);
if (evflag)
force->pair->ev_tally(i1, i4, nlocal, newton_bond, evdwl, ecoul, fpair, delx, dely, delz);
}
}
}
@ -288,17 +288,17 @@ void DihedralCharmm::compute(int eflag, int vflag)
void DihedralCharmm::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
const int np1 = atom->ndihedraltypes + 1;
memory->create(k,n+1,"dihedral:k");
memory->create(multiplicity,n+1,"dihedral:multiplicity");
memory->create(shift,n+1,"dihedral:shift");
memory->create(cos_shift,n+1,"dihedral:cos_shift");
memory->create(sin_shift,n+1,"dihedral:sin_shift");
memory->create(weight,n+1,"dihedral:weight");
memory->create(k, np1, "dihedral:k");
memory->create(multiplicity, np1, "dihedral:multiplicity");
memory->create(shift, np1, "dihedral:shift");
memory->create(cos_shift, np1, "dihedral:cos_shift");
memory->create(sin_shift, np1, "dihedral:sin_shift");
memory->create(weight, np1, "dihedral:weight");
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "dihedral:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -307,40 +307,40 @@ void DihedralCharmm::allocate()
void DihedralCharmm::coeff(int narg, char **arg)
{
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
// require integer values of shift for backwards compatibility
// arbitrary phase angle shift could be allowed, but would break
// backwards compatibility and is probably not needed
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp);
int shift_one = utils::inumeric(FLERR,arg[3],false,lmp);
double weight_one = utils::numeric(FLERR,arg[4],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
int multiplicity_one = utils::inumeric(FLERR, arg[2], false, lmp);
int shift_one = utils::inumeric(FLERR, arg[3], false, lmp);
double weight_one = utils::numeric(FLERR, arg[4], false, lmp);
if (multiplicity_one < 0)
error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
error->all(FLERR, "Incorrect multiplicity arg for dihedral coefficients");
if (weight_one < 0.0 || weight_one > 1.0)
error->all(FLERR,"Incorrect weight arg for dihedral coefficients");
if (weight_one > 0.0) weightflag=1;
error->all(FLERR, "Incorrect weight arg for dihedral coefficients");
if (weight_one > 0.0) weightflag = 1;
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
shift[i] = shift_one;
cos_shift[i] = cos(MY_PI*shift_one/180.0);
sin_shift[i] = sin(MY_PI*shift_one/180.0);
cos_shift[i] = cos(DEG2RAD * shift_one);
sin_shift[i] = sin(DEG2RAD * shift_one);
multiplicity[i] = multiplicity_one;
weight[i] = weight_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -349,14 +349,12 @@ void DihedralCharmm::coeff(int narg, char **arg)
void DihedralCharmm::init_style()
{
if (utils::strmatch(update->integrate_style,"^respa")) {
if (utils::strmatch(update->integrate_style, "^respa")) {
Respa *r = (Respa *) update->integrate;
if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral))
error->all(FLERR,"Dihedral style charmm must be set to same"
" r-RESPA level as 'pair'");
error->all(FLERR, "Dihedral style charmm must be set to same r-RESPA level as 'pair'");
if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral))
error->all(FLERR,"Dihedral style charmm must be set to same"
" r-RESPA level as 'outer'");
error->all(FLERR, "Dihedral style charmm must be set to same r-RESPA level as 'outer'");
}
// insure use of CHARMM pair_style if any weight factors are non-zero
@ -366,19 +364,20 @@ void DihedralCharmm::init_style()
if (weightflag) {
if ((force->special_lj[3] != 0.0) || (force->special_coul[3] != 0.0))
error->all(FLERR,"Must use 'special_bonds charmm' with"
" dihedral style charmm for use with CHARMM pair styles");
error->all(FLERR,
"Must use 'special_bonds charmm' with dihedral "
"style charmm for use with CHARMM pair styles");
int itmp;
if (force->pair == nullptr)
error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
lj14_1 = (double **) force->pair->extract("lj14_1",itmp);
lj14_2 = (double **) force->pair->extract("lj14_2",itmp);
lj14_3 = (double **) force->pair->extract("lj14_3",itmp);
lj14_4 = (double **) force->pair->extract("lj14_4",itmp);
int *ptr = (int *) force->pair->extract("implicit",itmp);
error->all(FLERR, "Dihedral charmm is incompatible with Pair style");
lj14_1 = (double **) force->pair->extract("lj14_1", itmp);
lj14_2 = (double **) force->pair->extract("lj14_2", itmp);
lj14_3 = (double **) force->pair->extract("lj14_3", itmp);
lj14_4 = (double **) force->pair->extract("lj14_4", itmp);
int *ptr = (int *) force->pair->extract("implicit", itmp);
if (!lj14_1 || !lj14_2 || !lj14_3 || !lj14_4 || !ptr)
error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
error->all(FLERR, "Dihedral charmm is incompatible with Pair style");
implicit = *ptr;
}
}
@ -389,11 +388,11 @@ void DihedralCharmm::init_style()
void DihedralCharmm::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&shift[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&weight[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&weightflag,sizeof(int),1,fp);
fwrite(&k[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&multiplicity[1], sizeof(int), atom->ndihedraltypes, fp);
fwrite(&shift[1], sizeof(int), atom->ndihedraltypes, fp);
fwrite(&weight[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&weightflag, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -405,22 +404,22 @@ void DihedralCharmm::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &multiplicity[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &shift[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &weight[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &weightflag, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&shift[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&weight[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&weightflag,1,MPI_INT,0,world);
MPI_Bcast(&k[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&multiplicity[1], atom->ndihedraltypes, MPI_INT, 0, world);
MPI_Bcast(&shift[1], atom->ndihedraltypes, MPI_INT, 0, world);
MPI_Bcast(&weight[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&weightflag, 1, MPI_INT, 0, world);
for (int i = 1; i <= atom->ndihedraltypes; i++) {
setflag[i] = 1;
cos_shift[i] = cos(MY_PI*shift[i]/180.0);
sin_shift[i] = sin(MY_PI*shift[i]/180.0);
cos_shift[i] = cos(DEG2RAD * shift[i]);
sin_shift[i] = sin(DEG2RAD * shift[i]);
}
}
@ -431,6 +430,5 @@ void DihedralCharmm::read_restart(FILE *fp)
void DihedralCharmm::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %d %d %g\n",i,k[i],multiplicity[i],shift[i],weight[i]);
fprintf(fp, "%d %g %d %d %g\n", i, k[i], multiplicity[i], shift[i], weight[i]);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -35,13 +34,13 @@
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::DEG2RAD;
#define TOLERANCE 0.05
static constexpr double TOLERANCE = 0.05;
/* ---------------------------------------------------------------------- */
DihedralCharmmfsw::DihedralCharmmfsw(LAMMPS *lmp) : Dihedral(lmp)
DihedralCharmmfsw::DihedralCharmmfsw(LAMMPS *_lmp) : Dihedral(_lmp)
{
weightflag = 0;
writedata = 1;
@ -66,19 +65,19 @@ DihedralCharmmfsw::~DihedralCharmmfsw()
void DihedralCharmmfsw::compute(int eflag, int vflag)
{
int i1,i2,i3,i4,i,m,n,type;
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
double edihedral,f1[3],f2[3],f3[3],f4[3];
double ax,ay,az,bx,by,bz,rasq,rbsq,rgsq,rg,rginv,ra2inv,rb2inv,rabinv;
double df,df1,ddf1,fg,hg,fga,hgb,gaa,gbb;
double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
double c,s,p,sx2,sy2,sz2;
int itype,jtype;
double delx,dely,delz,rsq,r2inv,r6inv,r;
double forcecoul,forcelj,fpair,ecoul,evdwl;
int i1, i2, i3, i4, i, m, n, type;
double vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, vb3x, vb3y, vb3z, vb2xm, vb2ym, vb2zm;
double edihedral, f1[3], f2[3], f3[3], f4[3];
double ax, ay, az, bx, by, bz, rasq, rbsq, rgsq, rg, rginv, ra2inv, rb2inv, rabinv;
double df, df1, ddf1, fg, hg, fga, hgb, gaa, gbb;
double dtfx, dtfy, dtfz, dtgx, dtgy, dtgz, dthx, dthy, dthz;
double c, s, p, sx2, sy2, sz2;
int itype, jtype;
double delx, dely, delz, rsq, r2inv, r6inv, r;
double forcecoul, forcelj, fpair, ecoul, evdwl;
edihedral = evdwl = ecoul = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
// insure pair->ev_tally() will use 1-4 virial contribution
@ -124,31 +123,30 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
vb3y = x[i4][1] - x[i3][1];
vb3z = x[i4][2] - x[i3][2];
ax = vb1y*vb2zm - vb1z*vb2ym;
ay = vb1z*vb2xm - vb1x*vb2zm;
az = vb1x*vb2ym - vb1y*vb2xm;
bx = vb3y*vb2zm - vb3z*vb2ym;
by = vb3z*vb2xm - vb3x*vb2zm;
bz = vb3x*vb2ym - vb3y*vb2xm;
ax = vb1y * vb2zm - vb1z * vb2ym;
ay = vb1z * vb2xm - vb1x * vb2zm;
az = vb1x * vb2ym - vb1y * vb2xm;
bx = vb3y * vb2zm - vb3z * vb2ym;
by = vb3z * vb2xm - vb3x * vb2zm;
bz = vb3x * vb2ym - vb3y * vb2xm;
rasq = ax*ax + ay*ay + az*az;
rbsq = bx*bx + by*by + bz*bz;
rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
rasq = ax * ax + ay * ay + az * az;
rbsq = bx * bx + by * by + bz * bz;
rgsq = vb2xm * vb2xm + vb2ym * vb2ym + vb2zm * vb2zm;
rg = sqrt(rgsq);
rginv = ra2inv = rb2inv = 0.0;
if (rg > 0) rginv = 1.0/rg;
if (rasq > 0) ra2inv = 1.0/rasq;
if (rbsq > 0) rb2inv = 1.0/rbsq;
rabinv = sqrt(ra2inv*rb2inv);
if (rg > 0) rginv = 1.0 / rg;
if (rasq > 0) ra2inv = 1.0 / rasq;
if (rbsq > 0) rb2inv = 1.0 / rbsq;
rabinv = sqrt(ra2inv * rb2inv);
c = (ax*bx + ay*by + az*bz)*rabinv;
s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
c = (ax * bx + ay * by + az * bz) * rabinv;
s = rg * rabinv * (ax * vb3x + ay * vb3y + az * vb3z);
// error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE))
problem(FLERR, i1, i2, i3, i4);
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) problem(FLERR, i1, i2, i3, i4);
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -158,13 +156,13 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
ddf1 = df1 = 0.0;
for (i = 0; i < m; i++) {
ddf1 = p*c - df1*s;
df1 = p*s + df1*c;
ddf1 = p * c - df1 * s;
df1 = p * s + df1 * c;
p = ddf1;
}
p = p*cos_shift[type] + df1*sin_shift[type];
df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
p = p * cos_shift[type] + df1 * sin_shift[type];
df1 = df1 * cos_shift[type] - ddf1 * sin_shift[type];
df1 *= -m;
p += 1.0;
@ -175,40 +173,40 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
if (eflag) edihedral = k[type] * p;
fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
fga = fg*ra2inv*rginv;
hgb = hg*rb2inv*rginv;
gaa = -ra2inv*rg;
gbb = rb2inv*rg;
fg = vb1x * vb2xm + vb1y * vb2ym + vb1z * vb2zm;
hg = vb3x * vb2xm + vb3y * vb2ym + vb3z * vb2zm;
fga = fg * ra2inv * rginv;
hgb = hg * rb2inv * rginv;
gaa = -ra2inv * rg;
gbb = rb2inv * rg;
dtfx = gaa*ax;
dtfy = gaa*ay;
dtfz = gaa*az;
dtgx = fga*ax - hgb*bx;
dtgy = fga*ay - hgb*by;
dtgz = fga*az - hgb*bz;
dthx = gbb*bx;
dthy = gbb*by;
dthz = gbb*bz;
dtfx = gaa * ax;
dtfy = gaa * ay;
dtfz = gaa * az;
dtgx = fga * ax - hgb * bx;
dtgy = fga * ay - hgb * by;
dtgz = fga * az - hgb * bz;
dthx = gbb * bx;
dthy = gbb * by;
dthz = gbb * bz;
df = -k[type] * df1;
sx2 = df*dtgx;
sy2 = df*dtgy;
sz2 = df*dtgz;
sx2 = df * dtgx;
sy2 = df * dtgy;
sz2 = df * dtgz;
f1[0] = df*dtfx;
f1[1] = df*dtfy;
f1[2] = df*dtfz;
f1[0] = df * dtfx;
f1[1] = df * dtfy;
f1[2] = df * dtfz;
f2[0] = sx2 - f1[0];
f2[1] = sy2 - f1[1];
f2[2] = sz2 - f1[2];
f4[0] = df*dthx;
f4[1] = df*dthy;
f4[2] = df*dthz;
f4[0] = df * dthx;
f4[1] = df * dthy;
f4[2] = df * dthz;
f3[0] = -sx2 - f4[0];
f3[1] = -sy2 - f4[1];
@ -241,8 +239,8 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb1x, vb1y, vb1z, vb2x,
vb2y, vb2z, vb3x, vb3y, vb3z);
// 1-4 LJ and Coulomb interactions
// tally energy/virial in pair, using newton_bond as newton flag
@ -254,9 +252,9 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
delx = x[i1][0] - x[i4][0];
dely = x[i1][1] - x[i4][1];
delz = x[i1][2] - x[i4][2];
rsq = delx*delx + dely*dely + delz*delz;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
rsq = delx * delx + dely * dely + delz * delz;
r2inv = 1.0 / rsq;
r6inv = r2inv * r2inv * r2inv;
// modifying coul and LJ force and energies to apply
// force_shift and force_switch as in CHARMM pairwise
@ -264,39 +262,42 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
// for r < cut_inner, so switching not applied
r = sqrt(rsq);
if (implicit) forcecoul = qqrd2e * q[i1]*q[i4]*r2inv;
else if (dihedflag) forcecoul = qqrd2e * q[i1]*q[i4]*sqrt(r2inv);
else forcecoul = qqrd2e * q[i1]*q[i4]*(sqrt(r2inv) -
r*cut_coulinv14*cut_coulinv14);
forcelj = r6inv * (lj14_1[itype][jtype]*r6inv - lj14_2[itype][jtype]);
fpair = weight[type] * (forcelj+forcecoul)*r2inv;
if (implicit)
forcecoul = qqrd2e * q[i1] * q[i4] * r2inv;
else if (dihedflag)
forcecoul = qqrd2e * q[i1] * q[i4] * sqrt(r2inv);
else
forcecoul = qqrd2e * q[i1] * q[i4] * (sqrt(r2inv) - r * cut_coulinv14 * cut_coulinv14);
forcelj = r6inv * (lj14_1[itype][jtype] * r6inv - lj14_2[itype][jtype]);
fpair = weight[type] * (forcelj + forcecoul) * r2inv;
if (eflag) {
if (dihedflag) ecoul = weight[type] * forcecoul;
else ecoul = weight[type] * qqrd2e * q[i1]*q[i4] *
(sqrt(r2inv) + r*cut_coulinv14*cut_coulinv14 -
2.0*cut_coulinv14);
evdwl14_12 = r6inv*lj14_3[itype][jtype]*r6inv -
lj14_3[itype][jtype]*cut_lj_inner6inv*cut_lj6inv;
evdwl14_6 = -lj14_4[itype][jtype]*r6inv +
lj14_4[itype][jtype]*cut_lj_inner3inv*cut_lj3inv;
if (dihedflag)
ecoul = weight[type] * forcecoul;
else
ecoul = weight[type] * qqrd2e * q[i1] * q[i4] *
(sqrt(r2inv) + r * cut_coulinv14 * cut_coulinv14 - 2.0 * cut_coulinv14);
evdwl14_12 = r6inv * lj14_3[itype][jtype] * r6inv -
lj14_3[itype][jtype] * cut_lj_inner6inv * cut_lj6inv;
evdwl14_6 =
-lj14_4[itype][jtype] * r6inv + lj14_4[itype][jtype] * cut_lj_inner3inv * cut_lj3inv;
evdwl = evdwl14_12 + evdwl14_6;
evdwl *= weight[type];
}
if (newton_bond || i1 < nlocal) {
f[i1][0] += delx*fpair;
f[i1][1] += dely*fpair;
f[i1][2] += delz*fpair;
f[i1][0] += delx * fpair;
f[i1][1] += dely * fpair;
f[i1][2] += delz * fpair;
}
if (newton_bond || i4 < nlocal) {
f[i4][0] -= delx*fpair;
f[i4][1] -= dely*fpair;
f[i4][2] -= delz*fpair;
f[i4][0] -= delx * fpair;
f[i4][1] -= dely * fpair;
f[i4][2] -= delz * fpair;
}
if (evflag) force->pair->ev_tally(i1,i4,nlocal,newton_bond,
evdwl,ecoul,fpair,delx,dely,delz);
if (evflag)
force->pair->ev_tally(i1, i4, nlocal, newton_bond, evdwl, ecoul, fpair, delx, dely, delz);
}
}
}
@ -306,17 +307,17 @@ void DihedralCharmmfsw::compute(int eflag, int vflag)
void DihedralCharmmfsw::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
const int np1 = atom->ndihedraltypes + 1;
memory->create(k,n+1,"dihedral:k");
memory->create(multiplicity,n+1,"dihedral:multiplicity");
memory->create(shift,n+1,"dihedral:shift");
memory->create(cos_shift,n+1,"dihedral:cos_shift");
memory->create(sin_shift,n+1,"dihedral:sin_shift");
memory->create(weight,n+1,"dihedral:weight");
memory->create(k, np1, "dihedral:k");
memory->create(multiplicity, np1, "dihedral:multiplicity");
memory->create(shift, np1, "dihedral:shift");
memory->create(cos_shift, np1, "dihedral:cos_shift");
memory->create(sin_shift, np1, "dihedral:sin_shift");
memory->create(weight, np1, "dihedral:weight");
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "dihedral:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -325,40 +326,40 @@ void DihedralCharmmfsw::allocate()
void DihedralCharmmfsw::coeff(int narg, char **arg)
{
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
// require integer values of shift for backwards compatibility
// arbitrary phase angle shift could be allowed, but would break
// backwards compatibility and is probably not needed
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp);
int shift_one = utils::inumeric(FLERR,arg[3],false,lmp);
double weight_one = utils::numeric(FLERR,arg[4],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
int multiplicity_one = utils::inumeric(FLERR, arg[2], false, lmp);
int shift_one = utils::inumeric(FLERR, arg[3], false, lmp);
double weight_one = utils::numeric(FLERR, arg[4], false, lmp);
if (multiplicity_one < 0)
error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
error->all(FLERR, "Incorrect multiplicity arg for dihedral coefficients");
if (weight_one < 0.0 || weight_one > 1.0)
error->all(FLERR,"Incorrect weight arg for dihedral coefficients");
if (weight_one > 0.0) weightflag=1;
error->all(FLERR, "Incorrect weight arg for dihedral coefficients");
if (weight_one > 0.0) weightflag = 1;
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k[i] = k_one;
shift[i] = shift_one;
cos_shift[i] = cos(MY_PI*shift_one/180.0);
sin_shift[i] = sin(MY_PI*shift_one/180.0);
cos_shift[i] = cos(DEG2RAD * shift_one);
sin_shift[i] = sin(DEG2RAD * shift_one);
multiplicity[i] = multiplicity_one;
weight[i] = weight_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -367,14 +368,12 @@ void DihedralCharmmfsw::coeff(int narg, char **arg)
void DihedralCharmmfsw::init_style()
{
if (utils::strmatch(update->integrate_style,"^respa")) {
if (utils::strmatch(update->integrate_style, "^respa")) {
Respa *r = (Respa *) update->integrate;
if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral))
error->all(FLERR,"Dihedral style charmmfsw must be set to same"
" r-RESPA level as 'pair'");
error->all(FLERR, "Dihedral style charmmfsw must be set to same r-RESPA level as 'pair'");
if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral))
error->all(FLERR,"Dihedral style charmmfsw must be set to same"
" r-RESPA level as 'outer'");
error->all(FLERR, "Dihedral style charmmfsw must be set to same r-RESPA level as 'outer'");
}
// insure use of CHARMM pair_style if any weight factors are non-zero
@ -384,19 +383,20 @@ void DihedralCharmmfsw::init_style()
if (weightflag) {
if ((force->special_lj[3] != 0.0) || (force->special_coul[3] != 0.0))
error->all(FLERR,"Must use 'special_bonds charmm' with"
" dihedral style charmm for use with CHARMM pair styles");
error->all(FLERR,
"Must use 'special_bonds charmm' with dihedral "
"style charmm for use with CHARMM pair styles");
int itmp;
if (force->pair == nullptr)
error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style");
lj14_1 = (double **) force->pair->extract("lj14_1",itmp);
lj14_2 = (double **) force->pair->extract("lj14_2",itmp);
lj14_3 = (double **) force->pair->extract("lj14_3",itmp);
lj14_4 = (double **) force->pair->extract("lj14_4",itmp);
int *ptr = (int *) force->pair->extract("implicit",itmp);
error->all(FLERR, "Dihedral charmmfsw is incompatible with Pair style");
lj14_1 = (double **) force->pair->extract("lj14_1", itmp);
lj14_2 = (double **) force->pair->extract("lj14_2", itmp);
lj14_3 = (double **) force->pair->extract("lj14_3", itmp);
lj14_4 = (double **) force->pair->extract("lj14_4", itmp);
int *ptr = (int *) force->pair->extract("implicit", itmp);
if (!lj14_1 || !lj14_2 || !lj14_3 || !lj14_4 || !ptr)
error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style");
error->all(FLERR, "Dihedral charmmfsw is incompatible with Pair style");
implicit = *ptr;
}
@ -404,25 +404,24 @@ void DihedralCharmmfsw::init_style()
// to 1/4 dihedral atoms to match CHARMM pairwise interactions
int itmp;
int *p_dihedflag = (int *) force->pair->extract("dihedflag",itmp);
double *p_cutljinner = (double *) force->pair->extract("cut_lj_inner",itmp);
double *p_cutlj = (double *) force->pair->extract("cut_lj",itmp);
double *p_cutcoul = (double *) force->pair->extract("cut_coul",itmp);
int *p_dihedflag = (int *) force->pair->extract("dihedflag", itmp);
double *p_cutljinner = (double *) force->pair->extract("cut_lj_inner", itmp);
double *p_cutlj = (double *) force->pair->extract("cut_lj", itmp);
double *p_cutcoul = (double *) force->pair->extract("cut_coul", itmp);
if (p_cutcoul == nullptr || p_cutljinner == nullptr ||
p_cutlj == nullptr || p_dihedflag == nullptr)
error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style");
if (p_cutcoul == nullptr || p_cutljinner == nullptr || p_cutlj == nullptr ||
p_dihedflag == nullptr)
error->all(FLERR, "Dihedral charmmfsw is incompatible with Pair style");
dihedflag = *p_dihedflag;
cut_coul14 = *p_cutcoul;
cut_lj_inner14 = *p_cutljinner;
cut_lj14 = *p_cutlj;
cut_coulinv14 = 1/cut_coul14;
cut_lj_inner3inv = (1/cut_lj_inner14) * (1/cut_lj_inner14) *
(1/cut_lj_inner14);
cut_coulinv14 = 1 / cut_coul14;
cut_lj_inner3inv = (1 / cut_lj_inner14) * (1 / cut_lj_inner14) * (1 / cut_lj_inner14);
cut_lj_inner6inv = cut_lj_inner3inv * cut_lj_inner3inv;
cut_lj3inv = (1/cut_lj14) * (1/cut_lj14) * (1/cut_lj14);
cut_lj3inv = (1 / cut_lj14) * (1 / cut_lj14) * (1 / cut_lj14);
cut_lj6inv = cut_lj3inv * cut_lj3inv;
}
@ -432,11 +431,11 @@ void DihedralCharmmfsw::init_style()
void DihedralCharmmfsw::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&shift[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&weight[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&weightflag,sizeof(int),1,fp);
fwrite(&k[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&multiplicity[1], sizeof(int), atom->ndihedraltypes, fp);
fwrite(&shift[1], sizeof(int), atom->ndihedraltypes, fp);
fwrite(&weight[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&weightflag, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -448,22 +447,22 @@ void DihedralCharmmfsw::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &multiplicity[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &shift[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &weight[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &weightflag, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&shift[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&weight[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&weightflag,1,MPI_INT,0,world);
MPI_Bcast(&k[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&multiplicity[1], atom->ndihedraltypes, MPI_INT, 0, world);
MPI_Bcast(&shift[1], atom->ndihedraltypes, MPI_INT, 0, world);
MPI_Bcast(&weight[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&weightflag, 1, MPI_INT, 0, world);
for (int i = 1; i <= atom->ndihedraltypes; i++) {
setflag[i] = 1;
cos_shift[i] = cos(MY_PI*shift[i]/180.0);
sin_shift[i] = sin(MY_PI*shift[i]/180.0);
cos_shift[i] = cos(DEG2RAD * shift[i]);
sin_shift[i] = sin(DEG2RAD * shift[i]);
}
}
@ -474,6 +473,5 @@ void DihedralCharmmfsw::read_restart(FILE *fp)
void DihedralCharmmfsw::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %d %d %g\n",i,k[i],multiplicity[i],shift[i],weight[i]);
fprintf(fp, "%d %g %d %d %g\n", i, k[i], multiplicity[i], shift[i], weight[i]);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -29,12 +28,11 @@
using namespace LAMMPS_NS;
#define TOLERANCE 0.05
#define SMALL 0.001
static constexpr double TOLERANCE = 0.05;
/* ---------------------------------------------------------------------- */
DihedralHarmonic::DihedralHarmonic(LAMMPS *lmp) : Dihedral(lmp)
DihedralHarmonic::DihedralHarmonic(LAMMPS *_lmp) : Dihedral(_lmp)
{
writedata = 1;
}
@ -57,16 +55,16 @@ DihedralHarmonic::~DihedralHarmonic()
void DihedralHarmonic::compute(int eflag, int vflag)
{
int i1,i2,i3,i4,i,m,n,type;
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
double edihedral,f1[3],f2[3],f3[3],f4[3];
double ax,ay,az,bx,by,bz,rasq,rbsq,rgsq,rg,rginv,ra2inv,rb2inv,rabinv;
double df,df1,ddf1,fg,hg,fga,hgb,gaa,gbb;
double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
double c,s,p,sx2,sy2,sz2;
int i1, i2, i3, i4, i, m, n, type;
double vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, vb3x, vb3y, vb3z, vb2xm, vb2ym, vb2zm;
double edihedral, f1[3], f2[3], f3[3], f4[3];
double ax, ay, az, bx, by, bz, rasq, rbsq, rgsq, rg, rginv, ra2inv, rb2inv, rabinv;
double df, df1, ddf1, fg, hg, fga, hgb, gaa, gbb;
double dtfx, dtfy, dtfz, dtgx, dtgy, dtgz, dthx, dthy, dthz;
double c, s, p, sx2, sy2, sz2;
edihedral = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -106,31 +104,30 @@ void DihedralHarmonic::compute(int eflag, int vflag)
// c,s calculation
ax = vb1y*vb2zm - vb1z*vb2ym;
ay = vb1z*vb2xm - vb1x*vb2zm;
az = vb1x*vb2ym - vb1y*vb2xm;
bx = vb3y*vb2zm - vb3z*vb2ym;
by = vb3z*vb2xm - vb3x*vb2zm;
bz = vb3x*vb2ym - vb3y*vb2xm;
ax = vb1y * vb2zm - vb1z * vb2ym;
ay = vb1z * vb2xm - vb1x * vb2zm;
az = vb1x * vb2ym - vb1y * vb2xm;
bx = vb3y * vb2zm - vb3z * vb2ym;
by = vb3z * vb2xm - vb3x * vb2zm;
bz = vb3x * vb2ym - vb3y * vb2xm;
rasq = ax*ax + ay*ay + az*az;
rbsq = bx*bx + by*by + bz*bz;
rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
rasq = ax * ax + ay * ay + az * az;
rbsq = bx * bx + by * by + bz * bz;
rgsq = vb2xm * vb2xm + vb2ym * vb2ym + vb2zm * vb2zm;
rg = sqrt(rgsq);
rginv = ra2inv = rb2inv = 0.0;
if (rg > 0) rginv = 1.0/rg;
if (rasq > 0) ra2inv = 1.0/rasq;
if (rbsq > 0) rb2inv = 1.0/rbsq;
rabinv = sqrt(ra2inv*rb2inv);
if (rg > 0) rginv = 1.0 / rg;
if (rasq > 0) ra2inv = 1.0 / rasq;
if (rbsq > 0) rb2inv = 1.0 / rbsq;
rabinv = sqrt(ra2inv * rb2inv);
c = (ax*bx + ay*by + az*bz)*rabinv;
s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
c = (ax * bx + ay * by + az * bz) * rabinv;
s = rg * rabinv * (ax * vb3x + ay * vb3y + az * vb3z);
// error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE))
problem(FLERR, i1, i2, i3, i4);
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) problem(FLERR, i1, i2, i3, i4);
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -140,13 +137,13 @@ void DihedralHarmonic::compute(int eflag, int vflag)
ddf1 = df1 = 0.0;
for (i = 0; i < m; i++) {
ddf1 = p*c - df1*s;
df1 = p*s + df1*c;
ddf1 = p * c - df1 * s;
df1 = p * s + df1 * c;
p = ddf1;
}
p = p*cos_shift[type] + df1*sin_shift[type];
df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
p = p * cos_shift[type] + df1 * sin_shift[type];
df1 = df1 * cos_shift[type] - ddf1 * sin_shift[type];
df1 *= -m;
p += 1.0;
@ -157,40 +154,40 @@ void DihedralHarmonic::compute(int eflag, int vflag)
if (eflag) edihedral = k[type] * p;
fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
fga = fg*ra2inv*rginv;
hgb = hg*rb2inv*rginv;
gaa = -ra2inv*rg;
gbb = rb2inv*rg;
fg = vb1x * vb2xm + vb1y * vb2ym + vb1z * vb2zm;
hg = vb3x * vb2xm + vb3y * vb2ym + vb3z * vb2zm;
fga = fg * ra2inv * rginv;
hgb = hg * rb2inv * rginv;
gaa = -ra2inv * rg;
gbb = rb2inv * rg;
dtfx = gaa*ax;
dtfy = gaa*ay;
dtfz = gaa*az;
dtgx = fga*ax - hgb*bx;
dtgy = fga*ay - hgb*by;
dtgz = fga*az - hgb*bz;
dthx = gbb*bx;
dthy = gbb*by;
dthz = gbb*bz;
dtfx = gaa * ax;
dtfy = gaa * ay;
dtfz = gaa * az;
dtgx = fga * ax - hgb * bx;
dtgy = fga * ay - hgb * by;
dtgz = fga * az - hgb * bz;
dthx = gbb * bx;
dthy = gbb * by;
dthz = gbb * bz;
df = -k[type] * df1;
sx2 = df*dtgx;
sy2 = df*dtgy;
sz2 = df*dtgz;
sx2 = df * dtgx;
sy2 = df * dtgy;
sz2 = df * dtgz;
f1[0] = df*dtfx;
f1[1] = df*dtfy;
f1[2] = df*dtfz;
f1[0] = df * dtfx;
f1[1] = df * dtfy;
f1[2] = df * dtfz;
f2[0] = sx2 - f1[0];
f2[1] = sy2 - f1[1];
f2[2] = sz2 - f1[2];
f4[0] = df*dthx;
f4[1] = df*dthy;
f4[2] = df*dthz;
f4[0] = df * dthx;
f4[1] = df * dthy;
f4[2] = df * dthz;
f3[0] = -sx2 - f4[0];
f3[1] = -sy2 - f4[1];
@ -223,8 +220,8 @@ void DihedralHarmonic::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb1x, vb1y, vb1z, vb2x,
vb2y, vb2z, vb3x, vb3y, vb3z);
}
}
@ -233,16 +230,16 @@ void DihedralHarmonic::compute(int eflag, int vflag)
void DihedralHarmonic::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
const int np1 = atom->ndihedraltypes + 1;
memory->create(k,n+1,"dihedral:k");
memory->create(sign,n+1,"dihedral:sign");
memory->create(multiplicity,n+1,"dihedral:multiplicity");
memory->create(cos_shift,n+1,"dihedral:cos_shift");
memory->create(sin_shift,n+1,"dihedral:sin_shift");
memory->create(k, np1, "dihedral:k");
memory->create(sign, np1, "dihedral:sign");
memory->create(multiplicity, np1, "dihedral:multiplicity");
memory->create(cos_shift, np1, "dihedral:cos_shift");
memory->create(sin_shift, np1, "dihedral:sin_shift");
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "dihedral:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -251,24 +248,24 @@ void DihedralHarmonic::allocate()
void DihedralHarmonic::coeff(int narg, char **arg)
{
if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (narg != 4) error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
double k_one = utils::numeric(FLERR,arg[1],false,lmp);
int sign_one = utils::inumeric(FLERR,arg[2],false,lmp);
int multiplicity_one = utils::inumeric(FLERR,arg[3],false,lmp);
double k_one = utils::numeric(FLERR, arg[1], false, lmp);
int sign_one = utils::inumeric(FLERR, arg[2], false, lmp);
int multiplicity_one = utils::inumeric(FLERR, arg[3], false, lmp);
// require sign = +/- 1 for backwards compatibility
// arbitrary phase angle shift could be allowed, but would break
// backwards compatibility and is probably not needed
if (sign_one != -1 && sign_one != 1)
error->all(FLERR,"Incorrect sign arg for dihedral coefficients");
error->all(FLERR, "Incorrect sign arg for dihedral coefficients");
if (multiplicity_one < 0)
error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
error->all(FLERR, "Incorrect multiplicity arg for dihedral coefficients");
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -286,7 +283,7 @@ void DihedralHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -295,9 +292,9 @@ void DihedralHarmonic::coeff(int narg, char **arg)
void DihedralHarmonic::write_restart(FILE *fp)
{
fwrite(&k[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&sign[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
fwrite(&k[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&sign[1], sizeof(int), atom->ndihedraltypes, fp);
fwrite(&multiplicity[1], sizeof(int), atom->ndihedraltypes, fp);
}
/* ----------------------------------------------------------------------
@ -309,13 +306,13 @@ void DihedralHarmonic::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR, &k[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &sign[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &multiplicity[1], sizeof(int), atom->ndihedraltypes, fp, nullptr, error);
}
MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&sign[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world);
MPI_Bcast(&k[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&sign[1], atom->ndihedraltypes, MPI_INT, 0, world);
MPI_Bcast(&multiplicity[1], atom->ndihedraltypes, MPI_INT, 0, world);
for (int i = 1; i <= atom->ndihedraltypes; i++) {
setflag[i] = 1;
@ -336,6 +333,5 @@ void DihedralHarmonic::read_restart(FILE *fp)
void DihedralHarmonic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %d %d\n",i,k[i],sign[i],multiplicity[i]);
fprintf(fp, "%d %g %d %d\n", i, k[i], sign[i], multiplicity[i]);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -29,12 +28,12 @@
using namespace LAMMPS_NS;
#define TOLERANCE 0.05
#define SMALL 0.001
static constexpr double TOLERANCE = 0.05;
static constexpr double SMALL = 0.001;
/* ---------------------------------------------------------------------- */
DihedralMultiHarmonic::DihedralMultiHarmonic(LAMMPS *lmp) : Dihedral(lmp)
DihedralMultiHarmonic::DihedralMultiHarmonic(LAMMPS *_lmp) : Dihedral(_lmp)
{
writedata = 1;
}
@ -57,17 +56,17 @@ DihedralMultiHarmonic::~DihedralMultiHarmonic()
void DihedralMultiHarmonic::compute(int eflag, int vflag)
{
int i1,i2,i3,i4,n,type;
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
double edihedral,f1[3],f2[3],f3[3],f4[3];
double sb1,sb2,sb3,rb1,rb3,c0,b1mag2,b1mag,b2mag2;
double b2mag,b3mag2,b3mag,ctmp,r12c1,c1mag,r12c2;
double c2mag,sc1,sc2,s1,s12,c,p,pd,a,a11,a22;
double a33,a12,a13,a23,sx2,sy2,sz2;
double s2,sin2;
int i1, i2, i3, i4, n, type;
double vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, vb3x, vb3y, vb3z, vb2xm, vb2ym, vb2zm;
double edihedral, f1[3], f2[3], f3[3], f4[3];
double sb1, sb2, sb3, rb1, rb3, c0, b1mag2, b1mag, b2mag2;
double b2mag, b3mag2, b3mag, ctmp, r12c1, c1mag, r12c2;
double c2mag, sc1, sc2, s1, s12, c, p, pd, a, a11, a22;
double a33, a12, a13, a23, sx2, sy2, sz2;
double s2, sin2;
edihedral = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -107,53 +106,52 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
// c0 calculation
sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
sb1 = 1.0 / (vb1x * vb1x + vb1y * vb1y + vb1z * vb1z);
sb2 = 1.0 / (vb2x * vb2x + vb2y * vb2y + vb2z * vb2z);
sb3 = 1.0 / (vb3x * vb3x + vb3y * vb3y + vb3z * vb3z);
rb1 = sqrt(sb1);
rb3 = sqrt(sb3);
c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * rb1 * rb3;
// 1st and 2nd angle
b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
b1mag2 = vb1x * vb1x + vb1y * vb1y + vb1z * vb1z;
b1mag = sqrt(b1mag2);
b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
b2mag2 = vb2x * vb2x + vb2y * vb2y + vb2z * vb2z;
b2mag = sqrt(b2mag2);
b3mag2 = vb3x*vb3x + vb3y*vb3y + vb3z*vb3z;
b3mag2 = vb3x * vb3x + vb3y * vb3y + vb3z * vb3z;
b3mag = sqrt(b3mag2);
ctmp = vb1x*vb2x + vb1y*vb2y + vb1z*vb2z;
r12c1 = 1.0 / (b1mag*b2mag);
ctmp = vb1x * vb2x + vb1y * vb2y + vb1z * vb2z;
r12c1 = 1.0 / (b1mag * b2mag);
c1mag = ctmp * r12c1;
ctmp = vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z;
r12c2 = 1.0 / (b2mag*b3mag);
ctmp = vb2xm * vb3x + vb2ym * vb3y + vb2zm * vb3z;
r12c2 = 1.0 / (b2mag * b3mag);
c2mag = ctmp * r12c2;
// cos and sin of 2 angles and final c
sin2 = MAX(1.0 - c1mag*c1mag,0.0);
sin2 = MAX(1.0 - c1mag * c1mag, 0.0);
sc1 = sqrt(sin2);
if (sc1 < SMALL) sc1 = SMALL;
sc1 = 1.0/sc1;
sc1 = 1.0 / sc1;
sin2 = MAX(1.0 - c2mag*c2mag,0.0);
sin2 = MAX(1.0 - c2mag * c2mag, 0.0);
sc2 = sqrt(sin2);
if (sc2 < SMALL) sc2 = SMALL;
sc2 = 1.0/sc2;
sc2 = 1.0 / sc2;
s1 = sc1 * sc1;
s2 = sc2 * sc2;
s12 = sc1 * sc2;
c = (c0 + c1mag*c2mag) * s12;
c = (c0 + c1mag * c2mag) * s12;
// error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE))
problem(FLERR, i1, i2, i3, i4);
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) problem(FLERR, i1, i2, i3, i4);
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -162,36 +160,36 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
// p = sum (i=1,5) a_i * c**(i-1)
// pd = dp/dc
p = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] + c*a5[type])));
pd = a2[type] + c*(2.0*a3[type] + c*(3.0*a4[type] + c*4.0*a5[type]));
p = a1[type] + c * (a2[type] + c * (a3[type] + c * (a4[type] + c * a5[type])));
pd = a2[type] + c * (2.0 * a3[type] + c * (3.0 * a4[type] + c * 4.0 * a5[type]));
if (eflag) edihedral = p;
a = pd;
c = c * a;
s12 = s12 * a;
a11 = c*sb1*s1;
a22 = -sb2 * (2.0*c0*s12 - c*(s1+s2));
a33 = c*sb3*s2;
a12 = -r12c1*(c1mag*c*s1 + c2mag*s12);
a13 = -rb1*rb3*s12;
a23 = r12c2*(c2mag*c*s2 + c1mag*s12);
a11 = c * sb1 * s1;
a22 = -sb2 * (2.0 * c0 * s12 - c * (s1 + s2));
a33 = c * sb3 * s2;
a12 = -r12c1 * (c1mag * c * s1 + c2mag * s12);
a13 = -rb1 * rb3 * s12;
a23 = r12c2 * (c2mag * c * s2 + c1mag * s12);
sx2 = a12*vb1x + a22*vb2x + a23*vb3x;
sy2 = a12*vb1y + a22*vb2y + a23*vb3y;
sz2 = a12*vb1z + a22*vb2z + a23*vb3z;
sx2 = a12 * vb1x + a22 * vb2x + a23 * vb3x;
sy2 = a12 * vb1y + a22 * vb2y + a23 * vb3y;
sz2 = a12 * vb1z + a22 * vb2z + a23 * vb3z;
f1[0] = a11*vb1x + a12*vb2x + a13*vb3x;
f1[1] = a11*vb1y + a12*vb2y + a13*vb3y;
f1[2] = a11*vb1z + a12*vb2z + a13*vb3z;
f1[0] = a11 * vb1x + a12 * vb2x + a13 * vb3x;
f1[1] = a11 * vb1y + a12 * vb2y + a13 * vb3y;
f1[2] = a11 * vb1z + a12 * vb2z + a13 * vb3z;
f2[0] = -sx2 - f1[0];
f2[1] = -sy2 - f1[1];
f2[2] = -sz2 - f1[2];
f4[0] = a13*vb1x + a23*vb2x + a33*vb3x;
f4[1] = a13*vb1y + a23*vb2y + a33*vb3y;
f4[2] = a13*vb1z + a23*vb2z + a33*vb3z;
f4[0] = a13 * vb1x + a23 * vb2x + a33 * vb3x;
f4[1] = a13 * vb1y + a23 * vb2y + a33 * vb3y;
f4[2] = a13 * vb1z + a23 * vb2z + a33 * vb3z;
f3[0] = sx2 - f4[0];
f3[1] = sy2 - f4[1];
@ -224,8 +222,8 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb1x, vb1y, vb1z, vb2x,
vb2y, vb2z, vb3x, vb3y, vb3z);
}
}
@ -234,16 +232,16 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
void DihedralMultiHarmonic::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
const int np1 = atom->ndihedraltypes + 1;
memory->create(a1,n+1,"dihedral:a1");
memory->create(a2,n+1,"dihedral:a2");
memory->create(a3,n+1,"dihedral:a3");
memory->create(a4,n+1,"dihedral:a4");
memory->create(a5,n+1,"dihedral:a5");
memory->create(a1, np1, "dihedral:a1");
memory->create(a2, np1, "dihedral:a2");
memory->create(a3, np1, "dihedral:a3");
memory->create(a4, np1, "dihedral:a4");
memory->create(a5, np1, "dihedral:a5");
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "dihedral:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -252,17 +250,17 @@ void DihedralMultiHarmonic::allocate()
void DihedralMultiHarmonic::coeff(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (narg != 6) error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
double a1_one = utils::numeric(FLERR,arg[1],false,lmp);
double a2_one = utils::numeric(FLERR,arg[2],false,lmp);
double a3_one = utils::numeric(FLERR,arg[3],false,lmp);
double a4_one = utils::numeric(FLERR,arg[4],false,lmp);
double a5_one = utils::numeric(FLERR,arg[5],false,lmp);
double a1_one = utils::numeric(FLERR, arg[1], false, lmp);
double a2_one = utils::numeric(FLERR, arg[2], false, lmp);
double a3_one = utils::numeric(FLERR, arg[3], false, lmp);
double a4_one = utils::numeric(FLERR, arg[4], false, lmp);
double a5_one = utils::numeric(FLERR, arg[5], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -275,7 +273,7 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -284,11 +282,11 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg)
void DihedralMultiHarmonic::write_restart(FILE *fp)
{
fwrite(&a1[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&a2[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&a3[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&a4[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&a5[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&a1[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&a2[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&a3[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&a4[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&a5[1], sizeof(double), atom->ndihedraltypes, fp);
}
/* ----------------------------------------------------------------------
@ -300,17 +298,17 @@ void DihedralMultiHarmonic::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR, &a1[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &a2[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &a3[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &a4[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &a5[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
}
MPI_Bcast(&a1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&a2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&a3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&a4[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&a5[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&a1[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&a2[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&a3[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&a4[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&a5[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
}
@ -322,5 +320,5 @@ void DihedralMultiHarmonic::read_restart(FILE *fp)
void DihedralMultiHarmonic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %g %g %g %g\n",i,a1[i],a2[i],a3[i],a4[i],a5[i]);
fprintf(fp, "%d %g %g %g %g %g\n", i, a1[i], a2[i], a3[i], a4[i], a5[i]);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -29,13 +28,13 @@
using namespace LAMMPS_NS;
#define TOLERANCE 0.05
#define SMALL 0.001
#define SMALLER 0.00001
static constexpr double TOLERANCE = 0.05;
static constexpr double SMALL = 0.001;
static constexpr double SMALLER = 0.00001;
/* ---------------------------------------------------------------------- */
DihedralOPLS::DihedralOPLS(LAMMPS *lmp) : Dihedral(lmp)
DihedralOPLS::DihedralOPLS(LAMMPS *_lmp) : Dihedral(_lmp)
{
writedata = 1;
}
@ -57,17 +56,17 @@ DihedralOPLS::~DihedralOPLS()
void DihedralOPLS::compute(int eflag, int vflag)
{
int i1,i2,i3,i4,n,type;
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
double edihedral,f1[3],f2[3],f3[3],f4[3];
double sb1,sb2,sb3,rb1,rb3,c0,b1mag2,b1mag,b2mag2;
double b2mag,b3mag2,b3mag,ctmp,r12c1,c1mag,r12c2;
double c2mag,sc1,sc2,s1,s12,c,p,pd,a,a11,a22;
double a33,a12,a13,a23,sx2,sy2,sz2;
double s2,cx,cy,cz,cmag,dx,phi,si,siinv,sin2;
int i1, i2, i3, i4, n, type;
double vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, vb3x, vb3y, vb3z, vb2xm, vb2ym, vb2zm;
double edihedral, f1[3], f2[3], f3[3], f4[3];
double sb1, sb2, sb3, rb1, rb3, c0, b1mag2, b1mag, b2mag2;
double b2mag, b3mag2, b3mag, ctmp, r12c1, c1mag, r12c2;
double c2mag, sc1, sc2, s1, s12, c, p, pd, a, a11, a22;
double a33, a12, a13, a23, sx2, sy2, sz2;
double s2, cx, cy, cz, cmag, dx, phi, si, siinv, sin2;
edihedral = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -107,59 +106,58 @@ void DihedralOPLS::compute(int eflag, int vflag)
// c0 calculation
sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
sb1 = 1.0 / (vb1x * vb1x + vb1y * vb1y + vb1z * vb1z);
sb2 = 1.0 / (vb2x * vb2x + vb2y * vb2y + vb2z * vb2z);
sb3 = 1.0 / (vb3x * vb3x + vb3y * vb3y + vb3z * vb3z);
rb1 = sqrt(sb1);
rb3 = sqrt(sb3);
c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * rb1 * rb3;
// 1st and 2nd angle
b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
b1mag2 = vb1x * vb1x + vb1y * vb1y + vb1z * vb1z;
b1mag = sqrt(b1mag2);
b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
b2mag2 = vb2x * vb2x + vb2y * vb2y + vb2z * vb2z;
b2mag = sqrt(b2mag2);
b3mag2 = vb3x*vb3x + vb3y*vb3y + vb3z*vb3z;
b3mag2 = vb3x * vb3x + vb3y * vb3y + vb3z * vb3z;
b3mag = sqrt(b3mag2);
ctmp = vb1x*vb2x + vb1y*vb2y + vb1z*vb2z;
r12c1 = 1.0 / (b1mag*b2mag);
ctmp = vb1x * vb2x + vb1y * vb2y + vb1z * vb2z;
r12c1 = 1.0 / (b1mag * b2mag);
c1mag = ctmp * r12c1;
ctmp = vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z;
r12c2 = 1.0 / (b2mag*b3mag);
ctmp = vb2xm * vb3x + vb2ym * vb3y + vb2zm * vb3z;
r12c2 = 1.0 / (b2mag * b3mag);
c2mag = ctmp * r12c2;
// cos and sin of 2 angles and final c
sin2 = MAX(1.0 - c1mag*c1mag,0.0);
sin2 = MAX(1.0 - c1mag * c1mag, 0.0);
sc1 = sqrt(sin2);
if (sc1 < SMALL) sc1 = SMALL;
sc1 = 1.0/sc1;
sc1 = 1.0 / sc1;
sin2 = MAX(1.0 - c2mag*c2mag,0.0);
sin2 = MAX(1.0 - c2mag * c2mag, 0.0);
sc2 = sqrt(sin2);
if (sc2 < SMALL) sc2 = SMALL;
sc2 = 1.0/sc2;
sc2 = 1.0 / sc2;
s1 = sc1 * sc1;
s2 = sc2 * sc2;
s12 = sc1 * sc2;
c = (c0 + c1mag*c2mag) * s12;
c = (c0 + c1mag * c2mag) * s12;
cx = vb1y*vb2z - vb1z*vb2y;
cy = vb1z*vb2x - vb1x*vb2z;
cz = vb1x*vb2y - vb1y*vb2x;
cmag = sqrt(cx*cx + cy*cy + cz*cz);
dx = (cx*vb3x + cy*vb3y + cz*vb3z)/cmag/b3mag;
cx = vb1y * vb2z - vb1z * vb2y;
cy = vb1z * vb2x - vb1x * vb2z;
cz = vb1x * vb2y - vb1y * vb2x;
cmag = sqrt(cx * cx + cy * cy + cz * cz);
dx = (cx * vb3x + cy * vb3y + cz * vb3z) / cmag / b3mag;
// error check
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE))
problem(FLERR, i1, i2, i3, i4);
if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) problem(FLERR, i1, i2, i3, i4);
if (c > 1.0) c = 1.0;
if (c < -1.0) c = -1.0;
@ -172,40 +170,40 @@ void DihedralOPLS::compute(int eflag, int vflag)
if (dx < 0.0) phi *= -1.0;
si = sin(phi);
if (fabs(si) < SMALLER) si = SMALLER;
siinv = 1.0/si;
siinv = 1.0 / si;
p = k1[type]*(1.0 + c) + k2[type]*(1.0 - cos(2.0*phi)) +
k3[type]*(1.0 + cos(3.0*phi)) + k4[type]*(1.0 - cos(4.0*phi)) ;
pd = k1[type] - 2.0*k2[type]*sin(2.0*phi)*siinv +
3.0*k3[type]*sin(3.0*phi)*siinv - 4.0*k4[type]*sin(4.0*phi)*siinv;
p = k1[type] * (1.0 + c) + k2[type] * (1.0 - cos(2.0 * phi)) +
k3[type] * (1.0 + cos(3.0 * phi)) + k4[type] * (1.0 - cos(4.0 * phi));
pd = k1[type] - 2.0 * k2[type] * sin(2.0 * phi) * siinv +
3.0 * k3[type] * sin(3.0 * phi) * siinv - 4.0 * k4[type] * sin(4.0 * phi) * siinv;
if (eflag) edihedral = p;
a = pd;
c = c * a;
s12 = s12 * a;
a11 = c*sb1*s1;
a22 = -sb2 * (2.0*c0*s12 - c*(s1+s2));
a33 = c*sb3*s2;
a12 = -r12c1 * (c1mag*c*s1 + c2mag*s12);
a13 = -rb1*rb3*s12;
a23 = r12c2 * (c2mag*c*s2 + c1mag*s12);
a11 = c * sb1 * s1;
a22 = -sb2 * (2.0 * c0 * s12 - c * (s1 + s2));
a33 = c * sb3 * s2;
a12 = -r12c1 * (c1mag * c * s1 + c2mag * s12);
a13 = -rb1 * rb3 * s12;
a23 = r12c2 * (c2mag * c * s2 + c1mag * s12);
sx2 = a12*vb1x + a22*vb2x + a23*vb3x;
sy2 = a12*vb1y + a22*vb2y + a23*vb3y;
sz2 = a12*vb1z + a22*vb2z + a23*vb3z;
sx2 = a12 * vb1x + a22 * vb2x + a23 * vb3x;
sy2 = a12 * vb1y + a22 * vb2y + a23 * vb3y;
sz2 = a12 * vb1z + a22 * vb2z + a23 * vb3z;
f1[0] = a11*vb1x + a12*vb2x + a13*vb3x;
f1[1] = a11*vb1y + a12*vb2y + a13*vb3y;
f1[2] = a11*vb1z + a12*vb2z + a13*vb3z;
f1[0] = a11 * vb1x + a12 * vb2x + a13 * vb3x;
f1[1] = a11 * vb1y + a12 * vb2y + a13 * vb3y;
f1[2] = a11 * vb1z + a12 * vb2z + a13 * vb3z;
f2[0] = -sx2 - f1[0];
f2[1] = -sy2 - f1[1];
f2[2] = -sz2 - f1[2];
f4[0] = a13*vb1x + a23*vb2x + a33*vb3x;
f4[1] = a13*vb1y + a23*vb2y + a33*vb3y;
f4[2] = a13*vb1z + a23*vb2z + a33*vb3z;
f4[0] = a13 * vb1x + a23 * vb2x + a33 * vb3x;
f4[1] = a13 * vb1y + a23 * vb2y + a33 * vb3y;
f4[2] = a13 * vb1z + a23 * vb2z + a33 * vb3z;
f3[0] = sx2 - f4[0];
f3[1] = sy2 - f4[1];
@ -238,8 +236,8 @@ void DihedralOPLS::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb1x, vb1y, vb1z, vb2x,
vb2y, vb2z, vb3x, vb3y, vb3z);
}
}
@ -248,15 +246,15 @@ void DihedralOPLS::compute(int eflag, int vflag)
void DihedralOPLS::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
const int np1 = atom->ndihedraltypes + 1;
memory->create(k1,n+1,"dihedral:k1");
memory->create(k2,n+1,"dihedral:k2");
memory->create(k3,n+1,"dihedral:k3");
memory->create(k4,n+1,"dihedral:k4");
memory->create(k1, np1, "dihedral:k1");
memory->create(k2, np1, "dihedral:k2");
memory->create(k3, np1, "dihedral:k3");
memory->create(k4, np1, "dihedral:k4");
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, np1, "dihedral:setflag");
for (int i = 1; i < np1; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -265,30 +263,30 @@ void DihedralOPLS::allocate()
void DihedralOPLS::coeff(int narg, char **arg)
{
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR, "Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error);
double k1_one = utils::numeric(FLERR,arg[1],false,lmp);
double k2_one = utils::numeric(FLERR,arg[2],false,lmp);
double k3_one = utils::numeric(FLERR,arg[3],false,lmp);
double k4_one = utils::numeric(FLERR,arg[4],false,lmp);
double k1_one = utils::numeric(FLERR, arg[1], false, lmp);
double k2_one = utils::numeric(FLERR, arg[2], false, lmp);
double k3_one = utils::numeric(FLERR, arg[3], false, lmp);
double k4_one = utils::numeric(FLERR, arg[4], false, lmp);
// store 1/2 factor with prefactor
int count = 0;
for (int i = ilo; i <= ihi; i++) {
k1[i] = 0.5*k1_one;
k2[i] = 0.5*k2_one;
k3[i] = 0.5*k3_one;
k4[i] = 0.5*k4_one;
k1[i] = 0.5 * k1_one;
k2[i] = 0.5 * k2_one;
k3[i] = 0.5 * k3_one;
k4[i] = 0.5 * k4_one;
setflag[i] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -297,10 +295,10 @@ void DihedralOPLS::coeff(int narg, char **arg)
void DihedralOPLS::write_restart(FILE *fp)
{
fwrite(&k1[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&k2[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&k3[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&k4[1],sizeof(double),atom->ndihedraltypes,fp);
fwrite(&k1[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&k2[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&k3[1], sizeof(double), atom->ndihedraltypes, fp);
fwrite(&k4[1], sizeof(double), atom->ndihedraltypes, fp);
}
/* ----------------------------------------------------------------------
@ -312,15 +310,15 @@ void DihedralOPLS::read_restart(FILE *fp)
allocate();
if (comm->me == 0) {
utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error);
utils::sfread(FLERR, &k1[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &k2[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &k3[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
utils::sfread(FLERR, &k4[1], sizeof(double), atom->ndihedraltypes, fp, nullptr, error);
}
MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k4[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
MPI_Bcast(&k1[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&k2[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&k3[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
MPI_Bcast(&k4[1], atom->ndihedraltypes, MPI_DOUBLE, 0, world);
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
}
@ -332,6 +330,5 @@ void DihedralOPLS::read_restart(FILE *fp)
void DihedralOPLS::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++)
fprintf(fp,"%d %g %g %g %g\n",i,2.0*k1[i],2.0*k2[i],2.0*k3[i],2.0*k4[i]);
fprintf(fp, "%d %g %g %g %g\n", i, 2.0 * k1[i], 2.0 * k2[i], 2.0 * k3[i], 2.0 * k4[i]);
}

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