Skip to content
Marcin Wojdyr edited this page Mar 26, 2015 · 13 revisions

monocryst.py

Generates monocrystal in PBC (but the description below is also relevant to generating bicrystals.)

Out of box supports Fe (bcc), Cu (fcc), NaCl, Si and diamond (both have the diamond structure), SiC (zinc blende, wurtzite or any polytype specified by a sequence of letters). Other systems can be easily added in the get_named_lattice() function.

Generate Si crystal with the size equal or larger than 2nm x 2nm x 3nm:

monocryst.py si 2 2 3 output.cfg

img/Si-223.png

Option --margin generates a cuboid in PBC, by padding the monocrystal with vacuum (of course it's not a monocrystal anymore):

monocryst.py --margin=1 NaCl 4 4 4 nacl.cfg

http://gosam.googlecode.com/svn/wiki/nacl-cubes.png

All the three pictures present the same configuration, shifted under PBC. The command above generates the system in the left picture. With the additional --center-zero option, the center of the configuration is exactly at (0,0,0), like in the middle picture. In AtomEye program, it is possible to shift the view under PBC, using mouse. If your visualization program cannot do this and you want to see the cube in one piece, you may use a program from the debyer toolset:

# shift the system by half of the PBC in x, y and z directions.
dbr_extend -r -S0.5,0.5,0.5 -i nacl.cfg

Having a configuration with the center at or near (0,0,0) makes mathematic calculations easier. For example, command

mdfile.py --prefer-negative --filter='abs(x)+abs(y)+abs(z) < 20' nacl.cfg nacl-oct.cfg

makes octahedron. The --prefer-negative option changes the internal processing of the coordinates: they are mapped to the (-H/2, H/2) range, instead of (0, H), where H is the PBC box size.

http://gosam.googlecode.com/svn/wiki/nacl-oct.png

csl.py

Info about coincident site lattice (CSL) grain boundaries in cubic crystals. Shows usage instructions when called without arguments.

Example. Print angle of rotation for Σ=5 grain boundary with the [001] axis of rotation:

$ ./csl.py 001 5
m= 3  n= 1  36.870
m= 2  n= 1  53.130
m= 1  n= 2 126.870
m= 1  n= 3 143.130

bicrystal.py

Generates bicrystals. This script has been used to generate only symmetric tilt and twist GBs in cubic systems. Nonetheless, it has a lot of options. Running the script without any parameters prints help (but the help is not complete).

Example 1

Generate diamond bicrystal:

  • rotation axis [100],
  • median plane (011), i.e. its a tilt boundary,
  • Σ=13 (pick the lowest rotation angle for Σ=13),
  • min. dimensions: 0.8 x 0.8 x 3 nm,
  • do not adjust z dimension
  • add 1.0nm vacuum in z dimension
  • if two atoms are in a distance smaller than 0.5, remove one of them
bicrystal.py 100 m011 13 0.8 0.8 3 nozfit remove:0.5 vacuum:1.0 lattice:diamond d13-ini.cfg

The GB is constructed at the z=0 plane, so you may want to shift it under PBC before visualization, like in the nacl.cfg case above.

http://gosam.googlecode.com/svn/wiki/d13-ini.png

Example 2

Let's now try to construct <110> symmetric tilt grain boundaries in Cu, similar to that in the paper: M. Tschopp et al., Acta Materialia 55 (2007) 3959-3969. Let's pick Σ267 (11,11,5) θ=144.4° boundary (Fig. 3f). To learn more about <110> Σ267 GBs, use csl.py:

$ ./csl.py 110 267
m=22  n= 5  35.636
m=13  n= 7  74.579
m=14  n=13 105.421
m= 5  n=11 144.364

The m and n integers are used to generate boundaries (see Grimmer, Acta Cryst. (1984) A40, 108). m,n can be used as a bicrystal.py parameter, instead of the Σ. In this case: 5,11.

If the rotation axis is [110], the (11,11,5) plane does not contain the axis, so to have tilt boundary, we use the equivalent (11,-11,5) plane.

The final command is

./bicrystal.py 1,1,0 11,-11,5 5,11 2 2 3 lattice:cu out.cfg

And we got GB with the 5 macroscopic degrees of freedom the same as in the Fig. 3f.

http://gosam.googlecode.com/svn/wiki/cu267.png

The system is periodic and there are two GBs. To get only one GB use the vacuum option, as in the previous example.

As you can see, in this geometrical construction some GB atoms are very close to each other. This system is clearly not a realistic model of the GB. The remove option (see the previous example) can remove the atoms that are too close to each other, but this is only the first step (and this step may not be necessary) to create realistic models.

The complete procedure that we used to prepare GBs is described in the paper:
M. Wojdyr et al, Energetics and structure of <001> tilt grain boundaries in SiC, Modelling Simul. Mater. Sci. Eng. 18 075009 (2010)

mdfile.py

Manipulates coordinate files and converts between file formats. Can handle gzipped (.gz) and bzip2'ed (.bz2) files. See the list of supported files in the source.

Examples

Convert VASP POSCAR file to LAMMPS input.

mdfile.py POSCAR foo.lammps./monocryst.py  --margin=1 NaCl 4 4 4 nacl.cfg

Convert all AtomEye cfg files to gzipped input LAMMPS files.

bash$ for i in *.cfg; do ../../mdfile.py $i `basename $i .cfg`.lammps.gz; done

Change all atoms B to C and Cl to Si.

mdfile.py --translate 'B->C, Cl->Si' input.cfg output.cfg

Swap Si and C atoms.

mdfile.py --translate 'Si->C, C->Si' input.cfg output.cfg

Set explicitly PBC box size.

mdfile.py --pbc '[(60,0,0),(0,60,0),(0,0,60)]' input.xyz output.cfg

Remove atoms that have the z coordinate outside of the (15,30) range.

mdfile.py --filter '15 < z < 30' input.cfg output.cfg
Clone this wiki locally