Merge branch 'development' of magit1.mpie.de:damask/DAMASK into development
This commit is contained in:
commit
5011e201d6
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
|||
Subproject commit 5e97c9ac2fa4f7748a1bc040c15889623a3afd1f
|
||||
Subproject commit 55a263fc30c40c16ef337be050f8901dd2747390
|
|
@ -451,9 +451,9 @@ def mapIncremental(label, mapping, N, base, new):
|
|||
# -----------------------------
|
||||
def OpenPostfile(name,type,nodal = False):
|
||||
"""Open postfile with extrapolation mode 'translate'"""
|
||||
p = {\
|
||||
'spectral': MPIEspectral_result,\
|
||||
'marc': post_open,\
|
||||
p = {
|
||||
'spectral': MPIEspectral_result,
|
||||
'marc': post_open,
|
||||
}[type](name)
|
||||
p.extrapolation({True:'linear',False:'translate'}[nodal])
|
||||
p.moveto(1)
|
||||
|
@ -512,19 +512,19 @@ def ParsePostfile(p,filename, outputFormat):
|
|||
|
||||
needs "outputFormat" for mapping of output names to postfile output indices
|
||||
"""
|
||||
stat = { \
|
||||
'IndexOfLabel': {}, \
|
||||
'Title': p.title(), \
|
||||
'Extrapolation': p.extrapolate, \
|
||||
'NumberOfIncrements': p.increments(), \
|
||||
'NumberOfNodes': p.nodes(), \
|
||||
'NumberOfNodalScalars': p.node_scalars(), \
|
||||
'LabelOfNodalScalar': [None]*p.node_scalars() , \
|
||||
'NumberOfElements': p.elements(), \
|
||||
'NumberOfElementalScalars': p.element_scalars(), \
|
||||
'LabelOfElementalScalar': [None]*p.element_scalars() , \
|
||||
'NumberOfElementalTensors': p.element_tensors(), \
|
||||
'LabelOfElementalTensor': [None]*p.element_tensors(), \
|
||||
stat = {
|
||||
'IndexOfLabel': {},
|
||||
'Title': p.title(),
|
||||
'Extrapolation': p.extrapolate,
|
||||
'NumberOfIncrements': p.increments(),
|
||||
'NumberOfNodes': p.nodes(),
|
||||
'NumberOfNodalScalars': p.node_scalars(),
|
||||
'LabelOfNodalScalar': [None]*p.node_scalars(),
|
||||
'NumberOfElements': p.elements(),
|
||||
'NumberOfElementalScalars': p.element_scalars(),
|
||||
'LabelOfElementalScalar': [None]*p.element_scalars(),
|
||||
'NumberOfElementalTensors': p.element_tensors(),
|
||||
'LabelOfElementalTensor': [None]*p.element_tensors(),
|
||||
}
|
||||
|
||||
# --- find labels
|
||||
|
@ -671,6 +671,9 @@ parser.add_option('-m','--map', dest='func',
|
|||
parser.add_option('-p','--type', dest='filetype',
|
||||
metavar = 'string',
|
||||
help = 'type of result file [auto]')
|
||||
parser.add_option('-q','--quiet', dest='verbose',
|
||||
action = 'store_false',
|
||||
help = 'suppress verbose output')
|
||||
|
||||
group_material = OptionGroup(parser,'Material identifier')
|
||||
|
||||
|
@ -711,24 +714,26 @@ parser.add_option_group(group_material)
|
|||
parser.add_option_group(group_general)
|
||||
parser.add_option_group(group_special)
|
||||
|
||||
parser.set_defaults(info = False)
|
||||
parser.set_defaults(legacy = False)
|
||||
parser.set_defaults(nodal = False)
|
||||
parser.set_defaults(prefix = '')
|
||||
parser.set_defaults(suffix = '')
|
||||
parser.set_defaults(dir = 'postProc')
|
||||
parser.set_defaults(filetype = None)
|
||||
parser.set_defaults(func = 'avg')
|
||||
parser.set_defaults(homog = '1')
|
||||
parser.set_defaults(cryst = '1')
|
||||
parser.set_defaults(phase = '1')
|
||||
parser.set_defaults(filter = '')
|
||||
parser.set_defaults(sep = [])
|
||||
parser.set_defaults(sort = [])
|
||||
parser.set_defaults(inc = False)
|
||||
parser.set_defaults(time = False)
|
||||
parser.set_defaults(separateFiles = False)
|
||||
parser.set_defaults(getIncrements= False)
|
||||
parser.set_defaults(info = False,
|
||||
verbose = True,
|
||||
legacy = False,
|
||||
nodal = False,
|
||||
prefix = '',
|
||||
suffix = '',
|
||||
dir = 'postProc',
|
||||
filetype = None,
|
||||
func = 'avg',
|
||||
homog = '1',
|
||||
cryst = '1',
|
||||
phase = '1',
|
||||
filter = '',
|
||||
sep = [],
|
||||
sort = [],
|
||||
inc = False,
|
||||
time = False,
|
||||
separateFiles = False,
|
||||
getIncrements= False,
|
||||
)
|
||||
|
||||
(options, files) = parser.parse_args()
|
||||
|
||||
|
@ -797,8 +802,9 @@ options.sep.reverse()
|
|||
|
||||
# --- start background messaging
|
||||
|
||||
bg = damask.util.backgroundMessage()
|
||||
bg.start()
|
||||
if options.verbose:
|
||||
bg = damask.util.backgroundMessage()
|
||||
bg.start()
|
||||
|
||||
# --- parse .output and .t16 files
|
||||
|
||||
|
@ -816,7 +822,7 @@ me = {
|
|||
'Constitutive': options.phase,
|
||||
}
|
||||
|
||||
bg.set_message('parsing .output files...')
|
||||
if options.verbose: bg.set_message('parsing .output files...')
|
||||
|
||||
for what in me:
|
||||
outputFormat[what] = ParseOutputFormat(filename, what, me[what])
|
||||
|
@ -824,9 +830,10 @@ for what in me:
|
|||
print("\nsection '{}' not found in <{}>".format(me[what], what))
|
||||
print('\n'.join(map(lambda x:' [%s]'%x, outputFormat[what]['specials']['brothers'])))
|
||||
|
||||
bg.set_message('opening result file...')
|
||||
if options.verbose: bg.set_message('opening result file...')
|
||||
|
||||
p = OpenPostfile(filename+extension,options.filetype,options.nodal)
|
||||
bg.set_message('parsing result file...')
|
||||
if options.verbose: bg.set_message('parsing result file...')
|
||||
stat = ParsePostfile(p, filename, outputFormat)
|
||||
if options.filetype == 'marc':
|
||||
stat['NumberOfIncrements'] -= 1 # t16 contains one "virtual" increment (at 0)
|
||||
|
@ -870,8 +877,7 @@ if options.info:
|
|||
|
||||
elementsOfNode = {}
|
||||
for e in range(stat['NumberOfElements']):
|
||||
if e%1000 == 0:
|
||||
bg.set_message('connect elem %i...'%e)
|
||||
if options.verbose and e%1000 == 0: bg.set_message('connect elem %i...'%e)
|
||||
for n in map(p.node_sequence,p.element(e).items):
|
||||
if n not in elementsOfNode:
|
||||
elementsOfNode[n] = [p.element_id(e)]
|
||||
|
@ -893,8 +899,7 @@ memberCount = 0
|
|||
|
||||
if options.nodalScalar:
|
||||
for n in range(stat['NumberOfNodes']):
|
||||
if n%1000 == 0:
|
||||
bg.set_message('scan node %i...'%n)
|
||||
if options.verbose and n%1000 == 0: bg.set_message('scan node %i...'%n)
|
||||
myNodeID = p.node_id(n)
|
||||
myNodeCoordinates = [p.node(n).x, p.node(n).y, p.node(n).z]
|
||||
myElemID = 0
|
||||
|
@ -928,8 +933,7 @@ if options.nodalScalar:
|
|||
|
||||
else:
|
||||
for e in range(stat['NumberOfElements']):
|
||||
if e%1000 == 0:
|
||||
bg.set_message('scan elem %i...'%e)
|
||||
if options.verbose and e%1000 == 0: bg.set_message('scan elem %i...'%e)
|
||||
myElemID = p.element_id(e)
|
||||
myIpCoordinates = ipCoords(p.element(e).type, map(lambda node: [node.x, node.y, node.z],
|
||||
map(p.node, map(p.node_sequence, p.element(e).items))))
|
||||
|
@ -995,7 +999,7 @@ if 'none' not in map(str.lower, options.sort):
|
|||
theKeys.append('x[0][%i]'%where[criterium])
|
||||
|
||||
sortKeys = eval('lambda x:(%s)'%(','.join(theKeys)))
|
||||
bg.set_message('sorting groups...')
|
||||
if options.verbose: bg.set_message('sorting groups...')
|
||||
groups.sort(key = sortKeys) # in-place sorting to save mem
|
||||
|
||||
|
||||
|
@ -1014,7 +1018,7 @@ standard = ['inc'] + \
|
|||
|
||||
# --------------------------- loop over positions --------------------------------
|
||||
|
||||
bg.set_message('getting map between positions and increments...')
|
||||
if options.verbose: bg.set_message('getting map between positions and increments...')
|
||||
|
||||
incAtPosition = {}
|
||||
positionOfInc = {}
|
||||
|
@ -1075,7 +1079,7 @@ for incCount,position in enumerate(locations): # walk through locations
|
|||
member += 1
|
||||
if member%1000 == 0:
|
||||
time_delta = ((len(locations)*memberCount)/float(member+incCount*memberCount)-1.0)*(time.time()-time_start)
|
||||
bg.set_message('(%02i:%02i:%02i) processing point %i of %i from increment %i (position %i)...'
|
||||
if options.verbose: bg.set_message('(%02i:%02i:%02i) processing point %i of %i from increment %i (position %i)...'
|
||||
%(time_delta//3600,time_delta%3600//60,time_delta%60,member,memberCount,increments[incCount],position))
|
||||
|
||||
newby = [] # current member's data
|
||||
|
|
|
@ -3084,35 +3084,49 @@ logical function crystallite_stateJump(ipc,ip,el)
|
|||
|
||||
implicit none
|
||||
integer(pInt), intent(in):: &
|
||||
el, & ! element index
|
||||
ip, & ! integration point index
|
||||
el, & ! element index
|
||||
ip, & ! integration point index
|
||||
ipc ! grain index
|
||||
|
||||
integer(pInt) :: &
|
||||
c, &
|
||||
p, &
|
||||
mySource, &
|
||||
myOffsetPlasticDeltaState, &
|
||||
myOffsetSourceDeltaState, &
|
||||
mySizePlasticDeltaState, &
|
||||
mySizeSourceDeltaState
|
||||
|
||||
c= phasememberAt(ipc,ip,el)
|
||||
c = phasememberAt(ipc,ip,el)
|
||||
p = phaseAt(ipc,ip,el)
|
||||
|
||||
call constitutive_collectDeltaState(crystallite_Tstar_v(1:6,ipc,ip,el), crystallite_Fe(1:3,1:3,ipc,ip,el), ipc,ip,el)
|
||||
mySizePlasticDeltaState = plasticState(p)%sizeDeltaState
|
||||
if( any(IEEE_is_NaN(plasticState(p)%deltaState(:,c)))) then ! NaN occured in deltaState
|
||||
|
||||
myOffsetPlasticDeltaState = plasticState(p)%offsetDeltaState
|
||||
mySizePlasticDeltaState = plasticState(p)%sizeDeltaState
|
||||
|
||||
if( any(IEEE_is_NaN(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)))) then ! NaN occured in deltaState
|
||||
crystallite_stateJump = .false.
|
||||
return
|
||||
endif
|
||||
plasticState(p)%state(1:mySizePlasticDeltaState,c) = plasticState(p)%state(1:mySizePlasticDeltaState,c) + &
|
||||
plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
||||
|
||||
plasticState(p)%state(myOffsetPlasticDeltaState + 1_pInt : &
|
||||
myOffsetPlasticDeltaState + mySizePlasticDeltaState,c) = &
|
||||
plasticState(p)%state(myOffsetPlasticDeltaState + 1_pInt : &
|
||||
myOffsetPlasticDeltaState + mySizePlasticDeltaState,c) + &
|
||||
plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
||||
|
||||
do mySource = 1_pInt, phase_Nsources(p)
|
||||
mySizeSourceDeltaState = sourceState(p)%p(mySource)%sizeDeltaState
|
||||
if( any(IEEE_is_NaN(sourceState(p)%p(mySource)%deltaState(:,c)))) then ! NaN occured in deltaState
|
||||
myOffsetSourceDeltaState = sourceState(p)%p(mySource)%offsetDeltaState
|
||||
mySizeSourceDeltaState = sourceState(p)%p(mySource)%sizeDeltaState
|
||||
if (any(IEEE_is_NaN(sourceState(p)%p(mySource)%deltaState(1:mySizeSourceDeltaState,c)))) then ! NaN occured in deltaState
|
||||
crystallite_stateJump = .false.
|
||||
return
|
||||
endif
|
||||
sourceState(p)%p(mySource)%state(1:mySizeSourceDeltaState,c) = &
|
||||
sourceState(p)%p(mySource)%state(1:mySizeSourceDeltaState,c) + &
|
||||
sourceState(p)%p(mySource)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||
myOffsetSourceDeltaState + mySizeSourceDeltaState,c) = &
|
||||
sourceState(p)%p(mySource)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||
myOffsetSourceDeltaState + mySizeSourceDeltaState,c) + &
|
||||
sourceState(p)%p(mySource)%deltaState(1:mySizeSourceDeltaState,c)
|
||||
enddo
|
||||
|
||||
|
@ -3123,7 +3137,9 @@ logical function crystallite_stateJump(ipc,ip,el)
|
|||
.or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then
|
||||
write(6,'(a,i8,1x,i2,1x,i3, /)') '<< CRYST >> update state at el ip ipc ',el,ip,ipc
|
||||
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> deltaState', plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
||||
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', plasticState(p)%state (1:mySizePlasticDeltaState,c)
|
||||
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', &
|
||||
plasticState(p)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||
myOffsetSourceDeltaState + mySizeSourceDeltaState,c)
|
||||
endif
|
||||
#endif
|
||||
|
||||
|
|
15
src/prec.f90
15
src/prec.f90
|
@ -39,20 +39,21 @@ module prec
|
|||
!http://stackoverflow.com/questions/3948210/can-i-have-a-pointer-to-an-item-in-an-allocatable-array
|
||||
type, public :: tState
|
||||
integer(pInt) :: &
|
||||
sizeState = 0_pInt , & !< size of state
|
||||
sizeDotState = 0_pInt, & !< size of dot state, i.e. parts of the state that are integrated
|
||||
sizeDeltaState = 0_pInt, & !< size of delta state, i.e. parts of the state that have discontinuous rates
|
||||
sizePostResults = 0_pInt !< size of output data
|
||||
sizeState = 0_pInt, & !< size of state
|
||||
sizeDotState = 0_pInt, & !< size of dot state, i.e. state(1:sizeDot) follows time evolution by dotState rates
|
||||
offsetDeltaState = 0_pInt, & !< offset of delta state
|
||||
sizeDeltaState = 0_pInt, & !< size of delta state, i.e. state(offset+1:offset+sizeDot) follows time evolution by deltaState increments
|
||||
sizePostResults = 0_pInt !< size of output data
|
||||
real(pReal), pointer, dimension(:), contiguous :: &
|
||||
atolState
|
||||
real(pReal), pointer, dimension(:,:), contiguous :: & ! a pointer is needed here because we might point to state/doState. However, they will never point to something, but are rather allocated and, hence, contiguous
|
||||
state0, &
|
||||
state, & !< state
|
||||
dotState, & !< state rate
|
||||
state0
|
||||
dotState, & !< rate of state change
|
||||
deltaState !< increment of state change
|
||||
real(pReal), allocatable, dimension(:,:) :: &
|
||||
partionedState0, &
|
||||
subState0, &
|
||||
deltaState, &
|
||||
previousDotState, & !< state rate of previous xxxx
|
||||
previousDotState2, & !< state rate two xxxx ago
|
||||
RK4dotState
|
||||
|
|
Loading…
Reference in New Issue