xtalgrowth: 2-dimensional simulation of crystal growth

xtalgrowth is an X application which simulate crystal growth of 2-dimensional hard spheres. If you execute xtalgrowth, a window opens, hard spheres fall from random positions, and they stacks at the bottom of the window. You can adjust growth conditions with command line options. You will get calculated results as PostScript files from stdout (standard output) in a certification-like form as shown in Fig.1. xtalgrowth is suitable for demonstrations of computer simulations of materials science, for example, in museums or at open campus events.


$ xtalgrowth --help
$ xtalgrowth -d 0.033 -c 3
$ xtalgrowth -d 0.033 -c 2
$ xtalgrowth -d 0.015 -c 1
$ xtalgrowth -g 'Mr. Takeshi Nishimatsu' | lpr

Put certification.eps in the current directory to get a certification letter. certification.eps will be used as a title of the certification letter. Name of the guest given with -g option and today's date will also be on the certification letter. The string given with -g option will be also used as a seed for a pseudo random number generator.

If your printer cannot print xtalgrowth's output correctly, pipe it through gs(1) command:

$ xtalgrowth [OPTIONS...] | gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH - | lpr

If you cannot print xtalgrowth's output correctly with Mac OS X, use lpr with a -l option:

$ xtalgrowth [OPTIONS...] | lpr -l
Fig. 1 Cirtification-like calculated result from xtalgrowth. Guest's name and the date will be in the form.


Homepage and DOWNLOAD

Home page of xtalgrowth is http://loto.sourceforge.net/xtalgrowth/ . Latest tar.gz package (xtalgrowth-X.Y.Z.tar.gz) can be downloaded from http://sourceforge.net/projects/loto/files/xtalgrowth/ .

Compilation and installation

Requirements are

If you have all of them, You can generate src/xtalgrowth with

$ tar zxf xtalgrowth-X.Y.Z.tar.gz
$ cd xtalgrowth-X.Y.Z
$ ./configure
$ make

Test the executable

$ cd src
$ ./xtalgrowth --help
$ ./xtalgrowth

If you want to install /usr/local/bin/xtalgrowth,

$ sudo make install

In some 64 bit systems, you may get link errors like

/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.so when searching for -lX11

In this case, give some LDFLAGS in the configure step

$ ./configure LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib64"

For Mac OS X into which XQuartz is installed and/or popt is installed via MacPorsts, use

$ ./configure CPPFLAGS=-I/opt/X11/include LDFLAGS=-L/opt/X11/lib
$ ./configure CPPFLAGS='-I/opt/X11/include -I/opt/local/include' LDFLAGS='-L/opt/X11/lib -L/opt/local/lib'


Calculation conditions and results

Periodic boundary condition is employed for x-direction (width of the box). Collision detection of hard spheres is rough. This computational roughness results in defects of crystals.

It starts from periodic substrates. If diameter is tight, you will not get perfect stacking:

$ xtalgrowth -d 0.033333

You can give the diameter of hard spheres with ration to the box width. Loose diameter and slow falling velocity may result in perfect stacking:

$ xtalgrowth -d 0.033 -v 0.0001

You can change criterion of stacking with -c option from 3 to 1. If -c 3, hard spheres stops falling when it touches 3 other spheres:

$ xtalgrowth -d 0.033 -c 3

If -c 2, hard spheres stops falling when it touches 2 other spheres. Defects will be included in the crystal:

$ xtalgrowth -d 0.033 -c 2

If -c 1, you will get fractal structures (See Reference [1]):

$ xtalgrowth -d 0.01 -c 1

Name of the guest given with -g option will be used in the PostScript file of certification letter from STDOUT. The string given with -g option is also used to generate 2 positive integers by hashpjw.c. Using that two integers as seeds, uni64.c generate pseudo random numbers (See Reference [4,5]):

$ xtalgrowth -g 'Mr. Takeshi Nishimatsu' > takeshi.ps

You will get a help message with a "--help" option

$ xtalgrowth --help

if you compiled with the popt library.

Fig. 2. xtalgrowth is executed with 3 kinds of set of options. (a) -c 3 -d 0.033 -v 0.0004, (b) -c 2 -d 0.033 -v 0.0001, and (c) -c 1 -d 0.020 -v 0.0004.


Display this program with real models like Fig.2 and Fig.3.

Fig. 3. Model of 2-dimensional ballistic crystal. BB projectiles (diameter: 6 mm) in a pair of acrylic glasses.
Fig. 4. BB projectiles in a music CD case. A Japanese 10 yen coin besides.


[1] Jean-François Gouyet, Michel Rosso and Bernard Sapoval: "Fractal surfaces and interfaces" in the book of "Fractals and disordered systems" edited by Armin Bunde and Shlomo Havlin, pp. 229-261 (1991), ISBN:0-387-54070-9, Springer-Verlag New York.

[2] Lawrence Bragg and J. F. Nye: "A Dynamical Model of a Crystal Structure", Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, Vol. 190, No. 1023, pp. 474-481 (Sep. 9, 1947). You can get a free PDF of this article from doi:10.1098/rspa.1947.0089.

[3] Lawrence Bragg and W. M. Lomer: "A Dynamical Model of a Crystal Structure. II", Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, Vol. 196, No. 1045, pp. 171-181 (Mar. 22, 1949). You can get a free PDF of this article from doi:10.1098/rspa.1949.0022.

[4] Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman: "Compilers: Principles, Techniques, and Tools" (1986), ISBN:0-201-10088-6, Addison Wesley, a.k.a. the Dragon Book.

[5] George Marsaglia and Wai Wan Tsang: "The 64-bit universal RNG", Statistics & Probability Letters, Vol. 66, pp. 183-187 (15 January 2004), doi:10.1016/j.spl.2003.11.001. Note that a part of code in the bottom of p.186, "y=(8888*x)%65579;" should be replaced by "y=(8888*y)%65579;". Consequently, 5 values of "The correct output" in p.187 are incorrect. See http://sci4um.com/about16220-asc.html .

Author and COPYING

Author: Takeshi Nishimatsu (t-nissie{at}imr.tohoku.ac.jp)

Copyright © 2009-2014 by Takeshi Nishimatsu

xtalgrowth is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. You can copy, modify and redistribute xtalgrowth, but only under the conditions described in the GNU General Public License (the "GPL"). For more detail, see COPYING.


http://loto.sourceforge.net/xtalgrowth/ is hosted by SourceForge.net Logo .