diff --git a/GUIDE.md b/GUIDE.md index 90f462c..423134e 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -846,14 +846,16 @@ The number of charges and mesh dimension may be adjusted by the user, via nameli ## Cluster program The `cluster` program is self contained. It reads in a configuration of atomic positions -and produces a circular linked list for each cluster identified within it. +and produces a circular linked list for each cluster identified within the configuration. The best value of the critical separation `r_cl` depends on the particular physical system -being considered. The supplied default will, for a liquid-state Lennard-Jones configuration, -most likely identify almost all atoms as belonging to a single cluster, with at most -a few atoms being isolated on their own. However, this is unlikely to be the type of system -for which this analysis is useful. - -* Should we provide a more illuminating test case? +being considered. To illustrate, we have provided a file `cluster.inp` consisting of +_N_=256 atoms at low overall density, generated by a short quench from a disordered system +at high temperature to a low temperature inhomogeneous state (not yet at equilibrium). +This file should be copied into the working directory before running the program. +With the default value `r_cl`=1.5, six well-separated clusters should be identified. +The results in this case are moderately insensitive to the value of `r_cl`, but increasing +it above 3 includes all atoms in a single cluster, while reducing it below 1.15 will start to +separate isolated atoms into clusters of their own. ## Correlation function program The aim of the program `corfun` is to illustrate the direct method, and the FFT method, diff --git a/cluster.f90 b/cluster.f90 index 13df063..855bcff 100644 --- a/cluster.f90 +++ b/cluster.f90 @@ -25,7 +25,7 @@ PROGRAM cluster ! the software, you should not imply endorsement by the authors or publishers. ! !------------------------------------------------------------------------------------------------! - ! Reads an atomic configuration with periodic boundary conditions from cnf.inp + ! Reads an atomic configuration with periodic boundary conditions from cluster.inp ! Defines a cluster by a critical separation r_cl ! Value of r_cl read from standard input using a namelist nml ! Leave namelist empty to accept supplied default @@ -46,14 +46,14 @@ PROGRAM cluster INTEGER, DIMENSION(:), ALLOCATABLE :: list ! Linked list array (n) INTEGER, DIMENSION(:), ALLOCATABLE :: done ! Indicates assignment to cluster (n) - CHARACTER(len=7), PARAMETER :: filename = 'cnf.inp' - REAL :: r_cl, r_cl_sq, box - INTEGER :: ioerr, count, cluster_id - INTEGER :: i, j, k + CHARACTER(len=11), PARAMETER :: filename = 'cluster.inp' + REAL :: r_cl, r_cl_sq, box + INTEGER :: ioerr, count, cluster_id + INTEGER :: i, j, k NAMELIST /nml/ r_cl - r_cl = 1.1 ! default value + r_cl = 1.5 ! default value READ ( unit=input_unit, nml=nml, iostat=ioerr ) ! namelist input IF ( ioerr /= 0 ) THEN diff --git a/cluster.inp b/cluster.inp new file mode 100644 index 0000000..6cedb76 --- /dev/null +++ b/cluster.inp @@ -0,0 +1,258 @@ + 256 + 13.67980758 + 5.1668796632 6.3990417092 -5.4106741030 + 6.2073207958 2.2037194666 -0.9033980742 + -6.3597582027 5.9187040747 -5.1289510269 + 3.0450758539 2.5131426283 3.2466102120 + 6.8176490535 1.7297475370 -2.0680386737 + 5.6519556108 2.0330414840 -1.7853399080 + -0.4533630707 -4.2605958729 0.6110479221 + -2.8528202445 -1.5804945474 5.1172481678 + 6.4674804227 -6.0129163269 -6.3917424230 + -1.4521371822 4.2760843292 -2.0492247081 + 5.5009439836 -0.5926292529 -0.9776975406 + 3.3868450259 0.4854706303 -2.6365564740 + 5.9962938425 1.1981457309 -0.2397535659 + 0.0039205801 -2.5287330459 1.7682604598 + 5.2003034716 -0.6480184385 -2.1061303544 + 1.8738007413 0.3920123010 -4.0680552659 + -6.4585421912 0.8867850703 -2.5739488920 + -5.3769142713 -4.3783853732 5.8058334538 + 3.7751564656 1.9020486918 2.6577909891 + -5.5692885824 -1.6093932441 5.2734867437 + 0.3216542201 5.0782098436 -0.4083726512 + 4.9950089932 1.4942110965 -2.7856947344 + -0.3631599082 3.3922265802 -0.1984957367 + -2.7564950759 3.2819656469 -2.1822194780 + -1.9568091109 5.3372737154 -1.6755036661 + 0.0949852057 3.2181491716 -2.3564223043 + 1.3923610851 1.3854199906 -3.9383462059 + 0.0404782413 6.3168285156 -1.9620961066 + -6.3115244738 -4.8825304212 -4.8003091878 + 2.3437096364 -0.5341290425 -3.6888432841 + 1.7670366814 1.2029536845 -2.9269323776 + -5.5838508187 -6.0467354949 -2.4734191669 + 5.1962612441 1.6975449773 -0.8662373828 + 5.0637220106 2.2428409303 3.9817810060 + -5.3523686007 -5.1801718276 -2.9951718609 + -1.0208227412 2.8540903530 -0.8794086411 + 5.5704079421 1.9167211837 2.1030788780 + -5.0239201547 -1.0619871086 4.3306771054 + -1.1358927747 2.5934445483 -2.8198891060 + 6.2791215898 0.2941040601 -0.7312446107 + -5.8451839455 -4.2620858517 3.5718444845 + 6.3921682237 5.2024732885 -5.1473999002 + 2.6655739327 3.4639696690 4.0679785509 + -5.5299256083 -2.0352423793 4.2063660817 + 6.0609259564 2.5760972781 4.0132210701 + 0.0379771629 -2.3052868404 0.6560586113 + 6.7836018829 -5.0291310813 -3.8838669845 + 4.4720821375 3.9669314770 4.1073838788 + -2.1084917418 -3.1893078585 1.6463015587 + -1.9271769804 4.8699529976 -0.0210087170 + 6.7656115712 5.7806313086 -6.0987384164 + -5.9559699727 -6.3154771482 -6.2333207283 + -2.5685219983 3.5072314497 -3.3771002388 + -6.0757088800 6.6447283403 -4.0864061297 + -4.9223306688 -3.6551951294 5.0544465445 + 6.2421427898 3.9839189752 1.4227337786 + 5.7653094300 5.5086254387 -5.9885471096 + -0.1580474216 -3.3021338123 0.9627805115 + 4.9823808323 6.3347488909 -6.5172269442 + -1.4404620499 -4.0224095888 2.0558544491 + -1.5372791074 -2.2548939867 1.9628912202 + 4.7445207487 3.1268561923 3.3187081550 + -6.5150312878 -5.8695126833 -5.3327511532 + 6.1494501267 -0.2670525840 -2.5706466116 + -0.4752448491 -4.1280937011 1.6597283999 + 6.1719169394 1.1908128080 -1.2828370373 + 3.8995996720 1.4361540529 -2.8864651489 + 4.6336209356 1.1532923223 3.7065708215 + 5.8143795148 3.5147689682 3.5637475684 + 3.3494118451 1.3565671844 -1.9249413576 + 6.4845752020 -0.6781312600 -1.5565980484 + 3.8274399143 2.9917358845 2.6104008755 + 4.6164749567 -0.0513321244 -1.4236997950 + 6.5358115406 5.9697661027 -4.2671486059 + 0.0117170475 3.0707911349 -1.2201581329 + 6.0212066408 -6.3109932176 -5.4019495057 + 0.7251176213 5.6687848743 -1.3575085024 + -5.6786814455 -3.2859290108 4.3797613218 + 4.3588633229 2.9115882038 4.4053179337 + -2.4205687672 -3.9005518970 2.4910636971 + 4.7360345003 2.6342738407 2.0482198538 + -4.6273228545 -2.7987382742 4.2715806476 + -0.8324262594 -4.8597135657 2.2822761365 + 4.3647039445 4.9144795485 3.4724774279 + -6.5060402894 -3.9588966760 4.5137857516 + 5.7496043863 6.7945893683 -4.4618304156 + 6.5723448468 -6.7699875140 -3.7355386886 + 4.1351182857 5.6102529334 2.5995693423 + 4.1544236034 3.9511665954 3.0374230297 + 5.0763817541 2.4803617909 5.1945850330 + 3.3659918831 1.5397999046 -4.6265484257 + 3.4662828570 -0.2447727568 -3.4126198916 + 5.5432619900 5.6101666025 -4.5749800817 + 5.1560350354 1.0383219940 -1.6973001544 + 3.4957838127 4.7792749220 2.7560584631 + 3.7019540592 3.2591527267 3.6766145720 + -0.6553984986 4.6296899933 -0.5013308728 + -1.5270960408 3.2827418438 -3.6677589083 + -1.0745281235 6.0538811106 -1.7580383212 + -6.6642293731 1.2178959104 -0.5941196018 + 1.2045249098 4.7634670824 -1.0758636837 + 5.7120505621 3.0489632557 1.6622965786 + -5.3518107516 -2.7157912819 5.2205833944 + -0.5830770994 -4.6574529105 3.3831656513 + 5.2706074525 5.2947036193 3.0589164774 + 0.8978612364 -3.0820137450 1.5297076035 + -2.9776045639 -0.6388428122 4.6691616828 + -2.5877934315 4.3643092284 -1.6075508672 + -6.5640313049 -4.0317481855 -1.9959115020 + -1.9785923558 -4.9314537670 2.1415293483 + -0.3972577105 5.8654088393 -0.9186231784 + 5.6247099463 4.5690373417 2.2129924891 + 0.5238313550 -4.1324088767 1.3244330492 + 5.0428947778 -6.2987828280 -4.8917514509 + 5.1929025027 4.2559691604 3.1839998909 + -1.1661582162 5.1380395817 -2.6338124399 + 0.1728638121 -3.4809673019 2.2173614567 + -0.1049373814 5.2541152377 -2.3800763177 + -5.9143149675 6.2316818122 -6.0725929044 + -4.8843706801 -4.8784335133 3.7274008522 + 4.2773921787 2.3597230109 -2.9731746312 + 2.6889040050 -0.3276254651 -2.5388209873 + 4.2551155020 0.9804358817 -1.0912378945 + 2.5426889972 0.4425593700 -3.3197882371 + 3.2260881926 2.3393912258 -2.5713674510 + 6.3527390745 -5.0346707351 -5.3104329846 + 5.2488234677 0.5627282240 -0.7388740978 + 5.3049310167 3.3783733763 4.5202605329 + -5.4732263713 -6.2228249094 -3.5473955078 + -0.6655900048 -1.6884619886 1.5834332292 + -6.3953651358 -5.9276240878 -4.1898099335 + 6.3795406674 4.5708526743 3.1066874472 + 0.0230665884 4.3791706573 0.3609095157 + 5.1397558778 4.0034895082 1.3640112216 + 6.5548405981 -4.8781667605 -2.7066962720 + 3.8390235920 3.8532672518 1.9883411040 + 4.4441291136 1.8292557598 -1.9464049269 + -1.3972212913 5.5417404376 -0.7667383943 + 2.1302541201 2.1536415594 -3.3867933941 + -6.8190541615 0.4533033150 -1.6965116321 + 4.3843117061 1.5284288176 -3.9260101917 + -3.6439239760 -2.3753822121 4.7147406752 + 6.2955202600 -5.8335947494 -3.3187746556 + -6.3422186641 -2.5497484637 4.8474162969 + -2.4983247032 4.0842599999 -0.4822647921 + -1.3824073559 4.2322080603 -3.2016865349 + -1.2583827595 -4.7335534749 1.2049374475 + -1.1561844565 4.4107873712 0.5126448490 + 0.1095077663 4.7765871298 -1.3938582805 + 3.4661609662 4.3594800451 3.8423534114 + -5.5358561046 -4.4308962162 4.6265392040 + 3.3875724310 2.0227187124 -3.5939522199 + -4.8058286799 -3.7908121238 3.8390350211 + 3.1071432275 3.7305290986 2.9421852364 + 5.8100003464 0.1921281359 -1.7014726528 + -0.6703090705 5.4013366857 0.2775383842 + -0.2326767104 -0.2358099799 -4.7918158850 + 2.8277509822 1.3706441802 -2.9127910737 + -6.1750223700 -4.5561935755 -3.2569568492 + 3.5951536814 0.1332244091 -1.6054283908 + 3.8466813760 2.6692312685 5.4314510572 + 4.9926201579 3.6473731420 2.3706293583 + -1.6942749946 4.5151891971 -1.0258305669 + 3.9957764358 2.2247569004 3.6557219783 + 5.5832683237 4.9932933411 1.1566318422 + -1.2321822982 -3.6324411643 0.9453409308 + -0.5896027260 3.5001391000 -3.1646854501 + 0.9609169585 0.1773640991 -4.5917262849 + -6.3503595451 6.7730218293 -3.0243704486 + -1.5048432059 3.6933111184 -0.3482771394 + 6.1115991247 3.6162380260 2.5400318606 + 0.4135210562 3.9986198727 -0.6564788584 + 0.6073790934 -2.5245216876 2.6419546446 + -4.5992606865 -1.9420965430 4.9352099508 + 1.7292153033 0.1109412064 -2.8097728265 + -0.9971495750 -2.5602085890 0.9479443327 + 0.2026583300 -0.3137014975 -3.6430389066 + 0.8193915879 -0.9402305383 -4.4776067990 + 1.2628608452 -0.3863590160 -3.6754924224 + -2.2335474518 -4.2576688004 1.3753429671 + 2.4737590054 1.2622261256 -4.0151078113 + 5.9580931774 6.5606747856 -6.2513447593 + -1.7518274805 3.4131650316 -2.5671716048 + -5.5650131710 -4.1792661563 -2.4831027259 + 5.0796476288 5.5210437705 1.9934742066 + -2.3796829839 4.2338110081 -2.6581795742 + -0.5258756962 -2.6204189838 2.7356977348 + 1.9725364440 -0.5482906629 -4.6975226854 + -1.8605891927 2.5428440630 -1.8609163855 + -4.4729590320 -4.6468111553 4.8304582669 + -0.3884140056 4.1620855080 -2.1766565531 + 0.7558238991 -0.3851753932 -2.6715890390 + 4.4480498013 4.8070871774 1.3246138461 + -0.1518121461 -1.1617325770 -4.1640023731 + 0.5072516255 4.1425949691 -2.7788567042 + -5.6865366459 -5.1026124782 -3.9971752288 + -5.8065377307 6.8233331873 -5.1782395223 + 6.1058309340 0.9392948693 -2.4444775304 + 2.7703689773 0.2234641738 -4.5419739839 + -0.8427210406 -3.1479321741 1.8432750380 + 5.7065654894 2.6675650347 2.9454557559 + -3.8213424225 -1.8934228346 5.6828335776 + 5.7530696679 1.5668673164 3.3724701704 + 4.2196585447 -0.2635323652 -2.4730315983 + 3.4975376631 3.6089750782 4.7455337579 + 1.6058904437 -1.3594947820 -3.8825474488 + 0.7062679682 -2.0580898832 -4.3186099711 + -6.7644464667 6.8324104616 -5.8095812255 + 2.2299936955 1.8580633537 -2.0247471837 + -2.2087659803 2.5522079105 -3.0288743296 + -1.8285382709 3.5302592193 -1.3902442428 + -4.1819700899 -0.2856250229 4.7221184173 + -3.8393384718 -1.3559826839 4.6258315218 + 4.8087989708 2.0057188058 2.9799628222 + 0.5490473611 -1.2574571404 -3.3262036998 + 4.1761906988 0.2254750185 -4.2692897082 + -0.6535720784 -3.8323309914 2.7374340998 + -4.6053171137 -1.0910420900 5.6106683524 + 0.9582391060 4.9916145880 -2.1568985915 + 4.3769045244 0.5797243640 -3.2686011269 + 5.9761150484 5.8522562460 6.6738569219 + -3.9858732918 -3.5905854014 4.5519400550 + -5.5294014564 -5.7426776067 -4.8351432091 + 0.2411045724 -4.4880345293 2.6464604407 + -6.1778270958 -5.1418461353 -2.2269616459 + 6.8398797197 -6.7805027603 -4.7495192917 + -0.9019423077 5.0083269477 -1.5235452106 + -0.8062078030 3.8608515195 -1.2182340369 + 5.1789891428 0.3621240374 -2.6416779678 + -2.6558286497 5.1304550783 -0.7876601422 + 3.4432389332 0.8981954543 -3.7581421685 + -4.2425995181 -2.9096491459 5.4306458763 + -6.8069538213 6.5593400577 6.8221523758 + -5.0760824159 -3.2832355271 6.0977653680 + -0.9063459693 3.1401579409 -1.9764092284 + 4.2593319524 0.7546145987 -2.1777778415 + 1.6521768508 -0.9286294985 -2.8539364197 + -6.3292320918 -5.6603235904 -3.1306778893 + -1.5745926423 -4.3923524059 3.0554456717 + 1.5485146290 -1.4863854869 -5.0410603721 + -1.5526690619 -3.1654904495 2.7148600679 + -6.7868680685 -6.0857072749 -2.2789180783 + -0.3660563979 4.5679028993 -3.2216949987 + 4.3051376015 1.8802193574 4.6574423767 + 2.4341302655 0.6925306738 -2.1230756182 + 6.1810135072 6.2410845107 -5.2807744860 + -6.0259525224 -3.4908483214 5.4119406124 + 4.5726305194 4.6621318804 2.3429816169 + -4.8625890886 -2.2146731960 5.9989380657 + 3.2053736710 2.4852064368 4.3974857636 + -3.6072518920 -0.7268314337 5.5434055368 + 5.3616178517 1.3791014672 4.4837463283 + 0.7813016935 3.9845400275 -1.7454121597 + 6.2439533441 -5.8678033002 -4.4454181212 + 0.8986946619 0.5516748267 -3.3040009778 + 4.5754019194 3.5699909444 5.2716639121 diff --git a/python_examples/cluster.py b/python_examples/cluster.py index 83f42f6..8404eb7 100755 --- a/python_examples/cluster.py +++ b/python_examples/cluster.py @@ -24,7 +24,7 @@ # the software, you should not imply endorsement by the authors or publishers. # #------------------------------------------------------------------------------------------------# -"""Identify atoms clusters in a configuration.""" +"""Identify atom clusters in a configuration.""" def in_range ( j, k ): """Returns True if pair, whose indices are supplied, is in range. @@ -51,7 +51,7 @@ def in_range ( j, k ): sys.exit() # Set default values, check keys and typecheck values -defaults = {"r_cl":1.1} +defaults = {"r_cl":1.5} for key, val in nml.items(): if key in defaults: assert type(val) == type(defaults[key]), key+" has the wrong type" @@ -65,7 +65,7 @@ def in_range ( j, k ): print ( "{:40}{:15.6f}".format('Cluster separation distance', r_cl) ) # Read in configuration -n, box, r = read_cnf_atoms('cnf.inp') +n, box, r = read_cnf_atoms('cluster.inp') print("{:40}{:15d} ".format('Number of particles', n)) print("{:40}{:15.6f}".format('Box (in sigma units)',box))