Merge branch 'development' into even-more-HDF5-postprocessing

This commit is contained in:
Martin Diehl 2019-07-06 20:35:09 -07:00
commit 18f00cb8df
104 changed files with 4221 additions and 4186 deletions

View File

@ -110,7 +110,7 @@ for executable in icc icpc ifort ;do
done done
firstLevel "MPI Wrappers" firstLevel "MPI Wrappers"
for executable in mpicc mpiCC mpic++ mpicpc mpicxx mpifort mpif90 mpif77; do for executable in mpicc mpiCC mpiicc mpic++ mpicpc mpicxx mpifort mpif90 mpif77; do
getDetails $executable '-show' getDetails $executable '-show'
done done

@ -1 +1 @@
Subproject commit 1d3cf8180a20bcba6958ce82eb97befec077d7d2 Subproject commit 18a976753be06aca6e15f580998e713daa08bb41

View File

@ -1 +1 @@
v2.0.3-559-g589f5343 v2.0.3-614-g4d6a047b

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,12 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,re,sys,collections import os
import math,scipy,scipy.linalg # noqa import sys
import numpy as np
from optparse import OptionParser from optparse import OptionParser
import re
import collections
import math # noqa
import scipy # noqa
import scipy.linalg # noqa
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,13 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os import os
import math import math
from optparse import OptionParser
import numpy as np import numpy as np
import scipy.ndimage import scipy.ndimage
from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -27,7 +30,7 @@ def curlFFT(geomdim,field):
curl_fourier = np.empty(field_fourier.shape,'c16') curl_fourier = np.empty(field_fourier.shape,'c16')
# differentiation in Fourier space # differentiation in Fourier space
TWOPIIMG = 2.0j*math.pi TWOPIIMG = 2.0j*np.pi
einsums = { einsums = {
3:'slm,ijkl,ijkm->ijks', # vector, 3 -> 3 3:'slm,ijkl,ijkm->ijks', # vector, 3 -> 3
9:'slm,ijkl,ijknm->ijksn', # tensor, 3x3 -> 3x3 9:'slm,ijkl,ijknm->ijksn', # tensor, 3x3 -> 3x3

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -30,6 +33,7 @@ def derivative(coordinates,what):
return result return result
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,10 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import sys
from optparse import OptionParser from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -16,6 +18,7 @@ def determinant(m):
-m[1]*m[3]*m[8] \ -m[1]*m[3]*m[8] \
-m[0]*m[5]*m[7] -m[0]*m[5]*m[7]
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,8 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import sys
from optparse import OptionParser from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
@ -19,6 +20,7 @@ def deviator(m,spherical = False):
] ]
return dev,sph if spherical else dev return dev,sph if spherical else dev
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,12 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import sys
from optparse import OptionParser
import numpy as np import numpy as np
import scipy.ndimage import scipy.ndimage
from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -57,7 +60,7 @@ def displacementAvgFFT(F,grid,size,nodal=False,transformed=False):
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): def displacementFluctFFT(F,grid,size,nodal=False,transformed=False):
"""Calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" """Calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell"""
integrator = 0.5j * size / math.pi integrator = 0.5j * size / np.pi
kk, kj, ki = np.meshgrid(np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2])), kk, kj, ki = np.meshgrid(np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2])),
np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1])), np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1])),

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -27,7 +30,7 @@ def divFFT(geomdim,field):
div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16')
# differentiation in Fourier space # differentiation in Fourier space
TWOPIIMG = 2.0j*math.pi TWOPIIMG = 2.0j*np.pi
einsums = { einsums = {
3:'ijkl,ijkl->ijk', # vector, 3 -> 1 3:'ijkl,ijkl->ijk', # vector, 3 -> 1
9:'ijkm,ijklm->ijkl', # tensor, 3x3 -> 3 9:'ijkm,ijklm->ijkl', # tensor, 3x3 -> 3

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -26,6 +29,7 @@ def E_hkl(stiffness,vec): # stiffness = (c11,c12,c44)
return 1.0/invE return 1.0/invE
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,12 +1,16 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,itertools import os
import sys
from optparse import OptionParser
import itertools
import numpy as np import numpy as np
from scipy import ndimage from scipy import ndimage
from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -31,6 +35,7 @@ def periodic_3Dpad(array, rimdim=(1,1,1)):
padded[p[0],p[1],p[2]] = array[spot[0],spot[1],spot[2]] padded[p[0],p[1],p[2]] = array[spot[0],spot[1],spot[2]]
return padded return padded
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,12 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
from scipy import ndimage from scipy import ndimage
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -27,7 +30,7 @@ def gradFFT(geomdim,field):
grad_fourier = np.empty(field_fourier.shape+(3,),'c16') grad_fourier = np.empty(field_fourier.shape+(3,),'c16')
# differentiation in Fourier space # differentiation in Fourier space
TWOPIIMG = 2.0j*math.pi TWOPIIMG = 2.0j*np.pi
einsums = { einsums = {
1:'ijkl,ijkm->ijkm', # scalar, 1 -> 3 1:'ijkl,ijkm->ijkm', # scalar, 1 -> 3
3:'ijkl,ijkm->ijklm', # vector, 3 -> 3x3 3:'ijkl,ijkm->ijklm', # vector, 3 -> 3x3

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,10 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os import os
from optparse import OptionParser from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,12 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
from collections import OrderedDict from collections import OrderedDict
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -14,7 +17,7 @@ def Mises(what,tensor):
dev = tensor - np.trace(tensor)/3.0*np.eye(3) dev = tensor - np.trace(tensor)/3.0*np.eye(3)
symdev = 0.5*(dev+dev.T) symdev = 0.5*(dev+dev.T)
return math.sqrt(np.sum(symdev*symdev.T)* return np.sqrt(np.sum(symdev*symdev.T)*
{ {
'stress': 3.0/2.0, 'stress': 3.0/2.0,
'strain': 2.0/3.0, 'strain': 2.0/3.0,

View File

@ -1,10 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -16,12 +20,13 @@ def norm(which,object):
if which == 'Abs': # p = 1 if which == 'Abs': # p = 1
return sum(map(abs, object)) return sum(map(abs, object))
elif which == 'Frobenius': # p = 2 elif which == 'Frobenius': # p = 2
return math.sqrt(sum([x*x for x in object])) return np.sqrt(sum([x*x for x in object]))
elif which == 'Max': # p = inf elif which == 'Max': # p = inf
return max(map(abs, object)) return max(map(abs, object))
else: else:
return -1 return -1
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
@ -136,7 +139,7 @@ parser.set_defaults(force = (0.0,0.0,1.0),
quaternion='orientation', quaternion='orientation',
normal = None, normal = None,
lattice = latticeChoices[0], lattice = latticeChoices[0],
CoverA = math.sqrt(8./3.), CoverA = np.sqrt(8./3.),
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,19 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import sys
from optparse import OptionParser from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Append data of ASCIItable(s). Append data of ASCIItable(s) column-wise.
""", version = scriptID) """, version = scriptID)

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import sys
from optparse import OptionParser
import numpy as np import numpy as np
import scipy.ndimage import scipy.ndimage
from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,12 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,re,sys,fnmatch import os
import math # noqa import sys
import numpy as np
from optparse import OptionParser from optparse import OptionParser
import re
import fnmatch
import math # noqa
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,12 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import math # noqa import sys
import numpy as np
from optparse import OptionParser, OptionGroup from optparse import OptionParser, OptionGroup
import math # noqa
import numpy as np
import damask import damask
def periodicAverage(coords, limits): def periodicAverage(coords, limits):
"""Centroid in periodic domain, see https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions""" """Centroid in periodic domain, see https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions"""
theta = 2.0*np.pi * (coords - limits[0])/(limits[1] - limits[0]) theta = 2.0*np.pi * (coords - limits[0])/(limits[1] - limits[0])

79
processing/post/growTable.py Executable file
View File

@ -0,0 +1,79 @@
#!/usr/bin/env python3
import os
import sys
from optparse import OptionParser
import numpy as np
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version])
# --------------------------------------------------------------------
# MAIN
# --------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """
Append data of ASCIItable(s) row-wise.
""", version = scriptID)
parser.add_option('-a', '--add','--table',
dest = 'table',
action = 'extend', metavar = '<string LIST>',
help = 'tables to add')
(options,filenames) = parser.parse_args()
if options.table is None:
parser.error('no table specified.')
# --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = [None]
for name in filenames:
try: table = damask.ASCIItable(name = name,
buffered = False)
except: continue
damask.util.report(scriptName,name)
tables = []
for addTable in options.table:
try: tables.append(damask.ASCIItable(name = addTable,
buffered = False,
readonly = True)
)
except: continue
# ------------------------------------------ read headers ------------------------------------------
table.head_read()
for addTable in tables: addTable.head_read()
# ------------------------------------------ assemble header --------------------------------------
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
table.head_write()
# ------------------------------------------ process data ------------------------------------------
table.data_readArray()
data = table.data
for addTable in tables:
addTable.data_readArray(table.labels(raw = True))
data = np.vstack((data,addTable.data))
table.data = data
table.data_writeArray()
# ------------------------------------------ output finalization -----------------------------------
table.close() # close ASCII tables
for addTable in tables:
addTable.close()

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
from PIL import Image from PIL import Image
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
from PIL import Image from PIL import Image
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,10 +1,13 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*- # -*- coding: UTF-8 no BOM -*-
import os,sys import os
import damask import sys
from optparse import OptionParser from optparse import OptionParser
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,13 +1,16 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import sys,os import os
import damask import sys
from optparse import OptionParser from optparse import OptionParser
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,9 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math,re,time,struct import os
import damask import sys
from optparse import OptionParser, OptionGroup from optparse import OptionParser, OptionGroup
import math
import re
import time
import struct
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,13 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,re import os
import damask import sys
from optparse import OptionParser from optparse import OptionParser
import re
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import numpy as np
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,13 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os import os
from optparse import OptionParser from optparse import OptionParser
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,12 +1,17 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# -*- coding: UTF-8 no BOM -*-
import os,string,math,sys import os
import numpy as np import sys
from optparse import OptionParser from optparse import OptionParser
import string
import math
import numpy as np
import vtk import vtk
import damask import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,vtk import os
import damask
from vtk.util import numpy_support
from collections import defaultdict
from optparse import OptionParser from optparse import OptionParser
from collections import defaultdict
import vtk
from vtk.util import numpy_support
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,15 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,vtk import os
import damask
from collections import defaultdict
from optparse import OptionParser from optparse import OptionParser
from collections import defaultdict
import vtk
from vtk.util import numpy_support from vtk.util import numpy_support
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,15 +1,20 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,vtk import os
import damask
from vtk.util import numpy_support
from collections import defaultdict
from optparse import OptionParser from optparse import OptionParser
from collections import defaultdict
import vtk
from vtk.util import numpy_support
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,vtk import os
import numpy as np import sys
import damask
from optparse import OptionParser from optparse import OptionParser
import vtk
import numpy as np
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -1,14 +1,19 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,vtk import os
import numpy as np import sys
import damask
from optparse import OptionParser from optparse import OptionParser
import vtk
import numpy as np
import damask
scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptName = os.path.splitext(os.path.basename(__file__))[0]
scriptID = ' '.join([scriptName,damask.version]) scriptID = ' '.join([scriptName,damask.version])
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# MAIN # MAIN
# -------------------------------------------------------------------- # --------------------------------------------------------------------

View File

@ -125,11 +125,6 @@ subroutine CPFEM_init
! flush(6) ! flush(6)
! endif ! endif
! call IO_read_intFile(777,'recordedPhase'//trim(rankStr),modelName,size(material_phase))
! read (777,rec=1) material_phase
! close (777)
! call IO_read_realFile(777,'convergedF'//trim(rankStr),modelName,size(crystallite_F0)) ! call IO_read_realFile(777,'convergedF'//trim(rankStr),modelName,size(crystallite_F0))
! read (777,rec=1) crystallite_F0 ! read (777,rec=1) crystallite_F0
! close (777) ! close (777)
@ -262,7 +257,7 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
if (debug_e <= discretization_nElem .and. debug_i <=discretization_nIP) then if (debug_e <= discretization_nElem .and. debug_i <=discretization_nIP) then
write(6,'(a,1x,i8,1x,i2,1x,i4,/,(12x,6(e20.8,1x)),/)') & write(6,'(a,1x,i8,1x,i2,1x,i4,/,(12x,6(e20.8,1x)),/)') &
'<< CPFEM >> aged state of elFE ip grain',debug_e, debug_i, 1, & '<< CPFEM >> aged state of elFE ip grain',debug_e, debug_i, 1, &
plasticState(phaseAt(1,debug_i,debug_e))%state(:,phasememberAt(1,debug_i,debug_e)) plasticState(material_phaseAt(1,debug_e))%state(:,material_phasememberAt(1,debug_i,debug_e))
endif endif
endif endif
@ -280,10 +275,6 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt
! write(6,'(a)') '<< CPFEM >> writing state variables of last converged step to binary files' ! write(6,'(a)') '<< CPFEM >> writing state variables of last converged step to binary files'
! !
! call IO_write_jobRealFile(777,'recordedPhase'//trim(rankStr),size(material_phase))
! write (777,rec=1) material_phase
! close (777)
! call IO_write_jobRealFile(777,'convergedF'//trim(rankStr),size(crystallite_F0)) ! call IO_write_jobRealFile(777,'convergedF'//trim(rankStr),size(crystallite_F0))
! write (777,rec=1) crystallite_F0 ! write (777,rec=1) crystallite_F0
! close (777) ! close (777)

View File

@ -52,7 +52,6 @@ subroutine CPFEM_initAll
call debug_init call debug_init
call config_init call config_init
call math_init call math_init
call FE_init
call mesh_init call mesh_init
call lattice_init call lattice_init
call HDF5_utilities_init call HDF5_utilities_init
@ -78,8 +77,8 @@ subroutine CPFEM_init
write(6,'(/,a)') ' <<<+- CPFEM init -+>>>' write(6,'(/,a)') ' <<<+- CPFEM init -+>>>'
flush(6) flush(6)
! *** restore the last converged values of each essential variable from the binary file ! *** restore the last converged values of each essential variable
if (restartRead) then if (interface_restartInc > 0) then
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0) then if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0) then
write(6,'(a)') '<< CPFEM >> restored state variables of last converged step from hdf5 file' write(6,'(a)') '<< CPFEM >> restored state variables of last converged step from hdf5 file'
flush(6) flush(6)
@ -89,12 +88,11 @@ subroutine CPFEM_init
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
call HDF5_read(fileHandle,material_phase, 'recordedPhase')
call HDF5_read(fileHandle,crystallite_F0, 'convergedF') call HDF5_read(fileHandle,crystallite_F0, 'convergedF')
call HDF5_read(fileHandle,crystallite_Fp0, 'convergedFp') call HDF5_read(fileHandle,crystallite_Fp0,'convergedFp')
call HDF5_read(fileHandle,crystallite_Fi0, 'convergedFi') call HDF5_read(fileHandle,crystallite_Fi0,'convergedFi')
call HDF5_read(fileHandle,crystallite_Lp0, 'convergedLp') call HDF5_read(fileHandle,crystallite_Lp0,'convergedLp')
call HDF5_read(fileHandle,crystallite_Li0, 'convergedLi') call HDF5_read(fileHandle,crystallite_Li0,'convergedLi')
call HDF5_read(fileHandle,crystallite_S0, 'convergedS') call HDF5_read(fileHandle,crystallite_S0, 'convergedS')
groupPlasticID = HDF5_openGroup(fileHandle,'PlasticPhases') groupPlasticID = HDF5_openGroup(fileHandle,'PlasticPhases')
@ -112,8 +110,6 @@ subroutine CPFEM_init
call HDF5_closeGroup(groupHomogID) call HDF5_closeGroup(groupHomogID)
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
restartRead = .false.
endif endif
end subroutine CPFEM_init end subroutine CPFEM_init
@ -158,7 +154,6 @@ subroutine CPFEM_age
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a')
call HDF5_write(fileHandle,material_phase, 'recordedPhase')
call HDF5_write(fileHandle,crystallite_F0, 'convergedF') call HDF5_write(fileHandle,crystallite_F0, 'convergedF')
call HDF5_write(fileHandle,crystallite_Fp0, 'convergedFp') call HDF5_write(fileHandle,crystallite_Fp0, 'convergedFp')
call HDF5_write(fileHandle,crystallite_Fi0, 'convergedFi') call HDF5_write(fileHandle,crystallite_Fi0, 'convergedFi')

View File

@ -353,8 +353,7 @@ subroutine flux(f,ts,n,time)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief sets user defined output variables for Marc !> @brief trigger writing of results
!> @details select a variable contour plotting (user subroutine).
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine uedinc(inc,incsub) subroutine uedinc(inc,incsub)
use prec use prec

View File

@ -1,8 +1,7 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH !> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief triggering reading in of restart information when doing a restart !> @brief holds some global variables and gets extra information for commercial FEM
!> @todo Descriptions for public variables needed
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module FEsolving module FEsolving
use prec use prec
@ -12,32 +11,34 @@ module FEsolving
implicit none implicit none
private private
integer, public :: &
restartInc = 1 !< needs description
logical, public :: & logical, public :: &
symmetricSolver = .false., & !< use a symmetric FEM solver #if defined(Marc4DAMASK) || defined(Abaqus)
restartWrite = .false., & !< write current state to enable restart
restartRead = .false., & !< restart information to continue calculation from saved state restartRead = .false., & !< restart information to continue calculation from saved state
#endif
restartWrite = .false., & !< write current state to enable restart
terminallyIll = .false. !< at least one material point is terminally ill terminallyIll = .false. !< at least one material point is terminally ill
integer, dimension(:,:), allocatable, public :: & integer, dimension(:,:), allocatable, public :: &
FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP
integer, dimension(2), public :: & integer, dimension(2), public :: &
FEsolving_execElem !< for ping-pong scheme always whole range, otherwise one specific element FEsolving_execElem !< for ping-pong scheme always whole range, otherwise one specific element
#if defined(Marc4DAMASK) || defined(Abaqus)
logical, public, protected :: &
symmetricSolver = .false. !< use a symmetric FEM solver (only Abaqus)
character(len=1024), public :: & character(len=1024), public :: &
modelName !< needs description modelName !< needs description
logical, dimension(:,:), allocatable, public :: & logical, dimension(:,:), allocatable, public :: &
calcMode !< do calculation or simply collect when using ping pong scheme calcMode !< do calculation or simply collect when using ping pong scheme
public :: FE_init public :: FE_init
#endif
contains contains
#if defined(Marc4DAMASK) || defined(Abaqus)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief determine whether a symmetric solver is used and whether restart is requested !> @brief determine whether a symmetric solver is used and whether restart is requested
!> @details restart information is found in input file in case of FEM solvers, in case of spectal !> @details restart information is found in input file in case of FEM solvers, in case of spectal
@ -45,27 +46,15 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine FE_init subroutine FE_init
#if defined(Marc4DAMASK) || defined(Abaqus)
integer, parameter :: & integer, parameter :: &
FILEUNIT = 222 FILEUNIT = 222
integer :: j integer :: j
character(len=65536) :: tag, line character(len=65536) :: tag, line
integer, allocatable, dimension(:) :: chunkPos integer, allocatable, dimension(:) :: chunkPos
#endif
write(6,'(/,a)') ' <<<+- FEsolving init -+>>>' write(6,'(/,a)') ' <<<+- FEsolving init -+>>>'
modelName = getSolverJobName() modelName = getSolverJobName()
#if defined(Grid) || defined(FEM)
restartInc = interface_RestartInc
if(restartInc < 0) then
call IO_warning(warning_ID=34)
restartInc = 0
endif
restartRead = restartInc > 0 ! only read in if "true" restart requested
#else
call IO_open_inputFile(FILEUNIT,modelName) call IO_open_inputFile(FILEUNIT,modelName)
rewind(FILEUNIT) rewind(FILEUNIT)
do do
@ -125,7 +114,6 @@ subroutine FE_init
200 close(FILEUNIT) 200 close(FILEUNIT)
endif endif
#endif
if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0) then if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0) then
write(6,'(a21,l1)') ' restart writing: ', restartWrite write(6,'(a21,l1)') ' restart writing: ', restartWrite
write(6,'(a21,l1)') ' restart reading: ', restartRead write(6,'(a21,l1)') ' restart reading: ', restartRead
@ -133,5 +121,6 @@ subroutine FE_init
endif endif
end subroutine FE_init end subroutine FE_init
#endif
end module FEsolving end module FEsolving

View File

@ -1873,7 +1873,7 @@ subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, &
call h5pcreate_f(H5P_DATASET_XFER_F, plist_id, hdferr) call h5pcreate_f(H5P_DATASET_XFER_F, plist_id, hdferr)
if (hdferr < 0) call IO_error(1,ext_msg='initialize_write: h5pcreate_f') if (hdferr < 0) call IO_error(1,ext_msg='initialize_write: h5pcreate_f')
#ifdef PETSc #ifdef PETSc
if (parallel) then if (parallel) then
call h5pset_dxpl_mpio_f(plist_id, H5FD_MPIO_COLLECTIVE_F, hdferr) call h5pset_dxpl_mpio_f(plist_id, H5FD_MPIO_COLLECTIVE_F, hdferr)
if (hdferr < 0) call IO_error(1,ext_msg='initialize_write: h5pset_dxpl_mpio_f') if (hdferr < 0) call IO_error(1,ext_msg='initialize_write: h5pset_dxpl_mpio_f')
endif endif
@ -1884,7 +1884,7 @@ if (parallel) then
writeSize = 0 writeSize = 0
writeSize(worldrank+1) = int(myShape(ubound(myShape,1))) writeSize(worldrank+1) = int(myShape(ubound(myShape,1)))
#ifdef PETSc #ifdef PETSc
if (parallel) then if (parallel) then
call MPI_allreduce(MPI_IN_PLACE,writeSize,worldsize,MPI_INT,MPI_SUM,PETSC_COMM_WORLD,ierr) ! get total output size over each process call MPI_allreduce(MPI_IN_PLACE,writeSize,worldsize,MPI_INT,MPI_SUM,PETSC_COMM_WORLD,ierr) ! get total output size over each process
if (ierr /= 0) call IO_error(894,ext_msg='initialize_write: MPI_allreduce') if (ierr /= 0) call IO_error(894,ext_msg='initialize_write: MPI_allreduce')
endif endif
@ -1928,6 +1928,6 @@ subroutine finalize_write(plist_id, dset_id, filespace_id, memspace_id)
if (hdferr < 0) call IO_error(1,ext_msg='finalize_write: h5sclose_f/memspace_id') if (hdferr < 0) call IO_error(1,ext_msg='finalize_write: h5sclose_f/memspace_id')
end subroutine finalize_write end subroutine finalize_write
#endif #endif
end module HDF5_Utilities end module HDF5_Utilities

View File

@ -50,6 +50,7 @@ module IO
IO_countNumericalDataLines IO_countNumericalDataLines
#endif #endif
#endif #endif
private :: & private :: &
IO_verifyFloatValue, & IO_verifyFloatValue, &
IO_verifyIntValue IO_verifyIntValue
@ -250,11 +251,11 @@ subroutine IO_open_inputFile(fileUnit,modelName)
contains contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief create a new input file for abaqus simulations by removing all comment lines and !> @brief create a new input file for abaqus simulations by removing all comment lines and
!> including "include"s !> including "include"s
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
recursive function abaqus_assembleInputFile(unit1,unit2) result(createSuccess) recursive function abaqus_assembleInputFile(unit1,unit2) result(createSuccess)
integer, intent(in) :: unit1, & integer, intent(in) :: unit1, &
unit2 unit2
@ -298,7 +299,7 @@ recursive function abaqus_assembleInputFile(unit1,unit2) result(createSuccess)
200 createSuccess =.false. 200 createSuccess =.false.
end function abaqus_assembleInputFile end function abaqus_assembleInputFile
#elif defined(Marc4DAMASK) #elif defined(Marc4DAMASK)
path = trim(modelName)//inputFileExtension path = trim(modelName)//inputFileExtension
open(fileUnit,status='old',iostat=myStat,file=path) open(fileUnit,status='old',iostat=myStat,file=path)
@ -769,23 +770,25 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
case (810) case (810)
msg = 'FFTW plan creation' msg = 'FFTW plan creation'
case (831) case (831)
msg = 'mask consistency violated in spectral loadcase' msg = 'mask consistency violated in grid load case'
case (832) case (832)
msg = 'ill-defined L (line partly defined) in spectral loadcase' msg = 'ill-defined L (line partly defined) in grid load case'
case (834) case (834)
msg = 'negative time increment in spectral loadcase' msg = 'negative time increment in grid load case'
case (835) case (835)
msg = 'non-positive increments in spectral loadcase' msg = 'non-positive increments in grid load case'
case (836) case (836)
msg = 'non-positive result frequency in spectral loadcase' msg = 'non-positive result frequency in grid load case'
case (837) case (837)
msg = 'incomplete loadcase' msg = 'incomplete loadcase'
case (838) case (838)
msg = 'mixed boundary conditions allow rotation' msg = 'mixed boundary conditions allow rotation'
case (839)
msg = 'non-positive restart frequency in grid load case'
case (841) case (841)
msg = 'missing header length info in spectral mesh' msg = 'missing header length info in grid mesh'
case (842) case (842)
msg = 'incomplete information in spectral mesh header' msg = 'incomplete information in grid mesh header'
case (843) case (843)
msg = 'microstructure count mismatch' msg = 'microstructure count mismatch'
case (846) case (846)

View File

@ -26,19 +26,12 @@ module config
config_numerics, & config_numerics, &
config_debug config_debug
!ToDo: bad names (how should one know that those variables are defined in config?)
character(len=64), dimension(:), allocatable, public, protected :: & character(len=64), dimension(:), allocatable, public, protected :: &
phase_name, & !< name of each phase config_name_phase, & !< name of each phase
homogenization_name, & !< name of each homogenization config_name_homogenization, & !< name of each homogenization
crystallite_name, & !< name of each crystallite setting config_name_crystallite, & !< name of each crystallite setting
microstructure_name, & !< name of each microstructure config_name_microstructure, & !< name of each microstructure
texture_name !< name of each texture config_name_texture !< name of each texture
! ToDo: Remove, use size(config_phase) etc
integer, public, protected :: &
material_Nphase, & !< number of phases
material_Nhomogenization !< number of homogenizations
public :: & public :: &
config_init, & config_init, &
@ -81,36 +74,33 @@ subroutine config_init
select case (trim(part)) select case (trim(part))
case (trim('phase')) case (trim('phase'))
call parse_materialConfig(phase_name,config_phase,line,fileContent(i+1:)) call parse_materialConfig(config_name_phase,config_phase,line,fileContent(i+1:))
if (verbose) write(6,'(a)') ' Phase parsed'; flush(6) if (verbose) write(6,'(a)') ' Phase parsed'; flush(6)
case (trim('microstructure')) case (trim('microstructure'))
call parse_materialConfig(microstructure_name,config_microstructure,line,fileContent(i+1:)) call parse_materialConfig(config_name_microstructure,config_microstructure,line,fileContent(i+1:))
if (verbose) write(6,'(a)') ' Microstructure parsed'; flush(6) if (verbose) write(6,'(a)') ' Microstructure parsed'; flush(6)
case (trim('crystallite')) case (trim('crystallite'))
call parse_materialConfig(crystallite_name,config_crystallite,line,fileContent(i+1:)) call parse_materialConfig(config_name_crystallite,config_crystallite,line,fileContent(i+1:))
if (verbose) write(6,'(a)') ' Crystallite parsed'; flush(6) if (verbose) write(6,'(a)') ' Crystallite parsed'; flush(6)
case (trim('homogenization')) case (trim('homogenization'))
call parse_materialConfig(homogenization_name,config_homogenization,line,fileContent(i+1:)) call parse_materialConfig(config_name_homogenization,config_homogenization,line,fileContent(i+1:))
if (verbose) write(6,'(a)') ' Homogenization parsed'; flush(6) if (verbose) write(6,'(a)') ' Homogenization parsed'; flush(6)
case (trim('texture')) case (trim('texture'))
call parse_materialConfig(texture_name,config_texture,line,fileContent(i+1:)) call parse_materialConfig(config_name_texture,config_texture,line,fileContent(i+1:))
if (verbose) write(6,'(a)') ' Texture parsed'; flush(6) if (verbose) write(6,'(a)') ' Texture parsed'; flush(6)
end select end select
enddo enddo
material_Nhomogenization = size(config_homogenization) if (size(config_homogenization) < 1) call IO_error(160,ext_msg='<homogenization>')
material_Nphase = size(config_phase)
if (material_Nhomogenization < 1) call IO_error(160,ext_msg='<homogenization>')
if (size(config_microstructure) < 1) call IO_error(160,ext_msg='<microstructure>') if (size(config_microstructure) < 1) call IO_error(160,ext_msg='<microstructure>')
if (size(config_crystallite) < 1) call IO_error(160,ext_msg='<crystallite>') if (size(config_crystallite) < 1) call IO_error(160,ext_msg='<crystallite>')
if (material_Nphase < 1) call IO_error(160,ext_msg='<phase>') if (size(config_phase) < 1) call IO_error(160,ext_msg='<phase>')
if (size(config_texture) < 1) call IO_error(160,ext_msg='<texture>') if (size(config_texture) < 1) call IO_error(160,ext_msg='<texture>')

View File

@ -55,9 +55,6 @@ module constitutive
constitutive_postResults, & constitutive_postResults, &
constitutive_results constitutive_results
private :: &
constitutive_hooke_SandItsTangents
contains contains
@ -114,7 +111,7 @@ subroutine constitutive_init
! write description file for constitutive output ! write description file for constitutive output
call IO_write_jobFile(FILEUNIT,'outputConstitutive') call IO_write_jobFile(FILEUNIT,'outputConstitutive')
PhaseLoop: do ph = 1,material_Nphase PhaseLoop: do ph = 1,material_Nphase
activePhase: if (any(material_phase == ph)) then activePhase: if (any(material_phaseAt == ph)) then
ins = phase_plasticityInstance(ph) ins = phase_plasticityInstance(ph)
knownPlasticity = .true. ! assume valid knownPlasticity = .true. ! assume valid
plasticityType: select case(phase_plasticity(ph)) plasticityType: select case(phase_plasticity(ph))
@ -149,7 +146,7 @@ subroutine constitutive_init
case default plasticityType case default plasticityType
knownPlasticity = .false. knownPlasticity = .false.
end select plasticityType end select plasticityType
write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(ph))//']' write(FILEUNIT,'(/,a,/)') '['//trim(config_name_phase(ph))//']'
if (knownPlasticity) then if (knownPlasticity) then
write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName)
if (phase_plasticity(ph) /= PLASTICITY_NONE_ID) then if (phase_plasticity(ph) /= PLASTICITY_NONE_ID) then
@ -251,15 +248,16 @@ function constitutive_homogenizedC(ipc,ip,el)
ip, & !< integration point ip, & !< integration point
el !< element el !< element
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_DISLOTWIN_ID) plasticityType case (PLASTICITY_DISLOTWIN_ID) plasticityType
constitutive_homogenizedC = plastic_dislotwin_homogenizedC(ipc,ip,el) constitutive_homogenizedC = plastic_dislotwin_homogenizedC(ipc,ip,el)
case default plasticityType case default plasticityType
constitutive_homogenizedC = lattice_C66(1:6,1:6,material_phase (ipc,ip,el)) constitutive_homogenizedC = lattice_C66(1:6,1:6,material_phaseAt(ipc,el))
end select plasticityType end select plasticityType
end function constitutive_homogenizedC end function constitutive_homogenizedC
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calls microstructure function of the different constitutive models !> @brief calls microstructure function of the different constitutive models
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -280,14 +278,14 @@ subroutine constitutive_microstructure(Fe, Fp, ipc, ip, el)
ho = material_homogenizationAt(el) ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el) tme = thermalMapping(ho)%p(ip,el)
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_DISLOTWIN_ID) plasticityType case (PLASTICITY_DISLOTWIN_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of) call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType case (PLASTICITY_DISLOUCLA_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_disloUCLA_dependentState(instance,of) call plastic_disloUCLA_dependentState(instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_dependentState (Fe,Fp,ip,el) call plastic_nonlocal_dependentState (Fe,Fp,ip,el)
@ -331,25 +329,25 @@ subroutine constitutive_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
Mp = matmul(matmul(transpose(Fi),Fi),S) Mp = matmul(matmul(transpose(Fi),Fi),S)
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_NONE_ID) plasticityType case (PLASTICITY_NONE_ID) plasticityType
Lp = 0.0_pReal Lp = 0.0_pReal
dLp_dMp = 0.0_pReal dLp_dMp = 0.0_pReal
case (PLASTICITY_ISOTROPIC_ID) plasticityType case (PLASTICITY_ISOTROPIC_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_isotropic_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of) call plastic_isotropic_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_phenopowerlaw_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of) call plastic_phenopowerlaw_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_KINEHARDENING_ID) plasticityType case (PLASTICITY_KINEHARDENING_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_kinehardening_LpAndItsTangent (Lp,dLp_dMp, Mp,instance,of) call plastic_kinehardening_LpAndItsTangent (Lp,dLp_dMp, Mp,instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
@ -357,13 +355,13 @@ subroutine constitutive_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
temperature(ho)%p(tme),geometry_plastic_nonlocal_IPvolume0(ip,el),ip,el) temperature(ho)%p(tme),geometry_plastic_nonlocal_IPvolume0(ip,el),ip,el)
case (PLASTICITY_DISLOTWIN_ID) plasticityType case (PLASTICITY_DISLOTWIN_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_dislotwin_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of) call plastic_dislotwin_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType case (PLASTICITY_DISLOUCLA_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_disloucla_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of) call plastic_disloucla_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
end select plasticityType end select plasticityType
@ -414,10 +412,10 @@ subroutine constitutive_LiAndItsTangents(Li, dLi_dS, dLi_dFi, &
dLi_dS = 0.0_pReal dLi_dS = 0.0_pReal
dLi_dFi = 0.0_pReal dLi_dFi = 0.0_pReal
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_isotropic_ID) plasticityType case (PLASTICITY_isotropic_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_isotropic_LiAndItsTangent(my_Li, my_dLi_dS, S ,instance,of) call plastic_isotropic_LiAndItsTangent(my_Li, my_dLi_dS, S ,instance,of)
case default plasticityType case default plasticityType
my_Li = 0.0_pReal my_Li = 0.0_pReal
@ -427,8 +425,8 @@ subroutine constitutive_LiAndItsTangents(Li, dLi_dS, dLi_dFi, &
Li = Li + my_Li Li = Li + my_Li
dLi_dS = dLi_dS + my_dLi_dS dLi_dS = dLi_dS + my_dLi_dS
KinematicsLoop: do k = 1, phase_Nkinematics(material_phase(ipc,ip,el)) KinematicsLoop: do k = 1, phase_Nkinematics(material_phaseAt(ipc,el))
kinematicsType: select case (phase_kinematics(k,material_phase(ipc,ip,el))) kinematicsType: select case (phase_kinematics(k,material_phaseAt(ipc,el)))
case (KINEMATICS_cleavage_opening_ID) kinematicsType case (KINEMATICS_cleavage_opening_ID) kinematicsType
call kinematics_cleavage_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, ipc, ip, el) call kinematics_cleavage_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, ipc, ip, el)
case (KINEMATICS_slipplane_opening_ID) kinematicsType case (KINEMATICS_slipplane_opening_ID) kinematicsType
@ -452,7 +450,7 @@ subroutine constitutive_LiAndItsTangents(Li, dLi_dS, dLi_dFi, &
dLi_dS(1:3,1:3,i,j) = matmul(matmul(Fi,dLi_dS(1:3,1:3,i,j)),FiInv)*detFi dLi_dS(1:3,1:3,i,j) = matmul(matmul(Fi,dLi_dS(1:3,1:3,i,j)),FiInv)*detFi
dLi_dFi(1:3,1:3,i,j) = dLi_dFi(1:3,1:3,i,j) + Li*FiInv(j,i) dLi_dFi(1:3,1:3,i,j) = dLi_dFi(1:3,1:3,i,j) + Li*FiInv(j,i)
dLi_dFi(1:3,i,1:3,j) = dLi_dFi(1:3,i,1:3,j) + math_I3*temp_33(j,i) + Li*FiInv(j,i) dLi_dFi(1:3,i,1:3,j) = dLi_dFi(1:3,i,1:3,j) + math_I3*temp_33(j,i) + Li*FiInv(j,i)
end do; end do enddo; enddo
end subroutine constitutive_LiAndItsTangents end subroutine constitutive_LiAndItsTangents
@ -475,7 +473,7 @@ pure function constitutive_initialFi(ipc, ip, el)
homog, offset homog, offset
constitutive_initialFi = math_I3 constitutive_initialFi = math_I3
phase = material_phase(ipc,ip,el) phase = material_phaseAt(ipc,el)
KinematicsLoop: do k = 1, phase_Nkinematics(phase) !< Warning: small initial strain assumption KinematicsLoop: do k = 1, phase_Nkinematics(phase) !< Warning: small initial strain assumption
kinematicsType: select case (phase_kinematics(k,phase)) kinematicsType: select case (phase_kinematics(k,phase))
@ -546,8 +544,8 @@ subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
ho = material_homogenizationAt(el) ho = material_homogenizationAt(el)
C = math_66toSym3333(constitutive_homogenizedC(ipc,ip,el)) C = math_66toSym3333(constitutive_homogenizedC(ipc,ip,el))
DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phase(ipc,ip,el)) DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(ipc,el))
degradationType: select case(phase_stiffnessDegradation(d,material_phase(ipc,ip,el))) degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(ipc,el)))
case (STIFFNESS_DEGRADATION_damage_ID) degradationType case (STIFFNESS_DEGRADATION_damage_ID) degradationType
C = C * damage(ho)%p(damageMapping(ho)%p(ip,el))**2 C = C * damage(ho)%p(damageMapping(ho)%p(ip,el))**2
end select degradationType end select degradationType
@ -556,10 +554,8 @@ subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration
S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration
dS_dFe = 0.0_pReal
forall (i=1:3, j=1:3) forall (i=1:3, j=1:3)
dS_dFe(i,j,1:3,1:3) = & dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn
end forall end forall
@ -597,31 +593,31 @@ subroutine constitutive_collectDotState(S, FeArray, Fi, FpArray, subdt, ipc, ip,
Mp = matmul(matmul(transpose(Fi),Fi),S) Mp = matmul(matmul(transpose(Fi),Fi),S)
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_ISOTROPIC_ID) plasticityType case (PLASTICITY_ISOTROPIC_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_isotropic_dotState (Mp,instance,of) call plastic_isotropic_dotState (Mp,instance,of)
case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_phenopowerlaw_dotState(Mp,instance,of) call plastic_phenopowerlaw_dotState(Mp,instance,of)
case (PLASTICITY_KINEHARDENING_ID) plasticityType case (PLASTICITY_KINEHARDENING_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_kinehardening_dotState(Mp,instance,of) call plastic_kinehardening_dotState(Mp,instance,of)
case (PLASTICITY_DISLOTWIN_ID) plasticityType case (PLASTICITY_DISLOTWIN_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_dislotwin_dotState (Mp,temperature(ho)%p(tme),instance,of) call plastic_dislotwin_dotState (Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType case (PLASTICITY_DISLOUCLA_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_disloucla_dotState (Mp,temperature(ho)%p(tme),instance,of) call plastic_disloucla_dotState (Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
@ -629,9 +625,9 @@ subroutine constitutive_collectDotState(S, FeArray, Fi, FpArray, subdt, ipc, ip,
subdt,ip,el) subdt,ip,el)
end select plasticityType end select plasticityType
SourceLoop: do i = 1, phase_Nsources(material_phase(ipc,ip,el)) SourceLoop: do i = 1, phase_Nsources(material_phaseAt(ipc,el))
sourceType: select case (phase_source(i,material_phase(ipc,ip,el))) sourceType: select case (phase_source(i,material_phaseAt(ipc,el)))
case (SOURCE_damage_anisoBrittle_ID) sourceType case (SOURCE_damage_anisoBrittle_ID) sourceType
call source_damage_anisoBrittle_dotState (S, ipc, ip, el) !< correct stress? call source_damage_anisoBrittle_dotState (S, ipc, ip, el) !< correct stress?
@ -643,8 +639,8 @@ subroutine constitutive_collectDotState(S, FeArray, Fi, FpArray, subdt, ipc, ip,
call source_damage_anisoDuctile_dotState ( ipc, ip, el) call source_damage_anisoDuctile_dotState ( ipc, ip, el)
case (SOURCE_thermal_externalheat_ID) sourceType case (SOURCE_thermal_externalheat_ID) sourceType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
call source_thermal_externalheat_dotState(material_phase(ipc,ip,el),of) call source_thermal_externalheat_dotState(material_phaseAt(ipc,el),of)
end select sourceType end select sourceType
@ -652,6 +648,7 @@ subroutine constitutive_collectDotState(S, FeArray, Fi, FpArray, subdt, ipc, ip,
end subroutine constitutive_collectDotState end subroutine constitutive_collectDotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief for constitutive models having an instantaneous change of state !> @brief for constitutive models having an instantaneous change of state
!> will return false if delta state is not needed/supported by the constitutive model !> will return false if delta state is not needed/supported by the constitutive model
@ -674,11 +671,11 @@ subroutine constitutive_collectDeltaState(S, Fe, Fi, ipc, ip, el)
Mp = matmul(matmul(transpose(Fi),Fi),S) Mp = matmul(matmul(transpose(Fi),Fi),S)
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_KINEHARDENING_ID) plasticityType case (PLASTICITY_KINEHARDENING_ID) plasticityType
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
call plastic_kinehardening_deltaState(Mp,instance,of) call plastic_kinehardening_deltaState(Mp,instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
@ -686,9 +683,9 @@ subroutine constitutive_collectDeltaState(S, Fe, Fi, ipc, ip, el)
end select plasticityType end select plasticityType
sourceLoop: do i = 1, phase_Nsources(material_phase(ipc,ip,el)) sourceLoop: do i = 1, phase_Nsources(material_phaseAt(ipc,el))
sourceType: select case (phase_source(i,material_phase(ipc,ip,el))) sourceType: select case (phase_source(i,material_phaseAt(ipc,el)))
case (SOURCE_damage_isoBrittle_ID) sourceType case (SOURCE_damage_isoBrittle_ID) sourceType
call source_damage_isoBrittle_deltaState (constitutive_homogenizedC(ipc,ip,el), Fe, & call source_damage_isoBrittle_deltaState (constitutive_homogenizedC(ipc,ip,el), Fe, &
@ -710,8 +707,8 @@ function constitutive_postResults(S, Fi, ipc, ip, el)
ipc, & !< component-ID of integration point ipc, & !< component-ID of integration point
ip, & !< integration point ip, & !< integration point
el !< element el !< element
real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%sizePostResults + & real(pReal), dimension(plasticState(material_phaseAt(ipc,el))%sizePostResults + &
sum(sourceState(material_phase(ipc,ip,el))%p(:)%sizePostResults)) :: & sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
constitutive_postResults constitutive_postResults
real(pReal), intent(in), dimension(3,3) :: & real(pReal), intent(in), dimension(3,3) :: &
Fi !< intermediate deformation gradient Fi !< intermediate deformation gradient
@ -734,12 +731,12 @@ function constitutive_postResults(S, Fi, ipc, ip, el)
tme = thermalMapping(ho)%p(ip,el) tme = thermalMapping(ho)%p(ip,el)
startPos = 1 startPos = 1
endPos = plasticState(material_phase(ipc,ip,el))%sizePostResults endPos = plasticState(material_phaseAt(ipc,el))%sizePostResults
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phase(ipc,ip,el))) plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_ISOTROPIC_ID) plasticityType case (PLASTICITY_ISOTROPIC_ID) plasticityType
constitutive_postResults(startPos:endPos) = & constitutive_postResults(startPos:endPos) = &
plastic_isotropic_postResults(Mp,instance,of) plastic_isotropic_postResults(Mp,instance,of)
@ -762,23 +759,23 @@ function constitutive_postResults(S, Fi, ipc, ip, el)
case (PLASTICITY_NONLOCAL_ID) plasticityType case (PLASTICITY_NONLOCAL_ID) plasticityType
constitutive_postResults(startPos:endPos) = & constitutive_postResults(startPos:endPos) = &
plastic_nonlocal_postResults (material_phase(ipc,ip,el),instance,of) plastic_nonlocal_postResults (material_phaseAt(ipc,el),instance,of)
end select plasticityType end select plasticityType
SourceLoop: do i = 1, phase_Nsources(material_phase(ipc,ip,el)) SourceLoop: do i = 1, phase_Nsources(material_phaseAt(ipc,el))
startPos = endPos + 1 startPos = endPos + 1
endPos = endPos + sourceState(material_phase(ipc,ip,el))%p(i)%sizePostResults endPos = endPos + sourceState(material_phaseAt(ipc,el))%p(i)%sizePostResults
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
sourceType: select case (phase_source(i,material_phase(ipc,ip,el))) sourceType: select case (phase_source(i,material_phaseAt(ipc,el)))
case (SOURCE_damage_isoBrittle_ID) sourceType case (SOURCE_damage_isoBrittle_ID) sourceType
constitutive_postResults(startPos:endPos) = source_damage_isoBrittle_postResults(material_phase(ipc,ip,el),of) constitutive_postResults(startPos:endPos) = source_damage_isoBrittle_postResults(material_phaseAt(ipc,el),of)
case (SOURCE_damage_isoDuctile_ID) sourceType case (SOURCE_damage_isoDuctile_ID) sourceType
constitutive_postResults(startPos:endPos) = source_damage_isoDuctile_postResults(material_phase(ipc,ip,el),of) constitutive_postResults(startPos:endPos) = source_damage_isoDuctile_postResults(material_phaseAt(ipc,el),of)
case (SOURCE_damage_anisoBrittle_ID) sourceType case (SOURCE_damage_anisoBrittle_ID) sourceType
constitutive_postResults(startPos:endPos) = source_damage_anisoBrittle_postResults(material_phase(ipc,ip,el),of) constitutive_postResults(startPos:endPos) = source_damage_anisoBrittle_postResults(material_phaseAt(ipc,el),of)
case (SOURCE_damage_anisoDuctile_ID) sourceType case (SOURCE_damage_anisoDuctile_ID) sourceType
constitutive_postResults(startPos:endPos) = source_damage_anisoDuctile_postResults(material_phase(ipc,ip,el),of) constitutive_postResults(startPos:endPos) = source_damage_anisoDuctile_postResults(material_phaseAt(ipc,el),of)
end select sourceType end select sourceType
enddo SourceLoop enddo SourceLoop
@ -790,12 +787,11 @@ end function constitutive_postResults
!> @brief writes constitutive results to HDF5 output file !> @brief writes constitutive results to HDF5 output file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine constitutive_results subroutine constitutive_results
#if defined(PETSc) || defined(DAMASK_HDF5)
integer :: p integer :: p
character(len=256) :: group character(len=256) :: group
#if defined(PETSc) || defined(DAMASK_HDF5) do p=1,size(config_name_phase)
do p=1,size(phase_name) group = trim('current/constituent')//'/'//trim(config_name_phase(p))
group = trim('current/constituent')//'/'//trim(phase_name(p))
call HDF5_closeGroup(results_addGroup(group)) call HDF5_closeGroup(results_addGroup(group))
group = trim(group)//'/plastic' group = trim(group)//'/plastic'
@ -824,9 +820,6 @@ subroutine constitutive_results
enddo enddo
#endif #endif
end subroutine constitutive_results end subroutine constitutive_results
end module constitutive end module constitutive

View File

@ -364,7 +364,7 @@ subroutine crystallite_init
do r = 1,size(config_crystallite) do r = 1,size(config_crystallite)
if (any(microstructure_crystallite(discretization_microstructureAt) == r)) then if (any(microstructure_crystallite(discretization_microstructureAt) == r)) then
write(FILEUNIT,'(/,a,/)') '['//trim(crystallite_name(r))//']' write(FILEUNIT,'(/,a,/)') '['//trim(config_name_crystallite(r))//']'
do o = 1,crystallite_Noutput(r) do o = 1,crystallite_Noutput(r)
write(FILEUNIT,'(a,i4)') trim(crystallite_output(o,r))//char(9),crystallite_sizePostResult(o,r) write(FILEUNIT,'(a,i4)') trim(crystallite_output(o,r))//char(9),crystallite_sizePostResult(o,r)
enddo enddo
@ -386,7 +386,7 @@ subroutine crystallite_init
crystallite_Fp0(1:3,1:3,c,i,e) = math_EulerToR(material_EulerAngles(1:3,c,i,e)) ! plastic def gradient reflects init orientation crystallite_Fp0(1:3,1:3,c,i,e) = math_EulerToR(material_EulerAngles(1:3,c,i,e)) ! plastic def gradient reflects init orientation
crystallite_Fi0(1:3,1:3,c,i,e) = constitutive_initialFi(c,i,e) crystallite_Fi0(1:3,1:3,c,i,e) = constitutive_initialFi(c,i,e)
crystallite_F0(1:3,1:3,c,i,e) = math_I3 crystallite_F0(1:3,1:3,c,i,e) = math_I3
crystallite_localPlasticity(c,i,e) = phase_localPlasticity(material_phase(c,i,e)) crystallite_localPlasticity(c,i,e) = phase_localPlasticity(material_phaseAt(c,e))
crystallite_Fe(1:3,1:3,c,i,e) = math_inv33(matmul(crystallite_Fi0(1:3,1:3,c,i,e), & crystallite_Fe(1:3,1:3,c,i,e) = math_inv33(matmul(crystallite_Fi0(1:3,1:3,c,i,e), &
crystallite_Fp0(1:3,1:3,c,i,e))) ! assuming that euler angles are given in internal strain free configuration crystallite_Fp0(1:3,1:3,c,i,e))) ! assuming that euler angles are given in internal strain free configuration
crystallite_Fp(1:3,1:3,c,i,e) = crystallite_Fp0(1:3,1:3,c,i,e) crystallite_Fp(1:3,1:3,c,i,e) = crystallite_Fp0(1:3,1:3,c,i,e)
@ -483,12 +483,12 @@ function crystallite_stress(dummyArgumentToPreventInternalCompilerErrorWithGCC)
elementLooping1: do e = FEsolving_execElem(1),FEsolving_execElem(2) elementLooping1: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,homogenization_Ngrains(material_homogenizationAt(e)) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
homogenizationRequestsCalculation: if (crystallite_requested(c,i,e)) then homogenizationRequestsCalculation: if (crystallite_requested(c,i,e)) then
plasticState (phaseAt(c,i,e))%subState0( :,phasememberAt(c,i,e)) = & plasticState (material_phaseAt(c,e))%subState0( :,material_phaseMemberAt(c,i,e)) = &
plasticState (phaseAt(c,i,e))%partionedState0(:,phasememberAt(c,i,e)) plasticState (material_phaseAt(c,e))%partionedState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(phaseAt(c,i,e)) do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState(phaseAt(c,i,e))%p(s)%subState0( :,phasememberAt(c,i,e)) = & sourceState(material_phaseAt(c,e))%p(s)%subState0( :,material_phaseMemberAt(c,i,e)) = &
sourceState(phaseAt(c,i,e))%p(s)%partionedState0(:,phasememberAt(c,i,e)) sourceState(material_phaseAt(c,e))%p(s)%partionedState0(:,material_phaseMemberAt(c,i,e))
enddo enddo
crystallite_subFp0(1:3,1:3,c,i,e) = crystallite_partionedFp0(1:3,1:3,c,i,e) crystallite_subFp0(1:3,1:3,c,i,e) = crystallite_partionedFp0(1:3,1:3,c,i,e)
crystallite_subLp0(1:3,1:3,c,i,e) = crystallite_partionedLp0(1:3,1:3,c,i,e) crystallite_subLp0(1:3,1:3,c,i,e) = crystallite_partionedLp0(1:3,1:3,c,i,e)
@ -543,11 +543,11 @@ function crystallite_stress(dummyArgumentToPreventInternalCompilerErrorWithGCC)
crystallite_subFi0(1:3,1:3,c,i,e) = crystallite_Fi (1:3,1:3,c,i,e) crystallite_subFi0(1:3,1:3,c,i,e) = crystallite_Fi (1:3,1:3,c,i,e)
crystallite_subS0 (1:3,1:3,c,i,e) = crystallite_S (1:3,1:3,c,i,e) crystallite_subS0 (1:3,1:3,c,i,e) = crystallite_S (1:3,1:3,c,i,e)
!if abbrevation, make c and p private in omp !if abbrevation, make c and p private in omp
plasticState( phaseAt(c,i,e))%subState0(:,phasememberAt(c,i,e)) & plasticState( material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e)) &
= plasticState(phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) = plasticState(material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(phaseAt(c,i,e)) do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( phaseAt(c,i,e))%p(s)%subState0(:,phasememberAt(c,i,e)) & sourceState( material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e)) &
= sourceState(phaseAt(c,i,e))%p(s)%state( :,phasememberAt(c,i,e)) = sourceState(material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e))
enddo enddo
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_crystallite),debug_levelBasic) /= 0 & if (iand(debug_level(debug_crystallite),debug_levelBasic) /= 0 &
@ -572,11 +572,11 @@ function crystallite_stress(dummyArgumentToPreventInternalCompilerErrorWithGCC)
crystallite_Lp (1:3,1:3,c,i,e) = crystallite_subLp0(1:3,1:3,c,i,e) crystallite_Lp (1:3,1:3,c,i,e) = crystallite_subLp0(1:3,1:3,c,i,e)
crystallite_Li (1:3,1:3,c,i,e) = crystallite_subLi0(1:3,1:3,c,i,e) crystallite_Li (1:3,1:3,c,i,e) = crystallite_subLi0(1:3,1:3,c,i,e)
endif endif
plasticState (phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) & plasticState (material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e)) &
= plasticState(phaseAt(c,i,e))%subState0(:,phasememberAt(c,i,e)) = plasticState(material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(phaseAt(c,i,e)) do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( phaseAt(c,i,e))%p(s)%state( :,phasememberAt(c,i,e)) & sourceState( material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e)) &
= sourceState(phaseAt(c,i,e))%p(s)%subState0(:,phasememberAt(c,i,e)) = sourceState(material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e))
enddo enddo
! cant restore dotState here, since not yet calculated in first cutback after initialization ! cant restore dotState here, since not yet calculated in first cutback after initialization
@ -839,7 +839,7 @@ subroutine crystallite_orientations
!$OMP PARALLEL DO !$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
if (plasticState(material_phase(1,i,e))%nonLocal) & ! if nonlocal model if (plasticState(material_phaseAt(1,e))%nonLocal) & ! if nonlocal model
call plastic_nonlocal_updateCompatibility(crystallite_orientation,i,e) call plastic_nonlocal_updateCompatibility(crystallite_orientation,i,e)
enddo; enddo enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -879,8 +879,8 @@ function crystallite_postResults(ipc, ip, el)
ipc !< grain index ipc !< grain index
real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(discretization_microstructureAt(el))) + & real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(discretization_microstructureAt(el))) + &
1+plasticState(material_phase(ipc,ip,el))%sizePostResults + & 1+plasticState(material_phaseAt(ipc,el))%sizePostResults + &
sum(sourceState(material_phase(ipc,ip,el))%p(:)%sizePostResults)) :: & sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
crystallite_postResults crystallite_postResults
integer :: & integer :: &
o, & o, &
@ -901,7 +901,7 @@ function crystallite_postResults(ipc, ip, el)
select case(crystallite_outputID(o,crystID)) select case(crystallite_outputID(o,crystID))
case (phase_ID) case (phase_ID)
mySize = 1 mySize = 1
crystallite_postResults(c+1) = real(material_phase(ipc,ip,el),pReal) ! phaseID of grain crystallite_postResults(c+1) = real(material_phaseAt(ipc,el),pReal) ! phaseID of grain
case (texture_ID) case (texture_ID)
mySize = 1 mySize = 1
crystallite_postResults(c+1) = real(material_texture(ipc,ip,el),pReal) ! textureID of grain crystallite_postResults(c+1) = real(material_texture(ipc,ip,el),pReal) ! textureID of grain
@ -967,7 +967,7 @@ function crystallite_postResults(ipc, ip, el)
c = c + mySize c = c + mySize
enddo enddo
crystallite_postResults(c+1) = real(plasticState(material_phase(ipc,ip,el))%sizePostResults,pReal) ! size of constitutive results crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results
c = c + 1 c = c + 1
if (size(crystallite_postResults)-c > 0) & if (size(crystallite_postResults)-c > 0) &
crystallite_postResults(c+1:size(crystallite_postResults)) = & crystallite_postResults(c+1:size(crystallite_postResults)) = &
@ -982,9 +982,6 @@ end function crystallite_postResults
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine crystallite_results subroutine crystallite_results
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
use config, only: &
config_name_phase => phase_name ! anticipate logical name
integer :: p,o integer :: p,o
real(pReal), allocatable, dimension(:,:,:) :: selected_tensors real(pReal), allocatable, dimension(:,:,:) :: selected_tensors
type(rotation), allocatable, dimension(:) :: selected_rotations type(rotation), allocatable, dimension(:) :: selected_rotations
@ -1053,9 +1050,9 @@ subroutine crystallite_results
contains contains
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
!> @brief select tensors for output !> @brief select tensors for output
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
function select_tensors(dataset,instance) function select_tensors(dataset,instance)
integer, intent(in) :: instance integer, intent(in) :: instance
@ -1106,8 +1103,6 @@ subroutine crystallite_results
end function select_rotations end function select_rotations
#endif #endif
end subroutine crystallite_results end subroutine crystallite_results
@ -1195,10 +1190,8 @@ logical function integrateStress(ipc,ip,el,timeFraction)
Fg_new = crystallite_subF(1:3,1:3,ipc,ip,el) Fg_new = crystallite_subF(1:3,1:3,ipc,ip,el)
endif endif
Lpguess = crystallite_Lp(1:3,1:3,ipc,ip,el) ! take as first guess
!* feed local variables Liguess = crystallite_Li(1:3,1:3,ipc,ip,el) ! take as first guess
Lpguess = crystallite_Lp(1:3,1:3,ipc,ip,el) ! ... and take it as first guess
Liguess = crystallite_Li(1:3,1:3,ipc,ip,el) ! ... and take it as first guess
Liguess_old = Liguess Liguess_old = Liguess
invFp_current = math_inv33(crystallite_subFp0(1:3,1:3,ipc,ip,el)) invFp_current = math_inv33(crystallite_subFp0(1:3,1:3,ipc,ip,el))
@ -1555,7 +1548,7 @@ subroutine integrateStateFPI
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
plasticState(p)%previousDotState2(:,c) = merge(plasticState(p)%previousDotState(:,c),& plasticState(p)%previousDotState2(:,c) = merge(plasticState(p)%previousDotState(:,c),&
0.0_pReal,& 0.0_pReal,&
@ -1583,7 +1576,7 @@ subroutine integrateStateFPI
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
zeta = damper(plasticState(p)%dotState (:,c), & zeta = damper(plasticState(p)%dotState (:,c), &
@ -1746,7 +1739,7 @@ subroutine integrateStateAdaptiveEuler
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
residuum_plastic(1:sizeDotState,g,i,e) = plasticState(p)%dotstate(1:sizeDotState,c) & residuum_plastic(1:sizeDotState,g,i,e) = plasticState(p)%dotstate(1:sizeDotState,c) &
@ -1775,7 +1768,7 @@ subroutine integrateStateAdaptiveEuler
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
residuum_plastic(1:sizeDotState,g,i,e) = residuum_plastic(1:sizeDotState,g,i,e) & residuum_plastic(1:sizeDotState,g,i,e) = residuum_plastic(1:sizeDotState,g,i,e) &
@ -1835,7 +1828,7 @@ subroutine integrateStateRK4
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
plasticState(p)%RK4dotState(:,c) = WEIGHT(n)*plasticState(p)%dotState(:,c) & plasticState(p)%RK4dotState(:,c) = WEIGHT(n)*plasticState(p)%dotState(:,c) &
+ merge(plasticState(p)%RK4dotState(:,c),0.0_pReal,n>1) + merge(plasticState(p)%RK4dotState(:,c),0.0_pReal,n>1)
@ -1926,7 +1919,7 @@ subroutine integrateStateRKCK45
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); cc = phasememberAt(g,i,e) p = material_phaseAt(g,e); cc = material_phaseMemberAt(g,i,e)
plasticState(p)%RKCK45dotState(stage,:,cc) = plasticState(p)%dotState(:,cc) plasticState(p)%RKCK45dotState(stage,:,cc) = plasticState(p)%dotState(:,cc)
plasticState(p)%dotState(:,cc) = A(1,stage) * plasticState(p)%RKCK45dotState(1,:,cc) plasticState(p)%dotState(:,cc) = A(1,stage) * plasticState(p)%RKCK45dotState(1,:,cc)
@ -1966,7 +1959,7 @@ subroutine integrateStateRKCK45
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); cc = phasememberAt(g,i,e) p = material_phaseAt(g,e); cc = material_phaseMemberAt(g,i,e)
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
@ -2005,7 +1998,7 @@ subroutine integrateStateRKCK45
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e)) then if (crystallite_todo(g,i,e)) then
p = phaseAt(g,i,e); cc = phasememberAt(g,i,e) p = material_phaseAt(g,e); cc = material_phaseMemberAt(g,i,e)
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
@ -2163,7 +2156,7 @@ subroutine update_state(timeFraction)
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) then
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
mySize = plasticState(p)%sizeDotState mySize = plasticState(p)%sizeDotState
plasticState(p)%state(1:mySize,c) = plasticState(p)%subState0(1:mySize,c) & plasticState(p)%state(1:mySize,c) = plasticState(p)%subState0(1:mySize,c) &
@ -2214,7 +2207,7 @@ subroutine update_dotState(timeFraction)
crystallite_Fi(1:3,1:3,g,i,e), & crystallite_Fi(1:3,1:3,g,i,e), &
crystallite_Fp, & crystallite_Fp, &
crystallite_subdt(g,i,e)*timeFraction, g,i,e) crystallite_subdt(g,i,e)*timeFraction, g,i,e)
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
NaN = any(IEEE_is_NaN(plasticState(p)%dotState(:,c))) NaN = any(IEEE_is_NaN(plasticState(p)%dotState(:,c)))
do s = 1, phase_Nsources(p) do s = 1, phase_Nsources(p)
NaN = NaN .or. any(IEEE_is_NaN(sourceState(p)%p(s)%dotState(:,c))) NaN = NaN .or. any(IEEE_is_NaN(sourceState(p)%p(s)%dotState(:,c)))
@ -2259,7 +2252,7 @@ subroutine update_deltaState
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fi(1:3,1:3,g,i,e), & crystallite_Fi(1:3,1:3,g,i,e), &
g,i,e) g,i,e)
p = phaseAt(g,i,e); c = phasememberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
myOffset = plasticState(p)%offsetDeltaState myOffset = plasticState(p)%offsetDeltaState
mySize = plasticState(p)%sizeDeltaState mySize = plasticState(p)%sizeDeltaState
NaN = any(IEEE_is_NaN(plasticState(p)%deltaState(1:mySize,c))) NaN = any(IEEE_is_NaN(plasticState(p)%deltaState(1:mySize,c)))
@ -2311,8 +2304,8 @@ logical function stateJump(ipc,ip,el)
myOffset, & myOffset, &
mySize mySize
c = phasememberAt(ipc,ip,el) c = material_phaseMemberAt(ipc,ip,el)
p = phaseAt(ipc,ip,el) p = material_phaseAt(ipc,el)
call constitutive_collectDeltaState(crystallite_S(1:3,1:3,ipc,ip,el), & call constitutive_collectDeltaState(crystallite_S(1:3,1:3,ipc,ip,el), &
crystallite_Fe(1:3,1:3,ipc,ip,el), & crystallite_Fe(1:3,1:3,ipc,ip,el), &

View File

@ -178,8 +178,8 @@ subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el
phiDot = 0.0_pReal phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal dPhiDot_dPhi = 0.0_pReal
do grain = 1, homogenization_Ngrains(material_homogenizationAt(el)) do grain = 1, homogenization_Ngrains(material_homogenizationAt(el))
phase = phaseAt(grain,ip,el) phase = material_phaseAt(grain,el)
constituent = phasememberAt(grain,ip,el) constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase) do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase)) select case(phase_source(source,phase))
case (SOURCE_damage_isoBrittle_ID) case (SOURCE_damage_isoBrittle_ID)

View File

@ -144,8 +144,8 @@ subroutine damage_nonlocal_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip,
phiDot = 0.0_pReal phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal dPhiDot_dPhi = 0.0_pReal
do grain = 1, homogenization_Ngrains(material_homogenizationAt(el)) do grain = 1, homogenization_Ngrains(material_homogenizationAt(el))
phase = phaseAt(grain,ip,el) phase = material_phaseAt(grain,el)
constituent = phasememberAt(grain,ip,el) constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase) do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase)) select case(phase_source(source,phase))
case (SOURCE_damage_isoBrittle_ID) case (SOURCE_damage_isoBrittle_ID)
@ -194,7 +194,7 @@ function damage_nonlocal_getDiffusion33(ip,el)
damage_nonlocal_getDiffusion33 = 0.0_pReal damage_nonlocal_getDiffusion33 = 0.0_pReal
do grain = 1, homogenization_Ngrains(homog) do grain = 1, homogenization_Ngrains(homog)
damage_nonlocal_getDiffusion33 = damage_nonlocal_getDiffusion33 + & damage_nonlocal_getDiffusion33 = damage_nonlocal_getDiffusion33 + &
crystallite_push33ToRef(grain,ip,el,lattice_DamageDiffusion33(1:3,1:3,material_phase(grain,ip,el))) crystallite_push33ToRef(grain,ip,el,lattice_DamageDiffusion33(1:3,1:3,material_phaseAt(grain,el)))
enddo enddo
damage_nonlocal_getDiffusion33 = & damage_nonlocal_getDiffusion33 = &
@ -217,7 +217,7 @@ real(pReal) function damage_nonlocal_getMobility(ip,el)
damage_nonlocal_getMobility = 0.0_pReal damage_nonlocal_getMobility = 0.0_pReal
do ipc = 1, homogenization_Ngrains(material_homogenizationAt(el)) do ipc = 1, homogenization_Ngrains(material_homogenizationAt(el))
damage_nonlocal_getMobility = damage_nonlocal_getMobility + lattice_DamageMobility(material_phase(ipc,ip,el)) damage_nonlocal_getMobility = damage_nonlocal_getMobility + lattice_DamageMobility(material_phaseAt(ipc,el))
enddo enddo
damage_nonlocal_getMobility = damage_nonlocal_getMobility/& damage_nonlocal_getMobility = damage_nonlocal_getMobility/&

View File

@ -1,5 +1,6 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief spatial discretization !> @brief spatial discretization
!> @details serves as an abstraction layer between the different solvers and DAMASK
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module discretization module discretization
@ -30,7 +31,9 @@ module discretization
contains contains
!--------------------------------------------------------------------------------------------------
!> @brief stores the relevant information in globally accesible variables
!--------------------------------------------------------------------------------------------------
subroutine discretization_init(homogenizationAt,microstructureAt,IPcoords0,NodeCoords0) subroutine discretization_init(homogenizationAt,microstructureAt,IPcoords0,NodeCoords0)
integer, dimension(:), intent(in) :: & integer, dimension(:), intent(in) :: &
@ -57,6 +60,9 @@ subroutine discretization_init(homogenizationAt,microstructureAt,IPcoords0,NodeC
end subroutine discretization_init end subroutine discretization_init
!--------------------------------------------------------------------------------------------------
!> @brief write the displacements
!--------------------------------------------------------------------------------------------------
subroutine discretization_results subroutine discretization_results
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
real(pReal), dimension(:,:), allocatable :: u real(pReal), dimension(:,:), allocatable :: u
@ -70,6 +76,9 @@ subroutine discretization_results
end subroutine discretization_results end subroutine discretization_results
!--------------------------------------------------------------------------------------------------
!> @brief stores current IP coordinates
!--------------------------------------------------------------------------------------------------
subroutine discretization_setIPcoords(IPcoords) subroutine discretization_setIPcoords(IPcoords)
real(pReal), dimension(:,:), intent(in) :: IPcoords real(pReal), dimension(:,:), intent(in) :: IPcoords
@ -78,5 +87,4 @@ subroutine discretization_setIPcoords(IPcoords)
end subroutine discretization_setIPcoords end subroutine discretization_setIPcoords
end module discretization end module discretization

View File

@ -10,7 +10,7 @@ module element
private private
!--------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
!> Properties of a single element (the element used in the mesh) !> Properties of a single element
!--------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
type, public :: tElement type, public :: tElement
integer :: & integer :: &
@ -21,11 +21,9 @@ module element
Ncellnodes, & Ncellnodes, &
NcellnodesPerCell, & NcellnodesPerCell, &
nIPs, & nIPs, &
nIPneighbors, & ! ToDo: MD: Do all IPs in one element type have the same number of neighbors? nIPneighbors
maxNnodeAtIP
integer, dimension(:,:), allocatable :: & integer, dimension(:,:), allocatable :: &
Cell, & !< intra-element (cell) nodes that constitute a cell Cell, & !< intra-element (cell) nodes that constitute a cell
NnodeAtIP, &
IPneighbor, & IPneighbor, &
cellFace cellFace
integer, dimension(:,:), allocatable :: & integer, dimension(:,:), allocatable :: &
@ -139,21 +137,6 @@ module element
4 & ! 3D 8node 4 & ! 3D 8node
] !< number of cell nodes in a specific cell type ] !< number of cell nodes in a specific cell type
!integer, dimension(maxval(geomType)), parameter, private :: maxNodeAtIP = & ! Intel 16.0 complains
integer, dimension(10), parameter, private :: maxNnodeAtIP = &
[ &
3, &
1, &
1, &
2, &
4, &
1, &
1, &
8, &
1, &
4 &
] !< maximum number of parent nodes that belong to an IP for a specific type of element
!integer, dimension(maxval(CELLTYPE)), parameter, private :: NCELLNODEPERCELL = & ! Intel 16.0 complains !integer, dimension(maxval(CELLTYPE)), parameter, private :: NCELLNODEPERCELL = & ! Intel 16.0 complains
integer, dimension(4), parameter, private :: NCELLNODEPERCELL = & integer, dimension(4), parameter, private :: NCELLNODEPERCELL = &
[ & [ &
@ -163,114 +146,6 @@ module element
8 & ! 3D 8node 8 & ! 3D 8node
] !< number of cell nodes in a specific cell type ] !< number of cell nodes in a specific cell type
! --------------------------------------------------------------------------------------------------
! MD: probably not needed START
integer, dimension(maxNnodeAtIP(1),nIP(1)), parameter, private :: NnodeAtIP1 = &
reshape([&
1,2,3 &
],[maxNnodeAtIP(1),nIP(1)])
integer, dimension(maxNnodeAtIP(2),nIP(2)), parameter, private :: NnodeAtIP2 = &
reshape([&
1, &
2, &
3 &
],[maxNnodeAtIP(2),nIP(2)])
integer, dimension(maxNnodeAtIP(3),nIP(3)), parameter, private :: NnodeAtIP3 = &
reshape([&
1, &
2, &
4, &
3 &
],[maxNnodeAtIP(3),nIP(3)])
integer, dimension(maxNnodeAtIP(4),nIP(4)), parameter, private :: NnodeAtIP4 = &
reshape([&
1,0, &
1,2, &
2,0, &
1,4, &
0,0, &
2,3, &
4,0, &
3,4, &
3,0 &
],[maxNnodeAtIP(4),nIP(4)])
integer, dimension(maxNnodeAtIP(5),nIP(5)), parameter, private :: NnodeAtIP5 = &
reshape([&
1,2,3,4 &
],[maxNnodeAtIP(5),nIP(5)])
integer, dimension(maxNnodeAtIP(6),nIP(6)), parameter, private :: NnodeAtIP6 = &
reshape([&
1, &
2, &
3, &
4 &
],[maxNnodeAtIP(6),nIP(6)])
integer, dimension(maxNnodeAtIP(7),nIP(7)), parameter, private :: NnodeAtIP7 = &
reshape([&
1, &
2, &
3, &
4, &
5, &
6 &
],[maxNnodeAtIP(7),nIP(7)])
integer, dimension(maxNnodeAtIP(8),nIP(8)), parameter, private :: NnodeAtIP8 = &
reshape([&
1,2,3,4,5,6,7,8 &
],[maxNnodeAtIP(8),nIP(8)])
integer, dimension(maxNnodeAtIP(9),nIP(9)), parameter, private :: NnodeAtIP9 = &
reshape([&
1, &
2, &
4, &
3, &
5, &
6, &
8, &
7 &
],[maxNnodeAtIP(9),nIP(9)])
integer, dimension(maxNnodeAtIP(10),nIP(10)), parameter, private :: NnodeAtIP10 = &
reshape([&
1,0, 0,0, &
1,2, 0,0, &
2,0, 0,0, &
1,4, 0,0, &
1,3, 2,4, &
2,3, 0,0, &
4,0, 0,0, &
3,4, 0,0, &
3,0, 0,0, &
1,5, 0,0, &
1,6, 2,5, &
2,6, 0,0, &
1,8, 4,5, &
0,0, 0,0, &
2,7, 3,6, &
4,8, 0,0, &
3,8, 4,7, &
3,7, 0,0, &
5,0, 0,0, &
5,6, 0,0, &
6,0, 0,0, &
5,8, 0,0, &
5,7, 6,8, &
6,7, 0,0, &
8,0, 0,0, &
7,8, 0,0, &
7,0, 0,0 &
],[maxNnodeAtIP(10),nIP(10)])
! *** FE_ipNeighbor *** ! *** FE_ipNeighbor ***
! is a list of the neighborhood of each IP. ! is a list of the neighborhood of each IP.
! It is sorted in (local) +x,-x, +y,-y, +z,-z direction. ! It is sorted in (local) +x,-x, +y,-y, +z,-z direction.
@ -386,15 +261,15 @@ module element
real(pReal), dimension(nNode(1),NcellNode(geomType(1))), parameter :: cellNodeParentNodeWeights1 = & integer, dimension(nNode(1),NcellNode(geomType(1))), parameter :: cellNodeParentNodeWeights1 = &
reshape(real([& reshape([&
1, 0, 0, & 1, 0, 0, &
0, 1, 0, & 0, 1, 0, &
0, 0, 1 & 0, 0, 1 &
],pReal),[nNode(1),NcellNode(geomType(1))]) ! 2D 3node 1ip ],[nNode(1),NcellNode(geomType(1))]) !< 2D 3node 1ip
real(pReal), dimension(nNode(2),NcellNode(geomType(2))), parameter :: cellNodeParentNodeWeights2 = & integer, dimension(nNode(2),NcellNode(geomType(2))), parameter :: cellNodeParentNodeWeights2 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, & 0, 0, 1, 0, 0, 0, &
@ -402,10 +277,10 @@ module element
0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 1, 0, &
0, 0, 0, 0, 0, 1, & 0, 0, 0, 0, 0, 1, &
1, 1, 1, 2, 2, 2 & 1, 1, 1, 2, 2, 2 &
],pReal),[nNode(2),NcellNode(geomType(2))]) ! 2D 6node 3ip ],[nNode(2),NcellNode(geomType(2))]) !< 2D 6node 3ip
real(pReal), dimension(nNode(3),NcellNode(geomType(3))), parameter :: cellNodeParentNodeWeights3 = & integer, dimension(nNode(3),NcellNode(geomType(3))), parameter :: cellNodeParentNodeWeights3 = &
reshape(real([& reshape([&
1, 0, 0, 0, & 1, 0, 0, 0, &
0, 1, 0, 0, & 0, 1, 0, 0, &
0, 0, 1, 0, & 0, 0, 1, 0, &
@ -415,10 +290,10 @@ module element
0, 0, 1, 1, & 0, 0, 1, 1, &
1, 0, 0, 1, & 1, 0, 0, 1, &
1, 1, 1, 1 & 1, 1, 1, 1 &
],pReal),[nNode(3),NcellNode(geomType(3))]) ! 2D 6node 3ip ],[nNode(3),NcellNode(geomType(3))]) !< 2D 6node 3ip
real(pReal), dimension(nNode(4),NcellNode(geomType(4))), parameter :: cellNodeParentNodeWeights4 = & integer, dimension(nNode(4),NcellNode(geomType(4))), parameter :: cellNodeParentNodeWeights4 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, 0, 0, & 0, 0, 1, 0, 0, 0, 0, 0, &
@ -435,10 +310,10 @@ module element
1, 4, 1, 1, 8, 8, 2, 2, & 1, 4, 1, 1, 8, 8, 2, 2, &
1, 1, 4, 1, 2, 8, 8, 2, & 1, 1, 4, 1, 2, 8, 8, 2, &
1, 1, 1, 4, 2, 2, 8, 8 & 1, 1, 1, 4, 2, 2, 8, 8 &
],pReal),[nNode(4),NcellNode(geomType(4))]) ! 2D 8node 9ip ],[nNode(4),NcellNode(geomType(4))]) !< 2D 8node 9ip
real(pReal), dimension(nNode(5),NcellNode(geomType(5))), parameter :: cellNodeParentNodeWeights5 = & integer, dimension(nNode(5),NcellNode(geomType(5))), parameter :: cellNodeParentNodeWeights5 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, 0, 0, & 0, 0, 1, 0, 0, 0, 0, 0, &
@ -448,18 +323,18 @@ module element
0, 0, 0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 0, 0, 1, 0, &
0, 0, 0, 0, 0, 0, 0, 1, & 0, 0, 0, 0, 0, 0, 0, 1, &
1, 1, 1, 1, 2, 2, 2, 2 & 1, 1, 1, 1, 2, 2, 2, 2 &
],pReal),[nNode(5),NcellNode(geomType(5))]) ! 2D 8node 4ip ],[nNode(5),NcellNode(geomType(5))]) !< 2D 8node 4ip
real(pReal), dimension(nNode(6),NcellNode(geomType(6))), parameter :: cellNodeParentNodeWeights6 = & integer, dimension(nNode(6),NcellNode(geomType(6))), parameter :: cellNodeParentNodeWeights6 = &
reshape(real([& reshape([&
1, 0, 0, 0, & 1, 0, 0, 0, &
0, 1, 0, 0, & 0, 1, 0, 0, &
0, 0, 1, 0, & 0, 0, 1, 0, &
0, 0, 0, 1 & 0, 0, 0, 1 &
],pReal),[nNode(6),NcellNode(geomType(6))]) ! 3D 4node 1ip ],[nNode(6),NcellNode(geomType(6))]) !< 3D 4node 1ip
real(pReal), dimension(nNode(7),NcellNode(geomType(7))), parameter :: cellNodeParentNodeWeights7 = & integer, dimension(nNode(7),NcellNode(geomType(7))), parameter :: cellNodeParentNodeWeights7 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, & 1, 0, 0, 0, 0, &
0, 1, 0, 0, 0, & 0, 1, 0, 0, 0, &
0, 0, 1, 0, 0, & 0, 0, 1, 0, 0, &
@ -475,10 +350,10 @@ module element
0, 1, 1, 1, 0, & 0, 1, 1, 1, 0, &
1, 0, 1, 1, 0, & 1, 0, 1, 1, 0, &
0, 0, 0, 0, 1 & 0, 0, 0, 0, 1 &
],pReal),[nNode(7),NcellNode(geomType(7))]) ! 3D 5node 4ip ],[nNode(7),NcellNode(geomType(7))]) !< 3D 5node 4ip
real(pReal), dimension(nNode(8),NcellNode(geomType(8))), parameter :: cellNodeParentNodeWeights8 = & integer, dimension(nNode(8),NcellNode(geomType(8))), parameter :: cellNodeParentNodeWeights8 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, & 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, &
@ -494,10 +369,10 @@ module element
0, 1, 1, 1, 0, 2, 0, 0, 2, 2, & 0, 1, 1, 1, 0, 2, 0, 0, 2, 2, &
1, 0, 1, 1, 0, 0, 2, 2, 0, 2, & 1, 0, 1, 1, 0, 0, 2, 2, 0, 2, &
3, 3, 3, 3, 4, 4, 4, 4, 4, 4 & 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 &
],pReal),[nNode(8),NcellNode(geomType(8))]) ! 3D 10node 4ip ],[nNode(8),NcellNode(geomType(8))]) !< 3D 10node 4ip
real(pReal), dimension(nNode(9),NcellNode(geomType(9))), parameter :: cellNodeParentNodeWeights9 = & integer, dimension(nNode(9),NcellNode(geomType(9))), parameter :: cellNodeParentNodeWeights9 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, & 0, 0, 1, 0, 0, 0, &
@ -519,10 +394,10 @@ module element
1, 0, 1, 1, 0, 1, & 1, 0, 1, 1, 0, 1, &
0, 0, 0, 1, 1, 1, & 0, 0, 0, 1, 1, 1, &
1, 1, 1, 1, 1, 1 & 1, 1, 1, 1, 1, 1 &
],pReal),[nNode(9),NcellNode(geomType(9))]) ! 3D 6node 6ip ],[nNode(9),NcellNode(geomType(9))]) !< 3D 6node 6ip
real(pReal), dimension(nNode(10),NcellNode(geomType(10))), parameter :: cellNodeParentNodeWeights10 = & integer, dimension(nNode(10),NcellNode(geomType(10))), parameter :: cellNodeParentNodeWeights10 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, & 1, 0, 0, 0, 0, 0, 0, 0, &
0, 1, 0, 0, 0, 0, 0, 0, & 0, 1, 0, 0, 0, 0, 0, 0, &
0, 0, 1, 0, 0, 0, 0, 0, & 0, 0, 1, 0, 0, 0, 0, 0, &
@ -531,10 +406,10 @@ module element
0, 0, 0, 0, 0, 1, 0, 0, & 0, 0, 0, 0, 0, 1, 0, 0, &
0, 0, 0, 0, 0, 0, 1, 0, & 0, 0, 0, 0, 0, 0, 1, 0, &
0, 0, 0, 0, 0, 0, 0, 1 & 0, 0, 0, 0, 0, 0, 0, 1 &
],pReal),[nNode(10),NcellNode(geomType(10))]) ! 3D 8node 1ip ],[nNode(10),NcellNode(geomType(10))]) !< 3D 8node 1ip
real(pReal), dimension(nNode(11),NcellNode(geomType(11))), parameter :: cellNodeParentNodeWeights11 = & integer, dimension(nNode(11),NcellNode(geomType(11))), parameter :: cellNodeParentNodeWeights11 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, & ! 1, 0, 0, 0, 0, 0, 0, 0, & !
0, 1, 0, 0, 0, 0, 0, 0, & ! 0, 1, 0, 0, 0, 0, 0, 0, & !
0, 0, 1, 0, 0, 0, 0, 0, & ! 0, 0, 1, 0, 0, 0, 0, 0, & !
@ -562,10 +437,10 @@ module element
1, 0, 0, 1, 1, 0, 0, 1, & ! 25 1, 0, 0, 1, 1, 0, 0, 1, & ! 25
0, 0, 0, 0, 1, 1, 1, 1, & ! 0, 0, 0, 0, 1, 1, 1, 1, & !
1, 1, 1, 1, 1, 1, 1, 1 & ! 1, 1, 1, 1, 1, 1, 1, 1 & !
],pReal),[nNode(11),NcellNode(geomType(11))]) ! 3D 8node 8ip ],[nNode(11),NcellNode(geomType(11))]) !< 3D 8node 8ip
real(pReal), dimension(nNode(12),NcellNode(geomType(12))), parameter :: cellNodeParentNodeWeights12 = & integer, dimension(nNode(12),NcellNode(geomType(12))), parameter :: cellNodeParentNodeWeights12 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
@ -593,10 +468,10 @@ module element
1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, & ! 25 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, & ! 25
0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, & ! 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, & !
3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 & ! 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 & !
],pReal),[nNode(12),NcellNode(geomType(12))]) ! 3D 20node 8ip ],[nNode(12),NcellNode(geomType(12))]) !< 3D 20node 8ip
real(pReal), dimension(nNode(13),NcellNode(geomType(13))), parameter :: cellNodeParentNodeWeights13 = & integer, dimension(nNode(13),NcellNode(geomType(13))), parameter :: cellNodeParentNodeWeights13 = &
reshape(real([& reshape([&
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ! 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & !
@ -661,7 +536,7 @@ module element
4, 8, 4, 3, 8,24, 8, 4, 12,12, 4, 4, 32,32,12,12, 12,32,12, 4, & ! 4, 8, 4, 3, 8,24, 8, 4, 12,12, 4, 4, 32,32,12,12, 12,32,12, 4, & !
3, 4, 8, 4, 4, 8,24, 8, 4,12,12, 4, 12,32,32,12, 4,12,32,12, & ! 3, 4, 8, 4, 4, 8,24, 8, 4,12,12, 4, 12,32,32,12, 4,12,32,12, & !
4, 3, 4, 8, 8, 4, 8,24, 4, 4,12,12, 12,12,32,32, 12, 4,12,32 & ! 4, 3, 4, 8, 8, 4, 8,24, 4, 4,12,12, 12,12,32,32, 12, 4,12,32 & !
],pReal),[nNode(13),NcellNode(geomType(13))]) ! 3D 20node 27ip ],[nNode(13),NcellNode(geomType(13))]) !< 3D 20node 27ip
integer, dimension(NCELLNODEPERCELL(CELLTYPE(1)),NIP(1)), parameter :: CELL1 = & integer, dimension(NCELLNODEPERCELL(CELLTYPE(1)),NIP(1)), parameter :: CELL1 = &
@ -803,9 +678,9 @@ module element
],[NCELLNODEPERCELLFACE(4),NIPNEIGHBOR(4)]) !< 3D 8node, VTK_HEXAHEDRON (12) ],[NCELLNODEPERCELLFACE(4),NIPNEIGHBOR(4)]) !< 3D 8node, VTK_HEXAHEDRON (12)
contains contains
subroutine tElement_init(self,elemType) subroutine tElement_init(self,elemType)
class(tElement) :: self class(tElement) :: self
integer, intent(in) :: elemType integer, intent(in) :: elemType
@ -846,50 +721,38 @@ module element
self%NcellNodes = NcellNode (self%geomType) self%NcellNodes = NcellNode (self%geomType)
self%maxNnodeAtIP = maxNnodeAtIP (self%geomType)
self%nIPs = nIP (self%geomType) self%nIPs = nIP (self%geomType)
self%cellType = cellType (self%geomType) self%cellType = cellType (self%geomType)
select case (self%geomType) select case (self%geomType)
case(1) case(1)
self%NnodeAtIP = NnodeAtIP1
self%IPneighbor = IPneighbor1 self%IPneighbor = IPneighbor1
self%cell = CELL1 self%cell = CELL1
case(2) case(2)
self%NnodeAtIP = NnodeAtIP2
self%IPneighbor = IPneighbor2 self%IPneighbor = IPneighbor2
self%cell = CELL2 self%cell = CELL2
case(3) case(3)
self%NnodeAtIP = NnodeAtIP3
self%IPneighbor = IPneighbor3 self%IPneighbor = IPneighbor3
self%cell = CELL3 self%cell = CELL3
case(4) case(4)
self%NnodeAtIP = NnodeAtIP4
self%IPneighbor = IPneighbor4 self%IPneighbor = IPneighbor4
self%cell = CELL4 self%cell = CELL4
case(5) case(5)
self%NnodeAtIP = NnodeAtIP5
self%IPneighbor = IPneighbor5 self%IPneighbor = IPneighbor5
self%cell = CELL5 self%cell = CELL5
case(6) case(6)
self%NnodeAtIP = NnodeAtIP6
self%IPneighbor = IPneighbor6 self%IPneighbor = IPneighbor6
self%cell = CELL6 self%cell = CELL6
case(7) case(7)
self%NnodeAtIP = NnodeAtIP7
self%IPneighbor = IPneighbor7 self%IPneighbor = IPneighbor7
self%cell = CELL7 self%cell = CELL7
case(8) case(8)
self%NnodeAtIP = NnodeAtIP8
self%IPneighbor = IPneighbor8 self%IPneighbor = IPneighbor8
self%cell = CELL8 self%cell = CELL8
case(9) case(9)
self%NnodeAtIP = NnodeAtIP9
self%IPneighbor = IPneighbor9 self%IPneighbor = IPneighbor9
self%cell = CELL9 self%cell = CELL9
case(10) case(10)
self%NnodeAtIP = NnodeAtIP10
self%IPneighbor = IPneighbor10 self%IPneighbor = IPneighbor10
self%cell = CELL10 self%cell = CELL10
end select end select
@ -911,16 +774,15 @@ module element
write(6,'(/,a)') ' <<<+- element_init -+>>>' write(6,'(/,a)') ' <<<+- element_init -+>>>'
write(6,*)' element type: ',self%elemType write(6,*) ' element type: ',self%elemType
write(6,*)' geom type: ',self%geomType write(6,*) ' geom type: ',self%geomType
write(6,*)' cell type: ',self%cellType write(6,*) ' cell type: ',self%cellType
write(6,*)' # node: ',self%Nnodes write(6,*) ' # node: ',self%Nnodes
write(6,*)' # IP: ',self%nIPs write(6,*) ' # IP: ',self%nIPs
write(6,*)' # cellnode: ',self%Ncellnodes write(6,*) ' # cellnode: ',self%Ncellnodes
write(6,*)' # cellnode/cell: ',self%NcellnodesPerCell write(6,*) ' # cellnode/cell: ',self%NcellnodesPerCell
write(6,*)' # IP neighbor: ',self%nIPneighbors write(6,*) ' # IP neighbor: ',self%nIPneighbors
write(6,*)' max # node at IP: ',self%maxNnodeAtIP
end subroutine tElement_init end subroutine tElement_init
end module element end module element

View File

@ -32,6 +32,7 @@ function findloc(a,v)
end function findloc end function findloc
#endif #endif
#if defined(__PGI) #if defined(__PGI)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief substitute for the norm2 intrinsic (only for real, dimension(3) at the moment) !> @brief substitute for the norm2 intrinsic (only for real, dimension(3) at the moment)

View File

@ -217,8 +217,7 @@ program DAMASK_spectral
case('freq','frequency','outputfreq') ! frequency of result writings case('freq','frequency','outputfreq') ! frequency of result writings
newLoadCase%outputfrequency = IO_intValue(line,chunkPos,i+1) newLoadCase%outputfrequency = IO_intValue(line,chunkPos,i+1)
case('r','restart','restartwrite') ! frequency of writing restart information case('r','restart','restartwrite') ! frequency of writing restart information
newLoadCase%restartfrequency = & newLoadCase%restartfrequency = IO_intValue(line,chunkPos,i+1)
max(0,IO_intValue(line,chunkPos,i+1))
case('guessreset','dropguessing') case('guessreset','dropguessing')
newLoadCase%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory newLoadCase%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory
case('euler') ! rotation of load case given in euler angles case('euler') ! rotation of load case given in euler angles
@ -300,6 +299,8 @@ program DAMASK_spectral
write(6,'(2x,a,i5)') 'increments: ', newLoadCase%incs write(6,'(2x,a,i5)') 'increments: ', newLoadCase%incs
if (newLoadCase%outputfrequency < 1) errorID = 836 ! non-positive result frequency if (newLoadCase%outputfrequency < 1) errorID = 836 ! non-positive result frequency
write(6,'(2x,a,i5)') 'output frequency: ', newLoadCase%outputfrequency write(6,'(2x,a,i5)') 'output frequency: ', newLoadCase%outputfrequency
if (newLoadCase%restartfrequency < 1) errorID = 839 ! non-positive restart frequency
if (newLoadCase%restartfrequency < huge(0)) &
write(6,'(2x,a,i5)') 'restart frequency: ', newLoadCase%restartfrequency write(6,'(2x,a,i5)') 'restart frequency: ', newLoadCase%restartfrequency
if (errorID > 0) call IO_error(error_ID = errorID, ext_msg = loadcase_string) ! exit with error message if (errorID > 0) call IO_error(error_ID = errorID, ext_msg = loadcase_string) ! exit with error message
endif reportAndCheck endif reportAndCheck
@ -347,7 +348,7 @@ program DAMASK_spectral
write(fileUnit) 'times:', loadCases%time ! one entry per LoadCase write(fileUnit) 'times:', loadCases%time ! one entry per LoadCase
write(fileUnit) 'logscales:', loadCases%logscale write(fileUnit) 'logscales:', loadCases%logscale
write(fileUnit) 'increments:', loadCases%incs ! one entry per LoadCase write(fileUnit) 'increments:', loadCases%incs ! one entry per LoadCase
write(fileUnit) 'startingIncrement:', restartInc ! start with writing out the previous inc write(fileUnit) 'startingIncrement:', interface_restartInc ! start with writing out the previous inc
write(fileUnit) 'eoh' write(fileUnit) 'eoh'
close(fileUnit) ! end of header close(fileUnit) ! end of header
open(newunit=statUnit,file=trim(getSolverJobName())//& open(newunit=statUnit,file=trim(getSolverJobName())//&
@ -425,7 +426,7 @@ program DAMASK_spectral
endif endif
timeinc = timeinc * real(subStepFactor,pReal)**real(-cutBackLevel,pReal) ! depending on cut back level, decrease time step timeinc = timeinc * real(subStepFactor,pReal)**real(-cutBackLevel,pReal) ! depending on cut back level, decrease time step
skipping: if (totalIncsCounter <= restartInc) then ! not yet at restart inc? skipping: if (totalIncsCounter <= interface_restartInc) then ! not yet at restart inc?
time = time + timeinc ! just advance time, skip already performed calculation time = time + timeinc ! just advance time, skip already performed calculation
guess = .true. ! QUESTION:why forced guessing instead of inheriting loadcase preference guess = .true. ! QUESTION:why forced guessing instead of inheriting loadcase preference
else skipping else skipping
@ -561,8 +562,7 @@ program DAMASK_spectral
fileOffset = fileOffset + sum(outputSize) ! forward to current file position fileOffset = fileOffset + sum(outputSize) ! forward to current file position
call CPFEM_results(totalIncsCounter,time) call CPFEM_results(totalIncsCounter,time)
endif endif
if ( loadCases(currentLoadCase)%restartFrequency > 0 & ! writing of restart info requested ... if (mod(inc,loadCases(currentLoadCase)%restartFrequency) == 0) then ! at frequency of writing restart information
.and. mod(inc,loadCases(currentLoadCase)%restartFrequency) == 0) then ! ... and at frequency of writing restart information
restartWrite = .true. ! set restart parameter for FEsolving restartWrite = .true. ! set restart parameter for FEsolving
lastRestartWritten = inc ! QUESTION: first call to CPFEM_general will write? lastRestartWritten = inc ! QUESTION: first call to CPFEM_general will write?
endif endif

View File

@ -181,8 +181,9 @@ subroutine grid_mech_FEM_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! init fields ! init fields
restart: if (restartInc > 0) then restartRead: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') 'reading values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
'reading values of increment ', interface_restartInc, ' from file'
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
@ -195,10 +196,10 @@ subroutine grid_mech_FEM_init
call HDF5_read(fileHandle,u_current, 'u') call HDF5_read(fileHandle,u_current, 'u')
call HDF5_read(fileHandle,u_lastInc, 'u_lastInc') call HDF5_read(fileHandle,u_lastInc, 'u_lastInc')
elseif (restartInc == 0) then restart elseif (interface_restartInc == 0) then restartRead
F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity
F = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) F = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3)
endif restart endif restartRead
materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent
call utilities_updateIPcoords(F) call utilities_updateIPcoords(F)
call utilities_constitutiveResponse(P_current,temp33_Real,C_volAvg,devNull, & ! stress field, stress avg, global average of stiffness and (min+max)/2 call utilities_constitutiveResponse(P_current,temp33_Real,C_volAvg,devNull, & ! stress field, stress avg, global average of stiffness and (min+max)/2
@ -210,12 +211,13 @@ subroutine grid_mech_FEM_init
call DMDAVecRestoreArrayF90(mech_grid,solution_lastInc,u_lastInc,ierr) call DMDAVecRestoreArrayF90(mech_grid,solution_lastInc,u_lastInc,ierr)
CHKERRQ(ierr) CHKERRQ(ierr)
restartRead: if (restartInc > 0) then restartRead2: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') 'reading more values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
'reading more values of increment ', interface_restartInc, ' from file'
call HDF5_read(fileHandle,C_volAvg, 'C_volAvg') call HDF5_read(fileHandle,C_volAvg, 'C_volAvg')
call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc') call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc')
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
endif restartRead endif restartRead2
end subroutine grid_mech_FEM_init end subroutine grid_mech_FEM_init

View File

@ -151,8 +151,9 @@ subroutine grid_mech_spectral_basic_init
! init fields ! init fields
call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! places pointer on PETSc data call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! places pointer on PETSc data
restart: if (restartInc > 0) then restartRead: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') ' reading values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
' reading values of increment ', interface_restartInc, ' from file'
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
@ -163,10 +164,10 @@ subroutine grid_mech_spectral_basic_init
call HDF5_read(fileHandle,F, 'F') call HDF5_read(fileHandle,F, 'F')
call HDF5_read(fileHandle,F_lastInc, 'F_lastInc') call HDF5_read(fileHandle,F_lastInc, 'F_lastInc')
elseif (restartInc == 0) then restart elseif (interface_restartInc == 0) then restartRead
F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity
F = reshape(F_lastInc,[9,grid(1),grid(2),grid3]) F = reshape(F_lastInc,[9,grid(1),grid(2),grid3])
endif restart endif restartRead
materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent
call Utilities_updateIPcoords(reshape(F,shape(F_lastInc))) call Utilities_updateIPcoords(reshape(F,shape(F_lastInc)))
@ -176,15 +177,16 @@ subroutine grid_mech_spectral_basic_init
math_I3) ! no rotation of boundary condition math_I3) ! no rotation of boundary condition
call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! deassociate pointer call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! deassociate pointer
restartRead: if (restartInc > 0) then restartRead2: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') 'reading more values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
'reading more values of increment ', interface_restartInc, ' from file'
call HDF5_read(fileHandle,C_volAvg, 'C_volAvg') call HDF5_read(fileHandle,C_volAvg, 'C_volAvg')
call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc') call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc')
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
fileUnit = IO_open_jobFile_binary('C_ref') fileUnit = IO_open_jobFile_binary('C_ref')
read(fileUnit) C_minMaxAvg; close(fileUnit) read(fileUnit) C_minMaxAvg; close(fileUnit)
endif restartRead endif restartRead2
call utilities_updateGamma(C_minMaxAvg,.true.) call utilities_updateGamma(C_minMaxAvg,.true.)

View File

@ -160,8 +160,9 @@ subroutine grid_mech_spectral_polarisation_init
F => FandF_tau( 0: 8,:,:,:) F => FandF_tau( 0: 8,:,:,:)
F_tau => FandF_tau( 9:17,:,:,:) F_tau => FandF_tau( 9:17,:,:,:)
restart: if (restartInc > 0) then restartRead: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') ' reading values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
' reading values of increment ', interface_restartInc, ' from file'
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
@ -174,12 +175,12 @@ subroutine grid_mech_spectral_polarisation_init
call HDF5_read(fileHandle,F_tau, 'F_tau') call HDF5_read(fileHandle,F_tau, 'F_tau')
call HDF5_read(fileHandle,F_tau_lastInc,'F_tau_lastInc') call HDF5_read(fileHandle,F_tau_lastInc,'F_tau_lastInc')
elseif (restartInc == 0) then restart elseif (interface_restartInc == 0) then restartRead
F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity
F = reshape(F_lastInc,[9,grid(1),grid(2),grid3]) F = reshape(F_lastInc,[9,grid(1),grid(2),grid3])
F_tau = 2.0_pReal*F F_tau = 2.0_pReal*F
F_tau_lastInc = 2.0_pReal*F_lastInc F_tau_lastInc = 2.0_pReal*F_lastInc
endif restart endif restartRead
materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent
call Utilities_updateIPcoords(reshape(F,shape(F_lastInc))) call Utilities_updateIPcoords(reshape(F,shape(F_lastInc)))
@ -189,15 +190,16 @@ subroutine grid_mech_spectral_polarisation_init
math_I3) ! no rotation of boundary condition math_I3) ! no rotation of boundary condition
call DMDAVecRestoreArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr) ! deassociate pointer call DMDAVecRestoreArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr) ! deassociate pointer
restartRead: if (restartInc > 0) then restartRead2: if (interface_restartInc > 0) then
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') ' reading more values of increment ', restartInc, ' from file' write(6,'(/,a,'//IO_intOut(interface_restartInc)//',a)') &
' reading more values of increment ', interface_restartInc, ' from file'
call HDF5_read(fileHandle,C_volAvg, 'C_volAvg') call HDF5_read(fileHandle,C_volAvg, 'C_volAvg')
call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc') call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc')
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
fileUnit = IO_open_jobFile_binary('C_ref') fileUnit = IO_open_jobFile_binary('C_ref')
read(fileUnit) C_minMaxAvg; close(fileUnit) read(fileUnit) C_minMaxAvg; close(fileUnit)
endif restartRead endif restartRead2
call utilities_updateGamma(C_minMaxAvg,.true.) call utilities_updateGamma(C_minMaxAvg,.true.)
C_scale = C_minMaxAvg C_scale = C_minMaxAvg

View File

@ -98,7 +98,7 @@ module spectral_utilities
real(pReal) :: time = 0.0_pReal !< length of increment real(pReal) :: time = 0.0_pReal !< length of increment
integer :: incs = 0, & !< number of increments integer :: incs = 0, & !< number of increments
outputfrequency = 1, & !< frequency of result writes outputfrequency = 1, & !< frequency of result writes
restartfrequency = 0, & !< frequency of restart writes restartfrequency = huge(0), & !< frequency of restart writes
logscale = 0 !< linear/logarithmic time inc flag logscale = 0 !< linear/logarithmic time inc flag
logical :: followFormerTrajectory = .true. !< follow trajectory of former loadcase logical :: followFormerTrajectory = .true. !< follow trajectory of former loadcase
integer(kind(FIELD_UNDEFINED_ID)), allocatable :: ID(:) integer(kind(FIELD_UNDEFINED_ID)), allocatable :: ID(:)

View File

@ -164,7 +164,7 @@ subroutine homogenization_init
call IO_write_jobFile(FILEUNIT,'outputHomogenization') call IO_write_jobFile(FILEUNIT,'outputHomogenization')
do p = 1,size(config_homogenization) do p = 1,size(config_homogenization)
if (any(material_homogenizationAt == p)) then if (any(material_homogenizationAt == p)) then
write(FILEUNIT,'(/,a,/)') '['//trim(homogenization_name(p))//']' write(FILEUNIT,'(/,a,/)') '['//trim(config_name_homogenization(p))//']'
write(FILEUNIT,'(a)') '(type) n/a' write(FILEUNIT,'(a)') '(type) n/a'
write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p) write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p)
@ -326,11 +326,11 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e);
do g = 1,myNgrains do g = 1,myNgrains
plasticState (phaseAt(g,i,e))%partionedState0(:,phasememberAt(g,i,e)) = & plasticState (material_phaseAt(g,e))%partionedState0(:,material_phasememberAt(g,i,e)) = &
plasticState (phaseAt(g,i,e))%state0( :,phasememberAt(g,i,e)) plasticState (material_phaseAt(g,e))%state0( :,material_phasememberAt(g,i,e))
do mySource = 1, phase_Nsources(phaseAt(g,i,e)) do mySource = 1, phase_Nsources(material_phaseAt(g,e))
sourceState(phaseAt(g,i,e))%p(mySource)%partionedState0(:,phasememberAt(g,i,e)) = & sourceState(material_phaseAt(g,e))%p(mySource)%partionedState0(:,material_phasememberAt(g,i,e)) = &
sourceState(phaseAt(g,i,e))%p(mySource)%state0( :,phasememberAt(g,i,e)) sourceState(material_phaseAt(g,e))%p(mySource)%state0( :,material_phasememberAt(g,i,e))
enddo enddo
crystallite_partionedFp0(1:3,1:3,g,i,e) = crystallite_Fp0(1:3,1:3,g,i,e) crystallite_partionedFp0(1:3,1:3,g,i,e) = crystallite_Fp0(1:3,1:3,g,i,e)
@ -412,11 +412,11 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
crystallite_S (1:3,1:3,1:myNgrains,i,e) crystallite_S (1:3,1:3,1:myNgrains,i,e)
do g = 1,myNgrains do g = 1,myNgrains
plasticState (phaseAt(g,i,e))%partionedState0(:,phasememberAt(g,i,e)) = & plasticState (material_phaseAt(g,e))%partionedState0(:,material_phasememberAt(g,i,e)) = &
plasticState (phaseAt(g,i,e))%state (:,phasememberAt(g,i,e)) plasticState (material_phaseAt(g,e))%state (:,material_phasememberAt(g,i,e))
do mySource = 1, phase_Nsources(phaseAt(g,i,e)) do mySource = 1, phase_Nsources(material_phaseAt(g,e))
sourceState(phaseAt(g,i,e))%p(mySource)%partionedState0(:,phasememberAt(g,i,e)) = & sourceState(material_phaseAt(g,e))%p(mySource)%partionedState0(:,material_phasememberAt(g,i,e)) = &
sourceState(phaseAt(g,i,e))%p(mySource)%state (:,phasememberAt(g,i,e)) sourceState(material_phaseAt(g,e))%p(mySource)%state (:,material_phasememberAt(g,i,e))
enddo enddo
enddo enddo
@ -475,11 +475,11 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
crystallite_S(1:3,1:3,1:myNgrains,i,e) = & crystallite_S(1:3,1:3,1:myNgrains,i,e) = &
crystallite_partionedS0(1:3,1:3,1:myNgrains,i,e) crystallite_partionedS0(1:3,1:3,1:myNgrains,i,e)
do g = 1, myNgrains do g = 1, myNgrains
plasticState (phaseAt(g,i,e))%state( :,phasememberAt(g,i,e)) = & plasticState (material_phaseAt(g,e))%state( :,material_phasememberAt(g,i,e)) = &
plasticState (phaseAt(g,i,e))%partionedState0(:,phasememberAt(g,i,e)) plasticState (material_phaseAt(g,e))%partionedState0(:,material_phasememberAt(g,i,e))
do mySource = 1, phase_Nsources(phaseAt(g,i,e)) do mySource = 1, phase_Nsources(material_phaseAt(g,e))
sourceState(phaseAt(g,i,e))%p(mySource)%state( :,phasememberAt(g,i,e)) = & sourceState(material_phaseAt(g,e))%p(mySource)%state( :,material_phasememberAt(g,i,e)) = &
sourceState(phaseAt(g,i,e))%p(mySource)%partionedState0(:,phasememberAt(g,i,e)) sourceState(material_phaseAt(g,e))%p(mySource)%partionedState0(:,material_phasememberAt(g,i,e))
enddo enddo
enddo enddo
if(homogState(material_homogenizationAt(e))%sizeState > 0) & if(homogState(material_homogenizationAt(e))%sizeState > 0) &
@ -605,14 +605,13 @@ subroutine materialpoint_postResults
IpLooping: do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) IpLooping: do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
thePos = 0 thePos = 0
theSize = homogState (material_homogenizationAt(e))%sizePostResults & theSize = thermalState (material_homogenizationAt(e))%sizePostResults &
+ thermalState (material_homogenizationAt(e))%sizePostResults &
+ damageState (material_homogenizationAt(e))%sizePostResults + damageState (material_homogenizationAt(e))%sizePostResults
materialpoint_results(thePos+1,i,e) = real(theSize,pReal) ! tell size of homogenization results materialpoint_results(thePos+1,i,e) = real(theSize,pReal) ! tell size of homogenization results
thePos = thePos + 1 thePos = thePos + 1
if (theSize > 0) then ! any homogenization results to mention? if (theSize > 0) then ! any homogenization results to mention?
materialpoint_results(thePos+1:thePos+theSize,i,e) = postResults(i,e) ! tell homogenization results materialpoint_results(thePos+1:thePos+theSize,i,e) = postResults(i,e)
thePos = thePos + theSize thePos = thePos + theSize
endif endif
@ -621,8 +620,8 @@ subroutine materialpoint_postResults
grainLooping :do g = 1,myNgrains grainLooping :do g = 1,myNgrains
theSize = 1 + crystallite_sizePostResults(myCrystallite) + & theSize = 1 + crystallite_sizePostResults(myCrystallite) + &
1 + plasticState (material_phase(g,i,e))%sizePostResults + & !ToDo 1 + plasticState (material_phaseAt(g,e))%sizePostResults + &
sum(sourceState(material_phase(g,i,e))%p(:)%sizePostResults) sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults)
materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results
thePos = thePos + theSize thePos = thePos + theSize
enddo grainLooping enddo grainLooping
@ -753,8 +752,7 @@ function postResults(ip,el)
integer, intent(in) :: & integer, intent(in) :: &
ip, & !< integration point ip, & !< integration point
el !< element number el !< element number
real(pReal), dimension( homogState (material_homogenizationAt(el))%sizePostResults & real(pReal), dimension( thermalState (material_homogenizationAt(el))%sizePostResults &
+ thermalState (material_homogenizationAt(el))%sizePostResults &
+ damageState (material_homogenizationAt(el))%sizePostResults) :: & + damageState (material_homogenizationAt(el))%sizePostResults) :: &
postResults postResults
integer :: & integer :: &
@ -797,8 +795,6 @@ end function postResults
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_results subroutine homogenization_results
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
use config, only: &
config_name_homogenization => homogenization_name ! anticipate logical name
use material, only: & use material, only: &
material_homogenization_type => homogenization_type material_homogenization_type => homogenization_type
@ -819,8 +815,6 @@ subroutine homogenization_results
enddo enddo
#endif #endif
end subroutine homogenization_results end subroutine homogenization_results
end module homogenization end module homogenization

View File

@ -364,8 +364,7 @@ module procedure mech_RGC_updateState
residMax = maxval(abs(tract)) ! get the maximum of the residual residMax = maxval(abs(tract)) ! get the maximum of the residual
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of) then
.and. prm%of_debug == of) then
stresLoc = maxloc(abs(P)) stresLoc = maxloc(abs(P))
residLoc = maxloc(abs(tract)) residLoc = maxloc(abs(tract))
write(6,'(1x,a)')' ' write(6,'(1x,a)')' '
@ -385,9 +384,8 @@ module procedure mech_RGC_updateState
if (residMax < relTol_RGC*stresMax .or. residMax < absTol_RGC) then if (residMax < relTol_RGC*stresMax .or. residMax < absTol_RGC) then
mech_RGC_updateState = .true. mech_RGC_updateState = .true.
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of) &
.and. prm%of_debug == of) write(6,'(1x,a55,/)')'... done and happy' write(6,'(1x,a55,/)')'... done and happy'; flush(6)
flush(6)
#endif #endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -406,8 +404,7 @@ module procedure mech_RGC_updateState
dst%relaxationRate_max(of) = maxval(abs(drelax))/dt dst%relaxationRate_max(of) = maxval(abs(drelax))/dt
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of) then
.and. prm%of_debug == of) then
write(6,'(1x,a30,1x,e15.8)') 'Constitutive work: ',stt%work(of) write(6,'(1x,a30,1x,e15.8)') 'Constitutive work: ',stt%work(of)
write(6,'(1x,a30,3(1x,e15.8))')'Magnitude mismatch: ',dst%mismatch(1,of), & write(6,'(1x,a30,3(1x,e15.8))')'Magnitude mismatch: ',dst%mismatch(1,of), &
dst%mismatch(2,of), & dst%mismatch(2,of), &
@ -428,18 +425,16 @@ module procedure mech_RGC_updateState
mech_RGC_updateState = [.true.,.false.] ! with direct cut-back mech_RGC_updateState = [.true.,.false.] ! with direct cut-back
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of) &
.and. prm%of_debug == of) write(6,'(1x,a,/)') '... broken' write(6,'(1x,a,/)') '... broken'; flush(6)
flush(6)
#endif #endif
return return
else ! proceed with computing the Jacobian and state update else ! proceed with computing the Jacobian and state update
#ifdef DEBUG #ifdef DEBUG
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of) &
.and. prm%of_debug == of) write(6,'(1x,a,/)') '... not yet done' write(6,'(1x,a,/)') '... not yet done'; flush(6)
flush(6)
#endif #endif
endif endif
@ -645,9 +640,9 @@ module procedure mech_RGC_updateState
end associate end associate
contains contains
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
!> @brief calculate stress-like penalty due to deformation mismatch !> @brief calculate stress-like penalty due to deformation mismatch
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
subroutine stressPenalty(rPen,nMis,avgF,fDef,ip,el,instance,of) subroutine stressPenalty(rPen,nMis,avgF,fDef,ip,el,instance,of)
real(pReal), dimension (:,:,:), intent(out) :: rPen !< stress-like penalty real(pReal), dimension (:,:,:), intent(out) :: rPen !< stress-like penalty
@ -673,7 +668,7 @@ module procedure mech_RGC_updateState
rPen = 0.0_pReal rPen = 0.0_pReal
nMis = 0.0_pReal nMis = 0.0_pReal
!-------------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
! get the correction factor the modulus of penalty stress representing the evolution of area of ! get the correction factor the modulus of penalty stress representing the evolution of area of
! the interfaces due to deformations ! the interfaces due to deformations
@ -682,8 +677,7 @@ module procedure mech_RGC_updateState
associate(prm => param(instance)) associate(prm => param(instance))
#ifdef DEBUG #ifdef DEBUG
debugActive = iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 & debugActive = iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0 .and. prm%of_debug == of
.and. prm%of_debug == of
if (debugActive) then if (debugActive) then
write(6,'(1x,a20,2(1x,i3))')'Correction factor: ',ip,el write(6,'(1x,a20,2(1x,i3))')'Correction factor: ',ip,el
@ -691,7 +685,7 @@ module procedure mech_RGC_updateState
endif endif
#endif #endif
!-------------------------------------------------------------------------------------------------- !-----------------------------------------------------------------------------------------------
! computing the mismatch and penalty stress tensor of all grains ! computing the mismatch and penalty stress tensor of all grains
grainLoop: do iGrain = 1,product(prm%Nconstituents) grainLoop: do iGrain = 1,product(prm%Nconstituents)
Gmoduli = equivalentModuli(iGrain,ip,el) Gmoduli = equivalentModuli(iGrain,ip,el)
@ -713,7 +707,7 @@ module procedure mech_RGC_updateState
bgGNghb = Gmoduli(2) bgGNghb = Gmoduli(2)
gDef = 0.5_pReal*(fDef(1:3,1:3,iGNghb) - fDef(1:3,1:3,iGrain)) ! difference/jump in deformation gradeint across the neighbor gDef = 0.5_pReal*(fDef(1:3,1:3,iGNghb) - fDef(1:3,1:3,iGrain)) ! difference/jump in deformation gradeint across the neighbor
!-------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------
! compute the mismatch tensor of all interfaces ! compute the mismatch tensor of all interfaces
nDefNorm = 0.0_pReal nDefNorm = 0.0_pReal
nDef = 0.0_pReal nDef = 0.0_pReal
@ -733,7 +727,7 @@ module procedure mech_RGC_updateState
endif endif
#endif #endif
!-------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------
! compute the stress penalty of all interfaces ! compute the stress penalty of all interfaces
do i = 1,3; do j = 1,3; do k = 1,3; do l = 1,3 do i = 1,3; do j = 1,3; do k = 1,3; do l = 1,3
rPen(i,j,iGrain) = rPen(i,j,iGrain) + 0.5_pReal*(muGrain*bgGrain + muGNghb*bgGNghb)*prm%xiAlpha & rPen(i,j,iGrain) = rPen(i,j,iGrain) + 0.5_pReal*(muGrain*bgGrain + muGNghb*bgGNghb)*prm%xiAlpha &
@ -757,9 +751,9 @@ module procedure mech_RGC_updateState
end subroutine stressPenalty end subroutine stressPenalty
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
!> @brief calculate stress-like penalty due to volume discrepancy !> @brief calculate stress-like penalty due to volume discrepancy
!-------------------------------------------------------------------------------------------------- !------------------------------------------------------------------------------------------------
subroutine volumePenalty(vPen,vDiscrep,fAvg,fDef,nGrain,instance,of) subroutine volumePenalty(vPen,vDiscrep,fAvg,fDef,nGrain,instance,of)
real(pReal), dimension (:,:,:), intent(out) :: vPen ! stress-like penalty due to volume real(pReal), dimension (:,:,:), intent(out) :: vPen ! stress-like penalty due to volume
@ -775,7 +769,7 @@ module procedure mech_RGC_updateState
real(pReal), dimension(size(vPen,3)) :: gVol real(pReal), dimension(size(vPen,3)) :: gVol
integer :: i integer :: i
!-------------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
! compute the volumes of grains and of cluster ! compute the volumes of grains and of cluster
vDiscrep = math_det33(fAvg) ! compute the volume of the cluster vDiscrep = math_det33(fAvg) ! compute the volume of the cluster
do i = 1,nGrain do i = 1,nGrain
@ -784,7 +778,7 @@ module procedure mech_RGC_updateState
! the volume of the cluster and the the total volume of grains ! the volume of the cluster and the the total volume of grains
enddo enddo
!-------------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
! calculate the stress and penalty due to volume discrepancy ! calculate the stress and penalty due to volume discrepancy
vPen = 0.0_pReal vPen = 0.0_pReal
do i = 1,nGrain do i = 1,nGrain
@ -855,7 +849,7 @@ module procedure mech_RGC_updateState
elasTens = constitutive_homogenizedC(grainID,ip,el) elasTens = constitutive_homogenizedC(grainID,ip,el)
!-------------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
! compute the equivalent shear modulus after Turterltaub and Suiker, JMPS (2005) ! compute the equivalent shear modulus after Turterltaub and Suiker, JMPS (2005)
cEquiv_11 = (elasTens(1,1) + elasTens(2,2) + elasTens(3,3))/3.0_pReal cEquiv_11 = (elasTens(1,1) + elasTens(2,2) + elasTens(3,3))/3.0_pReal
cEquiv_12 = (elasTens(1,2) + elasTens(2,3) + elasTens(3,1) + & cEquiv_12 = (elasTens(1,2) + elasTens(2,3) + elasTens(3,1) + &
@ -863,7 +857,7 @@ module procedure mech_RGC_updateState
cEquiv_44 = (elasTens(4,4) + elasTens(5,5) + elasTens(6,6))/3.0_pReal cEquiv_44 = (elasTens(4,4) + elasTens(5,5) + elasTens(6,6))/3.0_pReal
equivalentModuli(1) = 0.2_pReal*(cEquiv_11 - cEquiv_12) + 0.6_pReal*cEquiv_44 equivalentModuli(1) = 0.2_pReal*(cEquiv_11 - cEquiv_12) + 0.6_pReal*cEquiv_44
!-------------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
! obtain the length of Burgers vector (could be model dependend) ! obtain the length of Burgers vector (could be model dependend)
equivalentModuli(2) = 2.5e-10_pReal equivalentModuli(2) = 2.5e-10_pReal
@ -933,7 +927,6 @@ end subroutine mech_RGC_averageStressAndItsTangent
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief writes results to HDF5 output file !> @brief writes results to HDF5 output file
! ToDo: check wheter units are correct
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine mech_RGC_results(instance,group) module subroutine mech_RGC_results(instance,group)
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
@ -990,8 +983,6 @@ pure function relaxationVector(intFace,instance,of)
integer :: iNum integer :: iNum
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! collect the interface relaxation vector from the global state array ! collect the interface relaxation vector from the global state array
@ -1040,9 +1031,8 @@ pure function getInterface(iFace,iGrain3)
integer, dimension(3), intent(in) :: iGrain3 !< grain ID in 3D array integer, dimension(3), intent(in) :: iGrain3 !< grain ID in 3D array
integer, intent(in) :: iFace !< face index (1..6) mapped like (-e1,-e2,-e3,+e1,+e2,+e3) or iDir = (-1,-2,-3,1,2,3) integer, intent(in) :: iFace !< face index (1..6) mapped like (-e1,-e2,-e3,+e1,+e2,+e3) or iDir = (-1,-2,-3,1,2,3)
integer :: iDir integer :: iDir !< direction of interface normal
!* Direction of interface normal
iDir = (int(real(iFace-1,pReal)/2.0_pReal)+1)*(-1)**iFace iDir = (int(real(iFace-1,pReal)/2.0_pReal)+1)*(-1)**iFace
getInterface(1) = iDir getInterface(1) = iDir
@ -1064,8 +1054,8 @@ pure function grain1to3(grain1,nGDim)
integer, intent(in) :: grain1 !< grain ID in 1D array integer, intent(in) :: grain1 !< grain ID in 1D array
integer, dimension(3), intent(in) :: nGDim integer, dimension(3), intent(in) :: nGDim
grain1to3 = 1 + [mod((grain1-1),nGDim(1)), & grain1to3 = 1 + [mod((grain1-1), nGDim(1)), &
mod((grain1-1)/nGDim(1),nGDim(2)), & mod((grain1-1)/ nGDim(1),nGDim(2)), &
(grain1-1)/(nGDim(1)*nGDim(2))] (grain1-1)/(nGDim(1)*nGDim(2))]
end function grain1to3 end function grain1to3

View File

@ -138,7 +138,7 @@ subroutine kinematics_cleavage_opening_LiAndItsTangent(Ld, dLd_dTstar, S, ipc, i
traction_d, traction_t, traction_n, traction_crit, & traction_d, traction_t, traction_n, traction_crit, &
udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt
phase = material_phase(ipc,ip,el) phase = material_phaseAt(ipc,el)
instance = kinematics_cleavage_opening_instance(phase) instance = kinematics_cleavage_opening_instance(phase)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
damageOffset = damageMapping(homog)%p(ip,el) damageOffset = damageMapping(homog)%p(ip,el)

View File

@ -124,7 +124,7 @@ subroutine kinematics_slipplane_opening_LiAndItsTangent(Ld, dLd_dTstar, S, ipc,
traction_d, traction_t, traction_n, traction_crit, & traction_d, traction_t, traction_n, traction_crit, &
udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt
phase = material_phase(ipc,ip,el) phase = material_phaseAt(ipc,el)
instance = kinematics_slipplane_opening_instance(phase) instance = kinematics_slipplane_opening_instance(phase)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
damageOffset = damageMapping(homog)%p(ip,el) damageOffset = damageMapping(homog)%p(ip,el)
@ -181,7 +181,7 @@ subroutine kinematics_slipplane_opening_LiAndItsTangent(Ld, dLd_dTstar, S, ipc,
endif endif
enddo enddo
end associate end associate
end subroutine kinematics_slipplane_opening_LiAndItsTangent end subroutine kinematics_slipplane_opening_LiAndItsTangent

View File

@ -112,7 +112,7 @@ subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, ipc, ip,
real(pReal) :: & real(pReal) :: &
T, TRef, TDot T, TRef, TDot
phase = material_phase(ipc,ip,el) phase = material_phaseAt(ipc,el)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
offset = thermalMapping(homog)%p(ip,el) offset = thermalMapping(homog)%p(ip,el)
T = temperature(homog)%p(offset) T = temperature(homog)%p(offset)

View File

@ -98,6 +98,10 @@ module material
integer(kind(DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: & integer(kind(DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: &
damage_type !< nonlocal damage model damage_type !< nonlocal damage model
integer, public, protected :: &
material_Nphase, & !< number of phases
material_Nhomogenization !< number of homogenizations
integer(kind(SOURCE_undefined_ID)), dimension(:,:), allocatable, public, protected :: & integer(kind(SOURCE_undefined_ID)), dimension(:,:), allocatable, public, protected :: &
phase_source, & !< active sources mechanisms of each phase phase_source, & !< active sources mechanisms of each phase
phase_kinematics, & !< active kinematic mechanisms of each phase phase_kinematics, & !< active kinematic mechanisms of each phase
@ -139,10 +143,6 @@ module material
material_phaseMemberAt !< position of the element within its phase instance material_phaseMemberAt !< position of the element within its phase instance
! END NEW MAPPINGS ! END NEW MAPPINGS
! DEPRECATED: use material_phaseAt
integer, dimension(:,:,:), allocatable, public :: &
material_phase !< phase (index) of each grain,IP,element
type(tPlasticState), allocatable, dimension(:), public :: & type(tPlasticState), allocatable, dimension(:), public :: &
plasticState plasticState
type(tSourceState), allocatable, dimension(:), public :: & type(tSourceState), allocatable, dimension(:), public :: &
@ -180,9 +180,6 @@ module material
homogenization_active homogenization_active
! BEGIN DEPRECATED ! BEGIN DEPRECATED
integer, dimension(:,:,:), allocatable, public :: phaseAt !< phase ID of every material point (ipc,ip,el)
integer, dimension(:,:,:), allocatable, public :: phasememberAt !< memberID of given phase at every material point (ipc,ip,el)
integer, dimension(:,:,:), allocatable, public, target :: mappingHomogenization !< mapping from material points to offset in heterogenous state/field integer, dimension(:,:,:), allocatable, public, target :: mappingHomogenization !< mapping from material points to offset in heterogenous state/field
integer, dimension(:,:), allocatable, private, target :: mappingHomogenizationConst !< mapping from material points to offset in constant state/field integer, dimension(:,:), allocatable, private, target :: mappingHomogenizationConst !< mapping from material points to offset in constant state/field
! END DEPRECATED ! END DEPRECATED
@ -233,25 +230,18 @@ module material
material_parseMicrostructure, & material_parseMicrostructure, &
material_parseCrystallite, & material_parseCrystallite, &
material_parsePhase, & material_parsePhase, &
material_parseTexture, & material_parseTexture
material_populateGrains
contains contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses material configuration file !> @brief parses material configuration file
!> @details figures out if solverJobName.materialConfig is present, if not looks for
!> material.config
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_init subroutine material_init
integer, parameter :: FILEUNIT = 210 integer, parameter :: FILEUNIT = 210
integer :: m,c,h, myDebug, myPhase, myHomog integer :: i,e,m,c,h, myDebug, myPhase, myHomog, myMicro
integer :: &
g, & !< grain number
i, & !< integration point number
e !< element number
integer, dimension(:), allocatable :: & integer, dimension(:), allocatable :: &
CounterPhase, & CounterPhase, &
CounterHomogenization CounterHomogenization
@ -275,23 +265,27 @@ subroutine material_init
call material_parseTexture() call material_parseTexture()
if (iand(myDebug,debug_levelBasic) /= 0) write(6,'(a)') ' Texture parsed'; flush(6) if (iand(myDebug,debug_levelBasic) /= 0) write(6,'(a)') ' Texture parsed'; flush(6)
allocate(plasticState (size(config_phase))) material_Nphase = size(config_phase)
allocate(sourceState (size(config_phase))) material_Nhomogenization = size(config_homogenization)
do myPhase = 1,size(config_phase)
allocate(plasticState(material_Nphase))
allocate(sourceState (material_Nphase))
do myPhase = 1,material_Nphase
allocate(sourceState(myPhase)%p(phase_Nsources(myPhase))) allocate(sourceState(myPhase)%p(phase_Nsources(myPhase)))
enddo enddo
allocate(homogState (size(config_homogenization))) allocate(homogState (material_Nhomogenization))
allocate(thermalState (size(config_homogenization))) allocate(thermalState (material_Nhomogenization))
allocate(damageState (size(config_homogenization))) allocate(damageState (material_Nhomogenization))
allocate(thermalMapping (size(config_homogenization))) allocate(thermalMapping (material_Nhomogenization))
allocate(damageMapping (size(config_homogenization))) allocate(damageMapping (material_Nhomogenization))
allocate(temperature (size(config_homogenization))) allocate(temperature (material_Nhomogenization))
allocate(damage (size(config_homogenization))) allocate(damage (material_Nhomogenization))
allocate(temperatureRate (size(config_homogenization))) allocate(temperatureRate (material_Nhomogenization))
do m = 1,size(config_microstructure) do m = 1,size(config_microstructure)
if(microstructure_crystallite(m) < 1 .or. & if(microstructure_crystallite(m) < 1 .or. &
@ -311,17 +305,17 @@ subroutine material_init
write(6,'(/,a,/)') ' MATERIAL configuration' write(6,'(/,a,/)') ' MATERIAL configuration'
write(6,'(a32,1x,a16,1x,a6)') 'homogenization ','type ','grains' write(6,'(a32,1x,a16,1x,a6)') 'homogenization ','type ','grains'
do h = 1,size(config_homogenization) do h = 1,size(config_homogenization)
write(6,'(1x,a32,1x,a16,1x,i6)') homogenization_name(h),homogenization_type(h),homogenization_Ngrains(h) write(6,'(1x,a32,1x,a16,1x,i6)') config_name_homogenization(h),homogenization_type(h),homogenization_Ngrains(h)
enddo enddo
write(6,'(/,a14,18x,1x,a11,1x,a12,1x,a13)') 'microstructure','crystallite','constituents' write(6,'(/,a14,18x,1x,a11,1x,a12,1x,a13)') 'microstructure','crystallite','constituents'
do m = 1,size(config_microstructure) do m = 1,size(config_microstructure)
write(6,'(1x,a32,1x,i11,1x,i12)') microstructure_name(m), & write(6,'(1x,a32,1x,i11,1x,i12)') config_name_microstructure(m), &
microstructure_crystallite(m), & microstructure_crystallite(m), &
microstructure_Nconstituents(m) microstructure_Nconstituents(m)
if (microstructure_Nconstituents(m) > 0) then if (microstructure_Nconstituents(m) > 0) then
do c = 1,microstructure_Nconstituents(m) do c = 1,microstructure_Nconstituents(m)
write(6,'(a1,1x,a32,1x,a32,1x,f7.4)') '>',phase_name(microstructure_phase(c,m)),& write(6,'(a1,1x,a32,1x,a32,1x,f7.4)') '>',config_name_phase(microstructure_phase(c,m)),&
texture_name(microstructure_texture(c,m)),& config_name_texture(microstructure_texture(c,m)),&
microstructure_fraction(c,m) microstructure_fraction(c,m)
enddo enddo
write(6,*) write(6,*)
@ -329,10 +323,27 @@ subroutine material_init
enddo enddo
endif debugOut endif debugOut
call material_populateGrains
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! new mappings ! new mappings
allocate(material_phaseAt(homogenization_maxNgrains,discretization_nElem), source=0)
allocate(material_texture(homogenization_maxNgrains,discretization_nIP,discretization_nElem), source=0) !this is only needed by plasticity nonlocal
allocate(material_EulerAngles(3,homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0.0_pReal)
do e = 1, discretization_nElem
do i = 1, discretization_nIP
myMicro = discretization_microstructureAt(e)
do c = 1, homogenization_Ngrains(discretization_homogenizationAt(e))
material_phaseAt(c,e) = microstructure_phase(c,myMicro)
material_texture(c,i,e) = microstructure_texture(c,myMicro)
material_EulerAngles(1:3,c,i,e) = texture_Gauss(1:3,material_texture(c,i,e)) ! this is a copy of crystallite_orientation0
enddo
enddo
enddo
deallocate(microstructure_phase)
deallocate(microstructure_texture)
allocate(material_homogenizationAt,source=discretization_homogenizationAt) allocate(material_homogenizationAt,source=discretization_homogenizationAt)
allocate(material_homogenizationMemberAt(discretization_nIP,discretization_nElem),source=0) allocate(material_homogenizationMemberAt(discretization_nIP,discretization_nElem),source=0)
@ -345,8 +356,6 @@ subroutine material_init
enddo enddo
enddo enddo
allocate(material_phaseAt(homogenization_maxNgrains,discretization_nElem), source=material_phase(:,1,:))
allocate(material_phaseMemberAt(homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0) allocate(material_phaseMemberAt(homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0)
allocate(CounterPhase(size(config_phase)),source=0) allocate(CounterPhase(size(config_phase)),source=0)
@ -365,8 +374,8 @@ subroutine material_init
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
call results_openJobFile call results_openJobFile
call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,phase_name) call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,config_name_phase)
call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,homogenization_name) call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,config_name_homogenization)
call results_closeJobFile call results_closeJobFile
#endif #endif
@ -375,26 +384,15 @@ subroutine material_init
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! BEGIN DEPRECATED ! BEGIN DEPRECATED
allocate(phaseAt ( homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0)
allocate(phasememberAt ( homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0)
allocate(mappingHomogenization (2, discretization_nIP,discretization_nElem),source=0) allocate(mappingHomogenization (2, discretization_nIP,discretization_nElem),source=0)
allocate(mappingHomogenizationConst( discretization_nIP,discretization_nElem),source=1) allocate(mappingHomogenizationConst( discretization_nIP,discretization_nElem),source=1)
CounterHomogenization=0 CounterHomogenization=0
CounterPhase =0
do e = 1,discretization_nElem do e = 1,discretization_nElem
myHomog = discretization_homogenizationAt(e) myHomog = discretization_homogenizationAt(e)
do i = 1, discretization_nIP do i = 1, discretization_nIP
CounterHomogenization(myHomog) = CounterHomogenization(myHomog) + 1 CounterHomogenization(myHomog) = CounterHomogenization(myHomog) + 1
mappingHomogenization(1:2,i,e) = [CounterHomogenization(myHomog),huge(1)] mappingHomogenization(1:2,i,e) = [CounterHomogenization(myHomog),huge(1)]
do g = 1,homogenization_Ngrains(myHomog)
myPhase = material_phase(g,i,e)
CounterPhase(myPhase) = CounterPhase(myPhase)+1 ! not distinguishing between instances of same phase
phaseAt(g,i,e) = myPhase
phasememberAt(g,i,e) = CounterPhase(myPhase)
enddo
enddo enddo
enddo enddo
! END DEPRECATED ! END DEPRECATED
@ -555,7 +553,7 @@ subroutine material_parseMicrostructure
enddo enddo
enddo enddo
if (dNeq(sum(microstructure_fraction(:,m)),1.0_pReal)) call IO_error(153,ext_msg=microstructure_name(m)) if (dNeq(sum(microstructure_fraction(:,m)),1.0_pReal)) call IO_error(153,ext_msg=config_name_microstructure(m))
enddo enddo
@ -852,35 +850,4 @@ subroutine material_allocateSourceState(phase,of,NofMyPhase,&
end subroutine material_allocateSourceState end subroutine material_allocateSourceState
!--------------------------------------------------------------------------------------------------
!> @brief populates the grains
!> @details populates the grains by identifying active microstructure/homogenization pairs,
!! calculates the volume of the grains and deals with texture components
!--------------------------------------------------------------------------------------------------
subroutine material_populateGrains
integer :: e,i,c,homog,micro
allocate(material_phase(homogenization_maxNgrains,discretization_nIP,discretization_nElem), source=0)
allocate(material_texture(homogenization_maxNgrains,discretization_nIP,discretization_nElem), source=0)
allocate(material_EulerAngles(3,homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0.0_pReal)
do e = 1, discretization_nElem
do i = 1, discretization_nIP
homog = discretization_homogenizationAt(e)
micro = discretization_microstructureAt(e)
do c = 1, homogenization_Ngrains(homog)
material_phase(c,i,e) = microstructure_phase(c,micro)
material_texture(c,i,e) = microstructure_texture(c,micro)
material_EulerAngles(1:3,c,i,e) = texture_Gauss(1:3,material_texture(c,i,e))
enddo
enddo
enddo
deallocate(microstructure_phase)
deallocate(microstructure_texture)
end subroutine material_populateGrains
end module material end module material

View File

@ -291,7 +291,7 @@ program DAMASK_FEM
endif endif
timeinc = timeinc * real(subStepFactor,pReal)**real(-cutBackLevel,pReal) ! depending on cut back level, decrease time step timeinc = timeinc * real(subStepFactor,pReal)**real(-cutBackLevel,pReal) ! depending on cut back level, decrease time step
skipping: if (totalIncsCounter <= restartInc) then ! not yet at restart inc? skipping: if (totalIncsCounter <= interface_restartInc) then ! not yet at restart inc?
time = time + timeinc ! just advance time, skip already performed calculation time = time + timeinc ! just advance time, skip already performed calculation
guess = .true. guess = .true.
else skipping else skipping

View File

@ -8,11 +8,10 @@ module mesh
#include <petsc/finclude/petscdmplex.h> #include <petsc/finclude/petscdmplex.h>
#include <petsc/finclude/petscis.h> #include <petsc/finclude/petscis.h>
#include <petsc/finclude/petscdmda.h> #include <petsc/finclude/petscdmda.h>
use prec
use mesh_base
use PETScdmplex use PETScdmplex
use PETScdmda use PETScdmda
use PETScis use PETScis
use DAMASK_interface use DAMASK_interface
use IO use IO
use debug use debug
@ -20,6 +19,8 @@ module mesh
use numerics use numerics
use FEsolving use FEsolving
use FEM_Zoo use FEM_Zoo
use prec
use mesh_base
implicit none implicit none
private private
@ -35,13 +36,13 @@ module mesh
mesh_maxNips !< max number of IPs in any CP element mesh_maxNips !< max number of IPs in any CP element
!!!! BEGIN DEPRECATED !!!!! !!!! BEGIN DEPRECATED !!!!!
integer, dimension(:,:), allocatable, public, protected :: & integer, dimension(:,:), allocatable :: &
mesh_element !DEPRECATED mesh_element !DEPRECATED
real(pReal), dimension(:,:), allocatable, public :: & real(pReal), dimension(:,:), allocatable :: &
mesh_node !< node x,y,z coordinates (after deformation! ONLY FOR MARC!!!) mesh_node !< node x,y,z coordinates (after deformation! ONLY FOR MARC!!!)
real(pReal), dimension(:,:), allocatable, public, protected :: & real(pReal), dimension(:,:), allocatable :: &
mesh_ipVolume, & !< volume associated with IP (initially!) mesh_ipVolume, & !< volume associated with IP (initially!)
mesh_node0 !< node x,y,z coordinates (initially!) mesh_node0 !< node x,y,z coordinates (initially!)
@ -176,15 +177,13 @@ subroutine mesh_init
endif endif
enddo enddo
close (FILEUNIT) close (FILEUNIT)
endif
if (worldsize > 1) then
call DMPlexDistribute(globalMesh,0,sf,geomMesh,ierr)
CHKERRQ(ierr)
else
call DMClone(globalMesh,geomMesh,ierr) call DMClone(globalMesh,geomMesh,ierr)
CHKERRQ(ierr) CHKERRQ(ierr)
else
call DMPlexDistribute(globalMesh,0,sf,geomMesh,ierr)
CHKERRQ(ierr)
endif endif
call DMDestroy(globalMesh,ierr); CHKERRQ(ierr) call DMDestroy(globalMesh,ierr); CHKERRQ(ierr)
call DMGetStratumSize(geomMesh,'depth',dimPlex,mesh_NcpElems,ierr) call DMGetStratumSize(geomMesh,'depth',dimPlex,mesh_NcpElems,ierr)
@ -281,15 +280,6 @@ end subroutine mesh_FEM_build_ipVolumes
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Calculates IP Coordinates. Allocates global array 'mesh_ipCoordinates' !> @brief Calculates IP Coordinates. Allocates global array 'mesh_ipCoordinates'
! Called by all solvers in mesh_init in order to initialize the ip coordinates.
! Later on the current ip coordinates are directly prvided by the spectral solver and by Abaqus,
! so no need to use this subroutine anymore; Marc however only provides nodal displacements,
! so in this case the ip coordinates are always calculated on the basis of this subroutine.
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! FOR THE MOMENT THIS SUBROUTINE ACTUALLY CALCULATES THE CELL CENTER AND NOT THE IP COORDINATES,
! AS THE IP IS NOT (ALWAYS) LOCATED IN THE CENTER OF THE IP VOLUME.
! HAS TO BE CHANGED IN A LATER VERSION.
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine mesh_FEM_build_ipCoordinates(dimPlex,qPoints) subroutine mesh_FEM_build_ipCoordinates(dimPlex,qPoints)

View File

@ -497,7 +497,7 @@ subroutine mesh_marc_map_elements(tableStyle,nameElemSet,mapElemSet,nElems,fileF
mesh_mapFEtoCPelem(2,cpElem) = cpElem mesh_mapFEtoCPelem(2,cpElem) = cpElem
enddo enddo
call math_sort(mesh_mapFEtoCPelem,1,size(mesh_mapFEtoCPelem,2)) call math_sort(mesh_mapFEtoCPelem)
end subroutine mesh_marc_map_elements end subroutine mesh_marc_map_elements
@ -532,7 +532,7 @@ subroutine mesh_marc_map_nodes(nNodes,fileUnit)
endif endif
enddo enddo
620 call math_sort(mesh_mapFEtoCPnode,1,size(mesh_mapFEtoCPnode,2)) 620 call math_sort(mesh_mapFEtoCPnode)
end subroutine mesh_marc_map_nodes end subroutine mesh_marc_map_nodes

View File

@ -13,6 +13,7 @@ module plastic_disloUCLA
use material use material
use config use config
use lattice use lattice
use discretization
use results use results
implicit none implicit none
@ -295,7 +296,7 @@ subroutine plastic_disloUCLA_init()
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -15,9 +15,8 @@ module plastic_dislotwin
use material use material
use config use config
use lattice use lattice
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -139,14 +138,14 @@ module plastic_dislotwin
type :: tDislotwinMicrostructure type :: tDislotwinMicrostructure
real(pReal), dimension(:,:), allocatable :: & real(pReal), dimension(:,:), allocatable :: &
Lambda_sl, & !* mean free path between 2 obstacles seen by a moving dislocation Lambda_sl, & !< mean free path between 2 obstacles seen by a moving dislocation
Lambda_tw, & !* mean free path between 2 obstacles seen by a growing twin Lambda_tw, & !< mean free path between 2 obstacles seen by a growing twin
Lambda_tr, &!* mean free path between 2 obstacles seen by a growing martensite Lambda_tr, & !< mean free path between 2 obstacles seen by a growing martensite
tau_pass, & tau_pass, &
tau_hat_tw, & tau_hat_tw, &
tau_hat_tr, & tau_hat_tr, &
f_tw, & V_tw, & !< volume of a new twin
f_tr, & V_tr, & !< volume of a new martensite disc
tau_r_tw, & !< stress to bring partials close together (twin) tau_r_tw, & !< stress to bring partials close together (twin)
tau_r_tr !< stress to bring partials close together (trans) tau_r_tr !< stress to bring partials close together (trans)
end type tDislotwinMicrostructure end type tDislotwinMicrostructure
@ -278,7 +277,7 @@ subroutine plastic_dislotwin_init
prm%rho_mob_0 = math_expand(prm%rho_mob_0, prm%N_sl) prm%rho_mob_0 = math_expand(prm%rho_mob_0, prm%N_sl)
prm%rho_dip_0 = math_expand(prm%rho_dip_0, prm%N_sl) prm%rho_dip_0 = math_expand(prm%rho_dip_0, prm%N_sl)
prm%v0 = math_expand(prm%v0, prm%N_sl) prm%v0 = math_expand(prm%v0, prm%N_sl)
prm%b_sl = math_expand(prm%b_sl,prm%N_sl) prm%b_sl = math_expand(prm%b_sl, prm%N_sl)
prm%Delta_F = math_expand(prm%Delta_F, prm%N_sl) prm%Delta_F = math_expand(prm%Delta_F, prm%N_sl)
prm%CLambdaSlip = math_expand(prm%CLambdaSlip, prm%N_sl) prm%CLambdaSlip = math_expand(prm%CLambdaSlip, prm%N_sl)
prm%p = math_expand(prm%p, prm%N_sl) prm%p = math_expand(prm%p, prm%N_sl)
@ -322,7 +321,7 @@ subroutine plastic_dislotwin_init
prm%L_tw = config%getFloat('l0_twin') prm%L_tw = config%getFloat('l0_twin')
prm%i_tw = config%getFloat('cmfptwin') prm%i_tw = config%getFloat('cmfptwin')
prm%gamma_char = lattice_characteristicShear_Twin(prm%N_tw,config%getString('lattice_structure'),& prm%gamma_char= lattice_characteristicShear_Twin(prm%N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal)) config%getFloat('c/a',defaultVal=0.0_pReal))
prm%C66_tw = lattice_C66_twin(prm%N_tw,prm%C66,config%getString('lattice_structure'),& prm%C66_tw = lattice_C66_twin(prm%N_tw,prm%C66,config%getString('lattice_structure'),&
@ -339,9 +338,11 @@ subroutine plastic_dislotwin_init
prm%r = math_expand(prm%r,prm%N_tw) prm%r = math_expand(prm%r,prm%N_tw)
else else
allocate(prm%t_tw(0)) allocate(prm%gamma_char(0))
allocate(prm%b_tw(0)) allocate(prm%t_tw (0))
allocate(prm%r(0)) allocate(prm%b_tw (0))
allocate(prm%r (0))
allocate(prm%h_tw_tw (0,0))
endif endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -383,8 +384,10 @@ subroutine plastic_dislotwin_init
prm%s = config%getFloats('s_trans',defaultVal=[0.0_pReal]) prm%s = config%getFloats('s_trans',defaultVal=[0.0_pReal])
prm%s = math_expand(prm%s,prm%N_tr) prm%s = math_expand(prm%s,prm%N_tr)
else else
allocate(prm%t_tr(0)) allocate(prm%t_tr (0))
allocate(prm%b_tr(0)) allocate(prm%b_tr (0))
allocate(prm%s (0))
allocate(prm%h_tr_tr(0,0))
endif endif
if (sum(prm%N_tw) > 0 .or. prm%sum_N_tr > 0) then if (sum(prm%N_tw) > 0 .or. prm%sum_N_tr > 0) then
@ -452,42 +455,33 @@ subroutine plastic_dislotwin_init
do i= 1, size(outputs) do i= 1, size(outputs)
outputID = undefined_ID outputID = undefined_ID
select case(outputs(i)) select case(outputs(i))
case ('edge_density') case ('rho_mob')
outputID = merge(rho_mob_ID,undefined_ID,prm%sum_N_sl > 0) outputID = merge(rho_mob_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl outputSize = prm%sum_N_sl
case ('dipole_density') case ('rho_dip')
outputID = merge(rho_dip_ID,undefined_ID,prm%sum_N_sl > 0) outputID = merge(rho_dip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl outputSize = prm%sum_N_sl
case ('shear_rate_slip','shearrate_slip') case ('gamma_sl')
outputID = merge(dot_gamma_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl
case ('accumulated_shear_slip')
outputID = merge(gamma_sl_ID,undefined_ID,prm%sum_N_sl > 0) outputID = merge(gamma_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl outputSize = prm%sum_N_sl
case ('mfp_slip') case ('lambda_sl')
outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl > 0) outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl outputSize = prm%sum_N_sl
case ('resolved_stress_slip') case ('tau_pass')
outputID = merge(resolved_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl
case ('threshold_stress_slip')
outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0) outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0)
outputSize = prm%sum_N_sl outputSize = prm%sum_N_sl
case ('twin_fraction') case ('f_tw')
outputID = merge(f_tw_ID,undefined_ID,prm%sum_N_tw >0) outputID = merge(f_tw_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%sum_N_tw outputSize = prm%sum_N_tw
case ('mfp_twin') case ('lambda_tw')
outputID = merge(Lambda_tw_ID,undefined_ID,prm%sum_N_tw >0) outputID = merge(Lambda_tw_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%sum_N_tw outputSize = prm%sum_N_tw
case ('resolved_stress_twin') case ('tau_hat_tw')
outputID = merge(resolved_stress_twin_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%sum_N_tw
case ('threshold_stress_twin')
outputID = merge(tau_hat_tw_ID,undefined_ID,prm%sum_N_tw >0) outputID = merge(tau_hat_tw_ID,undefined_ID,prm%sum_N_tw >0)
outputSize = prm%sum_N_tw outputSize = prm%sum_N_tw
case ('strain_trans_fraction') case ('f_tr')
outputID = f_tr_ID outputID = f_tr_ID
outputSize = prm%sum_N_tr outputSize = prm%sum_N_tr
@ -503,7 +497,7 @@ subroutine plastic_dislotwin_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl & sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl &
+ size(['f_tw']) * prm%sum_N_tw & + size(['f_tw']) * prm%sum_N_tw &
+ size(['f_tr']) * prm%sum_N_tr + size(['f_tr']) * prm%sum_N_tr
@ -551,18 +545,18 @@ subroutine plastic_dislotwin_init
dot%f_tr=>plasticState(p)%dotState(startIndex:endIndex,:) dot%f_tr=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tr plasticState(p)%aTolState(startIndex:endIndex) = prm%aTol_f_tr
allocate(dst%Lambda_sl (prm%sum_N_sl, NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_sl (prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_pass (prm%sum_N_sl, NipcMyPhase),source=0.0_pReal) allocate(dst%tau_pass (prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
allocate(dst%Lambda_tw (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_tw (prm%sum_N_tw,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_hat_tw (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal) allocate(dst%tau_hat_tw (prm%sum_N_tw,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_r_tw (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal) allocate(dst%tau_r_tw (prm%sum_N_tw,NipcMyPhase),source=0.0_pReal)
allocate(dst%f_tw (prm%sum_N_tw, NipcMyPhase),source=0.0_pReal) allocate(dst%V_tw (prm%sum_N_tw,NipcMyPhase),source=0.0_pReal)
allocate(dst%Lambda_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal) allocate(dst%Lambda_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_hat_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal) allocate(dst%tau_hat_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_r_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal) allocate(dst%tau_r_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
allocate(dst%f_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal) allocate(dst%V_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
@ -590,9 +584,9 @@ function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
of of
real(pReal) :: f_unrotated real(pReal) :: f_unrotated
of = phasememberAt(ipc,ip,el) of = material_phasememberAt(ipc,ip,el)
associate(prm => param(phase_plasticityInstance(material_phase(ipc,ip,el))),& associate(prm => param(phase_plasticityInstance(material_phaseAt(ipc,el))),&
stt => state(phase_plasticityInstance(material_phase(ipc,ip,el)))) stt => state(phase_plasticityInstance(material_phaseAT(ipc,el))))
f_unrotated = 1.0_pReal & f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) & - sum(stt%f_tw(1:prm%sum_N_tw,of)) &
@ -742,9 +736,11 @@ subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
of of
integer :: i integer :: i
real(pReal) :: f_unrotated,& real(pReal) :: &
VacancyDiffusion,& f_unrotated, &
rho_dip_distance, ClimbVelocity, & VacancyDiffusion, &
rho_dip_distance, &
v_cl, &
tau tau
real(pReal), dimension(param(instance)%sum_N_sl) :: & real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_rho_dip_formation, & dot_rho_dip_formation, &
@ -757,7 +753,7 @@ subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
dot_gamma_tr dot_gamma_tr
associate(prm => param(instance), stt => state(instance), & associate(prm => param(instance), stt => state(instance), &
dot => dotstate(instance), dst => dependentState(instance)) dot => dotState(instance), dst => dependentState(instance))
f_unrotated = 1.0_pReal & f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) & - sum(stt%f_tw(1:prm%sum_N_tw,of)) &
@ -790,9 +786,9 @@ subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
if (dEq0(rho_dip_distance-rho_dip_distance_min(i))) then if (dEq0(rho_dip_distance-rho_dip_distance_min(i))) then
dot_rho_dip_climb(i) = 0.0_pReal dot_rho_dip_climb(i) = 0.0_pReal
else else
ClimbVelocity = 3.0_pReal*prm%mu*VacancyDiffusion*prm%atomicVolume(i) & v_cl = 3.0_pReal*prm%mu*VacancyDiffusion*prm%atomicVolume(i) &
/ (2.0_pReal*PI*kB*T*(rho_dip_distance+rho_dip_distance_min(i))) / (2.0_pReal*PI*kB*T*(rho_dip_distance+rho_dip_distance_min(i)))
dot_rho_dip_climb(i) = 4.0_pReal*ClimbVelocity*stt%rho_dip(i,of) & dot_rho_dip_climb(i) = 4.0_pReal*v_cl*stt%rho_dip(i,of) &
/ (rho_dip_distance-rho_dip_distance_min(i)) / (rho_dip_distance-rho_dip_distance_min(i))
endif endif
endif significantSlipStress endif significantSlipStress
@ -811,7 +807,7 @@ subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
dot%f_tw(:,of) = f_unrotated*dot_gamma_twin/prm%gamma_char dot%f_tw(:,of) = f_unrotated*dot_gamma_twin/prm%gamma_char
call kinetics_trans(Mp,T,dot_gamma_sl,instance,of,dot_gamma_tr) call kinetics_trans(Mp,T,dot_gamma_sl,instance,of,dot_gamma_tr)
dot%f_tw(:,of) = f_unrotated*dot_gamma_tr dot%f_tr(:,of) = f_unrotated*dot_gamma_tr
end associate end associate
@ -838,14 +834,13 @@ subroutine plastic_dislotwin_dependentState(T,instance,of)
inv_lambda_sl_tw, & !< 1/mean free distance between 2 twin stacks from different systems seen by a moving dislocation inv_lambda_sl_tw, & !< 1/mean free distance between 2 twin stacks from different systems seen by a moving dislocation
inv_lambda_sl_tr !< 1/mean free distance between 2 martensite lamellar from different systems seen by a moving dislocation inv_lambda_sl_tr !< 1/mean free distance between 2 martensite lamellar from different systems seen by a moving dislocation
real(pReal), dimension(param(instance)%sum_N_tw) :: & real(pReal), dimension(param(instance)%sum_N_tw) :: &
inv_lambda_tw_tw !< 1/mean free distance between 2 twin stacks from different systems seen by a growing twin inv_lambda_tw_tw, & !< 1/mean free distance between 2 twin stacks from different systems seen by a growing twin
f_over_t_tw
real(pReal), dimension(param(instance)%sum_N_tr) :: & real(pReal), dimension(param(instance)%sum_N_tr) :: &
inv_lambda_tr_tr !< 1/mean free distance between 2 martensite stacks from different systems seen by a growing martensite inv_lambda_tr_tr, & !< 1/mean free distance between 2 martensite stacks from different systems seen by a growing martensite
real(pReal), dimension(:), allocatable :: &
x0, &
f_over_t_tw, &
f_over_t_tr f_over_t_tr
real(pReal), dimension(:), allocatable :: &
x0
associate(prm => param(instance),& associate(prm => param(instance),&
@ -858,9 +853,9 @@ subroutine plastic_dislotwin_dependentState(T,instance,of)
SFE = prm%SFE_0K + prm%dSFE_dT * T SFE = prm%SFE_0K + prm%dSFE_dT * T
!* rescaled volume fraction for topology !* rescaled volume fraction for topology
f_over_t_tw = stt%f_tw(1:prm%sum_N_tw,of)/prm%t_tw !ToDo: this is per system f_over_t_tw = stt%f_tw(1:prm%sum_N_tw,of)/prm%t_tw ! this is per system ...
f_over_t_tr = sumf_trans/prm%t_tr !ToDo: But this not ... f_over_t_tr = sumf_trans/prm%t_tr ! but this not
!Todo: Physically ok, but naming could be adjusted ! ToDo ...Physically correct, but naming could be adjusted
forall (i = 1:prm%sum_N_sl) & forall (i = 1:prm%sum_N_sl) &
@ -872,26 +867,18 @@ subroutine plastic_dislotwin_dependentState(T,instance,of)
if (prm%sum_N_tw > 0 .and. prm%sum_N_sl > 0) & if (prm%sum_N_tw > 0 .and. prm%sum_N_sl > 0) &
inv_lambda_sl_tw = matmul(prm%h_sl_tw,f_over_t_tw)/(1.0_pReal-sumf_twin) inv_lambda_sl_tw = matmul(prm%h_sl_tw,f_over_t_tw)/(1.0_pReal-sumf_twin)
!ToDo: needed? if (prm%sum_N_tw > 0) &
inv_lambda_tw_tw = matmul(prm%h_tw_tw,f_over_t_tw)/(1.0_pReal-sumf_twin) inv_lambda_tw_tw = matmul(prm%h_tw_tw,f_over_t_tw)/(1.0_pReal-sumf_twin)
if (prm%sum_N_tr > 0 .and. prm%sum_N_sl > 0) & if (prm%sum_N_tr > 0 .and. prm%sum_N_sl > 0) &
inv_lambda_sl_tr = matmul(prm%h_sl_tr,f_over_t_tr)/(1.0_pReal-sumf_trans) inv_lambda_sl_tr = matmul(prm%h_sl_tr,f_over_t_tr)/(1.0_pReal-sumf_trans)
!ToDo: needed? if (prm%sum_N_tr > 0) &
inv_lambda_tr_tr = matmul(prm%h_tr_tr,f_over_t_tr)/(1.0_pReal-sumf_trans) inv_lambda_tr_tr = matmul(prm%h_tr_tr,f_over_t_tr)/(1.0_pReal-sumf_trans)
if ((prm%sum_N_tw > 0) .or. (prm%sum_N_tr > 0)) then ! ToDo: Change order if ((prm%sum_N_tw > 0) .or. (prm%sum_N_tr > 0)) then ! ToDo: better logic needed here
dst%Lambda_sl(:,of) = & dst%Lambda_sl(:,of) = prm%D &
prm%D/(1.0_pReal+prm%D*& / (1.0_pReal+prm%D*(inv_lambda_sl_sl + inv_lambda_sl_tw + inv_lambda_sl_tr))
(inv_lambda_sl_sl + inv_lambda_sl_tw + inv_lambda_sl_tr))
else else
dst%Lambda_sl(:,of) = prm%D & dst%Lambda_sl(:,of) = prm%D &
/ (1.0_pReal+prm%D*inv_lambda_sl_sl) !!!!!! correct? / (1.0_pReal+prm%D*inv_lambda_sl_sl) !!!!!! correct?
@ -906,16 +893,16 @@ subroutine plastic_dislotwin_dependentState(T,instance,of)
!* threshold stress for growing twin/martensite !* threshold stress for growing twin/martensite
if(prm%sum_N_tw == prm%sum_N_sl) & if(prm%sum_N_tw == prm%sum_N_sl) &
dst%tau_hat_tw(:,of) = & dst%tau_hat_tw(:,of) = SFE/(3.0_pReal*prm%b_tw) &
(SFE/(3.0_pReal*prm%b_tw)+ 3.0_pReal*prm%b_tw*prm%mu/(prm%L_tw*prm%b_sl)) ! slip burgers here correct? + 3.0_pReal*prm%b_tw*prm%mu/(prm%L_tw*prm%b_sl) ! slip burgers here correct?
if(prm%sum_N_tr == prm%sum_N_sl) & if(prm%sum_N_tr == prm%sum_N_sl) &
dst%tau_hat_tr(:,of) = & dst%tau_hat_tr(:,of) = SFE/(3.0_pReal*prm%b_tr) &
(SFE/(3.0_pReal*prm%b_tr) + 3.0_pReal*prm%b_tr*prm%mu/& + 3.0_pReal*prm%b_tr*prm%mu/(prm%L_tr*prm%b_sl) & ! slip burgers here correct?
(prm%L_tr*prm%b_sl) + prm%h*prm%gamma_fcc_hex/ (3.0_pReal*prm%b_tr) ) + prm%h*prm%gamma_fcc_hex/ (3.0_pReal*prm%b_tr)
dst%f_tw(:,of) = (PI/4.0_pReal)*prm%t_tw*dst%Lambda_tw(:,of)**2.0_pReal dst%V_tw(:,of) = (PI/4.0_pReal)*prm%t_tw*dst%Lambda_tw(:,of)**2.0_pReal
dst%f_tr(:,of) = (PI/4.0_pReal)*prm%t_tr*dst%Lambda_tr(:,of)**2.0_pReal dst%V_tr(:,of) = (PI/4.0_pReal)*prm%t_tr*dst%Lambda_tr(:,of)**2.0_pReal
x0 = prm%mu*prm%b_tw**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip and is the same for twin and trans x0 = prm%mu*prm%b_tw**2.0_pReal/(SFE*8.0_pReal*PI)*(2.0_pReal+prm%nu)/(1.0_pReal-prm%nu) ! ToDo: In the paper, this is the burgers vector for slip and is the same for twin and trans
@ -1174,12 +1161,11 @@ pure subroutine kinetics_twin(Mp,T,dot_gamma_sl,instance,of,&
isFCC: if (prm%fccTwinTransNucleation) then isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i) s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i) s2=prm%fcc_twinNucleationSlipPair(2,i)
if (tau(i) < dst%tau_r_tw(i,of)) then if (tau(i) < dst%tau_r_tw(i,of)) then ! ToDo: correct?
Ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+& Ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+&
abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state
(prm%L_tw*prm%b_sl(i))*& (prm%L_tw*prm%b_sl(i))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*& (1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tw(i,of)-tau(i)))) ! P_ncs
(dst%tau_r_tw(i,of)-tau)))
else else
Ndot0=0.0_pReal Ndot0=0.0_pReal
end if end if
@ -1190,7 +1176,7 @@ pure subroutine kinetics_twin(Mp,T,dot_gamma_sl,instance,of,&
significantStress: where(tau > tol_math_check) significantStress: where(tau > tol_math_check)
StressRatio_r = (dst%tau_hat_tw(:,of)/tau)**prm%r StressRatio_r = (dst%tau_hat_tw(:,of)/tau)**prm%r
dot_gamma_twin = prm%gamma_char * dst%f_tw(:,of) * Ndot0*exp(-StressRatio_r) dot_gamma_twin = prm%gamma_char * dst%V_tw(:,of) * Ndot0*exp(-StressRatio_r)
ddot_gamma_dtau = (dot_gamma_twin*prm%r/tau)*StressRatio_r ddot_gamma_dtau = (dot_gamma_twin*prm%r/tau)*StressRatio_r
else where significantStress else where significantStress
dot_gamma_twin = 0.0_pReal dot_gamma_twin = 0.0_pReal
@ -1232,7 +1218,6 @@ pure subroutine kinetics_trans(Mp,T,dot_gamma_sl,instance,of,&
ddot_gamma_dtau ddot_gamma_dtau
integer :: i,s1,s2 integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance)) associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_tr do i = 1, prm%sum_N_tr
@ -1240,12 +1225,11 @@ pure subroutine kinetics_trans(Mp,T,dot_gamma_sl,instance,of,&
isFCC: if (prm%fccTwinTransNucleation) then isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i) s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i) s2=prm%fcc_twinNucleationSlipPair(2,i)
if (tau(i) < dst%tau_r_tr(i,of)) then if (tau(i) < dst%tau_r_tr(i,of)) then ! ToDo: correct?
Ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+& Ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+&
abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/& ! ToDo: MD: it would be more consistent to use shearrates from state
(prm%L_tr*prm%b_sl(i))*& (prm%L_tr*prm%b_sl(i))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*& (1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tr(i,of)-tau(i)))) ! P_ncs
(dst%tau_r_tr(i,of)-tau)))
else else
Ndot0=0.0_pReal Ndot0=0.0_pReal
end if end if
@ -1256,8 +1240,8 @@ pure subroutine kinetics_trans(Mp,T,dot_gamma_sl,instance,of,&
significantStress: where(tau > tol_math_check) significantStress: where(tau > tol_math_check)
StressRatio_s = (dst%tau_hat_tr(:,of)/tau)**prm%s StressRatio_s = (dst%tau_hat_tr(:,of)/tau)**prm%s
dot_gamma_tr = dst%f_tr(:,of) * Ndot0*exp(-StressRatio_s) dot_gamma_tr = dst%V_tr(:,of) * Ndot0*exp(-StressRatio_s)
ddot_gamma_dtau = (dot_gamma_tr*prm%r/tau)*StressRatio_s ddot_gamma_dtau = (dot_gamma_tr*prm%s/tau)*StressRatio_s
else where significantStress else where significantStress
dot_gamma_tr = 0.0_pReal dot_gamma_tr = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal ddot_gamma_dtau = 0.0_pReal

View File

@ -14,9 +14,8 @@ module plastic_isotropic
use IO use IO
use material use material
use config use config
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -127,8 +126,8 @@ subroutine plastic_isotropic_init
config => config_phase(p)) config => config_phase(p))
#ifdef DEBUG #ifdef DEBUG
if (p==material_phase(debug_g,debug_i,debug_e)) & if (p==material_phaseAt(debug_g,debug_e)) &
prm%of_debug = phasememberAt(debug_g,debug_i,debug_e) prm%of_debug = material_phasememberAt(debug_g,debug_i,debug_e)
#endif #endif
prm%xi_0 = config%getFloat('tau0') prm%xi_0 = config%getFloat('tau0')
@ -190,7 +189,7 @@ subroutine plastic_isotropic_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['xi ','accumulated_shear']) sizeDotState = size(['xi ','accumulated_shear'])
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -13,9 +13,8 @@ module plastic_kinehardening
use material use material
use config use config
use lattice use lattice
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -146,8 +145,8 @@ subroutine plastic_kinehardening_init
config => config_phase(p)) config => config_phase(p))
#ifdef DEBUG #ifdef DEBUG
if (p==material_phase(debug_g,debug_i,debug_e)) then if (p==material_phaseAt(debug_g,debug_e)) then
prm%of_debug = phasememberAt(debug_g,debug_i,debug_e) prm%of_debug = material_phasememberAt(debug_g,debug_i,debug_e)
endif endif
#endif #endif
@ -257,7 +256,7 @@ subroutine plastic_kinehardening_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%totalNslip sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%totalNslip
sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%totalNslip sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%totalNslip
sizeState = sizeDotState + sizeDeltaState sizeState = sizeDotState + sizeDeltaState

View File

@ -6,6 +6,7 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module plastic_none module plastic_none
use material use material
use discretization
use debug use debug
implicit none implicit none
@ -36,7 +37,7 @@ subroutine plastic_none_init
do p = 1, size(phase_plasticity) do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
call material_allocatePlasticState(p,NipcMyPhase,0,0,0, & call material_allocatePlasticState(p,NipcMyPhase,0,0,0, &
0,0,0) 0,0,0)
plasticState(p)%sizePostResults = 0 plasticState(p)%sizePostResults = 0

View File

@ -556,7 +556,7 @@ subroutine plastic_nonlocal_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NofMyPhase=count(material_phase==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', & sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', &
'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', & 'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', &
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', & 'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
@ -677,7 +677,7 @@ subroutine plastic_nonlocal_init
allocate(iD(maxval(totalNslip),2,maxNinstances), source=0) allocate(iD(maxval(totalNslip),2,maxNinstances), source=0)
initializeInstances: do p = 1, size(phase_plasticity) initializeInstances: do p = 1, size(phase_plasticity)
NofMyPhase=count(material_phase==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then
!*** determine indices to state array !*** determine indices to state array
@ -766,7 +766,7 @@ subroutine plastic_nonlocal_init
! get the total volume of the instance ! get the total volume of the instance
do e = 1,discretization_nElem do e = 1,discretization_nElem
do i = 1,discretization_nIP do i = 1,discretization_nIP
if (material_phase(1,i,e) == phase) volume(phasememberAt(1,i,e)) = IPvolume(i,e) if (material_phaseAt(1,e) == phase) volume(material_phasememberAt(1,i,e)) = IPvolume(i,e)
enddo enddo
enddo enddo
totalVolume = sum(volume) totalVolume = sum(volume)
@ -854,29 +854,29 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el)
invConnections invConnections
real(pReal), dimension(3,nIPneighbors) :: & real(pReal), dimension(3,nIPneighbors) :: &
connection_latticeConf connection_latticeConf
real(pReal), dimension(2,totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & real(pReal), dimension(2,totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
rhoExcess rhoExcess
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
rho_edg_delta, & rho_edg_delta, &
rho_scr_delta rho_scr_delta
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),10) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),10) :: &
rho, & rho, &
rho_neighbor rho_neighbor
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))), & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))), &
totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
myInteractionMatrix ! corrected slip interaction matrix myInteractionMatrix ! corrected slip interaction matrix
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),nIPneighbors) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),nIPneighbors) :: &
rho_edg_delta_neighbor, & rho_edg_delta_neighbor, &
rho_scr_delta_neighbor rho_scr_delta_neighbor
real(pReal), dimension(2,maxval(totalNslip),nIPneighbors) :: & real(pReal), dimension(2,maxval(totalNslip),nIPneighbors) :: &
neighbor_rhoExcess, & ! excess density at neighboring material point neighbor_rhoExcess, & ! excess density at neighboring material point
neighbor_rhoTotal ! total density at neighboring material point neighbor_rhoTotal ! total density at neighboring material point
real(pReal), dimension(3,totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),2) :: & real(pReal), dimension(3,totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),2) :: &
m ! direction of dislocation motion m ! direction of dislocation motion
ph = phaseAt(1,ip,el) ph = material_phaseAt(1,el)
of = phasememberAt(1,ip,el) of = material_phasememberAt(1,ip,el)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst => microstructure(instance), stt => state(instance)) associate(prm => param(instance),dst => microstructure(instance), stt => state(instance))
@ -935,9 +935,9 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el)
do n = 1,nIPneighbors do n = 1,nIPneighbors
neighbor_el = IPneighborhood(1,n,ip,el) neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el) neighbor_ip = IPneighborhood(2,n,ip,el)
no = phasememberAt(1,neighbor_ip,neighbor_el) no = material_phasememberAt(1,neighbor_ip,neighbor_el)
if (neighbor_el > 0 .and. neighbor_ip > 0) then if (neighbor_el > 0 .and. neighbor_ip > 0) then
neighbor_instance = phase_plasticityInstance(material_phase(1,neighbor_ip,neighbor_el)) neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
if (neighbor_instance == instance) then if (neighbor_instance == instance) then
nRealNeighbors = nRealNeighbors + 1.0_pReal nRealNeighbors = nRealNeighbors + 1.0_pReal
@ -1202,22 +1202,22 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, &
of, & !offset of, & !offset
t, & !< dislocation type t, & !< dislocation type
s !< index of my current slip system s !< index of my current slip system
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),8) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),8) :: &
rhoSgl !< single dislocation densities (including blocked) rhoSgl !< single dislocation densities (including blocked)
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),10) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),10) :: &
rho rho
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),4) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),4) :: &
v, & !< velocity v, & !< velocity
tauNS, & !< resolved shear stress including non Schmid and backstress terms tauNS, & !< resolved shear stress including non Schmid and backstress terms
dv_dtau, & !< velocity derivative with respect to the shear stress dv_dtau, & !< velocity derivative with respect to the shear stress
dv_dtauNS !< velocity derivative with respect to the shear stress dv_dtauNS !< velocity derivative with respect to the shear stress
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
tau, & !< resolved shear stress including backstress terms tau, & !< resolved shear stress including backstress terms
gdotTotal !< shear rate gdotTotal !< shear rate
!*** shortcut for mapping !*** shortcut for mapping
ph = phaseAt(1,ip,el) ph = material_phaseAt(1,el)
of = phasememberAt(1,ip,el) of = material_phasememberAt(1,ip,el)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst=>microstructure(instance)) associate(prm => param(instance),dst=>microstructure(instance))
@ -1323,23 +1323,23 @@ subroutine plastic_nonlocal_deltaState(Mp,ip,el)
c, & ! character of dislocation c, & ! character of dislocation
t, & ! type of dislocation t, & ! type of dislocation
s ! index of my current slip system s ! index of my current slip system
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),10) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),10) :: &
deltaRhoRemobilization, & ! density increment by remobilization deltaRhoRemobilization, & ! density increment by remobilization
deltaRhoDipole2SingleStress ! density increment by dipole dissociation (by stress change) deltaRhoDipole2SingleStress ! density increment by dipole dissociation (by stress change)
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),10) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),10) :: &
rho ! current dislocation densities rho ! current dislocation densities
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),4) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),4) :: &
v ! dislocation glide velocity v ! dislocation glide velocity
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
tau ! current resolved shear stress tau ! current resolved shear stress
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),2) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),2) :: &
rhoDip, & ! current dipole dislocation densities (screw and edge dipoles) rhoDip, & ! current dipole dislocation densities (screw and edge dipoles)
dUpper, & ! current maximum stable dipole distance for edges and screws dUpper, & ! current maximum stable dipole distance for edges and screws
dUpperOld, & ! old maximum stable dipole distance for edges and screws dUpperOld, & ! old maximum stable dipole distance for edges and screws
deltaDUpper ! change in maximum stable dipole distance for edges and screws deltaDUpper ! change in maximum stable dipole distance for edges and screws
ph = phaseAt(1,ip,el) ph = material_phaseAt(1,el)
of = phasememberAt(1,ip,el) of = material_phasememberAt(1,ip,el)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst => microstructure(instance),del => deltaState(instance)) associate(prm => param(instance),dst => microstructure(instance),del => deltaState(instance))
@ -1459,7 +1459,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
np,& !< neighbour phase shortcut np,& !< neighbour phase shortcut
topp, & !< type of dislocation with opposite sign to t topp, & !< type of dislocation with opposite sign to t
s !< index of my current slip system s !< index of my current slip system
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),10) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),10) :: &
rho, & rho, &
rhoDot, & !< density evolution rhoDot, & !< density evolution
rhoDotMultiplication, & !< density evolution by multiplication rhoDotMultiplication, & !< density evolution by multiplication
@ -1467,24 +1467,24 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
rhoDotSingle2DipoleGlide, & !< density evolution by dipole formation (by glide) rhoDotSingle2DipoleGlide, & !< density evolution by dipole formation (by glide)
rhoDotAthermalAnnihilation, & !< density evolution by athermal annihilation rhoDotAthermalAnnihilation, & !< density evolution by athermal annihilation
rhoDotThermalAnnihilation !< density evolution by thermal annihilation rhoDotThermalAnnihilation !< density evolution by thermal annihilation
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),8) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),8) :: &
rhoSgl, & !< current single dislocation densities (positive/negative screw and edge without dipoles) rhoSgl, & !< current single dislocation densities (positive/negative screw and edge without dipoles)
neighbor_rhoSgl, & !< current single dislocation densities of neighboring ip (positive/negative screw and edge without dipoles) neighbor_rhoSgl, & !< current single dislocation densities of neighboring ip (positive/negative screw and edge without dipoles)
my_rhoSgl !< single dislocation densities of central ip (positive/negative screw and edge without dipoles) my_rhoSgl !< single dislocation densities of central ip (positive/negative screw and edge without dipoles)
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),4) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),4) :: &
v, & !< current dislocation glide velocity v, & !< current dislocation glide velocity
my_v, & !< dislocation glide velocity of central ip my_v, & !< dislocation glide velocity of central ip
neighbor_v, & !< dislocation glide velocity of enighboring ip neighbor_v, & !< dislocation glide velocity of enighboring ip
gdot !< shear rates gdot !< shear rates
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el)))) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el)))) :: &
tau, & !< current resolved shear stress tau, & !< current resolved shear stress
vClimb !< climb velocity of edge dipoles vClimb !< climb velocity of edge dipoles
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),2) :: & real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),2) :: &
rhoDip, & !< current dipole dislocation densities (screw and edge dipoles) rhoDip, & !< current dipole dislocation densities (screw and edge dipoles)
dLower, & !< minimum stable dipole distance for edges and screws dLower, & !< minimum stable dipole distance for edges and screws
dUpper !< current maximum stable dipole distance for edges and screws dUpper !< current maximum stable dipole distance for edges and screws
real(pReal), dimension(3,totalNslip(phase_plasticityInstance(material_phase(1,ip,el))),4) :: & real(pReal), dimension(3,totalNslip(phase_plasticityInstance(material_phaseAt(1,el))),4) :: &
m !< direction of dislocation motion m !< direction of dislocation motion
real(pReal), dimension(3,3) :: & real(pReal), dimension(3,3) :: &
my_F, & !< my total deformation gradient my_F, & !< my total deformation gradient
@ -1507,15 +1507,15 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
considerEnteringFlux, & considerEnteringFlux, &
considerLeavingFlux considerLeavingFlux
p = phaseAt(1,ip,el) p = material_phaseAt(1,el)
o = phasememberAt(1,ip,el) o = material_phasememberAt(1,ip,el)
if (timestep <= 0.0_pReal) then if (timestep <= 0.0_pReal) then
plasticState(p)%dotState = 0.0_pReal plasticState(p)%dotState = 0.0_pReal
return return
endif endif
ph = material_phase(1,ip,el) ph = material_phaseAt(1,el)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst => microstructure(instance),dot => dotState(instance),stt => state(instance)) associate(prm => param(instance),dst => microstructure(instance),dot => dotState(instance),stt => state(instance))
ns = totalNslip(instance) ns = totalNslip(instance)
@ -1592,7 +1592,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
!**************************************************************************** !****************************************************************************
!*** calculate dislocation fluxes (only for nonlocal plasticity) !*** calculate dislocation fluxes (only for nonlocal plasticity)
rhoDotFlux = 0.0_pReal rhoDotFlux = 0.0_pReal
if (.not. phase_localPlasticity(material_phase(1,ip,el))) then if (.not. phase_localPlasticity(material_phaseAt(1,el))) then
!*** check CFL (Courant-Friedrichs-Lewy) condition for flux !*** check CFL (Courant-Friedrichs-Lewy) condition for flux
if (any( abs(gdot) > 0.0_pReal & ! any active slip system ... if (any( abs(gdot) > 0.0_pReal & ! any active slip system ...
@ -1630,8 +1630,8 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
neighbor_el = IPneighborhood(1,n,ip,el) neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el) neighbor_ip = IPneighborhood(2,n,ip,el)
neighbor_n = IPneighborhood(3,n,ip,el) neighbor_n = IPneighborhood(3,n,ip,el)
np = phaseAt(1,neighbor_ip,neighbor_el) np = material_phaseAt(1,neighbor_el)
no = phasememberAt(1,neighbor_ip,neighbor_el) no = material_phasememberAt(1,neighbor_ip,neighbor_el)
opposite_neighbor = n + mod(n,2) - mod(n+1,2) opposite_neighbor = n + mod(n,2) - mod(n+1,2)
opposite_el = IPneighborhood(1,opposite_neighbor,ip,el) opposite_el = IPneighborhood(1,opposite_neighbor,ip,el)
@ -1639,7 +1639,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
opposite_n = IPneighborhood(3,opposite_neighbor,ip,el) opposite_n = IPneighborhood(3,opposite_neighbor,ip,el)
if (neighbor_n > 0) then ! if neighbor exists, average deformation gradient if (neighbor_n > 0) then ! if neighbor exists, average deformation gradient
neighbor_instance = phase_plasticityInstance(material_phase(1,neighbor_ip,neighbor_el)) neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
neighbor_Fe = Fe(1:3,1:3,1,neighbor_ip,neighbor_el) neighbor_Fe = Fe(1:3,1:3,1,neighbor_ip,neighbor_el)
neighbor_F = matmul(neighbor_Fe, Fp(1:3,1:3,1,neighbor_ip,neighbor_el)) neighbor_F = matmul(neighbor_Fe, Fp(1:3,1:3,1,neighbor_ip,neighbor_el))
Favg = 0.5_pReal * (my_F + neighbor_F) Favg = 0.5_pReal * (my_F + neighbor_F)
@ -1661,7 +1661,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
neighbor_v = 0.0_pReal ! needed for check of sign change in flux density below neighbor_v = 0.0_pReal ! needed for check of sign change in flux density below
neighbor_rhoSgl = 0.0_pReal neighbor_rhoSgl = 0.0_pReal
if (neighbor_n > 0) then if (neighbor_n > 0) then
if (phase_plasticity(material_phase(1,neighbor_ip,neighbor_el)) == PLASTICITY_NONLOCAL_ID & if (phase_plasticity(material_phaseAt(1,neighbor_el)) == PLASTICITY_NONLOCAL_ID &
.and. any(compatibility(:,:,:,n,ip,el) > 0.0_pReal)) & .and. any(compatibility(:,:,:,n,ip,el) > 0.0_pReal)) &
considerEnteringFlux = .true. considerEnteringFlux = .true.
endif endif
@ -1714,7 +1714,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, &
considerLeavingFlux = .true. considerLeavingFlux = .true.
if (opposite_n > 0) then if (opposite_n > 0) then
if (phase_plasticity(material_phase(1,opposite_ip,opposite_el)) /= PLASTICITY_NONLOCAL_ID) & if (phase_plasticity(material_phaseAt(1,opposite_el)) /= PLASTICITY_NONLOCAL_ID) &
considerLeavingFlux = .false. considerLeavingFlux = .false.
endif endif
@ -1905,20 +1905,20 @@ subroutine plastic_nonlocal_updateCompatibility(orientation,i,e)
s2 ! slip system index (my neighbor) s2 ! slip system index (my neighbor)
real(pReal), dimension(4) :: & real(pReal), dimension(4) :: &
absoluteMisorientation ! absolute misorientation (without symmetry) between me and my neighbor absoluteMisorientation ! absolute misorientation (without symmetry) between me and my neighbor
real(pReal), dimension(2,totalNslip(phase_plasticityInstance(material_phase(1,i,e))),& real(pReal), dimension(2,totalNslip(phase_plasticityInstance(material_phaseAt(1,e))),&
totalNslip(phase_plasticityInstance(material_phase(1,i,e))),& totalNslip(phase_plasticityInstance(material_phaseAt(1,e))),&
nIPneighbors) :: & nIPneighbors) :: &
my_compatibility ! my_compatibility for current element and ip my_compatibility ! my_compatibility for current element and ip
real(pReal) :: & real(pReal) :: &
my_compatibilitySum, & my_compatibilitySum, &
thresholdValue, & thresholdValue, &
nThresholdValues nThresholdValues
logical, dimension(totalNslip(phase_plasticityInstance(material_phase(1,i,e)))) :: & logical, dimension(totalNslip(phase_plasticityInstance(material_phaseAt(1,e)))) :: &
belowThreshold belowThreshold
type(rotation) :: rot type(rotation) :: rot
Nneighbors = nIPneighbors Nneighbors = nIPneighbors
ph = material_phase(1,i,e) ph = material_phaseAt(1,e)
textureID = material_texture(1,i,e) textureID = material_texture(1,i,e)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
ns = totalNslip(instance) ns = totalNslip(instance)
@ -1950,7 +1950,7 @@ subroutine plastic_nonlocal_updateCompatibility(orientation,i,e)
!* we consider this to be a real "physical" phase boundary, so completely incompatible. !* we consider this to be a real "physical" phase boundary, so completely incompatible.
!* If one of the two phases has a local plasticity law, !* If one of the two phases has a local plasticity law,
!* we do not consider this to be a phase boundary, so completely compatible. !* we do not consider this to be a phase boundary, so completely compatible.
neighbor_phase = material_phase(1,neighbor_i,neighbor_e) neighbor_phase = material_phaseAt(1,neighbor_e)
if (neighbor_phase /= ph) then if (neighbor_phase /= ph) then
if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph))& if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph))&
forall(s1 = 1:ns) my_compatibility(1:2,s1,s1,n) = 0.0_pReal forall(s1 = 1:ns) my_compatibility(1:2,s1,s1,n) = 0.0_pReal

View File

@ -12,9 +12,8 @@ module plastic_phenopowerlaw
use material use material
use config use config
use lattice use lattice
#if defined(PETSc) || defined(DAMASK_HDF5) use discretization
use results use results
#endif
implicit none implicit none
private private
@ -314,7 +313,7 @@ subroutine plastic_phenopowerlaw_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate state arrays ! allocate state arrays
NipcMyPhase = count(material_phase == p) NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['tau_slip ','gamma_slip']) * prm%totalNslip & sizeDotState = size(['tau_slip ','gamma_slip']) * prm%totalNslip &
+ size(['tau_twin ','gamma_twin']) * prm%totalNtwin + size(['tau_twin ','gamma_twin']) * prm%totalNtwin
sizeState = sizeDotState sizeState = sizeDotState

View File

@ -7,16 +7,15 @@
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine quit(stop_id) subroutine quit(stop_id)
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
#ifdef _OPENMP
use MPI, only: &
MPI_finalize
#endif
use PetscSys use PetscSys
#ifdef _OPENMP
use MPI
#endif
use hdf5 use hdf5
implicit none implicit none
integer, intent(in) :: stop_id integer, intent(in) :: stop_id
integer, dimension(8) :: dateAndTime ! type default integer integer, dimension(8) :: dateAndTime
integer :: error integer :: error
PetscErrorCode :: ierr = 0 PetscErrorCode :: ierr = 0

View File

@ -17,8 +17,7 @@ module results
private private
#if defined(PETSc) || defined(DAMASK_HDF5) #if defined(PETSc) || defined(DAMASK_HDF5)
integer(HID_T), public, protected :: tempCoordinates, tempResults integer(HID_T) :: resultsFile
integer(HID_T), private :: resultsFile, currentIncID, plist_id
interface results_writeDataset interface results_writeDataset

View File

@ -10,6 +10,7 @@ module source_damage_anisoBrittle
use IO use IO
use math use math
use material use material
use discretization
use config use config
use lattice use lattice
@ -164,7 +165,7 @@ subroutine source_damage_anisoBrittle_init
end associate end associate
phase = p phase = p
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_anisoBrittle_instance(phase) instance = source_damage_anisoBrittle_instance(phase)
sourceOffset = source_damage_anisoBrittle_offset(phase) sourceOffset = source_damage_anisoBrittle_offset(phase)
@ -202,8 +203,8 @@ subroutine source_damage_anisoBrittle_dotState(S, ipc, ip, el)
real(pReal) :: & real(pReal) :: &
traction_d, traction_t, traction_n, traction_crit traction_d, traction_t, traction_n, traction_crit
phase = phaseAt(ipc,ip,el) phase = material_phaseAt(ipc,el)
constituent = phasememberAt(ipc,ip,el) constituent = material_phasememberAt(ipc,ip,el)
instance = source_damage_anisoBrittle_instance(phase) instance = source_damage_anisoBrittle_instance(phase)
sourceOffset = source_damage_anisoBrittle_offset(phase) sourceOffset = source_damage_anisoBrittle_offset(phase)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)

View File

@ -9,6 +9,7 @@ module source_damage_anisoDuctile
use debug use debug
use IO use IO
use math use math
use discretization
use material use material
use config use config
@ -127,8 +128,7 @@ subroutine source_damage_anisoDuctile_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range ! exit if any parameter is out of range
if (extmsg /= '') & if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//SOURCE_DAMAGE_ANISODUCTILE_LABEL//')')
call IO_error(211,ext_msg=trim(extmsg)//'('//SOURCE_DAMAGE_ANISODUCTILE_LABEL//')')
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! output pararameters ! output pararameters
@ -151,7 +151,7 @@ subroutine source_damage_anisoDuctile_init
phase = p phase = p
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_anisoDuctile_instance(phase) instance = source_damage_anisoDuctile_instance(phase)
sourceOffset = source_damage_anisoDuctile_offset(phase) sourceOffset = source_damage_anisoDuctile_offset(phase)
@ -163,6 +163,7 @@ subroutine source_damage_anisoDuctile_init
end subroutine source_damage_anisoDuctile_init end subroutine source_damage_anisoDuctile_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculates derived quantities from state !> @brief calculates derived quantities from state
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -178,10 +179,10 @@ subroutine source_damage_anisoDuctile_dotState(ipc, ip, el)
sourceOffset, & sourceOffset, &
homog, damageOffset, & homog, damageOffset, &
instance, & instance, &
f, i i
phase = phaseAt(ipc,ip,el) phase = material_phaseAt(ipc,el)
constituent = phasememberAt(ipc,ip,el) constituent = material_phasememberAt(ipc,ip,el)
instance = source_damage_anisoDuctile_instance(phase) instance = source_damage_anisoDuctile_instance(phase)
sourceOffset = source_damage_anisoDuctile_offset(phase) sourceOffset = source_damage_anisoDuctile_offset(phase)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
@ -197,6 +198,7 @@ subroutine source_damage_anisoDuctile_dotState(ipc, ip, el)
end subroutine source_damage_anisoDuctile_dotState end subroutine source_damage_anisoDuctile_dotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns local part of nonlocal damage driving force !> @brief returns local part of nonlocal damage driving force
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -222,6 +224,7 @@ subroutine source_damage_anisoDuctile_getRateAndItsTangent(localphiDot, dLocalph
end subroutine source_damage_anisoDuctile_getRateAndItsTangent end subroutine source_damage_anisoDuctile_getRateAndItsTangent
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of local damage results !> @brief return array of local damage results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -251,6 +254,7 @@ function source_damage_anisoDuctile_postResults(phase, constituent)
end select end select
enddo enddo
end function source_damage_anisoDuctile_postResults end function source_damage_anisoDuctile_postResults
end module source_damage_anisoDuctile end module source_damage_anisoDuctile

View File

@ -9,6 +9,7 @@ module source_damage_isoBrittle
use debug use debug
use IO use IO
use math use math
use discretization
use material use material
use config use config
@ -133,7 +134,7 @@ subroutine source_damage_isoBrittle_init
phase = p phase = p
NofMyPhase=count(material_phase==phase) NofMyPhase = count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_isoBrittle_instance(phase) instance = source_damage_isoBrittle_instance(phase)
sourceOffset = source_damage_isoBrittle_offset(phase) sourceOffset = source_damage_isoBrittle_offset(phase)
@ -164,8 +165,8 @@ subroutine source_damage_isoBrittle_deltaState(C, Fe, ipc, ip, el)
strain(6), & strain(6), &
strainenergy strainenergy
phase = phaseAt(ipc,ip,el) !< phase ID at ipc,ip,el phase = material_phaseAt(ipc,el) !< phase ID at ipc,ip,el
constituent = phasememberAt(ipc,ip,el) !< state array offset for phase ID at ipc,ip,el constituent = material_phasememberAt(ipc,ip,el) !< state array offset for phase ID at ipc,ip,el
! ToDo: capability for multiple instances of SAME source within given phase. Needs Ninstance loop from here on! ! ToDo: capability for multiple instances of SAME source within given phase. Needs Ninstance loop from here on!
instance = source_damage_isoBrittle_instance(phase) !< instance of damage_isoBrittle source instance = source_damage_isoBrittle_instance(phase) !< instance of damage_isoBrittle source
sourceOffset = source_damage_isoBrittle_offset(phase) sourceOffset = source_damage_isoBrittle_offset(phase)

View File

@ -8,6 +8,7 @@ module source_damage_isoDuctile
use prec use prec
use debug use debug
use IO use IO
use discretization
use material use material
use config use config
@ -132,7 +133,7 @@ subroutine source_damage_isoDuctile_init
end associate end associate
phase = p phase = p
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phaseAt==phase) * discretization_nIP
instance = source_damage_isoDuctile_instance(phase) instance = source_damage_isoDuctile_instance(phase)
sourceOffset = source_damage_isoDuctile_offset(phase) sourceOffset = source_damage_isoDuctile_offset(phase)
@ -157,8 +158,8 @@ subroutine source_damage_isoDuctile_dotState(ipc, ip, el)
integer :: & integer :: &
phase, constituent, instance, homog, sourceOffset, damageOffset phase, constituent, instance, homog, sourceOffset, damageOffset
phase = phaseAt(ipc,ip,el) phase = material_phaseAt(ipc,el)
constituent = phasememberAt(ipc,ip,el) constituent = material_phasememberAt(ipc,ip,el)
instance = source_damage_isoDuctile_instance(phase) instance = source_damage_isoDuctile_instance(phase)
sourceOffset = source_damage_isoDuctile_offset(phase) sourceOffset = source_damage_isoDuctile_offset(phase)
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)

View File

@ -7,6 +7,7 @@
module source_thermal_dissipation module source_thermal_dissipation
use prec use prec
use debug use debug
use discretization
use material use material
use config use config
@ -75,7 +76,7 @@ subroutine source_thermal_dissipation_init
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
instance = source_thermal_dissipation_instance(p) instance = source_thermal_dissipation_instance(p)
param(instance)%kappa = config_phase(p)%getFloat('dissipation_coldworkcoeff') param(instance)%kappa = config_phase(p)%getFloat('dissipation_coldworkcoeff')
NofMyPhase=count(material_phase==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
sourceOffset = source_thermal_dissipation_offset(p) sourceOffset = source_thermal_dissipation_offset(p)
call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0) call material_allocateSourceState(p,sourceOffset,NofMyPhase,0,0,0)

View File

@ -7,6 +7,7 @@
module source_thermal_externalheat module source_thermal_externalheat
use prec use prec
use debug use debug
use discretization
use material use material
use config use config
@ -83,7 +84,7 @@ subroutine source_thermal_externalheat_init
if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle if (all(phase_source(:,p) /= SOURCE_thermal_externalheat_ID)) cycle
instance = source_thermal_externalheat_instance(p) instance = source_thermal_externalheat_instance(p)
sourceOffset = source_thermal_externalheat_offset(p) sourceOffset = source_thermal_externalheat_offset(p)
NofMyPhase=count(material_phase==p) NofMyPhase = count(material_phaseAt==p) * discretization_nIP
param(instance)%time = config_phase(p)%getFloats('externalheat_time') param(instance)%time = config_phase(p)%getFloats('externalheat_time')
param(instance)%nIntervals = size(param(instance)%time) - 1 param(instance)%nIntervals = size(param(instance)%time) - 1

Some files were not shown because too many files have changed in this diff Show More