```{index} single: Filters; Compute GBPD (Metric-Based Approach)
```
# Compute GBPD (Metric-Based Approach)
## Group (Subgroup)
Statistics (Crystallographic)
## Description
This **Filter** computes the grain boundary plane distribution (GBPD) like that shown in Fig. 1. It should be noted that most GBPDs presented so far in literature were obtained using a method based on partition of the grain boundary space into bins, similar to that implemented in the *Compute GBCD* **Filter**. This **Filter** calculates the GBPD using an alternative approach adapted from the one included in the *Compute GBCD (Metric-based Approach)* **Filter** and described by K. Glowinski and A. Morawiec in [Analysis of experimental grain boundary distributions based on boundary-space metrics, Metall. Mater. Trans. A 45, 3189-3194 (2014)](http://link.springer.com/article/10.1007%2Fs11661-014-2325-y). Briefly, the GBPD is probed at evenly distributed sampling directions (similarly to *Compute GBCD (Metric-based Approach)* **Filter**) and areas of mesh segments with their normal vectors deviated by less than a limiting angle ρp from a given direction are summed. If *n*S is the number of crystal symmetry transformations, each boundary plane segment is represented by up to 4 × *n*S equivalent vectors, and all of them are processed. It is enough to sample the distribution at directions corresponding to the standard stereographic triangle (or, in general, to a fundamental region corresponding to a considered crystallographic point group); values at remaining points are obtained based on crystal symmetries. After summing the boundary areas, the distribution is normalized. First, the values at sampling vectors are divided by the total area of all segments. Then, in order to express the distribution in the conventional units, i.e., multiples of random distribution (MRDs), the obtained fractional values are divided by the volume *v* = (*A* nS) / (4π), where *A* is the area of a spherical cap determined by ρp.

This **Filter** also calculates statistical errors of the distributions using the formula
ε = ( *f* *n* *v* )1/2, where ε
is the relative error of the distribution function at a given point, *f* is the value of the function at that point, and *n* stands for the number of grain boundaries (**not** the number of mesh triangles) in the considered network. The errors can be calculated either as their absolute values, i.e., ε × *f* or as relative errors, i.e., 100% × ε. The latter are computed in a way that if the relative error exceeds 100%, it is rounded down to 100%.
See also the documentation for {ref}`Compute GBCD (Metric-based Approach) Filter ` for additional information.
## Format of Output Files
Output files are formatted to be readable by GMT plotting program. The first line is always "0.0 0.0 0.0 0.0". Each of the remaining lines contains three numbers. The first two columns are angles (in degrees) describing a given sampling direction; let us denote them *col*1 and *col*2, respectively. The third column is either the value of the GBCD (in MRD) for that direction or its error (in MRD or %, depending on user's selection). If you use other software, you can retrive spherical angles θ and φ of the sampling directions in the following way:
θ = 90° - *col*1
φ = *col*2
Then, the directions are given as [ sin θ × cos φ , sin θ × sin φ , cos θ ].
## Feedback
In the case of any questions, suggestions, bugs, etc., please feel free to email the author of this **Filter** at kglowinski *at* ymail.com
### Input Parameter(s)
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Phase of Interest | Scalar Value |Int32 | Index of the Ensemble for which to compute GBPD; boundaries having grains of this phase on both its sides will only be taken into account |
| Limiting Distance [deg.] | Scalar Value |Float32 | The max angle from within which mesh segments are selected |
| Number of Sampling Points (on a Hemisphere) | Scalar Value |Int32 | The approximate number of sampling directions |
| Exclude Triangles Directly Neighboring Triple Lines | Bool | | If checked, only interiors of Faces are included in GBCD |
| Save Relative Errors Instead of Their Absolute Values | Bool | | Whether or not to save the distribution errors as relative (if exceeds 100%, then rounded down) or absolute |
| Triangle Geometry | Geometry Selection | Triangle | The complete path to the triangle geometry |
### Input Triangle Geometry Vertex Data
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Node Types | Array Selection | Allowed Types: int8 Comp. Shape: 1 | Specifies the type of node in the Geometry |
### Input Triangle Geometry Face Data
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Face Labels | Array Selection | Allowed Types: int32 Comp. Shape: 2 | Specifies which Features are on either side of each Face |
| Face Normals | Array Selection | Allowed Types: float64 Comp. Shape: 3 | Specifies the normal of each Face |
| Face Areas | Array Selection | Allowed Types: float64 Comp. Shape: 1 | Specifies the area of each Face |
### Input Triangle Geometry Face Feature Data
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Feature Face Labels | Array Selection | Allowed Types: int32 Comp. Shape: 2 | Specifies which original Features are on either side of each boundary Feature |
### Input Feature Data
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Average Euler Angles | Array Selection | Allowed Types: float32 Comp. Shape: 3 | Three angles defining the orientation of the Feature in Bunge convention (Z-X-Z) |
| Phases | Array Selection | Allowed Types: int32 Comp. Shape: 1 | Specifies to which phase each Feature belongs |
### Input Ensemble Data
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Crystal Structures | Array Selection | Allowed Types: uint32 Comp. Shape: 1 | Enumeration representing the crystal structure for each Ensemble |
### Output Parameters
| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Output Distribution File | FileSystemPath | | The output distribution file path (extension .dat, GMT format) |
| Output Distribution Errors File | FileSystemPath | | The output distribution errors file path (extension .dat, GMT format) |
## References
[1] K. Glowinski and A. Morawiec, Analysis of experimental grain boundary distributions based on boundary-space metrics, Metall. Mater. Trans. A 45, 3189-3194 (2014)
## Example Pipelines
## License & Copyright
Please see the description file distributed with this **Plugin**.
## DREAM3D-NX Help
If you need help, need to file a bug report or want to request a new feature, please head over to the [DREAM3DNX-Issues](https://github.com/BlueQuartzSoftware/DREAM3DNX-Issues/discussions) GitHub site where the community of DREAM3D-NX users can help answer your questions.