<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nbertin</id>
	<title>Micro and Nano Mechanics Group - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nbertin"/>
	<link rel="alternate" type="text/html" href="http://micro.stanford.edu/wiki/Special:Contributions/Nbertin"/>
	<updated>2026-07-06T01:42:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6757</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6757"/>
		<updated>2018-06-15T00:20:17Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD-XRD calculation tool (see Bertin and Cai, CMS, 2018 [https://doi.org/10.1016/j.commatsci.2018.01.037 PDF]) to compute virtual diffraction patterns (micro-Laue patterns and Stokes-Wilson line profiles) associated with discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]). The spectral method requires the FFTW library to be installed (see instructions to install FFTW [[Install_FFTW3 | here]]). Compile without flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; if FFTW is not installed. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to use the spectral approach (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]) to compute the displacement gradient field (very efficient). When the spectral method is used, the number of periodic images (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now. The spectral method requires the FFTW library.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector). The detector plane will be orthogonal to &amp;lt;math&amp;gt;\vec{D}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; to the dislocated microstructure (see Bertin and Cai, CMS, 2018 [https://doi.org/10.1016/j.commatsci.2018.01.037 PDF]). 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File generated when option &amp;lt;tt&amp;gt;writePeaks = 1&amp;lt;/tt&amp;gt;, that contains 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File generated when option &amp;lt;tt&amp;gt;writeDisplacementGradient = 1&amp;lt;/tt&amp;gt;, that contains the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6756</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6756"/>
		<updated>2018-06-15T00:03:24Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD-XRD calculation tool (see Bertin and Cai, CMS, 2018 [http://micro.stanford.edu/~caiwei/papers/Bertin_Cai_CMS_2018_XRD_DDD.pdf PDF]) to compute virtual diffraction patterns (micro-Laue patterns and Stokes-Wilson line profiles) associated with discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]). The spectral method requires the FFTW library to be installed (see instructions to install FFTW [[Install_FFTW3 | here]]). Compile without flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; if FFTW is not installed. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to use the spectral approach (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]) to compute the displacement gradient field (very efficient). When the spectral method is used, the number of periodic images (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now. The spectral method requires the FFTW library.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector). The detector plane will be orthogonal to &amp;lt;math&amp;gt;\vec{D}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6755</id>
		<title>DDD Energy Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6755"/>
		<updated>2018-06-15T00:03:21Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD Energy calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD Energy Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD energy calculation tool (see Bertin and Cai, JMPS, 2018) to compute the stored energy associated with periodic, discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD energy calculation tool is located in directory &amp;lt;tt&amp;gt;utilities/energy&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_ENERGY_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]). The spectral method requires the FFTW library to be installed (see instructions to install FFTW [[Install_FFTW3 | here]]). Compile without flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; if FFTW is not installed. Successful compilation will create executable &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
The DDD energy tool requires the same input files as the ParaDiS code, i.e. a control file and a data file. The calculation of the energy is performed using the following command:&lt;br /&gt;
&lt;br /&gt;
  ./paradiseng -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the energy tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; requires some additional parameters compared to the original control files used for ParaDiS simulations. There are 6 additional parameters that are specific to the energy calculation and that must be specified in the control file:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;: number of periodic images (in each direction) to be considered in the calculation&lt;br /&gt;
* &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;: resolution of the grid (in each direction) used to calculate the volume-based energy&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt;: value for the first large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;: value for the second large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;: toogle to enable GPU-accelerated calculations&lt;br /&gt;
* &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;: toogle to use the spectral approach (see Bertin, arXiv, 2018 [https://arxiv.org/pdf/1804.00803.pdf PDF]) to evaluate the volume-based energy (very efficient). When the spectral method is used, the number of periodic images (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored, and the values of the large core radius (&amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;) are automatically re-calculated based on the grid resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## ENERGY&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  rclarge1 = 1000.0&lt;br /&gt;
  rclarge2 = 1500.0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the energy of DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/energy/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy/examples&lt;br /&gt;
  ../../../bin/paradiseng -d taylor_edge_20.data taylor_edge_20.ctrl &lt;br /&gt;
  ../../../bin/paradiseng -d rs0001.data rs0001.ctrl&lt;br /&gt;
&lt;br /&gt;
The value of the stored energy is outputted in the console and in file &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt;. File &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt; is created in the output directory of the simulation (specified with control parameter &amp;lt;tt&amp;gt;dirname&amp;lt;/tt&amp;gt;). The first column is the dislocation density (&amp;lt;math&amp;gt;m^{-2}&amp;lt;/math&amp;gt;), and the second column is the value of the stored energy (&amp;lt;math&amp;gt;J/b^3&amp;lt;/math&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6754</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6754"/>
		<updated>2018-05-30T01:04:03Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Input files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD-XRD calculation tool (see Bertin and Cai, CMS, 2018 [http://micro.stanford.edu/~caiwei/papers/Bertin_Cai_CMS_2018_XRD_DDD.pdf PDF]) to compute virtual diffraction patterns (micro-Laue patterns and Stokes-Wilson line profiles) associated with discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector). The detector plane will be orthogonal to &amp;lt;math&amp;gt;\vec{D}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6753</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6753"/>
		<updated>2018-05-30T00:59:39Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD-XRD calculation tool (see Bertin and Cai, CMS, 2018 [http://micro.stanford.edu/~caiwei/papers/Bertin_Cai_CMS_2018_XRD_DDD.pdf PDF]) to compute virtual diffraction patterns (micro-Laue patterns and Stokes-Wilson line profiles) associated with discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6752</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6752"/>
		<updated>2018-05-25T17:34:32Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Input files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6751</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6751"/>
		<updated>2018-05-25T17:34:01Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Input files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the sample to the center of the main detector (i.e. specifying the position/orientation of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6750</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6750"/>
		<updated>2018-05-25T17:32:01Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Input files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Symbol of the material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the main detector with respect to the sample center (i.e. specifying the position of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6749</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6749"/>
		<updated>2018-05-25T17:30:10Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Input files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the XRD tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the main detector with respect to the sample center (i.e. specifying the position of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6748</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6748"/>
		<updated>2018-05-25T17:28:59Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Use flag &amp;lt;tt&amp;gt;-D_SPECTRAL&amp;lt;/tt&amp;gt; to enable calculations using the spectral method. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the energy tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the main detector with respect to the sample center (i.e. specifying the position of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Output file&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the selected (hkl) peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the values of the resolved strain in the direction of the diffracted vector &amp;lt;math&amp;gt;\vec{Q}&amp;lt;/math&amp;gt; of the (hkl) reflection at each sampling point. The first line is the magnitude &amp;lt;math&amp;gt;\|\vec{Q}_0\|&amp;lt;/math&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd tilt_GB_10.ctrl&lt;br /&gt;
  ../../../bin/paradisxrd cu_15um_105rel_ESM_3_init.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
The micro-Laue patterns files generated in the simulation results directory (files &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;) can be visualized using the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_laue_pattern.m&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line intensity ===&lt;br /&gt;
&lt;br /&gt;
The powder-XRD line intensity profiles can be constructed from files &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; using the Stokes-Wilson approximation method with the Matlab script&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples/plot_StokesWilson_line_profile.m&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6747</id>
		<title>DDD-XRD Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manual&amp;diff=6747"/>
		<updated>2018-05-25T02:10:37Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt; &amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt; DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt; &amp;lt;DIV&amp;gt; &amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRON...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD profiles calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool is located in directory &amp;lt;tt&amp;gt;utilities/xrd&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_XRD_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Successful compilation will create executable &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  ./paradisxrd -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the energy tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | &#039;&#039;&#039;Parameter&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Default&#039;&#039;&#039;&lt;br /&gt;
 | &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 3&lt;br /&gt;
 | Number of periodic images (in each direction) to be considered in the calculation.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 64&lt;br /&gt;
 | Resolution of the sampling grid (in each direction) used to evaluate the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 6&lt;br /&gt;
 | Maximum order of the (hkl) reflections to be considered in the ray-tracing procedure.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. A maximum of 10 peaks can be selected.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | none&lt;br /&gt;
 | List of (hkl) indices for the selected peaks. Secondary detectors will be associated to each selected peak.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;peaksOnly&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toggle to only consider the (hkl) peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. When enabled, the &amp;lt;tt&amp;gt;hklOrder&amp;lt;/tt&amp;gt; parameter will be ignored, and only peaks provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt; will be ray-traced.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writePeaks&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Write all reflected vectors (one per sampling point) for every selected peak (hkl) in file &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;writeDisplacementGradient&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Output the displacement gradient at each sampling point in file &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | Toogle to enable GPU-accelerated calculations of the displacement gradient field.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 0&lt;br /&gt;
 | 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 (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;material&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Cu&lt;br /&gt;
 | Material (used for atomic and structural factors).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Direction of the incoming X-ray beam.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;D&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | [1 0 0]&lt;br /&gt;
 | Vector linking the center of the main detector with respect to the sample center (i.e. specifying the position of the detector).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Ddist&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 70e-3&lt;br /&gt;
 | Distance between the center of the sample and the detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 256&lt;br /&gt;
 | Resolution (in each direction) of the main detector.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 280e-3&lt;br /&gt;
 | Size of the main detector (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;numPixels2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 128&lt;br /&gt;
 | Resolution (in each direction) of the secondary detectors.&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Dsize2&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 10e-5&lt;br /&gt;
 | Size of the secondary detectors (m).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 5e3&lt;br /&gt;
 | Minimum energy of the incoming X-ray (eV).&lt;br /&gt;
|-&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Emax&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | 25e3&lt;br /&gt;
 | Maximum energy of the incoming X-ray (eV).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## DIFFRACTION&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  hklOrder = 4&lt;br /&gt;
  numPeaks = 5&lt;br /&gt;
  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]&lt;br /&gt;
  peaksOnly = 0&lt;br /&gt;
  writePeaks = 0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
  material = &amp;quot;Cu&amp;quot;&lt;br /&gt;
  s0 = [1 0 0]&lt;br /&gt;
  D = [1 0 0]&lt;br /&gt;
  Ddist = 70e-3&lt;br /&gt;
  numPixels = 256&lt;br /&gt;
  Dsize = 280e-3&lt;br /&gt;
  numPixels2 = 128&lt;br /&gt;
  Dsize2 = 10e-5&lt;br /&gt;
  Emin = 5e3&lt;br /&gt;
  Emax = 25e3&lt;br /&gt;
&lt;br /&gt;
Note that in this example, 5 selected peaks are specified and provided in &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;, namely the &amp;lt;math&amp;gt;(1 1 3), (2 0 4), (2 2 4), (1 3 1), (1 3 \overline{1})&amp;lt;/math&amp;gt; reflections.&lt;br /&gt;
&lt;br /&gt;
=== Main detector vs. selected peaks ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool computes the virtual micro-Laue pattern collected on a detector when shining an incoming X-ray beam &amp;lt;tt&amp;gt;s0&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt; in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
In many situations, it is also of interest to examine diffraction patterns associated with specific (hkl) reflections. In the current implentation of the &amp;lt;tt&amp;gt;paradisxrd&amp;lt;/tt&amp;gt; tool, the user can specify up to 10 peaks (referred to as selected peaks) using parameters &amp;lt;tt&amp;gt;numPeaks&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;listPeaks&amp;lt;/tt&amp;gt;. 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 &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt; in the simulation results directory. For each selected peak, the strain distribution resolved along the diffraction vector are also outputed in file &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;. This data can be used to compute the line profile intensity using the Stokes-Wilson approximation.&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
&lt;br /&gt;
The DDD-XRD tool produces several outputs located in the simulation results directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;laue_pattern.out&amp;lt;/tt&amp;gt;: File containing the total intensity of reflected rays as collected at each pixel of the main detector.&lt;br /&gt;
* &amp;lt;tt&amp;gt;laue_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;_all.out&amp;lt;/tt&amp;gt;: File containing the intensity of the (hkl) reflection as collected at each pixel of the secondary detector associated with the slected (hkl) peak.&lt;br /&gt;
* &amp;lt;tt&amp;gt;reflected_beam_&amp;lt;hkl&amp;gt;.out&amp;lt;/tt&amp;gt;: File containing the direction of 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 huge when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Pstrain_peak_&amp;lt;hkl&amp;gt;_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt;: File containing the value of the resolved strain in the direction of the diffracted vector of the (hkl) reflection at each sampling point. The distribution of this apparent strain can be used to calculate the line intensity profile under the Stokes-Wilson approximation.&lt;br /&gt;
* &amp;lt;tt&amp;gt;G_&amp;lt;numGrid&amp;gt;.out&amp;lt;/tt&amp;gt; File containing the value of the displacement gradient tensor at each sampling point. Warning: this file may become big when the resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt; is large.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Generating diffraction patterns ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the XRD patterns asscociated with DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/xrd/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/xrd/examples&lt;br /&gt;
  ../../../bin/paradisxrd -d taylor_edge_20.data taylor_edge_20.ctrl &lt;br /&gt;
  ../../../bin/paradisxrd -d rs0001.data rs0001.ctrl&lt;br /&gt;
&lt;br /&gt;
=== Visualizing micro-Laue patterns ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Stokes-Wilson line profile ===&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6746</id>
		<title>DDD Energy Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6746"/>
		<updated>2018-05-24T19:54:16Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD Energy calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD Energy Manual&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD energy calculation tool (see Bertin and Cai, JMPS, 2018) to compute the stored energy associated with periodic, discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD energy calculation tool is located in directory &amp;lt;tt&amp;gt;utilities/energy&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_ENERGY_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Successful compilation will create executable &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
The DDD energy tool requires the same input files as the ParaDiS code, i.e. a control file and a data file. The calculation of the energy is performed using the following command:&lt;br /&gt;
&lt;br /&gt;
  ./paradiseng -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the energy tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; requires some additional parameters compared to the original control files used for ParaDiS simulations. There are 6 additional parameters that are specific to the energy calculation and that must be specified in the control file:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;: number of periodic images (in each direction) to be considered in the calculation&lt;br /&gt;
* &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;: resolution of the grid (in each direction) used to calculate the volume-based energy&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt;: value for the first large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;: value for the second large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;: toogle to enable GPU-accelerated calculations&lt;br /&gt;
* &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;: toogle to use the spectral approach (see Bertin, arXiv, 2018) to evaluate the volume-based energy (very efficient). When the spectral method is used, the number of periodic images (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored, and the values of the large core radius (&amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;) are automatically re-calculated based on the grid resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## ENERGY&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  rclarge1 = 1000.0&lt;br /&gt;
  rclarge2 = 1500.0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the energy of DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/energy/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy/examples&lt;br /&gt;
  ../../../bin/paradiseng -d taylor_edge_20.data taylor_edge_20.ctrl &lt;br /&gt;
  ../../../bin/paradiseng -d rs0001.data rs0001.ctrl&lt;br /&gt;
&lt;br /&gt;
The value of the stored energy is outputted in the console and in file &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt;. File &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt; is created in the output directory of the simulation (specified with control parameter &amp;lt;tt&amp;gt;dirname&amp;lt;/tt&amp;gt;). The first column is the dislocation density (&amp;lt;math&amp;gt;m^{-2}&amp;lt;/math&amp;gt;), and the second column is the value of the stored energy (&amp;lt;math&amp;gt;J/b^3&amp;lt;/math&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6745</id>
		<title>DDD Energy Manual</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD_Energy_Manual&amp;diff=6745"/>
		<updated>2018-05-24T19:46:44Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD Energy calculation&amp;lt;/P&amp;gt; &amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt; DDD Energy Manuals&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt; &amp;lt;DIV&amp;gt; &amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD Energy calculation&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD Energy Manuals&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page details how to use the DDD energy calculation tool (see Bertin and Cai, JMPS, 2018) to compute the stored energy associated with periodic, discrete dislocation structures generated from ParaDiS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
The DDD energy calculation tool is located in directory &amp;lt;tt&amp;gt;utilities/energy&amp;lt;/tt&amp;gt; of the ParaDiS code. The compilation of the code is performed with&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Make sure that the compilation mode is set to &amp;lt;tt&amp;gt;SERIAL&amp;lt;/tt&amp;gt; in the global makefile.setup file before compiling. Use flag &amp;lt;tt&amp;gt;-D_ENERGY_GPU&amp;lt;/tt&amp;gt; to enable GPU computations. Successful compilation will create executable &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; in the global &amp;lt;tt&amp;gt;bin/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Input files ===&lt;br /&gt;
&lt;br /&gt;
The DDD energy tool requires the same input files as the ParaDiS code, i.e. a control file and a data file. The calculation of the energy is performed using the following command:&lt;br /&gt;
&lt;br /&gt;
  ./paradiseng -d file.data file.ctrl&lt;br /&gt;
&lt;br /&gt;
The control file for the energy tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt; requires some additional parameters compared to the original control files used for ParaDiS simulations. There are 6 additional parameters that are specific to the energy calculation and that must be specified in the control file:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;: number of periodic images (in each direction) to be considered in the calculation&lt;br /&gt;
* &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;: resolution of the grid (in each direction) used to calculate the volume-based energy&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt;: value for the first large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;: value for the second large core radius used in the regularization procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;GPU&amp;lt;/tt&amp;gt;: toogle to enable GPU-accelerated calculations&lt;br /&gt;
* &amp;lt;tt&amp;gt;spectral&amp;lt;/tt&amp;gt;: toogle to use the spectral approach (see Bertin, 2018) to evaluate the volume-based energy (very efficient). When the spectral method is used, the number of periodic images (&amp;lt;tt&amp;gt;numPBCimg&amp;lt;/tt&amp;gt;) is ignored, and the values of the large core radius (&amp;lt;tt&amp;gt;rclarge1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rclarge2&amp;lt;/tt&amp;gt;) are automatically re-calculated based on the grid resolution &amp;lt;tt&amp;gt;numGrid&amp;lt;/tt&amp;gt;. The spectral method is not compatible with GPU calculation as of now.&lt;br /&gt;
&lt;br /&gt;
As an example, the following lines can be added at the end of any existing control file in order to use it with tool &amp;lt;tt&amp;gt;paradiseng&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  ## ENERGY&lt;br /&gt;
  ##----------------------------------&lt;br /&gt;
  numPBCimg = 3&lt;br /&gt;
  numGrid = 64&lt;br /&gt;
  rclarge1 = 1000.0&lt;br /&gt;
  rclarge2 = 1500.0&lt;br /&gt;
  GPU = 1&lt;br /&gt;
  spectral = 0&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
Examples of input files to compute the energy of DDD configurations are provided in&lt;br /&gt;
&lt;br /&gt;
  utilities/energy/examples&lt;br /&gt;
&lt;br /&gt;
The examples can be run using the following commands:&lt;br /&gt;
&lt;br /&gt;
  cd utilities/energy/examples&lt;br /&gt;
  ../../../bin/paradiseng -d taylor_edge_20.data taylor_edge_20.ctrl &lt;br /&gt;
  ../../../bin/paradiseng -d rs0001.data rs0001.ctrl&lt;br /&gt;
&lt;br /&gt;
The value of the stored energy is outputted in the console and in file &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt;. File &amp;lt;tt&amp;gt;energy.dat&amp;lt;/tt&amp;gt; is created in the output directory of the simulation (specified with control parameter &amp;lt;tt&amp;gt;dirname&amp;lt;/tt&amp;gt;). The first column is the dislocation density (&amp;lt;math&amp;gt;m^{-2}&amp;lt;/math&amp;gt;), and the second the value of the stored energy (&amp;lt;math&amp;gt;J/b^3&amp;lt;/math&amp;gt;).&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6744</id>
		<title>ParaDiS tools</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6744"/>
		<updated>2018-05-24T18:29:58Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;H4&amp;gt;NetworCh for ParaDiS&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[Extract links from DDD]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;H4&amp;gt;DDD-XRD&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Manual]]&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Matlab implementation and validation]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;H4&amp;gt;DDD Energy calculation&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD Energy Manual]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6743</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6743"/>
		<updated>2018-05-24T18:25:12Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Analytical non-singular displacement gradient formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the displacement gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[Media:ddd_xrd_matlab.tar | ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment using the expressions presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Shortest_paths_PBC_calculation&amp;diff=6713</id>
		<title>Shortest paths PBC calculation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Shortest_paths_PBC_calculation&amp;diff=6713"/>
		<updated>2018-01-31T20:20:56Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;NetworCh manuals&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
Shortest paths calculation in periodic CGSD simulation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;October 2016&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This example shows how to compute the shortest path between a bead in a CGSD simulation and its periodic image using the NetworCh library. The scripts and data files corresponding to this tutorial can be found in directory &amp;lt;tt&amp;gt;&amp;lt;NetworChDir&amp;gt;/tests/shortest_path_pbc/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Loading and replicating the structure ==&lt;br /&gt;
The chain structure corresponding to a CGSD simulation is outputted in two files: a beads position file (e.g. &amp;lt;tt&amp;gt;&amp;lt;simulationName&amp;gt;.cn&amp;lt;/tt&amp;gt;) which contains the id and the spatial coordinates of every beads in the simulation, and a bond file (e.g. &amp;lt;tt&amp;gt;&amp;lt;simulationName&amp;gt;.bnd&amp;lt;/tt&amp;gt;) which contains the connectivity information between the beads. The structure can be loaded in Matlab using function &amp;lt;tt&amp;gt;read_cgsd&amp;lt;/tt&amp;gt; by specifying the name of the simulation cn and bnd files (without their extension). For instance, files &amp;lt;tt&amp;gt;0_percent_strain_x500.cn&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;0_percent_strain_x500.bnd&amp;lt;/tt&amp;gt; can be loaded with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% Load CGSD structure&lt;br /&gt;
filename = &#039;0_percent_strain_x500&#039;;&lt;br /&gt;
[cn,bnds,vol] = read_cgsd(filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, a cross-link is represented by a cross-link bond of zero length between two beads. To simplify the structure and reduce the computation time, one can merge the cross-linked beads into a single bead by using the &amp;lt;tt&amp;gt;merge_cross_links&amp;lt;/tt&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% Merge cross-linked nodes&lt;br /&gt;
[cn,bnds] = merge_cross_links(cn,bnds);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The physical length of each bond can be calculated using function &amp;lt;tt&amp;gt;all_segments_length&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% Calculate bonds physical lengths&lt;br /&gt;
bonds_length = all_segments_length(cn,bnds,vol);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are interseted in calculated the shortest path from a bead to its periodic image, we need to replicate our structure by periodicity. For instance, if we wish to calculate the shortest path between a bead and its replica along the y-direction, we can use function &amp;lt;tt&amp;gt;replicate_volume&amp;lt;/tt&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ndir = 2; % replicate in the y-direction&lt;br /&gt;
[cn1,bnds1,vol1] = replicate_volume(cn,bnds,vol,ndir);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where beads position array &amp;lt;tt&amp;gt;cn1&amp;lt;/tt&amp;gt; will contain both the position of the beads in the primary volume &amp;lt;tt&amp;gt;vol&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;cn1(1:size(cn,1),:)&amp;lt;/tt&amp;gt; and their replica in the y-direction in &amp;lt;tt&amp;gt;cn1(size(cn,1)+1:end,:)&amp;lt;/tt&amp;gt; such that &amp;lt;tt&amp;gt;size(cn1,1) = 2*size(cn,1)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bonds_weight = bnds1(:,4); %use chain length as bond weight&lt;br /&gt;
&lt;br /&gt;
% or&lt;br /&gt;
&lt;br /&gt;
bonds_weight = bnds1(:,end); %use physical distance as bond weight&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Computing the shortest path between a bead and its periodic replica ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Computing the periodic image shortest path distribution ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n = size(cn,1);&lt;br /&gt;
&lt;br /&gt;
np = ne-ns+1;&lt;br /&gt;
sp = zeros(np,1);&lt;br /&gt;
&lt;br /&gt;
conn1 = generate_connectivity(size(cn1,1),bnds1);&lt;br /&gt;
&lt;br /&gt;
A1 = adjacency(cn1,bnds1,bonds_weight);&lt;br /&gt;
[~,comp1] = find_components(conn1);&lt;br /&gt;
&lt;br /&gt;
A1S = sparse(A1);&lt;br /&gt;
&lt;br /&gt;
for i=1:np&lt;br /&gt;
    if type == 2&lt;br /&gt;
        j = nid(i);&lt;br /&gt;
    else&lt;br /&gt;
        j = i+ns-1;&lt;br /&gt;
    end&lt;br /&gt;
    if bio_graph&lt;br /&gt;
        [d,~,~] = graphshortestpath(A1S,j,j+n);&lt;br /&gt;
        sp(i) = d;&lt;br /&gt;
    else&lt;br /&gt;
        [d,~] = shortest_path(conn1,A1,j,j+n,comp1);&lt;br /&gt;
        sp(i) = d;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
% Plot shortest paths distribution (only for cross-linked nodes)&lt;br /&gt;
nid = cn(nid,end-1);&lt;br /&gt;
output_data = [nid,sp,cn(:,end)];&lt;br /&gt;
sp = output_data(output_data(:,3)==1,2);&lt;br /&gt;
&lt;br /&gt;
figure(1);&lt;br /&gt;
hist(sp,20);&lt;br /&gt;
xlabel(&#039;shortest path length&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final script ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Documentation&amp;diff=6712</id>
		<title>NetworCh Documentation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Documentation&amp;diff=6712"/>
		<updated>2018-01-31T20:15:11Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;NetworCh manuals: Getting started&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
NetworCh: Documentation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;October 2016&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page contains a non-exhaustive list of the main Matlab functions available in the NetworCh library.&lt;br /&gt;
&lt;br /&gt;
== Common functions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Utility functions&lt;br /&gt;
|-&lt;br /&gt;
 | all_segments_length.m&lt;br /&gt;
 | Return the lengths of all segments by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | find_segment.m&lt;br /&gt;
 | Find the position of a given segment within the links list&lt;br /&gt;
|-&lt;br /&gt;
 | generate_connectivity.m&lt;br /&gt;
 | Generate nodal connectivity table corresponding to the links list&lt;br /&gt;
|-&lt;br /&gt;
 | pbc_fold.m&lt;br /&gt;
 | Folds point(s) into the primary volume by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | pbc_position.m&lt;br /&gt;
 | Returns the closest image of a point to another by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | segment_length.m&lt;br /&gt;
 | Compute length of a given segment by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | test_structure.m&lt;br /&gt;
 | Generate test structures to test network functions&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Network manipulation&lt;br /&gt;
|-&lt;br /&gt;
 | chop_structure.m&lt;br /&gt;
 | Extract a slice of the network by chopping the structure in a selected direction&lt;br /&gt;
|-&lt;br /&gt;
 | extract_links.m&lt;br /&gt;
 | Extract a sub-network that only contains given links from the original network&lt;br /&gt;
|-&lt;br /&gt;
 | extract_nodes.m&lt;br /&gt;
 | Extract a sub-network that only contains given nodes from the original network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_double_links.m&lt;br /&gt;
 | Remove double-links from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_link.m&lt;br /&gt;
 | Remove a given link from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_nodes.m&lt;br /&gt;
 | Remove given nodes from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_self_loops.m&lt;br /&gt;
 | Remove self-loops from the network&lt;br /&gt;
|-&lt;br /&gt;
 | replicate_volume.m&lt;br /&gt;
 | Duplicate initial network by assembling 2 periodic replica in a given direction&lt;br /&gt;
|-&lt;br /&gt;
 | replicate_volume_3.m&lt;br /&gt;
 | Replicate initial network by assembling 3 periodic replica in a given direction&lt;br /&gt;
|-&lt;br /&gt;
 | scale_structure.m&lt;br /&gt;
 | Rescale a structure by a scaling factor&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Geometrical functions&lt;br /&gt;
|-&lt;br /&gt;
 | facet_intersection.m&lt;br /&gt;
 | Find which facet of the rectangular primary volume is intersected by a given segment&lt;br /&gt;
|-&lt;br /&gt;
 | facet_intersection_position.m&lt;br /&gt;
 | Determine the facet and the intersection point between the rectangular primary volume and a given segment&lt;br /&gt;
|-&lt;br /&gt;
 | find_box_neighbors.m&lt;br /&gt;
 | Find neighbors of a given node based on box partitioning&lt;br /&gt;
|-&lt;br /&gt;
 | outside_box.m&lt;br /&gt;
 | Check if point(s) lie(s) outside of the primary volume&lt;br /&gt;
|-&lt;br /&gt;
 | partition_box.m&lt;br /&gt;
 | Sort nodes by partitioning the primary volume into boxes&lt;br /&gt;
|-&lt;br /&gt;
 | segment_plane_intersection.m&lt;br /&gt;
 | Compute the intersection between a plane and a given segment&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Visualization functions&lt;br /&gt;
|-&lt;br /&gt;
 | plot_box.m&lt;br /&gt;
 | Plot the box delimiting the primary volume&lt;br /&gt;
|-&lt;br /&gt;
 | plot_nodes.m&lt;br /&gt;
 | Plot a subset of nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | plot_segments.m&lt;br /&gt;
 | Plot a subset of segments of the network&lt;br /&gt;
|-&lt;br /&gt;
 | plot_structure.m&lt;br /&gt;
 | Plot the full network structure&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Export functions&lt;br /&gt;
|-&lt;br /&gt;
 | export_gexf.m&lt;br /&gt;
 | Export the network in GEXF format&lt;br /&gt;
|-&lt;br /&gt;
 | export_gml.m&lt;br /&gt;
 | Export the network in GML format&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Functions for DD structures analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Utility functions&lt;br /&gt;
|-&lt;br /&gt;
 | fcc_slip_system.m&lt;br /&gt;
 | Get Burgers vector and slip plane normal for a given FCC slip system&lt;br /&gt;
|-&lt;br /&gt;
 | get_slip_system.m&lt;br /&gt;
 | Determine the slip system of segment with a given Burgers vector b and slip plane normal&lt;br /&gt;
|-&lt;br /&gt;
 | is_junction_segment.m&lt;br /&gt;
 | Determine if a given segment (or list of segments) corresponds to a dislocation junction&lt;br /&gt;
|-&lt;br /&gt;
 | structure_sanity_check.m&lt;br /&gt;
 | Perform several sanity checks on the DD structure (conservation of the Burgers vector, zero-arm nodes, self-loops, double-links, ...)&lt;br /&gt;
|-&lt;br /&gt;
 | unique_slip_plane.m&lt;br /&gt;
 | Determine properties of the unique slip plane of a given segment (including the intercept coefficient)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Structure generation&lt;br /&gt;
|-&lt;br /&gt;
 | generate_fcc_junction.m&lt;br /&gt;
 | Generate the initial configuration (two straight segments connected at their middle point) to form a FCC junction (Lomer, glissile, Hirth or colinear) at given angles&lt;br /&gt;
|-&lt;br /&gt;
 | generate_frs.m&lt;br /&gt;
 | Generate a straight Frank-Read source in a periodic cubic volume&lt;br /&gt;
|-&lt;br /&gt;
 | generate_glissile_loop.m&lt;br /&gt;
 | Generate a glissile dislocation loop&lt;br /&gt;
|-&lt;br /&gt;
 | generate_infinite_line.m&lt;br /&gt;
 | Generate an infinite dislocation line in a periodic cubic volume&lt;br /&gt;
|-&lt;br /&gt;
 | generate_prismatic_loop.m&lt;br /&gt;
 | Generate a prismatic dislocation loop (4 nodes)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Structure decomposition&lt;br /&gt;
|-&lt;br /&gt;
 | decompose_into_loops.m&lt;br /&gt;
 | Decompose the dislocation network into loops by unzipping binary junctions&lt;br /&gt;
|-&lt;br /&gt;
 | irreductible_structure.m&lt;br /&gt;
 | Fully decompose the DD structure into an irredducible core by recursively unzipping junctions and reducing the network (removing self-links, merging double-links, ...)&lt;br /&gt;
|-&lt;br /&gt;
 | merge_double_links.m&lt;br /&gt;
 | Merge double-links of the DD network&lt;br /&gt;
|-&lt;br /&gt;
 | physical_structure.m&lt;br /&gt;
 | Reduce the DD structure to physical nodes only by removing all discretization nodes&lt;br /&gt;
|-&lt;br /&gt;
 | reduce_structure.m&lt;br /&gt;
 | Fully reduce the DD structure by recursively removing the self and double links, and the discretization nodes&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Import / Export structures&lt;br /&gt;
|-&lt;br /&gt;
 | read_data_files.m&lt;br /&gt;
 | List all ParaDiS data files in a given directory&lt;br /&gt;
|-&lt;br /&gt;
 | read_dxa_file.m&lt;br /&gt;
 | Read dislocations from a DXA (Ovito) .ca file&lt;br /&gt;
|-&lt;br /&gt;
 | read_nodes.m&lt;br /&gt;
 | Read dislocation nodes from a ParaDiS data file&lt;br /&gt;
|-&lt;br /&gt;
 | write_data_file.m&lt;br /&gt;
 | Write DD structure into a ParaDiS nodal data file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Functions for MD structures analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | read_cgsd.m&lt;br /&gt;
 | Read CGSD files (.cn and .bnd)&lt;br /&gt;
|-&lt;br /&gt;
 | merge_cross_links.m&lt;br /&gt;
 | Merge cross-linked nodes into single nodes and flag them&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functions for network analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | adjacency.m&lt;br /&gt;
 | Generate the adjacency matrix from the links/segments list&lt;br /&gt;
|-&lt;br /&gt;
 | assortativity.m&lt;br /&gt;
 | Calculate the Pearson correlation coefficient that measures the assortativity of the nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | average_degree.m&lt;br /&gt;
 | Calculate the average nodes degree and the exponent of best fit power-law distribution&lt;br /&gt;
|-&lt;br /&gt;
 | average_shortest_path.m&lt;br /&gt;
 | Compute the average shortest path between all pairs of nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | clustering.m&lt;br /&gt;
 | Calculate the clustering and transitivity coefficients of the network&lt;br /&gt;
|-&lt;br /&gt;
 | construct_shortest_path.m&lt;br /&gt;
 | Construct the shortest path (sequence of nodes) from a source to a target node&lt;br /&gt;
|-&lt;br /&gt;
 | extract_component.m&lt;br /&gt;
 | Extract a given component from the network&lt;br /&gt;
|-&lt;br /&gt;
 | find_components.m&lt;br /&gt;
 | Find unconnected components of the network&lt;br /&gt;
|-&lt;br /&gt;
 | link_density.m&lt;br /&gt;
 | Calculate the link density of the network&lt;br /&gt;
|-&lt;br /&gt;
 | normalized_laplacian.m&lt;br /&gt;
 | Compute the normalized graph Laplacian matrix of the network&lt;br /&gt;
|-&lt;br /&gt;
 | random_network.m&lt;br /&gt;
 | Generate a random network that follows a power-law degree distribution&lt;br /&gt;
|-&lt;br /&gt;
 | shortest_path.m&lt;br /&gt;
 | Compute shortest path from a source to all other vertices or to a given target&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Documentation&amp;diff=6711</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Documentation&amp;diff=6711"/>
		<updated>2018-01-31T20:12:30Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page Documentation to NetworCh Documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[NetworCh Documentation]]&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Documentation&amp;diff=6710</id>
		<title>NetworCh Documentation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Documentation&amp;diff=6710"/>
		<updated>2018-01-31T20:12:30Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page Documentation to NetworCh Documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NetworCh manuals: Getting started &lt;br /&gt;
= Documentation =&lt;br /&gt;
&lt;br /&gt;
== Common functions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Utility functions&lt;br /&gt;
|-&lt;br /&gt;
 | all_segments_length.m&lt;br /&gt;
 | Return the lengths of all segments by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | find_segment.m&lt;br /&gt;
 | Find the position of a given segment within the links list&lt;br /&gt;
|-&lt;br /&gt;
 | generate_connectivity.m&lt;br /&gt;
 | Generate nodal connectivity table corresponding to the links list&lt;br /&gt;
|-&lt;br /&gt;
 | pbc_fold.m&lt;br /&gt;
 | Folds point(s) into the primary volume by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | pbc_position.m&lt;br /&gt;
 | Returns the closest image of a point to another by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | segment_length.m&lt;br /&gt;
 | Compute length of a given segment by applying PBC&lt;br /&gt;
|-&lt;br /&gt;
 | test_structure.m&lt;br /&gt;
 | Generate test structures to test network functions&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Network manipulation&lt;br /&gt;
|-&lt;br /&gt;
 | chop_structure.m&lt;br /&gt;
 | Extract a slice of the network by chopping the structure in a selected direction&lt;br /&gt;
|-&lt;br /&gt;
 | extract_links.m&lt;br /&gt;
 | Extract a sub-network that only contains given links from the original network&lt;br /&gt;
|-&lt;br /&gt;
 | extract_nodes.m&lt;br /&gt;
 | Extract a sub-network that only contains given nodes from the original network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_double_links.m&lt;br /&gt;
 | Remove double-links from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_link.m&lt;br /&gt;
 | Remove a given link from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_nodes.m&lt;br /&gt;
 | Remove given nodes from the network&lt;br /&gt;
|-&lt;br /&gt;
 | remove_self_loops.m&lt;br /&gt;
 | Remove self-loops from the network&lt;br /&gt;
|-&lt;br /&gt;
 | replicate_volume.m&lt;br /&gt;
 | Duplicate initial network by assembling 2 periodic replica in a given direction&lt;br /&gt;
|-&lt;br /&gt;
 | replicate_volume_3.m&lt;br /&gt;
 | Replicate initial network by assembling 3 periodic replica in a given direction&lt;br /&gt;
|-&lt;br /&gt;
 | scale_structure.m&lt;br /&gt;
 | Rescale a structure by a scaling factor&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Geometrical functions&lt;br /&gt;
|-&lt;br /&gt;
 | facet_intersection.m&lt;br /&gt;
 | Find which facet of the rectangular primary volume is intersected by a given segment&lt;br /&gt;
|-&lt;br /&gt;
 | facet_intersection_position.m&lt;br /&gt;
 | Determine the facet and the intersection point between the rectangular primary volume and a given segment&lt;br /&gt;
|-&lt;br /&gt;
 | find_box_neighbors.m&lt;br /&gt;
 | Find neighbors of a given node based on box partitioning&lt;br /&gt;
|-&lt;br /&gt;
 | outside_box.m&lt;br /&gt;
 | Check if point(s) lie(s) outside of the primary volume&lt;br /&gt;
|-&lt;br /&gt;
 | partition_box.m&lt;br /&gt;
 | Sort nodes by partitioning the primary volume into boxes&lt;br /&gt;
|-&lt;br /&gt;
 | segment_plane_intersection.m&lt;br /&gt;
 | Compute the intersection between a plane and a given segment&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Visualization functions&lt;br /&gt;
|-&lt;br /&gt;
 | plot_box.m&lt;br /&gt;
 | Plot the box delimiting the primary volume&lt;br /&gt;
|-&lt;br /&gt;
 | plot_nodes.m&lt;br /&gt;
 | Plot a subset of nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | plot_segments.m&lt;br /&gt;
 | Plot a subset of segments of the network&lt;br /&gt;
|-&lt;br /&gt;
 | plot_structure.m&lt;br /&gt;
 | Plot the full network structure&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Export functions&lt;br /&gt;
|-&lt;br /&gt;
 | export_gexf.m&lt;br /&gt;
 | Export the network in GEXF format&lt;br /&gt;
|-&lt;br /&gt;
 | export_gml.m&lt;br /&gt;
 | Export the network in GML format&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Functions for DD structures analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Utility functions&lt;br /&gt;
|-&lt;br /&gt;
 | fcc_slip_system.m&lt;br /&gt;
 | Get Burgers vector and slip plane normal for a given FCC slip system&lt;br /&gt;
|-&lt;br /&gt;
 | get_slip_system.m&lt;br /&gt;
 | Determine the slip system of segment with a given Burgers vector b and slip plane normal&lt;br /&gt;
|-&lt;br /&gt;
 | is_junction_segment.m&lt;br /&gt;
 | Determine if a given segment (or list of segments) corresponds to a dislocation junction&lt;br /&gt;
|-&lt;br /&gt;
 | structure_sanity_check.m&lt;br /&gt;
 | Perform several sanity checks on the DD structure (conservation of the Burgers vector, zero-arm nodes, self-loops, double-links, ...)&lt;br /&gt;
|-&lt;br /&gt;
 | unique_slip_plane.m&lt;br /&gt;
 | Determine properties of the unique slip plane of a given segment (including the intercept coefficient)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Structure generation&lt;br /&gt;
|-&lt;br /&gt;
 | generate_fcc_junction.m&lt;br /&gt;
 | Generate the initial configuration (two straight segments connected at their middle point) to form a FCC junction (Lomer, glissile, Hirth or colinear) at given angles&lt;br /&gt;
|-&lt;br /&gt;
 | generate_frs.m&lt;br /&gt;
 | Generate a straight Frank-Read source in a periodic cubic volume&lt;br /&gt;
|-&lt;br /&gt;
 | generate_glissile_loop.m&lt;br /&gt;
 | Generate a glissile dislocation loop&lt;br /&gt;
|-&lt;br /&gt;
 | generate_infinite_line.m&lt;br /&gt;
 | Generate an infinite dislocation line in a periodic cubic volume&lt;br /&gt;
|-&lt;br /&gt;
 | generate_prismatic_loop.m&lt;br /&gt;
 | Generate a prismatic dislocation loop (4 nodes)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Structure decomposition&lt;br /&gt;
|-&lt;br /&gt;
 | decompose_into_loops.m&lt;br /&gt;
 | Decompose the dislocation network into loops by unzipping binary junctions&lt;br /&gt;
|-&lt;br /&gt;
 | irreductible_structure.m&lt;br /&gt;
 | Fully decompose the DD structure into an irredducible core by recursively unzipping junctions and reducing the network (removing self-links, merging double-links, ...)&lt;br /&gt;
|-&lt;br /&gt;
 | merge_double_links.m&lt;br /&gt;
 | Merge double-links of the DD network&lt;br /&gt;
|-&lt;br /&gt;
 | physical_structure.m&lt;br /&gt;
 | Reduce the DD structure to physical nodes only by removing all discretization nodes&lt;br /&gt;
|-&lt;br /&gt;
 | reduce_structure.m&lt;br /&gt;
 | Fully reduce the DD structure by recursively removing the self and double links, and the discretization nodes&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Import / Export structures&lt;br /&gt;
|-&lt;br /&gt;
 | read_data_files.m&lt;br /&gt;
 | List all ParaDiS data files in a given directory&lt;br /&gt;
|-&lt;br /&gt;
 | read_dxa_file.m&lt;br /&gt;
 | Read dislocations from a DXA (Ovito) .ca file&lt;br /&gt;
|-&lt;br /&gt;
 | read_nodes.m&lt;br /&gt;
 | Read dislocation nodes from a ParaDiS data file&lt;br /&gt;
|-&lt;br /&gt;
 | write_data_file.m&lt;br /&gt;
 | Write DD structure into a ParaDiS nodal data file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Functions for MD structures analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | read_cgsd.m&lt;br /&gt;
 | Read CGSD files (.cn and .bnd)&lt;br /&gt;
|-&lt;br /&gt;
 | merge_cross_links.m&lt;br /&gt;
 | Merge cross-linked nodes into single nodes and flag them&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Functions for network analysis ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
 | adjacency.m&lt;br /&gt;
 | Generate the adjacency matrix from the links/segments list&lt;br /&gt;
|-&lt;br /&gt;
 | assortativity.m&lt;br /&gt;
 | Calculate the Pearson correlation coefficient that measures the assortativity of the nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | average_degree.m&lt;br /&gt;
 | Calculate the average nodes degree and the exponent of best fit power-law distribution&lt;br /&gt;
|-&lt;br /&gt;
 | average_shortest_path.m&lt;br /&gt;
 | Compute the average shortest path between all pairs of nodes of the network&lt;br /&gt;
|-&lt;br /&gt;
 | clustering.m&lt;br /&gt;
 | Calculate the clustering and transitivity coefficients of the network&lt;br /&gt;
|-&lt;br /&gt;
 | construct_shortest_path.m&lt;br /&gt;
 | Construct the shortest path (sequence of nodes) from a source to a target node&lt;br /&gt;
|-&lt;br /&gt;
 | extract_component.m&lt;br /&gt;
 | Extract a given component from the network&lt;br /&gt;
|-&lt;br /&gt;
 | find_components.m&lt;br /&gt;
 | Find unconnected components of the network&lt;br /&gt;
|-&lt;br /&gt;
 | link_density.m&lt;br /&gt;
 | Calculate the link density of the network&lt;br /&gt;
|-&lt;br /&gt;
 | normalized_laplacian.m&lt;br /&gt;
 | Compute the normalized graph Laplacian matrix of the network&lt;br /&gt;
|-&lt;br /&gt;
 | random_network.m&lt;br /&gt;
 | Generate a random network that follows a power-law degree distribution&lt;br /&gt;
|-&lt;br /&gt;
 | shortest_path.m&lt;br /&gt;
 | Compute shortest path from a source to all other vertices or to a given target&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Introduction_and_examples&amp;diff=6709</id>
		<title>Introduction and examples</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Introduction_and_examples&amp;diff=6709"/>
		<updated>2018-01-31T20:12:00Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page Introduction and examples to NetworCh Introduction and examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[NetworCh Introduction and examples]]&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Introduction_and_examples&amp;diff=6708</id>
		<title>NetworCh Introduction and examples</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Introduction_and_examples&amp;diff=6708"/>
		<updated>2018-01-31T20:12:00Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page Introduction and examples to NetworCh Introduction and examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;NetworCh manuals: Getting started&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
NetworCh: Introduction and examples&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;October 2016&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Obtaining NetworCh ==&lt;br /&gt;
The NetworCh library is maintained through the SVN server of the group. To obtain the latest version, you can use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir NetworCh.svn&lt;br /&gt;
cd NetworCh.svn/&lt;br /&gt;
svn co https://micro.stanford.edu/svn/NetworCh .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The core of the NetworCh library is mainly written in Matlab and therefore does not require any installation. The Matlab functions are found in subfolder &amp;lt;tt&amp;gt;matlab/&amp;lt;/tt&amp;gt;. In order to use these functions from your Matlab installation, do not forget to add the library directory to your Matlab path, or use the following command at the beginning of your scripts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
addpath(genpath(&#039;&amp;lt;path to NetworCh.svn&amp;gt;/matlab&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A list of the main functions available in the library is provided here: [[NetworCh Documentation]].&lt;br /&gt;
&lt;br /&gt;
== NetworCh basics ==&lt;br /&gt;
&lt;br /&gt;
=== Network representation ===&lt;br /&gt;
A network is a collection of vertices (nodes) joined by edges (links). In NetworCh, each network/structure is represented by a list of nodes position &amp;lt;tt&amp;gt;rn&amp;lt;/tt&amp;gt; and a list of links &amp;lt;tt&amp;gt;links&amp;lt;/tt&amp;gt;. The first three columns of &amp;lt;tt&amp;gt;rn&amp;lt;/tt&amp;gt; are reserved for the &amp;lt;tt&amp;gt;(x,y,z)&amp;lt;/tt&amp;gt; spatial coordinates of each node. The two first columns of &amp;lt;tt&amp;gt;links&amp;lt;/tt&amp;gt; must contain the id of nodes connected by the edges.&lt;br /&gt;
&lt;br /&gt;
For example, a simple network consisting of two nodes A = &amp;lt;tt&amp;gt;(xa,ya,za)&amp;lt;/tt&amp;gt; and B = &amp;lt;tt&amp;gt;(xb,yb,zb)&amp;lt;/tt&amp;gt; joined by a single segment can be initialized as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% Nodes&lt;br /&gt;
rn = zeros(2,3);&lt;br /&gt;
rn(1,1:3) = [xa,ya,za];&lt;br /&gt;
rn(2,1:3) = [xb,yb,zb];&lt;br /&gt;
&lt;br /&gt;
% Links&lt;br /&gt;
links = zeros(1,2);&lt;br /&gt;
links(1,1:2) = [1,2];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Network visualization ===&lt;br /&gt;
A network can be plotted with function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
plot_structure(rn,links);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt; uses the spatial coordinates &amp;lt;tt&amp;gt;rn(:,1:3)&amp;lt;/tt&amp;gt; to position nodes and does not rely and graph drawing algorithm to generate a planar layout of the network.&lt;br /&gt;
&lt;br /&gt;
In many situations, the nodes of the network are contained in a rectangular box (e.g. the simulation box in DD or MD simulations). In NetworCh, such a volume is defined with array &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt;. Array &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; specifies the bounds of the volume in the following manner: &amp;lt;tt&amp;gt;bounds = [xmin,xmax;ymin,ymax;zmin,zmax]&amp;lt;/tt&amp;gt;. For example, if we assume that our structure is contained in a cubic simulation box of edge size &amp;lt;tt&amp;gt;L&amp;lt;/tt&amp;gt; centered in the origin &amp;lt;tt&amp;gt;(0,0,0)&amp;lt;/tt&amp;gt;, it can be visualized using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bounds = L/2*[-1,1;-1,1;-1,1];&lt;br /&gt;
plot_structure(rn,links,bounds);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, periodic boundary conditions will be applied for the visualization when argument &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; is specified in function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt;, such that nodes whose position lies outside the volume defined by &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; will be folded back to the volume.&lt;br /&gt;
&lt;br /&gt;
== Importing/Creating networks ==&lt;br /&gt;
&lt;br /&gt;
NetworCh can generate or import networks from different sources.&lt;br /&gt;
&lt;br /&gt;
=== Test structures ===&lt;br /&gt;
Several simple test structures are provided within the library to test its functions. Test structures are generated by using the &amp;lt;tt&amp;gt;test_structure&amp;lt;/tt&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = test_structure(id);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; is the index of the test structure to generate.&lt;br /&gt;
&lt;br /&gt;
=== DD structures ===&lt;br /&gt;
When working with DD structures, the following additional data convention are used: the fourth column of the nodes position array &amp;lt;tt&amp;gt;rn(:,4)&amp;lt;/tt&amp;gt; is reserved for the nodal constraint (e.g. unconstrained or pinned node), while entries &amp;lt;tt&amp;gt;links(i,3:5)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;links(i,6:8)&amp;lt;/tt&amp;gt; contain the components of the Burgers vector and that of the slip plane normal associated with segment &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DDLab&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
The format used in NetworCh to represent networks is the same as that used in DDLab to represent dislocation nodes and segments. Therefore, DDLab dislocation structures can be directly manipulated with the library.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ParaDiS&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
DD structures can be imported from ParaDiS &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt; files using function &amp;lt;tt&amp;gt;read_nodes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = read_nodes(datafile);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;datafile&amp;lt;/tt&amp;gt; is the path to the ParaDiS &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DXA analysis (Ovito)&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
DD structures can be imported from DXA files generated with Ovito by using the &amp;lt;tt&amp;gt;read_dxa_file&amp;lt;/tt&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = read_dxa_file(cafilename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;cafilename&amp;lt;/tt&amp;gt; is the path to the DXA &amp;lt;tt&amp;gt;ca&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== MD structures ===&lt;br /&gt;
&#039;&#039;&#039;CGSD structures&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
CGSD structures can be imported using function &amp;lt;tt&amp;gt;read_cgsd&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[cn,bnds,vol] = read_cgsd(filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;filename&amp;lt;/tt&amp;gt; contains the path and name (without extension) of the CGSD data files &amp;lt;tt&amp;gt;filename.cn&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;filename.bnd&amp;lt;/tt&amp;gt; (Note that both the positions and bonds files must have the same name, only their extension should differ).&lt;br /&gt;
&lt;br /&gt;
Similarly to the other import functions, array &amp;lt;tt&amp;gt;cn&amp;lt;/tt&amp;gt; contains the position of the atoms/beads, &amp;lt;tt&amp;gt;bnds&amp;lt;/tt&amp;gt; contains the bonds information, and &amp;lt;tt&amp;gt;vol&amp;lt;/tt&amp;gt; specifies the bounds of the simulation volume.&lt;br /&gt;
&lt;br /&gt;
=== Networks generation ===&lt;br /&gt;
Random networks can be generated using function &amp;lt;tt&amp;gt;random_network&amp;lt;/tt&amp;gt;. For instance&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links] = random_network(n,P,bounds);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will generate a network of &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; nodes randomly positionned within &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt;, and whose degree distribution (number of connections per node) is specified with array &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt;. The algorithm to generate such a network is based on the configuration model, with the additional constraint that links must join nodes that are in the spatial vicinity of one another.&lt;br /&gt;
&lt;br /&gt;
== Exporting networks ==&lt;br /&gt;
Networks can be exported in standard graph formats &amp;lt;tt&amp;gt;GML&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GEXF&amp;lt;/tt&amp;gt; for visualization / analysis with other network tools with the following functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export_gml(&#039;filename.gml&#039;,rn,links);&lt;br /&gt;
export_gexf(&#039;filename.gexf&#039;,rn,links);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Properties can be associated with nodes or links. For instance, the weight of the links can be exported by specifying property &amp;lt;tt&amp;gt;&#039;EdgeWeights&#039;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export_gml(&#039;filename.gml&#039;,rn,links,&#039;EdgeWeights&#039;,weights);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where array &amp;lt;tt&amp;gt;weights&amp;lt;/tt&amp;gt; contains the list of weight associated with each link such that &amp;lt;tt&amp;gt;size(weights,1) = size(links,1)&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6707</id>
		<title>NetworCh Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6707"/>
		<updated>2018-01-31T20:11:42Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetworCh library manuals =&lt;br /&gt;
&lt;br /&gt;
NetworCh is a library, mainly written in Matlab, developed to manipulate, visualize, analyze and characterize network structures in various areas of mechanics of materials.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
[[NetworCh Introduction and examples]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[NetworCh Documentation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Installing and using the igraph package in R]]&lt;br /&gt;
&lt;br /&gt;
== Dislocation dynamics ==&lt;br /&gt;
[[DDD structure generation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[DDD irreducible core graph]]&lt;br /&gt;
&lt;br /&gt;
== CGSD ==&lt;br /&gt;
[[Shortest paths PBC calculation]]&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Introduction_and_examples&amp;diff=6706</id>
		<title>NetworCh Introduction and examples</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Introduction_and_examples&amp;diff=6706"/>
		<updated>2018-01-31T20:10:35Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;NetworCh manuals: Getting started&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
NetworCh: Introduction and examples&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;October 2016&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Obtaining NetworCh ==&lt;br /&gt;
The NetworCh library is maintained through the SVN server of the group. To obtain the latest version, you can use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir NetworCh.svn&lt;br /&gt;
cd NetworCh.svn/&lt;br /&gt;
svn co https://micro.stanford.edu/svn/NetworCh .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The core of the NetworCh library is mainly written in Matlab and therefore does not require any installation. The Matlab functions are found in subfolder &amp;lt;tt&amp;gt;matlab/&amp;lt;/tt&amp;gt;. In order to use these functions from your Matlab installation, do not forget to add the library directory to your Matlab path, or use the following command at the beginning of your scripts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
addpath(genpath(&#039;&amp;lt;path to NetworCh.svn&amp;gt;/matlab&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A list of the main functions available in the library is provided here: [[NetworCh Documentation]].&lt;br /&gt;
&lt;br /&gt;
== NetworCh basics ==&lt;br /&gt;
&lt;br /&gt;
=== Network representation ===&lt;br /&gt;
A network is a collection of vertices (nodes) joined by edges (links). In NetworCh, each network/structure is represented by a list of nodes position &amp;lt;tt&amp;gt;rn&amp;lt;/tt&amp;gt; and a list of links &amp;lt;tt&amp;gt;links&amp;lt;/tt&amp;gt;. The first three columns of &amp;lt;tt&amp;gt;rn&amp;lt;/tt&amp;gt; are reserved for the &amp;lt;tt&amp;gt;(x,y,z)&amp;lt;/tt&amp;gt; spatial coordinates of each node. The two first columns of &amp;lt;tt&amp;gt;links&amp;lt;/tt&amp;gt; must contain the id of nodes connected by the edges.&lt;br /&gt;
&lt;br /&gt;
For example, a simple network consisting of two nodes A = &amp;lt;tt&amp;gt;(xa,ya,za)&amp;lt;/tt&amp;gt; and B = &amp;lt;tt&amp;gt;(xb,yb,zb)&amp;lt;/tt&amp;gt; joined by a single segment can be initialized as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% Nodes&lt;br /&gt;
rn = zeros(2,3);&lt;br /&gt;
rn(1,1:3) = [xa,ya,za];&lt;br /&gt;
rn(2,1:3) = [xb,yb,zb];&lt;br /&gt;
&lt;br /&gt;
% Links&lt;br /&gt;
links = zeros(1,2);&lt;br /&gt;
links(1,1:2) = [1,2];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Network visualization ===&lt;br /&gt;
A network can be plotted with function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
plot_structure(rn,links);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt; uses the spatial coordinates &amp;lt;tt&amp;gt;rn(:,1:3)&amp;lt;/tt&amp;gt; to position nodes and does not rely and graph drawing algorithm to generate a planar layout of the network.&lt;br /&gt;
&lt;br /&gt;
In many situations, the nodes of the network are contained in a rectangular box (e.g. the simulation box in DD or MD simulations). In NetworCh, such a volume is defined with array &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt;. Array &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; specifies the bounds of the volume in the following manner: &amp;lt;tt&amp;gt;bounds = [xmin,xmax;ymin,ymax;zmin,zmax]&amp;lt;/tt&amp;gt;. For example, if we assume that our structure is contained in a cubic simulation box of edge size &amp;lt;tt&amp;gt;L&amp;lt;/tt&amp;gt; centered in the origin &amp;lt;tt&amp;gt;(0,0,0)&amp;lt;/tt&amp;gt;, it can be visualized using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bounds = L/2*[-1,1;-1,1;-1,1];&lt;br /&gt;
plot_structure(rn,links,bounds);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, periodic boundary conditions will be applied for the visualization when argument &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; is specified in function &amp;lt;tt&amp;gt;plot_structure&amp;lt;/tt&amp;gt;, such that nodes whose position lies outside the volume defined by &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt; will be folded back to the volume.&lt;br /&gt;
&lt;br /&gt;
== Importing/Creating networks ==&lt;br /&gt;
&lt;br /&gt;
NetworCh can generate or import networks from different sources.&lt;br /&gt;
&lt;br /&gt;
=== Test structures ===&lt;br /&gt;
Several simple test structures are provided within the library to test its functions. Test structures are generated by using the &amp;lt;tt&amp;gt;test_structure&amp;lt;/tt&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = test_structure(id);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; is the index of the test structure to generate.&lt;br /&gt;
&lt;br /&gt;
=== DD structures ===&lt;br /&gt;
When working with DD structures, the following additional data convention are used: the fourth column of the nodes position array &amp;lt;tt&amp;gt;rn(:,4)&amp;lt;/tt&amp;gt; is reserved for the nodal constraint (e.g. unconstrained or pinned node), while entries &amp;lt;tt&amp;gt;links(i,3:5)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;links(i,6:8)&amp;lt;/tt&amp;gt; contain the components of the Burgers vector and that of the slip plane normal associated with segment &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DDLab&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
The format used in NetworCh to represent networks is the same as that used in DDLab to represent dislocation nodes and segments. Therefore, DDLab dislocation structures can be directly manipulated with the library.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ParaDiS&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
DD structures can be imported from ParaDiS &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt; files using function &amp;lt;tt&amp;gt;read_nodes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = read_nodes(datafile);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;datafile&amp;lt;/tt&amp;gt; is the path to the ParaDiS &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DXA analysis (Ovito)&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
DD structures can be imported from DXA files generated with Ovito by using the &amp;lt;tt&amp;gt;read_dxa_file&amp;lt;/tt&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links,bounds] = read_dxa_file(cafilename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;cafilename&amp;lt;/tt&amp;gt; is the path to the DXA &amp;lt;tt&amp;gt;ca&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== MD structures ===&lt;br /&gt;
&#039;&#039;&#039;CGSD structures&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
CGSD structures can be imported using function &amp;lt;tt&amp;gt;read_cgsd&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[cn,bnds,vol] = read_cgsd(filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;filename&amp;lt;/tt&amp;gt; contains the path and name (without extension) of the CGSD data files &amp;lt;tt&amp;gt;filename.cn&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;filename.bnd&amp;lt;/tt&amp;gt; (Note that both the positions and bonds files must have the same name, only their extension should differ).&lt;br /&gt;
&lt;br /&gt;
Similarly to the other import functions, array &amp;lt;tt&amp;gt;cn&amp;lt;/tt&amp;gt; contains the position of the atoms/beads, &amp;lt;tt&amp;gt;bnds&amp;lt;/tt&amp;gt; contains the bonds information, and &amp;lt;tt&amp;gt;vol&amp;lt;/tt&amp;gt; specifies the bounds of the simulation volume.&lt;br /&gt;
&lt;br /&gt;
=== Networks generation ===&lt;br /&gt;
Random networks can be generated using function &amp;lt;tt&amp;gt;random_network&amp;lt;/tt&amp;gt;. For instance&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[rn,links] = random_network(n,P,bounds);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will generate a network of &amp;lt;tt&amp;gt;n&amp;lt;/tt&amp;gt; nodes randomly positionned within &amp;lt;tt&amp;gt;bounds&amp;lt;/tt&amp;gt;, and whose degree distribution (number of connections per node) is specified with array &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt;. The algorithm to generate such a network is based on the configuration model, with the additional constraint that links must join nodes that are in the spatial vicinity of one another.&lt;br /&gt;
&lt;br /&gt;
== Exporting networks ==&lt;br /&gt;
Networks can be exported in standard graph formats &amp;lt;tt&amp;gt;GML&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GEXF&amp;lt;/tt&amp;gt; for visualization / analysis with other network tools with the following functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export_gml(&#039;filename.gml&#039;,rn,links);&lt;br /&gt;
export_gexf(&#039;filename.gexf&#039;,rn,links);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Properties can be associated with nodes or links. For instance, the weight of the links can be exported by specifying property &amp;lt;tt&amp;gt;&#039;EdgeWeights&#039;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export_gml(&#039;filename.gml&#039;,rn,links,&#039;EdgeWeights&#039;,weights);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where array &amp;lt;tt&amp;gt;weights&amp;lt;/tt&amp;gt; contains the list of weight associated with each link such that &amp;lt;tt&amp;gt;size(weights,1) = size(links,1)&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6705</id>
		<title>NetworCh Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6705"/>
		<updated>2018-01-31T19:45:04Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* NetworCh library manuals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetworCh library manuals =&lt;br /&gt;
&lt;br /&gt;
NetworCh is a library, mainly written in Matlab, developed to manipulate, visualize, analyze and characterize network structures in various areas of mechanics of materials.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
[[Introduction and examples]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Documentation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Installing and using the igraph package in R]]&lt;br /&gt;
&lt;br /&gt;
== Dislocation dynamics ==&lt;br /&gt;
[[DDD structure generation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[DDD irreducible core graph]]&lt;br /&gt;
&lt;br /&gt;
== CGSD ==&lt;br /&gt;
[[Shortest paths PBC calculation]]&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6704</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6704"/>
		<updated>2018-01-31T19:38:25Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[Media:ddd_xrd_matlab.tar | ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment using the expressions presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6703</id>
		<title>ParaDiS tools</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6703"/>
		<updated>2018-01-31T19:37:09Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;H4&amp;gt;NetworCh for ParaDiS&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[Extract links from DDD]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;H4&amp;gt;DDD-XRD&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Manual]]&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Matlab implementation and validation]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6702</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6702"/>
		<updated>2018-01-31T19:31:04Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Simulation Codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simulation Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[MD++ Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[ParaDiS Workshop Notes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDLab Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[VASP Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile Qbox]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[NetworCh Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to compile LAMMPS]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile pimc++]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS tools]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | &lt;br /&gt;
!width=&amp;quot;300&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Unix Basics]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computer Setup]] &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computing Clusters | Parallel Clusters]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install FFTW3]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install HDF5]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install GSL]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Standard Tcl Library | Tcl Library]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install the GNU Compiler Collection (GCC)]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Running Hybrid MPI/OpenMP Simulations]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install SHTOOLS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scientific Background ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Dislocations]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Science Outreach ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [http://www.youtube.com/watch?v=SgM-Xes16Sw  Outreach interview]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to install MD++ in Ubuntu | Install MD++ in Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Introduction to Molecular Dynamics Simulations of Fullerenes | MD of Fullerenes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Images of Fullerenes]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Android Applications and Information]]&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- (commented out until completion)&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Simulating Solids in MD++]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Videos of bucky balls in motion]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Tutorial:Members_Only | Members Only]] ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manuals&amp;diff=6701</id>
		<title>DDD-XRD Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Manuals&amp;diff=6701"/>
		<updated>2018-01-31T19:30:50Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page DDD-XRD Manuals to ParaDiS tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[ParaDiS tools]]&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6700</id>
		<title>ParaDiS tools</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6700"/>
		<updated>2018-01-31T19:30:50Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Nbertin moved page DDD-XRD Manuals to ParaDiS tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;H4&amp;gt;Codes&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Matlab implementation and validation]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6699</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6699"/>
		<updated>2018-01-31T19:29:47Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Undo revision 6698 by Nbertin (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simulation Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[MD++ Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[ParaDiS Workshop Notes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDLab Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[VASP Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile Qbox]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[NetworCh Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to compile LAMMPS]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile pimc++]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDD-XRD Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | &lt;br /&gt;
!width=&amp;quot;300&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Unix Basics]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computer Setup]] &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computing Clusters | Parallel Clusters]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install FFTW3]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install HDF5]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install GSL]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Standard Tcl Library | Tcl Library]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install the GNU Compiler Collection (GCC)]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Running Hybrid MPI/OpenMP Simulations]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install SHTOOLS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scientific Background ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Dislocations]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Science Outreach ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [http://www.youtube.com/watch?v=SgM-Xes16Sw  Outreach interview]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to install MD++ in Ubuntu | Install MD++ in Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Introduction to Molecular Dynamics Simulations of Fullerenes | MD of Fullerenes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Images of Fullerenes]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Android Applications and Information]]&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- (commented out until completion)&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Simulating Solids in MD++]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Videos of bucky balls in motion]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Tutorial:Members_Only | Members Only]] ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6698</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6698"/>
		<updated>2018-01-31T19:28:08Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Simulation Codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simulation Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[MD++ Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[ParaDiS Workshop Notes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDLab Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[VASP Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile Qbox]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[NetworCh Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to compile LAMMPS]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile pimc++]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS tools]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | &lt;br /&gt;
!width=&amp;quot;300&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Unix Basics]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computer Setup]] &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computing Clusters | Parallel Clusters]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install FFTW3]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install HDF5]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install GSL]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Standard Tcl Library | Tcl Library]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install the GNU Compiler Collection (GCC)]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Running Hybrid MPI/OpenMP Simulations]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install SHTOOLS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scientific Background ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Dislocations]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Science Outreach ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [http://www.youtube.com/watch?v=SgM-Xes16Sw  Outreach interview]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to install MD++ in Ubuntu | Install MD++ in Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Introduction to Molecular Dynamics Simulations of Fullerenes | MD of Fullerenes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Images of Fullerenes]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Android Applications and Information]]&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- (commented out until completion)&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Simulating Solids in MD++]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Videos of bucky balls in motion]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Tutorial:Members_Only | Members Only]] ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6697</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6697"/>
		<updated>2018-01-20T03:09:21Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[File:ddd_xrd_matlab.tar | ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment using the expressions presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ddd_xrd_matlab.tar&amp;diff=6696</id>
		<title>File:Ddd xrd matlab.tar</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ddd_xrd_matlab.tar&amp;diff=6696"/>
		<updated>2018-01-20T03:04:31Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Matlab implementation and validation of the non-singular displacement gradient for DDD-XRD calculations. See Bertin and Cai, CMS, 2018.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Matlab implementation and validation of the non-singular displacement gradient for DDD-XRD calculations. See Bertin and Cai, CMS, 2018.&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6695</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6695"/>
		<updated>2018-01-20T03:02:58Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[File:ddd_xrd_matlab.tar | ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment as presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6694</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6694"/>
		<updated>2018-01-20T03:02:30Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[File:ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment as presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6693</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6693"/>
		<updated>2018-01-20T02:59:56Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment as presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) that (i) provides an example of how to use the calculation functions, and (ii) performs calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6692</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6692"/>
		<updated>2018-01-20T02:59:15Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
The computation of the non-singular displacement gradient based on the expressions provided in the above (Bertin and Cai, CMS, 2018) is implemented in a Matlab code available here:&lt;br /&gt;
&lt;br /&gt;
[[ddd_xrd_matlab.tar]]&lt;br /&gt;
&lt;br /&gt;
Function &amp;lt;tt&amp;gt;displacement_gradient_seg.m&amp;lt;/tt&amp;gt; readily implements the displacement gradient for a straight dislocation segment as presented in the above. An optimized version (faster) is provided in &amp;lt;tt&amp;gt;displacement_gradient_seg_opt.m&amp;lt;/tt&amp;gt;. The calculation of the displacement gradient field for a set of dislocation segments can be performed using function &amp;lt;tt&amp;gt;displacement_gradient_structure.m&amp;lt;/tt&amp;gt;. Note that this implementation uses the [http://micro.stanford.edu/~caiwei/Forum/2005-12-05-DDLab/ DDLab] data structure to represent the dislocations.&lt;br /&gt;
&lt;br /&gt;
=== Validation: triangular loop test case ===&lt;br /&gt;
&lt;br /&gt;
The code includes a test case (&amp;lt;tt&amp;gt;test_triangular_loop.m&amp;lt;/tt&amp;gt;) to (i) provide an example of how to use the calculation functions and (ii) perform calculations that validate the non-singular displacement gradient formulation.&lt;br /&gt;
&lt;br /&gt;
This test case does the following:&lt;br /&gt;
* generates a random triangular dislocation loop&lt;br /&gt;
* computes the displacement gradient field along a line using the non-singular expression provided in Bertin and Cai, CMS, 2018.&lt;br /&gt;
* compares it with the displacement gradient field obtained by numerically differentiating the displacement field&lt;br /&gt;
* compares the stress obtained from the displacement gradient field with the non-singular stress expression provided in Cai et al., JMPS, 2006&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6691</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6691"/>
		<updated>2018-01-20T01:29:24Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \|\vec{x&#039;}-\vec{x}\|&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
Following the isotropic Burgers distribution proposed in Cai et al., JMPS, 2006, the singularity in the above expression can be eliminated by employing the modified radius vector &amp;lt;math&amp;gt;R_a&amp;lt;/math&amp;gt; defined as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
R_a = \sqrt{R^2 + a^2} = \sqrt{R_i R_i + a^2} = \sqrt{(x&#039;_i - x_i)(x&#039;_i - x_i) + a^2}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; denotes the dislocation core radius. With this, the displacement gradient produced by a straight dislocation segment with end points &amp;lt;math&amp;gt;\vec{x}_a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\vec{x}_b&amp;lt;/math&amp;gt; can be analytically expressed as:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} b_m \epsilon_{jlk} A_{jk}(\vec{x}) -\frac{1}{8\pi} b_i \epsilon_{mik} A_{lk}(\vec{x}) \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} b_i \epsilon_{ijk} B_{jklm}(\vec{x})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where line integrals &amp;lt;math&amp;gt;A_{jk}(\vec{x})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B_{jklm}(\vec{x})&amp;lt;/math&amp;gt; are given by:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
A_{jk}(\vec{x}) = t_k \left[ 3a^2 d_j J_{05} + 2d_j J_{03} + 3a^2 t_j J_{15} + 2t_j J_{13} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
B_{jklm}(\vec{x}) = &amp;amp;t_k \left[ (\delta_{mj}d_l + \delta_{jl}d_m + \delta_{lm}d_j)J_{03} + (\delta_{mj}t_l + \delta_{jl}t_m + \delta_{lm}t_j)J_{13} - 3(d_m d_j d_l)J_{05} \right. \\&lt;br /&gt;
&amp;amp;\left. -3(d_m d_j t_l + d_m t_j d_l + t_m d_j d_l)J_{15} - 3(d_m t_j t_l + t_m d_j t_l + t_m t_j d_l)J_{25} -3(t_m t_j t_l)J_{35} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\vec{t}&amp;lt;/math&amp;gt; denotes the unit dislocation line tangent, and &amp;lt;math&amp;gt;\vec{d} = \vec{x}_0-\vec{x}&amp;lt;/math&amp;gt; is the vector linking field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; to its orthogonal projection &amp;lt;math&amp;gt;\vec{x}_0&amp;lt;/math&amp;gt; on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
When adopting the following segment parametric representation&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\vec{x&#039;} = \vec{x}_0 + s\vec{t}, \; s \in (s_1,s_2)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
an analytical expression for the line integrals &amp;lt;math&amp;gt;J_{ij}&amp;lt;/math&amp;gt; is obtained as follows:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp;J_{03} = \int_{s_1}^{s_2} \frac{1}{R_a^3} ds = \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{13} = \int_{s_1}^{s_2} \frac{s}{R_a^3} ds = \left. -\frac{1}{R_a} \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{05} = \int_{s_1}^{s_2} \frac{1}{R_a^5} ds = \left. \frac{2s^3}{3( \vec{d} \cdot \vec{d} + a^2 )^2 R_a^3 } \right|_{s_1}^{s_2} + \left. \frac{s}{( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{15} = \int_{s_1}^{s_2} \frac{s}{R_a^5} ds = \left. -\frac{1}{3 R_a^3} \right|_{s_1}^{s_2}  \\&lt;br /&gt;
&amp;amp;J_{25} = \int_{s_1}^{s_2} \frac{s^2}{R_a^5} ds = \left. \frac{s^3}{3( \vec{d} \cdot \vec{d} + a^2 ) R_a^3 } \right|_{s_1}^{s_2} \\&lt;br /&gt;
&amp;amp;J_{35} = \int_{s_1}^{s_2} \frac{s^3}{R_a^5} ds = \left. -\frac{2(\vec{d} \cdot \vec{d} + a^2)}{3 R_a^3} \right|_{s_1}^{s_2} -\left. \frac{s^2}{R_a^3 } \right|_{s_1}^{s_2}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
- based on DDLab format&lt;br /&gt;
- functions descreption&lt;br /&gt;
&lt;br /&gt;
=== Validation: tringular loop test case ===&lt;br /&gt;
&lt;br /&gt;
- what the test case does&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6690</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6690"/>
		<updated>2018-01-20T00:53:06Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;January 2018&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
It can be shown that the deformation gradient &amp;lt;math&amp;gt;G_{ml} = u_{m,l}&amp;lt;/math&amp;gt; produced by a dislocation loop &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; with Burgers vector &amp;lt;math&amp;gt;\vec{b}&amp;lt;/math&amp;gt; can be written as (see Bertin and Cai, CMS, 2018):&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
u_{m,l}(\vec{x}) = &amp;amp;-\frac{1}{8\pi} \oint_C b_m \epsilon_{jlk} R_{,ppj} dx&#039;_k -\frac{1}{8\pi} \oint_C b_i \epsilon_{mik} R_{,ppl} \, dx&#039;_k \\&lt;br /&gt;
&amp;amp;-\frac{1}{8\pi(1-\nu)} \oint_C b_i \epsilon_{ijk} R_{,mjl} \, dx&#039;_k&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;R = \sqrt{\vec{x&#039;}-\vec{x}}&amp;lt;/math&amp;gt; is the norm of the distance vector linking the field point &amp;lt;math&amp;gt;\vec{x}&amp;lt;/math&amp;gt; and the coordinate &amp;lt;math&amp;gt;\vec{x&#039;}&amp;lt;/math&amp;gt; spanning the dislocation line, &amp;lt;math&amp;gt;\epsilon_{ijk}&amp;lt;/math&amp;gt; is the permutation tensor, and &amp;lt;math&amp;gt;\nu&amp;lt;/math&amp;gt; is Poisson&#039;s ratio of the medium. &amp;lt;math&amp;gt;R_{,ijk} = \partial^3 R / \partial x_i\partial x_j\partial x_k&amp;lt;/math&amp;gt; denotes the third derivative of the radius vector wrt. the field coordinate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
- based on DDLab format&lt;br /&gt;
- functions descreption&lt;br /&gt;
&lt;br /&gt;
=== Validation: tringular loop test case ===&lt;br /&gt;
&lt;br /&gt;
- what the test case does&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6689</id>
		<title>DDD-XRD Matlab implementation and validation</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=DDD-XRD_Matlab_implementation_and_validation&amp;diff=6689"/>
		<updated>2018-01-20T00:28:13Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt; &amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt; DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt; &amp;lt;DIV&amp;gt; &amp;lt;P AL...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;DDD-XRD approach&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;FONT SIZE=&amp;quot;+2&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
DDD-XRD: Matlab implementation and validation&amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Nicolas Bertin and Wei Cai&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page provides Matlab functions to compute the displacement gradient associated with discrete dislocation segments based on the non-singular formulation presented in Bertin and Cai, CMS, 2018.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Analytical non-singular displacement gradient formulation ==&lt;br /&gt;
&lt;br /&gt;
== Matlab implementation ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6688</id>
		<title>ParaDiS tools</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ParaDiS_tools&amp;diff=6688"/>
		<updated>2018-01-19T22:14:17Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;&amp;lt;H4&amp;gt;Codes&amp;lt;/H4&amp;gt; &amp;lt;UL&amp;gt; &amp;lt;LI&amp;gt;DDD-XRD Matlab implementation and validation &amp;lt;/UL&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;H4&amp;gt;Codes&amp;lt;/H4&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
&amp;lt;LI&amp;gt;[[DDD-XRD Matlab implementation and validation]]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6687</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6687"/>
		<updated>2018-01-19T22:10:32Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Simulation Codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simulation Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[MD++ Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[ParaDiS Workshop Notes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDLab Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[VASP Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile Qbox]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[NetworCh Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to compile LAMMPS]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile pimc++]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDD-XRD Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | &lt;br /&gt;
!width=&amp;quot;300&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Unix Basics]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computer Setup]] &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computing Clusters | Parallel Clusters]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install FFTW3]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install HDF5]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install GSL]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Standard Tcl Library | Tcl Library]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install the GNU Compiler Collection (GCC)]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Running Hybrid MPI/OpenMP Simulations]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install SHTOOLS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scientific Background ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Dislocations]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Science Outreach ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [http://www.youtube.com/watch?v=SgM-Xes16Sw  Outreach interview]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to install MD++ in Ubuntu | Install MD++ in Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Introduction to Molecular Dynamics Simulations of Fullerenes | MD of Fullerenes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Images of Fullerenes]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Android Applications and Information]]&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- (commented out until completion)&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Simulating Solids in MD++]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Videos of bucky balls in motion]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Tutorial:Members_Only | Members Only]] ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Before_You_Start:_Known_Bugs_in_ParaDiS&amp;diff=6559</id>
		<title>Before You Start: Known Bugs in ParaDiS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Before_You_Start:_Known_Bugs_in_ParaDiS&amp;diff=6559"/>
		<updated>2017-04-27T23:03:37Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the current known bugs in the different ParaDiS public releases.&lt;br /&gt;
&lt;br /&gt;
== General bugs ==&lt;br /&gt;
&lt;br /&gt;
=== Bug 1. Cell ownership ===&lt;br /&gt;
As the numbers of&lt;br /&gt;
cells and numbers of processors are changed, ownership or nodes/segments can&lt;br /&gt;
alter which may result in segments changing the cells into which they&lt;br /&gt;
are accounted... and hence alter results. So for a small test case, forces may be perfectly correct in serial but slightly off in parallel using cells (option FULL_N2Forces turned off). &lt;br /&gt;
&lt;br /&gt;
On a large simulation the results should be insignificant, but on small simulations with very few&lt;br /&gt;
dislocations, differences are more noticable.&lt;br /&gt;
&lt;br /&gt;
=== Bug 2. Segfault with X-window ===&lt;br /&gt;
Not really a bug, but a suggestion. When an X-window cannot be opened sucessfully the code exits with a segmentation fault. Should be able to add a descriptive message and a break instead.&lt;br /&gt;
&lt;br /&gt;
=== Bug 3. Input files created in DOS system ===&lt;br /&gt;
When ParaDiS input files (control and data files) are created in a DOS system (MS-DOS or Windows), the input files sometimes cannot be executed even though the files look okay in your editor of your linux system. For example, when you create input files using &#039;create_dislocation.f&#039; in your DOS (or Windows) system, the hidden character, which is ^M, is embedded at the end of each line in your files. This character is sometimes shown or not shown in your editor. If it is shown, the input files look as the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;background: white; border: 0; padding: rem; width: 625px;&amp;quot;&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
### ParaDis nodal file (create_dislocation.f)^M&lt;br /&gt;
### S.A. (10/29/07)###^M&lt;br /&gt;
^M&lt;br /&gt;
#File version number^M&lt;br /&gt;
2^M&lt;br /&gt;
^M&lt;br /&gt;
#Number of data file segments^M&lt;br /&gt;
1^M&lt;br /&gt;
#Minimum coordinate values (x, y, z)^M&lt;br /&gt;
  -18348.6238532110       -18348.6238532110       -18348.6238532110^M     &lt;br /&gt;
#Maximum coordinate values (x, y, z)^M&lt;br /&gt;
   18348.6238532110        18348.6238532110        18348.6238532110^M     &lt;br /&gt;
^M&lt;br /&gt;
#Node count^M&lt;br /&gt;
          54^M&lt;br /&gt;
#Domain geometry (x, y, z)^M&lt;br /&gt;
1 1 1^M&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the character ^M is not shown, it is frustrating because the input files look perfect, ParaDiS canot execute these inputs with ^Ms and shows the errors such as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;background: white; border: 0; padding: rem; width: 625px;&amp;quot;&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
Error: Expected &#039;=&#039; in parameter assignment &lt;br /&gt;
Fatal: Error obtaining values for parameter ) is produced.&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can remove this hidden character ^Ms simply using the command &amp;quot;&amp;lt;tt&amp;gt;dos2unix&amp;lt;/tt&amp;gt;&amp;quot;. This command erase all ^Ms in your files. Just run &amp;lt;tt&amp;gt;dos2unix (your-input-file-name)&amp;lt;/tt&amp;gt;, Then, the input files can be executed.&lt;br /&gt;
&lt;br /&gt;
=== Bug 4. White space in makefile.setup ===&lt;br /&gt;
&lt;br /&gt;
Make sure there is no white space after your specification of the &#039;SYS&#039; variable, e.g.&lt;br /&gt;
&lt;br /&gt;
 SYS = gcc&lt;br /&gt;
&lt;br /&gt;
If there is a white space following gcc then the code won&#039;t compile.&lt;br /&gt;
&lt;br /&gt;
== ParaDiS v2.5.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Bug 1. FCC_0 Mobility law with useLabFrame ===&lt;br /&gt;
&lt;br /&gt;
A bug in ParaDiS v2.5.1 is known to prevent dislocation motion when the mobility &amp;lt;tt&amp;gt;FCC_0&amp;lt;/tt&amp;gt; is used and the crystal is rotated using option &amp;lt;tt&amp;gt;useLabFrame = 1&amp;lt;/tt&amp;gt; (Note: there is no bug when the crystal is not rotated).&lt;br /&gt;
&lt;br /&gt;
To fix this bug, lines 111-112 in file &amp;lt;tt&amp;gt;src/MobilityLaw_FCC_0.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( (fabs(fabs(node-&amp;gt;nx[i]) - fabs(node-&amp;gt;ny[i])) &amp;gt; FFACTOR_NORMAL) ||&lt;br /&gt;
     (fabs(fabs(node-&amp;gt;ny[i]) - fabs(node-&amp;gt;nz[i])) &amp;gt; FFACTOR_NORMAL) )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
need to be replaced by the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ( (fabs(fabs(normX[i]) - fabs(normY[i])) &amp;gt; FFACTOR_NORMAL) ||&lt;br /&gt;
     (fabs(fabs(normY[i]) - fabs(normZ[i])) &amp;gt; FFACTOR_NORMAL) )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bug 2. Cross-slip in FCC ===&lt;br /&gt;
&lt;br /&gt;
A bug in ParaDiS v2.5.1 affects the cross-slip procedure in FCC crystals when cross-slip is enabled (default). The bug arises from the fact that the &amp;lt;tt&amp;gt;shearModulus&amp;lt;/tt&amp;gt; parameter controlling the threshold for noise level is not initialized within the &amp;lt;tt&amp;gt;CrossSlipFCC&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
To fix this bug, the following line must be added after line 78 in file &amp;lt;tt&amp;gt;src/CrossSlipFCC.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
shearModulus = param-&amp;gt;shearModulus;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once corrected, lines 74-79 in file &amp;lt;tt&amp;gt;src/CrossSlipFCC.c&amp;lt;/tt&amp;gt; should look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
eps = 1.0e-06;&lt;br /&gt;
thetacrit = 2.0 / 180.0 * M_PI;&lt;br /&gt;
sthetacrit = sin(thetacrit);&lt;br /&gt;
s2thetacrit = sthetacrit * sthetacrit;&lt;br /&gt;
areamin = param-&amp;gt;remeshAreaMin;&lt;br /&gt;
shearModulus = param-&amp;gt;shearModulus;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ParaDiS v2.3.5 ==&lt;br /&gt;
&lt;br /&gt;
=== Bug 1. Gcc with v2.3.5 ===&lt;br /&gt;
Segmentation fault occurs with v2.3.5s and v.2.3.5.1 when compiling with GCC on Ubuntu and running codes with FMM. The error when compiling using &amp;lt;tt&amp;gt;-03&amp;lt;/tt&amp;gt; optimization in serial or parallel (&amp;lt;tt&amp;gt;cc -O3&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;mpicc -03&amp;lt;/tt&amp;gt;). Appears to be specific to &amp;lt;tt&amp;gt;-03&amp;lt;/tt&amp;gt; and doesn&#039;t occur for &amp;lt;tt&amp;gt;-02&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-g&amp;lt;/tt&amp;gt;, for example. &amp;lt;tt&amp;gt;-03&amp;lt;/tt&amp;gt; works properly when using Rijm tables. &lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t occur with the older version of ParaDiS in the subversion (~2.2.3 or 2.2.6?).&lt;br /&gt;
&lt;br /&gt;
Details of error:&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;background: white; border: 0; padding: rem; width: 625px;&amp;quot;&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Initialize: Control file parsing complete&lt;br /&gt;
Generating uniform domain decomposition.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
0x00007ffff732896d in ?? () from /lib/libc.so.6&lt;br /&gt;
(gdb) backtrace&lt;br /&gt;
#0  0x00007ffff732896d in ?? () from /lib/libc.so.6&lt;br /&gt;
#1  0x00007ffff732b424 in calloc () from /lib/libc.so.6&lt;br /&gt;
#2  0x0000000000448911 in ReadNodeDataFile ()&lt;br /&gt;
#3  0x000000000042dcd4 in Initialize ()&lt;br /&gt;
#4  0x000000000040e321 in ParadisInit ()&lt;br /&gt;
#5  0x000000000040185a in main ()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ParaDiS v2.0 ==&lt;br /&gt;
&lt;br /&gt;
=== Bug 1. Serial mode in v2.0 ===&lt;br /&gt;
&lt;br /&gt;
If you download the standard distribution of ParaDiS &amp;lt;tt&amp;gt;pub-dd3d.v2.0.tar.gz&amp;lt;/tt&amp;gt;, you will not be able to compile and run it in SERIAL mode.  The fix to this problem is described below.&lt;br /&gt;
&lt;br /&gt;
You need to download these three files (available on [http://paradis.stanford.edu/downloads ParaDiS download site]):&lt;br /&gt;
&lt;br /&gt;
 makefile.sys&lt;br /&gt;
 makefile.setup&lt;br /&gt;
 ReadConfig.c&lt;br /&gt;
&lt;br /&gt;
This will allow you to use &amp;lt;tt&amp;gt;SYS = i386&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;SYS = cygwin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MODE = SERIAL&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;makefile.setup&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;SYS = i386&amp;lt;/tt&amp;gt; option requires intel compiler &amp;lt;tt&amp;gt;icc&amp;lt;/tt&amp;gt;.  If you do not have this compiler, you can modify the &amp;lt;tt&amp;gt;makefile.sys&amp;lt;/tt&amp;gt; file to use a different compiler.&lt;br /&gt;
&lt;br /&gt;
We are working to enable the &amp;lt;tt&amp;gt;SYS = mac&amp;lt;/tt&amp;gt; option.  Please come back soon.&lt;br /&gt;
&lt;br /&gt;
If your computer does not allow opening of X-window, then you need to set &amp;lt;tt&amp;gt;enable_window = 0&amp;lt;/tt&amp;gt; in your &amp;lt;tt&amp;gt;win.script&amp;lt;/tt&amp;gt; file.  This is also necessary if you submit your job to a queue in a cluster, because you won&#039;t be able to open an interactive window there.&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_the_igraph_package_in_R&amp;diff=6534</id>
		<title>Installing and using the igraph package in R</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_the_igraph_package_in_R&amp;diff=6534"/>
		<updated>2017-01-20T22:03:03Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* MC2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NetworCh manuals: Getting started &lt;br /&gt;
= Installing and using the igraph package in R =&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizing graphs and networks in &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. Specifically, it implements advanced functions, such as graph isomorphism, that are not yet available in the NetworCh matlab library.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== MC2 ===&lt;br /&gt;
&amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; is installed on mc2. To run &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;, simply load the module and type &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; in the terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load R/3.1.2&lt;br /&gt;
R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a library that is not natively available with &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. To install it, go to your &amp;lt;tt&amp;gt;Codes/&amp;lt;/tt&amp;gt; directory and create a new directory called &amp;lt;tt&amp;gt;R-packages/&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd Codes/&lt;br /&gt;
mkdir R-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of the &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package then proceeds within &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;install.packages()&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install.packages(&amp;quot;igraph&amp;quot;, lib=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package will be downloaded from the selected mirror and then directly compiled on mc2 (~5 minutes). Once the installtion is finished, the package can be loaded from &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;library()&amp;lt;/tt&amp;gt; command and specifying the path to the installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
library(&amp;quot;igraph&amp;quot;, lib.loc=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_the_igraph_package_in_R&amp;diff=6533</id>
		<title>Installing and using the igraph package in R</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_the_igraph_package_in_R&amp;diff=6533"/>
		<updated>2017-01-20T22:01:46Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;NetworCh manuals: Getting started  = Installing and using the igraph package in R = The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NetworCh manuals: Getting started &lt;br /&gt;
= Installing and using the igraph package in R =&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizing graphs and networks in &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. Specifically, it implements advanced functions, such as graph isomorphism, that are not yet available in the NetworCh matlab library.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== MC2 ===&lt;br /&gt;
&amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; is installed on mc2. To run &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;, simply load the module and type &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; in the terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load R/3.12&lt;br /&gt;
R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a library that is not natively available with &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. To install it, go to your &amp;lt;tt&amp;gt;Codes/&amp;lt;/tt&amp;gt; directory and create a new directory called &amp;lt;tt&amp;gt;R-packages/&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd Codes/&lt;br /&gt;
mkdir R-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of the &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package then proceeds within &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;install.packages()&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install.packages(&amp;quot;igraph&amp;quot;, lib=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package will be downloaded from the selected mirror and then directly compiled on mc2 (~5 minutes). Once the installtion is finished, the package can be loaded from &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;library()&amp;lt;/tt&amp;gt; command and specifying the path to the installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
library(&amp;quot;igraph&amp;quot;, lib.loc=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6532</id>
		<title>NetworCh Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6532"/>
		<updated>2017-01-20T21:59:56Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetworCh library manuals =&lt;br /&gt;
&lt;br /&gt;
NetworCh is a library, mainly written in Matlab, developed to manipulate, visualize, analyze and characterize network structures in various areas of mechanics of materials.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
[[How to obtain NetworCh]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Introduction and examples]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Documentation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Installing and using the igraph package in R]]&lt;br /&gt;
&lt;br /&gt;
== Dislocation dynamics ==&lt;br /&gt;
[[DD structure generation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[DD irreducible core graph]]&lt;br /&gt;
&lt;br /&gt;
== CGSD ==&lt;br /&gt;
[[Shortest paths PBC calculation]]&lt;br /&gt;
&lt;br /&gt;
== Network analysis ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_R_with_the_igraph_package&amp;diff=6531</id>
		<title>Installing and using R with the igraph package</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_R_with_the_igraph_package&amp;diff=6531"/>
		<updated>2017-01-09T16:48:22Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* MC2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NetworCh manuals: Getting started &lt;br /&gt;
= Installing and using the igraph package in R =&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizing graphs and networks in &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. Specifically, it implements advanced functions, such as graph isomorphism, that are not yet available in the NetworCh matlab library.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== MC2 ===&lt;br /&gt;
&amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; is installed on mc2. To run &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;, simply load the module and type &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; in the terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load R/3.12&lt;br /&gt;
R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a library that is not natively available with &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. To install it, go to your &amp;lt;tt&amp;gt;Codes/&amp;lt;/tt&amp;gt; directory and create a new directory called &amp;lt;tt&amp;gt;R-packages/&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd Codes/&lt;br /&gt;
mkdir R-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of the &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package then proceeds within &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;install.packages()&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install.packages(&amp;quot;igraph&amp;quot;, lib=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package will be downloaded from the selected mirror and then directly compiled on mc2 (~5 minutes). Once the installtion is finished, the package can be loaded from &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;library()&amp;lt;/tt&amp;gt; command and specifying the path to the installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
library(&amp;quot;igraph&amp;quot;, lib.loc=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_R_with_the_igraph_package&amp;diff=6530</id>
		<title>Installing and using R with the igraph package</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Installing_and_using_R_with_the_igraph_package&amp;diff=6530"/>
		<updated>2017-01-09T15:54:22Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: Created page with &amp;quot;NetworCh manuals: Getting started  = Installing and using the igraph package in R = The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NetworCh manuals: Getting started &lt;br /&gt;
= Installing and using the igraph package in R =&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a powerful library for analyzing, manipulating and vizualizing graphs and networks in &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. Specifically, it implements advanced functions, such as graph isomorphism, that are not yet available in the NetworCh matlab library.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== MC2 ===&lt;br /&gt;
&amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; is installed on mc2. To run &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;, simply load the module and type &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; in the terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load R/3.12&lt;br /&gt;
R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package is a library that is not natively available with &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt;. To install it, go to your &amp;lt;tt&amp;gt;Codes/&amp;lt;/tt&amp;gt; directory and create a new directory called &amp;lt;tt&amp;gt;R-packages/&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd Codes/&lt;br /&gt;
mkdir R-packages&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of the &amp;lt;tt&amp;gt;igraph&amp;lt;/tt&amp;gt; package then proceeds within &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;install.packages()&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install.packages(&amp;quot;igraph&amp;quot;, lib=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package will be downloaded from the selected mirror and then directly compiled on mc2 (~5 minutes). Once the installtion is finished, the package can be loaded from &amp;lt;tt&amp;gt;R&amp;lt;/tt&amp;gt; using the &amp;lt;tt&amp;gt;library()&amp;lt;/tt&amp;gt; command and specifying the path to the installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install.packages(&amp;quot;igraph&amp;quot;, lib=&amp;quot;~/Codes/R-packages/&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6529</id>
		<title>NetworCh Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6529"/>
		<updated>2017-01-09T15:29:54Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetworCh library manuals =&lt;br /&gt;
&lt;br /&gt;
NetworCh is a library, mainly written in Matlab, developed to manipulate, visualize, analyze and characterize network structures in various areas of mechanics of materials.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
[[How to obtain NetworCh]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Introduction and examples]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Documentation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Installing and using R with the igraph package]]&lt;br /&gt;
&lt;br /&gt;
== Dislocation dynamics ==&lt;br /&gt;
[[DD structure generation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[DD irreducible core graph]]&lt;br /&gt;
&lt;br /&gt;
== CGSD ==&lt;br /&gt;
[[Shortest paths PBC calculation]]&lt;br /&gt;
&lt;br /&gt;
== Network analysis ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6528</id>
		<title>NetworCh Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=NetworCh_Manuals&amp;diff=6528"/>
		<updated>2017-01-09T15:29:18Z</updated>

		<summary type="html">&lt;p&gt;Nbertin: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetworCh library manuals =&lt;br /&gt;
&lt;br /&gt;
NetworCh is a library, mainly written in Matlab, developed to manipulate, visualize, analyze and characterize network structures in various areas of mechanics of materials.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
[[How to obtain NetworCh]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Introduction and examples]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[Documentation]]&lt;br /&gt;
[[Installing and using R with the igraph package]]&lt;br /&gt;
&lt;br /&gt;
== Dislocation dynamics ==&lt;br /&gt;
[[DD structure generation]] &amp;lt;br&amp;gt;&lt;br /&gt;
[[DD irreducible core graph]]&lt;br /&gt;
&lt;br /&gt;
== CGSD ==&lt;br /&gt;
[[Shortest paths PBC calculation]]&lt;br /&gt;
&lt;br /&gt;
== Network analysis ==&lt;/div&gt;</summary>
		<author><name>Nbertin</name></author>
	</entry>
</feed>