texture is typically the more interesting information

therefore, but it to the top
This commit is contained in:
Martin Diehl 2019-05-30 14:05:45 +02:00
parent 8380071564
commit d0c7f8b934
4 changed files with 46 additions and 41 deletions

View File

@ -136,20 +136,19 @@ for name in filenames:
if errors != []: if errors != []:
damask.util.croak(errors) damask.util.croak(errors)
continue continue
config_header = ['<microstructure>'] config_header = ['<texture>']
for i in range(np.nanmax(microstructure)):
config_header += ['[{}{}]'.format(label,i+1),
'(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 {:.2f}'.format(*rot[i].asEulers(degrees = True)),
]
config_header += ['<microstructure>']
for i in range(np.nanmax(microstructure)): for i in range(np.nanmax(microstructure)):
config_header += ['[{}{}]'.format(label,i+1), config_header += ['[{}{}]'.format(label,i+1),
'crystallite 1', 'crystallite 1',
'(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(phase[i],i+1), '(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(phase[i],i+1),
] ]
config_header += ['<texture>']
for i in range(np.nanmax(microstructure)):
config_header += ['[{}{}]'.format(label,i+1),
'(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 {:.2f}'.format(*rot[i].asEulers(degrees = True)),
]
header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\ header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\
+ config_header + config_header
geom = damask.Geom(microstructure,size,origin, geom = damask.Geom(microstructure,size,origin,

View File

@ -114,25 +114,28 @@ for y in range(grid[1]):
Beta [i] = beta [x,y] Beta [i] = beta [x,y]
i+=1 i+=1
config_header = [] config_header = ['<texture>',
config_header.append('<microstructure>') '[canal]',
config_header.append('[canal]') '[interstitial]'
config_header.append('crystallite 1') ]
config_header.append('(constituent)\tphase 1\ttexture 1\tfraction 1.0')
config_header.append('[interstitial]')
config_header.append('crystallite 1')
config_header.append('(constituent)\tphase 2\ttexture 2\tfraction 1.0')
for i in range(3,np.max(microstructure)): for i in range(3,np.max(microstructure)):
config_header.append('[Point{}]'.format(i-2)) config_header += ['[Point{}]'.format(i-2),
config_header.append('crystallite 1') '(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 0'.format(Alpha[i],Beta[i])
config_header.append('(constituent)\tphase 3\ttexture {}\tfraction 1.0'.format(i)) ]
config_header.append('<texture>') config_header = ['<microstructure>',
config_header.append('[canal]') '[canal]',
config_header.append('[interstitial]') 'crystallite 1',
'(constituent)\tphase 1\ttexture 1\tfraction 1.0',
'[interstitial]',
'crystallite 1',
'(constituent)\tphase 2\ttexture 2\tfraction 1.0'
]
for i in range(3,np.max(microstructure)): for i in range(3,np.max(microstructure)):
config_header.append('[Point{}]'.format(i-2)) config_header += ['[Point{}]'.format(i-2),
config_header.append('(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 0'.format(Alpha[i],Beta[i])) 'crystallite 1',
'(constituent)\tphase 3\ttexture {}\tfraction 1.0'.format(i)
]
header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\ header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\
+ config_header + config_header

View File

@ -131,20 +131,20 @@ for name in filenames:
microstructure[x,y,z] = unique_inverse[indices[i]]+1 microstructure[x,y,z] = unique_inverse[indices[i]]+1
i+=1 i+=1
config_header = ['<microstructure>'] config_header = ['<texture>']
for i,data in enumerate(unique):
config_header += ['[Grain{}]'.format(i+1),
'crystallite 1',
'(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(int(data[4]),i+1),
]
config_header += ['<texture>']
for i,data in enumerate(unique): for i,data in enumerate(unique):
ori = damask.Rotation(data[0:4]) ori = damask.Rotation(data[0:4])
config_header += ['[Grain{}]'.format(i+1), config_header += ['[Grain{}]'.format(i+1),
'(gauss)\tphi1 {:g}\tPhi {:g}\tphi2 {:g}'.format(*ori.asEulers(degrees = True)), '(gauss)\tphi1 {:g}\tPhi {:g}\tphi2 {:g}'.format(*ori.asEulers(degrees = True)),
] ]
if options.axes is not None: config_header += ['axes\t{} {} {}'.format(*options.axes)] if options.axes is not None: config_header += ['axes\t{} {} {}'.format(*options.axes)]
config_header += ['<microstructure>']
for i,data in enumerate(unique):
config_header += ['[Grain{}]'.format(i+1),
'crystallite 1',
'(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(int(data[4]),i+1),
]
header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\ header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\
+ config_header + config_header

View File

@ -277,12 +277,7 @@ for name in filenames:
config_header = [] config_header = []
if options.config: if options.config:
config_header += ['<microstructure>']
for ID in grainIDs:
config_header += ['[Grain{}]'.format(ID),
'crystallite 1',
'(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(options.phase,ID)
]
if hasEulers: if hasEulers:
config_header += ['<texture>'] config_header += ['<texture>']
for ID in grainIDs: for ID in grainIDs:
@ -291,6 +286,14 @@ for name in filenames:
'(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 {:.2f}'.format(*eulers[eulerID]) '(gauss)\tphi1 {:.2f}\tPhi {:.2f}\tphi2 {:.2f}'.format(*eulers[eulerID])
] ]
if options.axes is not None: config_header += ['axes\t{} {} {}'.format(*options.axes)] if options.axes is not None: config_header += ['axes\t{} {} {}'.format(*options.axes)]
config_header += ['<microstructure>']
for ID in grainIDs:
config_header += ['[Grain{}]'.format(ID),
'crystallite 1',
'(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(options.phase,ID)
]
config_header += ['<!skip>'] config_header += ['<!skip>']
header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\ header = [scriptID + ' ' + ' '.join(sys.argv[1:])]\