standardizing
1) don't start with capital letters 2) mechanics -> mechanical, plasticity -> plastic, elasticity -> plastic 3) store results per top level group (no plasticity, only mechanics)
This commit is contained in:
parent
1f383ddeff
commit
f3558f19b6
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
|||
Subproject commit 13dfa0ee9d702782f0b7999f3f7fb2384f58d768
|
||||
Subproject commit 2d0b76a5969095321669f924a5f8cd92ae4cfbe6
|
|
@ -1,8 +1,8 @@
|
|||
TWIP_Steel_FeMnC:
|
||||
lattice: cF
|
||||
mechanics:
|
||||
elasticity: {type: hooke, C_11: 175.0e9, C_12: 115.0e9, C_44: 135.0e9}
|
||||
plasticity:
|
||||
mechanical:
|
||||
elastic: {type: hooke, C_11: 175.0e9, C_12: 115.0e9, C_44: 135.0e9}
|
||||
plastic:
|
||||
type: dislotwin
|
||||
output: [rho_mob, rho_dip, gamma_sl, Lambda_sl, tau_pass, f_tw, Lambda_tw, tau_hat_tw, f_tr]
|
||||
D: 2.0e-5
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Tungsten:
|
||||
lattice: cI
|
||||
mechanics:
|
||||
elasticity: {type: hooke, C_11: 523.0e9, C_12: 202.0e9, C_44: 161.0e9} # Marinica et al. Journal of Physics: Condensed Matter(2013)
|
||||
plasticity:
|
||||
mechanical:
|
||||
elastic: {type: hooke, C_11: 523.0e9, C_12: 202.0e9, C_44: 161.0e9} # Marinica et al. Journal of Physics: Condensed Matter(2013)
|
||||
plastic:
|
||||
type: dislotwin
|
||||
D: 2.0e-5 # Average grain size / m
|
||||
N_sl: [12]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# Kuo, J. C., Mikrostrukturmechanik von Bikristallen mit Kippkorngrenzen. Shaker-Verlag 2004. http://edoc.mpg.de/204079
|
||||
Aluminum:
|
||||
lattice: aP
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p]
|
||||
elasticity: {type: hooke, C_11: 110.9e9, C_12: 58.34e9}
|
||||
plasticity:
|
||||
elastic: {type: hooke, C_11: 110.9e9, C_12: 58.34e9}
|
||||
plastic:
|
||||
type: isotropic
|
||||
output: [xi]
|
||||
xi_0: 31e6
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Air:
|
||||
lattice: aP
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p]
|
||||
elasticity: {type: hooke, C_11: 1e8, C_12: 1e6}
|
||||
plasticity:
|
||||
elastic: {type: hooke, C_11: 1e8, C_12: 1e6}
|
||||
plastic:
|
||||
type: isotropic
|
||||
output: [xi]
|
||||
xi_0: 0.3e6
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Aluminum:
|
||||
lattice: cF
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12]
|
||||
a_sl: 2.25
|
||||
dot_gamma_0_sl: 0.001
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# Diehl et.al. 2015 Meccanica
|
||||
Ferrite:
|
||||
lattice: cI
|
||||
mechanics:
|
||||
elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
|
||||
plasticity:
|
||||
mechanical:
|
||||
elastic: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12, 12]
|
||||
a_sl: 2.0
|
||||
dot_gamma_0_sl: 0.001
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# Diehl et.al. 2015 Meccanica
|
||||
Martensite:
|
||||
lattice: cI
|
||||
mechanics:
|
||||
elasticity: {C_11: 417.4e9, C_12: 242.4e9, C_44: 211.1e9, type: hooke}
|
||||
plasticity:
|
||||
mechanical:
|
||||
elastic: {C_11: 417.4e9, C_12: 242.4e9, C_44: 211.1e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12, 12]
|
||||
a_sl: 2.0
|
||||
dot_gamma_0_sl: 0.001
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
Gold:
|
||||
lattice: cF
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {type: hooke, C_11: 191e9, C_12: 162e9, C_44: 42.2e9}
|
||||
plasticity:
|
||||
elastic: {type: hooke, C_11: 191e9, C_12: 162e9, C_44: 42.2e9}
|
||||
plastic:
|
||||
type: phenopowerlaw
|
||||
output: [xi_sl]
|
||||
N_sl: [12]
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
Magnesium:
|
||||
lattice: hP
|
||||
c/a: 1.62350
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 59.3e9, C_12: 25.7e9, C_13: 21.4e9, C_33: 61.5e9, C_44: 16.4e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 59.3e9, C_12: 25.7e9, C_13: 21.4e9, C_33: 61.5e9, C_44: 16.4e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [3, 3, 0, 6, 0, 6]
|
||||
N_tw: [6, 0, 0, 6]
|
||||
h_0_tw_tw: 50.0e6
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
Ti-alpha:
|
||||
lattice: hP
|
||||
c/a: 1.587
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 160.0e9, C_12: 90.0e9, C_13: 66.0e9, C_33: 181.7e9, C_44: 46.5e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 160.0e9, C_12: 90.0e9, C_13: 66.0e9, C_33: 181.7e9, C_44: 46.5e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [3, 3, 0, 0, 12]
|
||||
a_sl: 2.0
|
||||
dot_gamma_0_sl: 0.001
|
||||
|
|
|
@ -35,10 +35,10 @@ for filename in options.filenames:
|
|||
if not results.structured: continue
|
||||
coords = damask.grid_filters.coordinates0_point(results.cells,results.size,results.origin).reshape(-1,3,order='F')
|
||||
|
||||
N_digits = int(np.floor(np.log10(int(results.increments[-1][3:]))))+1
|
||||
N_digits = int(np.floor(np.log10(int(results.increments[-1][10:]))))+1
|
||||
N_digits = 5 # hack to keep test intact
|
||||
for inc in damask.util.show_progress(results.iterate('increments'),len(results.increments)):
|
||||
table = damask.Table(np.ones(np.product(results.cells),dtype=int)*int(inc[3:]),{'inc':(1,)})\
|
||||
table = damask.Table(np.ones(np.product(results.cells),dtype=int)*int(inc[10:]),{'inc':(1,)})\
|
||||
.add('pos',coords.reshape(-1,3))
|
||||
|
||||
results.view('homogenizations',False)
|
||||
|
@ -59,5 +59,5 @@ for filename in options.filenames:
|
|||
if not os.path.isdir(dirname):
|
||||
os.mkdir(dirname,0o755)
|
||||
file_out = '{}_inc{}.txt'.format(os.path.splitext(os.path.split(filename)[-1])[0],
|
||||
inc[3:].zfill(N_digits))
|
||||
inc[10:].zfill(N_digits))
|
||||
table.save(os.path.join(dirname,file_out),legacy=True)
|
||||
|
|
|
@ -60,10 +60,11 @@ class Result:
|
|||
self.size = f['geometry'].attrs['size']
|
||||
self.origin = f['geometry'].attrs['origin']
|
||||
|
||||
r=re.compile('inc[0-9]+')
|
||||
increments_unsorted = {int(i[3:]):i for i in f.keys() if r.match(i)}
|
||||
r=re.compile('inc[0-9]+' if self.version_minor < 12 else 'increment_[0-9]+')
|
||||
increments_unsorted = {int(i[10:]):i for i in f.keys() if r.match(i)}
|
||||
self.increments = [increments_unsorted[i] for i in sorted(increments_unsorted)]
|
||||
self.times = [round(f[i].attrs['time/s'],12) for i in self.increments]
|
||||
self.times = [round(f[i].attrs['time/s'],12) for i in self.increments] if self.version_minor < 12 else \
|
||||
[round(f[i].attrs['t/s'],12) for i in self.increments]
|
||||
|
||||
self.N_materialpoints, self.N_constituents = np.shape(f['mapping/phase'])
|
||||
|
||||
|
@ -139,9 +140,10 @@ class Result:
|
|||
choice = datasets if hasattr(datasets,'__iter__') and not isinstance(datasets,str) else \
|
||||
[datasets]
|
||||
|
||||
inc = 'inc' if self.version_minor < 12 else 'increment_' # compatibility hack
|
||||
if what == 'increments':
|
||||
choice = [c if isinstance(c,str) and c.startswith('inc') else
|
||||
f'inc{c}' for c in choice]
|
||||
choice = [c if isinstance(c,str) and c.startswith(inc) else
|
||||
f'{inc}{c}' for c in choice]
|
||||
elif what == 'times':
|
||||
what = 'increments'
|
||||
if choice == ['*']:
|
||||
|
@ -206,7 +208,7 @@ class Result:
|
|||
self._allow_modification = False
|
||||
|
||||
|
||||
def incs_in_range(self,start,end):
|
||||
def increments_in_range(self,start,end):
|
||||
"""
|
||||
Select all increments within a given range.
|
||||
|
||||
|
@ -218,9 +220,11 @@ class Result:
|
|||
End increment.
|
||||
|
||||
"""
|
||||
# compatibility hack
|
||||
ln = 3 if self.version_minor < 12 else 10
|
||||
selected = []
|
||||
for i,inc in enumerate([int(i[3:]) for i in self.increments]):
|
||||
s,e = map(lambda x: int(x[3:] if isinstance(x,str) and x.startswith('inc') else x), (start,end))
|
||||
for i,inc in enumerate([int(i[ln:]) for i in self.increments]):
|
||||
s,e = map(lambda x: int(x[ln:] if isinstance(x,str) and x.startswith('inc') else x), (start,end))
|
||||
if s <= inc <= e:
|
||||
selected.append(self.increments[i])
|
||||
return selected
|
||||
|
@ -461,6 +465,9 @@ class Result:
|
|||
|
||||
def list_data(self):
|
||||
"""Return information on all active datasets in the file."""
|
||||
# compatibility hack
|
||||
de = 'Description' if self.version_minor < 12 else 'description'
|
||||
un = 'Unit' if self.version_minor < 12 else 'unit'
|
||||
message = ''
|
||||
with h5py.File(self.fname,'r') as f:
|
||||
for i in self.iterate('increments'):
|
||||
|
@ -475,13 +482,13 @@ class Result:
|
|||
for d in f[group].keys():
|
||||
try:
|
||||
dataset = f['/'.join([group,d])]
|
||||
if 'Unit' in dataset.attrs:
|
||||
unit = f" / {dataset.attrs['Unit']}" if h5py3 else \
|
||||
f" / {dataset.attrs['Unit'].decode()}"
|
||||
if un in dataset.attrs:
|
||||
unit = f" / {dataset.attrs[un]}" if h5py3 else \
|
||||
f" / {dataset.attrs[un].decode()}"
|
||||
else:
|
||||
unit = ''
|
||||
description = dataset.attrs['Description'] if h5py3 else \
|
||||
dataset.attrs['Description'].decode()
|
||||
description = dataset.attrs[de] if h5py3 else \
|
||||
dataset.attrs[de].decode()
|
||||
message += f' {d}{unit}: {description}\n'
|
||||
except KeyError:
|
||||
pass
|
||||
|
@ -594,9 +601,9 @@ class Result:
|
|||
'data': np.abs(x['data']),
|
||||
'label': f'|{x["label"]}|',
|
||||
'meta': {
|
||||
'Unit': x['meta']['Unit'],
|
||||
'Description': f"Absolute value of {x['label']} ({x['meta']['Description']})",
|
||||
'Creator': 'add_absolute'
|
||||
'unit': x['meta']['unit'],
|
||||
'description': f"absolute value of {x['label']} ({x['meta']['description']})",
|
||||
'creator': 'add_absolute'
|
||||
}
|
||||
}
|
||||
def add_absolute(self,x):
|
||||
|
@ -622,9 +629,9 @@ class Result:
|
|||
'data': eval(formula),
|
||||
'label': kwargs['label'],
|
||||
'meta': {
|
||||
'Unit': kwargs['unit'],
|
||||
'Description': f"{kwargs['description']} (formula: {kwargs['formula']})",
|
||||
'Creator': 'add_calculation'
|
||||
'unit': kwargs['unit'],
|
||||
'description': f"{kwargs['description']} (formula: {kwargs['formula']})",
|
||||
'creator': 'add_calculation'
|
||||
}
|
||||
}
|
||||
def add_calculation(self,label,formula,unit='n/a',description=None):
|
||||
|
@ -654,11 +661,11 @@ class Result:
|
|||
'data': mechanics.stress_Cauchy(P['data'],F['data']),
|
||||
'label': 'sigma',
|
||||
'meta': {
|
||||
'Unit': P['meta']['Unit'],
|
||||
'Description': "Cauchy stress calculated "
|
||||
f"from {P['label']} ({P['meta']['Description']})"
|
||||
f" and {F['label']} ({F['meta']['Description']})",
|
||||
'Creator': 'add_stress_Cauchy'
|
||||
'unit': P['meta']['unit'],
|
||||
'description': "Cauchy stress calculated "
|
||||
f"from {P['label']} ({P['meta']['description']})"
|
||||
f" and {F['label']} ({F['meta']['description']})",
|
||||
'creator': 'add_stress_Cauchy'
|
||||
}
|
||||
}
|
||||
def add_stress_Cauchy(self,P='P',F='F'):
|
||||
|
@ -682,9 +689,9 @@ class Result:
|
|||
'data': np.linalg.det(T['data']),
|
||||
'label': f"det({T['label']})",
|
||||
'meta': {
|
||||
'Unit': T['meta']['Unit'],
|
||||
'Description': f"Determinant of tensor {T['label']} ({T['meta']['Description']})",
|
||||
'Creator': 'add_determinant'
|
||||
'unit': T['meta']['unit'],
|
||||
'description': f"determinant of tensor {T['label']} ({T['meta']['description']})",
|
||||
'creator': 'add_determinant'
|
||||
}
|
||||
}
|
||||
def add_determinant(self,T):
|
||||
|
@ -706,9 +713,9 @@ class Result:
|
|||
'data': tensor.deviatoric(T['data']),
|
||||
'label': f"s_{T['label']}",
|
||||
'meta': {
|
||||
'Unit': T['meta']['Unit'],
|
||||
'Description': f"Deviator of tensor {T['label']} ({T['meta']['Description']})",
|
||||
'Creator': 'add_deviator'
|
||||
'unit': T['meta']['unit'],
|
||||
'description': f"deviator of tensor {T['label']} ({T['meta']['description']})",
|
||||
'creator': 'add_deviator'
|
||||
}
|
||||
}
|
||||
def add_deviator(self,T):
|
||||
|
@ -727,19 +734,19 @@ class Result:
|
|||
@staticmethod
|
||||
def _add_eigenvalue(T_sym,eigenvalue):
|
||||
if eigenvalue == 'max':
|
||||
label,p = 'Maximum',2
|
||||
label,p = 'maximum',2
|
||||
elif eigenvalue == 'mid':
|
||||
label,p = 'Intermediate',1
|
||||
label,p = 'intermediate',1
|
||||
elif eigenvalue == 'min':
|
||||
label,p = 'Minimum',0
|
||||
label,p = 'minimum',0
|
||||
|
||||
return {
|
||||
'data': tensor.eigenvalues(T_sym['data'])[:,p],
|
||||
'label': f"lambda_{eigenvalue}({T_sym['label']})",
|
||||
'meta' : {
|
||||
'Unit': T_sym['meta']['Unit'],
|
||||
'Description': f"{label} eigenvalue of {T_sym['label']} ({T_sym['meta']['Description']})",
|
||||
'Creator': 'add_eigenvalue'
|
||||
'unit': T_sym['meta']['unit'],
|
||||
'description': f"{label} eigenvalue of {T_sym['label']} ({T_sym['meta']['description']})",
|
||||
'creator': 'add_eigenvalue'
|
||||
}
|
||||
}
|
||||
def add_eigenvalue(self,T_sym,eigenvalue='max'):
|
||||
|
@ -769,10 +776,10 @@ class Result:
|
|||
'data': tensor.eigenvectors(T_sym['data'])[:,p],
|
||||
'label': f"v_{eigenvalue}({T_sym['label']})",
|
||||
'meta' : {
|
||||
'Unit': '1',
|
||||
'Description': f"Eigenvector corresponding to {label} eigenvalue"
|
||||
f" of {T_sym['label']} ({T_sym['meta']['Description']})",
|
||||
'Creator': 'add_eigenvector'
|
||||
'unit': '1',
|
||||
'description': f"eigenvector corresponding to {label} eigenvalue"
|
||||
f" of {T_sym['label']} ({T_sym['meta']['description']})",
|
||||
'creator': 'add_eigenvector'
|
||||
}
|
||||
}
|
||||
def add_eigenvector(self,T_sym,eigenvalue='max'):
|
||||
|
@ -795,9 +802,9 @@ class Result:
|
|||
def _add_IPF_color(l,q):
|
||||
m = util.scale_to_coprime(np.array(l))
|
||||
try:
|
||||
lattice = {'fcc':'cF','bcc':'cI','hex':'hP'}[q['meta']['Lattice']]
|
||||
lattice = {'fcc':'cF','bcc':'cI','hex':'hP'}[q['meta']['lattice']]
|
||||
except KeyError:
|
||||
lattice = q['meta']['Lattice']
|
||||
lattice = q['meta']['lattice']
|
||||
try:
|
||||
o = Orientation(rotation = (rfn.structured_to_unstructured(q['data'])),lattice=lattice)
|
||||
except ValueError:
|
||||
|
@ -807,10 +814,10 @@ class Result:
|
|||
'data': np.uint8(o.IPF_color(l)*255),
|
||||
'label': 'IPFcolor_[{} {} {}]'.format(*m),
|
||||
'meta' : {
|
||||
'Unit': '8-bit RGB',
|
||||
'Lattice': q['meta']['Lattice'],
|
||||
'Description': 'Inverse Pole Figure (IPF) colors along sample direction [{} {} {}]'.format(*m),
|
||||
'Creator': 'add_IPF_color'
|
||||
'unit': '8-bit RGB',
|
||||
'lattice': q['meta']['lattice'],
|
||||
'description': 'Inverse Pole Figure (IPF) colors along sample direction [{} {} {}]'.format(*m),
|
||||
'creator': 'add_IPF_color'
|
||||
}
|
||||
}
|
||||
def add_IPF_color(self,l,q='O'):
|
||||
|
@ -835,9 +842,9 @@ class Result:
|
|||
'data': mechanics.maximum_shear(T_sym['data']),
|
||||
'label': f"max_shear({T_sym['label']})",
|
||||
'meta': {
|
||||
'Unit': T_sym['meta']['Unit'],
|
||||
'Description': f"Maximum shear component of {T_sym['label']} ({T_sym['meta']['Description']})",
|
||||
'Creator': 'add_maximum_shear'
|
||||
'unit': T_sym['meta']['unit'],
|
||||
'description': f"maximum shear component of {T_sym['label']} ({T_sym['meta']['description']})",
|
||||
'creator': 'add_maximum_shear'
|
||||
}
|
||||
}
|
||||
def add_maximum_shear(self,T_sym):
|
||||
|
@ -857,9 +864,9 @@ class Result:
|
|||
def _add_equivalent_Mises(T_sym,kind):
|
||||
k = kind
|
||||
if k is None:
|
||||
if T_sym['meta']['Unit'] == '1':
|
||||
if T_sym['meta']['unit'] == '1':
|
||||
k = 'strain'
|
||||
elif T_sym['meta']['Unit'] == 'Pa':
|
||||
elif T_sym['meta']['unit'] == 'Pa':
|
||||
k = 'stress'
|
||||
if k not in ['stress', 'strain']:
|
||||
raise ValueError('invalid von Mises kind {kind}')
|
||||
|
@ -869,9 +876,9 @@ class Result:
|
|||
mechanics.equivalent_stress_Mises)(T_sym['data']),
|
||||
'label': f"{T_sym['label']}_vM",
|
||||
'meta': {
|
||||
'Unit': T_sym['meta']['Unit'],
|
||||
'Description': f"Mises equivalent {k} of {T_sym['label']} ({T_sym['meta']['Description']})",
|
||||
'Creator': 'add_Mises'
|
||||
'unit': T_sym['meta']['unit'],
|
||||
'description': f"Mises equivalent {k} of {T_sym['label']} ({T_sym['meta']['description']})",
|
||||
'creator': 'add_Mises'
|
||||
}
|
||||
}
|
||||
def add_equivalent_Mises(self,T_sym,kind=None):
|
||||
|
@ -908,9 +915,9 @@ class Result:
|
|||
'data': np.linalg.norm(x['data'],ord=o,axis=axis,keepdims=True),
|
||||
'label': f"|{x['label']}|_{o}",
|
||||
'meta': {
|
||||
'Unit': x['meta']['Unit'],
|
||||
'Description': f"{o}-norm of {t} {x['label']} ({x['meta']['Description']})",
|
||||
'Creator': 'add_norm'
|
||||
'unit': x['meta']['unit'],
|
||||
'description': f"{o}-norm of {t} {x['label']} ({x['meta']['description']})",
|
||||
'creator': 'add_norm'
|
||||
}
|
||||
}
|
||||
def add_norm(self,x,ord=None):
|
||||
|
@ -934,11 +941,11 @@ class Result:
|
|||
'data': mechanics.stress_second_Piola_Kirchhoff(P['data'],F['data']),
|
||||
'label': 'S',
|
||||
'meta': {
|
||||
'Unit': P['meta']['Unit'],
|
||||
'Description': "2. Piola-Kirchhoff stress calculated "
|
||||
f"from {P['label']} ({P['meta']['Description']})"
|
||||
f" and {F['label']} ({F['meta']['Description']})",
|
||||
'Creator': 'add_stress_second_Piola_Kirchhoff'
|
||||
'unit': P['meta']['unit'],
|
||||
'description': "second Piola-Kirchhoff stress calculated "
|
||||
f"from {P['label']} ({P['meta']['description']})"
|
||||
f" and {F['label']} ({F['meta']['description']})",
|
||||
'creator': 'add_stress_second_Piola_Kirchhoff'
|
||||
}
|
||||
}
|
||||
def add_stress_second_Piola_Kirchhoff(self,P='P',F='F'):
|
||||
|
@ -976,10 +983,10 @@ class Result:
|
|||
# 'data': coords,
|
||||
# 'label': 'p^{}_[{} {} {})'.format(u'rφ' if polar else 'xy',*m),
|
||||
# 'meta' : {
|
||||
# 'Unit': '1',
|
||||
# 'Description': '{} coordinates of stereographic projection of pole (direction/plane) in crystal frame'\
|
||||
# 'unit': '1',
|
||||
# 'description': '{} coordinates of stereographic projection of pole (direction/plane) in crystal frame'\
|
||||
# .format('Polar' if polar else 'Cartesian'),
|
||||
# 'Creator': 'add_pole'
|
||||
# 'creator': 'add_pole'
|
||||
# }
|
||||
# }
|
||||
# def add_pole(self,q,p,polar=False):
|
||||
|
@ -1005,9 +1012,9 @@ class Result:
|
|||
'data': mechanics.rotation(F['data']).as_matrix(),
|
||||
'label': f"R({F['label']})",
|
||||
'meta': {
|
||||
'Unit': F['meta']['Unit'],
|
||||
'Description': f"Rotational part of {F['label']} ({F['meta']['Description']})",
|
||||
'Creator': 'add_rotation'
|
||||
'unit': F['meta']['unit'],
|
||||
'description': f"rotational part of {F['label']} ({F['meta']['description']})",
|
||||
'creator': 'add_rotation'
|
||||
}
|
||||
}
|
||||
def add_rotation(self,F):
|
||||
|
@ -1029,9 +1036,9 @@ class Result:
|
|||
'data': tensor.spherical(T['data'],False),
|
||||
'label': f"p_{T['label']}",
|
||||
'meta': {
|
||||
'Unit': T['meta']['Unit'],
|
||||
'Description': f"Spherical component of tensor {T['label']} ({T['meta']['Description']})",
|
||||
'Creator': 'add_spherical'
|
||||
'unit': T['meta']['unit'],
|
||||
'description': f"spherical component of tensor {T['label']} ({T['meta']['description']})",
|
||||
'creator': 'add_spherical'
|
||||
}
|
||||
}
|
||||
def add_spherical(self,T):
|
||||
|
@ -1053,9 +1060,9 @@ class Result:
|
|||
'data': mechanics.strain(F['data'],t,m),
|
||||
'label': f"epsilon_{t}^{m}({F['label']})",
|
||||
'meta': {
|
||||
'Unit': F['meta']['Unit'],
|
||||
'Description': f"Strain tensor of {F['label']} ({F['meta']['Description']})",
|
||||
'Creator': 'add_strain'
|
||||
'unit': F['meta']['unit'],
|
||||
'description': f"strain tensor of {F['label']} ({F['meta']['description']})",
|
||||
'creator': 'add_strain'
|
||||
}
|
||||
}
|
||||
def add_strain(self,F='F',t='V',m=0.0):
|
||||
|
@ -1084,10 +1091,10 @@ class Result:
|
|||
'data': (mechanics.stretch_left if t.upper() == 'V' else mechanics.stretch_right)(F['data']),
|
||||
'label': f"{t}({F['label']})",
|
||||
'meta': {
|
||||
'Unit': F['meta']['Unit'],
|
||||
'Description': '{} stretch tensor of {} ({})'.format('Left' if t.upper() == 'V' else 'Right',
|
||||
F['label'],F['meta']['Description']),
|
||||
'Creator': 'add_stretch_tensor'
|
||||
'unit': F['meta']['unit'],
|
||||
'description': '{} stretch tensor of {} ({})'.format('left' if t.upper() == 'V' else 'right',
|
||||
F['label'],F['meta']['description']),
|
||||
'creator': 'add_stretch_tensor'
|
||||
}
|
||||
}
|
||||
def add_stretch_tensor(self,F='F',t='V'):
|
||||
|
@ -1161,8 +1168,7 @@ class Result:
|
|||
if self._allow_modification and result[0]+'/'+result[1]['label'] in f:
|
||||
dataset = f[result[0]+'/'+result[1]['label']]
|
||||
dataset[...] = result[1]['data']
|
||||
dataset.attrs['Overwritten'] = 'Yes' if h5py3 else \
|
||||
'Yes'.encode()
|
||||
dataset.attrs['overwritten'] = True
|
||||
else:
|
||||
if result[1]['data'].size >= chunk_size*2:
|
||||
shape = result[1]['data'].shape
|
||||
|
@ -1175,14 +1181,14 @@ class Result:
|
|||
dataset = f[result[0]].create_dataset(result[1]['label'],data=result[1]['data'])
|
||||
|
||||
now = datetime.datetime.now().astimezone()
|
||||
dataset.attrs['Created'] = now.strftime('%Y-%m-%d %H:%M:%S%z') if h5py3 else \
|
||||
dataset.attrs['created'] = now.strftime('%Y-%m-%d %H:%M:%S%z') if h5py3 else \
|
||||
now.strftime('%Y-%m-%d %H:%M:%S%z').encode()
|
||||
|
||||
for l,v in result[1]['meta'].items():
|
||||
dataset.attrs[l]=v if h5py3 else v.encode()
|
||||
creator = dataset.attrs['Creator'] if h5py3 else \
|
||||
dataset.attrs['Creator'].decode()
|
||||
dataset.attrs['Creator'] = f"damask.Result.{creator} v{damask.version}" if h5py3 else \
|
||||
dataset.attrs[l.lower()]=v if h5py3 else v.encode()
|
||||
creator = dataset.attrs['creator'] if h5py3 else \
|
||||
dataset.attrs['creator'].decode()
|
||||
dataset.attrs['creator'] = f"damask.Result.{creator} v{damask.version}" if h5py3 else \
|
||||
f"damask.Result.{creator} v{damask.version}".encode()
|
||||
|
||||
except (OSError,RuntimeError) as err:
|
||||
|
@ -1200,6 +1206,8 @@ class Result:
|
|||
The view is not taken into account, i.e. the content of the
|
||||
whole file will be included.
|
||||
"""
|
||||
# compatibility hack
|
||||
u = 'Unit' if self.version_minor < 12 else 'unit'
|
||||
if self.N_constituents != 1 or len(self.phases) != 1 or not self.structured:
|
||||
raise TypeError('XDMF output requires homogeneous grid')
|
||||
|
||||
|
@ -1281,7 +1289,7 @@ class Result:
|
|||
dtype = f[name].dtype
|
||||
|
||||
if dtype not in np.sctypes['int']+np.sctypes['uint']+np.sctypes['float']: continue
|
||||
unit = f[name].attrs['Unit'] if h5py3 else f[name].attrs['Unit'].decode()
|
||||
unit = f[name].attrs[u] if h5py3 else f[name].attrs[u].decode()
|
||||
|
||||
attributes.append(ET.SubElement(grid, 'Attribute'))
|
||||
attributes[-1].attrib={'Name': name.split('/',2)[2]+f' / {unit}',
|
||||
|
@ -1325,7 +1333,10 @@ class Result:
|
|||
elif mode.lower()=='point':
|
||||
v = VTK.from_poly_data(self.coordinates0_point)
|
||||
|
||||
N_digits = int(np.floor(np.log10(max(1,int(self.increments[-1][3:])))))+1
|
||||
# compatibility hack
|
||||
ln = 3 if self.version_minor < 12 else 10
|
||||
|
||||
N_digits = int(np.floor(np.log10(max(1,int(self.increments[-1][ln:])))))+1
|
||||
|
||||
for inc in util.show_progress(self.iterate('increments'),len(self.visible['increments'])):
|
||||
|
||||
|
@ -1335,21 +1346,24 @@ class Result:
|
|||
for o in self.iterate('out_type_ph'):
|
||||
for c in range(self.N_constituents):
|
||||
prefix = '' if self.N_constituents == 1 else f'constituent{c}/'
|
||||
if o != 'mechanics':
|
||||
if o not in ['mechanics', 'mechanical']: # compatitbility hack
|
||||
for _ in self.iterate('phases'):
|
||||
path = self.get_dataset_location(label)
|
||||
if len(path) == 0:
|
||||
continue
|
||||
array = self.read_dataset(path,c)
|
||||
v.add(array,prefix+path[0].split('/',1)[1]+f' / {self._get_attribute(path[0],"Unit")}')
|
||||
v.add(array,prefix+path[0].split('/',1)[1]+f' / {self._get_attribute(path[0],"unit")}')
|
||||
else:
|
||||
paths = self.get_dataset_location(label)
|
||||
if len(paths) == 0:
|
||||
continue
|
||||
array = self.read_dataset(paths,c)
|
||||
ph_name = re.compile(r'(?<=(phase\/))(.*?)(?=(mechanics))') # identify phase name
|
||||
dset_name = prefix+re.sub(ph_name,r'',paths[0].split('/',1)[1]) # remove phase name
|
||||
v.add(array,dset_name+f' / {self._get_attribute(paths[0],"Unit")}')
|
||||
if self.version_minor < 12:
|
||||
ph_name = re.compile(r'(?<=(phase\/))(.*?)(?=(mechanics))') # identify phase name
|
||||
else:
|
||||
ph_name = re.compile(r'(?<=(phase\/))(.*?)(?=(mechanical))') # identify phase name
|
||||
dset_name = prefix+re.sub(ph_name,r'',paths[0].split('/',1)[1]) # remove phase name
|
||||
v.add(array,dset_name+f' / {self._get_attribute(paths[0],"unit")}')
|
||||
self.view('homogenizations',viewed_backup_ho)
|
||||
|
||||
viewed_backup_ph = self.visible['phases'].copy()
|
||||
|
@ -1360,10 +1374,10 @@ class Result:
|
|||
if len(paths) == 0:
|
||||
continue
|
||||
array = self.read_dataset(paths)
|
||||
v.add(array,paths[0].split('/',1)[1]+f' / {self._get_attribute(paths[0],"Unit")}')
|
||||
v.add(array,paths[0].split('/',1)[1]+f' / {self._get_attribute(paths[0],"unit")}')
|
||||
self.view('phases',viewed_backup_ph)
|
||||
|
||||
u = self.read_dataset(self.get_dataset_location('u_n' if mode.lower() == 'cell' else 'u_p'))
|
||||
v.add(u,'u')
|
||||
|
||||
v.save(f'{self.fname.stem}_inc{inc[3:].zfill(N_digits)}')
|
||||
v.save(f'{self.fname.stem}_inc{inc[ln:].zfill(N_digits)}')
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
homogenization:
|
||||
SX:
|
||||
N_constituents: 1
|
||||
mechanics: {type: none}
|
||||
mechanical: {type: pass}
|
||||
|
||||
phase:
|
||||
pheno_fcc:
|
||||
lattice: cF
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12]
|
||||
a_sl: 2.25
|
||||
atol_xi: 1.0
|
||||
|
@ -24,10 +24,10 @@ phase:
|
|||
xi_inf_sl: [63e6]
|
||||
pheno_bcc:
|
||||
lattice: cI
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12]
|
||||
a_sl: 2.25
|
||||
atol_xi: 1.0
|
||||
|
@ -42,62 +42,62 @@ phase:
|
|||
|
||||
material:
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8229200444892315, 0.5284940239127993, -0.11958598847729246, 0.17086795611292308]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.029934934533052786, -0.0463822071939717, 0.9983440440417412, 0.01617900728410769]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.5285808688806949, 0.7326575088838098, 0.4051997815944012, 0.1401013087924221]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.1839974517790312, 0.49550065903084944, -0.1541415483910751, -0.8347840545305227]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8055693100147384, -0.22778497057116814, -0.028331746016454287, 0.5462320075864553]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8025842700117737, -0.33640019337884963, -0.3847408071640489, 0.3076815085881779]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.6048933483394416, 0.7565005822419409, -0.08545681892422426, -0.2334695661144201]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.2012339360745425, -0.3580127491130033, -0.7798091137625135, 0.47247171400774884]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.7949688202267222, 0.3623793306926909, -0.18836147613310203, -0.4485819321629098]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.19733162113429173, -0.06559103894055797, -0.40230149937129567, 0.8915781236183501]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8659916384140512, -0.2761459420825848, 0.38479354764225004, -0.1604238964779258]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.5951846978175659, 0.4476701545571293, -0.6038886363266418, -0.2840160613735736]
|
||||
phase: pheno_bcc
|
||||
homogenization: SX
|
Binary file not shown.
|
@ -2,15 +2,15 @@
|
|||
homogenization:
|
||||
SX:
|
||||
N_constituents: 1
|
||||
mechanics: {type: none}
|
||||
mechanical: {type: pass}
|
||||
|
||||
phase:
|
||||
pheno_fcc:
|
||||
lattice: cF
|
||||
mechanics:
|
||||
mechanical:
|
||||
output: [F, P, F_e, F_p, L_p, O]
|
||||
elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plasticity:
|
||||
elastic: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke}
|
||||
plastic:
|
||||
N_sl: [12]
|
||||
a_sl: 2.25
|
||||
atol_xi: 1.0
|
||||
|
@ -25,32 +25,32 @@ phase:
|
|||
|
||||
material:
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8229200444892315, 0.5284940239127993, -0.11958598847729246, 0.17086795611292308]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.029934934533052786, -0.0463822071939717, 0.9983440440417412, 0.01617900728410769]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.5285808688806949, 0.7326575088838098, 0.4051997815944012, 0.1401013087924221]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.1839974517790312, 0.49550065903084944, -0.1541415483910751, -0.8347840545305227]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8055693100147384, -0.22778497057116814, -0.028331746016454287, 0.5462320075864553]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
||||
- constituents:
|
||||
- fraction: 1.0
|
||||
- v: 1.0
|
||||
O: [0.8025842700117737, -0.33640019337884963, -0.3847408071640489, 0.3076815085881779]
|
||||
phase: pheno_fcc
|
||||
homogenization: SX
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,14 +1,17 @@
|
|||
---
|
||||
solver:
|
||||
mechanical: spectral_basic
|
||||
|
||||
step:
|
||||
- discretization:
|
||||
loadstep:
|
||||
- boundary_conditions:
|
||||
mechanical:
|
||||
dot_F: [x, 0, 0,
|
||||
0, 1.0e-3, 0,
|
||||
0, 0, x]
|
||||
P: [0, x, x,
|
||||
x, x, x,
|
||||
x, x, 0]
|
||||
discretization:
|
||||
t: 20
|
||||
N: 40
|
||||
f_out: 4
|
||||
mechanics:
|
||||
dot_F: [x, 0, 0,
|
||||
0, 1.0e-3, 0,
|
||||
0, 0, x]
|
||||
P: [0, x, x,
|
||||
x, x, x,
|
||||
x, x, 0]
|
||||
f_out: 4
|
||||
|
|
|
@ -2,6 +2,8 @@ import pytest
|
|||
import numpy as np
|
||||
|
||||
from damask import Config
|
||||
from damask import Rotation
|
||||
from damask import Orientation
|
||||
|
||||
class TestConfig:
|
||||
|
||||
|
@ -42,3 +44,7 @@ class TestConfig:
|
|||
|
||||
def test_abstract_is_complete(self):
|
||||
assert Config().is_complete is None
|
||||
|
||||
@pytest.mark.parametrize('data',[Rotation.from_random(),Orientation.from_random()])
|
||||
def test_rotation_orientation(self,data):
|
||||
assert str(Config(a=data)) == str(Config(a=data.as_quaternion()))
|
||||
|
|
|
@ -48,7 +48,7 @@ class TestResult:
|
|||
a = default.get_dataset_location('F')
|
||||
default.view('increments','*')
|
||||
b = default.get_dataset_location('F')
|
||||
default.view('increments',default.incs_in_range(0,np.iinfo(int).max))
|
||||
default.view('increments',default.increments_in_range(0,np.iinfo(int).max))
|
||||
c = default.get_dataset_location('F')
|
||||
|
||||
default.view('times',True)
|
||||
|
@ -173,7 +173,7 @@ class TestResult:
|
|||
loc = {'O': default.get_dataset_location('O'),
|
||||
'color': default.get_dataset_location('IPFcolor_[{} {} {}]'.format(*d))}
|
||||
qu = default.read_dataset(loc['O']).view(np.double).squeeze()
|
||||
crystal_structure = default._get_attribute(default.get_dataset_location('O')[0],'Lattice')
|
||||
crystal_structure = default._get_attribute(default.get_dataset_location('O')[0],'lattice')
|
||||
c = Orientation(rotation=qu,lattice=crystal_structure)
|
||||
in_memory = np.uint8(c.IPF_color(np.array(d))*255)
|
||||
in_file = default.read_dataset(loc['color'])
|
||||
|
@ -314,9 +314,9 @@ class TestResult:
|
|||
with h5py.File(default.fname,'r') as f:
|
||||
# h5py3 compatibility
|
||||
try:
|
||||
created_first = f[loc[0]].attrs['Created'].decode()
|
||||
created_first = f[loc[0]].attrs['created'].decode()
|
||||
except AttributeError:
|
||||
created_first = f[loc[0]].attrs['Created']
|
||||
created_first = f[loc[0]].attrs['created']
|
||||
created_first = datetime.strptime(created_first,'%Y-%m-%d %H:%M:%S%z')
|
||||
|
||||
if overwrite == 'on':
|
||||
|
@ -332,9 +332,9 @@ class TestResult:
|
|||
with h5py.File(default.fname,'r') as f:
|
||||
# h5py3 compatibility
|
||||
try:
|
||||
created_second = f[loc[0]].attrs['Created'].decode()
|
||||
created_second = f[loc[0]].attrs['created'].decode()
|
||||
except AttributeError:
|
||||
created_second = f[loc[0]].attrs['Created']
|
||||
created_second = f[loc[0]].attrs['created']
|
||||
created_second = datetime.strptime(created_second,'%Y-%m-%d %H:%M:%S%z')
|
||||
if overwrite == 'on':
|
||||
assert created_first < created_second and np.allclose(default.read_dataset(loc),311.)
|
||||
|
|
|
@ -104,7 +104,6 @@ program DAMASK_grid
|
|||
load_step, &
|
||||
solver, &
|
||||
initial_conditions, &
|
||||
ic_thermal, &
|
||||
thermal, &
|
||||
step_bc, &
|
||||
step_mech, &
|
||||
|
@ -310,7 +309,7 @@ program DAMASK_grid
|
|||
|
||||
case(FIELD_THERMAL_ID)
|
||||
initial_conditions => config_load%get('initial_conditions',defaultVal=emptyDict)
|
||||
thermal => initial_conditions%get('thermal',defaultVal=emptyDict)
|
||||
thermal => initial_conditions%get('thermal',defaultVal=emptyDict)
|
||||
call grid_thermal_spectral_init(thermal%get_asFloat('T',defaultVal = T_0))
|
||||
|
||||
case(FIELD_DAMAGE_ID)
|
||||
|
|
|
@ -545,7 +545,7 @@ subroutine material_parseHomogenization
|
|||
|
||||
do h=1, size(material_name_homogenization)
|
||||
homog => material_homogenization%get(h)
|
||||
homogMech => homog%get('mechanics')
|
||||
homogMech => homog%get('mechanical')
|
||||
select case (homogMech%get_asString('type'))
|
||||
case('pass')
|
||||
homogenization_type(h) = HOMOGENIZATION_NONE_ID
|
||||
|
|
|
@ -139,7 +139,7 @@ module subroutine mechanical_RGC_init(num_homogMech)
|
|||
do ho = 1, size(homogenization_type)
|
||||
if (homogenization_type(ho) /= HOMOGENIZATION_RGC_ID) cycle
|
||||
homog => material_homogenization%get(ho)
|
||||
homogMech => homog%get('mechanics')
|
||||
homogMech => homog%get('mechanical')
|
||||
associate(prm => param(ho), &
|
||||
stt => state(ho), &
|
||||
st0 => state0(ho), &
|
||||
|
|
|
@ -46,7 +46,7 @@ module subroutine mechanical_isostrain_init
|
|||
do h = 1, size(homogenization_type)
|
||||
if (homogenization_type(h) /= HOMOGENIZATION_ISOSTRAIN_ID) cycle
|
||||
homog => material_homogenization%get(h)
|
||||
homogMech => homog%get('mechanics')
|
||||
homogMech => homog%get('mechanical')
|
||||
associate(prm => param(h))
|
||||
|
||||
prm%N_constituents = homogenization_Nconstituents(h)
|
||||
|
|
|
@ -480,8 +480,8 @@ subroutine lattice_init
|
|||
|
||||
do ph = 1, phases%length
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
elasticity => mech%get('elasticity')
|
||||
mech => phase%get('mechanical')
|
||||
elasticity => mech%get('elastic')
|
||||
lattice_C66(1,1,ph) = elasticity%get_asFloat('C_11')
|
||||
lattice_C66(1,2,ph) = elasticity%get_asFloat('C_12')
|
||||
|
||||
|
|
|
@ -341,21 +341,21 @@ module subroutine damage_results(group,ph)
|
|||
sourceLoop: do so = 1, phase_Nsources(ph)
|
||||
|
||||
if (phase_source(ph) /= DAMAGE_UNDEFINED_ID) &
|
||||
call results_closeGroup(results_addGroup(group//'sources/')) ! should be 'damage'
|
||||
call results_closeGroup(results_addGroup(group//'damage'))
|
||||
|
||||
sourceType: select case (phase_source(ph))
|
||||
|
||||
case (DAMAGE_ISOBRITTLE_ID) sourceType
|
||||
call isobrittle_results(ph,group//'sources/')
|
||||
call isobrittle_results(ph,group//'damage/')
|
||||
|
||||
case (DAMAGE_ISODUCTILE_ID) sourceType
|
||||
call isoductile_results(ph,group//'sources/')
|
||||
call isoductile_results(ph,group//'damage/')
|
||||
|
||||
case (DAMAGE_ANISOBRITTLE_ID) sourceType
|
||||
call anisobrittle_results(ph,group//'sources/')
|
||||
call anisobrittle_results(ph,group//'damage/')
|
||||
|
||||
case (DAMAGE_ANISODUCTILE_ID) sourceType
|
||||
call anisoductile_results(ph,group//'sources/')
|
||||
call anisoductile_results(ph,group//'damage/')
|
||||
|
||||
end select sourceType
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ module function anisoductile_init() result(mySources)
|
|||
do p = 1, phases%length
|
||||
if(mySources(p)) then
|
||||
phase => phases%get(p)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
sources => phase%get('damage')
|
||||
|
||||
|
||||
|
|
|
@ -247,13 +247,13 @@ module subroutine mechanical_init(materials,phases)
|
|||
allocate(phase_mechanical_F0(ph)%data(3,3,Nmembers))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
mech => phase%get('mechanical')
|
||||
#if defined(__GFORTRAN__)
|
||||
output_constituent(ph)%label = output_asStrings(mech)
|
||||
#else
|
||||
output_constituent(ph)%label = mech%get_asStrings('output',defaultVal=emptyStringArray)
|
||||
#endif
|
||||
elastic => mech%get('elasticity')
|
||||
elastic => mech%get('elastic')
|
||||
if(elastic%get_asString('type') == 'hooke') then
|
||||
phase_elasticity(ph) = ELASTICITY_HOOKE_ID
|
||||
else
|
||||
|
@ -269,7 +269,7 @@ module subroutine mechanical_init(materials,phases)
|
|||
if(maxVal(phase_NstiffnessDegradations)/=0) then
|
||||
do ph = 1, phases%length
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
mech => phase%get('mechanical')
|
||||
stiffDegradation => mech%get('stiffness_degradation',defaultVal=emptyList)
|
||||
do stiffDegradationCtr = 1, stiffDegradation%length
|
||||
if(stiffDegradation%get_asString(stiffDegradationCtr) == 'damage') &
|
||||
|
@ -398,32 +398,31 @@ module subroutine mechanical_results(group,ph)
|
|||
character(len=*), intent(in) :: group
|
||||
integer, intent(in) :: ph
|
||||
|
||||
if (phase_plasticity(ph) /= PLASTICITY_NONE_ID) &
|
||||
call results_closeGroup(results_addGroup(group//'plastic/'))
|
||||
|
||||
call crystallite_results(group,ph)
|
||||
|
||||
select case(phase_plasticity(ph))
|
||||
|
||||
case(PLASTICITY_ISOTROPIC_ID)
|
||||
call plastic_isotropic_results(ph,group//'plastic/')
|
||||
call plastic_isotropic_results(ph,group//'mechanical/')
|
||||
|
||||
case(PLASTICITY_PHENOPOWERLAW_ID)
|
||||
call plastic_phenopowerlaw_results(ph,group//'plastic/')
|
||||
call plastic_phenopowerlaw_results(ph,group//'mechanical/')
|
||||
|
||||
case(PLASTICITY_KINEHARDENING_ID)
|
||||
call plastic_kinehardening_results(ph,group//'plastic/')
|
||||
call plastic_kinehardening_results(ph,group//'mechanical/')
|
||||
|
||||
case(PLASTICITY_DISLOTWIN_ID)
|
||||
call plastic_dislotwin_results(ph,group//'plastic/')
|
||||
call plastic_dislotwin_results(ph,group//'mechanical/')
|
||||
|
||||
case(PLASTICITY_DISLOTUNGSTEN_ID)
|
||||
call plastic_dislotungsten_results(ph,group//'plastic/')
|
||||
call plastic_dislotungsten_results(ph,group//'mechanical/')
|
||||
|
||||
case(PLASTICITY_NONLOCAL_ID)
|
||||
call plastic_nonlocal_results(ph,group//'plastic/')
|
||||
call plastic_nonlocal_results(ph,group//'mechanical/')
|
||||
|
||||
end select
|
||||
|
||||
call crystallite_results(group,ph)
|
||||
|
||||
end subroutine mechanical_results
|
||||
|
||||
|
@ -978,35 +977,35 @@ subroutine crystallite_results(group,ph)
|
|||
character(len=:), allocatable :: structureLabel
|
||||
|
||||
|
||||
call results_closeGroup(results_addGroup(group//'/mechanics/'))
|
||||
call results_closeGroup(results_addGroup(group//'/mechanical'))
|
||||
|
||||
do ou = 1, size(output_constituent(ph)%label)
|
||||
|
||||
select case (output_constituent(ph)%label(ou))
|
||||
case('F')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_F(ph)%data,'F',&
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_F(ph)%data,'F',&
|
||||
'deformation gradient','1')
|
||||
case('F_e')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_Fe(ph)%data,'F_e',&
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_Fe(ph)%data,'F_e',&
|
||||
'elastic deformation gradient','1')
|
||||
case('F_p')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_Fp(ph)%data,'F_p', &
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_Fp(ph)%data,'F_p', &
|
||||
'plastic deformation gradient','1')
|
||||
case('F_i')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_Fi(ph)%data,'F_i', &
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_Fi(ph)%data,'F_i', &
|
||||
'inelastic deformation gradient','1')
|
||||
case('L_p')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_Lp(ph)%data,'L_p', &
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_Lp(ph)%data,'L_p', &
|
||||
'plastic velocity gradient','1/s')
|
||||
case('L_i')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_Li(ph)%data,'L_i', &
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_Li(ph)%data,'L_i', &
|
||||
'inelastic velocity gradient','1/s')
|
||||
case('P')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_P(ph)%data,'P', &
|
||||
'First Piola-Kirchhoff stress','Pa')
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_P(ph)%data,'P', &
|
||||
'first Piola-Kirchhoff stress','Pa')
|
||||
case('S')
|
||||
call results_writeDataset(group//'/mechanics/',phase_mechanical_S(ph)%data,'S', &
|
||||
'Second Piola-Kirchhoff stress','Pa')
|
||||
call results_writeDataset(group//'/mechanical/',phase_mechanical_S(ph)%data,'S', &
|
||||
'second Piola-Kirchhoff stress','Pa')
|
||||
case('O')
|
||||
select case(lattice_structure(ph))
|
||||
case(lattice_ISO_ID)
|
||||
|
@ -1023,9 +1022,9 @@ subroutine crystallite_results(group,ph)
|
|||
structureLabel = 'oP'
|
||||
end select
|
||||
selected_rotations = select_rotations(crystallite_orientation,ph)
|
||||
call results_writeDataset(group//'/mechanics/',selected_rotations,output_constituent(ph)%label(ou),&
|
||||
call results_writeDataset(group//'/mechanical',selected_rotations,output_constituent(ph)%label(ou),&
|
||||
'crystal orientation as quaternion','q_0 (q_1 q_2 q_3)')
|
||||
call results_addAttribute('Lattice',structureLabel,group//'/mechanics/'//output_constituent(ph)%label(ou))
|
||||
call results_addAttribute('lattice',structureLabel,group//'/mechanical/'//output_constituent(ph)%label(ou))
|
||||
end select
|
||||
enddo
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ module subroutine eigendeformation_init(phases)
|
|||
|
||||
do ph = 1,phases%length
|
||||
phase => phases%get(ph)
|
||||
mechanics => phase%get('mechanics')
|
||||
mechanics => phase%get('mechanical')
|
||||
kinematics => mechanics%get('eigen',defaultVal=emptyList)
|
||||
Nmodels(ph) = kinematics%length
|
||||
enddo
|
||||
|
@ -98,7 +98,7 @@ function kinematics_active(kinematics_label,kinematics_length) result(active_ki
|
|||
allocate(active_kinematics(kinematics_length,phases%length), source = .false. )
|
||||
do p = 1, phases%length
|
||||
phase => phases%get(p)
|
||||
mechanics => phase%get('mechanics')
|
||||
mechanics => phase%get('mechanical')
|
||||
kinematics => mechanics%get('eigen',defaultVal=emptyList)
|
||||
do k = 1, kinematics%length
|
||||
kinematics_type => kinematics%get(k)
|
||||
|
|
|
@ -27,6 +27,4 @@ module function kinematics_cleavage_opening_init() result(myKinematics)
|
|||
end function kinematics_cleavage_opening_init
|
||||
|
||||
|
||||
|
||||
|
||||
end submodule cleavageopening
|
||||
|
|
|
@ -61,8 +61,8 @@ module function kinematics_slipplane_opening_init() result(myKinematics)
|
|||
do p = 1, phases%length
|
||||
if(myKinematics(p)) then
|
||||
phase => phases%get(p)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
kinematics => phase%get('damage')
|
||||
|
||||
|
|
|
@ -449,8 +449,8 @@ function plastic_active(plastic_label) result(active_plastic)
|
|||
allocate(active_plastic(phases%length), source = .false. )
|
||||
do ph = 1, phases%length
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
if(pl%get_asString('type') == plastic_label) active_plastic(ph) = .true.
|
||||
enddo
|
||||
|
||||
|
|
|
@ -120,8 +120,8 @@ module function plastic_dislotungsten_init() result(myPlasticity)
|
|||
associate(prm => param(ph), dot => dotState(ph), stt => state(ph), dst => dependentState(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
#if defined (__GFORTRAN__)
|
||||
prm%output = output_asStrings(pl)
|
||||
|
|
|
@ -173,8 +173,8 @@ module function plastic_dislotwin_init() result(myPlasticity)
|
|||
associate(prm => param(ph), dot => dotState(ph), stt => state(ph), dst => dependentState(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
#if defined (__GFORTRAN__)
|
||||
prm%output = output_asStrings(pl)
|
||||
|
|
|
@ -85,8 +85,8 @@ module function plastic_isotropic_init() result(myPlasticity)
|
|||
associate(prm => param(ph), dot => dotState(ph), stt => state(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
#if defined (__GFORTRAN__)
|
||||
prm%output = output_asStrings(pl)
|
||||
|
|
|
@ -98,8 +98,8 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
|||
associate(prm => param(ph), dot => dotState(ph), dlt => deltaState(ph), stt => state(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
#if defined (__GFORTRAN__)
|
||||
prm%output = output_asStrings(pl)
|
||||
|
|
|
@ -227,8 +227,8 @@ module function plastic_nonlocal_init() result(myPlasticity)
|
|||
st0 => state0(ph), del => deltaState(ph), dst => microstructure(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
phase_localPlasticity(ph) = .not. pl%contains('nonlocal')
|
||||
|
||||
|
|
|
@ -107,8 +107,8 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
|
|||
associate(prm => param(ph), dot => dotState(ph), stt => state(ph))
|
||||
|
||||
phase => phases%get(ph)
|
||||
mech => phase%get('mechanics')
|
||||
pl => mech%get('plasticity')
|
||||
mech => phase%get('mechanical')
|
||||
pl => mech%get('plastic')
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! slip related parameters
|
||||
|
|
|
@ -92,7 +92,7 @@ module subroutine externalheat_dotState(ph, me)
|
|||
|
||||
so = source_thermal_externalheat_offset(ph)
|
||||
|
||||
thermalState(ph)%p(so)%dotState(1,me) = 1.0_pReal ! state is current time
|
||||
thermalState(ph)%p(so)%dotState(1,me) = 1.0_pReal ! state is current time
|
||||
|
||||
end subroutine externalheat_dotState
|
||||
|
||||
|
@ -116,15 +116,15 @@ module subroutine externalheat_getRate(TDot, ph, me)
|
|||
so = source_thermal_externalheat_offset(ph)
|
||||
|
||||
associate(prm => param(ph))
|
||||
do interval = 1, prm%nIntervals ! scan through all rate segments
|
||||
do interval = 1, prm%nIntervals ! scan through all rate segments
|
||||
frac_time = (thermalState(ph)%p(so)%state(1,me) - prm%t_n(interval)) &
|
||||
/ (prm%t_n(interval+1) - prm%t_n(interval)) ! fractional time within segment
|
||||
/ (prm%t_n(interval+1) - prm%t_n(interval)) ! fractional time within segment
|
||||
if ( (frac_time < 0.0_pReal .and. interval == 1) &
|
||||
.or. (frac_time >= 1.0_pReal .and. interval == prm%nIntervals) &
|
||||
.or. (frac_time >= 0.0_pReal .and. frac_time < 1.0_pReal) ) &
|
||||
TDot = prm%f_T(interval ) * (1.0_pReal - frac_time) + &
|
||||
prm%f_T(interval+1) * frac_time ! interpolate heat rate between segment boundaries...
|
||||
! ...or extrapolate if outside me bounds
|
||||
prm%f_T(interval+1) * frac_time ! interpolate heat rate between segment boundaries...
|
||||
! ...or extrapolate if outside me bounds
|
||||
enddo
|
||||
end associate
|
||||
|
||||
|
|
|
@ -105,13 +105,14 @@ subroutine results_addIncrement(inc,time)
|
|||
|
||||
integer, intent(in) :: inc
|
||||
real(pReal), intent(in) :: time
|
||||
|
||||
character(len=pStringLen) :: incChar
|
||||
|
||||
|
||||
write(incChar,'(i10)') inc
|
||||
call results_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar)))))
|
||||
call results_setLink(trim('inc'//trim(adjustl(incChar))),'current')
|
||||
call results_addAttribute('time/s',time,trim('inc'//trim(adjustl(incChar))))
|
||||
call results_closeGroup(results_addGroup(trim('increment_'//trim(adjustl(incChar)))))
|
||||
call results_setLink(trim('increment_'//trim(adjustl(incChar))),'current')
|
||||
call results_addAttribute('t/s',time,trim('increment_'//trim(adjustl(incChar))))
|
||||
|
||||
end subroutine results_addIncrement
|
||||
|
||||
|
@ -350,18 +351,17 @@ subroutine results_writeTensorDataset_real(group,dataset,label,description,SIuni
|
|||
transposed_ = .true.
|
||||
endif
|
||||
|
||||
groupHandle = results_openGroup(group)
|
||||
if(transposed_) then
|
||||
if(size(dataset,1) /= size(dataset,2)) error stop 'transpose non-symmetric tensor'
|
||||
allocate(dataset_transposed,mold=dataset)
|
||||
do i=1,size(dataset_transposed,3)
|
||||
dataset_transposed(:,:,i) = transpose(dataset(:,:,i))
|
||||
enddo
|
||||
call HDF5_write(groupHandle,dataset_transposed,label)
|
||||
else
|
||||
allocate(dataset_transposed,source=dataset)
|
||||
call HDF5_write(groupHandle,dataset,label)
|
||||
endif
|
||||
|
||||
groupHandle = results_openGroup(group)
|
||||
call HDF5_write(groupHandle,dataset,label)
|
||||
call executionStamp(group//'/'//label,description,SIunit)
|
||||
call HDF5_closeGroup(groupHandle)
|
||||
|
||||
|
@ -732,13 +732,13 @@ subroutine executionStamp(path,description,SIunit)
|
|||
|
||||
|
||||
if (HDF5_objectExists(resultsFile,path)) &
|
||||
call HDF5_addAttribute(resultsFile,'Description',description,path)
|
||||
call HDF5_addAttribute(resultsFile,'description',description,path)
|
||||
if (HDF5_objectExists(resultsFile,path) .and. present(SIunit)) &
|
||||
call HDF5_addAttribute(resultsFile,'Unit',SIunit,path)
|
||||
call HDF5_addAttribute(resultsFile,'unit',SIunit,path)
|
||||
if (HDF5_objectExists(resultsFile,path)) &
|
||||
call HDF5_addAttribute(resultsFile,'Creator','DAMASK '//DAMASKVERSION,path)
|
||||
call HDF5_addAttribute(resultsFile,'creator','DAMASK '//DAMASKVERSION,path)
|
||||
if (HDF5_objectExists(resultsFile,path)) &
|
||||
call HDF5_addAttribute(resultsFile,'Created',now(),path)
|
||||
call HDF5_addAttribute(resultsFile,'created',now(),path)
|
||||
|
||||
end subroutine executionStamp
|
||||
|
||||
|
@ -759,5 +759,4 @@ character(len=24) function now()
|
|||
end function now
|
||||
|
||||
|
||||
|
||||
end module results
|
||||
|
|
Loading…
Reference in New Issue