Create Texture for a Dual-Phase Microstructure#

[1]:
import damask
import numpy as np
[2]:
rnd = damask.Rotation.from_random(7)
fbr = damask.Rotation.from_fiber_component(crystal=[1,0],sample=[1,0],
                                           sigma=5.0,shape=5,degrees=True)
sph = damask.Rotation.from_spherical_component(center=damask.Rotation(),
                                               sigma=7.5,shape=3,degrees=True)
[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()
config
configuration is valid

[4]:
homogenization: {SX: null}
phase: {phase_A: null, phase_B: null}
material:
- constituents:
  - phase: phase_A
    O: [0.15093519547406106, 0.6408517773680587, 0.5542653253631022, 0.5092322803117861]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.10065663987949447, -0.8870570469909355, 0.3585678620369911, -0.27281335111411337]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.8020276055850013, 0.2840153575052528, -0.3912163450755843, -0.3507659731593908]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.10512520316253837, -0.46617153062557826, 0.36743735420318413, -0.7978863242532763]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.28774861343369623, -0.7529562679432722, 0.5295092693223004, 0.2643435789530137]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.11197213946410275, 0.2671782361723141, 0.6570810404014508, -0.6959328534022732]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.3130599812324952, 0.2885011928394853, 0.851756120276147, 0.30540468472672394]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.6709308365753393, -0.03499115953542194, 0.05204762320432019, -0.7388629617225801]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.996635680960474, 0.002130600001328447, 0.002406920114614181, 0.08189619475682905]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.9420360133165478, 0.014832267825094314, -0.008504432419523825, -0.3350758542107317]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.8843170980584047, -0.0008341164290721799, 0.011949442970649371, 0.4667330984021121]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_A
    O: [0.9807832111013471, 0.004300974762671467, -0.017762976969306288, -0.19424281476288618]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_B
    O: [0.9996229123852037, -0.027184578009375217, 0.0005262560921274401, 0.003841198706275199]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_B
    O: [0.99998258486503, 0.0029193101044743984, 0.0011998466152256992, 0.00498677884680965]
    v: 1.0
  homogenization: SX
- constituents:
  - phase: phase_B
    O: [0.9995499690155522, 0.0005798292459869174, -0.02814644524449467, 0.01035861280060744]
    v: 1.0
  homogenization: SX