need to pass init argument to dict superclass
This commit is contained in:
parent
e11be7e600
commit
403ac693da
|
@ -9,12 +9,15 @@ from . import Orientation
|
||||||
class ConfigMaterial(Config):
|
class ConfigMaterial(Config):
|
||||||
"""Material configuration."""
|
"""Material configuration."""
|
||||||
|
|
||||||
def __init__(self):
|
_defaults = {'material': [],
|
||||||
"""Initialize object with all required dictionary keys."""
|
'homogenization': {},
|
||||||
super().__init__()
|
'phase': {}}
|
||||||
self['material'] = []
|
|
||||||
self['homogenization'] = {}
|
def __init__(self,d={}):
|
||||||
self['phase'] = {}
|
"""Initialize object with default dictionary keys."""
|
||||||
|
super().__init__(d)
|
||||||
|
for k,v in self._defaults.items():
|
||||||
|
if k not in self: self[k] = v
|
||||||
|
|
||||||
def save(self,fname='material.yaml',**kwargs):
|
def save(self,fname='material.yaml',**kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
homogenization:
|
homogenization:
|
||||||
SX:
|
SX:
|
||||||
N_constituents: 2
|
N_constituents: 1
|
||||||
mech: {type: none}
|
mechanics: {type: none}
|
||||||
Taylor:
|
Taylor:
|
||||||
N_constituents: 2
|
N_constituents: 2
|
||||||
mech: {type: isostrain}
|
mechanics: {type: isostrain}
|
||||||
|
|
||||||
material:
|
material:
|
||||||
- constituents:
|
- constituents:
|
||||||
|
@ -34,11 +34,11 @@ material:
|
||||||
phase:
|
phase:
|
||||||
Aluminum:
|
Aluminum:
|
||||||
lattice: cF
|
lattice: cF
|
||||||
mech:
|
mechanics:
|
||||||
output: [F, P, F_e, F_p, L_p]
|
output: [F, P, F_e, F_p, L_p]
|
||||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||||
Steel:
|
Steel:
|
||||||
lattice: cI
|
lattice: cI
|
||||||
mech:
|
mechanics:
|
||||||
output: [F, P, F_e, F_p, L_p]
|
output: [F, P, F_e, F_p, L_p]
|
||||||
elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
|
elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
|
||||||
|
|
Loading…
Reference in New Issue