simplified
This commit is contained in:
parent
0e499eedf3
commit
b2289e80b2
|
@ -226,10 +226,11 @@ class ConfigMaterial(Config):
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
>>> import damask
|
>>> import damask
|
||||||
>>> m = damask.ConfigMaterial()
|
|
||||||
>>> O = damask.Rotation.from_random(3).as_quaternion()
|
>>> O = damask.Rotation.from_random(3).as_quaternion()
|
||||||
>>> phase = ['Aluminum','Steel','Aluminum']
|
>>> phase = ['Aluminum','Steel','Aluminum']
|
||||||
>>> m.material_add(constituents={'phase':phase,'O':O},homogenization='SX')
|
>>> m = damask.ConfigMaterial().material_add(constituents={'phase':phase,'O':O},
|
||||||
|
... homogenization='SX')
|
||||||
|
>>> m
|
||||||
material:
|
material:
|
||||||
- constituents:
|
- constituents:
|
||||||
- O: [0.577764, -0.146299, -0.617669, 0.513010]
|
- O: [0.577764, -0.146299, -0.617669, 0.513010]
|
||||||
|
@ -259,8 +260,7 @@ class ConfigMaterial(Config):
|
||||||
for i in range(len(c)):
|
for i in range(len(c)):
|
||||||
c[i][k] = v
|
c[i][k] = v
|
||||||
dup = copy.deepcopy(self)
|
dup = copy.deepcopy(self)
|
||||||
if 'material' not in dup: dup['material'] = []
|
dup['material'] = dup['material'] + c if 'material' in dup else c
|
||||||
dup['material'] +=c
|
|
||||||
|
|
||||||
return dup
|
return dup
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue