adjusted to new names
This commit is contained in:
parent
a04966582a
commit
1b18cae46b
|
@ -4,28 +4,28 @@ homogenization:
|
||||||
Taylor:
|
Taylor:
|
||||||
mech: {N_constituents: 2, type: isostrain}
|
mech: {N_constituents: 2, type: isostrain}
|
||||||
|
|
||||||
microstructure:
|
material:
|
||||||
- constituents:
|
- constituents:
|
||||||
- fraction: 1.0
|
- fraction: 1.0
|
||||||
orientation: [1.0, 0.0, 0.0, 0.0]
|
O: [1.0, 0.0, 0.0, 0.0]
|
||||||
phase: Aluminum
|
phase: Aluminum
|
||||||
homogenization: SX
|
homogenization: SX
|
||||||
- constituents:
|
- constituents:
|
||||||
- fraction: 1.0
|
- fraction: 1.0
|
||||||
orientation: [0.7936696712125002, -0.28765777461664166, -0.3436487135089419, 0.4113964260949434]
|
O: [0.7936696712125002, -0.28765777461664166, -0.3436487135089419, 0.4113964260949434]
|
||||||
phase: Aluminum
|
phase: Aluminum
|
||||||
homogenization: SX
|
homogenization: SX
|
||||||
- constituents:
|
- constituents:
|
||||||
- fraction: 1.0
|
- fraction: 1.0
|
||||||
orientation: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
O: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
||||||
phase: Aluminum
|
phase: Aluminum
|
||||||
homogenization: SX
|
homogenization: SX
|
||||||
- constituents:
|
- constituents:
|
||||||
- fraction: 0.5
|
- fraction: 0.5
|
||||||
orientation: [0.28645844315788244, -0.022571491243423537, -0.467933059311115, -0.8357456192708106]
|
O: [0.28645844315788244, -0.022571491243423537, -0.467933059311115, -0.8357456192708106]
|
||||||
phase: Aluminum
|
phase: Aluminum
|
||||||
- fraction: 0.5
|
- fraction: 0.5
|
||||||
orientation: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
O: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
||||||
phase: Steel
|
phase: Steel
|
||||||
homogenization: Taylor
|
homogenization: Taylor
|
||||||
|
|
||||||
|
|
|
@ -35,29 +35,29 @@ class TestConfigMaterial:
|
||||||
|
|
||||||
def test_invalid_orientation(self,reference_dir):
|
def test_invalid_orientation(self,reference_dir):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
material_config['microstructure'][0]['constituents'][0]['orientation']=[0,0,0,0]
|
material_config['material'][0]['constituents'][0]['O']=[0,0,0,0]
|
||||||
assert not material_config.is_valid
|
assert not material_config.is_valid
|
||||||
|
|
||||||
def test_invalid_fraction(self,reference_dir):
|
def test_invalid_fraction(self,reference_dir):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
material_config['microstructure'][0]['constituents'][0]['fraction']=.9
|
material_config['material'][0]['constituents'][0]['fraction']=.9
|
||||||
assert not material_config.is_valid
|
assert not material_config.is_valid
|
||||||
|
|
||||||
@pytest.mark.parametrize('item',['homogenization','phase','microstructure'])
|
@pytest.mark.parametrize('item',['homogenization','phase','material'])
|
||||||
def test_incomplete_missing(self,reference_dir,item):
|
def test_incomplete_missing(self,reference_dir,item):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
del material_config[item]
|
del material_config[item]
|
||||||
assert not material_config.is_complete
|
assert not material_config.is_complete
|
||||||
|
|
||||||
@pytest.mark.parametrize('item',['orientation','phase'])
|
@pytest.mark.parametrize('item',['O','phase'])
|
||||||
def test_incomplete_material_constituent(self,reference_dir,item):
|
def test_incomplete_material_constituent(self,reference_dir,item):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
del material_config['microstructure'][0]['constituents'][0][item]
|
del material_config['material'][0]['constituents'][0][item]
|
||||||
assert not material_config.is_complete
|
assert not material_config.is_complete
|
||||||
|
|
||||||
def test_incomplete_material_homogenization(self,reference_dir):
|
def test_incomplete_material_homogenization(self,reference_dir):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
del material_config['microstructure'][0]['homogenization']
|
del material_config['material'][0]['homogenization']
|
||||||
assert not material_config.is_complete
|
assert not material_config.is_complete
|
||||||
|
|
||||||
def test_incomplete_phase_lattice(self,reference_dir):
|
def test_incomplete_phase_lattice(self,reference_dir):
|
||||||
|
@ -67,10 +67,10 @@ class TestConfigMaterial:
|
||||||
|
|
||||||
def test_incomplete_wrong_phase(self,reference_dir):
|
def test_incomplete_wrong_phase(self,reference_dir):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
new = material_config.microstructure_rename_phase({'Steel':'FeNbC'})
|
new = material_config.material_rename_phase({'Steel':'FeNbC'})
|
||||||
assert not new.is_complete
|
assert not new.is_complete
|
||||||
|
|
||||||
def test_incomplete_wrong_homogenization(self,reference_dir):
|
def test_incomplete_wrong_homogenization(self,reference_dir):
|
||||||
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
material_config = ConfigMaterial.load(reference_dir/'material.yaml')
|
||||||
new = material_config.microstructure_rename_homogenization({'Taylor':'isostrain'})
|
new = material_config.material_rename_homogenization({'Taylor':'isostrain'})
|
||||||
assert not new.is_complete
|
assert not new.is_complete
|
||||||
|
|
Loading…
Reference in New Issue