Merge remote-tracking branch 'origin/development' into 42-new-coding-style-for-homogenization

This commit is contained in:
Martin Diehl 2018-11-03 11:30:12 +01:00
commit c5b98e544a
8 changed files with 46 additions and 24 deletions

View File

@ -275,6 +275,13 @@ Spectral_ipNeighborhood:
- master - master
- release - release
RGC_DetectChanges:
stage: spectral
script: RGC_DetectChanges/test.py
except:
- master
- release
Nonlocal_Damage_DetectChanges: Nonlocal_Damage_DetectChanges:
stage: spectral stage: spectral
script: Nonlocal_Damage_DetectChanges/test.py script: Nonlocal_Damage_DetectChanges/test.py

View File

@ -3,7 +3,7 @@ SHELL = /bin/sh
# Makefile for the installation of DAMASK # Makefile for the installation of DAMASK
######################################################################################## ########################################################################################
.PHONY: all .PHONY: all
all: spectral FEM marc processing all: spectral FEM processing
.PHONY: spectral .PHONY: spectral
spectral: build/spectral spectral: build/spectral
@ -23,10 +23,6 @@ build/FEM:
@mkdir -p build/FEM @mkdir -p build/FEM
@(cd build/FEM; cmake -Wno-dev -DDAMASK_SOLVER=FEM -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;) @(cd build/FEM; cmake -Wno-dev -DDAMASK_SOLVER=FEM -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
.PHONY: marc
marc:
@./installation/mods_MarcMentat/apply_DAMASK_modifications.sh ${MAKEFLAGS}
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf build @rm -rf build

@ -1 +1 @@
Subproject commit 70f135395370b06c424e0dcf163afbd9d8ad24a1 Subproject commit 3d42118124eb1b4bccb6164d714af25650ba5a93

View File

@ -1 +1 @@
v2.0.2-756-g7217cdac v2.0.2-830-g0cbcb028

View File

@ -139,6 +139,7 @@ for name in filenames:
table.data_readArray(positions+1) # read desired columns (indexed 1,...) table.data_readArray(positions+1) # read desired columns (indexed 1,...)
table.data_writeArray() # directly write out table.data_writeArray() # directly write out
except: except:
table.data_rewind()
atOnce = False # data contains items that prevent array chunking atOnce = False # data contains items that prevent array chunking
if not atOnce: # read data line by line if not atOnce: # read data line by line

View File

@ -79,7 +79,7 @@ class MPIEspectral_result: # mimic py_post result object
self.dataOffset = 0 self.dataOffset = 0
while self.dataOffset < self.filesize: while self.dataOffset < self.filesize:
self.file.seek(self.dataOffset) self.file.seek(self.dataOffset)
if self.file.read(3) == 'eoh': break if self.file.read(3) == b'eoh': break
self.dataOffset += 1 self.dataOffset += 1
self.dataOffset += 7 self.dataOffset += 7
#search first for the new keywords with ':', if not found try to find the old ones #search first for the new keywords with ':', if not found try to find the old ones
@ -179,7 +179,7 @@ class MPIEspectral_result: # mimic py_post result object
self.file.seek(filepos) self.file.seek(filepos)
# read the starting tag in front of the keyword (Fortran indicates start and end of writing by a 4 byte tag indicating the length of the following data) # read the starting tag in front of the keyword (Fortran indicates start and end of writing by a 4 byte tag indicating the length of the following data)
dataLen=struct.unpack('i',self.file.read(4))[0] dataLen=struct.unpack('i',self.file.read(4))[0]
name = self.file.read(len(identifier)) # anticipate identifier name = self.file.read(len(identifier)).decode(errors="ignore") # anticipate identifier
start=filepos+(4+len(identifier)) # position of the values for the found key start=filepos+(4+len(identifier)) # position of the values for the found key
filepos=filepos+(4+dataLen+4) # forward to next keyword filepos=filepos+(4+dataLen+4) # forward to next keyword
@ -202,7 +202,7 @@ class MPIEspectral_result: # mimic py_post result object
def _keyedString(self,identifier,default=None): def _keyedString(self,identifier,default=None):
value = default value = default
self.file.seek(0) self.file.seek(0)
m = re.search(r'(.{4})%s(.*?)\1'%identifier,self.file.read(self.dataOffset),re.DOTALL) m = re.search(r'(.{4})%s(.*?)\1'%identifier,self.file.read(self.dataOffset).decode(errors="ignore"),re.DOTALL)
if m: if m:
value = m.group(2) value = m.group(2)
return value return value
@ -466,7 +466,7 @@ def ParseOutputFormat(filename,what,me):
"""Parse .output* files in order to get a list of outputs""" """Parse .output* files in order to get a list of outputs"""
content = [] content = []
format = {'outputs':{},'specials':{'brothers':[]}} format = {'outputs':{},'specials':{'brothers':[]}}
for prefix in ['']+map(str,range(1,17)): for prefix in ['']+list(map(str,range(1,17))):
if os.path.exists(prefix+filename+'.output'+what): if os.path.exists(prefix+filename+'.output'+what):
try: try:
file = open(prefix+filename+'.output'+what) file = open(prefix+filename+'.output'+what)
@ -850,7 +850,7 @@ for opt in ['nodalScalar','elemScalar','elemTensor','homogenizationResult','crys
if (opt in ['nodalScalar','elemScalar','elemTensor'] and label not in stat['IndexOfLabel'] and label not in ['elements',]) \ if (opt in ['nodalScalar','elemScalar','elemTensor'] and label not in stat['IndexOfLabel'] and label not in ['elements',]) \
or (opt in ['homogenizationResult','crystalliteResult','constitutiveResult'] \ or (opt in ['homogenizationResult','crystalliteResult','constitutiveResult'] \
and (not outputFormat[opt[:-6].capitalize()]['outputs'] \ and (not outputFormat[opt[:-6].capitalize()]['outputs'] \
or label not in zip(*outputFormat[opt[:-6].capitalize()]['outputs'])[0])): or label not in list(zip(*outputFormat[opt[:-6].capitalize()]['outputs']))[0])):
parser.error('%s "%s" unknown...'%(opt,label)) parser.error('%s "%s" unknown...'%(opt,label))
@ -935,8 +935,8 @@ else:
for e in range(stat['NumberOfElements']): for e in range(stat['NumberOfElements']):
if options.verbose and 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) myElemID = p.element_id(e)
myIpCoordinates = ipCoords(p.element(e).type, map(lambda node: [node.x, node.y, node.z], myIpCoordinates = ipCoords(p.element(e).type, list(map(lambda node: [node.x, node.y, node.z],
map(p.node, map(p.node_sequence, p.element(e).items)))) list(map(p.node, map(p.node_sequence, p.element(e).items))))))
myIpIDs = ipIDs(p.element(e).type) myIpIDs = ipIDs(p.element(e).type)
Nips = len(myIpIDs) Nips = len(myIpIDs)
myNodeIDs = p.element(e).items[:Nips] myNodeIDs = p.element(e).items[:Nips]
@ -1023,7 +1023,7 @@ if options.verbose: bg.set_message('getting map between positions and increments
incAtPosition = {} incAtPosition = {}
positionOfInc = {} positionOfInc = {}
for position in range(stat['NumberOfIncrements']): for position in range(int(stat['NumberOfIncrements'])):
p.moveto(position+offset_pos) p.moveto(position+offset_pos)
incAtPosition[position] = p.increment # remember "real" increment at this position incAtPosition[position] = p.increment # remember "real" increment at this position
positionOfInc[p.increment] = position # remember position of "real" increment positionOfInc[p.increment] = position # remember position of "real" increment
@ -1130,7 +1130,7 @@ for incCount,position in enumerate(locations): # walk through locations
['Crystallite']*len(options.crystalliteResult) + ['Crystallite']*len(options.crystalliteResult) +
['Constitutive']*len(options.constitutiveResult) ['Constitutive']*len(options.constitutiveResult)
): ):
outputIndex = list(zip(*outputFormat[resultType]['outputs'])[0]).index(label) # find the position of this output in the outputFormat outputIndex = (list(zip(*outputFormat[resultType]['outputs']))[0]).index(label) # find the position of this output in the outputFormat
length = int(outputFormat[resultType]['outputs'][outputIndex][1]) length = int(outputFormat[resultType]['outputs'][outputIndex][1])
thisHead = heading('_',[[component,''.join( label.split() )] for component in range(int(length>1),length+int(length>1))]) thisHead = heading('_',[[component,''.join( label.split() )] for component in range(int(length>1),length+int(length>1))])
if assembleHeader: header += thisHead if assembleHeader: header += thisHead

View File

@ -43,25 +43,42 @@ subroutine DAMASK_interface_init()
use, intrinsic :: & use, intrinsic :: &
iso_fortran_env iso_fortran_env
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
#if defined(__GFORTRAN__) && __GNUC__ < 5
===================================================================================================
5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0
===================================================================================================
================== THIS VERSION OF DAMASK REQUIRES gfortran > 5.0 ==============================
====================== THIS VERSION OF DAMASK REQUIRES gfortran > 5.0 ==========================
========================= THIS VERSION OF DAMASK REQUIRES gfortran > 5.0 =======================
===================================================================================================
5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0
===================================================================================================
#endif
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1600
===================================================================================================
16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0
===================================================================================================
================== THIS VERSION OF DAMASK REQUIRES ifort > 16.0 ================================
====================== THIS VERSION OF DAMASK REQUIRES ifort > 16.0 ===========================
========================= THIS VERSION OF DAMASK REQUIRES ifort > 16.0 ========================
===================================================================================================
16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0 16.0
===================================================================================================
#endif
#if PETSC_VERSION_MAJOR!=3 || PETSC_VERSION_MINOR!=10 #if PETSC_VERSION_MAJOR!=3 || PETSC_VERSION_MINOR!=10
=================================================================================================== ===================================================================================================
3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x
=================================================================================================== ===================================================================================================
======= THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ==========================================
========== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x =======================================
============= THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ====================================
================ THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x =================================
=================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ============================== =================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ==============================
====================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x =========================== ====================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ===========================
========================= THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ======================== ========================= THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ========================
============================ THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x =====================
=============================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ==================
================================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ===============
===================================== THIS VERSION OF DAMASK REQUIRES PETSc 3.10.x ============
=================================================================================================== ===================================================================================================
3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x 3.10.x
=================================================================================================== ===================================================================================================
#endif #endif
use PETScSys use PETScSys
use system_routines, only: & use system_routines, only: &
getHostName, & getHostName, &

1
src/DAMASK_marc2018.f90 Symbolic link
View File

@ -0,0 +1 @@
DAMASK_marc.f90