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]:
material:
  - constituents:
      - O: [0.8171296620854447, -0.1824317604781739, -0.3416699572810903, -0.4269419262622249]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.3565851331729113, 0.6308060994006862, 0.6569020104903143, -0.20835176114622042]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.09505569283456058, -0.06325323667965059, 0.42090460353728015, -0.8998904144563464]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.767544187627544, -0.4710333293217168, -0.22727178216091076, -0.3706090389354746]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.5238546525864682, 0.5804966359885964, 0.43082387926315274, 0.45054494073963613]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.051022012010778786, -0.8326027286196069, -0.48003449084973665, -0.2715443576659093]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.1830314241865812, -0.7382781772179258, -0.5318535568679533, 0.3722588143360954]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.6409569953914004, -0.014158441839969348, -0.027685764366385666, -0.7669466520136466]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.13478780407568894, -0.013425333544520475, 0.030686411101591034, 0.9903082108441674]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.899888012540482, -0.007205349550090709, -9.757107663067311e-05, -0.43606150747765793]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.5611309827283841, -0.001962409771224051, -0.021203706369585837, 0.8274530633252619]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.15547400655321983, -0.028271832507648035, -0.004001652602952091, -0.9874272244319549]
        phase: phase_A
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.99615440813015, -0.021267595930789186, 0.08479889749941728, 0.00576467770812017]
        phase: phase_B
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9978224360408066, 0.012686613797118405, 0.040971429081000384, -0.05010766371538226]
        phase: phase_B
        v: 1.0
    homogenization: SX
  - constituents:
      - O: [0.9999278577185343, -0.0017875658022928227, 0.0040855172982117915, -0.011153139259023299]
        phase: phase_B
        v: 1.0
    homogenization: SX

homogenization: {}

phase: {}