upxo.pxtal.single_phased module

class upxo.pxtal.single_phased.OFHC_Cu_vox(lgi=None, ea=None)[source]

Bases: object

class TwinSetup(nprops: int, mprops: list, twin_axis: tuple)[source]

Bases: object

nprops: int
mprops: list
twin_axis: tuple
class TwinMorphSpec_v1(n: list, tv: numpy.array, dlk: bool, dnw: numpy.array, dno: numpy.array, tdis: str)[source]

Bases: object

n: list
tv: numpy.array
dnw: numpy.array
dno: numpy.array
tdis: str
dlk: bool
class FDB[source]

Bases: object

class MPropSetup(volnv: dict, rat_sanv_volnv: dict)[source]

Bases: object

volnv: dict
rat_sanv_volnv: dict
fdb
twin_setup
twspec
add_to_fdb(name, value)[source]

Add or update a named entry in the feature data base.

Examples

value = {'lgi': lgi,
         'ea': ea,
         'mprops': None,
         'neigh_fid': None}
pxtal.add_to_fdb('base', value)
add_data_to_fdb(name, value, calc_flag)[source]

Add or update a named field in the feature data base.

setup_twins()[source]

Alias for setup_for_twins; defers to add_to_fdb.

setup_for_twins(nprops=2, mprops=None, instance_name='twin.0', feature_name='annealing_twin', viz_grains=False, opacity=1.0)[source]

Carry out pre-requisite operations needed to establish twins

setup_gid_twin(GIDS)[source]

Initialise self.gid_twin as a dict mapping each host grain id to None.

add_fdb(*, fname, dnames, datas, info)[source]

Add feature data base entry.

Return type:

None

Examples

self.add_fdb(fname='twin_01',
             dnames='fid',
             datas=123,
             info={'a': 1, 'b': 2})

Notes

Intended for internal use.

find_twin_hosts(nprops=2, mprops={'rat_sanv_volnv': {'k': [0.1, 0.8], 'reset': False, 'sanv_N': 26, 'use': True}, 'volnv': {'k': [0.1, 0.8], 'min_vol': 4, 'reset': False, 'use': True}}, viz_grains=False, opacity=1.0)[source]

Identify grains eligible to host annealing twins based on morphological properties.

dim
uigrid
uimesh
m
s
S
ndimg_label_pck
binaryStructure3D
n
lgi
xax
yax
zax
vox
axlim
domain_volume
spart_flag
gid
s_gid
gid_s
s_n
g
gb
positions
mp
vox_size
gid_twin
prop_flag
prop
are_properties_available
prop_stat
info
pvgrid
ellfits
skimrp
sssr
valid_scalar_fields
pointclouds_pv
mprop
lgi_slice
grain_locs
feat_locs
gpos
spbound
spboundex
gid_imap_keys
gid_imap
neigh_gid
no_gid
noth_gid
Lgbp_all
Ggbp_all
gbpstack
gbpids
gbp_id_maps
gbp_ids
gid_pair_ids
gid_pair_ids_rev
gid_pair_ids_unique_lr
gid_pair_ids_unique_rl
gbsurf_pids_vox
gid_pair_gbp_IDs
gid_pair_gbp_coords
gid_gpid
triples
ctrls
tc_info
cluster_sets
set_mprop_volnv()[source]

Calculate the volume by number of voxels.

set_mprop_sanv(N=26, verbosity=100)[source]

Calculate the total surface area by number of voxels.

set_mprop_rat_sanv_volnv(reset_volnv=False, reset_sanv=False, N=26, verbosity=100)[source]

Compute surface-area-to-volume ratio metric rat_sanv_volnv for each grain.

instantiate_twins(ninstances=2, base_gs_name_prefix='twin.', reset_fdb=True, reset_keystring='twin.', make_sep_pvgrds=False, save_twin_coords=False, clean_verbosity_interval_1=250)[source]

# —–> FEATURE IDS

gstslice.fdb[“twin.0”][“data”][“feat_host_gids”] This has all gids initialliy selected for introducing twins. For grain ids which actually host twins, refer gstslice.fdb[“twin.0”][“data”][“feat_host_ids”] instead.

gstslice.fdb[“twin.0”][“data”][“feat_host_ids”] Feature (i.e. grain) ids which actually host twins.

gstslice.fdb[“twin.0”][“data”][“twin_map_g_t_missed”] Numpy array containing the list of parent feature IDs which were misses duringh twin instantiation. These are featre IDs initially selected for twin generation, but later rejected as twins could not be produced with the user specified algorithm control parameter values.

gstslice.fdb[“twin.0”][“data”][“notwin_gids”] Parent features i.e. grains, which were not selected to parent any children i.e. twins.

gstslice.fdb[“twin.0”][“data”][“twin_id”] Twin ID numbers

gstslice.fdb[“twin.0”][“data”][“twin_map_g_t”] Contains parent to children map. As a dictionary, keys are parent feature IDs. A value is a list of children feature IDs, which in this case are twin IDs.

gstslice.fdb[“twin.0”][“data”][“map_cp”] Dictiobnary having keys as twin IDs and values as parent IDs. This is a reverse map of twin ID to parent ID. len(gstslice.fdb[“twin.0”][“data”][“map_cp”].keys()) gives the total number of children, which can also abe obtained as sum(gstslice.fdb[“twin.0”][“data”][“twin_map_g_nt”].values()). In fact, in some UPXO twined grain structure, len(gstslice.fdb[“twin.0”][“data”][“map_cp”].keys()) was 383, sum(gstslice.fdb[“twin.0”][“data”][“twin_map_g_nt”].values()) was also 383 and len(gstslice.fdb[“twin.0”][“data”][“twin_id”]) was also 383. # —————————————– # —–> DEPRECATED

gstslice.fdb[“twin.0”][“data”][“twin_i”] DEPRECATED. Commented in code.

gstslice.fdb[“twin.0”][“data”][“parent_id”] numpy array of parent IDs which actually host children features. DEPRECTAED. This is the same as gstslice.fdb[“twin.0”][“data”][“feat_host_ids”]. Commented out in code.

gstslice.fdb[“twin.0”][“data”][“twin_zero_voxels”] List of twin IDs with zero voxels. Should be empty. To be deprecated. # —————————————– # —–> COORDINATES

gstslice.fdb[“twin.0”][“data”][“twin_coords”] Coordinates of twins. len(gstslice.fdb[“twin.0”][“data”][“twin_coords”]) is same as len(gstslice.fdb[“twin.0”][“data”][“parent_id”]).

gstslice.fdb[“twin.0”][“data”][“twin_map_g_t_coords”] Contains voxel coordinates of the twinned regions. Keys are parent feature ID. Value is dict with keys as children feature IDs and values being corresponding numpy cooridnate arrays. # —————————————– # —–> SIZE AND CONTENT PROPERTIES

gstslice.fdb[“twin.0”][“data”][“twin_vol”] Twin volumes

gstslice.fdb[“twin.0”][“data”][“twin_vf”] Twin volume fractions

gstslice.fdb[“twin.0”][“data”][“twin_map_g_nt”] Contains parent to children count map. As a dictionary, keys are parent feature IDs. A value is the length of the list of children feature IDs.

gstslice.fdb[“twin.0”][“data”][“twin_vol_total”] This is total volume of twins across the entire domain. It is numpy.int32 type.

gstslice.fdb[“twin.0”][“data”][“twin_vf_total”] This is the overall volume fraction of twins.

gstslice.fdb[“twin.0”][“data”][“twin_map_g_t_nvox”] Contains parent to children voxel count map. As a dictionary, keys are parent feature IDs. A value is the list of total number of voxels in each child feature. List size will be the total child feature count for the current parent feature ID.

gstslice.fdb[“twin.0”][“data”][“twin_nvox”] Total number of voxels across all children features (dict value) for a given parent feature ID (dict key). # —————————————– gstslice.fdb[“twin.0”][“data”][“pvgrid”] This is the PyVista grid having gstslice.fdb[“twin.0”][“data”][“fid”] as scalar field.

gstslice.fdb[“twin.0”][“data”][“parent_feature”] String value containing, the name of the parent feature, which in this case is ‘grain’.