DDD-XRD Manual: Difference between revisions
| Line 86: | Line 86: | ||
| [1 0 0] |
| [1 0 0] |
||
| Direction of the incoming X-ray beam. |
| Direction of the incoming X-ray beam. |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
|- |
|- |
||
| <tt>D</tt> |
| <tt>D</tt> |
||
| [1 0 0] |
| [1 0 0] |
||
| Vector linking the center of the |
| Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector). |
||
|- |
|- |
||
| <tt>Ddist</tt> |
| <tt>Ddist</tt> |
||
| Line 110: | Line 118: | ||
| 10e-5 |
| 10e-5 |
||
| Size of the secondary detectors (m). |
| Size of the secondary detectors (m). |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
|} |
|} |
||
Revision as of 17:34, 25 May 2018
DDD-XRD profiles calculation
DDD-XRD Manual
Nicolas Bertin
May 2018
This page details how to use the DDD-XRD calculation tool (see Bertin and Cai, CMS, 2018) to compute virtual diffraction patterns (micro-Laue patterns and Stokes-Wilson line profiles) associated with discrete dislocation structures generated from ParaDiS.
Compilation
The DDD-XRD tool is located in directory utilities/xrd of the ParaDiS code. The compilation of the code is performed with
cd utilities/xrd make
Make sure that the compilation mode is set to SERIAL in the global makefile.setup file before compiling. Use flag -D_XRD_GPU to enable GPU computations. Use flag -D_SPECTRAL to enable calculations using the spectral method. Successful compilation will create executable paradisxrd in the global bin/ folder.
Usage
Input files
The DDD-XRD tool requires the same input files as the ParaDiS code, i.e. a control file and a data file. The calculation of the diffraction patterns is performed using the following command:
./paradisxrd -d file.data file.ctrl
The control file for the XRD tool paradisxrd requires some additional parameters compared to the original control files used for ParaDiS simulations. Below is a list of additional parameters specific to XRD calculations that can be specified in the control file:
| Parameter | Default | Description |
| numPBCimg | 3 | Number of periodic images (in each direction) to be considered in the calculation. |
| numGrid | 64 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field. |
| hklOrder | 6 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure. |
| numPeaks | 0 | Number of selected peaks to be considered. The selected peaks allow to focus on specific reflections, by associating a secondary detector with each of them. The (hkl) indices of the selected peaks must be specified in parameter listPeaks. A maximum of 10 peaks can be selected. |
| listPeaks | none | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak. |
| peaksOnly | 0 | Toggle to only consider the (hkl) peaks provided in listPeaks. When enabled, the hklOrder parameter will be ignored, and only peaks provided in listPeaks will be ray-traced. |
| writePeaks | 0 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file reflected_beam_<hkl>.out in the simulation results directory. This data can then be post-processed to generate patterns on detectors with aribrary parameters (location, orientation, size, resolution) without having to re-perform the displacement gradient calculation and ray-tracing procedure. |
| writeDisplacementGradient | 0 | Output the displacement gradient at each sampling point in file G_<numGrid>.out in the simulation results directory. |
| GPU | 0 | Toogle to enable GPU-accelerated calculations of the displacement gradient field. |
| spectral | 0 | Toogle to use the spectral approach (see Bertin, arXiv, 2018) to compute the displacement gradient field (very efficient). When the spectral method is used, the number of periodic images (numPBCimg) is ignored. The spectral method is not compatible with GPU calculation as of now. |
| material | Cu | Symbol of the material (used for atomic and structural factors). |
| s0 | [1 0 0] | Direction of the incoming X-ray beam. |
| Emin | 5e3 | Minimum energy of the incoming X-ray (eV). |
| Emax | 25e3 | Maximum energy of the incoming X-ray (eV). |
| D | [1 0 0] | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector). |
| Ddist | 70e-3 | Distance between the center of the sample and the detector. |
| numPixels | 256 | Resolution (in each direction) of the main detector. |
| Dsize | 280e-3 | Size of the main detector (m). |
| numPixels2 | 128 | Resolution (in each direction) of the secondary detectors. |
| Dsize2 | 10e-5 | Size of the secondary detectors (m). |
As an example, the following lines can be added at the end of any existing control file in order to use it with tool paradisxrd:
##---------------------------------- ## DIFFRACTION ##---------------------------------- numGrid = 64 numPBCimg = 3 hklOrder = 4 numPeaks = 5 listPeaks = [1 1 3 2 0 4 2 2 4 1 3 1 1 3 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] peaksOnly = 0 writePeaks = 0 GPU = 1 spectral = 0 material = "Cu" s0 = [1 0 0] D = [1 0 0] Ddist = 70e-3 numPixels = 256 Dsize = 280e-3 numPixels2 = 128 Dsize2 = 10e-5 Emin = 5e3 Emax = 25e3
Note that in this example, 5 selected peaks are specified and provided in listPeaks, namely the reflections.
Main detector vs. selected peaks
By default, the paradisxrd tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam s0 to the dislocated microstructure (see Bertin and Cai, CMS, 2018). This detector is referred to as the main detector, and its size is typically chosen to be quite large such that several reflections fall onto the detector range. The intensity pattern collected on this main detector is outputed in file laue_pattern.out in the simulation results directory.
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the paradisxrd tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters numPeaks and listPeaks. A secondary detector will be associated to each of these selected peaks. The center of the secondary detectors are automatically located at the position of which the X-ray would be reflected off the corresponding (hkl) in a perfect crystal. Intensity patterns collected on secondary detectors are outputed in files laue_peak_<hkl>_<numGrid>_all.out in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file Pstrain_peak_<hkl>_<numGrid>.out. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.
Output files
The DDD-XRD tool produces several outputs located in the simulation results directory.
| Output file | Description |
| laue_pattern.out | File containing the total intensity of reflected rays as collected at each pixel of the main detector. |
| laue_peak_<hkl>_<numGrid>_all.out | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak. |
| reflected_beam_<hkl>.out | File containing the direction of the outcoming ray associated with the selected (hkl) reflection at each sampling point. This file can be post-processed to create the diffraction pattern associated with the selected (hkl) reflection on any new detector. Warning: this file may become big when the resolution numGrid is large. |
| Pstrain_peak_<hkl>_<numGrid>.out | File containing the values of the resolved strain in the direction of the diffracted vector of the (hkl) reflection at each sampling point. The first line is the magnitude of the (hkl) diffracted vector in the perfect crystal. The distribution of this apparent strain can be used to calculate the powder-XRD line intensity profile under the Stokes-Wilson approximation. |
| G_<numGrid>.out | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution numGrid is large. |
Examples
Generating diffraction patterns
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in
utilities/xrd/examples
The examples can be run using the following commands:
cd utilities/xrd/examples ../../../bin/paradisxrd tilt_GB_10.ctrl ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl
Visualizing micro-Laue patterns
The micro-Laue patterns files generated in the simulation results directory (files laue_pattern.out and laue_peak_<hkl>_<numGrid>_all.out) can be visualized using the Matlab script
utilities/xrd/examples/plot_laue_pattern.m
Stokes-Wilson line intensity
The powder-XRD line intensity profiles can be constructed from files Pstrain_peak_<hkl>_<numGrid>.out using the Stokes-Wilson approximation method with the Matlab script
utilities/xrd/examples/plot_StokesWilson_line_profile.m