Create Texture for a Dual-Phase Microstructure#
Contributor: Martin Diehl (https://martin-diehl.net) and Philip Eisenlohr (eisenlohr@egr.msu.edu)
DAMASK version: 3.0.1
[1]:
import damask
import numpy as np
[2]:
rng = np.random.default_rng(20191102)
rnd = damask.Rotation.from_random(7,rng_seed=rng)
fbr = damask.Rotation.from_fiber_component(crystal=[1,0],sample=[1,0],
sigma=5.0,shape=5,degrees=True,rng_seed=rng)
sph = damask.Rotation.from_spherical_component(center=damask.Rotation(),
sigma=7.5,shape=3,degrees=True,rng_seed=rng)
[3]:
config = damask.ConfigMaterial()\
.material_add(O=rnd,phase='phase_A',homogenization='SX')\
.material_add(O=fbr,phase='phase_A',homogenization='SX')\
.material_add(O=sph,phase='phase_B',homogenization='SX')
[4]:
print(f'configuration is{" " if config.is_valid else " not "}valid\n')
config.save('material.yaml')
config
configuration is valid
[4]:
homogenization: {SX: null}
phase: {phase_A: null, phase_B: null}
material:
- constituents:
- phase: phase_A
O: [0.004702411137213036, -0.9582446864633862, 0.1084379916089085, 0.2645490694937509]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.9147097460704486, -0.19068436891182194, 0.29014401444532145, -0.20678975501215882]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.10677819003833185, -0.4427133706883004, 0.13690394495734726, 0.879693468999888]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.8664338002923555, 0.04448357787828491, -0.4945927532088464, 0.05188149461403649]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.5621873738314133, 0.0028841916095125584, -0.817023371343172, -0.1281009321680984]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.1566777437467901, -0.8117282158019414, 0.5096142534839398, 0.23841707348975383]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.3559036203819333, 0.1946923701552408, 0.058744995087853975, -0.9121274689178566]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.9771533909925617, -0.004863833273663818, 0.0008445415419241075, -0.2124779526144011]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.6921032914673376, 0.00817270051964545, -0.037844830565611096, 0.7207593285596475]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.6308552503099563, -0.006973671244216273, 0.011666838427685728, -0.7757814807965207]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.04005625494335174, 0.01884514680214138, -0.002401907084394964, 0.9990168105313728]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_A
O: [0.7504344649005134, -0.042579315396452024, -0.03664528346481829, -0.6585531405965905]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_B
O: [0.9997077237860604, 0.001416270072543795, -0.006186872760829418, -0.023327747148338917]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_B
O: [0.9995113630353349, -0.026949863155362304, -0.006163317612475039, -0.014586074014681495]
v: 1.0
homogenization: SX
- constituents:
- phase: phase_B
O: [0.9999201916445849, 0.0012798700391004722, -0.006185971515045718, -0.010941025114429064]
v: 1.0
homogenization: SX