3D_dist_graph


Download program files. program.
Download the sample data. IN100_triangles.txt.zip


This program produces graphs of grain boundary area and property distributions from 3D data. Information about individual grain boundary triangles in a 3D microstructure (such as the *.ph file output from D3D) is used as input. The program can calculate the one-dimensional (1D) disorientation angle distribution, the 2D grain boundary plane distribution irrespective of disorientation, the grain boundary plane distributions at fixed disorientation, or the value of the distribution at a list of points in the 5D space.


The input for the program is a text file, such as on the one linked above. The data in this file is organized in the following way:
The first lines in the file that begin with "#" are part of the header and are ignored by the program.
Each line after the header describes one triangle.
The three Euler angles of the first grain are in the first three columns, the three Euler angles of the second grain are in the columns 4, 5, and 6, and the three components of the grain boundary normal vector, in the lab reference frame, and in columns 7, 8, and 9. The tenth column is the area of the triangle. The examples below all analyze the grain boundary area. It is possible to analyze other grain boundary properties, provided they are specified in:
column 11: energy
column 12: mean curvature
column 13: velocity
column 14: dihedral angle
column 15: velocity curvature product
You do not need to provide any columns beyond the one you are analyzing. However, if you want to analyze the distribution dihedral angles, for example, you will also need some values in columns 11, 12, and 13, even if they are not known. In the cases where you need to fill the columns, but do not know the values, it is best to fill them with 1.000.


Example:
As an example, we will graph distributions of the grain boundaries from Ni Alloy IN100. This is selected as the example because it is a well-known publicly available data set that comes with Dream.3D (D3D) and is used in the tutorials. We begin with the file IN100_triangles.txt.zip, which was exported from D3D (*.ph format) after following their tutorials. After you down load the data, it must be placed in the same folder as the program


We will begin by computing the one-dimensional distribution of grain boundary disorientations. The first thing to do is configure the parameters in input.txt for the run. These parameters are described in the lower part of the input.txt file.
In this case, change the name of the file labeled input_disor.txt to input.txt. This file has been preconfigured to work, so do not change anything other than the file name.
Next, open a terminal window in the dist_graph. From here, you simply compile and run the program. To compile, use the make clean and make commands:
(base) gr20macmin:dist_graph gr20$ make clean
rm -f main.o sub.o sub2.o symmetry.o
(base) gr20macmin:dist_graph gr20$ make
gfortran -O3 -c -ffixed-line-length-none main.f
gfortran -O3 -c -ffixed-line-length-none sub.f
gfortran -O3 -c -ffixed-line-length-none sub2.f
gfortran -O3 -c -ffixed-line-length-none symmetry.f
gfortran main.o sub.o sub2.o symmetry.o -o dist_graph
(base) gr20macmin:dist_graph gr20$
To run, just type and enter dist_graph on the command line.
The run time terminal output you should get can be viewed here here
The output is a text file with the fractional area and number listed for each angle. You can see the file here: IN100_triangles_disor_dist.txt.
This is a text file that can be graphed by almost any program. The graph I made is shown below.



Next, we compute the 2D grain boundary plane distribution ignoring of disorientation. The first thing to do is configure the parameters in input.txt for the run. These parameters are described in the lower part of the input.txt file.
In this case, change the name of the file labeled input_2d.txt to input.txt. This file has been preconfigured to work, so do not change anything other than the file name.
To run, just type and enter dist_graph on the command line.
The run time terminal output you should get can be viewed here here
After the program has run, it has written the file IN100_triangles_2d_gmt1.gpf. This is simply a text file with the values to plot. We use GMT to plot it. GMT is controlled by the script: ./Draw_stereograms_1.
Just before the program completed, it provided guidance on the parameters needed for GMT. If you copy and paste the suggested line:
./Draw_stereograms_1 1 IN100_triangles_2d_gmt IF rainbow 0.731 1.729 0.100
into the terminal, it will draw the graph. However you can make a better graph by editing the minimum, maximum, and interval values so that they are 'round' numbers. Instead of "0.731 1.729 0.100," I used "0.6 1.7 0.1".
At the end of this process, you should have two files:
IN100_triangles_2d_gmt.tif
and
IN100_triangles_2d_gmt.ps
They should be exactly the same, it just gives you a choice of format. The *.ps file is recommended because it has scalable resolution. This is illustrated below.


The next graph we make will be a grain boundary plane distribution at a fixed misorientation (39° around [110]). As always, we have to configure the parameters in input.txt for the run. These parameters are described in the lower part of the input.txt file.
In this case, change the name of the file labeled input_110_39.txt to input.txt. This file has been preconfigured to work, so do not change anything other than the file name.
To run, just type and enter dist_graph on the command line.
The run time terminal output you should get can be viewed here here
After the program has run, it has written the file IN100_triangles_110_39_gmt1.dat. This is simply a text file with the values to plot. We use GMT to plot it. GMT is controlled by the script: ./Draw_stereograms.
Just before the program completed, it provided guidance on the parameters needed for GMT. If you copy and paste the suggested line:
./Draw_stereograms 1 IN100_triangles_110_39_gmt 5d rainbow 0.159 3.098 0.294
into the terminal, it will draw the graph. However you can make a better graph by editing the minimum, maximum, and interval values so that they are 'round' numbers. Instead of "0.159 3.098 0.294," I used "0 3.2 0.5".
At the end of this process, you should have two files:
IN100_triangles_110_39_gmt.tif
and
IN100_triangles_110_39_gmt.ps
They should be exactly the same, it just gives you a choice of format. The *.ps file is recommended because it has scalable resolution. This is illustrated below.


We can repeat this at any fixed disorientation. To illustrate how to do this, we will plot the distribution for for 60° around [111]. As always, we have to configure the parameters in input.txt for the run. These parameters are described in the lower part of the input.txt file.
In this case, change the name of the file labeled input_111_60.txt to input.txt. This file has been preconfigured to work, so do not change anything other than the file name.
To run, just type and enter dist_graph on the command line.
The run time terminal output you should get can be viewed here here
After the program has run, it has written the file IN100_triangles_111_60_gmt1.dat. This is simply a text file with the values to plot. We use GMT to plot it. GMT is controlled by the script: ./Draw_stereograms.
Just before the program completed, it provided guidance on the parameters needed for GMT. If you copy and paste the suggested line:
./Draw_stereograms 1 IN100_triangles_111_60_gmt 5d rainbow 6.335 1825.983 181.965
into the terminal, it will draw the graph. However you can make a better graph by editing the minimum, maximum, and interval values so that they are 'round' numbers. Instead of "6.335 1825.983 181.965," I used "0 1800 300".
At the end of this process, you should have two files:
IN100_triangles_111_60_gmt.tif
and
IN100_triangles_111_60_gmt.ps
They should be exactly the same, it just gives you a choice of format. The *.ps file is recommended because it has scalable resolution. This is illustrated below.


Finally, the program will also determine that distribution at any arbitrary list of points in the 5D space. These can be in a text file where first line is the number of points that dist_graph will expect, and then each additional line is the axis, angle, grain boundary normal vector. Six examples of such files are included in the program folder. For example, the file grid_points_[111]_twist.txt and five others labeled grid_points_*.txt. grid_points_[111]_twist.txt is a list of [111] twist grain boundaries.
To run the program for such a list, you just have to configure the input.txt file. In this case, change the name of the file labeled input_points.txt to input.txt. This file has been preconfigured to work, so do not change anything other than the file name.
To run, just type and enter dist_graph on the command line.
The run time terminal output you should get can be viewed here here
After the program has run, it has written the file IN100_triangles_grid_points_[111]_twist.txt. This is simply a text file with the values that can be plotted by any graphics program.

Return To Main Page