Skip to content

Post Processing@

Note

This a working in progress. For now the repo has a script for converting simulation cell in KSOME format to extendedXYZ format. Additionally, there are basic classes and routines which can be used to write custom post-processing codes in Python.

Single Snap Shot/Figure@

<number of atoms>
comment line
<element> <X> <Y> <Z>

Animation@

<number of atoms>
comment line
atom_symbol11 x-coord11 y-coord11 z-coord11
atom_symbol12 x-coord12 y-coord12 z-coord12
...
atom_symbol1n x-coord1n y-coord1n z-coord1n
<number of atoms>
comment line
atom_symbol21 x-coord21 y-coord21 z-coord21
atom_symbol22 x-coord22 y-coord22 z-coord22
...
atom_symbol2n x-coord2n y-coord2n z-coord2n
.
.
.
<number of atoms>
comment line
atom_symbolm1 x-coordm1 y-coordm1 z-coordm1
atom_symbolm2 x-coordm2 y-coordm2 z-coordm2
...

atom_symbolmn x-coordmn y-coordmn z-coordmn

Format of Extended XYZ@

  • In the extended XYZ format, the comment line is replaced by a series of key/value pairs. The keys are always strings and values can be integers, real numbers, bool (T and F for true and false, respectively) and strings
  • Space separated values should be within quotes. (For example in Lattice in the example below).
  • Extended XYZ format has two required parameters: Lattice and Properties. Other parameters, like Time in the example below is optional.
  • Lattice is a Cartesian 3 × 3 matrix representation of the cell vectors
    • Lattice="R1x R1y R1z R2x R2y R2z R3x R3y R3z", where R1x R1y R1z are the Cartesian x-, y- and *z-*components of the first lattice vector and so on.
  • Properties are specified as colon-separated triplets giving the name, format (R for real, I for integer) and number of columns of each property.
    • For example Properties="species:S:1:pos:R:3:vel:R:3:select:I:1", the first column indicates the atomic species, the next three columns represent atomic positions, the next three represent velocities and the last property is select which is a single-value integer.

An example for an 8-atom cubic Si system

8
Lattice="5.44 0.0 0.0 0.0 5.44 0.0 0.0 0.0 5.44" Properties=species:S:1:pos:R:3 Time=0.0
Si        0.00000000      0.00000000      0.00000000
Si        1.36000000      1.36000000      1.36000000
Si        2.72000000      2.72000000      0.00000000
Si        4.08000000      4.08000000      1.36000000
Si        2.72000000      0.00000000      2.72000000
Si        4.08000000      1.36000000      4.08000000
Si        0.00000000      2.72000000      2.72000000
Si        1.36000000      4.08000000      4.08000000

To use the post-processing python codes argparse, numpy, termcolor and pylab are required.

KSOME Format → ExtendedXYZ Format@

Using ksm2xyz.py -h should give you the following output

Converts Input/Output Simulation Cell from KSOME format to extendedXYZ format
usage: ksm2xyz [-h] -i IN_FNAME [-lc a_0]
               [-scl Scale]
               [-rm_t type1 [type2 ...]]
               [-sr_min Size_Range_min]
               [-sr_max Size_Range_max] [-o OUT_FNAME]

optional arguments:
  -h, --help            show this help message and exit
  -i IN_FNAME  Input file name in KSOME Format (required)
                        
  -lc a_0, --latt_const a_0
                        Enter Lattice Constant in Å
                        Default = 1.0 Å
                        
  -scl Scale, --size_scale Scale
                        Enter Size Scaling (Default:1.0)
                        
  -rm_t type1 [type2 ...], --rmv_type type1 [type2 ...]
                        Enter defect types that should NOT be included
                        
  -sr_min Size_Range_min, --size_range_min Size_Range_min
                        Min. Size of Defect Clustr Incld.(Default: 0.0)
                        (Applies to all defect types)

  -sr_max Size_Range_max, --size_range_max Size_Range_max
                        Max. Size of Defect Clustr Incld.(Default: 1e9)
                        (Applies to all defect types)
  -o OUT_FNAME
                        Enter Output XYZ Filename
                        Default:Same as Input Filename 
                        eXYZ FORMAT Used: X, Y, Z, Type, Scaled Radius

Note: All Defects types are
spherical and have same size if the
number of elemental defects are the same

This page was last updated on Jul 1, 2021, 7:31 PM (PST)
Back to top