Merge branch 'MoreImprovements' into marc-improvements

This commit is contained in:
Martin Diehl 2020-01-13 10:04:27 +01:00
commit 76d0383c2f
18 changed files with 72 additions and 298 deletions

@ -1 +1 @@
Subproject commit 3eeffba1513c0495032d0f33522e3aaa1ed77465 Subproject commit 66d562c755cd9aa4bbb8280c509383014acd52db

View File

@ -1 +1 @@
v2.0.3-1294-g034367fa v2.0.3-1354-gef5a8a3a

View File

@ -4,14 +4,6 @@
[SX] [SX]
mech none mech none
#-------------------#
<crystallite>
#-------------------#
[aLittleSomething]
(output) f
(output) p
#-------------------# #-------------------#
<phase> <phase>
#-------------------# #-------------------#
@ -50,408 +42,212 @@ interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
atol_resistance 1 atol_resistance 1
(output) f
(output) p
#-------------------# #-------------------#
<microstructure> <microstructure>
#-------------------# #-------------------#
[Grain001] [Grain001]
crystallite 1
(constituent) phase 1 texture 1 fraction 1.0 (constituent) phase 1 texture 1 fraction 1.0
[Grain002] [Grain002]
crystallite 1
(constituent) phase 1 texture 2 fraction 1.0 (constituent) phase 1 texture 2 fraction 1.0
[Grain003] [Grain003]
crystallite 1
(constituent) phase 1 texture 3 fraction 1.0 (constituent) phase 1 texture 3 fraction 1.0
[Grain004] [Grain004]
crystallite 1
(constituent) phase 1 texture 4 fraction 1.0 (constituent) phase 1 texture 4 fraction 1.0
[Grain005] [Grain005]
crystallite 1
(constituent) phase 1 texture 5 fraction 1.0 (constituent) phase 1 texture 5 fraction 1.0
[Grain006] [Grain006]
crystallite 1
(constituent) phase 1 texture 6 fraction 1.0 (constituent) phase 1 texture 6 fraction 1.0
[Grain007] [Grain007]
crystallite 1
(constituent) phase 1 texture 7 fraction 1.0 (constituent) phase 1 texture 7 fraction 1.0
[Grain008] [Grain008]
crystallite 1
(constituent) phase 1 texture 8 fraction 1.0 (constituent) phase 1 texture 8 fraction 1.0
[Grain009] [Grain009]
crystallite 1
(constituent) phase 1 texture 9 fraction 1.0 (constituent) phase 1 texture 9 fraction 1.0
[Grain010] [Grain010]
crystallite 1
(constituent) phase 1 texture 10 fraction 1.0 (constituent) phase 1 texture 10 fraction 1.0
[Grain011] [Grain011]
crystallite 1
(constituent) phase 1 texture 11 fraction 1.0 (constituent) phase 1 texture 11 fraction 1.0
[Grain012] [Grain012]
crystallite 1
(constituent) phase 1 texture 12 fraction 1.0 (constituent) phase 1 texture 12 fraction 1.0
[Grain013] [Grain013]
crystallite 1
(constituent) phase 1 texture 13 fraction 1.0 (constituent) phase 1 texture 13 fraction 1.0
[Grain014] [Grain014]
crystallite 1
(constituent) phase 1 texture 14 fraction 1.0 (constituent) phase 1 texture 14 fraction 1.0
[Grain015] [Grain015]
crystallite 1
(constituent) phase 1 texture 15 fraction 1.0 (constituent) phase 1 texture 15 fraction 1.0
[Grain016] [Grain016]
crystallite 1
(constituent) phase 1 texture 16 fraction 1.0 (constituent) phase 1 texture 16 fraction 1.0
[Grain017] [Grain017]
crystallite 1
(constituent) phase 1 texture 17 fraction 1.0 (constituent) phase 1 texture 17 fraction 1.0
[Grain018] [Grain018]
crystallite 1
(constituent) phase 1 texture 18 fraction 1.0 (constituent) phase 1 texture 18 fraction 1.0
[Grain019] [Grain019]
crystallite 1
(constituent) phase 1 texture 19 fraction 1.0 (constituent) phase 1 texture 19 fraction 1.0
[Grain020] [Grain020]
crystallite 1
(constituent) phase 1 texture 20 fraction 1.0 (constituent) phase 1 texture 20 fraction 1.0
[Grain021] [Grain021]
crystallite 1
(constituent) phase 1 texture 21 fraction 1.0 (constituent) phase 1 texture 21 fraction 1.0
[Grain022] [Grain022]
crystallite 1
(constituent) phase 1 texture 22 fraction 1.0 (constituent) phase 1 texture 22 fraction 1.0
[Grain023] [Grain023]
crystallite 1
(constituent) phase 1 texture 23 fraction 1.0 (constituent) phase 1 texture 23 fraction 1.0
[Grain024] [Grain024]
crystallite 1
(constituent) phase 1 texture 24 fraction 1.0 (constituent) phase 1 texture 24 fraction 1.0
[Grain025] [Grain025]
crystallite 1
(constituent) phase 1 texture 25 fraction 1.0 (constituent) phase 1 texture 25 fraction 1.0
[Grain026] [Grain026]
crystallite 1
(constituent) phase 1 texture 26 fraction 1.0 (constituent) phase 1 texture 26 fraction 1.0
[Grain027] [Grain027]
crystallite 1
(constituent) phase 1 texture 27 fraction 1.0 (constituent) phase 1 texture 27 fraction 1.0
[Grain028] [Grain028]
crystallite 1
(constituent) phase 1 texture 28 fraction 1.0 (constituent) phase 1 texture 28 fraction 1.0
[Grain029] [Grain029]
crystallite 1
(constituent) phase 1 texture 29 fraction 1.0 (constituent) phase 1 texture 29 fraction 1.0
[Grain030] [Grain030]
crystallite 1
(constituent) phase 1 texture 30 fraction 1.0 (constituent) phase 1 texture 30 fraction 1.0
[Grain031] [Grain031]
crystallite 1
(constituent) phase 1 texture 31 fraction 1.0 (constituent) phase 1 texture 31 fraction 1.0
[Grain032] [Grain032]
crystallite 1
(constituent) phase 1 texture 32 fraction 1.0 (constituent) phase 1 texture 32 fraction 1.0
[Grain033] [Grain033]
crystallite 1
(constituent) phase 1 texture 33 fraction 1.0 (constituent) phase 1 texture 33 fraction 1.0
[Grain034] [Grain034]
crystallite 1
(constituent) phase 1 texture 34 fraction 1.0 (constituent) phase 1 texture 34 fraction 1.0
[Grain035] [Grain035]
crystallite 1
(constituent) phase 1 texture 35 fraction 1.0 (constituent) phase 1 texture 35 fraction 1.0
[Grain036] [Grain036]
crystallite 1
(constituent) phase 1 texture 36 fraction 1.0 (constituent) phase 1 texture 36 fraction 1.0
[Grain037] [Grain037]
crystallite 1
(constituent) phase 1 texture 37 fraction 1.0 (constituent) phase 1 texture 37 fraction 1.0
[Grain038] [Grain038]
crystallite 1
(constituent) phase 1 texture 38 fraction 1.0 (constituent) phase 1 texture 38 fraction 1.0
[Grain039] [Grain039]
crystallite 1
(constituent) phase 1 texture 39 fraction 1.0 (constituent) phase 1 texture 39 fraction 1.0
[Grain040] [Grain040]
crystallite 1
(constituent) phase 1 texture 40 fraction 1.0 (constituent) phase 1 texture 40 fraction 1.0
[Grain041] [Grain041]
crystallite 1
(constituent) phase 1 texture 41 fraction 1.0 (constituent) phase 1 texture 41 fraction 1.0
[Grain042] [Grain042]
crystallite 1
(constituent) phase 1 texture 42 fraction 1.0 (constituent) phase 1 texture 42 fraction 1.0
[Grain043] [Grain043]
crystallite 1
(constituent) phase 1 texture 43 fraction 1.0 (constituent) phase 1 texture 43 fraction 1.0
[Grain044] [Grain044]
crystallite 1
(constituent) phase 1 texture 44 fraction 1.0 (constituent) phase 1 texture 44 fraction 1.0
[Grain045] [Grain045]
crystallite 1
(constituent) phase 1 texture 45 fraction 1.0 (constituent) phase 1 texture 45 fraction 1.0
[Grain046] [Grain046]
crystallite 1
(constituent) phase 1 texture 46 fraction 1.0 (constituent) phase 1 texture 46 fraction 1.0
[Grain047] [Grain047]
crystallite 1
(constituent) phase 1 texture 47 fraction 1.0 (constituent) phase 1 texture 47 fraction 1.0
[Grain048] [Grain048]
crystallite 1
(constituent) phase 1 texture 48 fraction 1.0 (constituent) phase 1 texture 48 fraction 1.0
[Grain049] [Grain049]
crystallite 1
(constituent) phase 1 texture 49 fraction 1.0 (constituent) phase 1 texture 49 fraction 1.0
[Grain050] [Grain050]
crystallite 1
(constituent) phase 1 texture 50 fraction 1.0 (constituent) phase 1 texture 50 fraction 1.0
[Grain051] [Grain051]
crystallite 1
(constituent) phase 1 texture 51 fraction 1.0 (constituent) phase 1 texture 51 fraction 1.0
[Grain052] [Grain052]
crystallite 1
(constituent) phase 1 texture 52 fraction 1.0 (constituent) phase 1 texture 52 fraction 1.0
[Grain053] [Grain053]
crystallite 1
(constituent) phase 1 texture 53 fraction 1.0 (constituent) phase 1 texture 53 fraction 1.0
[Grain054] [Grain054]
crystallite 1
(constituent) phase 1 texture 54 fraction 1.0 (constituent) phase 1 texture 54 fraction 1.0
[Grain055] [Grain055]
crystallite 1
(constituent) phase 1 texture 55 fraction 1.0 (constituent) phase 1 texture 55 fraction 1.0
[Grain056] [Grain056]
crystallite 1
(constituent) phase 1 texture 56 fraction 1.0 (constituent) phase 1 texture 56 fraction 1.0
[Grain057] [Grain057]
crystallite 1
(constituent) phase 1 texture 57 fraction 1.0 (constituent) phase 1 texture 57 fraction 1.0
[Grain058] [Grain058]
crystallite 1
(constituent) phase 1 texture 58 fraction 1.0 (constituent) phase 1 texture 58 fraction 1.0
[Grain059] [Grain059]
crystallite 1
(constituent) phase 1 texture 59 fraction 1.0 (constituent) phase 1 texture 59 fraction 1.0
[Grain060] [Grain060]
crystallite 1
(constituent) phase 1 texture 60 fraction 1.0 (constituent) phase 1 texture 60 fraction 1.0
[Grain061] [Grain061]
crystallite 1
(constituent) phase 1 texture 61 fraction 1.0 (constituent) phase 1 texture 61 fraction 1.0
[Grain062] [Grain062]
crystallite 1
(constituent) phase 1 texture 62 fraction 1.0 (constituent) phase 1 texture 62 fraction 1.0
[Grain063] [Grain063]
crystallite 1
(constituent) phase 1 texture 63 fraction 1.0 (constituent) phase 1 texture 63 fraction 1.0
[Grain064] [Grain064]
crystallite 1
(constituent) phase 1 texture 64 fraction 1.0 (constituent) phase 1 texture 64 fraction 1.0
[Grain065] [Grain065]
crystallite 1
(constituent) phase 1 texture 65 fraction 1.0 (constituent) phase 1 texture 65 fraction 1.0
[Grain066] [Grain066]
crystallite 1
(constituent) phase 1 texture 66 fraction 1.0 (constituent) phase 1 texture 66 fraction 1.0
[Grain067] [Grain067]
crystallite 1
(constituent) phase 1 texture 67 fraction 1.0 (constituent) phase 1 texture 67 fraction 1.0
[Grain068] [Grain068]
crystallite 1
(constituent) phase 1 texture 68 fraction 1.0 (constituent) phase 1 texture 68 fraction 1.0
[Grain069] [Grain069]
crystallite 1
(constituent) phase 1 texture 69 fraction 1.0 (constituent) phase 1 texture 69 fraction 1.0
[Grain070] [Grain070]
crystallite 1
(constituent) phase 1 texture 70 fraction 1.0 (constituent) phase 1 texture 70 fraction 1.0
[Grain071] [Grain071]
crystallite 1
(constituent) phase 1 texture 71 fraction 1.0 (constituent) phase 1 texture 71 fraction 1.0
[Grain072] [Grain072]
crystallite 1
(constituent) phase 1 texture 72 fraction 1.0 (constituent) phase 1 texture 72 fraction 1.0
[Grain073] [Grain073]
crystallite 1
(constituent) phase 1 texture 73 fraction 1.0 (constituent) phase 1 texture 73 fraction 1.0
[Grain074] [Grain074]
crystallite 1
(constituent) phase 1 texture 74 fraction 1.0 (constituent) phase 1 texture 74 fraction 1.0
[Grain075] [Grain075]
crystallite 1
(constituent) phase 1 texture 75 fraction 1.0 (constituent) phase 1 texture 75 fraction 1.0
[Grain076] [Grain076]
crystallite 1
(constituent) phase 1 texture 76 fraction 1.0 (constituent) phase 1 texture 76 fraction 1.0
[Grain077] [Grain077]
crystallite 1
(constituent) phase 1 texture 77 fraction 1.0 (constituent) phase 1 texture 77 fraction 1.0
[Grain078] [Grain078]
crystallite 1
(constituent) phase 1 texture 78 fraction 1.0 (constituent) phase 1 texture 78 fraction 1.0
[Grain079] [Grain079]
crystallite 1
(constituent) phase 1 texture 79 fraction 1.0 (constituent) phase 1 texture 79 fraction 1.0
[Grain080] [Grain080]
crystallite 1
(constituent) phase 1 texture 80 fraction 1.0 (constituent) phase 1 texture 80 fraction 1.0
[Grain081] [Grain081]
crystallite 1
(constituent) phase 1 texture 81 fraction 1.0 (constituent) phase 1 texture 81 fraction 1.0
[Grain082] [Grain082]
crystallite 1
(constituent) phase 1 texture 82 fraction 1.0 (constituent) phase 1 texture 82 fraction 1.0
[Grain083] [Grain083]
crystallite 1
(constituent) phase 1 texture 83 fraction 1.0 (constituent) phase 1 texture 83 fraction 1.0
[Grain084] [Grain084]
crystallite 1
(constituent) phase 1 texture 84 fraction 1.0 (constituent) phase 1 texture 84 fraction 1.0
[Grain085] [Grain085]
crystallite 1
(constituent) phase 1 texture 85 fraction 1.0 (constituent) phase 1 texture 85 fraction 1.0
[Grain086] [Grain086]
crystallite 1
(constituent) phase 1 texture 86 fraction 1.0 (constituent) phase 1 texture 86 fraction 1.0
[Grain087] [Grain087]
crystallite 1
(constituent) phase 1 texture 87 fraction 1.0 (constituent) phase 1 texture 87 fraction 1.0
[Grain088] [Grain088]
crystallite 1
(constituent) phase 1 texture 88 fraction 1.0 (constituent) phase 1 texture 88 fraction 1.0
[Grain089] [Grain089]
crystallite 1
(constituent) phase 1 texture 89 fraction 1.0 (constituent) phase 1 texture 89 fraction 1.0
[Grain090] [Grain090]
crystallite 1
(constituent) phase 1 texture 90 fraction 1.0 (constituent) phase 1 texture 90 fraction 1.0
[Grain091] [Grain091]
crystallite 1
(constituent) phase 1 texture 91 fraction 1.0 (constituent) phase 1 texture 91 fraction 1.0
[Grain092] [Grain092]
crystallite 1
(constituent) phase 1 texture 92 fraction 1.0 (constituent) phase 1 texture 92 fraction 1.0
[Grain093] [Grain093]
crystallite 1
(constituent) phase 1 texture 93 fraction 1.0 (constituent) phase 1 texture 93 fraction 1.0
[Grain094] [Grain094]
crystallite 1
(constituent) phase 1 texture 94 fraction 1.0 (constituent) phase 1 texture 94 fraction 1.0
[Grain095] [Grain095]
crystallite 1
(constituent) phase 1 texture 95 fraction 1.0 (constituent) phase 1 texture 95 fraction 1.0
[Grain096] [Grain096]
crystallite 1
(constituent) phase 1 texture 96 fraction 1.0 (constituent) phase 1 texture 96 fraction 1.0
[Grain097] [Grain097]
crystallite 1
(constituent) phase 1 texture 97 fraction 1.0 (constituent) phase 1 texture 97 fraction 1.0
[Grain098] [Grain098]
crystallite 1
(constituent) phase 1 texture 98 fraction 1.0 (constituent) phase 1 texture 98 fraction 1.0
[Grain099] [Grain099]
crystallite 1
(constituent) phase 1 texture 99 fraction 1.0 (constituent) phase 1 texture 99 fraction 1.0
[Grain100] [Grain100]
crystallite 1
(constituent) phase 1 texture 100 fraction 1.0 (constituent) phase 1 texture 100 fraction 1.0
#-------------------# #-------------------#

View File

@ -419,11 +419,6 @@
[cube] [cube]
(gauss) phi1 0 Phi 0 phi2 0 (gauss) phi1 0 Phi 0 phi2 0
#-------------------#
<crystallite>
#-------------------#
{../ConfigFiles/Crystallite_All.config}
#-------------------# #-------------------#
<phase> <phase>

View File

@ -3,25 +3,12 @@
#-------------------# #-------------------#
[direct] [direct]
mech none # isostrain 1 grain mech none
thermal adiabatic # thermal strain (stress) induced mass transport thermal adiabatic
t0 330.0 t0 330.0
(output) temperature (output) temperature
#-------------------#
<crystallite>
#-------------------#
[aLittleSomething]
(output) texture
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#-------------------# #-------------------#
<phase> <phase>
#-------------------# #-------------------#
@ -34,6 +21,12 @@ plasticity none
{config/elastic_isotropic.config} {config/elastic_isotropic.config}
{config/thermal.config} {config/thermal.config}
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#................. #.................
[Ti matrix] [Ti matrix]
@ -43,6 +36,12 @@ plasticity none
{config/elastic_Ti.config} {config/elastic_Ti.config}
{config/thermal.config} {config/thermal.config}
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#................. #.................
[isotropic inclusion] [isotropic inclusion]
@ -52,6 +51,12 @@ plasticity none
{config/thermal.config} {config/thermal.config}
{config/thermalExpansion_isotropic.config} {config/thermalExpansion_isotropic.config}
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#................. #.................
[anisotropic inclusion] [anisotropic inclusion]
@ -61,6 +66,12 @@ plasticity none
{config/thermal.config} {config/thermal.config}
{config/thermalExpansion_fullyAnisotropic.config} {config/thermalExpansion_fullyAnisotropic.config}
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#................. #.................
[Ti inclusion] [Ti inclusion]
@ -71,32 +82,32 @@ plasticity none
{config/thermal.config} {config/thermal.config}
{config/thermalExpansion_Ti.config} {config/thermalExpansion_Ti.config}
(output) f
(output) p
(output) fe
(output) fi
(output) fp
#--------------------------# #--------------------------#
<microstructure> <microstructure>
#--------------------------# #--------------------------#
[isotropic matrix] [isotropic matrix]
crystallite 1
(constituent) phase 1 texture 1 fraction 1.0 (constituent) phase 1 texture 1 fraction 1.0
[Ti matrix] [Ti matrix]
crystallite 1
(constituent) phase 2 texture 1 fraction 1.0 (constituent) phase 2 texture 1 fraction 1.0
[isotropic inclusion] [isotropic inclusion]
crystallite 1
(constituent) phase 3 texture 1 fraction 1.0 (constituent) phase 3 texture 1 fraction 1.0
[anisotropic inclusion] [anisotropic inclusion]
crystallite 1
(constituent) phase 4 texture 1 fraction 1.0 (constituent) phase 4 texture 1 fraction 1.0
[rotated inclusion] [rotated inclusion]
crystallite 1
(constituent) phase 4 texture 2 fraction 1.0 (constituent) phase 4 texture 2 fraction 1.0
[Ti inclusion] [Ti inclusion]
crystallite 1
(constituent) phase 5 texture 1 fraction 1.0 (constituent) phase 5 texture 1 fraction 1.0
#--------------------------# #--------------------------#

View File

@ -2,6 +2,7 @@
import os import os
import sys import sys
from io import StringIO
from optparse import OptionParser from optparse import OptionParser
import numpy as np import numpy as np
@ -24,61 +25,33 @@ Transform X,Y,Z,F APS BeamLine 34 coordinates to x,y,z APS strain coordinates.
parser.add_option('-f','--frame',dest='frame', metavar='string', parser.add_option('-f','--frame',dest='frame', metavar='string',
help='label of APS X,Y,Z coords') help='label of APS X,Y,Z coords')
parser.add_option('--depth', dest='depth', metavar='string', parser.add_option('--depth', dest='depth', metavar='string',
help='depth') help='depth')
(options,filenames) = parser.parse_args() (options,filenames) = parser.parse_args()
if filenames == []: filenames = [None]
if options.frame is None: if options.frame is None:
parser.error('frame not specified') parser.error('frame not specified')
if options.depth is None: if options.depth is None:
parser.error('depth not specified') parser.error('depth not specified')
# --- loop over input files ------------------------------------------------------------------------
if filenames == []: filenames = [None] theta=-0.75*np.pi
RotMat2TSL=np.array([[1., 0., 0.],
[0., np.cos(theta), np.sin(theta)], # Orientation to account for -135 deg
[0., -np.sin(theta), np.cos(theta)]]) # rotation for TSL convention
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, damask.util.report(scriptName,name)
buffered = False)
except: continue
damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
coord = - table.get(options.frame)
coord[:,2] += table.get(options.depth)[:,0]
table.head_read() table.add('coord',
np.einsum('ijk,ik->ij',np.broadcast_to(RotMat2TSL,(coord.shape[0],3,3)),coord),
scriptID+' '+' '.join(sys.argv[1:]))
# ------------------------------------------ sanity checks ----------------------------------------- table.to_ASCII(sys.stdout if name is None else name)
errors = []
if table.label_dimension(options.frame) != 3:
errors.append('input {} does not have dimension 3.'.format(options.frame))
if table.label_dimension(options.depth) != 1:
errors.append('input {} does not have dimension 1.'.format(options.depth))
if errors != []:
damask.util.croak(errors)
table.close(dismiss = True)
continue
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
# ------------------------------------------ assemble header ---------------------------------------
table.labels_append(['%i_coord'%(i+1) for i in range(3)]) # extend ASCII header with new labels
table.head_write()
# ------------------------------------------ process data ------------------------------------------
theta=-0.75*np.pi
RotMat2TSL=np.array([[1., 0., 0.],
[0., np.cos(theta), np.sin(theta)], # Orientation to account for -135 deg
[0., -np.sin(theta), np.cos(theta)]]) # rotation for TSL convention
outputAlive = True
while outputAlive and table.data_read(): # read next data line of ASCII table
coord = list(map(float,table.data[table.label_index(options.frame):table.label_index(options.frame)+3]))
depth = float(table.data[table.label_index(options.depth)])
table.data_append(np.dot(RotMat2TSL,np.array([-coord[0],-coord[1],-coord[2]+depth])))
outputAlive = table.data_write() # output processed line
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables

View File

@ -176,7 +176,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
F = table.get(options.defgrad).reshape(grid[2],grid[1],grid[0],3,3) F = table.get(options.defgrad).reshape(grid[2],grid[1],grid[0],3,3)
nodes = damask.grid_filters.node_coord(size,F) nodes = damask.grid_filters.node_coord(size,F)

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
for label in options.labels: for label in options.labels:
field = table.get(label) field = table.get(label)

View File

@ -50,7 +50,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
F = table.get(options.f).reshape(np.append(grid[::-1],(3,3))) F = table.get(options.f).reshape(np.append(grid[::-1],(3,3)))
if options.nodal: if options.nodal:

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
for label in options.labels: for label in options.labels:
field = table.get(label) field = table.get(label)

View File

@ -143,7 +143,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
neighborhood = neighborhoods[options.neighborhood] neighborhood = neighborhoods[options.neighborhood]
diffToNeighbor = np.empty(list(grid+2)+[len(neighborhood)],'i') diffToNeighbor = np.empty(list(grid+2)+[len(neighborhood)],'i')

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
for label in options.labels: for label in options.labels:
field = table.get(label) field = table.get(label)

View File

@ -65,7 +65,7 @@ for name in filenames:
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
if (options.grid is None or options.size is None): if (options.grid is None or options.size is None):
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
else: else:
grid = np.array(options.grid,'i') grid = np.array(options.grid,'i')
size = np.array(options.size,'d') size = np.array(options.size,'d')

View File

@ -54,7 +54,7 @@ for name in filenames:
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos)) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.get(options.pos))
packing = np.array(options.packing,'i') packing = np.array(options.packing,'i')
outSize = grid*packing outSize = grid*packing

View File

@ -86,7 +86,7 @@ for name in filenames:
if options.phase is None: if options.phase is None:
table.data = np.column_stack((table.data,np.ones(len(table.data)))) # add single phase if no phase column given table.data = np.column_stack((table.data,np.ones(len(table.data)))) # add single phase if no phase column given
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.data[:,0:3]) grid,size,origin = damask.grid_filters.cell_coord0_gridSizeOrigin(table.data[:,0:3])
indices = np.lexsort((table.data[:,0],table.data[:,1],table.data[:,2])) # indices of position when sorting x fast, z slow indices = np.lexsort((table.data[:,0],table.data[:,1],table.data[:,2])) # indices of position when sorting x fast, z slow
microstructure = np.empty(grid,dtype = int) # initialize empty microstructure microstructure = np.empty(grid,dtype = int) # initialize empty microstructure

View File

@ -181,7 +181,7 @@ def cell_coord(size,F,origin=np.zeros(3)):
""" """
return cell_coord0(F.shape[:3][::-1],size,origin) + cell_displacement(size,F) return cell_coord0(F.shape[:3][::-1],size,origin) + cell_displacement(size,F)
def cell_coord0_2_DNA(coord0,ordered=True): def cell_coord0_gridSizeOrigin(coord0,ordered=True):
""" """
Return grid 'DNA', i.e. grid, size, and origin from array of cell positions. Return grid 'DNA', i.e. grid, size, and origin from array of cell positions.
@ -231,7 +231,7 @@ def coord0_check(coord0):
array of undeformed cell coordinates. array of undeformed cell coordinates.
""" """
cell_coord0_2_DNA(coord0,ordered=True) cell_coord0_gridSizeOrigin(coord0,ordered=True)
@ -331,7 +331,7 @@ def node_2_cell(node_data):
return c[:-1,:-1,:-1] return c[:-1,:-1,:-1]
def node_coord0_2_DNA(coord0,ordered=False): def node_coord0_gridSizeOrigin(coord0,ordered=False):
""" """
Return grid 'DNA', i.e. grid, size, and origin from array of nodal positions. Return grid 'DNA', i.e. grid, size, and origin from array of nodal positions.

View File

@ -22,7 +22,7 @@ class Table():
Additional, human-readable information. Additional, human-readable information.
""" """
self.comments = ['table.py v {}'.format(version)] if not comments else [c for c in comments] self.comments = [] if comments is None else [c for c in comments]
self.data = pd.DataFrame(data=data) self.data = pd.DataFrame(data=data)
self.shapes = shapes self.shapes = shapes
self.__label_condensed() self.__label_condensed()
@ -77,10 +77,9 @@ class Table():
if keyword == 'header': if keyword == 'header':
header = int(header) header = int(header)
else: else:
raise Exception raise TypeError
comments = ['table.py:from_ASCII v {}'.format(version)] comments = [f.readline()[:-1] for i in range(1,header)]
comments+= [f.readline()[:-1] for i in range(1,header)]
labels = f.readline().split() labels = f.readline().split()
shapes = {} shapes = {}
@ -139,7 +138,7 @@ class Table():
data = np.loadtxt(content) data = np.loadtxt(content)
for c in range(data.shape[1]-10): for c in range(data.shape[1]-10):
shapes['user_defined{}'.format(c+1)] = (1,) shapes['n/a_{}'.format(c+1)] = (1,)
return Table(data,shapes,comments) return Table(data,shapes,comments)

View File

@ -26,12 +26,12 @@ class TestGridFilters:
@pytest.mark.parametrize('mode',[('cell'),('node')]) @pytest.mark.parametrize('mode',[('cell'),('node')])
def test_grid_DNA(self,mode): def test_grid_DNA(self,mode):
"""Ensure that xx_coord0_2_DNA is the inverse of xx_coord0.""" """Ensure that xx_coord0_gridSizeOrigin is the inverse of xx_coord0."""
grid = np.random.randint(8,32,(3)) grid = np.random.randint(8,32,(3))
size = np.random.random(3) size = np.random.random(3)
origin = np.random.random(3) origin = np.random.random(3)
coord0 = eval('grid_filters.{}_coord0(grid,size,origin)'.format(mode)) # noqa coord0 = eval('grid_filters.{}_coord0(grid,size,origin)'.format(mode)) # noqa
_grid,_size,_origin = eval('grid_filters.{}_coord0_2_DNA(coord0.reshape((-1,3)))'.format(mode)) _grid,_size,_origin = eval('grid_filters.{}_coord0_gridSizeOrigin(coord0.reshape((-1,3)))'.format(mode))
assert np.allclose(grid,_grid) and np.allclose(size,_size) and np.allclose(origin,_origin) assert np.allclose(grid,_grid) and np.allclose(size,_size) and np.allclose(origin,_origin)
def test_displacement_fluct_equivalence(self): def test_displacement_fluct_equivalence(self):