-
Notifications
You must be signed in to change notification settings - Fork 96
HH4
The program EMhh4 is a modern fortran-2003 implementation of the original Head&Humble hh.f program written in the 1970s. The original program was capable of running in 8k of memory (!!!) and used a number of geometrical restrictions to achieve this: only straight inclined dislocations are possible, up to four parallel dislocations of equal length, with up to three stacking faults in between them. Fortran-77 was (and remains) infamous for allowing what amounts to spaghetti code, i.e., numerous goto statements, common blocks (global memory), computed if and goto statements, etc. This modern version does away with all these deprecated programming constructs while keeping the original variable names and program layout. The code uses a name list file as input, and produces an HDF5 output file along with (optionally) tiff or bmp images. The computational speed of the original program is maintained (we ran the new and old codes side by side, and the difference in execution speed is minimal). The program takes a lot of input parameters, and it is important for the user to also understand the geometrical limitations; both are described below.
To be written.
First execute the EMhh4 -t command, which will place a EMhh4.template file in your working folder. Rename it with extension .nml, and then edit the file.
&hhlist
! namelist file for EMsoft version of the 4-dislocation Head&Humble program,
! modified by the group of Prof. Skalicky (U. Vienna) in the early 1980s.
! Some of the original input parameters are handled in a different way in
! the EMsoft context, but they are kept in this file (commented out and placed
! at the end of the template file) for historical reasons.
!===========================================================================
!
!============EMsoft specific parameters======
! crystal structure file name (.xtal)
xtalname = 'undefined',
! output file name
outname = 'undefined',
! prefix for image file name
imageprefix = 'undefined',
! image type 'bmp' or 'tiff'
imagetype = 'tiff',
! number of rows and columns in the BF/DF images
IROW = 160,
ICOL = 256,
! accelerating voltage [kV] [not present in original program]
kV = 200.0,
!============defect parameters================
! integer Burgers vector components e.g. -1,1,1, for dislocation 1
LB = 1 0 1,
! common integer denominator for LB components e.g. 2,
LD = 2,
! dislocation 2 [set to zero if no dislocation present]
LB2 = 0 0 0,
LD2 = 1,
! dislocation 3 [set to zero if no dislocation present]
LB3 = 0 0 0,
LD3 = 1,
! dislocation 4 [set to zero if no dislocation present]
LB4 = 0 0 0,
LD4 = 1,
! dislocation line direction (integers) e.g. -1,1,1,
LU = 1 1 1,
! diffraction vector (integers) e.g. 1,2,-1,
LG = 2 0 0,
!
!=============stacking fault parameters========
! stacking fault plane normal (integers) e.g. 1,1,0,
LFP1 = 1 1 0,
! same for second and third stacking faults,
LFP = 0 0 0,
LFP3 = 0 0 0,
! components and denominator (integers) of the displacement vector of the first
! stacking fault
LS1 = 1 0 1,
LQ1 = 2,
! same for second and third faults,
LS2 = 0 0 0,
LQ2 = 2,
LS3 = 0 0 0,
LQ3 = 2,
! separation between dislocations in units of extinction distance,
SEP = 2.0,
! second separation parameter
SEP2 = 2.0,
! used for parallel, overlapping stacking faults,
FAP1 = 0.0,
FAP3 = 0.0,
!
!=============foil geometry parameters=========
! beam direction (integers) e.g. 1,1,1,
LBM = 0 0 1,
! foil normal (integers) e.g. 1,1,1,
LFN = 0 0 1,
! foil thickness in units of extinction distance, e.g. 6.0,
THICK = 5.0,
! starting thickness of computation, default = 0.0,
START = 0.0,
! end of thickness integration
FINISH = 6.0,
! w-parameter (excitation error * extinction distance) [original parameter name CN17]
! this can be defined as a range from wmin to wmax, along with number of increments;
! if both values identical, then only one BF/DF image pair will be produced
wmin = -1.0,
wmax = 1.0,
wnum = 5,
!
!==============material property parameters
! 6x6 elastic constant tensor, to be entered in six separate rows; must be symmetric
! example is for cubic symmetry; units are [GPa]
D1row1 = 100.0 80.0 80.0 0.0 0.0 0.0,
D1row2 = 80.0 100.0 80.0 0.0 0.0 0.0,
D1row3 = 80.0 80.0 100.0 0.0 0.0 0.0,
D1row4 = 0.0 0.0 0.0 50.0 0.0 0.0,
D1row5 = 0.0 0.0 0.0 0.0 50.0 0.0,
D1row6 = 0.0 0.0 0.0 0.0 0.0 50.0,
!
!=========diagnostic parameter================
! 0=no test data, 1=output test data in file HHdiagnostics.txt
LTEST = 0,
/
The first parameter block asks for the crystal structure file name, an HDF5 output filename, and (optionally) the prefix and extension for image files that will contain bright field/dark field image pairs (both tiff and bmp are available). The image size in pixels is defined using IROW and ICOL; the original program was designed for a 4/3 ratio of image width to height, so we recommend that this ratio be maintained. Finally, the accelerating voltage must be given in kV. Note that the original hh.f program required that the user specify the extinction distance (XIGEE) and the absorption ratio (ANO); these are now computed directly from the crystal structure and the accelerating voltage.
The second parameter block labeled defect parameters contains the Burgers vectors for up to 4 dislocations; the first Burgers vector is given by LB/LD, with LB a list of three integers and LD the denominator. For instance, for a [211]/6 partial dislocation in fcc, the correct entry would be LB = 2, 1, 1 and LD = 6. The same goes for three additional dislocations with the LBi and LDi variables. The line direction LU and the diffraction vector LG conclude this parameter section. Note that all four dislocations have the same line direction, but they may have different Burgers vectors.
The third group of parameters describes the stacking faults, if any are present. The stacking faults are defined by their plane normals and displacement vectors. The plane normals are given by LFP, LFP1 and LFP3, and the displacement vectors use the same convention of numerators (LSi) and denominators (LQi) as for the dislocation parameters. Note that stacking faults will be bounded by the dislocations, so the displacement vectors must be consistent with the Burgers vectors (i.e., the dislocations will need to be partial dislocations if stacking faults are present). The separation between the partials is set by means of the two parameters SEP and SEP2. The final variables FAP1 and FAP3 can be used when the stacking faults overlap each other.
The foil geometry parameters are defined in the fourth parameter block; they include the beam direction (LBM) and foil normal (LFN), as well as the foil thickness (THICK) in units of the extinction distance. The START and FINISH parameters can be used to define the size of the region of interest; in particular, START can be negative. Both are also defined in units of the extinction distance. Finally, the diffraction condition is set by means of the w parameter which is equal to the excitation error multiplied by the extinction distance. A range can be defined by setting both wmin and wmax and defining the number of values to be used in that range; for instance, wmin=-1.0, wmax=1.0 and wnum=5 results in BF/DF image pairs to be computed for w = -1.0, -0.5, 0.0, 0.5, and 1.0.
The material property block currently contains only the elastic moduli (in arbitrary units since only ratios are used in the program). They are entered in engineering notation as a 6x6 array, defined by six individual rows in the input file.
Finally, the user can request that the program write a HHdiagnostics.txt file by setting LTEST to 1; this is mostly used for debugging purposes. This concludes the list of program parameters.
It should be noted that the original hh4.f source code used for this program was taken from a version written by the group of Prof. Skalicky at the University of Vienna in the early 1980s. This version also included piezoelectric contributions to the dislocation cores. In its present version, the EMhh4 program does not include piezoelectric effects; in a future EMsoft release, we may make those options available as well.
Consider two basic examples: a perfect [110]/2 dislocation in fcc Al, and a pair of <211>/6 partials with a stacking fault in between them in fcc Ni.
&hhlist
xtalname = 'Al.xtal',
outname = 'PATH/runa.h5',
imageprefix = 'PATH/Al',
imagetype = 'tiff',
IROW = 160,
ICOL = 256,
kV = 100.0,
!============defect parameters================
LB = -1 0 1,
LD = 2,
LU = 1 1 1,
LG = 2 0 0,
!=============foil geometry parameters=========
LBM = 0 0 1,
LFN = 0 0 1,
THICK = 5.0,
START = -1.0,
FINISH = 6.0,
wmin = -0.5,
wmax = 0.5,
wnum = 3,
!==============material property parameters
D1row1 = 108.0 61.0 61.0 0.0 0.0 0.0,
D1row2 = 61.0 108.0 61.0 0.0 0.0 0.0,
D1row3 = 61.0 61.0 108.0 0.0 0.0 0.0,
D1row4 = 0.0 0.0 0.0 29.0 0.0 0.0,
D1row5 = 0.0 0.0 0.0 0.0 29.0 0.0,
D1row6 = 0.0 0.0 0.0 0.0 0.0 29.0,
LTEST = 0,
/
The result of this simulation is shown below for the three diffraction conditions, bright field images on the left, dark field on the right for w = -0.5, 0.0, and 0.5 from top to bottom.
The second example has the following input file:
&hhlist
xtalname = 'Cu.xtal',
outname = 'playarea/HH/Cu',
imageprefix = 'playarea/HH/Cu',
imagetype = 'tiff',
IROW = 160,
ICOL = 256,
kV = 200.0,
!============defect parameters================
LB = 2 -1 -1,
LD = 6,
LB2 = 1 -2 1,
LD2 = 6,
LB3 = 0 0 0,
LD3 = 1,
LB4 = 0 0 0,
LD4 = 1,
LU = -1 -1 2,
LG = 1 1 -1,
!=============foil geometry parameters=========
LBM = 0 1 1,
LFN = 0 1 1,
THICK = 10.0,
START = -1.0,
FINISH = 11.0,
wmin = -0.5,
wmax = 0.5,
wnum = 5,
!=============stacking fault parameters========
LFP1 = 0 0 0,
LFP = 1 1 1,
LFP3 = 0 0 0,
LS1 = 0 0 0,
LQ1 = 2,
LS2 = 2 -1 -1,
LQ2 = 6,
LS3 = 0 0 0,
LQ3 = 2,
SEP = 16.0,
SEP2 = 0.0,
FAP1 = 0.0,
FAP3 = 0.0,
!==============material property parameters
D1row1 = 16.84 12.14 12.14 0.0 0.0 0.0,
D1row2 = 12.14 16.84 12.14 0.0 0.0 0.0,
D1row3 = 12.14 12.14 16.84 0.0 0.0 0.0,
D1row4 = 0.0 0.0 0.0 7.55 0.0 0.0,
D1row5 = 0.0 0.0 0.0 0.0 7.55 0.0,
D1row6 = 0.0 0.0 0.0 0.0 0.0 7.55,
LTEST = 0,
/
The results of this simulation are shown below for the five diffraction conditions, bright field images on the left, dark field on the right for w = -0.5, -0.25, 0.0, 0.25 and 0.5 from top to bottom.
Wiki pages are maintained by M. De Graef; they are part of the EMsoft package and fall under the same copyright (BSD2).
Information for Users
SEM Modalities
- Monte Carlo Simulations- EBSD Master Pattern Simulations
- EBSD Overlap Master Patterns
- EBSD Pattern Simulations
- EBSD Dictionary Indexing
- EBSD Spherical Indexing
- EBSD Reflector Ranking
- EBSD HREBSD
- ECP Master Pattern Simulations
- ECP Pattern Simulations
- TKD Master Pattern Simulations
- TKD Pattern Simulations
- ECCI Defect Image Simulations
TEM Modalities
- HH4- PED
- CBED Pattern Simulations
- STEM-DCI Image Simulations
- EMIntegrateSTEM utility
Utility Programs
- EMConvertOrientations- EMDisorientations
- EMHOLZ
- EMKikuchiMap
- EMOpenCLinfo
- EMZAgeom
- EMcuboMK
- EMdpextract
- EMdpmerge
- EMdrawcell
- EMeqvPS
- EMeqvrot
- EMfamily
- EMGBO
- EMGBOdm
- EMgetEulers
- EMgetOSM
- EMlatgeom
- EMlistSG
- EMlistTC
- EMmkxtal
- EMorbit
- EMorient
- EMqg
- EMsampleRFZ
- EMshowxtal
- EMsoftSlackTest
- EMsoftinit
- EMstar
- EMstereo
- EMxtalExtract
- EMxtalinfo
- EMzap
Complete Examples
- Crystal Data Entry Example
- EBSD Example
- ECP Example
- TKD Example
- ECCI Example
- CBED Example
- Dictionary Indexing Example
- DItutorial
Information for Developers