# makeTabO

## Introduction¶

HOMAT or ABAQUS analysis of a polycrystal RVE need phase (material) and orientation data as input. The converter Mesh2XXX requires a tabular file in MICRESS TabO format to provide this additional information. However, this data might be missing from time to time and it can be useful to have a meaningful replacement.

This Python script covers the following cases and generates a TabO file:

• A MICRESS simulation without activated orientation output (TabO) but activated grain data output (TabGD). The script will enrich the grain data with pseudo random orientations generated using an Halton sequence 1.

• A microstructure was synthesized by Neper. The script will convert the data given in the generated 'stcell' file to a TabO file format. Phases can be assigned to grains by various algorithms (see parameter description). Orientations will be added from a given orientation file (*.ori), generated using an Halton sequence, or given orientation classes.

## Execution¶

The script requires Python 2.7. makeTabO supports the following command-line parameters. All arguments are case-sensitive. To see an overview, call the help as follows:

makeTabO.py -h


This will generate the following output:

usage: makeTabO.py [-h] [-t {tabGD,neper}] [-s SEED] [-d DIAMETERS DIAMETERS]
[-f FRACTIONS FRACTIONS] [-oc ORIENTATION_CLASSES]
input

positional arguments:
input               base input name (extension will be added
automatically)

optional arguments:
-h, --help        show this help message and exit
-t {tabGD,neper}, --type {tabGD,neper}
type of input
-s SEED, --seed SEED  Seed for generating Halton sequence of orientations
[integer]
-d DIAMETERS DIAMETERS, --diameters DIAMETERS DIAMETERS
diameter thresholds (float array of size 2) (used in Neper mode)
-f FRACTIONS FRACTIONS, --fractions FRACTIONS FRACTIONS
target phase fractions (float array of size 2, sum = 1) (used in Neper mode)
-oc ORIENTATION_CLASSES, --orientation_classes ORIENTATION_CLASSES
2D orientaton classes "[[classes for phase 1],[classes for phase 2]]"
Each class is a tuple [<angle>,<variance>,<fraction>] (used in Neper mode).


The most basic usage-scenario is calling the script with a type and base name of the input without any further optional arguments, such as

makeTabO.py -t tabGD GrainGrowth
makeTabO.py -t neper n996_125


the extension 'TabGD' (MICRESS) or 'stcell' and 'ori' (NEPER) will be appended automatically. 'tabGD' is the default type.

## Options¶

The following optional parameters can by used with 'tabGD' input:

• -s or --seed
The algorithm for generating the Halton sequence for orientations is using a seed integer value. Same seeds will result in the same orientation sequence.

Options for Neper only:

• no options
Phases will be assigned to grains accordings to the input stcell file (last column of input file). The resulting fractions will be calculated by using the volume outlined in the 2nd column of the stcell file.

• -f or --fractions
Grains can be assigned to 2 different phases. With this parameter, the targeted volume fractions of the resulting phase assignment can be specified. The algorithm will try to assign grains to phases in a way that it gets close to the desired fractions. See also diameter parameter. If no fractions are given, grains will get the phase specified in the Neper input.

Example:

makeTabO.py -t neper -f 0.2 0.8 myfile

• -d or --diameters
These two diameter thresholds (x,y) are used to assign grains with (diameter < x) to phase 1 and (diameter > y) to phase 2. Grains with a diameter in between these thresholds will be assigned to match the given fractions. The diameter has to be the first column in the Neper input file.

Example:

makeTabO.py -t neper -f 0.2 0.8 -d 10.0 20.0 myfile


All grains with a diameter <= 10.0 (in Neper unit lengths) are assigned to phase 1 and >= 20 to phase 2. The residual grains between both diameters will be assigned respectively to phase 1 or phase 2 in order to match the targeted fractions of 20% for phase 1 and 80% for phase 2.

• -oc or --orientation_classes (2D only) Orientations can be assigned to grains by specific classes described by a tuple of values: angle, variance and fraction. angle is the mean orientation with a variance. The number of grains assigned to an orientation classes depends on the given fraction. Given the phases of grains determined by the above options, a list of classes can be defined for phase 1 and 2. Orientations assigned before will be overwritten. The parameter is read as a string ("" necessary) which will be interpreted as Python array.

Example:

makeTabO.py -t neper -f 0.2 0.8 -oc "[[[60.0,0.5,1.0]],[[0.0,0.5,0.3],[30.0,0.5,0.7]]]" myfile


All grains of phase 1 will get an orientation of 60 degree with a variance of 0.5 degree. Grains of phase 2, having a total volume fraction of 80% will be divided into grains with a mean orientation of 0.0 degree and 30.0 degree according to the given targeted volume fractions of 30%, resp. 70%. The variance of 0.5 degree is the same for both generated classes.

### Other options¶

-h or --help print a help message.

1. J. H. Halton. On the efficiency of certain quasi-random sequences of points in evaluating muti-dimensional integrals. Num. Math., 2:84–90, 1960.