Skip to content

dimonaks/diffraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Program 'diffraction': a manual.

1. INTRODUCTION

    The program 'diffraction' allows to calculate selected area diffraction patterns (SADP)
    of different crystal structures for arbitrary axis zones. The program will
    be useful for scientist who are working in the field of crystallography and 
    materials science. The calculated SADP pictures resembles that obtained
    with the help of transmission electron microscope (TEM).

    To calculate SADP one need to know the crystal lattice of the structure
    and atomic factors of the considered elements (provided in books).
    The calculated SADP pictures are saved in the postscript format. The output picture files 
    could be used directly in your Latex manuscript. 

    Since it is usually needed to calculate a number of SADP for several axis zones and crystal
    structures, the program allows to do this in one run and provide  output picture with
    matrix-type layout of SADP. In other words up to 100 SADP could be shown on one figure
    automatically.

    LIMITATIONS: Currently the program supports crystal structures with two elements only.
    Please ask dimonaks@gmail.com if you need more.


2. COMPILATION

    2.1. Run the following commands:

    git clone https://github.com/dimonaks/diffraction diffraction
    cd diffraction/src

    2.2. Edit makefile by choosing correct C++ compiler.

    2.3. Then run:

    make
    cd ..

3. USAGE

    3.1. The input files

    In order to run the program you need the following files (examples are included).

    structure.geo   - crystal lattice of your structure in ABINIT format.
    For each structure one file is needed.

    config.conf         - the file with control parameters, specific for crystal structure; 
    for each structure separate file could be used  (if file is not provided, some default values are used).

    layout.conf     - the file, with global  parameters. 
    Determines the layout of output .eps.

    atomic_factors.conf - contains atomic factors for elements of the crystal structure
    (if file is not provided, the default values for carbon and titanium atoms are used).

    3.2. Try run

    As a try just run:

    ./diffraction   layout.conf

    In this run the example input files are used to calculate diffraction patterns of Ti2C structure.
    The result of calculations could be found in output/ folder.


    3.3. Description of layout.conf

    The layout.conf file determines the number of SADPs, the layout of output figure (number of columns and rows), 
    needed axis zones and paths to the corresponding crystal structure and configuration files. 
    #Example of layout file.

    DEBUG    0             # If 1 show additional run information.
    BOUNDINGBOX 0 0 80 90  # Sizes of rectangular (mm) for one SADP.
    NPATTERN 3     # Number of patterns, described after PATTERNS: keyword
    NROW     1     # Number of pattern rows.
    NCOLUMN  3     # Number of pattern columns.


    # After PATTERNS: keyword for each pattern the following information is provided: 
    # u v w structure_file_1 config_file_1 custom_name_1
    # u v w structure_file_2 config_file_2 custom_name_2
    # where u v w is axis zone

    PATTERNS:      
    -1 1 0  structure.geo  config.conf  Ti2C(166)
     1 1 1  structure.geo  config.conf  Ti2C(166)
     1 1 2  structure.geo  config.conf  Ti2C(166)
    
    #end of example layout file.

    3.4. Description of structure.geo 

    This is geometry file, which describes the crystal lattice of your structure.
    The file should be in the ABINIT format and include the following information:

    natom  - number of atoms;
    rprimd - 3 translation vectors in Bohr units, the format is r1x r1y r1z r2x r2y r2z r3x r3y r3z;
    xred   - reduced coordinates in the units of the provided vectors for all atoms;
    typat  - the list of atomic types (0 and 1  !!!).


    3.5. Description of config.conf

    #Example of configuration file

    NX                  14   # Numbers of reciprocal lattice points in each direction;
    NY                  14   # If you do not see reflexes with large indices try to increase these numbers.
    NZ                  14

    ZONE_AXIS_TYPE      1    # Type of axis zone provided in layout file:
    # if 0 - the plane in reciprocal space is determined with vector in reciprocal space (normal);
    # if 1 - the plane in reciprocal space is determined with vector in real space in Cartesian coordinates;
    # if 2 - the plane in reciprocal space is determined with [uvw] direction in direct space - most common.

    EWALD_PLANE_THICK   5e-2 # Thickness of Ewald plane (1/Bohr);§
    # In reality the reciprocal lattice points have some volume, making them visible in TEM,
    # even though they are slightly shifted from Ewald sphere.
    # By increasing the thickness of Ewald plane you can include more reciprocal points.

    REFLEX_MIN_SIZE     2e-2 # Minimum size of reflexes, included in pattern (mm);
    ZOOM                70   # Control the size of the pattern (Bohr * mm);
    REFLEX_TOT_AREA     7e1  # Control total area of all reflexes in the pattern (internal units);
    PATTERN_RADIUS      30   # The radius of pattern (mm);

    S1  1    # Three numbers to normalize Miller indices; 
    S2  1    # Miller indices on the pattern are normalized as h/S1 k/S2 l/S3
    S3  1

    INDEX_FONTSIZE  5    # Font-size of Miller indices (pt)

    # End of example configuration file


    3.6. Description of atomic_factors.conf

    The file consists of three lines.
    By default each line should contain 24 parameters.
    The first line contains changes of wave vector.
    The second line contains corresponding atomic factors for the first  element.
    The third line  contains corresponding atomic factors for the second element.

    !!! The values of atomic factors should be used for 200 keV electron energy.

About

Calculation of diffraction patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published