fraction --> v
This commit is contained in:
parent
2c1f23d983
commit
14ce127dc4
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
|||
Subproject commit f3cd8f4c4b2d154e179d9bb5f396a77535f88556
|
||||
Subproject commit 3f915ee49eb7e5e26d4b9b5e5712de9e05e64d83
|
|
@ -8,102 +8,102 @@ material:
|
|||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [1.0, 0.0, 0.0, 0.0]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.7936696712125002, -0.28765777461664166, -0.3436487135089419, 0.4113964260949434]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.28645844315788244, -0.022571491243423537, -0.467933059311115, -0.8357456192708106]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.33012772942625784, -0.6781865350268957, 0.6494525351030648, 0.09638521992649676]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.43596817439583935, -0.5982537129781701, 0.046599032277502436, 0.6707106499919265]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.169734823419553, -0.699615227367322, -0.6059581215838098, -0.33844257746495854]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.9698864809294915, 0.1729052643205874, -0.15948307917616958, 0.06315956884687175]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.46205660912967883, 0.3105054068891252, -0.617849551030653, 0.555294529545738]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.4512443497461787, -0.7636045534540555, -0.04739348426715133, -0.45939142396805815]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.2161856212656443, -0.6581450184826598, -0.5498086209601588, 0.4667112513346289]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.8753220715350803, -0.4561599367657419, -0.13298279533852678, -0.08969369719975541]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.11908260752431069, 0.18266024809834172, -0.7144822594012615, -0.664807992845101]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.751104669484278, 0.5585633382623958, -0.34579336397009175, 0.06538900566860861]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.08740438971703973, 0.8991264096610437, -0.4156704205935976, 0.10559485570696363]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.5584325870096193, 0.6016408353068798, -0.14280340445801173, 0.5529814994483859]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.4052725440888093, 0.25253073423599154, 0.5693263597910454, -0.669215876471182]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.7570164606888676, 0.15265448024694664, -0.5998021466848317, 0.20942796551297105]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.6987659297138081, -0.132172211261028, -0.19693254724422338, 0.6748883269678543]
|
||||
- homogenization: SX
|
||||
constituents:
|
||||
- phase: Aluminum
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
O: [0.7729330445886478, 0.21682179052722322, -0.5207379472917645, 0.2905078484066341]
|
||||
|
||||
phase:
|
||||
|
|
|
@ -74,12 +74,12 @@ class ConfigMaterial(Config):
|
|||
material:
|
||||
- constituents:
|
||||
- O: [0.19, 0.8, 0.24, -0.51]
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- O: [0.8, 0.19, 0.24, -0.51]
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
phase: Steel
|
||||
homogenization: SX
|
||||
homogenization: {}
|
||||
|
@ -172,7 +172,7 @@ class ConfigMaterial(Config):
|
|||
if 'constituents' in v:
|
||||
f = 0.0
|
||||
for c in v['constituents']:
|
||||
f+= float(c['fraction'])
|
||||
f+= float(c['v'])
|
||||
if 'O' in c:
|
||||
try:
|
||||
Rotation.from_quaternion(c['O'])
|
||||
|
@ -257,17 +257,17 @@ class ConfigMaterial(Config):
|
|||
material:
|
||||
- constituents:
|
||||
- O: [0.577764, -0.146299, -0.617669, 0.513010]
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- O: [0.184176, 0.340305, 0.737247, 0.553840]
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
phase: Steel
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- O: [0.0886257, -0.144848, 0.615674, -0.769487]
|
||||
fraction: 1.0
|
||||
v: 1.0
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
homogenization: {}
|
||||
|
@ -312,7 +312,7 @@ class ConfigMaterial(Config):
|
|||
if hasattr(v,'__len__') and not isinstance(v,str): N_material = len(v)
|
||||
|
||||
if N == 1:
|
||||
m = [[{'fraction':1.0}] for _ in range(N_material)]
|
||||
m = [[{'v':1.0}] for _ in range(N_material)]
|
||||
for k,v in kwargs.items():
|
||||
if hasattr(v,'__len__') and not isinstance(v,str):
|
||||
if len(v) != N_material:
|
||||
|
|
|
@ -8,25 +8,25 @@ homogenization:
|
|||
|
||||
material:
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [1.0, 0.0, 0.0, 0.0]
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.7936696712125002, -0.28765777461664166, -0.3436487135089419, 0.4113964260949434]
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
||||
phase: Aluminum
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 0.5
|
||||
- v: 0.5
|
||||
O: [0.28645844315788244, -0.022571491243423537, -0.467933059311115, -0.8357456192708106]
|
||||
phase: Aluminum
|
||||
- fraction: 0.5
|
||||
- v: 0.5
|
||||
O: [0.3986143167493579, -0.7014883552495493, 0.2154871765709027, 0.5500781677772945]
|
||||
phase: Steel
|
||||
homogenization: Taylor
|
||||
|
|
|
@ -42,7 +42,7 @@ class TestConfigMaterial:
|
|||
|
||||
def test_invalid_fraction(self,ref_path):
|
||||
material_config = ConfigMaterial.load(ref_path/'material.yaml')
|
||||
material_config['material'][0]['constituents'][0]['fraction']=.9
|
||||
material_config['material'][0]['constituents'][0]['v']=.9
|
||||
assert not material_config.is_valid
|
||||
|
||||
@pytest.mark.parametrize('item',['homogenization','phase','material'])
|
||||
|
|
|
@ -265,7 +265,7 @@ subroutine material_parseMaterial
|
|||
frac = 0.0_pReal
|
||||
do co = 1, constituents%length
|
||||
constituent => constituents%get(co)
|
||||
frac = frac + constituent%get_asFloat('fraction')
|
||||
frac = frac + constituent%get_asFloat('v')
|
||||
|
||||
material_phaseAt(co,el) = phases%getIndex(constituent%get_asString('phase'))
|
||||
do ip = 1, discretization_nIPs
|
||||
|
|
Loading…
Reference in New Issue