Create Texure for a Dual-Phase Microstructure

[1]:
import damask
import numpy as np
[2]:
r = damask.Rotation.from_random(7)
f = damask.Rotation.from_fiber_component([1,0],[1,0],5.,5,
                                         degrees=True)
g = damask.Rotation.from_spherical_component(damask.Rotation(),7.5,3,
                                             degrees=True)
[3]:
config = damask.ConfigMaterial()
config = config.material_add(O=np.vstack([r.as_quaternion(),f.as_quaternion()]),
                             phase='phase_A',homogenization='SX')
config = config.material_add(O=g,
                             phase='phase_B',homogenization='SX')
[4]:
print('is valid:',config.is_valid,'\n')

print(config)

config.save()
is valid: True

material:
  - constituents:
      - O: [0.8315564410810052, 0.19677798902790158, -0.1266076827283572, 0.5037487498793256]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.223793173523216, -0.09527851012040563, -0.6079981003167635, -0.7557624831948528]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.6547982343981062, 0.0816772879256619, 0.743946963021531, -0.10540877134884064]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.02939757224616157, -0.3470127118926654, -0.3516655673180307, 0.8689357221876756]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.40995012082994053, -0.12672837997001848, 0.8943106538121749, -0.12684348867692008]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.7357245510325712, -0.13164415835998988, -0.16865590325376983, 0.6425997096756787]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.44217107886197327, -0.29985374072648124, 0.845197761644725, -0.014601880054341121]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9698853450794067, 0.0032926870536240434, -0.014314904350675207, -0.24311861122834305]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.99915163059566, 0.01986250882421071, -0.03593020675665006, 0.0032434647626044277]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.34286821668831585, -0.06093875614183279, 0.06527200785240667, -0.9351296268302998]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.6237187628942247, -0.014308406711787862, -0.055779616185839855, 0.779524732596233]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.059408889769413276, -0.013937198837548499, -0.001981595262477956, -0.998134465683429]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9998891172145261, 0.009214131584074511, -0.008913532124163178, -0.0075764107714993475]
        phase: phase_B
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9934244899446183, -0.054293472572214965, -0.04235538458445767, 0.09146596640842905]
        phase: phase_B
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9974340799594351, 0.06768566239867743, 0.018561418032657866, -0.014120233770883436]
        phase: phase_B
        v: 1.0
    homogenization: SX

homogenization: {}

phase: {}