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):
|
||||
"""Material configuration."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initialize object with all required dictionary keys."""
|
||||
super().__init__()
|
||||
self['material'] = []
|
||||
self['homogenization'] = {}
|
||||
self['phase'] = {}
|
||||
_defaults = {'material': [],
|
||||
'homogenization': {},
|
||||
'phase': {}}
|
||||
|
||||
def __init__(self,d={}):
|
||||
"""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):
|
||||
"""
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
homogenization:
|
||||
SX:
|
||||
N_constituents: 2
|
||||
mech: {type: none}
|
||||
N_constituents: 1
|
||||
mechanics: {type: none}
|
||||
Taylor:
|
||||
N_constituents: 2
|
||||
mech: {type: isostrain}
|
||||
mechanics: {type: isostrain}
|
||||
|
||||
material:
|
||||
- constituents:
|
||||
|
@ -34,11 +34,11 @@ material:
|
|||
phase:
|
||||
Aluminum:
|
||||
lattice: cF
|
||||
mech:
|
||||
mechanics:
|
||||
output: [F, P, F_e, F_p, L_p]
|
||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
Steel:
|
||||
lattice: cI
|
||||
mech:
|
||||
mechanics:
|
||||
output: [F, P, F_e, F_p, L_p]
|
||||
elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
|
||||
|
|
Loading…
Reference in New Issue