From 6b51bf104a3b19adee21ac1305f6ba6882cbfc1f Mon Sep 17 00:00:00 2001 From: Sam Cameron Date: Tue, 8 Dec 2020 14:52:28 +0000 Subject: [PATCH] Added unit test for fix bd/sphere. --- unittest/force-styles/tests/data.bdsphere | 86 +++++++++++++++++++ .../tests/fix-timestep-bd_sphere.yaml | 80 +++++++++++++++++ unittest/force-styles/tests/in.bdsphere | 16 ++++ 3 files changed, 182 insertions(+) create mode 100644 unittest/force-styles/tests/data.bdsphere create mode 100644 unittest/force-styles/tests/fix-timestep-bd_sphere.yaml create mode 100644 unittest/force-styles/tests/in.bdsphere diff --git a/unittest/force-styles/tests/data.bdsphere b/unittest/force-styles/tests/data.bdsphere new file mode 100644 index 0000000000..3fbad7d05e --- /dev/null +++ b/unittest/force-styles/tests/data.bdsphere @@ -0,0 +1,86 @@ +LAMMPS data file via write_data, version 30 Nov 2020, timestep = 120000 + +32 atoms +1 atom types + +-2.7144176165949063 2.7144176165949063 xlo xhi +-2.7144176165949063 2.7144176165949063 ylo yhi +-1.3572088082974532 1.3572088082974532 zlo zhi + +Masses + +1 1 + +Pair Coeffs # zero + +1 + +Atoms # hybrid + +1 1 0.8174385639059338 -1.5010271964354949 1.0637924298773633 0 0.6257069940596588 -0.111108944542851 -0.7721046302331049 1 1 -1 0 -1 +2 1 -1.5885878110813303 2.2401728691740113 0.47068930278928994 0 -0.5102593570021903 0.8585717488647711 -0.049899305035241655 1 1 0 -1 -1 +3 1 -1.1818944957014061 -2.6848623178033457 -1.1800939297629425 0 -0.004166477179696561 0.19766436575888424 0.9802609035236738 1 1 0 0 0 +4 1 0.1720589621174558 1.3643946759490944 -1.1522506184595422 0 0.11721568749368932 0.2990753541702089 -0.9470028590945996 1 1 0 -1 0 +5 1 -2.5038595242428823 -1.624930716630223 -1.1484315973168586 0 -0.3868419197154481 -0.6136739748888413 0.6883005024660352 1 1 0 0 0 +6 1 -1.2345478646498314 -0.3224402671532977 0.5533955773621407 0 0.24969915142093102 -0.15640101573329426 -0.9556092590893315 1 1 0 0 -1 +7 1 1.1946150666115714 0.4921384424233923 -0.516829526742452 0 0.0036359783326705107 -0.4590891155800383 -0.8883827798969893 1 1 0 0 -1 +8 1 1.8342027600045443 1.516095010832566 0.043843911607852545 0 -0.8435468778359277 0.11782686457134713 -0.5239708912511688 1 1 0 -1 -1 +9 1 -0.5406701027756321 2.23952568921304 0.5241488585364904 0 0.045872039042421424 0.13268297551853248 -0.9900964518882184 1 1 0 0 -1 +10 1 -0.3972258497968314 0.7566024687022016 -0.2323435643206888 0 0.655171514572036 -0.43050189344470563 0.6208207520966965 1 1 0 0 -1 +11 1 -0.7183933447005026 1.1587411649504586 0.20950093049531074 0 0.22933670283280452 -0.6843477395075139 -0.6921508854034168 1 1 0 0 -1 +12 1 1.022524253197315 0.17877446802634833 0.29899480569943504 0 0.6711103355965887 -0.41621190608313047 -0.6134969981100816 1 1 0 0 -2 +13 1 -1.4250800612966135 -2.4056565408365356 0.21801121763465003 0 -0.5029961497078136 0.46126362983367525 -0.7309108955076378 1 1 0 1 0 +14 1 -1.7432369014700662 1.621196939810902 0.07955801420882219 0 -0.7988534279257005 0.3194109740977685 -0.5097154405325315 1 1 0 0 -1 +15 1 -0.9908151496097626 -2.6488792381485773 -1.1948117198271224 0 0.5516163133238324 -0.6234158094772195 0.5541409309633126 1 1 0 1 0 +16 1 2.6948716697156523 0.41280900513864877 0.1548529904178103 0 -0.8512724888069316 0.23988291811633639 0.4666811924605956 1 1 0 0 -1 +17 1 -1.5494542712095147 -0.53420074244155 -0.6250925146711168 0 -0.07678144567993991 -0.03950496198488684 0.9962650087089635 1 1 0 0 0 +18 1 -2.3151948315996678 -2.6221617748715036 -0.1899804833264763 0 -0.7569384929404162 -0.33315612552157964 -0.562184234866597 1 1 0 0 0 +19 1 2.1590179665621467 1.6095466091914918 -1.2253859221608403 0 0.20879037375649698 -0.06905534931949565 0.9755193173674137 1 1 0 -1 0 +20 1 2.202409043221526 0.14395355359028536 1.335860415061412 0 -0.14984238844204667 -0.9847320173066201 0.08860086183112265 1 1 0 -1 -1 +21 1 -1.4500395490531754 -1.5281375693866057 0.00020797713894412338 0 -0.9915462127271186 0.08451237717795997 0.09845692525281326 1 1 0 0 0 +22 1 -1.0657362106538344 0.6350242518491277 -0.7513800843604899 0 -0.6569043427466144 -0.07223746743273625 0.7505054515321944 1 1 0 -1 0 +23 1 -0.5619632776222234 1.8699713384517294 -0.9467270322768698 0 0.7911745431454184 0.5177930983571434 -0.3254737310019788 1 1 0 0 0 +24 1 -2.1040517028343215 -2.247249268720423 0.11322260281322279 0 -0.04193441020358475 0.2313330374822751 -0.9719704373128341 1 1 1 0 -1 +25 1 -0.868354233492487 -0.14640654973697223 -0.9035771863161228 0 -0.15652971300701132 0.0848859275832726 -0.9840187133608133 1 1 0 0 0 +26 1 -0.4652717213714348 0.12334049868763304 -0.3826888902964762 0 0.6487662426744875 0.7578954080882759 0.06853402632804934 1 1 -1 0 -1 +27 1 -1.0478542019398558 2.3814414358320106 1.2039965288246885 0 0.10846325104076994 -0.6457073741173193 -0.7558423844851409 1 1 0 0 -1 +28 1 2.500698605198214 -0.728008572758278 0.48410831318342695 0 -0.3622892345018212 0.911584495321123 0.19431988692415955 1 1 0 0 -1 +29 1 -1.416084269787537 -1.7066588654378656 0.8328319180724224 0 -0.08971242415920104 -0.44687722085944426 0.8900856309526737 1 1 0 1 -1 +30 1 -0.6370519124977301 0.47113373856505564 -0.08549434306971403 0 -0.6030496979424049 -0.7976847581640081 -0.0054852898193420265 1 1 0 0 0 +31 1 0.8225325721319097 -0.441545584269452 0.3381678086542899 0 -0.6909877678544062 -0.7162885851668209 0.09729628685258002 1 1 0 0 0 +32 1 2.1861742760925518 1.5740929150306235 -0.01693950575830974 0 0.890366016527044 0.3247001065794207 0.3190896385047258 1 1 0 0 0 + +Velocities + +1 -524.6769664299819 215.42199277006424 -112.27005568908588 -462.03530876082846 -551.9512642384534 -196.46403300264745 +2 391.3416799472542 48.7957761872576 -623.1311508507263 489.33832403519347 -260.3072072833973 -529.7105564646685 +3 109.86388293585976 665.5499875054874 -583.4371492475789 -678.3137468561738 622.6210695594215 37.427168579931944 +4 398.4814329387423 -117.47798197974335 -376.25882363220865 44.966011242133156 -720.7197483734453 654.1933839835833 +5 584.5314601424474 159.82839534760055 -199.69054648577074 298.5492685852273 657.8565691587017 -616.4449676099423 +6 609.4975570025578 738.2439586459146 284.06966373218285 143.74329023895925 256.75048911205783 -57.96098774586574 +7 -27.968041606728725 752.3634409363073 223.6145040530379 -496.9033910070852 198.22198514310026 -81.32767873220877 +8 -451.1189781565461 -759.642533657806 547.0603381420482 316.5054412546416 669.7302717449263 -447.9786170711034 +9 -54.531235862640735 -115.1466962517251 -610.7279757582849 -731.9703465871636 -735.0301879611621 -584.8114323501295 +10 748.6292469789635 701.8693636792311 -498.1997398935133 208.99011146198362 -538.4269075676226 130.16593091403558 +11 -174.9453247974202 153.40962619436522 390.8158086666639 -381.20607659097726 548.6301954978544 225.4382939850729 +12 -393.58450479962613 562.7494007708912 -512.2495061493412 425.83486537187855 260.1521699032197 -605.409242525273 +13 294.0485676041469 -416.4803586200817 -678.9550420350499 284.48925268723156 -67.2753269810592 559.4386740115784 +14 -764.1287373972617 733.8169442814999 720.6030317274988 357.0913464046234 521.8205481343224 173.7714175822938 +15 -91.18940426263303 224.9036504882129 284.4326488075122 -207.62866349692237 501.5282881027212 445.99895870682315 +16 179.07740801693492 -535.4403834538152 -318.55850921823156 266.7175735768374 444.97898080245074 -381.12832705309194 +17 -428.2045641732463 -491.50884735767914 -270.6175162521197 727.5062118970601 128.20058511314278 270.88345291377027 +18 395.0795674693432 306.1681692632796 -13.216405710204159 671.3857274637012 102.79070644890297 322.4136674209789 +19 -203.6409986589429 -54.701509197392014 581.0635722032287 -186.75568274826543 476.4083542709755 -601.0363388843747 +20 -115.92502268264624 -762.0000436955148 -223.1167962036293 489.85643882981896 -247.41158767130918 -365.8330907652003 +21 658.7418242889948 586.715926671846 -624.8573383343708 -10.66175165422313 359.69577124554525 -340.2786090411881 +22 56.13036471905219 261.41167548131494 373.8653013382346 673.5607754029996 -245.8613985477709 353.0482780954667 +23 -252.99394908800596 -466.09490577221976 -670.846651689147 -616.9981712696467 -541.8114132827196 -369.70154580103025 +24 -627.059810991902 278.53716543954556 457.18418082455213 -101.65170342061822 225.64771910612274 649.9004460194175 +25 -542.388717452386 -105.31239543953356 69.1170307021082 -204.78231016519337 -522.3497436231834 -357.49930063072486 +26 -213.4605252121538 -534.3449644895232 244.1099101456221 275.4530388773477 212.2684271906576 -165.97485643999994 +27 595.2153731851414 626.5401264322599 -736.723964414168 -188.93350086112284 -459.44316502268424 -484.4606024327521 +28 -400.55444615195614 606.638183855102 121.6628831751137 359.49918126198475 668.2849798601502 -135.04633035091715 +29 -347.6624143232117 -365.7917228400548 -541.6372617049859 160.0398519292602 -624.5129134218859 -448.13097661684066 +30 -104.98117502101249 500.1388613847156 731.4317325082025 -481.0858846642298 -574.8809141763269 122.21267028742885 +31 754.8558584263326 -34.937336585228245 -726.0948084688208 -103.81133072710576 431.8053281041717 -479.89267857331 +32 140.02839515740888 643.0847109951975 -535.5893264521633 -373.10470401809016 -661.5529040774077 37.5722333352976 diff --git a/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml new file mode 100644 index 0000000000..66a65bc3ba --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-bd_sphere.yaml @@ -0,0 +1,80 @@ +--- +lammps_version: 24 Aug 2020 +date_generated: Tue Dec 08 12:28:40 2020 +epsilon: 1e-12 +prerequisites: ! | + atom hybrid dipole sphere + fix bd_sphere +pre_commands: ! "" +post_commands: ! | + fix test solute bd_sphere 1.0 1.0 1.0 1.0 1049270 + fix_modify test virial yes +input_file: in.bdsphere +natoms: 32 +run_pos: ! |2 +1 0.8198132185477983 -1.5120221815010249 1.069236010215717 +2 -1.583657719347759 2.2448791290372445 0.48185576252150486 +3 -1.1880610036164596 -2.678219122115848 -1.1824396130063375 +4 0.1908794667962731 1.3593710068293134 -1.1524405138570022 +5 -2.502067366922716 -1.6291621715156412 -1.155308629818198 +6 -1.214213515524568 -0.33667539680264325 0.5468489960944642 +7 1.2020658999364164 0.5045561046001554 -0.5265404283266816 +8 1.8138899397447894 1.5212405777462397 0.04943268689972926 +9 -0.547736141448719 2.2385521615789026 0.5146647473679599 +10 -0.38821952892982114 0.7570899758491753 -0.23554333362488367 +11 -0.7101567507222957 1.1587573566149103 0.19674801175715137 +12 1.0217947252204158 0.1732739652383159 0.3064332055619567 +13 -1.43254480550968 -2.4145346257525504 0.22508495277327453 +14 -1.7469141674373843 1.605802890508775 0.07604534549063337 +15 -0.9840165887382163 -2.631709004347024 -1.1933270065258215 +16 2.6947076505094056 0.4027838910781582 0.16197472527708037 +17 -1.553343026077184 -0.5326249015108566 -0.6372569894483383 +18 -2.32697929027452 -2.6229660088889384 -0.1908463010722981 +19 2.161025566743724 1.613342829181601 -1.2185964188334404 +20 2.200299550516107 0.13388691832171218 1.3492239308384593 +21 -1.444652156145116 -1.5251851082502694 -0.01486082239207267 +22 -1.069098522661769 0.6345737477571621 -0.7476592232484849 +23 -0.5530156382651018 1.8581482829486815 -0.9359906503001887 +24 -2.1057002294256346 -2.2411635326026076 0.1027461222133986 +25 -0.846470575235486 -0.16100145290710122 -0.8945542130124591 +26 -0.4600833044897612 0.1168099650353831 -0.3780372490219117 +27 -1.0507601010756238 2.380597031527799 1.2042435415073673 +28 2.4951223446270854 -0.7272384746662179 0.49148118274363145 +29 -1.4227701815513125 -1.7103131555856865 0.8522428843219197 +30 -0.6362527497446904 0.4809930863631752 -0.09023977411046079 +31 0.8307577317570568 -0.43366523738108803 0.3435388363003548 +32 2.193071783870056 1.5720818983016567 -0.002617308630618007 +run_vel: ! |2 +1 -199.33264006196603 -425.90458140644324 687.4446082626521 +2 -437.96841023792416 91.79431782876951 428.57844526457393 +3 256.4136360073004 753.6546188320922 -477.2093961250793 +4 566.9823183079484 -598.4626629699561 -572.6010613373849 +5 193.3673483203161 517.2757090545375 86.71381952181962 +6 330.2395000638781 -14.096120493379578 -736.8264608358458 +7 772.6058378438489 335.4342218605717 -492.47120565202727 +8 -379.69346948872095 328.07026948905315 212.8907928502149 +9 -32.22616772317161 520.1349898628745 -354.5179475075607 +10 1.0828608441585152 -152.03654350035677 -287.63229160711455 +11 -8.398427517515586 462.54972999070884 -696.8949630195855 +12 -35.97938353895289 590.1362599649709 750.3193298672243 +13 -738.0063700936831 2.1036698005985586 521.0581963709241 +14 734.7145728536893 -576.3310076952716 -212.8973489276375 +15 462.14962458969075 517.8011186395346 582.1970348843957 +16 579.8864331189503 -723.7080269305067 -397.93358494791835 +17 -74.75036331228799 -271.6937286797369 318.88308122021147 +18 -390.80278885093725 -625.5459111419849 -678.090840223804 +19 -598.6933260882906 41.7579655827356 750.013779723682 +20 158.9763823000137 310.0053213378944 226.83667759758563 +21 -578.1763126419472 755.241466585726 -387.1851268613029 +22 -686.649568451259 496.2326396493665 -392.30182210275524 +23 139.72339904857833 686.4901911325059 460.94182891802774 +24 625.6387119562066 -178.79780516572728 194.63377933230842 +25 761.5753760889415 -550.6374632586046 -355.3666363468769 +26 -167.9925585211552 -748.0176849962858 537.6949353742531 +27 -687.973065038564 -637.3675344653028 -231.07938308121751 +28 -480.2313784604401 372.9809695991278 24.972745276651647 +29 67.21410614540838 54.58636231646205 639.3712010004265 +30 -469.9090654062959 715.7242943947524 -386.21519675922724 +31 -380.59017466972404 487.7214660680053 177.24466119039292 +32 138.31144158562722 31.005629253137737 621.8772779588675 +... diff --git a/unittest/force-styles/tests/in.bdsphere b/unittest/force-styles/tests/in.bdsphere new file mode 100644 index 0000000000..1fb583f51d --- /dev/null +++ b/unittest/force-styles/tests/in.bdsphere @@ -0,0 +1,16 @@ +variable newton_pair index on +variable newton_bond index on +variable units index lj +variable input_dir index . +variable data_file index ${input_dir}/data.bdsphere +variable pair_style index 'zero 8.0' + +atom_style hybrid dipole sphere +atom_modify map array +neigh_modify delay 2 every 2 check no +units ${units} +timestep 0.00001 +newton ${newton_pair} ${newton_bond} + +pair_style ${pair_style} +read_data ${data_file}