upxo.xtal.mcgrain2d_definitions module

class upxo.xtal.mcgrain2d_definitions.grain2d[source]

Bases: object

Per-grain data object for 2D Monte-Carlo / LFI polycrystals.

Attached under pxt.gs[tslice].g[gid]['grain'] on an mcgs2_grain_structure. Holds pixel locations, bounding-box masks, GB indices, and scikit-image property hooks used during characterisation.

Access pattern

pxt.gs[t].g[gid]['grain'].<attr>

loc, coords

Grain pixel locations / coordinates.

npixels

Number of pixels in the grain.

position

Relative placement in the polycrystal (centroid + boundary tag).

gbloc

Grain-boundary pixel locations.

bbox_bounds, bbox_ex_bounds, bbox, bbox_ex

Bounding-box bounds and masks (extended by one pixel where possible).

skprop

scikit-image regionprops handle when computed.

_px_area

Area of a single pixel.

gid

Grain ID (matches LFI / lgi label).

gind

Indices of grain pixels in the parent state matrix.

gbid, gbind

Grain-boundary ID and boundary-pixel indices in the parent matrix.

gbvert

Grain-boundary vertices.

gbsegs

grain boundary segments pxt.gs[t].g[gid][‘grain’].gbsegs

gbsegs_geo

grain boundary segments: dict with below keys: ‘info’: OPTIONS:

‘spg.menp’: Single Pixel Grain. Multi-edge not possible ‘slg.menp’: Straight line Grain. Multi-edge not possible

‘me’: Multi-edge pxt.gs[t].g[gid][‘grain’].gbsegs_geo

s

Monte-Car;o State value of the current grain pxt.gs[t].g[gid][‘grain’].s

sn

pxt.gs[t].g[gid][‘grain’].sn

neigh

GIDs of the neighbouring grains pxt.gs[t].g[gid][‘grain’].neigh

grain_core

Grain core region pxt.gs[t].g[gid][‘grain’].grain_core

gb_zone

Grain boundary zone pxt.gs[t].g[gid][‘grain’].gb_zone

subgrains

sub-grains inside grain. It shall also encompass any island_grains pxt.gs[t].g[gid][‘grain’].subgrains

paps

prior-austenite packats pxt.gs[t].g[gid][‘grain’].paps

blocks

block structuers in paps pxt.gs[t].g[gid][‘grain’].blocks

laths

Lath structures inside blocks pxt.gs[t].g[gid][‘grain’].laths

xstruc
Type:

Crystal Structure: ‘fcc’, ‘bcc’, ‘hcp’

xmin, xmax, ymin, ymax

pxt.gs[t].g[gid][‘grain’].(xmin, xmax, ymin, ymax)

control_points_mesh

Points places at strategic locations inside the grain to control mesh density of a conformal mesh pxt.gs[t].g[gid][‘grain’].control_points_mesh

ea_pixels

Euler snagles of all pixels

quats_pixels

Quaternions of all the pixesl int he grain

ref_quat

Reference quaternion value of the all pixes in the grain

ref_ea

Referecne Euler angle of all the pixesl in the grain

texcomp

T3exture component name to which the pixel would belong to. Defined at each of the pixesl in the grain

glb_pert_min_ea1,  glb_pert_max_ea1

Global minimum and maximum allowed perturbation to euler angle 1

glb_pert_min_ea2,  glb_pert_max_ea2

Global minimum and maximum allowed perturbation to euler angle 2

glb_pert_min_ea3,  glb_pert_max_ea3

Global minimum and maximum allowed perturbation to euler angle 3

lcl_pert_min_ea1, lcl_pert_max_ea1

Local minimum and maximum allowed perturbation to euler angle 1

lcl_pert_min_ea2, lcl_pert_max_ea2

Local minimum and maximum allowed perturbation to euler angle 2

lcl_pert_min_ea3, lcl_pert_max_ea3

Local minimum and maximum allowed perturbation to euler angle 3

--------------------------------------------------------------------------
_xgr_min_
Type:

Minimum value of the xgr of the parent grain structure

_xgr_max_
Type:

Maximum value of the xgr of the parent grain structure

_xgr_incr_
Type:

Increment value of the xgr of the parent grain structure

_ygr_min_
Type:

Minimum value of the ygr of the parent grain structure

_ygr_max_
Type:

Maximum value of the ygr of the parent grain structure

_xgr_incr_
Type:

Increment value of the ygr of the parent grain structure

rtol = 1e-06
loc
position
coords
gbloc
xmin
xmax
ymin
ymax
brec
bbox_bounds
bbox_ex_bounds
loctree
coordtree
bbox
bbox_ex
neigh
npixels
skprop
s
sn
gid
gind
gbid
gbind
grain_core
gb_zone
ea

Default values of non-grain boundary segment coordinates inside the bounding box. You may change this value np.nan if necessary. refer to demos/neighOps/neighOps-1.ipynb for usage example. use the appropriate setter and getter methods to operate on this attribute.

Type:

lfi_gbseg_empties

property lfi_gbseg_empties

Lfi gbseg empties.

property lfi_gbsegs

Convert the sparse storage into a full grain boundary segment lfi array.

set_quat()[source]

Set or update quat.

find_misori(angles)[source]

Find misori.

set_glb_ea_pert(pert_ea1, pert_ea2, pert_ea3)[source]

Set or update glb ea pert.

make_loctree()[source]

Build and return loctree.

property mean_ea

Mean ea.

make_coordtree()[source]

Build and return coordtree.

set_skprop()[source]

Set or update skprop.

make_prop(generator, skprop=True)[source]

Build and return prop.

property centroid

Centroid.

m
gbvert
gbsegs
gbsegs_geo
xgid
bbox_bz
bbox_core
plot(hold_on=False)[source]

Plot.

plotgb(hold_on=False)[source]

Plotgb.

plotgbseg(hold_on=False)[source]

Plotgbseg.