Merge branch 'development' of magit1.mpie.de:damask/DAMASK into miscImprovements
This commit is contained in:
commit
c2b1499d84
|
@ -41,7 +41,7 @@ if [ ! -z "$PS1" ]; then
|
||||||
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
||||||
echo https://damask.mpie.de
|
echo https://damask.mpie.de
|
||||||
echo
|
echo
|
||||||
echo Using environment with ...
|
echo "Using environment with ..."
|
||||||
echo "DAMASK $DAMASK_ROOT"
|
echo "DAMASK $DAMASK_ROOT"
|
||||||
echo "Spectral Solver $SOLVER"
|
echo "Spectral Solver $SOLVER"
|
||||||
echo "Post Processing $PROCESSING"
|
echo "Post Processing $PROCESSING"
|
||||||
|
|
|
@ -1115,7 +1115,7 @@ allocate(nonSchmidProjection(3,3,4,maxTotalNslip,maxNinstances),
|
||||||
|
|
||||||
initializeInstances: do phase = 1_pInt, size(phase_plasticity)
|
initializeInstances: do phase = 1_pInt, size(phase_plasticity)
|
||||||
NofMyPhase=count(material_phase==phase)
|
NofMyPhase=count(material_phase==phase)
|
||||||
myPhase2: if (phase_plasticity(phase) == PLASTICITY_NONLOCAL_ID .and. NofMyPhase/=0) then
|
myPhase2: if (phase_plasticity(phase) == PLASTICITY_NONLOCAL_ID) then
|
||||||
instance = phase_plasticityInstance(phase)
|
instance = phase_plasticityInstance(phase)
|
||||||
!*** Inverse lookup of my slip system family and the slip system in lattice
|
!*** Inverse lookup of my slip system family and the slip system in lattice
|
||||||
|
|
||||||
|
|
|
@ -501,10 +501,10 @@ class ASCIItable():
|
||||||
columns = []
|
columns = []
|
||||||
for i,(c,d) in enumerate(zip(indices[present],dimensions[present])): # for all valid labels ...
|
for i,(c,d) in enumerate(zip(indices[present],dimensions[present])): # for all valid labels ...
|
||||||
# ... transparently add all components unless column referenced by number or with explicit dimension
|
# ... transparently add all components unless column referenced by number or with explicit dimension
|
||||||
columns += range(c,c + \
|
columns += range(c,c +
|
||||||
(d if str(c) != str(labels[present[i]]) else \
|
(d if str(c) != str(labels[present[i]]) else
|
||||||
1))
|
1))
|
||||||
use = np.array(columns)
|
use = np.array(columns) if len(columns) > 0 else None
|
||||||
|
|
||||||
self.tags = list(np.array(self.tags)[use]) # update labels with valid subset
|
self.tags = list(np.array(self.tags)[use]) # update labels with valid subset
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# -*- coding: UTF-8 no BOM -*-
|
# -*- coding: UTF-8 no BOM -*-
|
||||||
|
|
||||||
import os,sys
|
import os,sys
|
||||||
|
import numpy as np
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import damask
|
import damask
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ parser.add_option('-o','--offset',
|
||||||
parser.add_option('-l','--label',
|
parser.add_option('-l','--label',
|
||||||
dest = 'label',
|
dest = 'label',
|
||||||
action = 'extend', metavar = '<string LIST>',
|
action = 'extend', metavar = '<string LIST>',
|
||||||
help='heading of column(s) to be mapped')
|
help='column label(s) to be mapped')
|
||||||
parser.add_option('-a','--asciitable',
|
parser.add_option('-a','--asciitable',
|
||||||
dest = 'asciitable',
|
dest = 'asciitable',
|
||||||
type = 'string', metavar = 'string',
|
type = 'string', metavar = 'string',
|
||||||
|
@ -49,12 +50,13 @@ if options.map is None:
|
||||||
if options.asciitable is not None and os.path.isfile(options.asciitable):
|
if options.asciitable is not None and os.path.isfile(options.asciitable):
|
||||||
|
|
||||||
mappedTable = damask.ASCIItable(name = options.asciitable,
|
mappedTable = damask.ASCIItable(name = options.asciitable,
|
||||||
buffered = False, readonly = True)
|
buffered = False,
|
||||||
|
readonly = True)
|
||||||
mappedTable.head_read() # read ASCII header info of mapped table
|
mappedTable.head_read() # read ASCII header info of mapped table
|
||||||
missing_labels = mappedTable.data_readArray(options.label)
|
missing_labels = mappedTable.data_readArray(options.label)
|
||||||
|
|
||||||
if len(missing_labels) > 0:
|
if len(missing_labels) > 0:
|
||||||
mappedTable.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels)))
|
damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels)))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
parser.error('no mapped ASCIItable given.')
|
parser.error('no mapped ASCIItable given.')
|
||||||
|
@ -64,9 +66,8 @@ else:
|
||||||
if filenames == []: filenames = [None]
|
if filenames == []: filenames = [None]
|
||||||
|
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
try:
|
try: table = damask.ASCIItable(name = name,
|
||||||
table = damask.ASCIItable(name = name,
|
buffered = False)
|
||||||
buffered = False)
|
|
||||||
except: continue
|
except: continue
|
||||||
damask.util.report(scriptName,name)
|
damask.util.report(scriptName,name)
|
||||||
|
|
||||||
|
@ -96,7 +97,10 @@ for name in filenames:
|
||||||
|
|
||||||
outputAlive = True
|
outputAlive = True
|
||||||
while outputAlive and table.data_read(): # read next data line of ASCII table
|
while outputAlive and table.data_read(): # read next data line of ASCII table
|
||||||
table.data_append(mappedTable.data[int(round(float(table.data[mappedColumn])))+options.offset-1]) # add all mapped data types
|
try:
|
||||||
|
table.data_append(mappedTable.data[int(round(float(table.data[mappedColumn])))+options.offset-1]) # add all mapped data types
|
||||||
|
except IndexError:
|
||||||
|
table.data_append(np.nan*np.ones_like(mappedTable.data[0]))
|
||||||
outputAlive = table.data_write() # output processed line
|
outputAlive = table.data_write() # output processed line
|
||||||
|
|
||||||
# ------------------------------------------ output finalization -----------------------------------
|
# ------------------------------------------ output finalization -----------------------------------
|
||||||
|
|
|
@ -167,7 +167,6 @@ force = np.array(options.force)
|
||||||
force /= np.linalg.norm(force)
|
force /= np.linalg.norm(force)
|
||||||
|
|
||||||
if options.normal:
|
if options.normal:
|
||||||
damask.util.croak('got normal')
|
|
||||||
normal = np.array(options.normal)
|
normal = np.array(options.normal)
|
||||||
normal /= np.linalg.norm(normal)
|
normal /= np.linalg.norm(normal)
|
||||||
if abs(np.dot(force,normal)) > 1e-3:
|
if abs(np.dot(force,normal)) > 1e-3:
|
||||||
|
|
Loading…
Reference in New Issue