1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/DAMASK_marc.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/DAMASK_marc.f90"
33 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/prec.f90" 1
43 use,
intrinsic :: ieee_arithmetic
49 integer,
parameter ::
preal = ieee_selected_real_kind(15,307)
51 integer,
parameter ::
pint = selected_int_kind(18)
55 integer,
parameter ::
plongint = selected_int_kind(18)
63 real(
preal),
dimension(:),
pointer :: p
67 integer,
dimension(:),
pointer :: p
73 sizestate = 0, & !< size of state
75 offsetdeltastate = 0, &
77 real(
preal),
pointer,
dimension(:),
contiguous :: &
79 real(
preal),
pointer,
dimension(:,:),
contiguous :: &
82 dotstate, & !< rate of state change
84 real(
preal),
allocatable,
dimension(:,:) :: &
89 real(
preal),
allocatable,
dimension(:,:,:) :: &
97 real(
preal),
pointer,
dimension(:,:) :: &
98 sliprate, & !< slip rate
103 type(
tstate),
dimension(:),
allocatable :: p
107 integer,
pointer,
dimension(:,:) :: p
113 integer,
dimension(0),
parameter :: &
115 real(
preal),
dimension(0),
parameter :: &
117 character(len=pStringLen),
dimension(0),
parameter :: &
131 write(6,
'(/,a)')
' <<<+- prec init -+>>>'
133 write(6,
'(a,i3)')
' Size of integer in bit: ',bit_size(0)
134 write(6,
'(a,i19)')
' Maximum value: ',huge(0)
135 write(6,
'(/,a,i3)')
' Size of float in bit: ',storage_size(0.0_preal)
136 write(6,
'(a,e10.3)')
' Maximum value: ',huge(0.0_preal)
137 write(6,
'(a,e10.3)')
' Minimum value: ',tiny(0.0_preal)
138 write(6,
'(a,i3)')
' Decimal precision: ',precision(0.0_preal)
151 logical elemental pure function dEq(a,b,tol)
153 real(
preal),
intent(in) :: a,b
154 real(
preal),
intent(in),
optional :: tol
157 if (
present(tol))
then
163 deq = merge(.true.,.false.,abs(a-b) <= eps)
174 logical elemental pure function
dneq(a,b,tol)
176 real(
preal),
intent(in) :: a,b
177 real(
preal),
intent(in),
optional :: tol
179 if (
present(tol))
then
194 logical elemental pure function
deq0(a,tol)
196 real(
preal),
intent(in) :: a
197 real(
preal),
intent(in),
optional :: tol
200 if (
present(tol))
then
206 deq0 = merge(.true.,.false.,abs(a) <= eps)
217 logical elemental pure function
dneq0(a,tol)
219 real(
preal),
intent(in) :: a
220 real(
preal),
intent(in),
optional :: tol
222 if (
present(tol))
then
238 logical elemental pure function
ceq(a,b,tol)
240 complex(pReal),
intent(in) :: a,b
241 real(
preal),
intent(in),
optional :: tol
244 if (
present(tol))
then
250 ceq = merge(.true.,.false.,abs(a-b) <= eps)
262 logical elemental pure function
cneq(a,b,tol)
264 complex(pReal),
intent(in) :: a,b
265 real(
preal),
intent(in),
optional :: tol
267 if (
present(tol))
then
281 integer,
allocatable,
dimension(:) :: realloc_lhs_test
282 real(
preal),
dimension(2) :: r
286 call random_number(r)
289 if(
deq(r(1),r(2)) .and.
dneq(r(1),r(2)))
call quit(9000)
292 realloc_lhs_test = [1,2]
293 if (any(realloc_lhs_test/=[1,2]))
call quit(9000)
298 # 29 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/DAMASK_marc.f90" 2
327 integer,
dimension(8) :: dateandtime
329 character(len=pPathLen) :: wd
331 write(6,
'(/,a)')
' <<<+- DAMASK_marc init -+>>>'
333 write(6,
'(/,a)')
' Roters et al., Computational Materials Science 158:420–478, 2019'
334 write(6,
'(a)')
' https://doi.org/10.1016/j.commatsci.2018.04.030'
336 write(6,
'(/,a)')
' Version: '//damaskversion
343 write(6,
'(/,a,i4.4,a,i8.8)')
' Compiled with Intel fortran version :', __intel_compiler,&
344 ', build date :', __intel_compiler_build_date
347 write(6,
'(/,a)')
' Compiled on: '//
"Apr 1 2020"//
' at '//
"18:44:55"
349 call date_and_time(values = dateandtime)
350 write(6,
'(/,a,2(i2.2,a),i4.4)')
' Date: ',dateandtime(3),
'/',dateandtime(2),
'/', dateandtime(1)
351 write(6,
'(a,2(i2.2,a),i2.2)')
' Time: ',dateandtime(5),
':', dateandtime(6),
':', dateandtime(7)
354 wd = wd(1:scan(wd,
'/',back=.true.))
357 write(6,
'(a20,a,a16)')
' working directory "',trim(wd),
'" does not exist'
371 character(1024) :: inputname
372 character(len=*),
parameter :: pathsep = achar(47)//achar(92)
376 inquire(5, name=inputname)
377 extpos = len_trim(inputname)-4
388 character(len=pStringLen) :: line
389 integer :: mystat,fileunit,s,e
392 status=
'old', position=
'rewind', action=
'read',iostat=mystat)
394 read (fileunit,
'(A)',
END=100) line
395 if(index(trim(
lc(line)),
'solver') == 1)
then
396 read (fileunit,
'(A)',
END=100) line
397 s = verify(line,
' ')
398 s = s + verify(line(s+1:),
' ')
399 e = s + scan(line(s+1:),
' ')
412 character(len=*),
intent(in) :: string
413 character(len=len(string)) ::
lc
415 character(26),
parameter :: lower =
'abcdefghijklmnopqrstuvwxyz'
416 character(26),
parameter :: upper =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
421 lc(i:i) = string(i:i)
422 n = index(upper,
lc(i:i))
423 if (n/=0)
lc(i:i) = lower(n:n)
433 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 1
440 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/IO.f90" 1
453 character(len=*),
parameter,
public :: &
454 io_eof =
'#EOF#', & !< end of file string
455 io_whitespace = achar(44)//achar(32)//achar(9)//achar(10)//achar(13)
456 character,
parameter,
public :: &
457 io_eol = new_line(
'DAMASK'), &
459 character(len=*),
parameter,
private :: &
461 '───────────────────'//&
462 '───────────────────'//&
486 write(6,
'(/,a)')
' <<<+- IO init -+>>>';
flush(6)
498 character(len=*),
intent(in) :: filename
500 character(len=pStringLen),
dimension(:),
allocatable :: filecontent
501 character(len=pStringLen) :: line
502 character(len=:),
allocatable :: rawdata
507 mytotallines, & !< # lines read from file
514 inquire(file = filename, size=filelength)
515 if (filelength == 0)
then
516 allocate(filecontent(0))
519 open(newunit=fileunit, file=filename, access=
'stream',&
520 status=
'old', position=
'rewind', action=
'read',iostat=mystat)
521 if(mystat /= 0)
call io_error(100,ext_msg=trim(filename))
522 allocate(
character(len=fileLength)::rawdata)
523 read(fileunit) rawdata
530 if (rawdata(l:l) ==
io_eol) mytotallines = mytotallines+1
532 allocate(filecontent(mytotallines))
539 do while (l <= mytotallines)
540 endpos = merge(startpos + scan(rawdata(startpos:),
io_eol) - 2,len(rawdata),l /= mytotallines)
542 line = rawdata(startpos:startpos+
pstringlen-1)
543 if (.not. warned)
then
544 call io_warning(207,ext_msg=trim(filename),el=l)
548 line = rawdata(startpos:endpos)
550 startpos = endpos + 2
552 filecontent(l) = line
565 character(len=*),
intent(in) :: filename
566 character,
intent(in),
optional :: mode
571 if (
present(mode))
then
579 status=
'replace',access=
'stream',action=
'write',iostat=ierr)
580 if (ierr /= 0)
call io_error(100,ext_msg=
'could not open file (w): '//trim(filename))
581 elseif(m ==
'r')
then
583 status=
'old', access=
'stream',action=
'read', iostat=ierr)
584 if (ierr /= 0)
call io_error(100,ext_msg=
'could not open file (r): '//trim(filename))
586 call io_error(100,ext_msg=
'unknown access mode: '//m)
597 character(len=*),
intent(in) :: string
599 integer :: posnonblank
610 pure function io_gettag(string,openChar,closeChar)
612 character(len=*),
intent(in) :: string
613 character,
intent(in) :: openchar, & !< indicates beginning of tag
615 character(len=:),
allocatable ::
io_gettag
617 integer :: left,right
619 left = scan(string,openchar)
620 right = merge(scan(string,closechar), &
621 left + merge(scan(string(left+1:),openchar),0,len(string) > left), &
622 openchar /= closechar)
624 foundtag:
if (left == verify(string,
io_whitespace) .and. right > left)
then
641 character(len=*),
intent(in) :: string
644 integer :: left, right
655 endofstring:
if (right < left)
then
669 character(len=*),
intent(in) :: string
670 integer,
dimension(:),
intent(in) :: chunkpos
671 integer,
intent(in) :: mychunk
674 validchunk:
if (mychunk > chunkpos(1) .or. mychunk < 1)
then
676 call io_error(110,el=mychunk,ext_msg=
'IO_stringValue: "'//trim(string)//
'"')
678 io_stringvalue = string(chunkpos(mychunk*2):chunkpos(mychunk*2+1))
687 integer function io_intvalue(string,chunkPos,myChunk)
689 character(len=*),
intent(in) :: string
690 integer,
dimension(:),
intent(in) :: chunkpos
691 integer,
intent(in) :: mychunk
703 character(len=*),
intent(in) :: string
704 integer,
dimension(:),
intent(in) :: chunkpos
705 integer,
intent(in) :: mychunk
715 pure function io_lc(string)
717 character(len=*),
intent(in) :: string
718 character(len=len(string)) ::
io_lc
720 character(len=*),
parameter :: lower =
'abcdefghijklmnopqrstuvwxyz'
721 character(len=len(LOWER)),
parameter :: upper =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
726 n = index(upper,string(i:i))
728 io_lc(i:i) = lower(n:n)
730 io_lc(i:i) = string(i:i)
740 subroutine io_error(error_ID,el,ip,g,instance,ext_msg)
742 integer,
intent(in) :: error_id
743 integer,
optional,
intent(in) :: el,ip,g,instance
744 character(len=*),
optional,
intent(in) :: ext_msg
747 character(len=pStringLen) :: msg
748 character(len=pStringLen) :: formatstring
750 select case (error_id)
755 msg =
'internal check failed:'
760 msg =
'could not open file:'
762 msg =
'write error for file:'
764 msg =
'could not read file:'
766 msg =
'could not assemble input files'
768 msg =
'working directory does not exist:'
773 msg =
'invalid chunk selected'
775 msg =
'invalid character for int:'
777 msg =
'invalid character for float:'
782 msg =
'unknown lattice structure encountered'
784 msg =
'hex lattice structure with invalid c/a ratio'
786 msg =
'trans_lattice_structure not possible'
788 msg =
'transformed hex lattice structure with invalid c/a ratio'
790 msg =
'negative lattice parameter'
792 msg =
'zero entry on stiffness diagonal'
794 msg =
'zero entry on stiffness diagonal for transformed phase'
796 msg =
'not defined for lattice structure'
798 msg =
'not enough interaction parameters given'
803 msg =
'key not found'
805 msg =
'number of chunks in string differs'
809 msg =
'no value found for key'
811 msg =
'negative number systems requested'
813 msg =
'too many systems requested'
815 msg =
'number of values does not match'
817 msg =
'not supported anymore'
819 msg =
'Nconstituents mismatch between homogenization and microstructure'
824 msg =
'index out of bounds'
826 msg =
'microstructure has no constituents'
828 msg =
'sum of phase fractions differs from 1'
830 msg =
'homogenization index out of bounds'
832 msg =
'microstructure index out of bounds'
834 msg =
'invalid texture transformation specified'
836 msg =
'no entries in config part'
838 msg =
'config part found twice'
840 msg =
'homogenization configuration'
842 msg =
'no homogenization specified via State Variable 2'
844 msg =
'no microstructure specified via State Variable 3'
846 msg =
'unknown element type:'
848 msg =
'mesh consists of more than one element type'
853 msg =
'unknown elasticity specified:'
855 msg =
'unknown plasticity specified:'
858 msg =
'unknown material parameter:'
860 msg =
'material parameter out of bounds:'
865 msg =
'unknown numerics parameter:'
867 msg =
'numerics parameter out of bounds:'
872 msg =
'matrix inversion error'
874 msg =
'error in Eigenvalue calculation'
876 msg =
'invalid orientation specified'
881 msg =
'unknown homogenization specified'
886 msg =
'Ping-Pong not possible when using non-DAMASK elements'
888 msg =
'Ping-Pong needed when using non-local plasticity'
890 msg =
'invalid selection for debug'
895 msg =
'initializing FFTW'
897 msg =
'FFTW plan creation'
899 msg =
'mask consistency violated in grid load case'
901 msg =
'ill-defined L (line partly defined) in grid load case'
903 msg =
'negative time increment in grid load case'
905 msg =
'non-positive increments in grid load case'
907 msg =
'non-positive result frequency in grid load case'
909 msg =
'incomplete loadcase'
911 msg =
'mixed boundary conditions allow rotation'
913 msg =
'non-positive restart frequency in grid load case'
915 msg =
'missing header length info in grid mesh'
917 msg =
'incomplete information in grid mesh header'
919 msg =
'microstructure count mismatch'
921 msg =
'rotation for load case rotation ill-defined (R:RT != I)'
923 msg =
'unknown solver type selected'
925 msg =
'unknown filter type selected'
933 msg =
'unknown error number...'
939 write(0,
'(a,24x,a,40x,a)')
' │',
'error',
'│'
940 write(0,
'(a,24x,i3,42x,a)')
' │',error_id,
'│'
942 write(formatstring,
'(a,i6.6,a,i6.6,a)')
'(1x,a4,a',max(1,len_trim(msg)),
',',&
943 max(1,72-len_trim(msg)-4),
'x,a)'
944 write(0,formatstring)
'│ ',trim(msg),
'│'
945 if (
present(ext_msg))
then
946 write(formatstring,
'(a,i6.6,a,i6.6,a)')
'(1x,a4,a',max(1,len_trim(ext_msg)),
',',&
947 max(1,72-len_trim(ext_msg)-4),
'x,a)'
948 write(0,formatstring)
'│ ',trim(ext_msg),
'│'
951 write(0,
'(a19,1x,i9,44x,a3)')
' │ at element ',el,
'│'
953 write(0,
'(a19,1x,i9,44x,a3)')
' │ at IP ',ip,
'│'
955 write(0,
'(a19,1x,i9,44x,a3)')
' │ at constituent',g,
'│'
956 if (
present(instance)) &
957 write(0,
'(a19,1x,i9,44x,a3)')
' │ at instance ',instance,
'│'
958 write(0,
'(a,69x,a)')
' │',
'│'
961 call quit(9000+error_id)
970 subroutine io_warning(warning_ID,el,ip,g,ext_msg)
972 integer,
intent(in) :: warning_id
973 integer,
optional,
intent(in) :: el,ip,g
974 character(len=*),
optional,
intent(in) :: ext_msg
976 character(len=pStringLen) :: msg
977 character(len=pStringLen) :: formatstring
979 select case (warning_id)
983 msg =
'invalid restart increment given'
985 msg =
'could not get $DAMASK_NUM_THREADS'
987 msg =
'found spectral solver parameter'
989 msg =
'parameter has no effect'
991 msg =
'main diagonal of C66 close to zero'
993 msg =
'no valid parameter for FFTW, using FFTW_PATIENT'
995 msg =
'not all available slip system families are defined'
997 msg =
'not all available twin system families are defined'
999 msg =
'not all available parameters are defined'
1001 msg =
'not all available transformation system families are defined'
1003 msg =
'crystallite debugging off'
1005 msg =
'position not found when parsing line'
1007 msg =
'line truncated'
1009 msg =
'crystallite responds elastically'
1011 msg =
'stiffness close to zero'
1013 msg =
'polar decomposition failed'
1015 msg =
'unknown crystal symmetry'
1017 msg =
'max number of cut back exceeded, terminating'
1019 msg =
'unknown warning number'
1024 write(6,
'(a,24x,a,38x,a)')
' │',
'warning',
'│'
1025 write(6,
'(a,24x,i3,42x,a)')
' │',warning_id,
'│'
1027 write(formatstring,
'(a,i6.6,a,i6.6,a)')
'(1x,a4,a',max(1,len_trim(msg)),
',',&
1028 max(1,72-len_trim(msg)-4),
'x,a)'
1029 write(6,formatstring)
'│ ',trim(msg),
'│'
1030 if (
present(ext_msg))
then
1031 write(formatstring,
'(a,i6.6,a,i6.6,a)')
'(1x,a4,a',max(1,len_trim(ext_msg)),
',',&
1032 max(1,72-len_trim(ext_msg)-4),
'x,a)'
1033 write(6,formatstring)
'│ ',trim(ext_msg),
'│'
1036 write(6,
'(a19,1x,i9,44x,a3)')
' │ at element ',el,
'│'
1038 write(6,
'(a19,1x,i9,44x,a3)')
' │ at IP ',ip,
'│'
1040 write(6,
'(a19,1x,i9,44x,a3)')
' │ at constituent',g,
'│'
1041 write(6,
'(a,69x,a)')
' │',
'│'
1057 character(len=*),
intent(in) :: string
1059 integer :: readstatus
1060 character(len=*),
parameter :: validchars =
'0123456789+- '
1062 valid:
if (verify(string,validchars) == 0)
then
1064 if (readstatus /= 0)
call io_error(111,ext_msg=string)
1078 character(len=*),
intent(in) :: string
1080 integer :: readstatus
1081 character(len=*),
parameter :: validchars =
'0123456789eE.+- '
1083 valid:
if (verify(string,validchars) == 0)
then
1085 if (readstatus /= 0)
call io_error(112,ext_msg=string)
1099 integer,
dimension(:),
allocatable :: chunkPos
1100 character(len=:),
allocatable :: str
1129 # 7 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
1131 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90" 1
1150 integer,
protected,
public :: &
1156 integer(4),
protected,
public :: &
1163 logical,
protected,
public :: &
1175 integer,
protected,
public :: &
1176 itmax = 250, & !< maximum number of iterations
1183 # 65 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1187 # 77 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1200 integer :: i,j, ierr
1201 integer,
allocatable,
dimension(:) :: chunkpos
1202 character(len=pStringLen),
dimension(:),
allocatable :: filecontent
1203 character(len=pStringLen) :: &
1213 write(6,
'(/,a)')
' <<<+- numerics init -+>>>'
1225 inquire(file=
'numerics.config', exist=fexist)
1227 fileexists:
if (fexist)
then
1228 write(6,
'(a,/)')
' using values from config file'
1231 do j=1,
size(filecontent)
1235 line = filecontent(j)
1237 if(line(i:i) ==
'=') line(i:i) =
' '
1244 case (
'defgradtolerance')
1246 case (
'ijacostiffness')
1250 case (
'usepingpong')
1257 case (
'random_seed',
'fixed_seed')
1264 case (
'residualstiffness')
1269 case (
'err_struct_tolabs')
1271 case (
'err_struct_tolrel')
1273 case (
'err_thermal_tolabs')
1275 case (
'err_thermal_tolrel')
1277 case (
'err_damage_tolabs')
1279 case (
'err_damage_tolrel')
1287 case (
'maxstaggerediter')
1292 # 201 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1296 # 214 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1300 write(6,
'(a,/)')
' using standard values'
1310 write(6,
'(a24,1x,L8)')
' use ping pong scheme: ',
usepingpong
1315 write(6,
'(a16,1x,i16,/)')
' random_seed: ',
randomseed
1317 write(6,
'(a,/)')
' random seed will be generated!'
1321 write(6,
'(a24,1x,es8.1)')
' charLength: ',
charlength
1330 write(6,
'(a24,1x,i8)')
' itmax: ',
itmax
1331 write(6,
'(a24,1x,i8)')
' itmin: ',
itmin
1332 write(6,
'(a24,1x,i8)')
' maxCutBack: ',
maxcutback
1333 write(6,
'(a24,1x,i8)')
' maxStaggeredIter: ',
stagitmax
1343 # 271 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1359 call io_error(301,ext_msg=
'integrator')
1372 # 311 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/numerics.f90"
1377 # 8 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
1379 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/debug.f90" 1
1394 integer,
parameter,
public :: &
1398 integer,
parameter,
private :: &
1400 integer,
parameter,
public :: &
1407 integer,
parameter,
public :: &
1420 integer,
parameter,
private :: &
1423 integer,
protected,
dimension(debug_maxNtype+2),
public :: &
1426 integer,
protected,
public :: &
1431 integer,
dimension(2),
public :: &
1460 character(len=pStringLen),
dimension(:),
allocatable :: filecontent
1462 integer :: i, what, j
1463 integer,
allocatable,
dimension(:) :: chunkpos
1464 character(len=pStringLen) :: tag, line
1467 write(6,
'(/,a)')
' <<<+- debug init -+>>>'
1473 inquire(file=
'debug.config', exist=fexist)
1475 fileexists:
if (fexist)
then
1477 do j=1,
size(filecontent)
1478 line = filecontent(j)
1483 case (
'element',
'e',
'el')
1485 case (
'integrationpoint',
'i',
'ip')
1487 case (
'grain',
'g',
'gr')
1497 case (
'fesolving',
'fe')
1505 case (
'constitutive')
1507 case (
'crystallite')
1509 case (
'homogenization')
1523 do i = 2, chunkpos(1)
1554 write(6,
'(a,/)')
' using values from config file'
1557 write(6,
'(a,/)')
' using standard values'
1578 tag =
' Constitutive'
1580 tag =
' Crystallite'
1582 tag =
' Homogenizaiton'
1586 tag =
' Spectral solver'
1588 tag =
' MSC.MARC FEM solver'
1592 write(6,
'(3a)')
' debug level for ', trim(tag),
':'
1596 write(6,
'(a)')
' selective on:'
1597 write(6,
'(a24,1x,i8)')
' element: ',
debug_e
1598 write(6,
'(a24,1x,i8)')
' ip: ',
debug_i
1599 write(6,
'(a24,1x,i8)')
' grain: ',
debug_g
1639 write(6,
'(2/,a,/)')
' Extreme values of returned stress and Jacobian'
1640 write(6,
'(a39)')
' value el ip'
1644 write(6,
'(a14,1x,e12.3,1x,i8,1x,i4,/)')
' max :',
debug_jacobianmax,
debug_jacobianmaxlocation
1645 endif debugoutputcpfem
1651 # 9 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
1653 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/list.f90" 1
1665 character(len=:),
allocatable :: val
1666 integer,
dimension(:),
allocatable :: pos
1704 subroutine add(this,string)
1707 character(len=*),
intent(in) :: string
1714 do while (
associated(temp%next))
1717 temp%string%val =
io_lc(trim(string))
1728 subroutine show(this)
1734 do while (
associated(item%next))
1735 write(6,
'(a)')
' '//trim(item%string%val)
1746 subroutine free(this)
1750 if(
associated(this%next))
deallocate(this%next)
1759 recursive subroutine finalize(this)
1763 if(
associated(this%next))
deallocate(this%next)
1779 if (
associated(this(i)%next))
then
1780 temp => this(i)%next
1795 character(len=*),
intent(in) :: key
1801 do while (
associated(item%next) .and. .not.
keyexists)
1816 character(len=*),
intent(in) :: key
1822 do while (
associated(item%next))
1823 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key)) &
1836 real(pReal) function getfloat(this,key,defaultVal)
1839 character(len=*),
intent(in) :: key
1840 real(
preal),
intent(in),
optional :: defaultval
1845 found =
present(defaultval)
1849 do while (
associated(item%next))
1850 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
1852 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
1858 if (.not. found)
call io_error(140,ext_msg=key)
1868 integer function getint(this,key,defaultVal)
1871 character(len=*),
intent(in) :: key
1872 integer,
intent(in),
optional :: defaultval
1877 found =
present(defaultval)
1878 if (found)
getint = defaultval
1881 do while (
associated(item%next))
1882 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
1884 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
1890 if (.not. found)
call io_error(140,ext_msg=key)
1901 character(len=pStringLen) function getstring(this,key,defaultVal,raw)
1904 character(len=*),
intent(in) :: key
1905 character(len=*),
intent(in),
optional :: defaultval
1906 logical,
intent(in),
optional :: raw
1910 if (
present(raw))
then
1916 found =
present(defaultval)
1923 do while (
associated(item%next))
1924 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
1926 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
1929 getstring = trim(item%string%val(item%string%pos(4):))
1937 if (.not. found)
call io_error(140,ext_msg=key)
1947 function getfloats(this,key,defaultVal,requiredSize)
1951 character(len=*),
intent(in) :: key
1952 real(
preal),
dimension(:),
intent(in),
optional :: defaultval
1953 integer,
intent(in),
optional :: requiredsize
1959 cumulative = (key(1:1) ==
'(' .and. key(len_trim(key):len_trim(key)) ==
')')
1965 do while (
associated(item%next))
1966 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
1969 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
1970 do i = 2, item%string%pos(1)
1977 if (.not. found)
then
1978 if (
present(defaultval)) then;
getfloats = defaultval; else;
call io_error(140,ext_msg=key);
endif
1980 if (
present(requiredsize))
then
1992 function getints(this,key,defaultVal,requiredSize)
1994 integer,
dimension(:),
allocatable ::
getints
1996 character(len=*),
intent(in) :: key
1997 integer,
dimension(:),
intent(in),
optional :: defaultval
1998 integer,
intent(in),
optional :: requiredsize
2004 cumulative = (key(1:1) ==
'(' .and. key(len_trim(key):len_trim(key)) ==
')')
2010 do while (
associated(item%next))
2011 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
2013 if (.not. cumulative)
getints = [
integer::]
2014 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
2015 do i = 2, item%string%pos(1)
2022 if (.not. found)
then
2023 if (
present(defaultval)) then;
getints = defaultval; else;
call io_error(140,ext_msg=key);
endif
2025 if (
present(requiredsize))
then
2040 character(len=pStringLen),
dimension(:),
allocatable ::
getstrings
2042 character(len=*),
intent(in) :: key
2043 character(len=*),
dimension(:),
intent(in),
optional :: defaultval
2044 logical,
intent(in),
optional :: raw
2046 character(len=pStringLen) :: str
2052 cumulative = (key(1:1) ==
'(' .and. key(len_trim(key):len_trim(key)) ==
')')
2053 if (
present(raw))
then
2061 do while (
associated(item%next))
2062 if (trim(
io_stringvalue(item%string%val,item%string%pos,1)) == trim(key))
then
2065 if (item%string%pos(1) < 2)
call io_error(143,ext_msg=key)
2067 notallocated:
if (.not.
allocated(
getstrings))
then
2069 str = item%string%val(item%string%pos(4):)
2074 do i=3,item%string%pos(1)
2081 str = item%string%val(item%string%pos(4):)
2084 do i=2,item%string%pos(1)
2094 if (.not. found)
then
2095 if (
present(defaultval))
then
2107 # 10 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
2109 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/future.f90" 1
2128 integer,
intent(in),
dimension(:) :: a
2129 integer,
intent(in) :: v
2131 integer,
allocatable,
dimension(:) ::
findloc
2133 allocate(
findloc(count(a==v)))
2145 # 11 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
2147 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/config.f90" 1
2177 character(len=pStringLen),
public,
protected,
allocatable,
dimension(:) :: &
2198 character(len=pStringLen) :: &
2201 character(len=pStringLen),
dimension(:),
allocatable :: filecontent
2202 logical :: fileexists
2204 write(6,
'(/,a)')
' <<<+- config init -+>>>';
flush(6)
2210 write(6,
'(/,a)')
' reading '//trim(
getsolverjobname())//
'.materialConfig';
flush(6)
2213 inquire(file=
'material.config',exist=fileexists)
2214 if(.not. fileexists)
call io_error(100,ext_msg=
'material.config')
2215 write(6,
'(/,a)')
' reading material.config';
flush(6)
2219 do i = 1,
size(filecontent)
2220 line = trim(filecontent(i))
2222 select case (trim(part))
2224 case (trim(
'phase'))
2226 if (verbose)
write(6,
'(a)')
' Phase parsed';
flush(6)
2228 case (trim(
'microstructure'))
2230 if (verbose)
write(6,
'(a)')
' Microstructure parsed';
flush(6)
2232 case (trim(
'crystallite'))
2234 if (verbose)
write(6,
'(a)')
' Crystallite parsed';
flush(6)
2237 case (trim(
'homogenization'))
2239 if (verbose)
write(6,
'(a)')
' Homogenization parsed';
flush(6)
2241 case (trim(
'texture'))
2243 if (verbose)
write(6,
'(a)')
' Texture parsed';
flush(6)
2250 call io_error(160,ext_msg=
'<homogenization>')
2252 call io_error(160,ext_msg=
'<microstructure>')
2254 call io_error(160,ext_msg=
'<phase>')
2256 call io_error(160,ext_msg=
'<texture>')
2259 inquire(file=
'numerics.config', exist=fileexists)
2260 if (fileexists)
then
2261 write(6,
'(/,a)')
' reading numerics.config';
flush(6)
2266 inquire(file=
'debug.config', exist=fileexists)
2267 if (fileexists)
then
2268 write(6,
'(/,a)')
' reading debug.config';
flush(6)
2282 character(len=*),
intent(in) :: filename
2283 integer,
intent(in),
optional :: cnt
2284 character(len=pStringLen),
dimension(:),
allocatable :: filecontent
2285 character(len=pStringLen),
dimension(:),
allocatable :: includedcontent
2286 character(len=pStringLen) :: line
2287 character(len=pStringLen),
parameter :: dummy =
'https://damask2.mpie.de'
2288 character(len=:),
allocatable :: rawdata
2293 mytotallines, & !< # lines read from file without include statements
2298 if (
present(cnt))
then
2299 if (cnt>10)
call io_error(106,ext_msg=trim(filename))
2304 inquire(file = filename, size=filelength)
2305 if (filelength == 0)
then
2306 allocate(filecontent(0))
2309 open(newunit=fileunit, file=filename, access=
'stream',&
2310 status=
'old', position=
'rewind', action=
'read',iostat=mystat)
2311 if(mystat /= 0)
call io_error(100,ext_msg=trim(filename))
2312 allocate(
character(len=fileLength)::rawdata)
2313 read(fileunit) rawdata
2319 do l=1, len(rawdata)
2320 if (rawdata(l:l) ==
io_eol) mytotallines = mytotallines+1
2322 allocate(filecontent(mytotallines))
2329 do while (l <= mytotallines)
2330 endpos = merge(startpos + scan(rawdata(startpos:),
io_eol) - 2,len(rawdata),l /= mytotallines)
2332 line = rawdata(startpos:startpos+
pstringlen-1)
2333 if (.not. warned)
then
2334 call io_warning(207,ext_msg=trim(filename),el=l)
2338 line = rawdata(startpos:endpos)
2340 startpos = endpos + 2
2342 recursion:
if (scan(trim(adjustl(line)),
'{') == 1 .and. scan(trim(line),
'}') > 2)
then
2344 merge(cnt,1,
present(cnt)))
2345 filecontent = [ filecontent(1:l-1), includedcontent, [(dummy,i=1,mytotallines-l)] ]
2346 mytotallines = mytotallines - 1 +
size(includedcontent)
2347 l = l - 1 +
size(includedcontent)
2349 filecontent(l) = line
2364 character(len=pStringLen),
allocatable,
dimension(:),
intent(out) :: sectionNames
2366 character(len=pStringLen),
intent(inout) :: line
2367 character(len=pStringLen),
dimension(:),
intent(in) :: fileContent
2369 integer,
allocatable,
dimension(:) :: partPosition
2372 character(len=pStringLen) :: sectionName
2376 if (
allocated(part))
call io_error(161,ext_msg=trim(line))
2377 allocate(partposition(0))
2379 do i = 1,
size(filecontent)
2380 line = trim(filecontent(i))
2382 nextsection:
if (
io_gettag(line,
'[',
']') /=
'')
then
2383 partposition = [partposition, i]
2386 if (
size(partposition) < 1) &
2387 echo = (trim(
io_gettag(line,
'/',
'/')) ==
'echo') .or. echo
2390 allocate(sectionnames(
size(partposition)))
2391 allocate(part(
size(partposition)))
2393 partposition = [partposition, i]
2395 do i = 1,
size(partposition) -1
2396 write(sectionname,
'(i0,a,a)') i,
'_',trim(
io_gettag(filecontent(partposition(i)),
'[',
']'))
2397 sectionnames(i) = sectionname
2398 do j = partposition(i) + 1, partposition(i+1) -1
2399 call part(i)%add(trim(adjustl(filecontent(j))))
2402 write(6,*)
'section',i,
'"'//trim(sectionnames(i))//
'"'
2417 character(len=pStringLen),
dimension(:),
intent(in) :: fileContent
2420 do i = 1,
size(filecontent)
2421 call config_list%add(trim(adjustl(filecontent(i))))
2434 character(len=*),
intent(in) :: what
2436 select case(trim(what))
2438 case(
'material.config/phase')
2441 case(
'material.config/microstructure')
2444 case(
'material.config/homogenization')
2447 case(
'material.config/texture')
2450 case(
'debug.config')
2453 case(
'numerics.config')
2457 call io_error(0,ext_msg=
'config_deallocate')
2464 # 12 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
2466 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/math.f90" 1
2492 complex(pReal),
parameter ::
twopiimg = cmplx(0.0_preal,2.0_preal*
pi)
2494 real(
preal),
dimension(3,3),
parameter :: &
2496 1.0_preal,0.0_preal,0.0_preal, &
2497 0.0_preal,1.0_preal,0.0_preal, &
2498 0.0_preal,0.0_preal,1.0_preal &
2501 real(
preal),
dimension(6),
parameter,
private :: &
2503 1.0_preal, 1.0_preal, 1.0_preal, &
2504 sqrt(2.0_preal), sqrt(2.0_preal), sqrt(2.0_preal) ]
2506 real(
preal),
dimension(6),
parameter,
private :: &
2509 integer,
dimension (2,6),
parameter,
private :: &
2519 integer,
dimension (2,6),
parameter,
private :: &
2529 integer,
dimension (2,9),
parameter,
private :: &
2558 real(pReal),
dimension(4) :: randTest
2560 integer,
dimension(:),
allocatable :: randInit
2562 write(6,
'(/,a)')
' <<<+- math init -+>>>';
flush(6)
2564 call random_seed(size=randsize)
2565 allocate(randinit(randsize))
2570 call random_seed(get = randinit)
2571 randinit(2:randsize) = randinit(1)
2574 call random_seed(put = randinit)
2575 call random_number(randtest)
2577 write(6,
'(a,i2)')
' size of random seed: ', randsize
2578 write(6,
'(a,i0)')
' value of random seed: ', randinit(1)
2579 write(6,
'(a,4(/,26x,f17.14),/)')
' start of random sequence: ', randtest
2581 call random_seed(put = randinit)
2593 recursive subroutine math_sort(a, istart, iend, sortDim)
2595 integer,
dimension(:,:),
intent(inout) :: a
2596 integer,
intent(in),
optional :: istart,iend, sortdim
2597 integer :: ipivot,s,e,d
2599 if(
present(istart))
then
2605 if(
present(iend))
then
2611 if(
present(sortdim))
then
2631 integer,
dimension(:,:),
intent(inout) :: a
2632 integer,
intent(in) :: istart,iend,sort
2633 integer,
dimension(size(a,1)) :: tmp
2638 do j = iend, istart, -1
2639 if (a(sort,j) <= a(sort,istart))
exit
2643 if (a(sort,i) > a(sort,istart))
exit
2645 cross:
if (i >= j)
then
2647 a(:,istart) = a(:,j)
2670 real(
preal),
dimension(:),
intent(in) :: what
2671 integer,
dimension(:),
intent(in) :: how
2675 if (sum(how) == 0)
return
2678 math_expand(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1,
size(what))+1)
2689 integer,
intent(in) :: n
2703 integer,
intent(in) :: d
2721 integer,
intent(in) :: d
2724 real(
preal),
dimension(d,d) :: identity2nd
2727 do i=1,d;
do j=1,d;
do k=1,d;
do l=1,d
2729 *(identity2nd(i,k)*identity2nd(j,l)+identity2nd(i,l)*identity2nd(j,k))
2730 enddo; enddo; enddo;
enddo
2743 integer,
intent(in) :: i,j,k
2745 if (all([i,j,k] == [1,2,3]) .or. all([i,j,k] == [2,3,1]) .or. all([i,j,k] == [3,1,2]))
then
2747 elseif (all([i,j,k] == [3,2,1]) .or. all([i,j,k] == [2,1,3]) .or. all([i,j,k] == [1,3,2]))
then
2763 integer,
intent (in) :: i,j
2765 math_delta = merge(0.0_preal, 1.0_preal, i /= j)
2775 real(preal),
dimension(3),
intent(in) :: a,b
2779 a(3)*b(1) -a(1)*b(3), &
2780 a(1)*b(2) -a(2)*b(1) ]
2790 real(preal),
dimension(:),
intent(in) :: a,b
2791 real(preal),
dimension(size(A,1),size(B,1)) ::
math_outer
2794 do i=1,
size(a,1);
do j=1,
size(b,1)
2806 real(preal),
dimension(:),
intent(in) :: a
2807 real(preal),
dimension(size(A,1)),
intent(in) :: b
2819 real(preal),
dimension(3,3),
intent(in) :: a,b
2831 real(preal),
dimension(3,3,3,3),
intent(in) :: a
2832 real(preal),
dimension(3,3),
intent(in) :: b
2849 real(preal),
dimension(3,3,3,3),
intent(in) :: a
2850 real(preal),
dimension(3,3,3,3),
intent(in) :: b
2853 do i=1,3;
do j=1,3;
do k=1,3;
do l=1,3
2855 enddo; enddo; enddo;
enddo
2865 real(preal),
dimension(3,3),
intent(in) :: a
2866 integer,
intent(in),
optional :: n
2869 real(preal) :: invfac
2872 if (
present(n))
then
2883 invfac = invfac/real(i,preal)
2898 real(preal),
dimension(3,3),
intent(in) :: a
2917 real(preal),
dimension(3,3),
intent(out) :: inva
2918 real(preal),
intent(out) :: deta
2919 logical,
intent(out) :: error
2920 real(preal),
dimension(3,3),
intent(in) :: a
2922 inva(1,1) = a(2,2) * a(3,3) - a(2,3) * a(3,2)
2923 inva(2,1) = -a(2,1) * a(3,3) + a(2,3) * a(3,1)
2924 inva(3,1) = a(2,1) * a(3,2) - a(2,2) * a(3,1)
2926 deta = a(1,1) * inva(1,1) + a(1,2) * inva(2,1) + a(1,3) * inva(3,1)
2928 if (deq0(deta))
then
2932 inva(1,2) = -a(1,2) * a(3,3) + a(1,3) * a(3,2)
2933 inva(2,2) = a(1,1) * a(3,3) - a(1,3) * a(3,1)
2934 inva(3,2) = -a(1,1) * a(3,2) + a(1,2) * a(3,1)
2936 inva(1,3) = a(1,2) * a(2,3) - a(1,3) * a(2,2)
2937 inva(2,3) = -a(1,1) * a(2,3) + a(1,3) * a(2,1)
2938 inva(3,3) = a(1,1) * a(2,2) - a(1,2) * a(2,1)
2954 real(preal),
dimension(3,3,3,3),
intent(in) :: a
2957 integer,
dimension(6) :: ipiv6
2958 real(preal),
dimension(6,6) :: temp66
2959 real(preal),
dimension(6*(64+2)) :: work
2966 call dgetrf(6,6,temp66,6,ipiv6,ierr)
2968 call dgetri(6,temp66,6,ipiv6,work,
size(work,1),ierr)
2969 error = error .or. (ierr /= 0)
2971 call io_error(400, ext_msg =
'math_invSym3333')
2984 real(pReal),
dimension(:,:),
intent(in) :: A
2985 real(pReal),
dimension(size(A,1),size(A,1)),
intent(out) :: invA
2986 logical,
intent(out) :: error
2988 integer,
dimension(size(A,1)) :: ipiv
2989 real(pReal),
dimension(size(A,1)*(64+2)) :: work
2996 call dgetrf(
size(a,1),
size(a,1),inva,
size(a,1),ipiv,ierr)
2998 call dgetri(
size(a,1),inva,
size(a,1),ipiv,work,
size(work,1),ierr)
2999 error = error .or. (ierr /= 0)
3010 real(preal),
dimension(3,3),
intent(in) :: m
3023 real(preal),
dimension(6,6),
intent(in) :: m
3036 real(preal),
dimension(3,3),
intent(in) :: m
3049 real(preal),
dimension(3,3),
intent(in) :: m
3062 real(preal),
dimension(3,3),
intent(in) :: m
3074 real(preal),
dimension(3,3),
intent(in) :: m
3086 real(preal),
dimension(3,3),
intent(in) :: m
3088 math_det33 = m(1,1)* (m(2,2)*m(3,3)-m(2,3)*m(3,2)) &
3089 - m(1,2)* (m(2,1)*m(3,3)-m(2,3)*m(3,1)) &
3090 + m(1,3)* (m(2,1)*m(3,2)-m(2,2)*m(3,1))
3100 real(preal),
dimension(3,3),
intent(in) :: m
3102 math_detsym33 = -(m(1,1)*m(2,3)**2 + m(2,2)*m(1,3)**2 + m(3,3)*m(1,2)**2) &
3103 + m(1,1)*m(2,2)*m(3,3) + 2.0_preal * m(1,2)*m(1,3)*m(2,3)
3114 real(preal),
dimension(3,3),
intent(in) :: m33
3131 real(preal),
dimension(9),
intent(in) :: v9
3151 real(preal),
dimension(3,3),
intent(in) :: m33
3152 logical,
optional,
intent(in) :: weighted
3154 real(preal),
dimension(6) :: w
3157 if(
present(weighted))
then
3179 real(preal),
dimension(6),
intent(in) :: v6
3180 logical,
optional,
intent(in) :: weighted
3182 real(preal),
dimension(6) :: w
3185 if(
present(weighted))
then
3205 real(preal),
dimension(3,3,3,3),
intent(in) :: m3333
3222 real(preal),
dimension(9,9),
intent(in) :: m99
3242 real(preal),
dimension(3,3,3,3),
intent(in) :: m3333
3243 logical,
optional,
intent(in) :: weighted
3245 real(preal),
dimension(6) :: w
3248 if(
present(weighted))
then
3270 real(preal),
dimension(6,6),
intent(in) :: m66
3271 logical,
optional,
intent(in) :: weighted
3273 real(preal),
dimension(6) :: w
3276 if(
present(weighted))
then
3298 real(preal),
dimension(6,6),
intent(in) :: m66
3316 real(preal),
intent(in) :: meanvalue, & !< meanvalue of gauss distribution
3318 real(preal),
intent(in),
optional :: width
3320 real(preal),
dimension(2) :: rnd
3321 real(preal) :: scatter, &
3324 if (abs(stddev) < tol_math_check)
then
3327 if (
present(width))
then
3334 call random_number(rnd)
3335 scatter = width_ * (2.0_preal * rnd(1) - 1.0_preal)
3336 if (rnd(2) <= exp(-0.5_preal * scatter ** 2.0_preal))
exit
3351 real(pReal),
dimension(:,:),
intent(in) :: m
3352 real(pReal),
dimension(size(m,1)),
intent(out) :: w
3353 real(pReal),
dimension(size(m,1),size(m,1)),
intent(out) :: v
3355 logical,
intent(out) :: error
3357 real(pReal),
dimension((64+2)*size(m,1)) :: work
3362 call dsyev(
'V',
'U',
size(m,1),v,
size(m,1),w,work,
size(work,1),ierr)
3378 real(pReal),
dimension(3,3),
intent(in) :: m
3379 real(pReal),
dimension(3),
intent(out) :: w
3380 real(pReal),
dimension(3,3),
intent(out) :: v
3382 real(pReal) :: T, U, norm, threshold
3387 v(1:3,2) = [ m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2), &
3388 m(1, 3) * m(1, 2) - m(2, 3) * m(1, 1), &
3393 threshold = sqrt(5.68e-14_preal * u**2)
3395 v(1:3,1) = [ v(1,2) + m(1, 3) * w(1), &
3396 v(2,2) + m(2, 3) * w(1), &
3397 (m(1,1) - w(1)) * (m(2,2) - w(1)) - v(3,2)]
3398 norm = norm2(v(1:3, 1))
3399 fallback1:
if(norm < threshold)
then
3402 v(1:3,1) = v(1:3, 1) / norm
3403 v(1:3,2) = [ v(1,2) + m(1, 3) * w(2), &
3404 v(2,2) + m(2, 3) * w(2), &
3405 (m(1,1) - w(2)) * (m(2,2) - w(2)) - v(3,2)]
3406 norm = norm2(v(1:3, 2))
3407 fallback2:
if(norm < threshold)
then
3410 v(1:3,2) = v(1:3, 2) / norm
3425 real(preal),
intent(in),
dimension(3,3) :: m
3427 real(preal),
dimension(3,3) :: u , uinv
3432 inversionfailed:
if (all(deq0(uinv)))
then
3434 call io_warning(650)
3435 else inversionfailed
3437 endif inversionfailed
3446 real(preal),
dimension(3,3),
intent(in) :: m
3448 real(preal),
dimension(3) :: i, v
3449 real(preal) :: p, q, rho, phi
3450 real(preal),
parameter :: tol=1.e-14_preal
3451 real(preal),
dimension(3,3,3) :: n, eb
3455 p = i(2)-i(1)**2.0_preal/3.0_preal
3456 q = -2.0_preal/27.0_preal*i(1)**3.0_preal+product(i(1:2))/3.0_preal-i(3)
3458 threesimilareigvals:
if(all(abs([p,q]) < tol))
then
3465 else threesimilareigvals
3466 rho=sqrt(-3.0_preal*p**3.0_preal)/9.0_preal
3467 phi=acos(
math_clip(-q/rho*0.5_preal,-1.0_preal,1.0_preal))
3468 v = 2.0_preal*rho**(1.0_preal/3.0_preal)* [cos((phi )/3.0_preal), &
3469 cos((phi+2.0_preal*
pi)/3.0_preal), &
3470 cos((phi+4.0_preal*
pi)/3.0_preal) &
3475 twosimilareigvals:
if(abs(v(1)-v(2)) < tol)
then
3476 eb(1:3,1:3,3) = matmul(n(1:3,1:3,1),n(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
3477 eb(1:3,1:3,1) =
math_i3-eb(1:3,1:3,3)
3478 eb(1:3,1:3,2) = 0.0_preal
3479 elseif (abs(v(2)-v(3)) < tol)
then twosimilareigvals
3480 eb(1:3,1:3,1) = matmul(n(1:3,1:3,2),n(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
3481 eb(1:3,1:3,2) =
math_i3-eb(1:3,1:3,1)
3482 eb(1:3,1:3,3) = 0.0_preal
3483 elseif (abs(v(3)-v(1)) < tol)
then twosimilareigvals
3484 eb(1:3,1:3,2) = matmul(n(1:3,1:3,3),n(1:3,1:3,1))/((v(2)-v(3))*(v(2)-v(1)))
3485 eb(1:3,1:3,3) =
math_i3-eb(1:3,1:3,2)
3486 eb(1:3,1:3,1) = 0.0_preal
3487 else twosimilareigvals
3488 eb(1:3,1:3,1) = matmul(n(1:3,1:3,2),n(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
3489 eb(1:3,1:3,2) = matmul(n(1:3,1:3,3),n(1:3,1:3,1))/((v(2)-v(3))*(v(2)-v(1)))
3490 eb(1:3,1:3,3) = matmul(n(1:3,1:3,1),n(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
3491 endif twosimilareigvals
3492 endif threesimilareigvals
3495 + sqrt(v(2)) * eb(1:3,1:3,2) &
3496 + sqrt(v(3)) * eb(1:3,1:3,3)
3509 real(preal),
dimension(:,:),
intent(in) :: m
3512 real(preal),
dimension(size(m,1),size(m,1)) :: m_
3514 real(preal),
dimension((64+2)*size(m,1)) :: work
3519 call dsyev(
'N',
'U',
size(m,1),m_,
size(m,1),
math_eigvalsh,work,
size(work,1),ierr)
3520 if (ierr /= 0)
math_eigvalsh = ieee_value(1.0_preal,ieee_quiet_nan)
3534 real(preal),
intent(in),
dimension(3,3) :: m
3536 real(preal) :: p, q, rho, phi
3537 real(preal),
parameter :: tol=1.e-14_preal
3541 p = i(2)-i(1)**2.0_preal/3.0_preal
3542 q = product(i(1:2))/3.0_preal &
3543 - 2.0_preal/27.0_preal*i(1)**3.0_preal &
3546 if(all(abs([p,q]) < tol))
then
3549 rho=sqrt(-3.0_preal*p**3.0_preal)/9.0_preal
3550 phi=acos(
math_clip(-q/rho*0.5_preal,-1.0_preal,1.0_preal))
3552 [cos(phi/3.0_preal), &
3553 cos((phi+2.0_preal*
pi)/3.0_preal), &
3554 cos((phi+4.0_preal*
pi)/3.0_preal) &
3567 real(preal),
dimension(3,3),
intent(in) :: m
3572 -(m(1,2)**2 + m(1,3)**2 + m(2,3)**2)
3583 integer,
intent(in) :: n
3595 integer,
intent(in) :: n, k
3596 integer :: i, k_, n_
3614 integer,
intent(in),
dimension(:) :: alpha
3618 do i = 1,
size(alpha)
3630 real(preal),
dimension (3),
intent(in) :: v1,v2,v3,v4
3631 real(preal),
dimension (3,3) :: m
3647 real(preal),
dimension (3),
intent(in) :: v1,v2,v3
3658 real(preal)
pure elemental function
math_clip(a, left, right)
3660 real(preal),
intent(in) :: a
3661 real(preal),
intent(in),
optional :: left, right
3666 if (
present(left) .and.
present(right)) &
3677 integer,
dimension(2,4) :: &
3678 sort_in_ = reshape([+1,+5, +5,+6, -1,-1, +3,-2],[2,4])
3679 integer,
dimension(2,4),
parameter :: &
3680 sort_out_ = reshape([-1,-1, +1,+5, +5,+6, +3,-2],[2,4])
3682 integer,
dimension(5) :: range_out_ = [1,2,3,4,5]
3683 integer,
dimension(3) :: ijk
3686 real(preal),
dimension(3) :: v3_1,v3_2,v3_3,v3_4
3687 real(preal),
dimension(6) :: v6
3688 real(preal),
dimension(9) :: v9
3689 real(preal),
dimension(3,3) :: t33,t33_2
3690 real(preal),
dimension(6,6) :: t66
3691 real(preal),
dimension(9,9) :: t99,t99_2
3692 real(preal),
dimension(:,:), &
3693 allocatable :: txx,txx_2
3698 if (any(abs([1.0_preal,2.0_preal,2.0_preal,3.0_preal,3.0_preal,3.0_preal] - &
3699 math_expand([1.0_preal,2.0_preal,3.0_preal],[1,2,3,0])) > tol_math_check)) &
3700 call io_error(0,ext_msg=
'math_expand [1,2,3] by [1,2,3,0] => [1,2,2,3,3,3]')
3702 if (any(abs([1.0_preal,2.0_preal,2.0_preal] - &
3703 math_expand([1.0_preal,2.0_preal,3.0_preal],[1,2])) > tol_math_check)) &
3704 call io_error(0,ext_msg=
'math_expand [1,2,3] by [1,2] => [1,2,2]')
3706 if (any(abs([1.0_preal,2.0_preal,2.0_preal,1.0_preal,1.0_preal,1.0_preal] - &
3707 math_expand([1.0_preal,2.0_preal],[1,2,3])) > tol_math_check)) &
3708 call io_error(0,ext_msg=
'math_expand [1,2] by [1,2,3] => [1,2,2,1,1,1]')
3711 if(any(sort_in_ /= sort_out_)) &
3712 call io_error(0,ext_msg=
'math_sort')
3715 call io_error(0,ext_msg=
'math_range')
3718 call io_error(0,ext_msg=
'math_exp33(math_I3,1)')
3720 call io_error(0,ext_msg=
'math_exp33(math_I3,256)')
3722 call random_number(v9)
3724 call io_error(0,ext_msg=
'math_33to9/math_9to33')
3726 call random_number(t99)
3728 call io_error(0,ext_msg=
'math_3333to99/math_99to3333')
3730 call random_number(v6)
3732 call io_error(0,ext_msg=
'math_sym33to6/math_6toSym33')
3734 call random_number(t66)
3736 call io_error(0,ext_msg=
'math_sym3333to66/math_66toSym3333')
3738 call random_number(v6)
3740 call io_error(0,ext_msg=
'math_symmetric33')
3742 call random_number(v3_1)
3743 call random_number(v3_2)
3744 call random_number(v3_3)
3745 call random_number(v3_4)
3747 if(dneq(abs(dot_product(
math_cross(v3_1-v3_4,v3_2-v3_4),v3_3-v3_4))/6.0, &
3749 call io_error(0,ext_msg=
'math_volTetrahedron')
3751 call random_number(t33)
3753 call io_error(0,ext_msg=
'math_det33/math_detSym33')
3756 call io_error(0,ext_msg=
'math_inv33(math_I3)')
3759 call random_number(t33)
3762 call io_error(0,ext_msg=
'math_inv33')
3765 if(any(dneq0(matmul(t33,t33_2) -
math_identity2nd(3),tol=1.0e-9_preal)) .or. e) &
3766 call io_error(0,ext_msg=
'math_invert33: T:T^-1 != I')
3767 if(dneq(det,
math_det33(t33),tol=1.0e-12_preal)) &
3768 call io_error(0,ext_msg=
'math_invert33 (determinant)')
3771 if(any(dneq0(matmul(t33,t33_2) -
math_identity2nd(3),tol=1.0e-9_preal)) .or. e) &
3772 call io_error(0,ext_msg=
'math_invert t33')
3775 call random_number(t33)
3779 if(any(dneq0(matmul(t33_2,t33) -
math_i3,tol=1.0e-10_preal))) &
3780 call io_error(0,ext_msg=
'math_rotationalPart')
3782 call random_number(r)
3783 d = int(r*5.0_preal) + 1
3785 allocate(txx_2(d,d))
3787 if(any(dneq0(txx_2,txx) .or. e)) &
3788 call io_error(0,ext_msg=
'math_invert(txx)/math_identity2nd')
3791 if(any(dneq0(matmul(t99_2,t99)-
math_identity2nd(9),tol=1.0e-9_preal)) .or. e) &
3792 call io_error(0,ext_msg=
'math_invert(t99)')
3794 if(any(dneq(
math_clip([4.0_preal,9.0_preal],5.0_preal,6.5_preal),[5.0_preal,6.5_preal]))) &
3795 call io_error(0,ext_msg=
'math_clip')
3798 call io_error(0,ext_msg=
'math_factorial')
3801 call io_error(0,ext_msg=
'math_binomial')
3803 ijk = cshift([1,2,3],int(r*1.0e2_preal))
3805 call io_error(0,ext_msg=
'math_LeviCivita(even)')
3806 ijk = cshift([3,2,1],int(r*2.0e2_preal))
3808 call io_error(0,ext_msg=
'math_LeviCivita(odd)')
3809 ijk = cshift([2,2,1],int(r*2.0e2_preal))
3811 call io_error(0,ext_msg=
'math_LeviCivita')
3816 # 13 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
3818 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/quaternions.f90" 1
3833 real(
preal),
parameter,
public ::
p = -1.0_preal
3860 generic,
public ::
operator(==) =>
eq__
3863 generic,
public ::
operator(/=) =>
neq__
3880 interface assignment (=)
3883 end interface assignment (=)
3894 procedure dot_product__
3902 module procedure exp__
3906 module procedure log__
3932 write(6,
'(/,a)')
' <<<+- quaternions init -+>>>';
flush(6)
3943 real(
preal),
intent(in),
dimension(4) :: array
3961 self = [other%w,other%x,other%y,other%z]
3972 real(preal),
intent(in),
dimension(4) :: other
3989 add__ = [ self%w, self%x, self%y ,self%z] &
3990 + [other%w, other%x, other%y,other%z]
4002 pos__ = self * (+1.0_preal)
4014 sub__ = [ self%w, self%x, self%y ,self%z] &
4015 - [other%w, other%x, other%y,other%z]
4027 neg__ = self * (-1.0_preal)
4039 mul_quat__%w = self%w*other%w - self%x*other%x - self%y*other%y - self%z*other%z
4040 mul_quat__%x = self%w*other%x + self%x*other%w +
p * (self%y*other%z - self%z*other%y)
4041 mul_quat__%y = self%w*other%y + self%y*other%w +
p * (self%z*other%x - self%x*other%z)
4042 mul_quat__%z = self%w*other%z + self%z*other%w +
p * (self%x*other%y - self%y*other%x)
4053 real(preal),
intent(in) :: scal
4055 mul_scal__ = [self%w,self%x,self%y,self%z]*scal
4078 real(preal),
intent(in) :: scal
4080 div_scal__ = [self%w,self%x,self%y,self%z]/scal
4088 logical elemental pure function
eq__(self,other)
4092 eq__ = all(deq([ self%w, self%x, self%y, self%z], &
4093 [other%w,other%x,other%y,other%z]))
4101 logical elemental pure function
neq__(self,other)
4105 neq__ = .not. self%eq__(other)
4129 real(preal),
intent(in) :: expon
4142 real(preal) :: absimag
4144 absimag = norm2(
aimag(a))
4146 exp__ = merge(
exp(a%w) * [ cos(absimag), &
4147 a%x/absimag * sin(absimag), &
4148 a%y/absimag * sin(absimag), &
4149 a%z/absimag * sin(absimag)], &
4150 ieee_value(1.0_preal,ieee_signaling_nan), &
4162 real(preal) :: absimag
4164 absimag = norm2(
aimag(a))
4167 a%x/absimag * acos(a%w/
abs(a)), &
4168 a%y/absimag * acos(a%w/
abs(a)), &
4169 a%z/absimag * acos(a%w/
abs(a))], &
4170 ieee_value(1.0_preal,ieee_signaling_nan), &
4179 real(preal)
elemental pure function
abs__(self)
4183 abs__ = norm2([self%w,self%x,self%y,self%z])
4207 conjg__ = [self%w,-self%x,-self%y,-self%z]
4229 real(preal),
dimension(4) ::
asarray
4232 asarray = [self%w,self%x,self%y,self%z]
4240 pure function real__(self)
4255 real(preal),
dimension(3) ::
aimag__
4258 aimag__ = [self%x,self%y,self%z]
4280 real(pReal),
dimension(4) :: qu
4283 call random_number(qu)
4284 qu = (qu-0.5_preal) * 2.0_preal
4288 if(any(dneq(q%asArray(),q_2%asArray())))
call io_error(0,ext_msg=
'assign_vec__')
4291 if(any(dneq(q_2%asArray(),2.0_preal*qu)))
call io_error(0,ext_msg=
'add__')
4294 if(any(dneq0(q_2%asArray())))
call io_error(0,ext_msg=
'sub__')
4297 if(any(dneq(q_2%asArray(),5.0_preal*qu)))
call io_error(0,ext_msg=
'mul__')
4300 if(any(dneq(q_2%asArray(),2.0_preal*qu)))
call io_error(0,ext_msg=
'div__')
4303 if(dneq0(
abs(q)) .and. q_2 == q)
call io_error(0,ext_msg=
'eq__')
4306 if(q_2 /= q)
call io_error(0,ext_msg=
'neq__')
4308 if(dneq(
abs(q),norm2(qu)))
call io_error(0,ext_msg=
'abs__')
4309 if(dneq(
abs(q)**2.0_preal,
real(q*q%conjg()),1.0e-14_preal)) &
4310 call io_error(0,ext_msg=
'abs__/*conjg')
4312 if(any(dneq(q%asArray(),qu)))
call io_error(0,ext_msg=
'eq__')
4313 if(dneq(q%real(), qu(1)))
call io_error(0,ext_msg=
'real()')
4314 if(any(dneq(q%aimag(), qu(2:4))))
call io_error(0,ext_msg=
'aimag()')
4316 q_2 = q%homomorphed()
4317 if(q /= q_2* (-1.0_preal))
call io_error(0,ext_msg=
'homomorphed')
4318 if(dneq(q_2%real(), qu(1)* (-1.0_preal)))
call io_error(0,ext_msg=
'homomorphed/real')
4319 if(any(dneq(q_2%aimag(),qu(2:4)*(-1.0_preal))))
call io_error(0,ext_msg=
'homomorphed/aimag')
4322 if(dneq(
abs(q),
abs(q_2)))
call io_error(0,ext_msg=
'conjg/abs')
4323 if(q /=
conjg(q_2))
call io_error(0,ext_msg=
'conjg/involution')
4324 if(dneq(q_2%real(), q%real()))
call io_error(0,ext_msg=
'conjg/real')
4325 if(any(dneq(q_2%aimag(),q%aimag()*(-1.0_preal))))
call io_error(0,ext_msg=
'conjg/aimag')
4327 if(
abs(q) > 0.0_preal)
then
4328 q_2 = q * q%inverse()
4329 if( dneq(
real(q_2), 1.0_preal,1.0e-15_preal))
call io_error(0,ext_msg=
'inverse/real')
4330 if(any(dneq0(
aimag(q_2), 1.0e-15_preal)))
call io_error(0,ext_msg=
'inverse/aimag')
4334 if(any(dneq0(q_2%asArray(),1.0e-15_preal)))
call io_error(0,ext_msg=
'inverse/conjg')
4349 # 14 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
4351 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/Lambert.f90" 1
4400 pref = sqrt(6.0_preal/
pi), &
4401 a =
pi**(5.0_preal/6.0_preal)/6.0_preal**(1.0_preal/6.0_preal), &
4402 ap =
pi**(2.0_preal/3.0_preal), &
4404 beta =
a/2.0_preal, &
4405 r1 = (3.0_preal*
pi/4.0_preal)**(1.0_preal/3.0_preal), &
4406 r2 = sqrt(2.0_preal), &
4408 prek =
r1 * 2.0_preal**(1.0_preal/4.0_preal)/
beta
4424 real(
preal),
intent(in),
dimension(3) :: cube
4425 real(
preal),
dimension(3) :: ball, lamxyz, xyz
4426 real(
preal),
dimension(2) :: t
4427 real(
preal) :: c, s, q
4428 real(
preal),
parameter :: eps = 1.0e-8_preal
4429 integer,
dimension(3) :: p
4430 integer,
dimension(2) :: order
4432 if (maxval(abs(cube)) >
ap/2.0+eps)
then
4433 ball = ieee_value(cube,ieee_positive_inf)
4438 center:
if (all(
deq0(cube)))
then
4446 special:
if (all(
deq0(xyz(1:2))))
then
4447 lamxyz = [ 0.0_preal, 0.0_preal,
pref * xyz(3) ]
4449 order = merge( [2,1], [1,2], abs(xyz(2)) <= abs(xyz(1)))
4450 q =
pi12 * xyz(order(1))/xyz(order(2))
4453 q =
prek * xyz(order(2))/ sqrt(
r2-c)
4454 t = [ (
r2*c - 1.0),
r2 * s] * q
4459 s =
pi * c/(24.0*xyz(3)**2)
4460 c =
spi * c / sqrt(24.0_preal) / xyz(3)
4462 lamxyz = [ t(order(2)) * q, t(order(1)) * q,
pref * xyz(3) - c ]
4480 real(
preal),
intent(in),
dimension(3) :: xyz
4481 real(
preal),
dimension(3) :: cube, xyz1, xyz3
4482 real(
preal),
dimension(2) :: tinv, xyz2
4483 real(
preal) :: rs, qxy, q2, sq2, q, tt
4484 integer,
dimension(3) :: p
4488 cube = ieee_value(cube,ieee_positive_inf)
4492 center:
if (all(
deq0(xyz)))
then
4499 xyz2 = xyz3(1:2) * sqrt( 2.0*rs/(rs+abs(xyz3(3))) )
4504 special:
if (
deq0(qxy))
then
4507 q2 = qxy + maxval(abs(xyz2))**2
4509 q = (
beta/
r2/
r1) * sqrt(q2*qxy/(q2-maxval(abs(xyz2))*sq2))
4510 tt = (minval(abs(xyz2))**2+maxval(abs(xyz2))*sq2)/
r2/qxy
4511 tinv = q * sign(1.0_preal,xyz2) * merge([ 1.0_preal, acos(
math_clip(tt,-1.0_preal,1.0_preal))/
pi12], &
4512 [ acos(
math_clip(tt,-1.0_preal,1.0_preal))/
pi12, 1.0_preal], &
4513 abs(xyz2(2)) <= abs(xyz2(1)))
4517 xyz1 = [ tinv(1), tinv(2), sign(1.0_preal,xyz3(3)) * rs /
pref ] /
sc
4534 real(
preal),
intent(in),
dimension(3) :: xyz
4537 if (((abs(xyz(1)) <= xyz(3)).and.(abs(xyz(2)) <= xyz(3))) .or. &
4538 ((abs(xyz(1)) <= -xyz(3)).and.(abs(xyz(2)) <= -xyz(3))))
then
4540 else if (((abs(xyz(3)) <= xyz(1)).and.(abs(xyz(2)) <= xyz(1))) .or. &
4541 ((abs(xyz(3)) <= -xyz(1)).and.(abs(xyz(2)) <= -xyz(1))))
then
4543 else if (((abs(xyz(1)) <= xyz(2)).and.(abs(xyz(3)) <= xyz(2))) .or. &
4544 ((abs(xyz(1)) <= -xyz(2)).and.(abs(xyz(3)) <= -xyz(2))))
then
4553 # 15 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
4555 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/rotations.f90" 1
4651 write(6,
'(/,a)')
' <<<+- rotations init -+>>>';
flush(6)
4662 class(
rotation),
intent(in) :: self
4671 class(
rotation),
intent(in) :: self
4680 class(
rotation),
intent(in) :: self
4689 class(
rotation),
intent(in) :: self
4698 class(
rotation),
intent(in) :: self
4707 class(
rotation),
intent(in) :: self
4719 class(
rotation),
intent(out) :: self
4720 real(pReal),
dimension(4),
intent(in) :: qu
4722 if (
dneq(norm2(qu),1.0_preal)) &
4723 call io_error(402,ext_msg=
'fromQuaternion')
4731 class(
rotation),
intent(out) :: self
4732 real(pReal),
dimension(3),
intent(in) :: eu
4733 logical,
intent(in),
optional :: degrees
4735 real(pReal),
dimension(3) :: Eulers
4737 if (.not.
present(degrees))
then
4740 eulers = merge(eu*
inrad,eu,degrees)
4743 if (any(eulers<0.0_preal) .or. any(eulers>2.0_preal*
pi) .or. eulers(2) >
pi) &
4744 call io_error(402,ext_msg=
'fromEulers')
4746 self%q =
eu2qu(eulers)
4752 class(
rotation),
intent(out) :: self
4753 real(pReal),
dimension(4),
intent(in) :: ax
4754 logical,
intent(in),
optional :: degrees
4755 integer,
intent(in),
optional :: P
4757 real(pReal) :: angle
4758 real(pReal),
dimension(3) :: axis
4760 if (.not.
present(degrees))
then
4763 angle = merge(ax(4)*
inrad,ax(4),degrees)
4766 if (.not.
present(p))
then
4769 axis = ax(1:3) * merge(-1.0_preal,1.0_preal,p == 1)
4770 if(
abs(p) /= 1)
call io_error(402,ext_msg=
'fromAxisAngle (P)')
4773 if(
dneq(norm2(axis),1.0_preal) .or. angle < 0.0_preal .or. angle >
pi) &
4774 call io_error(402,ext_msg=
'fromAxisAngle')
4776 self%q =
ax2qu([axis,angle])
4782 class(
rotation),
intent(out) :: self
4783 real(pReal),
dimension(3,3),
intent(in) :: om
4786 call io_error(402,ext_msg=
'fromMatrix')
4797 pure elemental function rotrot__(self,R)
result(rRot)
4800 class(
rotation),
intent(in) :: self,r
4803 call rrot%standardize()
4813 class(
rotation),
intent(inout) :: self
4815 if (
real(self%q) < 0.0_preal) self%q = self%q%homomorphed()
4824 pure function rotvector(self,v,active)
result(vRot)
4826 real(
preal),
dimension(3) :: vrot
4827 class(
rotation),
intent(in) :: self
4828 real(
preal),
intent(in),
dimension(3) :: v
4829 logical,
intent(in),
optional :: active
4831 real(
preal),
dimension(3) :: v_normed
4835 if (
present(active))
then
4836 passive = .not. active
4841 if (
deq0(norm2(v)))
then
4844 v_normed = v/norm2(v)
4846 q = self%q * (
quaternion([0.0_preal, v_normed(1), v_normed(2), v_normed(3)]) *
conjg(self%q) )
4848 q =
conjg(self%q) * (
quaternion([0.0_preal, v_normed(1), v_normed(2), v_normed(3)]) * self%q )
4850 vrot = q%aimag()*norm2(v)
4861 pure function rottensor2(self,T,active)
result(tRot)
4863 real(
preal),
dimension(3,3) :: trot
4864 class(
rotation),
intent(in) :: self
4865 real(
preal),
intent(in),
dimension(3,3) :: t
4866 logical,
intent(in),
optional :: active
4870 if (
present(active))
then
4871 passive = .not. active
4877 trot = matmul(matmul(self%asMatrix(),t),transpose(self%asMatrix()))
4879 trot = matmul(matmul(transpose(self%asMatrix()),t),self%asMatrix())
4891 pure function rottensor4(self,T,active)
result(tRot)
4893 real(
preal),
dimension(3,3,3,3) :: trot
4894 class(
rotation),
intent(in) :: self
4895 real(
preal),
intent(in),
dimension(3,3,3,3) :: t
4896 logical,
intent(in),
optional :: active
4898 real(
preal),
dimension(3,3) :: r
4899 integer :: i,j,k,l,m,n,o,
p
4901 if (
present(active))
then
4902 r = merge(transpose(self%asMatrix()),self%asMatrix(),active)
4908 do i = 1,3;
do j = 1,3;
do k = 1,3;
do l = 1,3
4909 do m = 1,3;
do n = 1,3;
do o = 1,3;
do p = 1,3
4910 trot(i,j,k,l) = trot(i,j,k,l) &
4911 + r(i,m) * r(j,n) * r(k,o) * r(l,
p) * t(m,n,o,
p)
4912 enddo; enddo; enddo; enddo; enddo; enddo; enddo;
enddo
4924 real(
preal),
dimension(6,6) :: trot
4925 class(
rotation),
intent(in) :: self
4926 real(
preal),
intent(in),
dimension(6,6) :: t
4927 logical,
intent(in),
optional :: active
4929 if (
present(active))
then
4944 class(
rotation),
intent(in) :: self, other
4955 pure function qu2om(qu)
result(om)
4957 real(
preal),
intent(in),
dimension(4) :: qu
4958 real(
preal),
dimension(3,3) :: om
4962 qq = qu(1)**2-sum(qu(2:4)**2)
4965 om(1,1) = qq+2.0_preal*qu(2)**2
4966 om(2,2) = qq+2.0_preal*qu(3)**2
4967 om(3,3) = qq+2.0_preal*qu(4)**2
4969 om(1,2) = 2.0_preal*(qu(2)*qu(3)-qu(1)*qu(4))
4970 om(2,3) = 2.0_preal*(qu(3)*qu(4)-qu(1)*qu(2))
4971 om(3,1) = 2.0_preal*(qu(4)*qu(2)-qu(1)*qu(3))
4972 om(2,1) = 2.0_preal*(qu(3)*qu(2)+qu(1)*qu(4))
4973 om(3,2) = 2.0_preal*(qu(4)*qu(3)+qu(1)*qu(2))
4974 om(1,3) = 2.0_preal*(qu(2)*qu(4)+qu(1)*qu(3))
4976 if (
p < 0.0_preal) om = transpose(om)
4985 pure function qu2eu(qu)
result(eu)
4987 real(
preal),
intent(in),
dimension(4) :: qu
4988 real(
preal),
dimension(3) :: eu
4990 real(
preal) :: q12, q03, chi, chiinv
4992 q03 = qu(1)**2+qu(4)**2
4993 q12 = qu(2)**2+qu(3)**2
4996 degenerated:
if (
deq0(chi))
then
4997 eu = merge([atan2(-
p*2.0_preal*qu(1)*qu(4),qu(1)**2-qu(4)**2), 0.0_preal, 0.0_preal], &
4998 [atan2( 2.0_preal*qu(2)*qu(3),qu(2)**2-qu(3)**2),
pi, 0.0_preal], &
5001 chiinv = 1.0_preal/chi
5002 eu = [atan2((-
p*qu(1)*qu(3)+qu(2)*qu(4))*chi, (-
p*qu(1)*qu(2)-qu(3)*qu(4))*chi ), &
5003 atan2( 2.0_preal*chi, q03-q12 ), &
5004 atan2((
p*qu(1)*qu(3)+qu(2)*qu(4))*chi, (-
p*qu(1)*qu(2)+qu(3)*qu(4))*chi )]
5006 where(eu<0.0_preal) eu = mod(eu+2.0_preal*
pi,[2.0_preal*
pi,
pi,2.0_preal*
pi])
5015 pure function qu2ax(qu)
result(ax)
5017 real(
preal),
intent(in),
dimension(4) :: qu
5018 real(
preal),
dimension(4) :: ax
5020 real(
preal) :: omega, s
5022 if (
deq0(sum(qu(2:4)**2)))
then
5023 ax = [ 0.0_preal, 0.0_preal, 1.0_preal, 0.0_preal ]
5024 elseif (
dneq0(qu(1)))
then
5025 s = sign(1.0_preal,qu(1))/norm2(qu(2:4))
5026 omega = 2.0_preal * acos(
math_clip(qu(1),-1.0_preal,1.0_preal))
5027 ax = [ qu(2)*s, qu(3)*s, qu(4)*s, omega ]
5029 ax = [ qu(2), qu(3), qu(4),
pi ]
5039 pure function qu2ro(qu)
result(ro)
5041 real(
preal),
intent(in),
dimension(4) :: qu
5042 real(
preal),
dimension(4) :: ro
5045 real(
preal),
parameter :: thr = 1.0e-8_preal
5047 if (
abs(qu(1)) < thr)
then
5048 ro = [qu(2), qu(3), qu(4), ieee_value(1.0_preal,ieee_positive_inf)]
5052 ro = [0.0_preal, 0.0_preal,
p, 0.0_preal]
5054 ro = [qu(2)/s,qu(3)/s,qu(4)/s, tan(acos(
math_clip(qu(1),-1.0_preal,1.0_preal)))]
5066 pure function qu2ho(qu)
result(ho)
5068 real(
preal),
intent(in),
dimension(4) :: qu
5069 real(
preal),
dimension(3) :: ho
5071 real(
preal) :: omega, f
5073 omega = 2.0 * acos(
math_clip(qu(1),-1.0_preal,1.0_preal))
5075 if (
deq0(omega))
then
5076 ho = [ 0.0_preal, 0.0_preal, 0.0_preal ]
5079 f = 0.75_preal * ( omega - sin(omega) )
5080 ho = ho/norm2(ho)* f**(1.0_preal/3.0_preal)
5090 pure function qu2cu(qu)
result(cu)
5092 real(
preal),
intent(in),
dimension(4) :: qu
5093 real(
preal),
dimension(3) :: cu
5105 pure function om2qu(om)
result(qu)
5107 real(
preal),
intent(in),
dimension(3,3) :: om
5108 real(
preal),
dimension(4) :: qu
5119 pure function om2eu(om)
result(eu)
5121 real(
preal),
intent(in),
dimension(3,3) :: om
5122 real(
preal),
dimension(3) :: eu
5125 if (
abs(om(3,3)) < 1.0_preal)
then
5126 zeta = 1.0_preal/sqrt(1.0_preal-om(3,3)**2.0_preal)
5127 eu = [atan2(om(3,1)*zeta,-om(3,2)*zeta), &
5129 atan2(om(1,3)*zeta, om(2,3)*zeta)]
5131 eu = [atan2(om(1,2),om(1,1)), 0.5_preal*
pi*(1.0_preal-om(3,3)),0.0_preal ]
5134 where(eu<0.0_preal) eu = mod(eu+2.0_preal*
pi,[2.0_preal*
pi,
pi,2.0_preal*
pi])
5143 function om2ax(om)
result(ax)
5145 real(
preal),
intent(in),
dimension(3,3) :: om
5146 real(
preal),
dimension(4) :: ax
5149 real(
preal),
dimension(3) :: wr, wi
5150 real(
preal),
dimension((64+2)*3) :: work
5151 real(
preal),
dimension(3,3) :: vr, devnull, om_
5160 ax(4) = acos(
math_clip(t,-1.0_preal,1.0_preal))
5162 if (
deq0(ax(4)))
then
5163 ax(1:3) = [ 0.0_preal, 0.0_preal, 1.0_preal ]
5165 call dgeev(
'N',
'V',3,om_,3,wr,wi,devnull,3,vr,3,work,
size(work,1),ierr)
5166 if (ierr /= 0)
call io_error(401,ext_msg=
'Error in om2ax: DGEEV return not zero')
5168 i = maxloc(merge(1,0,
ceq(cmplx(wr,wi,
preal),cmplx(1.0_preal,0.0_preal,
preal),tol=1.0e-14_preal)),dim=1)
5172 if (i == 0)
call io_error(401,ext_msg=
'Error in om2ax Real: eigenvalue not found')
5174 where (
dneq0([om(2,3)-om(3,2), om(3,1)-om(1,3), om(1,2)-om(2,1)])) &
5175 ax(1:3) = sign(ax(1:3),-
p *[om(2,3)-om(3,2), om(3,1)-om(1,3), om(1,2)-om(2,1)])
5185 pure function om2ro(om)
result(ro)
5187 real(
preal),
intent(in),
dimension(3,3) :: om
5188 real(
preal),
dimension(4) :: ro
5199 function om2ho(om)
result(ho)
5201 real(
preal),
intent(in),
dimension(3,3) :: om
5202 real(
preal),
dimension(3) :: ho
5213 function om2cu(om)
result(cu)
5215 real(
preal),
intent(in),
dimension(3,3) :: om
5216 real(
preal),
dimension(3) :: cu
5227 pure function eu2qu(eu)
result(qu)
5229 real(
preal),
intent(in),
dimension(3) :: eu
5230 real(
preal),
dimension(4) :: qu
5231 real(
preal),
dimension(3) :: ee
5232 real(
preal) :: cphi, sphi
5239 qu = [ cphi*cos(ee(1)+ee(3)), &
5240 -
p*sphi*cos(ee(1)-ee(3)), &
5241 -
p*sphi*sin(ee(1)-ee(3)), &
5242 -
p*cphi*sin(ee(1)+ee(3))]
5243 if(qu(1) < 0.0_preal) qu = qu * (-1.0_preal)
5252 pure function eu2om(eu)
result(om)
5254 real(
preal),
intent(in),
dimension(3) :: eu
5255 real(
preal),
dimension(3,3) :: om
5257 real(
preal),
dimension(3) :: c, s
5262 om(1,1) = c(1)*c(3)-s(1)*s(3)*c(2)
5263 om(1,2) = s(1)*c(3)+c(1)*s(3)*c(2)
5265 om(2,1) = -c(1)*s(3)-s(1)*c(3)*c(2)
5266 om(2,2) = -s(1)*s(3)+c(1)*c(3)*c(2)
5269 om(3,2) = -c(1)*s(2)
5272 where(
deq0(om)) om = 0.0_preal
5281 pure function eu2ax(eu)
result(ax)
5283 real(
preal),
intent(in),
dimension(3) :: eu
5284 real(
preal),
dimension(4) :: ax
5286 real(
preal) :: t, delta, tau, alpha, sigma
5288 t = tan(eu(2)*0.5_preal)
5289 sigma = 0.5_preal*(eu(1)+eu(3))
5290 delta = 0.5_preal*(eu(1)-eu(3))
5291 tau = sqrt(t**2+sin(sigma)**2)
5293 alpha = merge(
pi, 2.0_preal*atan(tau/cos(sigma)),
deq(sigma,
pi*0.5_preal,tol=1.0e-15_preal))
5295 if (
deq0(alpha))
then
5296 ax = [ 0.0_preal, 0.0_preal, 1.0_preal, 0.0_preal ]
5298 ax(1:3) = -
p/tau * [ t*cos(delta), t*sin(delta), sin(sigma) ]
5300 if (alpha < 0.0_preal) ax = -ax
5310 pure function eu2ro(eu)
result(ro)
5312 real(
preal),
intent(in),
dimension(3) :: eu
5313 real(
preal),
dimension(4) :: ro
5316 if (ro(4) >=
pi)
then
5317 ro(4) = ieee_value(ro(4),ieee_positive_inf)
5318 elseif(
deq0(ro(4)))
then
5319 ro = [ 0.0_preal, 0.0_preal,
p, 0.0_preal ]
5321 ro(4) = tan(ro(4)*0.5_preal)
5331 pure function eu2ho(eu)
result(ho)
5333 real(
preal),
intent(in),
dimension(3) :: eu
5334 real(
preal),
dimension(3) :: ho
5345 function eu2cu(eu)
result(cu)
5347 real(
preal),
intent(in),
dimension(3) :: eu
5348 real(
preal),
dimension(3) :: cu
5359 pure function ax2qu(ax)
result(qu)
5361 real(
preal),
intent(in),
dimension(4) :: ax
5362 real(
preal),
dimension(4) :: qu
5367 if (
deq0(ax(4)))
then
5368 qu = [ 1.0_preal, 0.0_preal, 0.0_preal, 0.0_preal ]
5370 c = cos(ax(4)*0.5_preal)
5371 s = sin(ax(4)*0.5_preal)
5372 qu = [ c, ax(1)*s, ax(2)*s, ax(3)*s ]
5382 pure function ax2om(ax)
result(om)
5384 real(
preal),
intent(in),
dimension(4) :: ax
5385 real(
preal),
dimension(3,3) :: om
5387 real(
preal) :: q, c, s, omc
5393 om(1,1) = ax(1)**2*omc + c
5394 om(2,2) = ax(2)**2*omc + c
5395 om(3,3) = ax(3)**2*omc + c
5398 om(1,2) = q + s*ax(3)
5399 om(2,1) = q - s*ax(3)
5402 om(2,3) = q + s*ax(1)
5403 om(3,2) = q - s*ax(1)
5406 om(3,1) = q + s*ax(2)
5407 om(1,3) = q - s*ax(2)
5409 if (
p > 0.0_preal) om = transpose(om)
5418 pure function ax2eu(ax)
result(eu)
5420 real(
preal),
intent(in),
dimension(4) :: ax
5421 real(
preal),
dimension(3) :: eu
5432 pure function ax2ro(ax)
result(ro)
5434 real(
preal),
intent(in),
dimension(4) :: ax
5435 real(
preal),
dimension(4) :: ro
5437 real(
preal),
parameter :: thr = 1.0e-7_preal
5439 if (
deq0(ax(4)))
then
5440 ro = [ 0.0_preal, 0.0_preal,
p, 0.0_preal ]
5444 ro(4) = merge(ieee_value(ro(4),ieee_positive_inf),tan(ax(4)*0.5_preal),
abs(ax(4)-
pi) < thr)
5454 pure function ax2ho(ax)
result(ho)
5456 real(
preal),
intent(in),
dimension(4) :: ax
5457 real(
preal),
dimension(3) :: ho
5461 f = 0.75_preal * ( ax(4) - sin(ax(4)) )
5462 f = f**(1.0_preal/3.0_preal)
5472 function ax2cu(ax)
result(cu)
5474 real(
preal),
intent(in),
dimension(4) :: ax
5475 real(
preal),
dimension(3) :: cu
5486 pure function ro2qu(ro)
result(qu)
5488 real(
preal),
intent(in),
dimension(4) :: ro
5489 real(
preal),
dimension(4) :: qu
5500 pure function ro2om(ro)
result(om)
5502 real(
preal),
intent(in),
dimension(4) :: ro
5503 real(
preal),
dimension(3,3) :: om
5514 pure function ro2eu(ro)
result(eu)
5516 real(
preal),
intent(in),
dimension(4) :: ro
5517 real(
preal),
dimension(3) :: eu
5528 pure function ro2ax(ro)
result(ax)
5530 real(
preal),
intent(in),
dimension(4) :: ro
5531 real(
preal),
dimension(4) :: ax
5533 real(
preal) :: ta, angle
5537 if (.not. ieee_is_finite(ta))
then
5538 ax = [ ro(1), ro(2), ro(3),
pi ]
5539 elseif (
deq0(ta))
then
5540 ax = [ 0.0_preal, 0.0_preal, 1.0_preal, 0.0_preal ]
5542 angle = 2.0_preal*atan(ta)
5543 ta = 1.0_preal/norm2(ro(1:3))
5544 ax = [ ro(1)/ta, ro(2)/ta, ro(3)/ta, angle ]
5554 pure function ro2ho(ro)
result(ho)
5556 real(
preal),
intent(in),
dimension(4) :: ro
5557 real(
preal),
dimension(3) :: ho
5561 if (
deq0(norm2(ro(1:3))))
then
5562 ho = [ 0.0_preal, 0.0_preal, 0.0_preal ]
5564 f = merge(2.0_preal*atan(ro(4)) - sin(2.0_preal*atan(ro(4))),
pi, ieee_is_finite(ro(4)))
5565 ho = ro(1:3) * (0.75_preal*f)**(1.0_preal/3.0_preal)
5575 pure function ro2cu(ro)
result(cu)
5577 real(
preal),
intent(in),
dimension(4) :: ro
5578 real(
preal),
dimension(3) :: cu
5589 pure function ho2qu(ho)
result(qu)
5591 real(
preal),
intent(in),
dimension(3) :: ho
5592 real(
preal),
dimension(4) :: qu
5603 pure function ho2om(ho)
result(om)
5605 real(
preal),
intent(in),
dimension(3) :: ho
5606 real(
preal),
dimension(3,3) :: om
5617 pure function ho2eu(ho)
result(eu)
5619 real(
preal),
intent(in),
dimension(3) :: ho
5620 real(
preal),
dimension(3) :: eu
5631 pure function ho2ax(ho)
result(ax)
5633 real(
preal),
intent(in),
dimension(3) :: ho
5634 real(
preal),
dimension(4) :: ax
5637 real(
preal) :: hmag_squared, s, hm
5638 real(
preal),
parameter,
dimension(16) :: &
5639 tfit = [ 1.0000000000018852_preal, -0.5000000002194847_preal, &
5640 -0.024999992127593126_preal, -0.003928701544781374_preal, &
5641 -0.0008152701535450438_preal, -0.0002009500426119712_preal, &
5642 -0.00002397986776071756_preal, -0.00008202868926605841_preal, &
5643 +0.00012448715042090092_preal, -0.0001749114214822577_preal, &
5644 +0.0001703481934140054_preal, -0.00012062065004116828_preal, &
5645 +0.000059719705868660826_preal, -0.00001980756723965647_preal, &
5646 +0.000003953714684212874_preal, -0.00000036555001439719544_preal ]
5649 hmag_squared = sum(ho**2.0_preal)
5650 if (
deq0(hmag_squared))
then
5651 ax = [ 0.0_preal, 0.0_preal, 1.0_preal, 0.0_preal ]
5656 s = tfit(1) + tfit(2) * hmag_squared
5658 hm = hm*hmag_squared
5659 s = s + tfit(i) * hm
5661 ax = [ho/sqrt(hmag_squared), 2.0_preal*acos(s)]
5671 pure function ho2ro(ho)
result(ro)
5673 real(
preal),
intent(in),
dimension(3) :: ho
5674 real(
preal),
dimension(4) :: ro
5685 pure function ho2cu(ho)
result(cu)
5687 real(
preal),
intent(in),
dimension(3) :: ho
5688 real(
preal),
dimension(3) :: cu
5699 pure function cu2qu(cu)
result(qu)
5701 real(
preal),
intent(in),
dimension(3) :: cu
5702 real(
preal),
dimension(4) :: qu
5713 pure function cu2om(cu)
result(om)
5715 real(
preal),
intent(in),
dimension(3) :: cu
5716 real(
preal),
dimension(3,3) :: om
5727 pure function cu2eu(cu)
result(eu)
5729 real(
preal),
intent(in),
dimension(3) :: cu
5730 real(
preal),
dimension(3) :: eu
5741 function cu2ax(cu)
result(ax)
5743 real(
preal),
intent(in),
dimension(3) :: cu
5744 real(
preal),
dimension(4) :: ax
5755 pure function cu2ro(cu)
result(ro)
5757 real(
preal),
intent(in),
dimension(3) :: cu
5758 real(
preal),
dimension(4) :: ro
5769 pure function cu2ho(cu)
result(ho)
5771 real(
preal),
intent(in),
dimension(3) :: cu
5772 real(
preal),
dimension(3) :: ho
5785 real(pReal),
dimension(4) :: qu, ax, ro
5786 real(pReal),
dimension(3) :: x, eu, ho, v3
5787 real(pReal),
dimension(3,3) :: om, t33
5788 real(pReal),
dimension(3,3,3,3) :: t3333
5789 character(len=pStringLen) :: msg
5804 qu =
eu2qu([0.0_preal,0.0_preal,0.0_preal])
5808 qu = [0.0_preal,0.0_preal,1.0_preal,0.0_preal]
5810 qu =
ro2qu([1.0_preal,0.0_preal,0.0_preal,ieee_value(1.0_preal, ieee_positive_inf)])
5812 qu =
ax2qu([1.0_preal,0.0_preal,0.0_preal,0.0_preal])
5814 call random_number(x)
5816 b = sqrt(1-0_preal -x(3))
5817 qu = [cos(2.0_preal*
pi*x(1))*a,&
5818 sin(2.0_preal*
pi*x(2))*b,&
5819 cos(2.0_preal*
pi*x(2))*b,&
5820 sin(2.0_preal*
pi*x(1))*a]
5821 if(qu(1)<0.0_preal) qu = qu * (-1.0_preal)
5824 if(
dneq0(norm2(
om2qu(
qu2om(qu))-qu),1.0e-12_preal)) msg = trim(msg)//
'om2qu/qu2om,'
5825 if(
dneq0(norm2(
eu2qu(
qu2eu(qu))-qu),1.0e-12_preal)) msg = trim(msg)//
'eu2qu/qu2eu,'
5826 if(
dneq0(norm2(
ax2qu(
qu2ax(qu))-qu),1.0e-12_preal)) msg = trim(msg)//
'ax2qu/qu2ax,'
5827 if(
dneq0(norm2(
ro2qu(
qu2ro(qu))-qu),1.0e-12_preal)) msg = trim(msg)//
'ro2qu/qu2ro,'
5828 if(
dneq0(norm2(
ho2qu(
qu2ho(qu))-qu),1.0e-7_preal)) msg = trim(msg)//
'ho2qu/qu2ho,'
5829 if(
dneq0(norm2(
cu2qu(
qu2cu(qu))-qu),1.0e-7_preal)) msg = trim(msg)//
'cu2qu/qu2cu,'
5867 call r%fromMatrix(om)
5869 call random_number(v3)
5870 if(all(
dneq(r%rotVector(r%rotVector(v3),active=.true.),v3,1.0e-12_preal))) &
5871 msg = trim(msg)//
'rotVector,'
5873 call random_number(t33)
5874 if(all(
dneq(r%rotTensor2(r%rotTensor2(t33),active=.true.),t33,1.0e-12_preal))) &
5875 msg = trim(msg)//
'rotTensor2,'
5877 call random_number(t3333)
5878 if(all(
dneq(r%rotTensor4(r%rotTensor4(t3333),active=.true.),t3333,1.0e-12_preal))) &
5879 msg = trim(msg)//
'rotTensor4,'
5881 if(len_trim(msg) /= 0)
call io_error(0,ext_msg=msg)
5889 # 16 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
5891 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/FEsolving.f90" 1
5905 integer,
dimension(2) :: &
5906 fesolving_execelem, & !< for ping-pong scheme always whole range, otherwise one specific element
5910 logical,
dimension(:,:),
allocatable :: &
5915 # 17 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
5917 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/element.f90" 1
5934 geomtype, & !< geometry type (same for same dimension and same number of integration points)
5938 ncellnodespercell, &
5941 character(len=:),
allocatable :: &
5943 integer,
dimension(:,:),
allocatable :: &
5944 cell, & !< intra-element (cell) nodes that constitute a cell
5947 integer,
dimension(:,:),
allocatable :: &
5951 cellnodeparentnodeweights
5957 integer,
parameter :: &
5960 integer,
dimension(NELEMTYPE),
parameter ::
nnode = &
5978 integer,
dimension(NELEMTYPE),
parameter ::
geomtype = &
5996 integer,
dimension(maxval(GEOMTYPE)),
parameter ::
ncellnode = &
6010 integer,
dimension(maxval(GEOMTYPE)),
parameter ::
nip = &
6024 integer,
dimension(maxval(GEOMTYPE)),
parameter ::
celltype = &
6068 integer,
dimension(NIPNEIGHBOR(CELLTYPE(1)),NIP(1)),
parameter ::
ipneighbor1 = &
6077 integer,
dimension(NIPNEIGHBOR(CELLTYPE(2)),NIP(2)),
parameter ::
ipneighbor2 = &
6088 integer,
dimension(NIPNEIGHBOR(CELLTYPE(3)),NIP(3)),
parameter ::
ipneighbor3 = &
6100 integer,
dimension(NIPNEIGHBOR(CELLTYPE(4)),NIP(4)),
parameter ::
ipneighbor4 = &
6117 integer,
dimension(NIPNEIGHBOR(CELLTYPE(5)),NIP(5)),
parameter ::
ipneighbor5 = &
6126 integer,
dimension(NIPNEIGHBOR(CELLTYPE(6)),NIP(6)),
parameter ::
ipneighbor6 = &
6129 -2, 1, 3,-2, 4,-1, &
6138 integer,
dimension(NIPNEIGHBOR(CELLTYPE(7)),NIP(7)),
parameter ::
ipneighbor7 = &
6141 -3, 1, 3,-2, 5,-1, &
6144 -3, 4, 6,-2,-5, 2, &
6152 integer,
dimension(NIPNEIGHBOR(CELLTYPE(8)),NIP(8)),
parameter ::
ipneighbor8 = &
6161 integer,
dimension(NIPNEIGHBOR(CELLTYPE(9)),NIP(9)),
parameter ::
ipneighbor9 = &
6164 -3, 1, 4,-2, 6,-1, &
6166 -3, 3,-4, 2, 8,-1, &
6168 -3, 5, 8,-2,-6, 2, &
6177 integer,
dimension(NIPNEIGHBOR(CELLTYPE(10)),NIP(10)),
parameter ::
ipneighbor10 = &
6181 -3, 2, 6,-2,12,-1, &
6184 -3, 5, 9, 3,15,-1, &
6187 -3, 8,-4, 6,18,-1, &
6188 11,-5,13,-2,19, 1, &
6189 12,10,14,-2,20, 2, &
6190 -3,11,15,-2,21, 3, &
6191 14,-5,16,10,22, 4, &
6192 15,13,17,11,23, 5, &
6193 -3,14,18,12,24, 6, &
6194 17,-5,-4,13,25, 7, &
6195 18,16,-4,14,26, 8, &
6196 -3,17,-4,15,27, 9, &
6197 20,-5,22,-2,-6,10, &
6198 21,19,23,-2,-6,11, &
6199 -3,20,24,-2,-6,12, &
6200 23,-5,25,19,-6,13, &
6201 24,22,26,20,-6,14, &
6202 -3,23,27,21,-6,15, &
6203 26,-5,-4,22,-6,16, &
6204 27,25,-4,23,-6,17, &
6258 1, 0, 0, 0, 0, 0, 0, 0, &
6259 0, 1, 0, 0, 0, 0, 0, 0, &
6260 0, 0, 1, 0, 0, 0, 0, 0, &
6261 0, 0, 0, 1, 0, 0, 0, 0, &
6262 1, 0, 0, 0, 2, 0, 0, 0, &
6263 0, 1, 0, 0, 2, 0, 0, 0, &
6264 0, 1, 0, 0, 0, 2, 0, 0, &
6265 0, 0, 1, 0, 0, 2, 0, 0, &
6266 0, 0, 1, 0, 0, 0, 2, 0, &
6267 0, 0, 0, 1, 0, 0, 2, 0, &
6268 0, 0, 0, 1, 0, 0, 0, 2, &
6269 1, 0, 0, 0, 0, 0, 0, 2, &
6270 4, 1, 1, 1, 8, 2, 2, 8, &
6271 1, 4, 1, 1, 8, 8, 2, 2, &
6272 1, 1, 4, 1, 2, 8, 8, 2, &
6273 1, 1, 1, 4, 2, 2, 8, 8 &
6282 1, 0, 0, 0, 0, 0, 0, 0, &
6283 0, 1, 0, 0, 0, 0, 0, 0, &
6284 0, 0, 1, 0, 0, 0, 0, 0, &
6285 0, 0, 0, 1, 0, 0, 0, 0, &
6286 0, 0, 0, 0, 1, 0, 0, 0, &
6287 0, 0, 0, 0, 0, 1, 0, 0, &
6288 0, 0, 0, 0, 0, 0, 1, 0, &
6289 0, 0, 0, 0, 0, 0, 0, 1, &
6290 1, 1, 1, 1, 2, 2, 2, 2 &
6334 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6335 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, &
6336 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, &
6337 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, &
6338 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, &
6339 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, &
6340 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, &
6341 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, &
6342 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, &
6343 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, &
6344 1, 1, 1, 0, 2, 2, 2, 0, 0, 0, &
6345 1, 1, 0, 1, 2, 0, 0, 2, 2, 0, &
6346 0, 1, 1, 1, 0, 2, 0, 0, 2, 2, &
6347 1, 0, 1, 1, 0, 0, 2, 2, 0, 2, &
6348 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 &
6386 1, 0, 0, 0, 0, 0, 0, 0, &
6387 0, 1, 0, 0, 0, 0, 0, 0, &
6388 0, 0, 1, 0, 0, 0, 0, 0, &
6389 0, 0, 0, 1, 0, 0, 0, 0, &
6390 0, 0, 0, 0, 1, 0, 0, 0, &
6391 0, 0, 0, 0, 0, 1, 0, 0, &
6392 0, 0, 0, 0, 0, 0, 1, 0, &
6393 0, 0, 0, 0, 0, 0, 0, 1 &
6402 1, 0, 0, 0, 0, 0, 0, 0, &
6403 0, 1, 0, 0, 0, 0, 0, 0, &
6404 0, 0, 1, 0, 0, 0, 0, 0, &
6405 0, 0, 0, 1, 0, 0, 0, 0, &
6406 0, 0, 0, 0, 1, 0, 0, 0, &
6407 0, 0, 0, 0, 0, 1, 0, 0, &
6408 0, 0, 0, 0, 0, 0, 1, 0, &
6409 0, 0, 0, 0, 0, 0, 0, 1, &
6410 1, 1, 0, 0, 0, 0, 0, 0, &
6411 0, 1, 1, 0, 0, 0, 0, 0, &
6412 0, 0, 1, 1, 0, 0, 0, 0, &
6413 1, 0, 0, 1, 0, 0, 0, 0, &
6414 0, 0, 0, 0, 1, 1, 0, 0, &
6415 0, 0, 0, 0, 0, 1, 1, 0, &
6416 0, 0, 0, 0, 0, 0, 1, 1, &
6417 0, 0, 0, 0, 1, 0, 0, 1, &
6418 1, 0, 0, 0, 1, 0, 0, 0, &
6419 0, 1, 0, 0, 0, 1, 0, 0, &
6420 0, 0, 1, 0, 0, 0, 1, 0, &
6421 0, 0, 0, 1, 0, 0, 0, 1, &
6422 1, 1, 1, 1, 0, 0, 0, 0, &
6423 1, 1, 0, 0, 1, 1, 0, 0, &
6424 0, 1, 1, 0, 0, 1, 1, 0, &
6425 0, 0, 1, 1, 0, 0, 1, 1, &
6426 1, 0, 0, 1, 1, 0, 0, 1, &
6427 0, 0, 0, 0, 1, 1, 1, 1, &
6428 1, 1, 1, 1, 1, 1, 1, 1 &
6437 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6438 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6439 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6440 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6441 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6442 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6443 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6444 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6445 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6446 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6448 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, &
6449 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, &
6450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, &
6451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, &
6452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, &
6453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, &
6454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, &
6455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, &
6456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, &
6457 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, &
6458 1, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, &
6459 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, &
6460 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 2, &
6461 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, &
6462 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, &
6463 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 &
6472 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6473 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6474 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6475 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6476 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6477 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6478 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6479 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6480 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6481 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6482 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6483 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6484 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6485 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, &
6486 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, &
6487 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, &
6488 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, &
6489 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, &
6490 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, &
6491 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, &
6492 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, &
6493 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, &
6494 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, &
6495 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, &
6496 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, &
6497 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, &
6498 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, &
6499 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, &
6500 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, &
6501 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, &
6502 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, &
6503 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, &
6504 4, 1, 1, 1, 0, 0, 0, 0, 8, 2, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, &
6505 1, 4, 1, 1, 0, 0, 0, 0, 8, 8, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, &
6506 1, 1, 4, 1, 0, 0, 0, 0, 2, 8, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, &
6507 1, 1, 1, 4, 0, 0, 0, 0, 2, 2, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, &
6508 4, 1, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 8, 2, 0, 0, &
6509 1, 4, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 2, 8, 0, 0, &
6510 0, 4, 1, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 8, 2, 0, &
6511 0, 1, 4, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 2, 8, 0, &
6512 0, 0, 4, 1, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 8, 2, &
6513 0, 0, 1, 4, 0, 0, 1, 1, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 2, 8, &
6514 1, 0, 0, 4, 1, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 2, 2, 0, 0, 8, &
6515 4, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 2, 8, 0, 0, 2, &
6516 1, 1, 0, 0, 4, 1, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0, &
6517 1, 1, 0, 0, 1, 4, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 2, 8, 0, 0, &
6518 0, 1, 1, 0, 0, 4, 1, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, &
6519 0, 1, 1, 0, 0, 1, 4, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 2, 8, 0, &
6520 0, 0, 1, 1, 0, 0, 4, 1, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 8, 2, &
6521 0, 0, 1, 1, 0, 0, 1, 4, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 2, 8, &
6522 1, 0, 0, 1, 1, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 8, 2, 0, 0, 8, &
6523 1, 0, 0, 1, 4, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, 8, 0, 0, 2, &
6524 0, 0, 0, 0, 4, 1, 1, 1, 0, 0, 0, 0, 8, 2, 2, 8, 0, 0, 0, 0, &
6525 0, 0, 0, 0, 1, 4, 1, 1, 0, 0, 0, 0, 8, 8, 2, 2, 0, 0, 0, 0, &
6526 0, 0, 0, 0, 1, 1, 4, 1, 0, 0, 0, 0, 2, 8, 8, 2, 0, 0, 0, 0, &
6527 0, 0, 0, 0, 1, 1, 1, 4, 0, 0, 0, 0, 2, 2, 8, 8, 0, 0, 0, 0, &
6528 24, 8, 4, 8, 8, 4, 3, 4, 32,12,12,32, 12, 4, 4,12, 32,12, 4,12, &
6529 8,24, 8, 4, 4, 8, 4, 3, 32,32,12,12, 12,12, 4, 4, 12,32,12, 4, &
6530 4, 8,24, 8, 3, 4, 8, 4, 12,32,32,12, 4,12,12, 4, 4,12,32,12, &
6531 8, 4, 8,24, 4, 3, 4, 8, 12,12,32,32, 4, 4,12,12, 12, 4,12,32, &
6532 8, 4, 3, 4, 24, 8, 4, 8, 12, 4, 4,12, 32,12,12,32, 32,12, 4,12, &
6533 4, 8, 4, 3, 8,24, 8, 4, 12,12, 4, 4, 32,32,12,12, 12,32,12, 4, &
6534 3, 4, 8, 4, 4, 8,24, 8, 4,12,12, 4, 12,32,32,12, 4,12,32,12, &
6535 4, 3, 4, 8, 8, 4, 8,24, 4, 4,12,12, 12,12,32,32, 12, 4,12,32 &
6543 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(1)),NIP(1)),
parameter ::
cell1 = &
6552 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(2)),NIP(2)),
parameter ::
cell2 = &
6563 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(3)),NIP(3)),
parameter ::
cell3 = &
6575 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(4)),NIP(4)),
parameter ::
cell4 = &
6592 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(5)),NIP(5)),
parameter ::
cell5 = &
6601 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(6)),NIP(6)),
parameter ::
cell6 = &
6603 1, 5,11, 7, 8,12,15,14, &
6604 5, 2, 6,11,12, 9,13,15, &
6605 7,11, 6, 3,14,15,13,10, &
6606 8,12,15, 4, 4, 9,13,10 &
6613 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(7)),NIP(7)),
parameter ::
cell7 = &
6615 1, 7,16, 9,10,17,21,19, &
6616 7, 2, 8,16,17,11,18,21, &
6617 9,16, 8, 3,19,21,18,12, &
6618 10,17,21,19, 4,13,20,15, &
6619 17,11,18,21,13, 5,14,20, &
6620 19,21,18,12,15,20,14, 6 &
6627 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(8)),NIP(8)),
parameter ::
cell8 = &
6629 1, 2, 3, 4, 5, 6, 7, 8 &
6636 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)),
parameter ::
cell9 = &
6638 1, 9,21,12,17,22,27,25, &
6639 9, 2,10,21,22,18,23,27, &
6640 12,21,11, 4,25,27,24,20, &
6641 21,10, 3,11,27,23,19,24, &
6642 17,22,27,25, 5,13,26,16, &
6643 22,18,23,27,13, 6,14,26, &
6644 25,27,24,20,16,26,15, 8, &
6645 27,23,19,24,26,14, 7,15 &
6652 integer,
dimension(NCELLNODEPERCELL(CELLTYPE(10)),NIP(10)),
parameter ::
cell10 = &
6654 1, 9,33,16,17,37,57,44, &
6655 9,10,34,33,37,38,58,57, &
6656 10, 2,11,34,38,18,39,58, &
6657 16,33,36,15,44,57,60,43, &
6658 33,34,35,36,57,58,59,60, &
6659 34,11,12,35,58,39,40,59, &
6660 15,36,14, 4,43,60,42,20, &
6661 36,35,13,14,60,59,41,42, &
6662 35,12, 3,13,59,40,19,41, &
6663 17,37,57,44,21,45,61,52, &
6664 37,38,58,57,45,46,62,61, &
6665 38,18,39,58,46,22,47,62, &
6666 44,57,60,43,52,61,64,51, &
6667 57,58,59,60,61,62,63,64, &
6668 58,39,40,59,62,47,48,63, &
6669 43,60,42,20,51,64,50,24, &
6670 60,59,41,42,64,63,49,50, &
6671 59,40,19,41,63,48,23,49, &
6672 21,45,61,52, 5,25,53,32, &
6673 45,46,62,61,25,26,54,53, &
6674 46,22,47,62,26, 6,27,54, &
6675 52,61,64,51,32,53,56,31, &
6676 61,62,63,64,53,54,55,56, &
6677 62,47,48,63,54,27,28,55, &
6678 51,64,50,24,31,56,30, 8, &
6679 64,63,49,50,56,55,29,30, &
6680 63,48,23,49,55,28, 7,29 &
6688 integer,
dimension(NCELLNODEPERCELLFACE(1),NIPNEIGHBOR(1)),
parameter ::
cellface1 = &
6699 integer,
dimension(NCELLNODEPERCELLFACE(2),NIPNEIGHBOR(2)),
parameter ::
cellface2 = &
6711 integer,
dimension(NCELLNODEPERCELLFACE(3),NIPNEIGHBOR(3)),
parameter ::
cellface3 = &
6723 integer,
dimension(NCELLNODEPERCELLFACE(4),NIPNEIGHBOR(4)),
parameter ::
cellface4 = &
6747 integer,
intent(in) :: elemType
6749 self%elemType = elemtype
6751 self%Nnodes =
nnode(self%elemType)
6752 self%geomType =
geomtype(self%elemType)
6754 select case (self%elemType)
6782 call io_error(0,ext_msg=
'invalid element type')
6786 self%NcellNodes =
ncellnode(self%geomType)
6787 self%nIPs =
nip(self%geomType)
6788 self%cellType =
celltype(self%geomType)
6790 select case (self%geomType)
6825 select case(self%cellType)
6828 self%vtkType =
'TRIANGLE'
6831 self%vtkType =
'QUAD'
6834 self%vtkType =
'TETRA'
6837 self%vtkType =
'HEXAHEDRON'
6840 self%nIPneighbors =
size(self%IPneighbor,1)
6842 write(6,
'(/,a)')
' <<<+- element_init -+>>>';
flush(6)
6844 write(6,*)
' element type: ',self%elemType
6845 write(6,*)
' geom type: ',self%geomType
6846 write(6,*)
' cell type: ',self%cellType
6847 write(6,*)
' # node: ',self%Nnodes
6848 write(6,*)
' # IP: ',self%nIPs
6849 write(6,*)
' # cellnode: ',self%Ncellnodes
6850 write(6,*)
' # cellnode/cell: ',self%NcellnodesPerCell
6851 write(6,*)
' # IP neighbor: ',self%nIPneighbors
6856 # 18 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
6858 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/HDF5_utilities.f90" 1
6947 integer(SIZE_T) :: typeSize
6949 write(6,
'(/,a)')
' <<<+- HDF5_Utilities init -+>>>'
6953 call h5open_f(hdferr)
6954 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_Utilities_init: h5open_f')
6956 call h5tget_size_f(h5t_native_integer,typesize, hdferr)
6957 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_Utilities_init: h5tget_size_f (int)')
6958 if (int(bit_size(0),size_t)/=typesize*8) &
6959 call io_error(0,ext_msg=
'Default integer size does not match H5T_NATIVE_INTEGER')
6961 call h5tget_size_f(h5t_native_double,typesize, hdferr)
6962 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_Utilities_init: h5tget_size_f (double)')
6963 if (int(storage_size(0.0_preal),size_t)/=typesize*8) &
6964 call io_error(0,ext_msg=
'pReal does not match H5T_NATIVE_DOUBLE')
6972 integer(HID_T) function hdf5_openfile(fileName,mode,parallel)
6974 character(len=*),
intent(in) :: filename
6975 character,
intent(in),
optional :: mode
6976 logical,
intent(in),
optional :: parallel
6979 integer(HID_T) :: plist_id
6982 if (
present(mode))
then
6988 call h5pcreate_f(h5p_file_access_f, plist_id, hdferr)
6989 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_openFile: h5pcreate_f')
6999 call h5fcreate_f(filename,h5f_acc_trunc_f,
hdf5_openfile,hdferr,access_prp = plist_id)
7000 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_openFile: h5fcreate_f (w)')
7001 elseif(m ==
'a')
then
7002 call h5fopen_f(filename,h5f_acc_rdwr_f,
hdf5_openfile,hdferr,access_prp = plist_id)
7003 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_openFile: h5fopen_f (a)')
7004 elseif(m ==
'r')
then
7005 call h5fopen_f(filename,h5f_acc_rdonly_f,
hdf5_openfile,hdferr,access_prp = plist_id)
7006 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_openFile: h5fopen_f (r)')
7008 call io_error(1,ext_msg=
'HDF5_openFile: h5fopen_f unknown access mode: '//trim(m))
7011 call h5pclose_f(plist_id, hdferr)
7012 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_openFile: h5pclose_f')
7022 integer(HID_T),
intent(in) :: fileHandle
7026 call h5fclose_f(filehandle,hdferr)
7027 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_closeFile: h5fclose_f')
7037 integer(HID_T),
intent(in) :: filehandle
7038 character(len=*),
intent(in) :: groupname
7041 integer(HID_T) :: aplist_id
7045 call h5pcreate_f(h5p_group_access_f, aplist_id, hdferr)
7046 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_addGroup: h5pcreate_f ('//trim(groupname)//
')')
7057 call h5gcreate_f(filehandle, trim(groupname),
hdf5_addgroup, hdferr, object_namelen_default_f,gapl_id = aplist_id)
7058 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_addGroup: h5gcreate_f ('//trim(groupname)//
')')
7060 call h5pclose_f(aplist_id,hdferr)
7070 integer(HID_T),
intent(in) :: filehandle
7071 character(len=*),
intent(in) :: groupname
7075 integer(HID_T) :: aplist_id
7076 logical :: is_collective
7081 call h5pcreate_f(h5p_group_access_f, aplist_id, hdferr)
7082 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_openGroup: h5pcreate_f ('//trim(groupname)//
')')
7093 call h5gopen_f(filehandle, trim(groupname),
hdf5_opengroup, hdferr, gapl_id = aplist_id)
7094 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_openGroup: h5gopen_f ('//trim(groupname)//
')')
7096 call h5pclose_f(aplist_id,hdferr)
7106 integer(HID_T),
intent(in) :: group_id
7109 call h5gclose_f(group_id, hdferr)
7110 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_closeGroup: h5gclose_f (el is ID)', el = int(group_id))
7120 integer(HID_T),
intent(in) :: loc_id
7121 character(len=*),
intent(in),
optional :: path
7124 character(len=pStringLen) :: p
7126 if (
present(path))
then
7133 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_objectExists: h5oexists_by_name_f')
7137 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_objectExists: h5oexists_by_name_f')
7148 integer(HID_T),
intent(in) :: loc_id
7149 character(len=*),
intent(in) :: attrLabel, attrValue
7150 character(len=*),
intent(in),
optional :: path
7153 integer(HID_T) :: attr_id, space_id, type_id
7154 logical :: attrExists
7155 character(len=pStringLen) :: p
7157 if (
present(path))
then
7163 call h5screate_f(h5s_scalar_f,space_id,hdferr)
7164 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5screate_f')
7165 call h5tcopy_f(h5t_native_character, type_id, hdferr)
7166 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5tcopy_f')
7167 call h5tset_size_f(type_id, int(len_trim(attrvalue),hsize_t), hdferr)
7168 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5tset_size_f')
7169 call h5aexists_by_name_f(loc_id,trim(p),attrlabel,attrexists,hdferr)
7170 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5aexists_by_name_f')
7171 if (attrexists)
then
7172 call h5adelete_by_name_f(loc_id, trim(p), attrlabel, hdferr)
7173 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5adelete_by_name_f')
7175 call h5acreate_by_name_f(loc_id,trim(p),trim(attrlabel),type_id,space_id,attr_id,hdferr)
7176 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5acreate_f')
7177 call h5awrite_f(attr_id, type_id, trim(attrvalue), int([1],hsize_t), hdferr)
7178 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5awrite_f')
7179 call h5aclose_f(attr_id,hdferr)
7180 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5aclose_f')
7181 call h5tclose_f(type_id,hdferr)
7182 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5tclose_f')
7183 call h5sclose_f(space_id,hdferr)
7184 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_str: h5sclose_f')
7194 integer(HID_T),
intent(in) :: loc_id
7195 character(len=*),
intent(in) :: attrLabel
7196 integer,
intent(in) :: attrValue
7197 character(len=*),
intent(in),
optional :: path
7200 integer(HID_T) :: attr_id, space_id
7201 logical :: attrExists
7202 character(len=pStringLen) :: p
7204 if (
present(path))
then
7210 call h5screate_f(h5s_scalar_f,space_id,hdferr)
7211 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5screate_f')
7212 call h5aexists_by_name_f(loc_id,trim(p),attrlabel,attrexists,hdferr)
7213 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5aexists_by_name_f')
7214 if (attrexists)
then
7215 call h5adelete_by_name_f(loc_id, trim(p), attrlabel, hdferr)
7216 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5adelete_by_name_f')
7218 call h5acreate_by_name_f(loc_id,trim(p),trim(attrlabel),h5t_native_integer,space_id,attr_id,hdferr)
7219 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5acreate_f')
7220 call h5awrite_f(attr_id, h5t_native_integer, attrvalue, int([1],hsize_t), hdferr)
7221 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5awrite_f')
7222 call h5aclose_f(attr_id,hdferr)
7223 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5tclose_f')
7224 call h5sclose_f(space_id,hdferr)
7225 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int: h5sclose_f')
7235 integer(HID_T),
intent(in) :: loc_id
7236 character(len=*),
intent(in) :: attrLabel
7237 real(pReal),
intent(in) :: attrValue
7238 character(len=*),
intent(in),
optional :: path
7241 integer(HID_T) :: attr_id, space_id
7242 logical :: attrExists
7243 character(len=pStringLen) :: p
7245 if (
present(path))
then
7251 call h5screate_f(h5s_scalar_f,space_id,hdferr)
7252 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5screate_f')
7253 call h5aexists_by_name_f(loc_id,trim(p),attrlabel,attrexists,hdferr)
7254 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5aexists_by_name_f')
7255 if (attrexists)
then
7256 call h5adelete_by_name_f(loc_id, trim(p), attrlabel, hdferr)
7257 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5adelete_by_name_f')
7259 call h5acreate_by_name_f(loc_id,trim(p),trim(attrlabel),h5t_native_double,space_id,attr_id,hdferr)
7260 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5acreate_f')
7261 call h5awrite_f(attr_id, h5t_native_double, attrvalue, int([1],hsize_t), hdferr)
7262 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5awrite_f')
7263 call h5aclose_f(attr_id,hdferr)
7264 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5tclose_f')
7265 call h5sclose_f(space_id,hdferr)
7266 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_real: h5sclose_f')
7276 integer(HID_T),
intent(in) :: loc_id
7277 character(len=*),
intent(in) :: attrLabel
7278 integer,
intent(in),
dimension(:) :: attrValue
7279 character(len=*),
intent(in),
optional :: path
7282 integer(HID_T) :: attr_id, space_id
7283 integer(HSIZE_T),
dimension(1) :: array_size
7284 logical :: attrExists
7285 character(len=pStringLen) :: p
7287 if (
present(path))
then
7293 array_size =
size(attrvalue,kind=hsize_t)
7295 call h5screate_simple_f(1, array_size, space_id, hdferr, array_size)
7296 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5screate_f')
7297 call h5aexists_by_name_f(loc_id,trim(p),attrlabel,attrexists,hdferr)
7298 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5aexists_by_name_f')
7299 if (attrexists)
then
7300 call h5adelete_by_name_f(loc_id, trim(p), attrlabel, hdferr)
7301 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5adelete_by_name_f')
7303 call h5acreate_by_name_f(loc_id,trim(p),trim(attrlabel),h5t_native_integer,space_id,attr_id,hdferr)
7304 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5acreate_f')
7305 call h5awrite_f(attr_id, h5t_native_integer, attrvalue, array_size, hdferr)
7306 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5awrite_f')
7307 call h5aclose_f(attr_id,hdferr)
7308 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5tclose_f')
7309 call h5sclose_f(space_id,hdferr)
7310 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5sclose_f')
7320 integer(HID_T),
intent(in) :: loc_id
7321 character(len=*),
intent(in) :: attrLabel
7322 real(pReal),
intent(in),
dimension(:) :: attrValue
7323 character(len=*),
intent(in),
optional :: path
7326 integer(HID_T) :: attr_id, space_id
7327 integer(HSIZE_T),
dimension(1) :: array_size
7328 logical :: attrExists
7329 character(len=pStringLen) :: p
7331 if (
present(path))
then
7337 array_size =
size(attrvalue,kind=hsize_t)
7339 call h5screate_simple_f(1, array_size, space_id, hdferr, array_size)
7340 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5screate_f')
7341 call h5aexists_by_name_f(loc_id,trim(p),attrlabel,attrexists,hdferr)
7342 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5aexists_by_name_f')
7343 if (attrexists)
then
7344 call h5adelete_by_name_f(loc_id, trim(p), attrlabel, hdferr)
7345 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5adelete_by_name_f')
7347 call h5acreate_by_name_f(loc_id,trim(p),trim(attrlabel),h5t_native_double,space_id,attr_id,hdferr)
7348 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5acreate_f')
7349 call h5awrite_f(attr_id, h5t_native_double, attrvalue, array_size, hdferr)
7350 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5awrite_f')
7351 call h5aclose_f(attr_id,hdferr)
7352 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5tclose_f')
7353 call h5sclose_f(space_id,hdferr)
7354 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_addAttribute_int_array: h5sclose_f')
7364 character(len=*),
intent(in) :: target_name, link_name
7365 integer(HID_T),
intent(in) :: loc_id
7367 logical :: linkExists
7369 call h5lexists_f(loc_id, link_name,linkexists, hdferr)
7370 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_setLink: h5lexists_soft_f ('//trim(link_name)//
')')
7371 if (linkexists)
then
7372 call h5ldelete_f(loc_id,link_name, hdferr)
7373 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_setLink: h5ldelete_soft_f ('//trim(link_name)//
')')
7375 call h5lcreate_soft_f(target_name, loc_id, link_name, hdferr)
7376 if (hdferr < 0)
call io_error(1,ext_msg =
'HDF5_setLink: h5lcreate_soft_f ('//trim(target_name)//
' '//trim(link_name)//
')')
7386 real(pReal),
intent(out),
dimension(:) :: dataset
7387 integer(HID_T),
intent(in) :: loc_id
7388 character(len=*),
intent(in) :: datasetName
7389 logical,
intent(in),
optional :: parallel
7391 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7392 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7394 myShape, & !< shape of the dataset (this process)
7400 myshape = int(shape(dataset),hsize_t)
7401 if (any(myshape(1:
size(myshape)-1) == 0))
return
7405 if (
present(parallel))
then
7406 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7407 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7409 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7410 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7413 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7414 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7415 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real1: h5dread_f')
7417 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7426 real(pReal),
intent(out),
dimension(:,:) :: dataset
7427 integer(HID_T),
intent(in) :: loc_id
7428 character(len=*),
intent(in) :: datasetName
7429 logical,
intent(in),
optional :: parallel
7431 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7432 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7434 myShape, & !< shape of the dataset (this process)
7440 myshape = int(shape(dataset),hsize_t)
7441 if (any(myshape(1:
size(myshape)-1) == 0))
return
7445 if (
present(parallel))
then
7446 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7447 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7449 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7450 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7453 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7454 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7455 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real2: h5dread_f')
7457 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7466 real(pReal),
intent(out),
dimension(:,:,:) :: dataset
7467 integer(HID_T),
intent(in) :: loc_id
7468 character(len=*),
intent(in) :: datasetName
7469 logical,
intent(in),
optional :: parallel
7471 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7472 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7474 myShape, & !< shape of the dataset (this process)
7480 myshape = int(shape(dataset),hsize_t)
7481 if (any(myshape(1:
size(myshape)-1) == 0))
return
7485 if (
present(parallel))
then
7486 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7487 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7489 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7490 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7493 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7494 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7495 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real3: h5dread_f')
7497 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7506 real(pReal),
intent(out),
dimension(:,:,:,:) :: dataset
7507 integer(HID_T),
intent(in) :: loc_id
7508 character(len=*),
intent(in) :: datasetName
7509 logical,
intent(in),
optional :: parallel
7511 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7512 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7514 myShape, & !< shape of the dataset (this process)
7520 myshape = int(shape(dataset),hsize_t)
7521 if (any(myshape(1:
size(myshape)-1) == 0))
return
7525 if (
present(parallel))
then
7526 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7527 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7529 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7530 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7533 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7534 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7535 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real4: h5dread_f')
7537 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7546 real(pReal),
intent(out),
dimension(:,:,:,:,:) :: dataset
7547 integer(HID_T),
intent(in) :: loc_id
7548 character(len=*),
intent(in) :: datasetName
7549 logical,
intent(in),
optional :: parallel
7551 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7552 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7554 myShape, & !< shape of the dataset (this process)
7560 myshape = int(shape(dataset),hsize_t)
7561 if (any(myshape(1:
size(myshape)-1) == 0))
return
7565 if (
present(parallel))
then
7566 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7567 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7569 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7570 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7573 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7574 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7575 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real5: h5dread_f')
7577 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7586 real(pReal),
intent(out),
dimension(:,:,:,:,:,:) :: dataset
7587 integer(HID_T),
intent(in) :: loc_id
7588 character(len=*),
intent(in) :: datasetName
7589 logical,
intent(in),
optional :: parallel
7591 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7592 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7594 myShape, & !< shape of the dataset (this process)
7600 myshape = int(shape(dataset),hsize_t)
7601 if (any(myshape(1:
size(myshape)-1) == 0))
return
7605 if (
present(parallel))
then
7606 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7607 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7609 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7610 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7613 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7614 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7615 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real6: h5dread_f')
7617 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7626 real(pReal),
intent(out),
dimension(:,:,:,:,:,:,:) :: dataset
7627 integer(HID_T),
intent(in) :: loc_id
7628 character(len=*),
intent(in) :: datasetName
7629 logical,
intent(in),
optional :: parallel
7631 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7632 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7634 myShape, & !< shape of the dataset (this process)
7640 myshape = int(shape(dataset),hsize_t)
7641 if (any(myshape(1:
size(myshape)-1) == 0))
return
7645 if (
present(parallel))
then
7646 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7647 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7649 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7650 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7653 call h5dread_f(dset_id, h5t_native_double,dataset,totalshape, hdferr,&
7654 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7655 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_real7: h5dread_f')
7657 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7667 integer,
intent(out),
dimension(:) :: dataset
7668 integer(HID_T),
intent(in) :: loc_id
7669 character(len=*),
intent(in) :: datasetName
7670 logical,
intent(in),
optional :: parallel
7673 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7674 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7676 myShape, & !< shape of the dataset (this process)
7682 myshape = int(shape(dataset),hsize_t)
7683 if (any(myshape(1:
size(myshape)-1) == 0))
return
7687 if (
present(parallel))
then
7688 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7689 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7691 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7692 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7695 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7696 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7697 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int1: h5dread_f')
7699 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7708 integer,
intent(out),
dimension(:,:) :: dataset
7709 integer(HID_T),
intent(in) :: loc_id
7710 character(len=*),
intent(in) :: datasetName
7711 logical,
intent(in),
optional :: parallel
7713 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7714 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7716 myShape, & !< shape of the dataset (this process)
7722 myshape = int(shape(dataset),hsize_t)
7723 if (any(myshape(1:
size(myshape)-1) == 0))
return
7727 if (
present(parallel))
then
7728 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7729 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7731 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7732 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7735 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7736 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7737 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int2: h5dread_f')
7739 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7748 integer,
intent(out),
dimension(:,:,:) :: dataset
7749 integer(HID_T),
intent(in) :: loc_id
7750 character(len=*),
intent(in) :: datasetName
7751 logical,
intent(in),
optional :: parallel
7753 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7754 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7756 myShape, & !< shape of the dataset (this process)
7762 myshape = int(shape(dataset),hsize_t)
7763 if (any(myshape(1:
size(myshape)-1) == 0))
return
7767 if (
present(parallel))
then
7768 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7769 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7771 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7772 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7775 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7776 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7777 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int3: h5dread_f')
7779 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7788 integer,
intent(out),
dimension(:,:,:,:) :: dataset
7789 integer(HID_T),
intent(in) :: loc_id
7790 character(len=*),
intent(in) :: datasetName
7791 logical,
intent(in),
optional :: parallel
7793 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7794 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7796 myShape, & !< shape of the dataset (this process)
7802 myshape = int(shape(dataset),hsize_t)
7803 if (any(myshape(1:
size(myshape)-1) == 0))
return
7807 if (
present(parallel))
then
7808 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7809 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7811 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7812 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7815 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7816 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7817 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int4: h5dread_f')
7819 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7828 integer,
intent(out),
dimension(:,:,:,:,:) :: dataset
7829 integer(HID_T),
intent(in) :: loc_id
7830 character(len=*),
intent(in) :: datasetName
7831 logical,
intent(in),
optional :: parallel
7833 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7834 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7836 myShape, & !< shape of the dataset (this process)
7842 myshape = int(shape(dataset),hsize_t)
7843 if (any(myshape(1:
size(myshape)-1) == 0))
return
7847 if (
present(parallel))
then
7848 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7849 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7851 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7852 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7855 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7856 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7857 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int5: h5dread_f')
7859 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7868 integer,
intent(out),
dimension(:,:,:,:,:,:) :: dataset
7869 integer(HID_T),
intent(in) :: loc_id
7870 character(len=*),
intent(in) :: datasetName
7871 logical,
intent(in),
optional :: parallel
7873 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7874 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7876 myShape, & !< shape of the dataset (this process)
7882 myshape = int(shape(dataset),hsize_t)
7883 if (any(myshape(1:
size(myshape)-1) == 0))
return
7887 if (
present(parallel))
then
7888 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7889 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7891 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7892 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7895 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7896 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7897 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int6: h5dread_f')
7899 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7908 integer,
intent(out),
dimension(:,:,:,:,:,:,:) :: dataset
7909 integer(HID_T),
intent(in) :: loc_id
7910 character(len=*),
intent(in) :: datasetName
7911 logical,
intent(in),
optional :: parallel
7913 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
7914 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7916 myShape, & !< shape of the dataset (this process)
7922 myshape = int(shape(dataset),hsize_t)
7923 if (any(myshape(1:
size(myshape)-1) == 0))
return
7927 if (
present(parallel))
then
7928 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7929 mystart, totalshape, loc_id,myshape,datasetname,parallel)
7931 call initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
7932 mystart, totalshape, loc_id,myshape,datasetname,.false.)
7935 call h5dread_f(dset_id, h5t_native_integer,dataset,totalshape, hdferr,&
7936 file_space_id = filespace_id, xfer_prp = plist_id, mem_space_id = memspace_id)
7937 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_read_int7: h5dread_f')
7939 call finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
7949 real(pReal),
intent(inout),
dimension(:) :: dataset
7950 integer(HID_T),
intent(in) :: loc_id
7951 character(len=*),
intent(in) :: datasetName
7952 logical,
intent(in),
optional :: parallel
7956 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
7957 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
7959 myShape, & !< shape of the dataset (this process)
7964 myshape = int(shape(dataset),hsize_t)
7965 if (any(myshape(1:
size(myshape)-1) == 0))
return
7967 if (
present(parallel))
then
7969 mystart, totalshape,loc_id,myshape,datasetname,h5t_native_double,parallel)
7972 mystart, totalshape,loc_id,myshape,datasetname,h5t_native_double,.false.)
7975 if (product(totalshape) /= 0)
then
7976 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
7977 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
7978 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real1: h5dwrite_f')
7981 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
7990 real(pReal),
intent(inout),
dimension(:,:) :: dataset
7991 integer(HID_T),
intent(in) :: loc_id
7992 character(len=*),
intent(in) :: datasetName
7993 logical,
intent(in),
optional :: parallel
7997 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
7998 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8000 myShape, & !< shape of the dataset (this process)
8005 myshape = int(shape(dataset),hsize_t)
8006 if (any(myshape(1:
size(myshape)-1) == 0))
return
8008 if (
present(parallel))
then
8010 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8013 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8016 if (product(totalshape) /= 0)
then
8017 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8018 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8019 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real2: h5dwrite_f')
8022 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8031 real(pReal),
intent(inout),
dimension(:,:,:) :: dataset
8032 integer(HID_T),
intent(in) :: loc_id
8033 character(len=*),
intent(in) :: datasetName
8034 logical,
intent(in),
optional :: parallel
8038 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8039 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8041 myShape, & !< shape of the dataset (this process)
8046 myshape = int(shape(dataset),hsize_t)
8047 if (any(myshape(1:
size(myshape)-1) == 0))
return
8049 if (
present(parallel))
then
8051 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8054 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8057 if (product(totalshape) /= 0)
then
8058 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8059 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8060 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real3: h5dwrite_f')
8063 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8072 real(pReal),
intent(inout),
dimension(:,:,:,:) :: dataset
8073 integer(HID_T),
intent(in) :: loc_id
8074 character(len=*),
intent(in) :: datasetName
8075 logical,
intent(in),
optional :: parallel
8079 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8080 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8082 myShape, & !< shape of the dataset (this process)
8087 myshape = int(shape(dataset),hsize_t)
8088 if (any(myshape(1:
size(myshape)-1) == 0))
return
8090 if (
present(parallel))
then
8092 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8095 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8098 if (product(totalshape) /= 0)
then
8099 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8100 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8101 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real4: h5dwrite_f')
8104 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8114 real(pReal),
intent(inout),
dimension(:,:,:,:,:) :: dataset
8115 integer(HID_T),
intent(in) :: loc_id
8116 character(len=*),
intent(in) :: datasetName
8117 logical,
intent(in),
optional :: parallel
8121 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8122 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8124 myShape, & !< shape of the dataset (this process)
8129 myshape = int(shape(dataset),hsize_t)
8130 if (any(myshape(1:
size(myshape)-1) == 0))
return
8132 if (
present(parallel))
then
8134 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8137 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8140 if (product(totalshape) /= 0)
then
8141 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8142 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8143 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real5: h5dwrite_f')
8146 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8155 real(pReal),
intent(inout),
dimension(:,:,:,:,:,:) :: dataset
8156 integer(HID_T),
intent(in) :: loc_id
8157 character(len=*),
intent(in) :: datasetName
8158 logical,
intent(in),
optional :: parallel
8162 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8163 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8165 myShape, & !< shape of the dataset (this process)
8170 myshape = int(shape(dataset),hsize_t)
8171 if (any(myshape(1:
size(myshape)-1) == 0))
return
8173 if (
present(parallel))
then
8175 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8178 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8181 if (product(totalshape) /= 0)
then
8182 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8183 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8184 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real6: h5dwrite_f')
8187 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8196 real(pReal),
intent(inout),
dimension(:,:,:,:,:,:,:) :: dataset
8197 integer(HID_T),
intent(in) :: loc_id
8198 character(len=*),
intent(in) :: datasetName
8199 logical,
intent(in),
optional :: parallel
8203 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8204 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8206 myShape, & !< shape of the dataset (this process)
8211 myshape = int(shape(dataset),hsize_t)
8212 if (any(myshape(1:
size(myshape)-1) == 0))
return
8214 if (
present(parallel))
then
8216 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,parallel)
8219 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_double,.false.)
8222 if (product(totalshape) /= 0)
then
8223 call h5dwrite_f(dset_id, h5t_native_double,dataset,int(totalshape,hsize_t), hdferr,&
8224 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8225 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_real7: h5dwrite_f')
8228 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8238 integer,
intent(inout),
dimension(:) :: dataset
8239 integer(HID_T),
intent(in) :: loc_id
8240 character(len=*),
intent(in) :: datasetName
8241 logical,
intent(in),
optional :: parallel
8245 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8246 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8248 myShape, & !< shape of the dataset (this process)
8253 myshape = int(shape(dataset),hsize_t)
8254 if (any(myshape(1:
size(myshape)-1) == 0))
return
8256 if (
present(parallel))
then
8258 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8261 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8264 if (product(totalshape) /= 0)
then
8265 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8266 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8267 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int1: h5dwrite_f')
8270 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8279 integer,
intent(inout),
dimension(:,:) :: dataset
8280 integer(HID_T),
intent(in) :: loc_id
8281 character(len=*),
intent(in) :: datasetName
8282 logical,
intent(in),
optional :: parallel
8286 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8287 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8289 myShape, & !< shape of the dataset (this process)
8294 myshape = int(shape(dataset),hsize_t)
8295 if (any(myshape(1:
size(myshape)-1) == 0))
return
8297 if (
present(parallel))
then
8299 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8302 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8305 if (product(totalshape) /= 0)
then
8306 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8307 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8308 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int2: h5dwrite_f')
8311 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8320 integer,
intent(inout),
dimension(:,:,:) :: dataset
8321 integer(HID_T),
intent(in) :: loc_id
8322 character(len=*),
intent(in) :: datasetName
8323 logical,
intent(in),
optional :: parallel
8327 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8328 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8330 myShape, & !< shape of the dataset (this process)
8335 myshape = int(shape(dataset),hsize_t)
8336 if (any(myshape(1:
size(myshape)-1) == 0))
return
8338 if (
present(parallel))
then
8340 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8343 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8346 if (product(totalshape) /= 0)
then
8347 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8348 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8349 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int3: h5dwrite_f')
8352 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8361 integer,
intent(inout),
dimension(:,:,:,:) :: dataset
8362 integer(HID_T),
intent(in) :: loc_id
8363 character(len=*),
intent(in) :: datasetName
8364 logical,
intent(in),
optional :: parallel
8368 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8369 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8371 myShape, & !< shape of the dataset (this process)
8376 myshape = int(shape(dataset),hsize_t)
8377 if (any(myshape(1:
size(myshape)-1) == 0))
return
8379 if (
present(parallel))
then
8381 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8384 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8387 if (product(totalshape) /= 0)
then
8388 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8389 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8390 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int4: h5dwrite_f')
8393 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8402 integer,
intent(inout),
dimension(:,:,:,:,:) :: dataset
8403 integer(HID_T),
intent(in) :: loc_id
8404 character(len=*),
intent(in) :: datasetName
8405 logical,
intent(in),
optional :: parallel
8409 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8410 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8412 myShape, & !< shape of the dataset (this process)
8417 myshape = int(shape(dataset),hsize_t)
8418 if (any(myshape(1:
size(myshape)-1) == 0))
return
8420 if (
present(parallel))
then
8422 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8425 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8428 if (product(totalshape) /= 0)
then
8429 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8430 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8431 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int5: h5dwrite_f')
8434 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8443 integer,
intent(inout),
dimension(:,:,:,:,:,:) :: dataset
8444 integer(HID_T),
intent(in) :: loc_id
8445 character(len=*),
intent(in) :: datasetName
8446 logical,
intent(in),
optional :: parallel
8450 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8451 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8453 myShape, & !< shape of the dataset (this process)
8458 myshape = int(shape(dataset),hsize_t)
8459 if (any(myshape(1:
size(myshape)-1) == 0))
return
8461 if (
present(parallel))
then
8463 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8466 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8469 if (product(totalshape) /= 0)
then
8470 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8471 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8472 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int6: h5dwrite_f')
8475 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8484 integer,
intent(inout),
dimension(:,:,:,:,:,:,:) :: dataset
8485 integer(HID_T),
intent(in) :: loc_id
8486 character(len=*),
intent(in) :: datasetName
8487 logical,
intent(in),
optional :: parallel
8491 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id
8492 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8494 myShape, & !< shape of the dataset (this process)
8499 myshape = int(shape(dataset),hsize_t)
8500 if (any(myshape(1:
size(myshape)-1) == 0))
return
8502 if (
present(parallel))
then
8504 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,parallel)
8507 mystart, totalshape, loc_id,myshape,datasetname,h5t_native_integer,.false.)
8510 if (product(totalshape) /= 0)
then
8511 call h5dwrite_f(dset_id, h5t_native_integer,dataset,int(totalshape,hsize_t), hdferr,&
8512 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8513 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_int7: h5dwrite_f')
8516 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8528 type(
rotation),
intent(in),
dimension(:) :: dataset
8529 integer(HID_T),
intent(in) :: loc_id
8530 character(len=*),
intent(in) :: datasetName
8531 logical,
intent(in),
optional :: parallel
8534 real(pReal),
dimension(4,size(dataset)) :: dataset_asArray
8535 integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id,dtype_id,w_id,x_id,y_id,z_id
8536 integer(HSIZE_T),
dimension(size(shape(dataset))) :: &
8538 myShape, & !< shape of the dataset (this process)
8540 integer(SIZE_T) :: type_size_real
8543 do i = 1,
size(dataset)
8544 dataset_asarray(1:4,i) = dataset(i)%asQuaternion()
8549 myshape = int(shape(dataset),hsize_t)
8553 call h5tget_size_f(h5t_native_double, type_size_real, hdferr)
8555 call h5tcreate_f(h5t_compound_f, type_size_real*4_size_t, dtype_id, hdferr)
8556 call h5tinsert_f(dtype_id,
"w", type_size_real*0_size_t, h5t_native_double, hdferr)
8557 call h5tinsert_f(dtype_id,
"x", type_size_real*1_size_t, h5t_native_double, hdferr)
8558 call h5tinsert_f(dtype_id,
"y", type_size_real*2_size_t, h5t_native_double, hdferr)
8559 call h5tinsert_f(dtype_id,
"z", type_size_real*3_size_t, h5t_native_double, hdferr)
8561 if (
present(parallel))
then
8563 mystart, totalshape, loc_id,myshape,datasetname,dtype_id,parallel)
8566 mystart, totalshape, loc_id,myshape,datasetname,dtype_id,.false.)
8569 call h5pset_preserve_f(plist_id, .true., hdferr)
8571 if (product(totalshape) /= 0)
then
8572 call h5tcreate_f(h5t_compound_f, type_size_real, x_id, hdferr)
8573 call h5tinsert_f(x_id,
"x", 0_size_t, h5t_native_double, hdferr)
8574 call h5tcreate_f(h5t_compound_f, type_size_real, w_id, hdferr)
8575 call h5tinsert_f(w_id,
"w", 0_size_t, h5t_native_double, hdferr)
8576 call h5tcreate_f(h5t_compound_f, type_size_real, y_id, hdferr)
8577 call h5tinsert_f(y_id,
"y", 0_size_t, h5t_native_double, hdferr)
8578 call h5tcreate_f(h5t_compound_f, type_size_real, z_id, hdferr)
8579 call h5tinsert_f(z_id,
"z", 0_size_t, h5t_native_double, hdferr)
8581 call h5dwrite_f(dset_id, w_id,dataset_asarray(1,:),int(totalshape,hsize_t), hdferr,&
8582 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8583 call h5dwrite_f(dset_id, x_id,dataset_asarray(2,:),int(totalshape,hsize_t), hdferr,&
8584 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8585 call h5dwrite_f(dset_id, y_id,dataset_asarray(3,:),int(totalshape,hsize_t), hdferr,&
8586 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8587 call h5dwrite_f(dset_id, z_id,dataset_asarray(4,:),int(totalshape,hsize_t), hdferr,&
8588 file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
8589 if (hdferr < 0)
call io_error(1,ext_msg=
'HDF5_write_rotation: h5dwrite_f')
8592 call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8600 subroutine initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id, &
8601 myStart, globalShape, &
8602 loc_id,localShape,datasetName,parallel)
8604 integer(HID_T),
intent(in) :: loc_id
8605 character(len=*),
intent(in) :: datasetName
8606 logical,
intent(in) :: parallel
8607 integer(HSIZE_T),
intent(in),
dimension(:) :: &
8609 integer(HSIZE_T),
intent(out),
dimension(size(localShape,1)):: &
8612 integer(HID_T),
intent(out) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
8614 integer,
dimension(worldsize) :: &
8621 call h5pcreate_f(h5p_dataset_xfer_f, plist_id, hdferr)
8622 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5pcreate_f')
8626 readsize(
worldrank+1) = int(localshape(ubound(localshape,1)))
8627 # 1777 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/HDF5_utilities.f90"
8628 mystart = int(0,hsize_t)
8629 mystart(ubound(mystart)) = int(sum(readsize(1:
worldrank)),hsize_t)
8630 globalshape = [localshape(1:ubound(localshape,1)-1),int(sum(readsize),hsize_t)]
8634 call h5screate_simple_f(
size(localshape), localshape, memspace_id, hdferr, localshape)
8635 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5screate_simple_f/memspace_id')
8639 call h5pcreate_f(h5p_dataset_access_f, aplist_id, hdferr)
8640 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5pcreate_f')
8648 call h5dopen_f(loc_id,datasetname,dset_id,hdferr, dapl_id = aplist_id)
8649 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5dopen_f')
8650 call h5dget_space_f(dset_id, filespace_id, hdferr)
8651 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5dget_space_f')
8655 call h5sselect_hyperslab_f(filespace_id, h5s_select_set_f, mystart, localshape, hdferr)
8656 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_read: h5sselect_hyperslab_f')
8664 subroutine finalize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_id)
8666 integer(HID_T),
intent(in) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id
8669 call h5pclose_f(plist_id, hdferr)
8670 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_read: plist_id')
8671 call h5pclose_f(aplist_id, hdferr)
8672 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_read: aplist_id')
8673 call h5dclose_f(dset_id, hdferr)
8674 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_read: h5dclose_f')
8675 call h5sclose_f(filespace_id, hdferr)
8676 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_read: h5sclose_f/filespace_id')
8677 call h5sclose_f(memspace_id, hdferr)
8678 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_read: h5sclose_f/memspace_id')
8686 subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, &
8687 myStart, totalShape, &
8688 loc_id,myShape,datasetName,datatype,parallel)
8690 integer(HID_T),
intent(in) :: loc_id
8691 character(len=*),
intent(in) :: datasetName
8692 logical,
intent(in) :: parallel
8693 integer(HID_T),
intent(in) :: datatype
8694 integer(HSIZE_T),
intent(in),
dimension(:) :: &
8696 integer(HSIZE_T),
intent(out),
dimension(size(myShape,1)):: &
8699 integer(HID_T),
intent(out) :: dset_id, filespace_id, memspace_id, plist_id
8701 integer,
dimension(worldsize) :: &
8708 call h5pcreate_f(h5p_dataset_xfer_f, plist_id, hdferr)
8709 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_write: h5pcreate_f')
8720 writesize(
worldrank+1) = int(myshape(ubound(myshape,1)))
8727 mystart = int(0,hsize_t)
8728 mystart(ubound(mystart)) = int(sum(writesize(1:
worldrank)),hsize_t)
8729 totalshape = [myshape(1:ubound(myshape,1)-1),int(sum(writesize),hsize_t)]
8733 call h5screate_simple_f(
size(myshape), myshape, memspace_id, hdferr, myshape)
8734 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_write: h5dopen_f')
8735 call h5screate_simple_f(
size(totalshape), totalshape, filespace_id, hdferr, totalshape)
8736 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_write: h5dget_space_f')
8740 call h5dcreate_f(loc_id, trim(datasetname), datatype, filespace_id, dset_id, hdferr)
8741 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_write: h5dcreate_f')
8742 call h5sselect_hyperslab_f(filespace_id, h5s_select_set_f, mystart, myshape, hdferr)
8743 if (hdferr < 0)
call io_error(1,ext_msg=
'initialize_write: h5sselect_hyperslab_f')
8751 subroutine finalize_write(plist_id, dset_id, filespace_id, memspace_id)
8753 integer(HID_T),
intent(in) :: dset_id, filespace_id, memspace_id, plist_id
8756 call h5pclose_f(plist_id, hdferr)
8757 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_write: plist_id')
8758 call h5dclose_f(dset_id, hdferr)
8759 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_write: h5dclose_f')
8760 call h5sclose_f(filespace_id, hdferr)
8761 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_write: h5sclose_f/filespace_id')
8762 call h5sclose_f(memspace_id, hdferr)
8763 if (hdferr < 0)
call io_error(1,ext_msg=
'finalize_write: h5sclose_f/memspace_id')
8768 # 19 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
8770 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/results.f90" 1
8834 character(len=pStringLen) :: commandline
8836 write(6,
'(/,a)')
' <<<+- results init -+>>>'
8838 write(6,
'(/,a)')
' Diehl et al., Integrating Materials and Manufacturing Innovation 6(1):83–91, 2017'
8839 write(6,
'(a)')
' https://doi.org/10.1007/s40192-017-0084-5'
8845 call get_command(commandline)
8879 integer,
intent(in) :: inc
8880 real(preal),
intent(in) :: time
8881 character(len=pStringLen) :: incchar
8883 write(incchar,
'(i10)') inc
8909 character(len=*),
intent(in) :: groupname
8921 character(len=*),
intent(in) :: groupname
8933 integer(HID_T),
intent(in) :: group_id
8945 character(len=*),
intent(in) :: path, link
8957 character(len=*),
intent(in) :: attrLabel, attrValue
8958 character(len=*),
intent(in),
optional :: path
8960 if (
present(path))
then
8974 character(len=*),
intent(in) :: attrLabel
8975 integer,
intent(in) :: attrValue
8976 character(len=*),
intent(in),
optional :: path
8978 if (
present(path))
then
8992 character(len=*),
intent(in) :: attrLabel
8993 real(pReal),
intent(in) :: attrValue
8994 character(len=*),
intent(in),
optional :: path
8996 if (
present(path))
then
9010 character(len=*),
intent(in) :: attrLabel
9011 integer,
intent(in),
dimension(:) :: attrValue
9012 character(len=*),
intent(in),
optional :: path
9014 if (
present(path))
then
9028 character(len=*),
intent(in) :: attrLabel
9029 real(pReal),
intent(in),
dimension(:) :: attrValue
9030 character(len=*),
intent(in),
optional :: path
9032 if (
present(path))
then
9046 character(len=*),
intent(in) :: link
9050 if (hdferr < 0)
call io_error(1,ext_msg =
'results_removeLink: h5ldelete_soft_f ('//trim(link)//
')')
9060 character(len=*),
intent(in) :: label,group,description
9061 character(len=*),
intent(in),
optional :: SIunit
9062 real(pReal),
intent(inout),
dimension(:) :: dataset
9064 integer(HID_T) :: groupHandle
9071 call hdf5_write(grouphandle,dataset,label,.false.)
9089 character(len=*),
intent(in) :: label,group,description
9090 character(len=*),
intent(in),
optional :: SIunit
9091 real(pReal),
intent(inout),
dimension(:,:) :: dataset
9093 integer(HID_T) :: groupHandle
9100 call hdf5_write(grouphandle,dataset,label,.false.)
9119 character(len=*),
intent(in) :: label,group,description
9120 character(len=*),
intent(in),
optional :: SIunit
9121 logical,
intent(in),
optional :: transposed
9122 real(pReal),
intent(in),
dimension(:,:,:) :: dataset
9125 logical :: transposed_
9126 integer(HID_T) :: groupHandle
9127 real(pReal),
dimension(:,:,:),
allocatable :: dataset_transposed
9130 if(
present(transposed))
then
9131 transposed_ = transposed
9133 transposed_ = .true.
9136 if(transposed_)
then
9137 if(
size(dataset,1) /=
size(dataset,2))
call io_error(0,ext_msg=
'transpose non-symmetric tensor')
9138 allocate(dataset_transposed,mold=dataset)
9139 do i=1,
size(dataset_transposed,3)
9140 dataset_transposed(:,:,i) = transpose(dataset(:,:,i))
9143 allocate(dataset_transposed,source=dataset)
9151 call hdf5_write(grouphandle,dataset_transposed,label,.false.)
9170 character(len=*),
intent(in) :: label,group,description
9171 character(len=*),
intent(in),
optional :: SIunit
9172 integer,
intent(inout),
dimension(:,:) :: dataset
9174 integer(HID_T) :: groupHandle
9181 call hdf5_write(grouphandle,dataset,label,.false.)
9200 character(len=*),
intent(in) :: label,group,description
9201 character(len=*),
intent(in),
optional :: SIunit
9202 integer,
intent(inout),
dimension(:,:,:) :: dataset
9204 integer(HID_T) :: groupHandle
9211 call hdf5_write(grouphandle,dataset,label,.false.)
9230 character(len=*),
intent(in) :: label,group,description
9231 character(len=*),
intent(in),
optional :: lattice_structure
9232 type(
rotation),
intent(inout),
dimension(:) :: dataset
9234 integer(HID_T) :: groupHandle
9241 call hdf5_write(grouphandle,dataset,label,.false.)
9260 integer,
dimension(:,:),
intent(in) :: phaseat
9261 integer,
dimension(:,:,:),
intent(in) :: memberatlocal
9262 character(len=pStringLen),
dimension(:),
intent(in) :: label
9264 integer,
dimension(size(memberAtLocal,1),size(memberAtLocal,2),size(memberAtLocal,3)) :: &
9265 phaseatmaterialpoint, &
9267 integer,
dimension(size(label),0:worldsize-1) :: memberoffset
9268 integer,
dimension(0:worldsize-1) :: writesize
9269 integer(HSIZE_T),
dimension(2) :: &
9270 myshape, & !< shape of the dataset (this process)
9275 loc_id, & !< identifier of group in file
9276 dtype_id, & !< identifier of compound data type
9277 name_id, & !< identifier of name (string) in compound data type
9278 position_id, & !< identifier of position/index (integer) in compound data type
9286 integer(SIZE_T) :: type_size_string, type_size_int
9291 call h5tcopy_f(h5t_native_character, dt_id, ierr)
9292 call h5tset_size_f(dt_id, int(len(label(1)),size_t), ierr)
9293 call h5tget_size_f(dt_id, type_size_string, ierr)
9295 call h5tget_size_f(h5t_native_integer, type_size_int, ierr)
9297 call h5tcreate_f(h5t_compound_f, type_size_string + type_size_int, dtype_id, ierr)
9298 call h5tinsert_f(dtype_id,
"Name", 0_size_t, dt_id,ierr)
9299 call h5tinsert_f(dtype_id,
"Position", type_size_string, h5t_native_integer, ierr)
9303 call h5tcreate_f(h5t_compound_f, type_size_string, name_id, ierr)
9304 call h5tinsert_f(name_id,
"Name", 0_size_t, dt_id, ierr)
9306 call h5tcreate_f(h5t_compound_f, type_size_int, position_id, ierr)
9307 call h5tinsert_f(position_id,
"Position", 0_size_t, h5t_native_integer, ierr)
9309 call h5tclose_f(dt_id, ierr)
9313 call h5pcreate_f(h5p_dataset_xfer_f, plist_id, ierr)
9316 memberoffset(i,
worldrank) = count(phaseat == i)*
size(memberatlocal,2)
9319 writesize(
worldrank) =
size(memberatlocal(1,:,:))
9323 # 563 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/results.f90"
9325 myshape = int([
size(phaseat,1),writesize(
worldrank)], hsize_t)
9326 myoffset = int([0,sum(writesize(0:
worldrank-1))], hsize_t)
9327 totalshape = int([
size(phaseat,1),sum(writesize)], hsize_t)
9331 call h5screate_simple_f(2,myshape,memspace_id,ierr,myshape)
9332 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5screate_simple_f/memspace_id')
9334 call h5screate_simple_f(2,totalshape,filespace_id,ierr,totalshape)
9335 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5screate_simple_f/filespace_id')
9337 call h5sselect_hyperslab_f(filespace_id, h5s_select_set_f, myoffset, myshape, ierr)
9338 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5sselect_hyperslab_f')
9342 do i = 1,
size(phaseatmaterialpoint,2)
9343 phaseatmaterialpoint(:,i,:) = phaseat
9348 do i = 1,
size(label)
9349 where(phaseatmaterialpoint == i) memberatglobal = memberatlocal + sum(memberoffset(i,0:
worldrank-1)) -1
9354 call h5pset_preserve_f(plist_id, .true., ierr)
9357 call h5dcreate_f(loc_id,
'constituent', dtype_id, filespace_id, dset_id, ierr)
9358 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5dcreate_f')
9360 call h5dwrite_f(dset_id, name_id, reshape(label(pack(phaseatmaterialpoint,.true.)),myshape), &
9361 myshape, ierr, file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
9362 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5dwrite_f/name_id')
9363 call h5dwrite_f(dset_id, position_id, reshape(pack(memberatglobal,.true.),myshape), &
9364 myshape, ierr, file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
9365 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_constituent: h5dwrite_f/position_id')
9370 call h5pclose_f(plist_id, ierr)
9371 call h5sclose_f(filespace_id, ierr)
9372 call h5sclose_f(memspace_id, ierr)
9373 call h5dclose_f(dset_id, ierr)
9374 call h5tclose_f(dtype_id, ierr)
9375 call h5tclose_f(name_id, ierr)
9376 call h5tclose_f(position_id, ierr)
9386 integer,
dimension(:),
intent(in) :: homogenizationat
9387 integer,
dimension(:,:),
intent(in) :: memberatlocal
9388 character(len=pStringLen),
dimension(:),
intent(in) :: label
9390 integer,
dimension(size(memberAtLocal,1),size(memberAtLocal,2)) :: &
9391 homogenizationatmaterialpoint, &
9393 integer,
dimension(size(label),0:worldsize-1) :: memberoffset
9394 integer,
dimension(0:worldsize-1) :: writesize
9395 integer(HSIZE_T),
dimension(1) :: &
9396 myshape, & !< shape of the dataset (this process)
9401 loc_id, & !< identifier of group in file
9402 dtype_id, & !< identifier of compound data type
9403 name_id, & !< identifier of name (string) in compound data type
9404 position_id, & !< identifier of position/index (integer) in compound data type
9412 integer(SIZE_T) :: type_size_string, type_size_int
9417 call h5tcopy_f(h5t_native_character, dt_id, ierr)
9418 call h5tset_size_f(dt_id, int(len(label(1)),size_t), ierr)
9419 call h5tget_size_f(dt_id, type_size_string, ierr)
9421 call h5tget_size_f(h5t_native_integer, type_size_int, ierr)
9423 call h5tcreate_f(h5t_compound_f, type_size_string + type_size_int, dtype_id, ierr)
9424 call h5tinsert_f(dtype_id,
"Name", 0_size_t, dt_id,ierr)
9425 call h5tinsert_f(dtype_id,
"Position", type_size_string, h5t_native_integer, ierr)
9429 call h5tcreate_f(h5t_compound_f, type_size_string, name_id, ierr)
9430 call h5tinsert_f(name_id,
"Name", 0_size_t, dt_id, ierr)
9432 call h5tcreate_f(h5t_compound_f, type_size_int, position_id, ierr)
9433 call h5tinsert_f(position_id,
"Position", 0_size_t, h5t_native_integer, ierr)
9435 call h5tclose_f(dt_id, ierr)
9439 call h5pcreate_f(h5p_dataset_xfer_f, plist_id, ierr)
9442 memberoffset(i,
worldrank) = count(homogenizationat == i)*
size(memberatlocal,1)
9445 writesize(
worldrank) =
size(memberatlocal)
9449 # 698 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/results.f90"
9451 myshape = int([writesize(
worldrank)], hsize_t)
9452 myoffset = int([sum(writesize(0:
worldrank-1))], hsize_t)
9453 totalshape = int([sum(writesize)], hsize_t)
9457 call h5screate_simple_f(1,myshape,memspace_id,ierr,myshape)
9458 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5screate_simple_f/memspace_id')
9460 call h5screate_simple_f(1,totalshape,filespace_id,ierr,totalshape)
9461 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5screate_simple_f/filespace_id')
9463 call h5sselect_hyperslab_f(filespace_id, h5s_select_set_f, myoffset, myshape, ierr)
9464 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5sselect_hyperslab_f')
9468 do i = 1,
size(homogenizationatmaterialpoint,1)
9469 homogenizationatmaterialpoint(i,:) = homogenizationat
9474 do i = 1,
size(label)
9475 where(homogenizationatmaterialpoint == i) memberatglobal = memberatlocal + sum(memberoffset(i,0:
worldrank-1)) - 1
9480 call h5pset_preserve_f(plist_id, .true., ierr)
9483 call h5dcreate_f(loc_id,
'materialpoint', dtype_id, filespace_id, dset_id, ierr)
9484 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5dcreate_f')
9486 call h5dwrite_f(dset_id, name_id, reshape(label(pack(homogenizationatmaterialpoint,.true.)),myshape), &
9487 myshape, ierr, file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
9488 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5dwrite_f/name_id')
9489 call h5dwrite_f(dset_id, position_id, reshape(pack(memberatglobal,.true.),myshape), &
9490 myshape, ierr, file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
9491 if (ierr < 0)
call io_error(1,ext_msg=
'results_mapping_materialpoint: h5dwrite_f/position_id')
9496 call h5pclose_f(plist_id, ierr)
9497 call h5sclose_f(filespace_id, ierr)
9498 call h5sclose_f(memspace_id, ierr)
9499 call h5dclose_f(dset_id, ierr)
9500 call h5tclose_f(dtype_id, ierr)
9501 call h5tclose_f(name_id, ierr)
9502 call h5tclose_f(position_id, ierr)
9766 # 20 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
9768 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/geometry_plastic_nonlocal.f90" 1
9783 integer,
protected :: &
9786 integer,
dimension(:,:,:,:),
allocatable,
protected :: &
9789 real(
preal),
dimension(:,:),
allocatable,
protected :: &
9792 real(
preal),
dimension(:,:,:),
allocatable,
protected :: &
9795 real(
preal),
dimension(:,:,:,:),
allocatable,
protected :: &
9811 integer,
dimension(:,:,:,:),
intent(in) :: IPneighborhood
9825 real(pReal),
dimension(:,:),
intent(in) :: IPvolume
9838 real(pReal),
dimension(:,:,:),
intent(in) :: IParea
9851 real(pReal),
dimension(:,:,:,:),
intent(in) :: IPareaNormal
9883 integer,
dimension(:),
allocatable :: shp
9888 real(pReal),
dimension(:),
allocatable :: temp
9892 'initial cell volume',
'm³')
9893 end block writevolume
9896 real(pReal),
dimension(:,:),
allocatable :: temp
9900 'initial cell face area',
'm²')
9901 end block writeareas
9904 real(pReal),
dimension(:,:,:),
allocatable :: temp
9907 call results_writedataset(
'geometry',temp,
'n_0',&
9908 'initial cell face normals',
'-',transposed=.false.)
9909 end block writenormals
9912 call results_closejobfile
9917 # 21 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
9919 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/discretization.f90" 1
9932 integer,
public,
protected :: &
9936 integer,
public,
protected,
dimension(:),
allocatable :: &
9940 real(
preal),
public,
protected,
dimension(:,:),
allocatable :: &
9961 IPcoords0,NodeCoords0,&
9964 integer,
dimension(:),
intent(in) :: &
9967 real(
preal),
dimension(:,:),
intent(in) :: &
9970 integer,
optional,
intent(in) :: &
9973 write(6,
'(/,a)')
' <<<+- discretization init -+>>>';
flush(6)
9987 if(
present(sharednodesbegin))
then
10001 real(
preal),
dimension(:,:),
allocatable :: u
10011 call results_writedataset(
'current/geometry',u,
'u_p',
'displacements of the materialpoints',
'm')
10021 real(
preal),
dimension(:,:),
intent(in) :: ipcoords
10033 real(
preal),
dimension(:,:),
intent(in) :: nodecoords
10041 # 22 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
10044 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/marc/discretization_marc.f90" 1
10070 integer,
dimension(:,:),
allocatable :: parents
10071 integer,
dimension(:,:),
allocatable :: weights
10079 integer,
dimension(:),
allocatable,
public :: &
10094 integer,
intent(in) :: el, ip
10096 real(
preal),
dimension(:,:),
allocatable :: &
10097 node0_elem, & !< node x,y,z coordinates (initially
10101 integer,
dimension(:),
allocatable :: &
10102 microstructureat, &
10105 nnodes, & !< total number of nodes in the mesh
10108 real(
preal),
dimension(:,:),
allocatable :: &
10110 integer,
dimension(:,:,:),
allocatable :: &
10112 integer,
dimension(:,:),
allocatable :: &
10114 real(
preal),
dimension(:,:,:,:),
allocatable :: &
10117 write(6,
'(/,a)')
' <<<+- mesh init -+>>>';
flush(6)
10121 call inputread(elem,node0_elem,connectivity_elem,microstructureat,homogenizationat)
10122 nelems =
size(connectivity_elem,2)
10130 allocate(
calcmode(elem%nIPs,nelems),source=.false.)
10135 allocate(connectivity_cell(elem%NcellNodesPerCell,elem%nIPs,nelems))
10137 elem,connectivity_elem)
10138 allocate(node0_cell(3,maxval(connectivity_cell)))
10141 allocate(ip_reshaped(3,elem%nIPs*nelems),source=0.0_preal)
10142 call buildipcoordinates(ip_reshaped,reshape(connectivity_cell,[elem%NcellNodesPerCell,&
10143 elem%nIPs*nelems]),node0_cell)
10150 reshape(connectivity_cell,[elem%NcellNodesPerCell,elem%nIPs*nelems]),&
10151 node0_cell,ip_reshaped)
10156 unscalednormals =
ipareanormal(elem,nelems,connectivity_cell,node0_cell)
10168 connectivity_elem,connectivity_cell, &
10169 coordinates_nodes,coordinates_points)
10173 integer,
dimension(:,:),
intent(in) :: &
10174 connectivity_elem, &
10176 real(pReal),
dimension(:,:),
intent(in) :: &
10177 coordinates_nodes, &
10180 integer,
dimension(:,:),
allocatable :: &
10182 real(pReal),
dimension(:,:),
allocatable :: &
10188 connectivity_temp = connectivity_elem
10190 'connectivity of the elements',
'-')
10192 connectivity_temp = connectivity_cell
10194 'connectivity of the cells',
'-')
10197 coordinates_temp = coordinates_nodes
10199 'initial coordinates of the nodes',
'm')
10201 coordinates_temp = coordinates_points
10203 'initial coordinates of the materialpoints',
'm')
10213 subroutine inputread(elem,node0_elem,connectivity_elem,microstructureAt,homogenizationAt)
10215 type(
telement),
intent(out) :: elem
10216 real(pReal),
dimension(:,:),
allocatable,
intent(out) :: &
10218 integer,
dimension(:,:),
allocatable,
intent(out) :: &
10220 integer,
dimension(:),
allocatable,
intent(out) :: &
10221 microstructureAt, &
10225 fileFormatVersion, &
10226 hypoelasticTableStyle, &
10227 initialcondTableStyle, &
10230 integer,
dimension(:),
allocatable :: &
10232 character(len=pStringLen),
dimension(:),
allocatable :: inputFile
10234 character(len=pStringLen),
dimension(:),
allocatable :: &
10236 integer,
dimension(:,:),
allocatable :: &
10244 if (fileformatversion > 12) &
10246 hypoelastictablestyle,inputfile)
10258 nelems,elem%nNodes,inputfile)
10269 nelems,elem%nNodes,nameelemset,mapelemset,&
10270 initialcondtablestyle,inputfile)
10280 integer,
intent(out) :: fileFormat
10281 character(len=*),
dimension(:),
intent(in) :: fileContent
10283 integer,
allocatable,
dimension(:) :: chunkPos
10286 do l = 1,
size(filecontent)
10288 if(chunkpos(1) < 2) cycle
10290 fileformat =
io_intvalue(filecontent(l),chunkpos,2)
10303 integer,
intent(out) :: initialcond, hypoelastic
10304 character(len=*),
dimension(:),
intent(in) :: fileContent
10306 integer,
allocatable,
dimension(:) :: chunkPos
10312 do l = 1,
size(filecontent)
10314 if(chunkpos(1) < 6) cycle
10316 initialcond =
io_intvalue(filecontent(l),chunkpos,4)
10317 hypoelastic =
io_intvalue(filecontent(l),chunkpos,5)
10329 tableStyle,fileContent)
10331 integer,
allocatable,
dimension(:),
intent(out) :: matNumber
10332 integer,
intent(in) :: tableStyle
10333 character(len=*),
dimension(:),
intent(in) :: fileContent
10335 integer,
allocatable,
dimension(:) :: chunkPos
10336 integer :: i, j, data_blocks, l
10338 do l = 1,
size(filecontent)
10340 if(chunkpos(1) < 1) cycle
10342 if (len_trim(filecontent(l+1))/=0)
then
10344 data_blocks =
io_intvalue(filecontent(l+1),chunkpos,1)
10348 allocate(matnumber(data_blocks), source = 0)
10349 do i = 0, data_blocks - 1
10350 j = i*(2+tablestyle) + 1
10352 matnumber(i+1) =
io_intvalue(filecontent(l+1+j),chunkpos,1)
10367 integer,
intent(out) :: nNodes, nElems
10368 character(len=*),
dimension(:),
intent(in) :: fileContent
10370 integer,
allocatable,
dimension(:) :: chunkPos
10376 do l = 1,
size(filecontent)
10378 if(chunkpos(1) < 1) cycle
10383 nnodes =
io_intvalue(filecontent(l+1),chunkpos,2)
10396 integer,
intent(out) :: nElemSets, maxNelemInSet
10397 character(len=*),
dimension(:),
intent(in) :: fileContent
10399 integer,
allocatable,
dimension(:) :: chunkPos
10400 integer :: i,l,elemInCurrentSet
10405 do l = 1,
size(filecontent)
10407 if(chunkpos(1) < 2) cycle
10410 nelemsets = nelemsets + 1
10414 elemincurrentset = 1 + abs(
io_intvalue(filecontent(l+1),chunkpos,3) &
10417 elemincurrentset = 0
10422 elemincurrentset = elemincurrentset + chunkpos(1) - 1
10424 elemincurrentset = elemincurrentset + 1
10429 maxneleminset = max(maxneleminset, elemincurrentset)
10442 character(len=pStringLen),
dimension(:),
allocatable,
intent(out) :: nameElemSet
10443 integer,
dimension(:,:),
allocatable,
intent(out) :: mapElemSet
10444 character(len=*),
dimension(:),
intent(in) :: fileContent
10446 integer,
allocatable,
dimension(:) :: chunkPos
10447 integer :: elemSet, NelemSets, maxNelemInSet,l
10451 allocate(nameelemset(nelemsets)); nameelemset =
'n/a'
10452 allocate(mapelemset(1+maxneleminset,nelemsets),source=0)
10455 do l = 1,
size(filecontent)
10457 if(chunkpos(1) < 2) cycle
10460 elemset = elemset+1
10461 nameelemset(elemset) = trim(
io_stringvalue(filecontent(l),chunkpos,4))
10462 mapelemset(:,elemset) =
continuousintvalues(filecontent(l+1:),
size(mapelemset,1)-1,nameelemset,mapelemset,
size(nameelemset))
10473 nElems,nNodesPerElem,fileContent)
10475 integer,
allocatable,
dimension(:),
intent(out) :: FEM2DAMASK
10477 integer,
intent(in) :: nElems, & !< number of elements
10479 character(len=*),
dimension(:),
intent(in) :: fileContent
10481 integer,
dimension(2,nElems) :: map_unsorted
10482 integer,
allocatable,
dimension(:) :: chunkPos
10483 integer :: i,j,l,nNodesAlreadyRead
10485 do l = 1,
size(filecontent)
10487 if(chunkpos(1) < 1) cycle
10492 map_unsorted(:,i) = [
io_intvalue(filecontent(l+1+i+j),chunkpos,1),i]
10493 nnodesalreadyread = chunkpos(1) - 2
10494 do while(nnodesalreadyread < nnodesperelem)
10497 nnodesalreadyread = nnodesalreadyread + chunkpos(1)
10505 allocate(fem2damask(minval(map_unsorted(1,:)):maxval(map_unsorted(1,:))),source=-1)
10507 fem2damask(map_unsorted(1,i)) = map_unsorted(2,i)
10517 nNodes,fileContent)
10519 integer,
allocatable,
dimension(:),
intent(out) :: FEM2DAMASK
10521 integer,
intent(in) :: nNodes
10522 character(len=*),
dimension(:),
intent(in) :: fileContent
10524 integer,
dimension(2,nNodes) :: map_unsorted
10525 integer,
allocatable,
dimension(:) :: chunkPos
10528 do l = 1,
size(filecontent)
10530 if(chunkpos(1) < 1) cycle
10534 map_unsorted(:,i) = [
io_intvalue(filecontent(l+1+i),chunkpos,1),i]
10541 allocate(fem2damask(minval(map_unsorted(1,:)):maxval(map_unsorted(1,:))),source=-1)
10543 fem2damask(map_unsorted(1,i)) = map_unsorted(2,i)
10555 real(pReal),
allocatable,
dimension(:,:),
intent(out) :: nodes
10556 integer,
intent(in) :: nNode
10557 character(len=*),
dimension(:),
intent(in) :: fileContent
10559 integer,
allocatable,
dimension(:) :: chunkPos
10562 allocate(nodes(3,nnode))
10564 do l = 1,
size(filecontent)
10566 if(chunkpos(1) < 1) cycle
10588 type(
telement),
intent(out) :: elem
10589 integer,
intent(in) :: nElem
10590 character(len=*),
dimension(:),
intent(in) :: fileContent
10592 integer,
allocatable,
dimension(:) :: chunkPos
10593 integer :: i,j,t,l,remainingChunks
10596 do l = 1,
size(filecontent)
10598 if(chunkpos(1) < 1) cycle
10609 remainingchunks = elem%nNodes - (chunkpos(1) - 2)
10610 do while(remainingchunks > 0)
10613 remainingchunks = remainingchunks - chunkpos(1)
10627 character(len=*),
intent(in) :: what
10629 select case (
io_lc(what))
10671 integer,
intent(in) :: &
10674 character(len=*),
dimension(:),
intent(in) :: filecontent
10676 integer,
dimension(nNodes,nElem) :: &
10679 integer,
allocatable,
dimension(:) :: chunkpos
10681 integer,
dimension(1+nElem) :: contints
10682 integer :: i,k,j,t,e,l,nnodesalreadyread
10684 do l = 1,
size(filecontent)
10686 if(chunkpos(1) < 1) cycle
10693 do k = 1,chunkpos(1)-2
10697 nnodesalreadyread = chunkpos(1) - 2
10698 do while(nnodesalreadyread < nnodes)
10701 do k = 1,chunkpos(1)
10705 nnodesalreadyread = nnodesalreadyread + chunkpos(1)
10720 nElem,nNodes,nameElemSet,mapElemSet,initialcondTableStyle,fileContent)
10722 integer,
dimension(:),
allocatable,
intent(out) :: &
10723 microstructureAt, &
10725 integer,
intent(in) :: &
10727 nNodes, & !< number of nodes per element
10728 initialcondTableStyle
10729 character(len=*),
dimension(:),
intent(in) :: nameElemSet
10730 integer,
dimension(:,:),
intent(in) :: mapElemSet
10731 character(len=*),
dimension(:),
intent(in) :: fileContent
10733 integer,
allocatable,
dimension(:) :: chunkPos
10735 integer,
dimension(1+nElem) :: contInts
10736 integer :: i,j,t,sv,myVal,e,nNodesAlreadyRead,l,k,m
10739 allocate(microstructureat(nelem),source=0)
10740 allocate(homogenizationat(nelem),source=0)
10742 do l = 1,
size(filecontent)
10744 if(chunkpos(1) < 2) cycle
10747 k = merge(2,1,initialcondtablestyle == 2)
10750 if( (sv == 2) .or. (sv == 3) )
then
10753 do while (scan(
io_stringvalue(filecontent(l+k+m),chunkpos,1),
'+-',back=.true.)>1)
10755 if (initialcondtablestyle == 2) m = m + 2
10756 contints =
continuousintvalues(filecontent(l+k+m+1:),nelem,nameelemset,mapelemset,
size(nameelemset))
10757 do i = 1,contints(1)
10759 if (sv == 2) microstructureat(e) = myval
10760 if (sv == 3) homogenizationat(e) = myval
10762 if (initialcondtablestyle == 0) m = m + 1
10774 subroutine buildcells(connectivity_cell,cellNodeDefinition, &
10775 elem,connectivity_elem)
10778 integer,
dimension(:,:,:),
intent(out) :: connectivity_cell
10780 type(
telement),
intent(in) :: elem
10781 integer,
dimension(:,:),
intent(in) :: connectivity_elem
10783 integer,
dimension(:),
allocatable :: candidates_local
10784 integer,
dimension(:,:),
allocatable :: parentsAndWeights,candidates_global
10786 integer :: e, n, c, p, s,i,m,j,nParentNodes,nCellNode,Nelem,candidateID
10788 nelem =
size(connectivity_elem,2)
10792 connectivity_cell = -spread(elem%cell,3,nelem)
10798 do c = 1, elem%NcellNodes
10799 realnode:
if (count(elem%cellNodeParentNodeWeights(:,c) /= 0) == 1)
then
10800 where(connectivity_cell(:,:,e) == -c)
10801 connectivity_cell(:,:,e) = connectivity_elem(c,e)
10807 ncellnode = maxval(connectivity_elem)
10811 do nparentnodes = 2, elem%nNodes
10814 candidates_local = [
integer::]
10815 do c = 1, elem%NcellNodes
10816 if (count(elem%cellNodeParentNodeWeights(:,c) /= 0) == nparentnodes) &
10817 candidates_local = [candidates_local,c]
10819 s =
size(candidates_local)
10821 if (
allocated(candidates_global))
deallocate(candidates_global)
10822 allocate(candidates_global(nparentnodes*2+2,s*nelem))
10823 parentsandweights = reshape([(0, i = 1,2*nparentnodes)],[nparentnodes,2])
10826 do i = 1,
size(candidates_local)
10827 candidateid = (e-1)*
size(candidates_local)+i
10828 c = candidates_local(i)
10830 do j = 1,
size(elem%cellNodeParentNodeWeights(:,c))
10831 if (elem%cellNodeParentNodeWeights(j,c) /= 0)
then
10833 parentsandweights(p,1:2) = [connectivity_elem(j,e),elem%cellNodeParentNodeWeights(j,c)]
10837 do p = 1, nparentnodes
10838 m = maxloc(parentsandweights(:,1),1)
10840 candidates_global(p, candidateid) = parentsandweights(m,1)
10841 candidates_global(p+nparentnodes, candidateid) = parentsandweights(m,2)
10842 candidates_global(nparentnodes*2+1:nparentnodes*2+2,candidateid) = [e,c]
10844 parentsandweights(m,1) = -huge(parentsandweights(m,1))
10850 call math_sort(candidates_global,sortdim=1)
10852 do p = 2, nparentnodes*2
10854 do while(n <=
size(candidates_local)*nelem)
10856 do while (n+j<=
size(candidates_local)*nelem)
10857 if (candidates_global(p-1,n+j)/=candidates_global(p-1,n))
exit
10861 if (any(candidates_global(p,n:e)/=candidates_global(p,n))) &
10862 call math_sort(candidates_global(:,n:e),sortdim=p)
10867 i =
uniquerows(candidates_global(1:2*nparentnodes,:))
10868 allocate(cellnodedefinition(nparentnodes-1)%parents(i,nparentnodes))
10869 allocate(cellnodedefinition(nparentnodes-1)%weights(i,nparentnodes))
10873 do while(n <=
size(candidates_local)*nelem)
10875 parentsandweights(:,1) = candidates_global(1:nparentnodes,n+j)
10876 parentsandweights(:,2) = candidates_global(nparentnodes+1:nparentnodes*2,n+j)
10878 e = candidates_global(nparentnodes*2+1,n+j)
10879 c = candidates_global(nparentnodes*2+2,n+j)
10881 do while (n+j<=
size(candidates_local)*nelem)
10882 if (any(candidates_global(1:2*nparentnodes,n+j)/=candidates_global(1:2*nparentnodes,n)))
exit
10883 where (connectivity_cell(:,:,candidates_global(nparentnodes*2+1,n+j)) == -candidates_global(nparentnodes*2+2,n+j))
10884 connectivity_cell(:,:,candidates_global(nparentnodes*2+1,n+j)) = ncellnode + 1
10889 ncellnode = ncellnode + 1
10890 cellnodedefinition(nparentnodes-1)%parents(i,:) = parentsandweights(:,1)
10891 cellnodedefinition(nparentnodes-1)%weights(i,:) = parentsandweights(:,2)
10904 integer,
dimension(:,:),
intent(in) :: a
10907 u, & !< # of unique rows
10908 r, & !< row counter
10913 do while(r <=
size(a,2))
10915 do while (r+d<=
size(a,2))
10916 if (any(a(:,r)/=a(:,r+d)))
exit
10932 definition,node_elem)
10934 real(pReal),
dimension(:,:),
intent(out) :: node_cell
10936 real(pReal),
dimension(:,:),
intent(in) :: node_elem
10938 integer :: i, j, k, n
10940 n =
size(node_elem,2)
10941 node_cell(:,1:n) = node_elem
10946 node_cell(:,n) = 0.0_preal
10948 node_cell(:,n) = node_cell(:,n) &
10949 + node_cell(:,definition(i)%parents(j,k)) * real(definition(i)%weights(j,k),preal)
10951 node_cell(:,n) = node_cell(:,n)/real(sum(definition(i)%weights(j,:)),preal)
10962 connectivity_cell,node_cell)
10964 real(pReal),
dimension(:,:),
intent(out):: IPcoordinates
10965 integer,
dimension(:,:),
intent(in) :: connectivity_cell
10966 real(pReal),
dimension(:,:),
intent(in) :: node_cell
10970 do i = 1,
size(connectivity_cell,2)
10971 ipcoordinates(:,i) = 0.0_preal
10972 do n = 1,
size(connectivity_cell,1)
10973 ipcoordinates(:,i) = ipcoordinates(:,i) &
10974 + node_cell(:,connectivity_cell(n,i))
10976 ipcoordinates(:,i) = ipcoordinates(:,i)/real(
size(connectivity_cell,1),preal)
10987 function ipvolume(elem,node,connectivity)
10989 type(
telement),
intent(in) :: elem
10990 real(
preal),
dimension(:,:),
intent(in) :: node
10991 integer,
dimension(:,:,:),
intent(in) :: connectivity
10993 real(
preal),
dimension(elem%nIPs,size(connectivity,3)) ::
ipvolume
10994 real(
preal),
dimension(3) :: x0,x1,x2,x3,x4,x5,x6,x7
10998 do e = 1,
size(connectivity,3)
11001 select case (elem%cellType)
11004 node(1:3,connectivity(2,i,e)), &
11005 node(1:3,connectivity(3,i,e)))
11009 node(1:3,connectivity(2,i,e)), &
11010 node(1:3,connectivity(3,i,e))) &
11012 node(1:3,connectivity(4,i,e)), &
11013 node(1:3,connectivity(1,i,e)))
11016 node(1:3,connectivity(2,i,e)), &
11017 node(1:3,connectivity(3,i,e)), &
11018 node(1:3,connectivity(4,i,e)))
11023 x0 = node(1:3,connectivity(1,i,e))
11024 x1 = node(1:3,connectivity(2,i,e))
11025 x2 = node(1:3,connectivity(4,i,e))
11026 x3 = node(1:3,connectivity(3,i,e))
11027 x4 = node(1:3,connectivity(5,i,e))
11028 x5 = node(1:3,connectivity(6,i,e))
11029 x6 = node(1:3,connectivity(8,i,e))
11030 x7 = node(1:3,connectivity(7,i,e))
11032 + dot_product((x6-x0),
math_cross((x7-x2)+(x5-x0),(x7-x4))) &
11033 + dot_product((x7-x1),
math_cross((x5-x0), (x7-x4)+(x3-x0)))
11047 type(
telement),
intent(in) :: elem
11048 integer,
intent(in) :: nelem
11049 integer,
dimension(:,:,:),
intent(in) :: connectivity
11050 real(
preal),
dimension(:,:),
intent(in) :: node
11054 real(
preal),
dimension (3,size(elem%cellFace,1)) :: nodepos
11055 integer :: e,i,f,n,m
11057 m =
size(elem%cellFace,1)
11061 do f = 1,elem%nIPneighbors
11062 nodepos = node(1:3,connectivity(elem%cellface(1:m,f),i,e))
11064 select case (elem%cellType)
11067 ipareanormal(2,f,i,e) = -(nodepos(1,2) - nodepos(1,1))
11071 nodepos(1:3,3) - nodepos(1:3,1))
11080 +
math_cross(nodepos(1:3,mod(n+0,m)+1) - nodepos(1:3,n), &
11081 nodepos(1:3,mod(n+1,m)+1) - nodepos(1:3,n)) * 0.5_preal
11098 character(len=*),
dimension(:),
intent(in) :: filecontent
11099 integer,
intent(in) :: maxn
11100 integer,
intent(in) :: lookupmaxn
11101 integer,
dimension(:,:),
intent(in) :: lookupmap
11102 character(len=*),
dimension(:),
intent(in) :: lookupname
11106 integer :: l,i,first,last
11107 integer,
allocatable,
dimension(:) :: chunkpos
11108 logical :: rangegeneration
11111 rangegeneration = .false.
11113 do l = 1,
size(filecontent)
11115 if (chunkpos(1) < 1)
then
11117 elseif (verify(
io_stringvalue(filecontent(l),chunkpos,1),
'0123456789') > 0)
then
11118 do i = 1, lookupmaxn
11119 if (
io_stringvalue(filecontent(l),chunkpos,1) == lookupname(i))
then
11128 do i = first, last, sign(1,last-first)
11134 do i = 1,chunkpos(1)-1
11154 character(len=*),
intent(in) :: str
11155 integer,
dimension(:),
intent(in) :: chunkpos
11158 if(chunkpos(1) == 3)
then
11166 # 24 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
11169 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/material.f90" 1
11190 character(len=*),
parameter,
public :: &
11219 enum,
bind(c); enumerator :: &
11255 integer(kind(ELASTICITY_undefined_ID)),
dimension(:),
allocatable,
public,
protected :: &
11257 integer(kind(PLASTICITY_undefined_ID)),
dimension(:),
allocatable,
public,
protected :: &
11259 integer(kind(THERMAL_isothermal_ID)),
dimension(:),
allocatable,
public,
protected :: &
11261 integer(kind(DAMAGE_none_ID)),
dimension(:),
allocatable,
public,
protected :: &
11263 integer(kind(HOMOGENIZATION_undefined_ID)),
dimension(:),
allocatable,
public,
protected :: &
11266 integer,
public,
protected :: &
11270 integer(kind(SOURCE_undefined_ID)),
dimension(:,:),
allocatable,
public,
protected :: &
11271 phase_source, & !< active sources mechanisms of each phase
11275 integer,
public,
protected :: &
11278 integer,
dimension(:),
allocatable,
public,
protected :: &
11279 phase_nsources, & !< number of source mechanisms active in each phase
11289 real(
preal),
dimension(:),
allocatable,
public,
protected :: &
11293 integer,
dimension(:),
allocatable,
public,
protected :: &
11295 integer,
dimension(:,:),
allocatable,
public,
target :: &
11297 integer,
dimension(:,:),
allocatable,
public,
protected :: &
11299 integer,
dimension(:,:,:),
allocatable,
public,
protected :: &
11306 type(
tstate),
allocatable,
dimension(:),
public :: &
11311 integer,
dimension(:,:,:),
allocatable,
public,
protected :: &
11314 type(
rotation),
dimension(:,:,:),
allocatable,
public,
protected :: &
11317 logical,
dimension(:),
allocatable,
public,
protected :: &
11320 integer,
dimension(:),
allocatable,
private :: &
11323 integer,
dimension(:,:),
allocatable,
private :: &
11341 damage, & !< damage field
11383 integer :: i,e,m,c,h, mydebug, myphase, myhomog, mymicro
11384 integer,
dimension(:),
allocatable :: &
11386 counterhomogenization
11390 write(6,
'(/,a)')
' <<<+- material init -+>>>';
flush(6)
11393 if (iand(mydebug,
debug_levelbasic) /= 0)
write(6,
'(a)')
' Phase parsed';
flush(6)
11396 if (iand(mydebug,
debug_levelbasic) /= 0)
write(6,
'(a)')
' Microstructure parsed';
flush(6)
11399 if (iand(mydebug,
debug_levelbasic) /= 0)
write(6,
'(a)')
' Homogenization parsed';
flush(6)
11402 if (iand(mydebug,
debug_levelbasic) /= 0)
write(6,
'(a)')
' Texture parsed';
flush(6)
11429 call io_error(150,m,ext_msg=
'phase')
11432 call io_error(150,m,ext_msg=
'texture')
11439 write(6,
'(/,a,/)')
' MATERIAL configuration'
11440 write(6,
'(a32,1x,a16,1x,a6)')
'homogenization ',
'type ',
'grains'
11444 write(6,
'(/,a14,18x,1x,a11,1x,a12,1x,a13)')
'microstructure',
'constituents'
11468 call io_error(150,ext_msg=
'phase')
11474 call io_error(150,ext_msg=
'texture')
11541 character(len=pStringLen) :: tag
11543 logical,
dimension(:),
allocatable :: homogenization_active
11563 select case (trim(tag))
11574 call io_error(500,ext_msg=trim(tag))
11583 select case (trim(tag))
11591 call io_error(500,ext_msg=trim(tag))
11600 select case (trim(tag))
11608 call io_error(500,ext_msg=trim(tag))
11631 character(len=pStringLen),
dimension(:),
allocatable :: &
11633 integer,
allocatable,
dimension(:) :: chunkPos
11635 character(len=pStringLen) :: &
11637 real(pReal),
dimension(:,:),
allocatable :: &
11638 microstructure_fraction
11645 call io_error(155,ext_msg=
'More microstructures in geometry than sections in material.config')
11656 allocate(strings(1))
11659 do c = 1,
size(strings)
11671 microstructure_fraction(c,m) =
io_floatvalue(strings(c),chunkpos,i+1)
11688 integer :: sourceCtr, kinematicsCtr, stiffDegradationCtr, p
11689 character(len=pStringLen),
dimension(:),
allocatable :: str
11739 str = [
'GfortranBug86277']
11740 str =
config_phase(p)%getStrings(
'(source)',defaultval=str)
11741 if (str(1) ==
'GfortranBug86277') str = [
character(len=pStringLen)::]
11745 do sourcectr = 1,
size(str)
11746 select case (trim(str(sourcectr)))
11763 str = [
'GfortranBug86277']
11764 str =
config_phase(p)%getStrings(
'(kinematics)',defaultval=str)
11765 if (str(1) ==
'GfortranBug86277') str = [
character(len=pStringLen)::]
11769 do kinematicsctr = 1,
size(str)
11770 select case (trim(str(kinematicsctr)))
11780 str = [
'GfortranBug86277']
11781 str =
config_phase(p)%getStrings(
'(stiffness_degradation)',defaultval=str)
11782 if (str(1) ==
'GfortranBug86277') str = [
character(len=pStringLen)::]
11786 do stiffdegradationctr = 1,
size(str)
11787 select case (trim(str(stiffdegradationctr)))
11811 character(len=pStringLen),
dimension(:),
allocatable :: strings
11812 integer,
dimension(:),
allocatable :: chunkPos
11813 real(pReal),
dimension(3,3) :: transformation
11814 real(pReal),
dimension(3) :: Eulers
11845 select case (strings(j))
11847 transformation(j,1:3) = [ 1.0_preal, 0.0_preal, 0.0_preal]
11849 transformation(j,1:3) = [-1.0_preal, 0.0_preal, 0.0_preal]
11851 transformation(j,1:3) = [ 0.0_preal, 1.0_preal, 0.0_preal]
11853 transformation(j,1:3) = [ 0.0_preal,-1.0_preal, 0.0_preal]
11855 transformation(j,1:3) = [ 0.0_preal, 0.0_preal, 1.0_preal]
11857 transformation(j,1:3) = [ 0.0_preal, 0.0_preal,-1.0_preal]
11862 call transformation_%fromMatrix(transformation)
11875 sizeState,sizeDotState,sizeDeltaState)
11877 integer,
intent(in) :: &
11887 plasticstate(phase)%offsetDeltaState = sizestate-sizedeltastate
11889 allocate(
plasticstate(phase)%atol (sizestate), source=0.0_preal)
11890 allocate(
plasticstate(phase)%state0 (sizestate,nipcmyphase), source=0.0_preal)
11891 allocate(
plasticstate(phase)%partionedState0 (sizestate,nipcmyphase), source=0.0_preal)
11892 allocate(
plasticstate(phase)%subState0 (sizestate,nipcmyphase), source=0.0_preal)
11893 allocate(
plasticstate(phase)%state (sizestate,nipcmyphase), source=0.0_preal)
11895 allocate(
plasticstate(phase)%dotState (sizedotstate,nipcmyphase),source=0.0_preal)
11897 allocate(
plasticstate(phase)%previousDotState (sizedotstate,nipcmyphase),source=0.0_preal)
11898 allocate(
plasticstate(phase)%previousDotState2 (sizedotstate,nipcmyphase),source=0.0_preal)
11901 allocate(
plasticstate(phase)%RK4dotState (4,sizedotstate,nipcmyphase),source=0.0_preal)
11903 allocate(
plasticstate(phase)%RKCK45dotState (6,sizedotstate,nipcmyphase),source=0.0_preal)
11905 allocate(
plasticstate(phase)%deltaState (sizedeltastate,nipcmyphase),source=0.0_preal)
11914 sizeState,sizeDotState,sizeDeltaState)
11916 integer,
intent(in) :: &
11920 sizestate, sizedotstate,sizedeltastate
11923 sourcestate(phase)%p(of)%sizeDotState = sizedotstate
11924 sourcestate(phase)%p(of)%sizeDeltaState = sizedeltastate
11925 sourcestate(phase)%p(of)%offsetDeltaState = sizestate-sizedeltastate
11927 allocate(
sourcestate(phase)%p(of)%atol (sizestate), source=0.0_preal)
11928 allocate(
sourcestate(phase)%p(of)%state0 (sizestate,nipcmyphase), source=0.0_preal)
11929 allocate(
sourcestate(phase)%p(of)%partionedState0 (sizestate,nipcmyphase), source=0.0_preal)
11930 allocate(
sourcestate(phase)%p(of)%subState0 (sizestate,nipcmyphase), source=0.0_preal)
11931 allocate(
sourcestate(phase)%p(of)%state (sizestate,nipcmyphase), source=0.0_preal)
11933 allocate(
sourcestate(phase)%p(of)%dotState (sizedotstate,nipcmyphase),source=0.0_preal)
11935 allocate(
sourcestate(phase)%p(of)%previousDotState (sizedotstate,nipcmyphase),source=0.0_preal)
11936 allocate(
sourcestate(phase)%p(of)%previousDotState2 (sizedotstate,nipcmyphase),source=0.0_preal)
11939 allocate(
sourcestate(phase)%p(of)%RK4dotState (4,sizedotstate,nipcmyphase),source=0.0_preal)
11941 allocate(
sourcestate(phase)%p(of)%RKCK45dotState (6,sizedotstate,nipcmyphase),source=0.0_preal)
11943 allocate(
sourcestate(phase)%p(of)%deltaState (sizedeltastate,nipcmyphase),source=0.0_preal)
11948 # 26 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
11950 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/lattice.f90" 1
11971 integer,
dimension(2),
parameter :: &
11974 integer,
dimension(1),
parameter :: &
11977 integer,
dimension(1),
parameter :: &
11980 integer,
dimension(1),
parameter :: &
11983 integer,
parameter :: &
11996 real(
preal),
dimension(3+3,FCC_NSLIP),
parameter :: &
11999 0, 1,-1, 1, 1, 1, &
12000 -1, 0, 1, 1, 1, 1, &
12001 1,-1, 0, 1, 1, 1, &
12002 0,-1,-1, -1,-1, 1, &
12003 1, 0, 1, -1,-1, 1, &
12004 -1, 1, 0, -1,-1, 1, &
12005 0,-1, 1, 1,-1,-1, &
12006 -1, 0,-1, 1,-1,-1, &
12007 1, 1, 0, 1,-1,-1, &
12008 0, 1, 1, -1, 1,-1, &
12009 1, 0,-1, -1, 1,-1, &
12010 -1,-1, 0, -1, 1,-1, &
12012 1, 1, 0, 1,-1, 0, &
12013 1,-1, 0, 1, 1, 0, &
12014 1, 0, 1, 1, 0,-1, &
12015 1, 0,-1, 1, 0, 1, &
12016 0, 1, 1, 0, 1,-1, &
12020 real(
preal),
dimension(3+3,FCC_NTWIN),
parameter :: &
12022 -2, 1, 1, 1, 1, 1, &
12023 1,-2, 1, 1, 1, 1, &
12024 1, 1,-2, 1, 1, 1, &
12025 2,-1, 1, -1,-1, 1, &
12026 -1, 2, 1, -1,-1, 1, &
12027 -1,-1,-2, -1,-1, 1, &
12028 -2,-1,-1, 1,-1,-1, &
12029 1, 2,-1, 1,-1,-1, &
12030 1,-1, 2, 1,-1,-1, &
12031 2, 1,-1, -1, 1,-1, &
12032 -1,-2,-1, -1, 1,-1, &
12033 -1, 1, 2, -1, 1,-1 &
12036 integer,
dimension(2,FCC_NTWIN),
parameter,
public :: &
12052 real(
preal),
dimension(3+3,FCC_NCLEAVAGE),
parameter :: &
12055 0, 1, 0, 1, 0, 0, &
12056 0, 0, 1, 0, 1, 0, &
12062 integer,
dimension(2),
parameter :: &
12065 integer,
dimension(1),
parameter :: &
12068 integer,
dimension(1),
parameter :: &
12071 integer,
parameter :: &
12082 real(
preal),
dimension(3+3,BCC_NSLIP),
parameter :: &
12086 1,-1, 1, 0, 1, 1, &
12087 -1,-1, 1, 0, 1, 1, &
12088 1, 1, 1, 0,-1, 1, &
12089 -1, 1, 1, 0,-1, 1, &
12090 -1, 1, 1, 1, 0, 1, &
12091 -1,-1, 1, 1, 0, 1, &
12092 1, 1, 1, -1, 0, 1, &
12093 1,-1, 1, -1, 0, 1, &
12094 -1, 1, 1, 1, 1, 0, &
12095 -1, 1,-1, 1, 1, 0, &
12096 1, 1, 1, -1, 1, 0, &
12097 1, 1,-1, -1, 1, 0, &
12099 -1, 1, 1, 2, 1, 1, &
12100 1, 1, 1, -2, 1, 1, &
12101 1, 1,-1, 2,-1, 1, &
12102 1,-1, 1, 2, 1,-1, &
12103 1,-1, 1, 1, 2, 1, &
12104 1, 1,-1, -1, 2, 1, &
12105 1, 1, 1, 1,-2, 1, &
12106 -1, 1, 1, 1, 2,-1, &
12107 1, 1,-1, 1, 1, 2, &
12108 1,-1, 1, -1, 1, 2, &
12109 -1, 1, 1, 1,-1, 2, &
12113 real(
preal),
dimension(3+3,BCC_NTWIN),
parameter :: &
12116 -1, 1, 1, 2, 1, 1, &
12117 1, 1, 1, -2, 1, 1, &
12118 1, 1,-1, 2,-1, 1, &
12119 1,-1, 1, 2, 1,-1, &
12120 1,-1, 1, 1, 2, 1, &
12121 1, 1,-1, -1, 2, 1, &
12122 1, 1, 1, 1,-2, 1, &
12123 -1, 1, 1, 1, 2,-1, &
12124 1, 1,-1, 1, 1, 2, &
12125 1,-1, 1, -1, 1, 2, &
12126 -1, 1, 1, 1,-1, 2, &
12130 real(
preal),
dimension(3+3,BCC_NCLEAVAGE),
parameter :: &
12133 0, 1, 0, 1, 0, 0, &
12134 0, 0, 1, 0, 1, 0, &
12140 integer,
dimension(6),
parameter :: &
12143 integer,
dimension(4),
parameter :: &
12146 integer,
parameter :: &
12155 real(
preal),
dimension(4+4,HEX_NSLIP),
parameter :: &
12159 2, -1, -1, 0, 0, 0, 0, 1, &
12160 -1, 2, -1, 0, 0, 0, 0, 1, &
12161 -1, -1, 2, 0, 0, 0, 0, 1, &
12163 2, -1, -1, 0, 0, 1, -1, 0, &
12164 -1, 2, -1, 0, -1, 0, 1, 0, &
12165 -1, -1, 2, 0, 1, -1, 0, 0, &
12167 -1, 1, 0, 0, 1, 1, -2, 0, &
12168 0, -1, 1, 0, -2, 1, 1, 0, &
12169 1, 0, -1, 0, 1, -2, 1, 0, &
12171 -1, 2, -1, 0, 1, 0, -1, 1, &
12172 -2, 1, 1, 0, 0, 1, -1, 1, &
12173 -1, -1, 2, 0, -1, 1, 0, 1, &
12174 1, -2, 1, 0, -1, 0, 1, 1, &
12175 2, -1, -1, 0, 0, -1, 1, 1, &
12176 1, 1, -2, 0, 1, -1, 0, 1, &
12178 -2, 1, 1, 3, 1, 0, -1, 1, &
12179 -1, -1, 2, 3, 1, 0, -1, 1, &
12180 -1, -1, 2, 3, 0, 1, -1, 1, &
12181 1, -2, 1, 3, 0, 1, -1, 1, &
12182 1, -2, 1, 3, -1, 1, 0, 1, &
12183 2, -1, -1, 3, -1, 1, 0, 1, &
12184 2, -1, -1, 3, -1, 0, 1, 1, &
12185 1, 1, -2, 3, -1, 0, 1, 1, &
12186 1, 1, -2, 3, 0, -1, 1, 1, &
12187 -1, 2, -1, 3, 0, -1, 1, 1, &
12188 -1, 2, -1, 3, 1, -1, 0, 1, &
12189 -2, 1, 1, 3, 1, -1, 0, 1, &
12191 -1, -1, 2, 3, 1, 1, -2, 2, &
12192 1, -2, 1, 3, -1, 2, -1, 2, &
12193 2, -1, -1, 3, -2, 1, 1, 2, &
12194 1, 1, -2, 3, -1, -1, 2, 2, &
12195 -1, 2, -1, 3, 1, -2, 1, 2, &
12196 -2, 1, 1, 3, 2, -1, -1, 2 &
12199 real(
preal),
dimension(4+4,HEX_NTWIN),
parameter :: &
12202 -1, 0, 1, 1, 1, 0, -1, 2, &
12203 0, -1, 1, 1, 0, 1, -1, 2, &
12204 1, -1, 0, 1, -1, 1, 0, 2, &
12205 1, 0, -1, 1, -1, 0, 1, 2, &
12206 0, 1, -1, 1, 0, -1, 1, 2, &
12207 -1, 1, 0, 1, 1, -1, 0, 2, &
12209 -1, -1, 2, 6, 1, 1, -2, 1, &
12210 1, -2, 1, 6, -1, 2, -1, 1, &
12211 2, -1, -1, 6, -2, 1, 1, 1, &
12212 1, 1, -2, 6, -1, -1, 2, 1, &
12213 -1, 2, -1, 6, 1, -2, 1, 1, &
12214 -2, 1, 1, 6, 2, -1, -1, 1, &
12216 1, 0, -1, -2, 1, 0, -1, 1, &
12217 0, 1, -1, -2, 0, 1, -1, 1, &
12218 -1, 1, 0, -2, -1, 1, 0, 1, &
12219 -1, 0, 1, -2, -1, 0, 1, 1, &
12220 0, -1, 1, -2, 0, -1, 1, 1, &
12221 1, -1, 0, -2, 1, -1, 0, 1, &
12223 1, 1, -2, -3, 1, 1, -2, 2, &
12224 -1, 2, -1, -3, -1, 2, -1, 2, &
12225 -2, 1, 1, -3, -2, 1, 1, 2, &
12226 -1, -1, 2, -3, -1, -1, 2, 2, &
12227 1, -2, 1, -3, 1, -2, 1, 2, &
12228 2, -1, -1, -3, 2, -1, -1, 2 &
12233 integer,
dimension(13),
parameter :: &
12234 bct_nslipsystem = [2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 4, 8, 8 ]
12236 integer,
parameter :: &
12243 real(
preal),
dimension(3+3,BCT_NSLIP),
parameter :: &
12247 0, 0, 1, 1, 0, 0, &
12248 0, 0, 1, 0, 1, 0, &
12250 0, 0, 1, 1, 1, 0, &
12251 0, 0, 1, -1, 1, 0, &
12253 0, 1, 0, 1, 0, 0, &
12254 1, 0, 0, 0, 1, 0, &
12256 1,-1, 1, 1, 1, 0, &
12257 1,-1,-1, 1, 1, 0, &
12258 -1,-1,-1, -1, 1, 0, &
12259 -1,-1, 1, -1, 1, 0, &
12261 1, -1, 0, 1, 1, 0, &
12262 1, 1, 0, 1,-1, 0, &
12264 0, 1, 1, 1, 0, 0, &
12265 0,-1, 1, 1, 0, 0, &
12266 -1, 0, 1, 0, 1, 0, &
12267 1, 0, 1, 0, 1, 0, &
12269 0, 1, 0, 0, 0, 1, &
12270 1, 0, 0, 0, 0, 1, &
12272 1, 1, 0, 0, 0, 1, &
12273 -1, 1, 0, 0, 0, 1, &
12275 0, 1,-1, 0, 1, 1, &
12276 0,-1,-1, 0,-1, 1, &
12277 -1, 0,-1, -1, 0, 1, &
12278 1, 0,-1, 1, 0, 1, &
12280 1,-1, 1, 0, 1, 1, &
12281 1, 1,-1, 0, 1, 1, &
12282 1, 1, 1, 0, 1,-1, &
12283 -1, 1, 1, 0, 1,-1, &
12284 1,-1,-1, 1, 0, 1, &
12285 -1,-1, 1, 1, 0, 1, &
12286 1, 1, 1, 1, 0,-1, &
12287 1,-1, 1, 1, 0,-1, &
12289 1, 0, 0, 0, 1, 1, &
12290 1, 0, 0, 0, 1,-1, &
12291 0, 1, 0, 1, 0, 1, &
12292 0, 1, 0, 1, 0,-1, &
12294 0, 1,-1, 2, 1, 1, &
12295 0,-1,-1, 2,-1, 1, &
12296 1, 0,-1, 1, 2, 1, &
12297 -1, 0,-1, -1, 2, 1, &
12298 0, 1,-1, -2, 1, 1, &
12299 0,-1,-1, -2,-1, 1, &
12300 -1, 0,-1, -1,-2, 1, &
12301 1, 0,-1, 1,-2, 1, &
12303 -1, 1, 1, 2, 1, 1, &
12304 -1,-1, 1, 2,-1, 1, &
12305 1,-1, 1, 1, 2, 1, &
12306 -1,-1, 1, -1, 2, 1, &
12307 1, 1, 1, -2, 1, 1, &
12308 1,-1, 1, -2,-1, 1, &
12309 -1, 1, 1, -1,-2, 1, &
12315 integer,
dimension(3),
parameter :: &
12318 integer,
parameter :: &
12325 real(
preal),
dimension(3+3,ORT_NCLEAVAGE),
parameter :: &
12328 0, 1, 0, 1, 0, 0, &
12329 0, 0, 1, 0, 1, 0, &
12334 enum,
bind(c); enumerator :: &
12345 real(
preal),
dimension(:),
allocatable,
public,
protected :: &
12350 real(
preal),
dimension(:,:,:),
allocatable,
public,
protected :: &
12354 integer(kind(lattice_UNDEFINED_ID)),
dimension(:),
allocatable,
public,
protected :: &
12404 integer :: nphases, p,i
12405 character(len=pStringLen) :: structure =
''
12407 write(6,
'(/,a)')
' <<<+- lattice init -+>>>';
flush(6)
12412 allocate(
lattice_c66(6,6,nphases), source=0.0_preal)
12420 source=[(0.0_preal,i=1,nphases)])
12435 structure =
config_phase(p)%getString(
'lattice_structure')
12436 select case(trim(structure))
12450 call io_error(130,ext_msg=
'lattice_init: '//trim(structure))
12461 call io_error(135,el=i,ip=p,ext_msg=
'matrix diagonal "el"ement of phase "ip"')
12494 integer,
dimension(:),
intent(in) :: ntwin
12495 character(len=*),
intent(in) :: structure
12496 real(
preal),
intent(in) :: covera
12497 real(
preal),
dimension(sum(Ntwin)) :: characteristicshear
12500 a, & !< index of active system
12501 p, & !< index in potential system list
12502 f, & !< index of my family
12505 integer,
dimension(HEX_NTWIN),
parameter :: &
12506 hex_sheartwin = reshape( [&
12533 if (len_trim(structure) /= 3) &
12534 call io_error(137,ext_msg=
'lattice_characteristicShear_Twin: '//trim(structure))
12537 myfamilies:
do f = 1,
size(ntwin,1)
12538 mysystems:
do s = 1,ntwin(f)
12540 select case(structure)
12542 characteristicshear(a) = 0.5_preal*sqrt(2.0_preal)
12544 if (covera < 1.0_preal .or. covera > 2.0_preal) &
12545 call io_error(131,ext_msg=
'lattice_characteristicShear_Twin')
12547 select case(hex_sheartwin(p))
12549 characteristicshear(a) = (3.0_preal-covera**2.0_preal)/sqrt(3.0_preal)/covera
12551 characteristicshear(a) = 1.0_preal/covera
12553 characteristicshear(a) = (4.0_preal*covera**2.0_preal-9.0_preal)/sqrt(48.0_preal)/covera
12555 characteristicshear(a) = 2.0_preal*(covera**2.0_preal-2.0_preal)/3.0_preal/covera
12558 call io_error(137,ext_msg=
'lattice_characteristicShear_Twin: '//trim(structure))
12571 integer,
dimension(:),
intent(in) :: ntwin
12572 character(len=*),
intent(in) :: structure
12573 real(
preal),
dimension(6,6),
intent(in) :: c66
12574 real(
preal),
intent(in) :: covera
12577 real(
preal),
dimension(3,3,sum(Ntwin)):: coordinatesystem
12581 if (len_trim(structure) /= 3) &
12582 call io_error(137,ext_msg=
'lattice_C66_twin: '//trim(structure))
12584 select case(structure)
12587 trim(structure),0.0_preal)
12590 trim(structure),0.0_preal)
12595 call io_error(137,ext_msg=
'lattice_C66_twin: '//trim(structure))
12598 do i = 1, sum(ntwin)
12599 call r%fromAxisAngle([coordinatesystem(1:3,2,i),
pi],p=1)
12610 cOverA_trans,a_bcc,a_fcc)
12612 integer,
dimension(:),
intent(in) :: ntrans
12613 character(len=*),
intent(in) :: structure_target
12614 real(
preal),
dimension(6,6),
intent(in) :: c_parent66
12617 real(
preal),
dimension(6,6) :: c_bar66, c_target_unrotated66
12618 real(
preal),
dimension(3,3,sum(Ntrans)) :: q,s
12620 real(
preal) :: a_bcc, a_fcc, covera_trans
12623 if (len_trim(structure_target) /= 3) &
12624 call io_error(137,ext_msg=
'lattice_C66_trans (target): '//trim(structure_target))
12628 if (structure_target(1:3) ==
'hex')
then
12629 if (covera_trans < 1.0_preal .or. covera_trans > 2.0_preal) &
12630 call io_error(131,ext_msg=
'lattice_C66_trans: '//trim(structure_target))
12631 c_bar66(1,1) = (c_parent66(1,1) + c_parent66(1,2) + 2.0_preal*c_parent66(4,4))/2.0_preal
12632 c_bar66(1,2) = (c_parent66(1,1) + 5.0_preal*c_parent66(1,2) - 2.0_preal*c_parent66(4,4))/6.0_preal
12633 c_bar66(3,3) = (c_parent66(1,1) + 2.0_preal*c_parent66(1,2) + 4.0_preal*c_parent66(4,4))/3.0_preal
12634 c_bar66(1,3) = (c_parent66(1,1) + 2.0_preal*c_parent66(1,2) - 2.0_preal*c_parent66(4,4))/3.0_preal
12635 c_bar66(4,4) = (c_parent66(1,1) - c_parent66(1,2) + c_parent66(4,4))/3.0_preal
12636 c_bar66(1,4) = (c_parent66(1,1) - c_parent66(1,2) - 2.0_preal*c_parent66(4,4)) /(3.0_preal*sqrt(2.0_preal))
12638 c_target_unrotated66 = 0.0_preal
12639 c_target_unrotated66(1,1) = c_bar66(1,1) - c_bar66(1,4)**2.0_preal/c_bar66(4,4)
12640 c_target_unrotated66(1,2) = c_bar66(1,2) + c_bar66(1,4)**2.0_preal/c_bar66(4,4)
12641 c_target_unrotated66(1,3) = c_bar66(1,3)
12642 c_target_unrotated66(3,3) = c_bar66(3,3)
12643 c_target_unrotated66(4,4) = c_bar66(4,4) - c_bar66(1,4)**2.0_preal/(0.5_preal*(c_bar66(1,1) - c_bar66(1,2)))
12645 elseif (structure_target(1:3) ==
'bcc')
then
12646 if (a_bcc <= 0.0_preal .or. a_fcc <= 0.0_preal) &
12647 call io_error(134,ext_msg=
'lattice_C66_trans: '//trim(structure_target))
12648 c_target_unrotated66 = c_parent66
12650 call io_error(137,ext_msg=
'lattice_C66_trans : '//trim(structure_target))
12655 call io_error(135,el=i,ext_msg=
'matrix diagonal "el"ement in transformation')
12660 do i = 1, sum(ntrans)
12661 call r%fromMatrix(q(1:3,1:3,i))
12675 integer,
dimension(:),
intent(in) :: nslip
12676 real(
preal),
dimension(:),
intent(in) :: nonschmidcoefficients
12677 integer,
intent(in) :: sense
12678 real(
preal),
dimension(1:3,1:3,sum(Nslip)) :: nonschmidmatrix
12680 real(
preal),
dimension(1:3,1:3,sum(Nslip)) :: coordinatesystem
12681 real(
preal),
dimension(3) :: direction, normal, np
12685 if (abs(sense) /= 1)
call io_error(0,ext_msg=
'lattice_nonSchmidMatrix')
12689 coordinatesystem(1:3,1,1:sum(nslip)) = coordinatesystem(1:3,1,1:sum(nslip))*real(sense,
preal)
12692 do i = 1,sum(nslip)
12693 direction = coordinatesystem(1:3,1,i)
12694 normal = coordinatesystem(1:3,2,i)
12695 call r%fromAxisAngle([direction,60.0_preal],degrees=.true.,p=1)
12696 np = r%rotate(normal)
12698 if (
size(nonschmidcoefficients)>0) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12699 + nonschmidcoefficients(1) *
math_outer(direction, np)
12700 if (
size(nonschmidcoefficients)>1) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12702 if (
size(nonschmidcoefficients)>2) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12704 if (
size(nonschmidcoefficients)>3) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12705 + nonschmidcoefficients(4) *
math_outer(normal, normal)
12706 if (
size(nonschmidcoefficients)>4) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12709 if (
size(nonschmidcoefficients)>5) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
12710 + nonschmidcoefficients(6) *
math_outer(direction, direction)
12722 integer,
dimension(:),
intent(in) :: nslip
12723 real(
preal),
dimension(:),
intent(in) :: interactionvalues
12724 character(len=*),
intent(in) :: structure
12725 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: interactionmatrix
12727 integer,
dimension(:),
allocatable :: nslipmax
12728 integer,
dimension(:,:),
allocatable :: interactiontypes
12730 integer,
dimension(FCC_NSLIP,FCC_NSLIP),
parameter :: &
12731 fcc_interactionslipslip = reshape( [&
12732 1, 2, 2, 4, 6, 5, 3, 5, 5, 4, 5, 6, 9,10, 9,10,11,12, &
12733 2, 1, 2, 6, 4, 5, 5, 4, 6, 5, 3, 5, 9,10,11,12, 9,10, &
12734 2, 2, 1, 5, 5, 3, 5, 6, 4, 6, 5, 4, 11,12, 9,10, 9,10, &
12735 4, 6, 5, 1, 2, 2, 4, 5, 6, 3, 5, 5, 9,10,10, 9,12,11, &
12736 6, 4, 5, 2, 1, 2, 5, 3, 5, 5, 4, 6, 9,10,12,11,10, 9, &
12737 5, 5, 3, 2, 2, 1, 6, 5, 4, 5, 6, 4, 11,12,10, 9,10, 9, &
12738 3, 5, 5, 4, 5, 6, 1, 2, 2, 4, 6, 5, 10, 9,10, 9,11,12, &
12739 5, 4, 6, 5, 3, 5, 2, 1, 2, 6, 4, 5, 10, 9,12,11, 9,10, &
12740 5, 6, 4, 6, 5, 4, 2, 2, 1, 5, 5, 3, 12,11,10, 9, 9,10, &
12741 4, 5, 6, 3, 5, 5, 4, 6, 5, 1, 2, 2, 10, 9, 9,10,12,11, &
12742 5, 3, 5, 5, 4, 6, 6, 4, 5, 2, 1, 2, 10, 9,11,12,10, 9, &
12743 6, 5, 4, 5, 6, 4, 5, 5, 3, 2, 2, 1, 12,11, 9,10,10, 9, &
12745 9, 9,11, 9, 9,11,10,10,12,10,10,12, 1, 7, 8, 8, 8, 8, &
12746 10,10,12,10,10,12, 9, 9,11, 9, 9,11, 7, 1, 8, 8, 8, 8, &
12747 9,11, 9,10,12,10,10,12,10, 9,11, 9, 8, 8, 1, 7, 8, 8, &
12748 10,12,10, 9,11, 9, 9,11, 9,10,12,10, 8, 8, 7, 1, 8, 8, &
12749 11, 9, 9,12,10,10,11, 9, 9,12,10,10, 8, 8, 8, 8, 1, 7, &
12750 12,10,10,11, 9, 9,12,10,10,11, 9, 9, 8, 8, 8, 8, 7, 1 &
12751 ],shape(fcc_interactionslipslip))
12765 integer,
dimension(BCC_NSLIP,BCC_NSLIP),
parameter :: &
12766 bcc_interactionslipslip = reshape( [&
12767 1,2,6,6,5,4,4,3,4,3,5,4, 6,6,4,3,3,4,6,6,4,3,6,6, &
12768 2,1,6,6,4,3,5,4,5,4,4,3, 6,6,3,4,4,3,6,6,3,4,6,6, &
12769 6,6,1,2,4,5,3,4,4,5,3,4, 4,3,6,6,6,6,3,4,6,6,4,3, &
12770 6,6,2,1,3,4,4,5,3,4,4,5, 3,4,6,6,6,6,4,3,6,6,3,4, &
12771 5,4,4,3,1,2,6,6,3,4,5,4, 3,6,4,6,6,4,6,3,4,6,3,6, &
12772 4,3,5,4,2,1,6,6,4,5,4,3, 4,6,3,6,6,3,6,4,3,6,4,6, &
12773 4,5,3,4,6,6,1,2,5,4,3,4, 6,3,6,4,4,6,3,6,6,4,6,3, &
12774 3,4,4,5,6,6,2,1,4,3,4,5, 6,4,6,3,3,6,4,6,6,3,6,4, &
12775 4,5,4,3,3,4,5,4,1,2,6,6, 3,6,6,4,4,6,6,3,6,4,3,6, &
12776 3,4,5,4,4,5,4,3,2,1,6,6, 4,6,6,3,3,6,6,4,6,3,4,6, &
12777 5,4,3,4,5,4,3,4,6,6,1,2, 6,3,4,6,6,4,3,6,4,6,6,3, &
12778 4,3,4,5,4,3,4,5,6,6,2,1, 6,4,3,6,6,3,4,6,3,6,6,4, &
12780 6,6,4,3,3,4,6,6,3,4,6,6, 1,5,6,6,5,6,6,3,5,6,3,6, &
12781 6,6,3,4,6,6,3,4,6,6,3,4, 5,1,6,6,6,5,3,6,6,5,6,3, &
12782 4,3,6,6,4,3,6,6,6,6,4,3, 6,6,1,5,6,3,5,6,3,6,5,6, &
12783 3,4,6,6,6,6,4,3,4,3,6,6, 6,6,5,1,3,6,6,5,6,3,6,5, &
12784 3,4,6,6,6,6,4,3,4,3,6,6, 5,6,6,3,1,6,5,6,5,3,6,6, &
12785 4,3,6,6,4,3,6,6,6,6,4,3, 6,5,3,6,6,1,6,5,3,5,6,6, &
12786 6,6,3,4,6,6,3,4,6,6,3,4, 6,3,5,6,5,6,1,6,6,6,5,3, &
12787 6,6,4,3,3,4,6,6,3,4,6,6, 3,6,6,5,6,5,6,1,6,6,3,5, &
12788 4,3,6,6,4,3,6,6,6,6,4,3, 5,6,3,6,5,3,6,6,1,6,6,5, &
12789 3,4,6,6,6,6,4,3,4,3,6,6, 6,5,6,3,3,5,6,6,6,1,5,6, &
12790 6,6,4,3,3,4,6,6,3,4,6,6, 3,6,5,6,6,6,5,3,6,5,1,6, &
12791 6,6,3,4,6,6,3,4,6,6,3,4, 6,3,6,5,6,6,3,5,5,6,6,1 &
12792 ],shape(bcc_interactionslipslip))
12800 integer,
dimension(HEX_NSLIP,HEX_NSLIP),
parameter :: &
12801 hex_interactionslipslip = reshape( [&
12802 1, 2, 2, 3, 3, 3, 7, 7, 7, 13,13,13,13,13,13, 21,21,21,21,21,21,21,21,21,21,21,21, 31,31,31,31,31,31, &
12803 2, 1, 2, 3, 3, 3, 7, 7, 7, 13,13,13,13,13,13, 21,21,21,21,21,21,21,21,21,21,21,21, 31,31,31,31,31,31, &
12804 2, 2, 1, 3, 3, 3, 7, 7, 7, 13,13,13,13,13,13, 21,21,21,21,21,21,21,21,21,21,21,21, 31,31,31,31,31,31, &
12806 6, 6, 6, 4, 5, 5, 8, 8, 8, 14,14,14,14,14,14, 22,22,22,22,22,22,22,22,22,22,22,22, 32,32,32,32,32,32, &
12807 6, 6, 6, 5, 4, 5, 8, 8, 8, 14,14,14,14,14,14, 22,22,22,22,22,22,22,22,22,22,22,22, 32,32,32,32,32,32, &
12808 6, 6, 6, 5, 5, 4, 8, 8, 8, 14,14,14,14,14,14, 22,22,22,22,22,22,22,22,22,22,22,22, 32,32,32,32,32,32, &
12810 12,12,12, 11,11,11, 9,10,10, 15,15,15,15,15,15, 23,23,23,23,23,23,23,23,23,23,23,23, 33,33,33,33,33,33, &
12811 12,12,12, 11,11,11, 10, 9,10, 15,15,15,15,15,15, 23,23,23,23,23,23,23,23,23,23,23,23, 33,33,33,33,33,33, &
12812 12,12,12, 11,11,11, 10,10, 9, 15,15,15,15,15,15, 23,23,23,23,23,23,23,23,23,23,23,23, 33,33,33,33,33,33, &
12814 20,20,20, 19,19,19, 18,18,18, 16,17,17,17,17,17, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12815 20,20,20, 19,19,19, 18,18,18, 17,16,17,17,17,17, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12816 20,20,20, 19,19,19, 18,18,18, 17,17,16,17,17,17, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12817 20,20,20, 19,19,19, 18,18,18, 17,17,17,16,17,17, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12818 20,20,20, 19,19,19, 18,18,18, 17,17,17,17,16,17, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12819 20,20,20, 19,19,19, 18,18,18, 17,17,17,17,17,16, 24,24,24,24,24,24,24,24,24,24,24,24, 34,34,34,34,34,34, &
12821 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 25,26,26,26,26,26,26,26,26,26,26,26, 35,35,35,35,35,35, &
12822 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,25,26,26,26,26,26,26,26,26,26,26, 35,35,35,35,35,35, &
12823 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,25,26,26,26,26,26,26,26,26,26, 35,35,35,35,35,35, &
12824 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,25,26,26,26,26,26,26,26,26, 35,35,35,35,35,35, &
12825 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,25,26,26,26,26,26,26,26, 35,35,35,35,35,35, &
12826 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,25,26,26,26,26,26,26, 35,35,35,35,35,35, &
12827 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,25,26,26,26,26,26, 35,35,35,35,35,35, &
12828 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,26,25,26,26,26,26, 35,35,35,35,35,35, &
12829 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,26,26,25,26,26,26, 35,35,35,35,35,35, &
12830 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,26,26,26,25,26,26, 35,35,35,35,35,35, &
12831 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,26,26,26,26,25,26, 35,35,35,35,35,35, &
12832 30,30,30, 29,29,29, 28,28,28, 27,27,27,27,27,27, 26,26,26,26,26,26,26,26,26,26,26,25, 35,35,35,35,35,35, &
12834 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 36,37,37,37,37,37, &
12835 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 37,36,37,37,37,37, &
12836 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 37,37,36,37,37,37, &
12837 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 37,37,37,36,37,37, &
12838 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 37,37,37,37,36,37, &
12839 42,42,42, 41,41,41, 40,40,40, 39,39,39,39,39,39, 38,38,38,38,38,38,38,38,38,38,38,38, 37,37,37,37,37,36 &
12840 ],shape(hex_interactionslipslip))
12842 integer,
dimension(BCT_NSLIP,BCT_NSLIP),
parameter :: &
12843 bct_interactionslipslip = reshape( [&
12844 1, 2, 3, 3, 7, 7, 13, 13, 13, 13, 21, 21, 31, 31, 31, 31, 43, 43, 57, 57, 73, 73, 73, 73, 91, 91, 91, 91, 91, 91, 91, 91, 111, 111, 111, 111, 133,133,133,133,133,133,133,133, 157,157,157,157,157,157,157,157, &
12845 2, 1, 3, 3, 7, 7, 13, 13, 13, 13, 21, 21, 31, 31, 31, 31, 43, 43, 57, 57, 73, 73, 73, 73, 91, 91, 91, 91, 91, 91, 91, 91, 111, 111, 111, 111, 133,133,133,133,133,133,133,133, 157,157,157,157,157,157,157,157, &
12847 6, 6, 4, 5, 8, 8, 14, 14, 14, 14, 22, 22, 32, 32, 32, 32, 44, 44, 58, 58, 74, 74, 74, 74, 92, 92, 92, 92, 92, 92, 92, 92, 112, 112, 112, 112, 134,134,134,134,134,134,134,134, 158,158,158,158,158,158,158,158, &
12848 6, 6, 5, 4, 8, 8, 14, 14, 14, 14, 22, 22, 32, 32, 32, 32, 44, 44, 58, 58, 74, 74, 74, 74, 92, 92, 92, 92, 92, 92, 92, 92, 112, 112, 112, 112, 134,134,134,134,134,134,134,134, 158,158,158,158,158,158,158,158, &
12850 12, 12, 11, 11, 9, 10, 15, 15, 15, 15, 23, 23, 33, 33, 33, 33, 45, 45, 59, 59, 75, 75, 75, 75, 93, 93, 93, 93, 93, 93, 93, 93, 113, 113, 113, 113, 135,135,135,135,135,135,135,135, 159,159,159,159,159,159,159,159, &
12851 12, 12, 11, 11, 10, 9, 15, 15, 15, 15, 23, 23, 33, 33, 33, 33, 45, 45, 59, 59, 75, 75, 75, 75, 93, 93, 93, 93, 93, 93, 93, 93, 113, 113, 113, 113, 135,135,135,135,135,135,135,135, 159,159,159,159,159,159,159,159, &
12853 20, 20, 19, 19, 18, 18, 16, 17, 17, 17, 24, 24, 34, 34, 34, 34, 46, 46, 60, 60, 76, 76, 76, 76, 94, 94, 94, 94, 94, 94, 94, 94, 114, 114, 114, 114, 136,136,136,136,136,136,136,136, 160,160,160,160,160,160,160,160, &
12854 20, 20, 19, 19, 18, 18, 17, 16, 17, 17, 24, 24, 34, 34, 34, 34, 46, 46, 60, 60, 76, 76, 76, 76, 94, 94, 94, 94, 94, 94, 94, 94, 114, 114, 114, 114, 136,136,136,136,136,136,136,136, 160,160,160,160,160,160,160,160, &
12855 20, 20, 19, 19, 18, 18, 17, 17, 16, 17, 24, 24, 34, 34, 34, 34, 46, 46, 60, 60, 76, 76, 76, 76, 94, 94, 94, 94, 94, 94, 94, 94, 114, 114, 114, 114, 136,136,136,136,136,136,136,136, 160,160,160,160,160,160,160,160, &
12856 20, 20, 19, 19, 18, 18, 17, 17, 17, 16, 24, 24, 34, 34, 34, 34, 46, 46, 60, 60, 76, 76, 76, 76, 94, 94, 94, 94, 94, 94, 94, 94, 114, 114, 114, 114, 136,136,136,136,136,136,136,136, 160,160,160,160,160,160,160,160, &
12858 30, 30, 29, 29, 28, 28, 27, 27, 27, 27, 25, 26, 35, 35, 35, 35, 47, 47, 61, 61, 77, 77, 77, 77, 95, 95, 95, 95, 95, 95, 95, 95, 115, 115, 115, 115, 137,137,137,137,137,137,137,137, 161,161,161,161,161,161,161,161, &
12859 30, 30, 29, 29, 28, 28, 27, 27, 27, 27, 26, 25, 35, 35, 35, 35, 47, 47, 61, 61, 77, 77, 77, 77, 95, 95, 95, 95, 95, 95, 95, 95, 115, 115, 115, 115, 137,137,137,137,137,137,137,137, 161,161,161,161,161,161,161,161, &
12861 42, 42, 41, 41, 40, 40, 39, 39, 39, 39, 38, 38, 36, 37, 37, 37, 48, 48, 62, 62, 78, 78, 78, 78, 96, 96, 96, 96, 96, 96, 96, 96, 116, 116, 116, 116, 138,138,138,138,138,138,138,138, 162,162,162,162,162,162,162,162, &
12862 42, 42, 41, 41, 40, 40, 39, 39, 39, 39, 38, 38, 37, 36, 37, 37, 48, 48, 62, 62, 78, 78, 78, 78, 96, 96, 96, 96, 96, 96, 96, 96, 116, 116, 116, 116, 138,138,138,138,138,138,138,138, 162,162,162,162,162,162,162,162, &
12863 42, 42, 41, 41, 40, 40, 39, 39, 39, 39, 38, 38, 37, 37, 36, 37, 48, 48, 62, 62, 78, 78, 78, 78, 96, 96, 96, 96, 96, 96, 96, 96, 116, 116, 116, 116, 138,138,138,138,138,138,138,138, 162,162,162,162,162,162,162,162, &
12864 42, 42, 41, 41, 40, 40, 39, 39, 39, 39, 38, 38, 37, 37, 37, 36, 48, 48, 62, 62, 78, 78, 78, 78, 96, 96, 96, 96, 96, 96, 96, 96, 116, 116, 116, 116, 138,138,138,138,138,138,138,138, 162,162,162,162,162,162,162,162, &
12866 56, 56, 55, 55, 54, 54, 53, 53, 53, 53, 52, 52, 51, 51, 51, 51, 49, 50, 63, 63, 79, 79, 79, 79, 97, 97, 97, 97, 97, 97, 97, 97, 117, 117, 117, 117, 139,139,139,139,139,139,139,139, 163,163,163,163,163,163,163,163, &
12867 56, 56, 55, 55, 54, 54, 53, 53, 53, 53, 52, 52, 51, 51, 51, 51, 50, 49, 63, 63, 79, 79, 79, 79, 97, 97, 97, 97, 97, 97, 97, 97, 117, 117, 117, 117, 139,139,139,139,139,139,139,139, 163,163,163,163,163,163,163,163, &
12869 72, 72, 71, 71, 70, 70, 69, 69, 69, 69, 68, 68, 67, 67, 67, 67, 66, 66, 64, 65, 80, 80, 80, 80, 98, 98, 98, 98, 98, 98, 98, 98, 118, 118, 118, 118, 140,140,140,140,140,140,140,140, 164,164,164,164,164,164,164,164, &
12870 72, 72, 71, 71, 70, 70, 69, 69, 69, 69, 68, 68, 67, 67, 67, 67, 66, 66, 65, 64, 80, 80, 80, 80, 98, 98, 98, 98, 98, 98, 98, 98, 118, 118, 118, 118, 140,140,140,140,140,140,140,140, 164,164,164,164,164,164,164,164, &
12872 90, 90, 89, 89, 88, 88, 87, 87, 87, 87, 86, 86, 85, 85, 85, 85, 84, 84, 83, 83, 81, 82, 82, 82, 99, 99, 99, 99, 99, 99, 99, 99, 119, 119, 119, 119, 141,141,141,141,141,141,141,141, 165,165,165,165,165,165,165,165, &
12873 90, 90, 89, 89, 88, 88, 87, 87, 87, 87, 86, 86, 85, 85, 85, 85, 84, 84, 83, 83, 82, 81, 82, 82, 99, 99, 99, 99, 99, 99, 99, 99, 119, 119, 119, 119, 141,141,141,141,141,141,141,141, 165,165,165,165,165,165,165,165, &
12874 90, 90, 89, 89, 88, 88, 87, 87, 87, 87, 86, 86, 85, 85, 85, 85, 84, 84, 83, 83, 82, 82, 81, 82, 99, 99, 99, 99, 99, 99, 99, 99, 119, 119, 119, 119, 141,141,141,141,141,141,141,141, 165,165,165,165,165,165,165,165, &
12875 90, 90, 89, 89, 88, 88, 87, 87, 87, 87, 86, 86, 85, 85, 85, 85, 84, 84, 83, 83, 82, 82, 82, 81, 99, 99, 99, 99, 99, 99, 99, 99, 119, 119, 119, 119, 141,141,141,141,141,141,141,141, 165,165,165,165,165,165,165,165, &
12877 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 100,101,101,101,101,101,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12878 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,100,101,101,101,101,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12879 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,100,101,101,101,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12880 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,101,100,101,101,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12881 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,101,101,100,101,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12882 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,101,101,101,100,101,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12883 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,101,101,101,101,100,101, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12884 110,110, 109,109, 108,108, 107,107,107,107, 106,106, 105,105,105,105, 104,104, 103,103, 102,102,102,102, 101,101,101,101,101,101,101,100, 120, 120, 120, 120, 142,142,142,142,142,142,142,142, 166,166,166,166,166,166,166,166, &
12886 132,132, 131,131, 130,130, 129,129,129,129, 128,128, 127,127,127,127, 126,126, 125,125, 124,124,124,124, 123,123,123,123,123,123,123,123, 121, 122, 122, 122, 143,143,143,143,143,143,143,143, 167,167,167,167,167,167,167,167, &
12887 132,132, 131,131, 130,130, 129,129,129,129, 128,128, 127,127,127,127, 126,126, 125,125, 124,124,124,124, 123,123,123,123,123,123,123,123, 121, 121, 122, 122, 143,143,143,143,143,143,143,143, 167,167,167,167,167,167,167,167, &
12888 132,132, 131,131, 130,130, 129,129,129,129, 128,128, 127,127,127,127, 126,126, 125,125, 124,124,124,124, 123,123,123,123,123,123,123,123, 121, 122, 121, 122, 143,143,143,143,143,143,143,143, 167,167,167,167,167,167,167,167, &
12889 132,132, 131,131, 130,130, 129,129,129,129, 128,128, 127,127,127,127, 126,126, 125,125, 124,124,124,124, 123,123,123,123,123,123,123,123, 121, 122, 122, 121, 143,143,143,143,143,143,143,143, 167,167,167,167,167,167,167,167, &
12891 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 144,145,145,145,145,145,145,145, 168,168,168,168,168,168,168,168, &
12892 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,144,145,145,145,145,145,145, 168,168,168,168,168,168,168,168, &
12893 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,144,145,145,145,145,145, 168,168,168,168,168,168,168,168, &
12894 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,145,144,145,145,145,145, 168,168,168,168,168,168,168,168, &
12895 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,145,145,144,145,145,145, 168,168,168,168,168,168,168,168, &
12896 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,145,145,145,144,145,145, 168,168,168,168,168,168,168,168, &
12897 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,145,145,145,145,144,145, 168,168,168,168,168,168,168,168, &
12898 156,156, 155,155, 154,154, 153,153,153,153, 152,152, 151,151,151,151, 150,150, 149,149, 148,148,148,148, 147,147,147,147,147,147,147,147, 146, 146, 146, 146, 145,145,145,145,145,145,145,144, 168,168,168,168,168,168,168,168, &
12900 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 169,170,170,170,170,170,170,170, &
12901 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 170,169,170,170,170,170,170,170, &
12902 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 170,170,169,170,170,170,170,170, &
12903 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 170,170,170,169,170,170,170,170, &
12904 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 170,170,170,170,169,170,170,170, &
12905 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 169,170,170,170,170,169,170,170, &
12906 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 169,170,170,170,170,170,169,170, &
12907 182,182, 181,181, 180,180, 179,179,179,179, 178,178, 177,177,177,177, 176,176, 175,175, 174,174,174,174, 173,173,173,173,173,173,173,173, 172, 172, 172, 172, 171,171,171,171,171,171,171,171, 169,170,170,170,170,170,170,169 &
12908 ],shape(bct_interactionslipslip))
12911 if (len_trim(structure) /= 3) &
12912 call io_error(137,ext_msg=
'lattice_interaction_SlipBySlip: '//trim(structure))
12914 select case(structure)
12916 interactiontypes = fcc_interactionslipslip
12919 interactiontypes = bcc_interactionslipslip
12922 interactiontypes = hex_interactionslipslip
12925 interactiontypes = bct_interactionslipslip
12928 call io_error(137,ext_msg=
'lattice_interaction_SlipBySlip: '//trim(structure))
12931 interactionmatrix =
buildinteraction(nslip,nslip,nslipmax,nslipmax,interactionvalues,interactiontypes)
12942 integer,
dimension(:),
intent(in) :: ntwin
12943 real(
preal),
dimension(:),
intent(in) :: interactionvalues
12944 character(len=*),
intent(in) :: structure
12945 real(
preal),
dimension(sum(Ntwin),sum(Ntwin)) :: interactionmatrix
12947 integer,
dimension(:),
allocatable :: ntwinmax
12948 integer,
dimension(:,:),
allocatable :: interactiontypes
12950 integer,
dimension(FCC_NTWIN,FCC_NTWIN),
parameter :: &
12951 fcc_interactiontwintwin = reshape( [&
12952 1,1,1,2,2,2,2,2,2,2,2,2, &
12953 1,1,1,2,2,2,2,2,2,2,2,2, &
12954 1,1,1,2,2,2,2,2,2,2,2,2, &
12955 2,2,2,1,1,1,2,2,2,2,2,2, &
12956 2,2,2,1,1,1,2,2,2,2,2,2, &
12957 2,2,2,1,1,1,2,2,2,2,2,2, &
12958 2,2,2,2,2,2,1,1,1,2,2,2, &
12959 2,2,2,2,2,2,1,1,1,2,2,2, &
12960 2,2,2,2,2,2,1,1,1,2,2,2, &
12961 2,2,2,2,2,2,2,2,2,1,1,1, &
12962 2,2,2,2,2,2,2,2,2,1,1,1, &
12963 2,2,2,2,2,2,2,2,2,1,1,1 &
12964 ],shape(fcc_interactiontwintwin))
12966 integer,
dimension(BCC_NTWIN,BCC_NTWIN),
parameter :: &
12967 bcc_interactiontwintwin = reshape( [&
12968 1,3,3,3,3,3,3,2,3,3,2,3, &
12969 3,1,3,3,3,3,2,3,3,3,3,2, &
12970 3,3,1,3,3,2,3,3,2,3,3,3, &
12971 3,3,3,1,2,3,3,3,3,2,3,3, &
12972 3,3,3,2,1,3,3,3,3,2,3,3, &
12973 3,3,2,3,3,1,3,3,2,3,3,3, &
12974 3,2,3,3,3,3,1,3,3,3,3,2, &
12975 2,3,3,3,3,3,3,1,3,3,2,3, &
12976 3,3,2,3,3,2,3,3,1,3,3,3, &
12977 3,3,3,2,2,3,3,3,3,1,3,3, &
12978 2,3,3,3,3,3,3,2,3,3,1,3, &
12979 3,2,3,3,3,3,2,3,3,3,3,1 &
12980 ],shape(bcc_interactiontwintwin))
12984 integer,
dimension(HEX_NTWIN,HEX_NTWIN),
parameter :: &
12985 hex_interactiontwintwin = reshape( [&
12986 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12987 2, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12988 2, 2, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12989 2, 2, 2, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12990 2, 2, 2, 2, 1, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12991 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
12993 6, 6, 6, 6, 6, 6, 4, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
12994 6, 6, 6, 6, 6, 6, 5, 4, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
12995 6, 6, 6, 6, 6, 6, 5, 5, 4, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
12996 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
12997 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
12998 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
13000 12,12,12,12,12,12, 11,11,11,11,11,11, 9,10,10,10,10,10, 15,15,15,15,15,15, &
13001 12,12,12,12,12,12, 11,11,11,11,11,11, 10, 9,10,10,10,10, 15,15,15,15,15,15, &
13002 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10, 9,10,10,10, 15,15,15,15,15,15, &
13003 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10, 9,10,10, 15,15,15,15,15,15, &
13004 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10,10, 9,10, 15,15,15,15,15,15, &
13005 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10,10,10, 9, 15,15,15,15,15,15, &
13007 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 16,17,17,17,17,17, &
13008 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,16,17,17,17,17, &
13009 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,16,17,17,17, &
13010 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,16,17,17, &
13011 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,17,16,17, &
13012 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,17,17,16 &
13013 ],shape(hex_interactiontwintwin))
13015 if (len_trim(structure) /= 3) &
13016 call io_error(137,ext_msg=
'lattice_interaction_TwinByTwin: '//trim(structure))
13018 select case(structure)
13020 interactiontypes = fcc_interactiontwintwin
13023 interactiontypes = bcc_interactiontwintwin
13026 interactiontypes = hex_interactiontwintwin
13029 call io_error(137,ext_msg=
'lattice_interaction_TwinByTwin: '//trim(structure))
13032 interactionmatrix =
buildinteraction(ntwin,ntwin,ntwinmax,ntwinmax,interactionvalues,interactiontypes)
13043 integer,
dimension(:),
intent(in) :: ntrans
13044 real(
preal),
dimension(:),
intent(in) :: interactionvalues
13045 character(len=*),
intent(in) :: structure
13046 real(
preal),
dimension(sum(Ntrans),sum(Ntrans)) :: interactionmatrix
13048 integer,
dimension(:),
allocatable :: ntransmax
13049 integer,
dimension(:,:),
allocatable :: interactiontypes
13051 integer,
dimension(FCC_NTRANS,FCC_NTRANS),
parameter :: &
13052 fcc_interactiontranstrans = reshape( [&
13053 1,1,1,2,2,2,2,2,2,2,2,2, &
13054 1,1,1,2,2,2,2,2,2,2,2,2, &
13055 1,1,1,2,2,2,2,2,2,2,2,2, &
13056 2,2,2,1,1,1,2,2,2,2,2,2, &
13057 2,2,2,1,1,1,2,2,2,2,2,2, &
13058 2,2,2,1,1,1,2,2,2,2,2,2, &
13059 2,2,2,2,2,2,1,1,1,2,2,2, &
13060 2,2,2,2,2,2,1,1,1,2,2,2, &
13061 2,2,2,2,2,2,1,1,1,2,2,2, &
13062 2,2,2,2,2,2,2,2,2,1,1,1, &
13063 2,2,2,2,2,2,2,2,2,1,1,1, &
13064 2,2,2,2,2,2,2,2,2,1,1,1 &
13065 ],shape(fcc_interactiontranstrans))
13067 if (len_trim(structure) /= 3) &
13068 call io_error(137,ext_msg=
'lattice_interaction_TransByTrans: '//trim(structure))
13070 if(structure ==
'fcc')
then
13071 interactiontypes = fcc_interactiontranstrans
13074 call io_error(137,ext_msg=
'lattice_interaction_TransByTrans: '//trim(structure))
13077 interactionmatrix =
buildinteraction(ntrans,ntrans,ntransmax,ntransmax,interactionvalues,interactiontypes)
13088 integer,
dimension(:),
intent(in) :: nslip, & !< number of active slip systems per family
13090 real(
preal),
dimension(:),
intent(in) :: interactionvalues
13091 character(len=*),
intent(in) :: structure
13092 real(
preal),
dimension(sum(Nslip),sum(Ntwin)) :: interactionmatrix
13094 integer,
dimension(:),
allocatable :: nslipmax, &
13096 integer,
dimension(:,:),
allocatable :: interactiontypes
13098 integer,
dimension(FCC_NTWIN,FCC_NSLIP),
parameter :: &
13099 fcc_interactionsliptwin = reshape( [&
13100 1,1,1,3,3,3,2,2,2,3,3,3, &
13101 1,1,1,3,3,3,3,3,3,2,2,2, &
13102 1,1,1,2,2,2,3,3,3,3,3,3, &
13103 3,3,3,1,1,1,3,3,3,2,2,2, &
13104 3,3,3,1,1,1,2,2,2,3,3,3, &
13105 2,2,2,1,1,1,3,3,3,3,3,3, &
13106 2,2,2,3,3,3,1,1,1,3,3,3, &
13107 3,3,3,2,2,2,1,1,1,3,3,3, &
13108 3,3,3,3,3,3,1,1,1,2,2,2, &
13109 3,3,3,2,2,2,3,3,3,1,1,1, &
13110 2,2,2,3,3,3,3,3,3,1,1,1, &
13111 3,3,3,3,3,3,2,2,2,1,1,1, &
13113 4,4,4,4,4,4,4,4,4,4,4,4, &
13114 4,4,4,4,4,4,4,4,4,4,4,4, &
13115 4,4,4,4,4,4,4,4,4,4,4,4, &
13116 4,4,4,4,4,4,4,4,4,4,4,4, &
13117 4,4,4,4,4,4,4,4,4,4,4,4, &
13118 4,4,4,4,4,4,4,4,4,4,4,4 &
13119 ],shape(fcc_interactionsliptwin))
13123 integer,
dimension(BCC_NTWIN,BCC_NSLIP),
parameter :: &
13124 bcc_interactionsliptwin = reshape( [&
13125 3,3,3,2,2,3,3,3,3,2,3,3, &
13126 3,3,2,3,3,2,3,3,2,3,3,3, &
13127 3,2,3,3,3,3,2,3,3,3,3,2, &
13128 2,3,3,3,3,3,3,2,3,3,2,3, &
13129 2,3,3,3,3,3,3,2,3,3,2,3, &
13130 3,3,2,3,3,2,3,3,2,3,3,3, &
13131 3,2,3,3,3,3,2,3,3,3,3,2, &
13132 3,3,3,2,2,3,3,3,3,2,3,3, &
13133 2,3,3,3,3,3,3,2,3,3,2,3, &
13134 3,3,3,2,2,3,3,3,3,2,3,3, &
13135 3,2,3,3,3,3,2,3,3,3,3,2, &
13136 3,3,2,3,3,2,3,3,2,3,3,3, &
13138 1,3,3,3,3,3,3,2,3,3,2,3, &
13139 3,1,3,3,3,3,2,3,3,3,3,2, &
13140 3,3,1,3,3,2,3,3,2,3,3,3, &
13141 3,3,3,1,2,3,3,3,3,2,3,3, &
13142 3,3,3,2,1,3,3,3,3,2,3,3, &
13143 3,3,2,3,3,1,3,3,2,3,3,3, &
13144 3,2,3,3,3,3,1,3,3,3,3,2, &
13145 2,3,3,3,3,3,3,1,3,3,2,3, &
13146 3,3,2,3,3,2,3,3,1,3,3,3, &
13147 3,3,3,2,2,3,3,3,3,1,3,3, &
13148 2,3,3,3,3,3,3,2,3,3,1,3, &
13149 3,2,3,3,3,3,2,3,3,3,3,1 &
13150 ],shape(bcc_interactionsliptwin))
13154 integer,
dimension(HEX_NTWIN,HEX_NSLIP),
parameter :: &
13155 hex_interactionsliptwin = reshape( [&
13156 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
13157 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
13158 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
13160 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
13161 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
13162 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
13164 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
13165 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
13166 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
13168 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13169 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13170 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13171 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13172 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13173 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
13175 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13176 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13177 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13178 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13179 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13180 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13181 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13182 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13183 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13184 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13185 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13186 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
13188 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
13189 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
13190 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
13191 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
13192 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
13193 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24 &
13195 ],shape(hex_interactionsliptwin))
13197 if (len_trim(structure) /= 3) &
13198 call io_error(137,ext_msg=
'lattice_interaction_SlipByTwin: '//trim(structure))
13200 select case(structure)
13202 interactiontypes = fcc_interactionsliptwin
13206 interactiontypes = bcc_interactionsliptwin
13210 interactiontypes = hex_interactionsliptwin
13214 call io_error(137,ext_msg=
'lattice_interaction_SlipByTwin: '//trim(structure))
13217 interactionmatrix =
buildinteraction(nslip,ntwin,nslipmax,ntwinmax,interactionvalues,interactiontypes)
13228 integer,
dimension(:),
intent(in) :: nslip, & !< number of active slip systems per family
13230 real(
preal),
dimension(:),
intent(in) :: interactionvalues
13231 character(len=*),
intent(in) :: structure
13232 real(
preal),
dimension(sum(Nslip),sum(Ntrans)) :: interactionmatrix
13234 integer,
dimension(:),
allocatable :: nslipmax, &
13236 integer,
dimension(:,:),
allocatable :: interactiontypes
13238 integer,
dimension(FCC_NTRANS,FCC_NSLIP),
parameter :: &
13239 fcc_interactionsliptrans = reshape( [&
13240 1,1,1,3,3,3,2,2,2,3,3,3, &
13241 1,1,1,3,3,3,3,3,3,2,2,2, &
13242 1,1,1,2,2,2,3,3,3,3,3,3, &
13243 3,3,3,1,1,1,3,3,3,2,2,2, &
13244 3,3,3,1,1,1,2,2,2,3,3,3, &
13245 2,2,2,1,1,1,3,3,3,3,3,3, &
13246 2,2,2,3,3,3,1,1,1,3,3,3, &
13247 3,3,3,2,2,2,1,1,1,3,3,3, &
13248 3,3,3,3,3,3,1,1,1,2,2,2, &
13249 3,3,3,2,2,2,3,3,3,1,1,1, &
13250 2,2,2,3,3,3,3,3,3,1,1,1, &
13251 3,3,3,3,3,3,2,2,2,1,1,1, &
13253 4,4,4,4,4,4,4,4,4,4,4,4, &
13254 4,4,4,4,4,4,4,4,4,4,4,4, &
13255 4,4,4,4,4,4,4,4,4,4,4,4, &
13256 4,4,4,4,4,4,4,4,4,4,4,4, &
13257 4,4,4,4,4,4,4,4,4,4,4,4, &
13258 4,4,4,4,4,4,4,4,4,4,4,4 &
13259 ],shape(fcc_interactionsliptrans))
13261 if (len_trim(structure) /= 3) &
13262 call io_error(137,ext_msg=
'lattice_interaction_SlipByTrans: '//trim(structure))
13264 select case(structure)
13266 interactiontypes = fcc_interactionsliptrans
13270 call io_error(137,ext_msg=
'lattice_interaction_SlipByTrans: '//trim(structure))
13273 interactionmatrix =
buildinteraction(nslip,ntrans,nslipmax,ntransmax,interactionvalues,interactiontypes)
13284 integer,
dimension(:),
intent(in) :: ntwin, & !< number of active twin systems per family
13286 real(
preal),
dimension(:),
intent(in) :: interactionvalues
13287 character(len=*),
intent(in) :: structure
13288 real(
preal),
dimension(sum(Ntwin),sum(Nslip)) :: interactionmatrix
13290 integer,
dimension(:),
allocatable :: ntwinmax, &
13292 integer,
dimension(:,:),
allocatable :: interactiontypes
13294 integer,
dimension(FCC_NSLIP,FCC_NTWIN),
parameter :: &
13295 fcc_interactiontwinslip = 1
13297 integer,
dimension(BCC_NSLIP,BCC_NTWIN),
parameter :: &
13298 bcc_interactiontwinslip = 1
13300 integer,
dimension(HEX_NSLIP,HEX_NTWIN),
parameter :: &
13301 hex_interactiontwinslip = reshape( [&
13302 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13303 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13304 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13305 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13306 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13307 1, 1, 1, 5, 5, 5, 9, 9, 9, 13,13,13,13,13,13, 17,17,17,17,17,17,17,17,17,17,17,17, 21,21,21,21,21,21, &
13309 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13310 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13311 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13312 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13313 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13314 2, 2, 2, 6, 6, 6, 10,10,10, 14,14,14,14,14,14, 18,18,18,18,18,18,18,18,18,18,18,18, 22,22,22,22,22,22, &
13316 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13317 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13318 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13319 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13320 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13321 3, 3, 3, 7, 7, 7, 11,11,11, 15,15,15,15,15,15, 19,19,19,19,19,19,19,19,19,19,19,19, 23,23,23,23,23,23, &
13323 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24, &
13324 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24, &
13325 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24, &
13326 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24, &
13327 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24, &
13328 4, 4, 4, 8, 8, 8, 12,12,12, 16,16,16,16,16,16, 20,20,20,20,20,20,20,20,20,20,20,20, 24,24,24,24,24,24 &
13329 ],shape(hex_interactiontwinslip))
13331 if (len_trim(structure) /= 3) &
13332 call io_error(137,ext_msg=
'lattice_interaction_TwinBySlip: '//trim(structure))
13334 select case(structure)
13336 interactiontypes = fcc_interactiontwinslip
13340 interactiontypes = bcc_interactiontwinslip
13344 interactiontypes = hex_interactiontwinslip
13348 call io_error(137,ext_msg=
'lattice_interaction_TwinBySlip: '//trim(structure))
13351 interactionmatrix =
buildinteraction(ntwin,nslip,ntwinmax,nslipmax,interactionvalues,interactiontypes)
13362 integer,
dimension(:),
intent(in) :: nslip
13363 character(len=*),
intent(in) :: structure
13364 real(
preal),
intent(in) :: covera
13365 real(
preal),
dimension(3,3,sum(Nslip)) :: schmidmatrix
13367 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
13368 real(
preal),
dimension(:,:),
allocatable :: slipsystems
13369 integer,
dimension(:),
allocatable :: nslipmax
13372 if (len_trim(structure) /= 3) &
13373 call io_error(137,ext_msg=
'lattice_SchmidMatrix_slip: '//trim(structure))
13375 select case(structure)
13389 call io_error(137,ext_msg=
'lattice_SchmidMatrix_slip: '//trim(structure))
13392 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
13393 call io_error(145,ext_msg=
'Nslip '//trim(structure))
13394 if (any(nslip < 0)) &
13395 call io_error(144,ext_msg=
'Nslip '//trim(structure))
13399 do i = 1, sum(nslip)
13400 schmidmatrix(1:3,1:3,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
13402 call io_error(0,i,ext_msg =
'dilatational Schmid matrix for slip')
13414 integer,
dimension(:),
intent(in) :: ntwin
13415 character(len=*),
intent(in) :: structure
13416 real(
preal),
intent(in) :: covera
13417 real(
preal),
dimension(3,3,sum(Ntwin)) :: schmidmatrix
13419 real(
preal),
dimension(3,3,sum(Ntwin)) :: coordinatesystem
13420 real(
preal),
dimension(:,:),
allocatable :: twinsystems
13421 integer,
dimension(:),
allocatable :: ntwinmax
13424 if (len_trim(structure) /= 3) &
13425 call io_error(137,ext_msg=
'lattice_SchmidMatrix_twin: '//trim(structure))
13427 select case(structure)
13438 call io_error(137,ext_msg=
'lattice_SchmidMatrix_twin: '//trim(structure))
13441 if (any(ntwinmax(1:
size(ntwin)) - ntwin < 0)) &
13442 call io_error(145,ext_msg=
'Ntwin '//trim(structure))
13443 if (any(ntwin < 0)) &
13444 call io_error(144,ext_msg=
'Ntwin '//trim(structure))
13448 do i = 1, sum(ntwin)
13449 schmidmatrix(1:3,1:3,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
13451 call io_error(0,i,ext_msg =
'dilatational Schmid matrix for twin')
13463 integer,
dimension(:),
intent(in) :: ntrans
13464 character(len=*),
intent(in) :: structure_target
13465 real(
preal),
intent(in) :: covera
13466 real(
preal),
dimension(3,3,sum(Ntrans)) :: schmidmatrix
13468 real(
preal),
dimension(3,3,sum(Ntrans)) :: devnull
13469 real(
preal) :: a_bcc, a_fcc
13471 if (len_trim(structure_target) /= 3) &
13472 call io_error(137,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
13473 if (structure_target(1:3) /=
'bcc' .and. structure_target(1:3) /=
'hex') &
13474 call io_error(137,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
13476 if (structure_target(1:3) ==
'hex' .and. (covera < 1.0_preal .or. covera > 2.0_preal)) &
13477 call io_error(131,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
13479 if (structure_target(1:3) ==
'bcc' .and. (a_bcc <= 0.0_preal .or. a_fcc <= 0.0_preal)) &
13480 call io_error(134,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
13493 integer,
dimension(:),
intent(in) :: ncleavage
13494 character(len=*),
intent(in) :: structure
13495 real(
preal),
intent(in) :: covera
13496 real(
preal),
dimension(3,3,3,sum(Ncleavage)) :: schmidmatrix
13498 real(
preal),
dimension(3,3,sum(Ncleavage)) :: coordinatesystem
13499 real(
preal),
dimension(:,:),
allocatable :: cleavagesystems
13500 integer,
dimension(:),
allocatable :: ncleavagemax
13503 if (len_trim(structure) /= 3) &
13504 call io_error(137,ext_msg=
'lattice_SchmidMatrix_cleavage: '//trim(structure))
13506 select case(structure)
13517 call io_error(137,ext_msg=
'lattice_SchmidMatrix_cleavage: '//trim(structure))
13520 if (any(ncleavagemax(1:
size(ncleavage)) - ncleavage < 0)) &
13521 call io_error(145,ext_msg=
'Ncleavage '//trim(structure))
13522 if (any(ncleavage < 0)) &
13523 call io_error(144,ext_msg=
'Ncleavage '//trim(structure))
13527 do i = 1, sum(ncleavage)
13528 schmidmatrix(1:3,1:3,1,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
13529 schmidmatrix(1:3,1:3,2,i) =
math_outer(coordinatesystem(1:3,3,i),coordinatesystem(1:3,2,i))
13530 schmidmatrix(1:3,1:3,3,i) =
math_outer(coordinatesystem(1:3,2,i),coordinatesystem(1:3,2,i))
13541 integer,
dimension(:),
intent(in) :: nslip
13542 character(len=*),
intent(in) :: structure
13543 real(
preal),
intent(in) :: covera
13544 real(
preal),
dimension(3,sum(Nslip)) :: d
13546 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
13549 d = coordinatesystem(1:3,1,1:sum(nslip))
13559 integer,
dimension(:),
intent(in) :: nslip
13560 character(len=*),
intent(in) :: structure
13561 real(
preal),
intent(in) :: covera
13562 real(
preal),
dimension(3,sum(Nslip)) :: n
13564 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
13567 n = coordinatesystem(1:3,2,1:sum(nslip))
13577 integer,
dimension(:),
intent(in) :: nslip
13578 character(len=*),
intent(in) :: structure
13579 real(
preal),
intent(in) :: covera
13580 real(
preal),
dimension(3,sum(Nslip)) :: t
13582 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
13585 t = coordinatesystem(1:3,3,1:sum(nslip))
13596 integer,
dimension(:),
intent(in) :: nslip
13597 character(len=*),
intent(in) :: structure
13599 character(len=:),
dimension(:),
allocatable :: labels
13601 real(
preal),
dimension(:,:),
allocatable :: slipsystems
13602 integer,
dimension(:),
allocatable :: nslipmax
13604 if (len_trim(structure) /= 3) &
13605 call io_error(137,ext_msg=
'lattice_labels_slip: '//trim(structure))
13607 select case(structure)
13621 call io_error(137,ext_msg=
'lattice_labels_slip: '//trim(structure))
13624 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
13625 call io_error(145,ext_msg=
'Nslip '//trim(structure))
13626 if (any(nslip < 0)) &
13627 call io_error(144,ext_msg=
'Nslip '//trim(structure))
13629 labels =
getlabels(nslip,nslipmax,slipsystems)
13639 real(
preal),
dimension(3,3) :: t_sym
13641 real(
preal),
dimension(3,3),
intent(in) :: t
13642 character(len=*),
intent(in) :: structure
13648 if (len_trim(structure) /= 3) &
13649 call io_error(137,ext_msg=
'lattice_applyLatticeSymmetry33: '//trim(structure))
13651 select case(structure)
13652 case(
'iso',
'fcc',
'bcc')
13654 t_sym(k,k) = t(1,1)
13657 t_sym(1,1) = t(1,1)
13658 t_sym(2,2) = t(1,1)
13659 t_sym(3,3) = t(3,3)
13661 t_sym(1,1) = t(1,1)
13662 t_sym(2,2) = t(2,2)
13663 t_sym(3,3) = t(3,3)
13665 call io_error(137,ext_msg=
'lattice_applyLatticeSymmetry33: '//trim(structure))
13677 real(
preal),
dimension(6,6) :: c66_sym
13679 real(
preal),
dimension(6,6),
intent(in) :: c66
13680 character(len=*),
intent(in) :: structure
13684 c66_sym = 0.0_preal
13686 if (len_trim(structure) /= 3) &
13687 call io_error(137,ext_msg=
'applyLatticeSymmetryC66: '//trim(structure))
13689 select case(structure)
13693 c66_sym(k,j) = c66(1,2)
13695 c66_sym(k,k) = c66(1,1)
13696 c66_sym(k+3,k+3) = 0.5_preal*(c66(1,1)-c66(1,2))
13701 c66_sym(k,j) = c66(1,2)
13703 c66_sym(k,k) = c66(1,1)
13704 c66_sym(k+3,k+3) = c66(4,4)
13707 c66_sym(1,1) = c66(1,1)
13708 c66_sym(2,2) = c66(1,1)
13709 c66_sym(3,3) = c66(3,3)
13710 c66_sym(1,2) = c66(1,2)
13711 c66_sym(2,1) = c66(1,2)
13712 c66_sym(1,3) = c66(1,3)
13713 c66_sym(3,1) = c66(1,3)
13714 c66_sym(2,3) = c66(1,3)
13715 c66_sym(3,2) = c66(1,3)
13716 c66_sym(4,4) = c66(4,4)
13717 c66_sym(5,5) = c66(4,4)
13718 c66_sym(6,6) = 0.5_preal*(c66(1,1)-c66(1,2))
13720 c66_sym(1,1) = c66(1,1)
13721 c66_sym(2,2) = c66(2,2)
13722 c66_sym(3,3) = c66(3,3)
13723 c66_sym(1,2) = c66(1,2)
13724 c66_sym(2,1) = c66(1,2)
13725 c66_sym(1,3) = c66(1,3)
13726 c66_sym(3,1) = c66(1,3)
13727 c66_sym(2,3) = c66(2,3)
13728 c66_sym(3,2) = c66(2,3)
13729 c66_sym(4,4) = c66(4,4)
13730 c66_sym(5,5) = c66(5,5)
13731 c66_sym(6,6) = c66(6,6)
13733 c66_sym(1,1) = c66(1,1)
13734 c66_sym(2,2) = c66(1,1)
13735 c66_sym(3,3) = c66(3,3)
13736 c66_sym(1,2) = c66(1,2)
13737 c66_sym(2,1) = c66(1,2)
13738 c66_sym(1,3) = c66(1,3)
13739 c66_sym(3,1) = c66(1,3)
13740 c66_sym(2,3) = c66(1,3)
13741 c66_sym(3,2) = c66(1,3)
13742 c66_sym(4,4) = c66(4,4)
13743 c66_sym(5,5) = c66(4,4)
13744 c66_sym(6,6) = c66(6,6)
13746 call io_error(137,ext_msg=
'applyLatticeSymmetryC66: '//trim(structure))
13758 integer,
dimension(:),
intent(in) :: ntwin
13759 character(len=*),
intent(in) :: structure
13761 character(len=:),
dimension(:),
allocatable :: labels
13763 real(
preal),
dimension(:,:),
allocatable :: twinsystems
13764 integer,
dimension(:),
allocatable :: ntwinmax
13766 if (len_trim(structure) /= 3) &
13767 call io_error(137,ext_msg=
'lattice_labels_twin: '//trim(structure))
13769 select case(structure)
13780 call io_error(137,ext_msg=
'lattice_labels_twin: '//trim(structure))
13783 if (any(ntwinmax(1:
size(ntwin)) - ntwin < 0)) &
13784 call io_error(145,ext_msg=
'Ntwin '//trim(structure))
13785 if (any(ntwin < 0)) &
13786 call io_error(144,ext_msg=
'Ntwin '//trim(structure))
13788 labels =
getlabels(ntwin,ntwinmax,twinsystems)
13799 integer,
dimension(:),
intent(in) :: nslip
13800 character(len=*),
intent(in) :: structure
13801 real(
preal),
intent(in) :: covera
13802 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: projection
13804 real(
preal),
dimension(3,sum(Nslip)) :: n, t
13810 do i=1, sum(nslip);
do j=1, sum(nslip)
13811 projection(i,j) = abs(
math_inner(n(:,i),t(:,j)))
13823 integer,
dimension(:),
intent(in) :: nslip
13824 character(len=*),
intent(in) :: structure
13825 real(
preal),
intent(in) :: covera
13826 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: projection
13828 real(
preal),
dimension(3,sum(Nslip)) :: n, d
13834 do i=1, sum(nslip);
do j=1, sum(nslip)
13835 projection(i,j) = abs(
math_inner(n(:,i),d(:,j)))
13847 integer,
dimension(:),
intent(in) :: nslip
13848 character(len=*),
intent(in) :: structure
13849 real(
preal),
intent(in) :: covera
13850 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
13852 real(
preal),
dimension(:,:),
allocatable :: slipsystems
13853 integer,
dimension(:),
allocatable :: nslipmax
13855 if (len_trim(structure) /= 3) &
13856 call io_error(137,ext_msg=
'coordinateSystem_slip: '//trim(structure))
13858 select case(structure)
13872 call io_error(137,ext_msg=
'coordinateSystem_slip: '//trim(structure))
13875 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
13876 call io_error(145,ext_msg=
'Nslip '//trim(structure))
13877 if (any(nslip < 0)) &
13878 call io_error(144,ext_msg=
'Nslip '//trim(structure))
13888 function buildinteraction(reacting_used,acting_used,reacting_max,acting_max,values,matrix)
13890 integer,
dimension(:),
intent(in) :: &
13891 reacting_used, & !< # of reacting systems per family as specified in material.config
13892 acting_used, & !< # of acting systems per family as specified in material.config
13893 reacting_max, & !< max # of reacting systems per family for given lattice
13895 real(
preal),
dimension(:),
intent(in) :: values
13896 integer,
dimension(:,:),
intent(in) :: matrix
13900 acting_family_index, acting_family, acting_system, &
13901 reacting_family_index, reacting_family, reacting_system, &
13904 do acting_family = 1,
size(acting_used,1)
13905 acting_family_index = sum(acting_used(1:acting_family-1))
13906 do acting_system = 1,acting_used(acting_family)
13908 do reacting_family = 1,
size(reacting_used,1)
13909 reacting_family_index = sum(reacting_used(1:reacting_family-1))
13910 do reacting_system = 1,reacting_used(reacting_family)
13912 i = sum( acting_max(1: acting_family-1)) + acting_system
13913 j = sum(reacting_max(1:reacting_family-1)) + reacting_system
13915 k = acting_family_index + acting_system
13916 l = reacting_family_index + reacting_system
13918 if (matrix(i,j) >
size(values))
call io_error(138,ext_msg=
'buildInteraction')
13934 integer,
dimension(:),
intent(in) :: &
13935 active, & !< # of active systems per family
13937 real(
preal),
dimension(:,:),
intent(in) :: &
13939 character(len=*),
intent(in) :: &
13941 real(
preal),
intent(in) :: &
13943 real(
preal),
dimension(3,3,sum(active)) :: &
13946 real(
preal),
dimension(3) :: &
13949 a, & !< index of active system
13950 p, & !< index in potential system matrix
13951 f, & !< index of my family
13954 if (len_trim(structure) /= 3) &
13955 call io_error(137,ext_msg=
'buildCoordinateSystem: '//trim(structure))
13956 if (trim(structure) ==
'bct' .and. covera > 2.0_preal) &
13957 call io_error(131,ext_msg=
'buildCoordinateSystem:'//trim(structure))
13958 if (trim(structure) ==
'hex' .and. (covera < 1.0_preal .or. covera > 2.0_preal)) &
13959 call io_error(131,ext_msg=
'buildCoordinateSystem:'//trim(structure))
13962 activefamilies:
do f = 1,
size(active,1)
13963 activesystems:
do s = 1,active(f)
13965 p = sum(potential(1:f-1))+s
13967 select case(trim(structure))
13969 case (
'fcc',
'bcc',
'iso',
'ort',
'bct')
13970 direction = system(1:3,p)
13971 normal = system(4:6,p)
13974 direction = [ system(1,p)*1.5_preal, &
13975 (system(1,p)+2.0_preal*system(2,p))*sqrt(0.75_preal), &
13976 system(4,p)*covera ]
13977 normal = [ system(5,p), &
13978 (system(5,p)+2.0_preal*system(6,p))/sqrt(3.0_preal), &
13979 system(8,p)/covera ]
13982 call io_error(137,ext_msg=
'buildCoordinateSystem: '//trim(structure))
13989 normal /norm2(normal))
13991 enddo activesystems
13992 enddo activefamilies
14005 integer,
dimension(:),
intent(in) :: &
14007 real(pReal),
dimension(3,3,sum(Ntrans)),
intent(out) :: &
14008 Q, & !< Total rotation: Q = R*B
14010 real(pReal),
intent(in) :: &
14011 cOverA, & !< c/a for target hex structure
14012 a_bcc, & !< lattice parameter a for target bcc structure
14016 R, & !< Pitsch rotation
14018 real(pReal),
dimension(3,3) :: &
14019 U, & !< Bain deformation
14021 real(pReal),
dimension(3) :: &
14025 real(pReal),
dimension(3+3,FCC_NTRANS),
parameter :: &
14026 FCCTOHEX_SYSTEMTRANS = reshape(real( [&
14027 -2, 1, 1, 1, 1, 1, &
14028 1,-2, 1, 1, 1, 1, &
14029 1, 1,-2, 1, 1, 1, &
14030 2,-1, 1, -1,-1, 1, &
14031 -1, 2, 1, -1,-1, 1, &
14032 -1,-1,-2, -1,-1, 1, &
14033 -2,-1,-1, 1,-1,-1, &
14034 1, 2,-1, 1,-1,-1, &
14035 1,-1, 2, 1,-1,-1, &
14036 2, 1,-1, -1, 1,-1, &
14037 -1,-2,-1, -1, 1,-1, &
14038 -1, 1, 2, -1, 1,-1 &
14039 ],preal),shape(fcctohex_systemtrans))
14040 real(pReal),
dimension(4,fcc_Ntrans),
parameter :: &
14041 FCCTOBCC_SYSTEMTRANS = reshape([&
14042 0.0, 1.0, 0.0, 10.26, &
14043 0.0,-1.0, 0.0, 10.26, &
14044 0.0, 0.0, 1.0, 10.26, &
14045 0.0, 0.0,-1.0, 10.26, &
14046 1.0, 0.0, 0.0, 10.26, &
14047 -1.0, 0.0, 0.0, 10.26, &
14048 0.0, 0.0, 1.0, 10.26, &
14049 0.0, 0.0,-1.0, 10.26, &
14050 1.0, 0.0, 0.0, 10.26, &
14051 -1.0, 0.0, 0.0, 10.26, &
14052 0.0, 1.0, 0.0, 10.26, &
14053 0.0,-1.0, 0.0, 10.26 &
14054 ],shape(fcctobcc_systemtrans))
14056 integer,
dimension(9,fcc_Ntrans),
parameter :: &
14057 FCCTOBCC_BAINVARIANT = reshape( [&
14058 1, 0, 0, 0, 1, 0, 0, 0, 1, &
14059 1, 0, 0, 0, 1, 0, 0, 0, 1, &
14060 1, 0, 0, 0, 1, 0, 0, 0, 1, &
14061 1, 0, 0, 0, 1, 0, 0, 0, 1, &
14062 0, 1, 0, 1, 0, 0, 0, 0, 1, &
14063 0, 1, 0, 1, 0, 0, 0, 0, 1, &
14064 0, 1, 0, 1, 0, 0, 0, 0, 1, &
14065 0, 1, 0, 1, 0, 0, 0, 0, 1, &
14066 0, 0, 1, 1, 0, 0, 0, 1, 0, &
14067 0, 0, 1, 1, 0, 0, 0, 1, 0, &
14068 0, 0, 1, 1, 0, 0, 0, 1, 0, &
14069 0, 0, 1, 1, 0, 0, 0, 1, 0 &
14070 ],shape(fcctobcc_bainvariant))
14072 real(pReal),
dimension(4,fcc_Ntrans),
parameter :: &
14073 FCCTOBCC_BAINROT = reshape([&
14074 1.0, 0.0, 0.0, 45.0, &
14075 1.0, 0.0, 0.0, 45.0, &
14076 1.0, 0.0, 0.0, 45.0, &
14077 1.0, 0.0, 0.0, 45.0, &
14078 0.0, 1.0, 0.0, 45.0, &
14079 0.0, 1.0, 0.0, 45.0, &
14080 0.0, 1.0, 0.0, 45.0, &
14081 0.0, 1.0, 0.0, 45.0, &
14082 0.0, 0.0, 1.0, 45.0, &
14083 0.0, 0.0, 1.0, 45.0, &
14084 0.0, 0.0, 1.0, 45.0, &
14085 0.0, 0.0, 1.0, 45.0 &
14086 ],shape(fcctobcc_bainrot))
14088 if (a_bcc > 0.0_preal .and. a_fcc > 0.0_preal .and.
deq0(covera))
then
14089 do i = 1,sum(ntrans)
14090 call r%fromAxisAngle(fcctobcc_systemtrans(:,i),degrees=.true.,p=1)
14091 call b%fromAxisAngle(fcctobcc_bainrot(:,i), degrees=.true.,p=1)
14092 x = real(fcctobcc_bainvariant(1:3,i),preal)
14093 y = real(fcctobcc_bainvariant(4:6,i),preal)
14094 z = real(fcctobcc_bainvariant(7:9,i),preal)
14097 + (a_bcc/a_fcc)*
math_outer(y,y) * sqrt(2.0_preal) &
14098 + (a_bcc/a_fcc)*
math_outer(z,z) * sqrt(2.0_preal)
14099 q(1:3,1:3,i) = matmul(r%asMatrix(),b%asMatrix())
14100 s(1:3,1:3,i) = matmul(r%asMatrix(),u) -
math_i3
14102 elseif (covera > 0.0_preal .and.
deq0(a_bcc))
then
14105 ss(1,3) = sqrt(2.0_preal)/4.0_preal
14106 sd(3,3) = covera/sqrt(8.0_preal/3.0_preal)
14108 do i = 1,sum(ntrans)
14109 x = fcctohex_systemtrans(1:3,i)/norm2(fcctohex_systemtrans(1:3,i))
14110 z = fcctohex_systemtrans(4:6,i)/norm2(fcctohex_systemtrans(4:6,i))
14115 s(1:3,1:3,i) = matmul(q(1:3,1:3,i), matmul(matmul(sd,ss), transpose(q(1:3,1:3,i)))) -
math_i3
14118 call io_error(132,ext_msg=
'buildTransformationSystem')
14127 function getlabels(active,potential,system)
result(labels)
14129 integer,
dimension(:),
intent(in) :: &
14130 active, & !< # of active systems per family
14132 real(
preal),
dimension(:,:),
intent(in) :: &
14135 character(len=:),
dimension(:),
allocatable :: labels
14136 character(len=:),
allocatable :: label
14140 a, & !< index of active system
14141 p, & !< index in potential system matrix
14142 f, & !< index of my family
14145 i = 2*
size(system,1) + (
size(system,1) - 2) + 4
14146 allocate(
character(len=i) :: labels(sum(active)), label)
14149 activefamilies:
do f = 1,
size(active,1)
14150 activesystems:
do s = 1,active(f)
14152 p = sum(potential(1:f-1))+s
14156 direction:
do j = 1,
size(system,1)/2
14157 write(label(i+1:i+2),
'(I2.1)') int(system(j,p))
14158 label(i+3:i+3) =
' '
14165 normal:
do j =
size(system,1)/2+1,
size(system,1)
14166 write(label(i+1:i+2),
'(I2.1)') int(system(j,p))
14167 label(i+3:i+3) =
' '
14174 enddo activesystems
14175 enddo activefamilies
14186 real(
preal),
dimension(6,6),
intent(in) :: c
14187 character(len=*),
intent(in) :: assumption
14189 real(
preal) :: k, mu, nu
14191 real(
preal),
dimension(6,6) :: s
14193 if (
io_lc(assumption) ==
'voigt')
then
14194 k = (c(1,1)+c(2,2)+c(3,3) +2.0_preal*(c(1,2)+c(2,3)+c(1,3))) &
14196 elseif(
io_lc(assumption) ==
'reuss')
then
14200 / (s(1,1)+s(2,2)+s(3,3) +2.0_preal*(s(1,2)+s(2,3)+s(1,3)))
14207 nu = (1.5_preal*k -mu)/(3.0_preal*k+mu)
14218 real(
preal),
dimension(6,6),
intent(in) :: c
14219 character(len=*),
intent(in) :: assumption
14223 real(
preal),
dimension(6,6) :: s
14225 if (
io_lc(assumption) ==
'voigt')
then
14226 mu = (1.0_preal*(c(1,1)+c(2,2)+c(3,3)) -1.0_preal*(c(1,2)+c(2,3)+c(1,3)) +3.0_preal*(c(4,4)+c(5,5)+c(6,6))) &
14228 elseif(
io_lc(assumption) ==
'reuss')
then
14232 / (4.0_preal*(s(1,1)+s(2,2)+s(3,3)) -4.0_preal*(s(1,2)+s(2,3)+s(1,3)) +3.0_preal*(s(4,4)+s(5,5)+s(6,6)))
14246 real(pReal),
dimension(:,:,:),
allocatable :: CoSy
14247 real(pReal),
dimension(:,:),
allocatable :: system
14249 real(pReal),
dimension(6,6) :: C
14250 real(pReal),
dimension(2) :: r
14251 real(pReal) :: lambda
14253 call random_number(r)
14255 system = reshape([1.0_preal+r(1),0.0_preal,0.0_preal, 0.0_preal,1.0_preal+r(2),0.0_preal],[6,1])
14261 call random_number(c)
14262 c(1,1) = c(1,1) + 1.0_preal
14265 call io_error(0,ext_msg=
'equivalent_mu/voigt')
14267 call io_error(0,ext_msg=
'equivalent_mu/reuss')
14270 call io_error(0,ext_msg=
'equivalent_nu/voigt')
14272 call io_error(0,ext_msg=
'equivalent_nu/reuss')
14277 # 27 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
14279 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_thermal_dissipation.f90" 1
14296 integer,
dimension(:),
allocatable :: &
14321 integer :: ninstance,sourceoffset,nipcmyphase,p
14327 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
14331 allocate(
param(ninstance))
14346 prm%kappa =
config%getFloat(
'dissipation_coldworkcoeff')
14362 integer,
intent(in) :: &
14364 real(preal),
intent(in),
dimension(3,3) :: &
14366 real(preal),
intent(in),
dimension(3,3) :: &
14369 real(preal),
intent(out) :: &
14374 tdot = prm%kappa*sum(abs(tstar*lp))
14375 dtdot_dt = 0.0_preal
14381 # 28 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
14383 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_thermal_externalheat.f90" 1
14400 integer,
dimension(:),
allocatable :: &
14429 integer :: ninstance,sourceoffset,nipcmyphase,p
14435 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
14439 allocate(
param(ninstance))
14454 prm%time =
config%getFloats(
'externalheat_time')
14455 prm%nIntervals =
size(prm%time) - 1
14457 prm%heat_rate =
config%getFloats(
'externalheat_rate',requiredsize =
size(prm%time))
14474 integer,
intent(in) :: &
14483 sourcestate(phase)%p(sourceoffset)%dotState(1,of) = 1.0_preal
14493 integer,
intent(in) :: &
14496 real(preal),
intent(out) :: &
14501 sourceoffset, interval
14508 do interval = 1, prm%nIntervals
14509 frac_time = (sourcestate(phase)%p(sourceoffset)%state(1,of) - prm%time(interval)) &
14510 / (prm%time(interval+1) - prm%time(interval))
14511 if ( (frac_time < 0.0_preal .and. interval == 1) &
14512 .or. (frac_time >= 1.0_preal .and. interval == prm%nIntervals) &
14513 .or. (frac_time >= 0.0_preal .and. frac_time < 1.0_preal) ) &
14514 tdot = prm%heat_rate(interval ) * (1.0_preal - frac_time) + &
14515 prm%heat_rate(interval+1) * frac_time
14524 # 29 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
14526 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_damage_isoBrittle.f90" 1
14546 integer,
dimension(:),
allocatable :: &
14552 critstrainenergy, &
14554 character(len=pStringLen),
allocatable,
dimension(:) :: &
14576 integer :: ninstance,sourceoffset,nipcmyphase,p
14577 character(len=pStringLen) :: extmsg =
''
14583 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
14587 allocate(
param(ninstance))
14604 prm%N =
config%getFloat(
'isobrittle_n')
14605 prm%critStrainEnergy =
config%getFloat(
'isobrittle_criticalstrainenergy')
14608 if (prm%N <= 0.0_preal) extmsg = trim(extmsg)//
' isobrittle_n'
14609 if (prm%critStrainEnergy <= 0.0_preal) extmsg = trim(extmsg)//
' isobrittle_criticalstrainenergy'
14613 sourcestate(p)%p(sourceoffset)%atol =
config%getFloat(
'isobrittle_atol',defaultval=1.0e-3_preal)
14614 if(any(
sourcestate(p)%p(sourceoffset)%atol < 0.0_preal)) extmsg = trim(extmsg)//
' isobrittle_atol'
14632 integer,
intent(in) :: &
14633 ipc, & !< component-ID of integration point
14634 ip, & !< integration point
14636 real(preal),
intent(in),
dimension(3,3) :: &
14638 real(preal),
intent(in),
dimension(6,6) :: &
14645 real(preal),
dimension(6) :: &
14650 phase = material_phaseat(ipc,el)
14651 constituent = material_phasememberat(ipc,ip,el)
14654 strain = 0.5_preal*math_sym33to6(matmul(transpose(fe),fe)-math_i3)
14657 strainenergy = 2.0_preal*sum(strain*matmul(c,strain))/prm%critStrainEnergy
14660 if (strainenergy > sourcestate(phase)%p(sourceoffset)%subState0(1,constituent))
then
14661 sourcestate(phase)%p(sourceoffset)%deltaState(1,constituent) = &
14662 strainenergy - sourcestate(phase)%p(sourceoffset)%state(1,constituent)
14664 sourcestate(phase)%p(sourceoffset)%deltaState(1,constituent) = &
14665 sourcestate(phase)%p(sourceoffset)%subState0(1,constituent) - &
14666 sourcestate(phase)%p(sourceoffset)%state(1,constituent)
14678 integer,
intent(in) :: &
14681 real(preal),
intent(in) :: &
14683 real(preal),
intent(out) :: &
14693 localphidot = (1.0_preal - phi)**(prm%n - 1.0_preal) &
14694 - phi*sourcestate(phase)%p(sourceoffset)%state(1,constituent)
14695 dlocalphidot_dphi = - (prm%n - 1.0_preal)* (1.0_preal - phi)**max(0.0_preal,prm%n - 2.0_preal) &
14696 - sourcestate(phase)%p(sourceoffset)%state(1,constituent)
14707 integer,
intent(in) :: phase
14708 character(len=*),
intent(in) :: group
14714 outputsloop:
do o = 1,
size(prm%output)
14715 select case(trim(prm%output(o)))
14716 case (
'isobrittle_drivingforce')
14717 call results_writedataset(group,stt,
'tbd',
'driving force',
'tbd')
14725 # 30 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
14727 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_damage_isoDuctile.f90" 1
14746 integer,
dimension(:),
allocatable :: &
14752 critplasticstrain, &
14754 character(len=pStringLen),
allocatable,
dimension(:) :: &
14776 integer :: ninstance,sourceoffset,nipcmyphase,p
14777 character(len=pStringLen) :: extmsg =
''
14783 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
14787 allocate(
param(ninstance))
14804 prm%N =
config%getFloat(
'isoductile_ratesensitivity')
14805 prm%critPlasticStrain =
config%getFloat(
'isoductile_criticalplasticstrain')
14808 if (prm%N <= 0.0_preal) extmsg = trim(extmsg)//
' isoductile_ratesensitivity'
14809 if (prm%critPlasticStrain <= 0.0_preal) extmsg = trim(extmsg)//
' isoductile_criticalplasticstrain'
14813 sourcestate(p)%p(sourceoffset)%atol =
config%getFloat(
'isoductile_atol',defaultval=1.0e-3_preal)
14814 if(any(
sourcestate(p)%p(sourceoffset)%atol < 0.0_preal)) extmsg = trim(extmsg)//
' isoductile_atol'
14832 integer,
intent(in) :: &
14833 ipc, & !< component-ID of integration point
14834 ip, & !< integration point
14844 phase = material_phaseat(ipc,el)
14845 constituent = material_phasememberat(ipc,ip,el)
14847 homog = material_homogenizationat(el)
14848 damageoffset = damagemapping(homog)%p(ip,el)
14851 sourcestate(phase)%p(sourceoffset)%dotState(1,constituent) = &
14852 sum(plasticstate(phase)%slipRate(:,constituent))/(damage(homog)%p(damageoffset)**prm%N)/prm%critPlasticStrain
14863 integer,
intent(in) :: &
14866 real(preal),
intent(in) :: &
14868 real(preal),
intent(out) :: &
14877 dlocalphidot_dphi = -sourcestate(phase)%p(sourceoffset)%state(1,constituent)
14879 localphidot = 1.0_preal &
14880 + dlocalphidot_dphi*phi
14890 integer,
intent(in) :: phase
14891 character(len=*),
intent(in) :: group
14897 outputsloop:
do o = 1,
size(prm%output)
14898 select case(trim(prm%output(o)))
14899 case (
'isoductile_drivingforce')
14900 call results_writedataset(group,stt,
'tbd',
'driving force',
'tbd')
14908 # 31 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
14910 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_damage_anisoBrittle.f90" 1
14931 integer,
dimension(:),
allocatable :: &
14942 real(
preal),
dimension(:,:,:,:),
allocatable :: &
14946 character(len=pStringLen),
allocatable,
dimension(:) :: &
14968 integer :: ninstance,sourceoffset,nipcmyphase,p
14969 integer,
dimension(:),
allocatable :: n_cl
14970 character(len=pStringLen) :: extmsg =
''
14976 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
14980 allocate(
param(ninstance))
14998 prm%sum_N_cl = sum(abs(n_cl))
15000 prm%n =
config%getFloat(
'anisobrittle_ratesensitivity')
15001 prm%sdot_0 =
config%getFloat(
'anisobrittle_sdot0')
15003 prm%critDisp =
config%getFloats(
'anisobrittle_criticaldisplacement',requiredsize=
size(n_cl))
15004 prm%critLoad =
config%getFloats(
'anisobrittle_criticalload', requiredsize=
size(n_cl))
15007 config%getFloat(
'c/a',defaultval=0.0_preal))
15014 if (prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' anisobrittle_n'
15015 if (prm%sdot_0 <= 0.0_preal) extmsg = trim(extmsg)//
' anisobrittle_sdot0'
15016 if (any(prm%critLoad < 0.0_preal)) extmsg = trim(extmsg)//
' anisobrittle_critLoad'
15017 if (any(prm%critDisp < 0.0_preal)) extmsg = trim(extmsg)//
' anisobrittle_critDisp'
15021 sourcestate(p)%p(sourceoffset)%atol =
config%getFloat(
'anisobrittle_atol',defaultval=1.0e-3_preal)
15022 if(any(
sourcestate(p)%p(sourceoffset)%atol < 0.0_preal)) extmsg = trim(extmsg)//
' anisobrittle_atol'
15040 integer,
intent(in) :: &
15041 ipc, & !< component-ID of integration point
15042 ip, & !< integration point
15044 real(preal),
intent(in),
dimension(3,3) :: &
15055 traction_d, traction_t, traction_n, traction_crit
15057 phase = material_phaseat(ipc,el)
15058 constituent = material_phasememberat(ipc,ip,el)
15060 homog = material_homogenizationat(el)
15061 damageoffset = damagemapping(homog)%p(ip,el)
15064 sourcestate(phase)%p(sourceoffset)%dotState(1,constituent) = 0.0_preal
15065 do i = 1, prm%sum_N_cl
15066 traction_d = math_tensordot(s,prm%cleavage_systems(1:3,1:3,1,i))
15067 traction_t = math_tensordot(s,prm%cleavage_systems(1:3,1:3,2,i))
15068 traction_n = math_tensordot(s,prm%cleavage_systems(1:3,1:3,3,i))
15070 traction_crit = prm%critLoad(i)*damage(homog)%p(damageoffset)**2.0_preal
15072 sourcestate(phase)%p(sourceoffset)%dotState(1,constituent) &
15073 = sourcestate(phase)%p(sourceoffset)%dotState(1,constituent) &
15074 + prm%sdot_0 / prm%critDisp(i) &
15075 * ((max(0.0_preal, abs(traction_d) - traction_crit)/traction_crit)**prm%n + &
15076 (max(0.0_preal, abs(traction_t) - traction_crit)/traction_crit)**prm%n + &
15077 (max(0.0_preal, abs(traction_n) - traction_crit)/traction_crit)**prm%n)
15089 integer,
intent(in) :: &
15092 real(preal),
intent(in) :: &
15094 real(preal),
intent(out) :: &
15103 dlocalphidot_dphi = -sourcestate(phase)%p(sourceoffset)%state(1,constituent)
15105 localphidot = 1.0_preal &
15106 + dlocalphidot_dphi*phi
15116 integer,
intent(in) :: phase
15117 character(len=*),
intent(in) :: group
15123 outputsloop:
do o = 1,
size(prm%output)
15124 select case(trim(prm%output(o)))
15125 case (
'anisobrittle_drivingforce')
15126 call results_writedataset(group,stt,
'tbd',
'driving force',
'tbd')
15134 # 32 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
15136 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/source_damage_anisoDuctile.f90" 1
15156 integer,
dimension(:),
allocatable :: &
15165 character(len=pStringLen),
allocatable,
dimension(:) :: &
15187 integer :: ninstance,sourceoffset,nipcmyphase,p
15188 integer,
dimension(:),
allocatable :: n_sl
15189 character(len=pStringLen) :: extmsg =
''
15195 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
15199 allocate(
param(ninstance))
15217 prm%n =
config%getFloat(
'anisoductile_ratesensitivity')
15218 prm%critPlasticStrain =
config%getFloats(
'anisoductile_criticalplasticstrain',requiredsize=
size(n_sl))
15221 prm%critPlasticStrain =
math_expand(prm%critPlasticStrain,n_sl)
15224 if (prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' anisoductile_ratesensitivity'
15225 if (any(prm%critPlasticStrain < 0.0_preal)) extmsg = trim(extmsg)//
' anisoductile_criticalplasticstrain'
15229 sourcestate(p)%p(sourceoffset)%atol =
config%getFloat(
'anisoductile_atol',defaultval=1.0e-3_preal)
15230 if(any(
sourcestate(p)%p(sourceoffset)%atol < 0.0_preal)) extmsg = trim(extmsg)//
' anisoductile_atol'
15248 integer,
intent(in) :: &
15249 ipc, & !< component-ID of integration point
15250 ip, & !< integration point
15260 phase = material_phaseat(ipc,el)
15261 constituent = material_phasememberat(ipc,ip,el)
15263 homog = material_homogenizationat(el)
15264 damageoffset = damagemapping(homog)%p(ip,el)
15267 sourcestate(phase)%p(sourceoffset)%dotState(1,constituent) &
15268 = sum(plasticstate(phase)%slipRate(:,constituent)/(damage(homog)%p(damageoffset)**prm%n)/prm%critPlasticStrain)
15279 integer,
intent(in) :: &
15282 real(preal),
intent(in) :: &
15284 real(preal),
intent(out) :: &
15293 dlocalphidot_dphi = -sourcestate(phase)%p(sourceoffset)%state(1,constituent)
15295 localphidot = 1.0_preal &
15296 + dlocalphidot_dphi*phi
15306 integer,
intent(in) :: phase
15307 character(len=*),
intent(in) :: group
15313 outputsloop:
do o = 1,
size(prm%output)
15314 select case(trim(prm%output(o)))
15315 case (
'anisoductile_drivingforce')
15316 call results_writedataset(group,stt,
'tbd',
'driving force',
'tbd')
15324 # 33 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
15326 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/kinematics_cleavage_opening.f90" 1
15355 real(
preal),
dimension(:,:,:,:),
allocatable :: &
15374 integer :: ninstance,p
15375 integer,
dimension(:),
allocatable :: n_cl
15376 character(len=pStringLen) :: extmsg =
''
15382 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
15385 allocate(
param(ninstance))
15394 n_cl =
config%getInts(
'ncleavage')
15395 prm%sum_N_cl = sum(abs(n_cl))
15397 prm%n =
config%getFloat(
'anisobrittle_ratesensitivity')
15398 prm%sdot0 =
config%getFloat(
'anisobrittle_sdot0')
15400 prm%critLoad =
config%getFloats(
'anisobrittle_criticalload',requiredsize=
size(n_cl))
15403 config%getFloat(
'c/a',defaultval=0.0_preal))
15409 if (prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' anisobrittle_n'
15410 if (prm%sdot0 <= 0.0_preal) extmsg = trim(extmsg)//
' anisobrittle_sdot0'
15411 if (any(prm%critLoad < 0.0_preal)) extmsg = trim(extmsg)//
' anisobrittle_critLoad'
15428 integer,
intent(in) :: &
15429 ipc, & !< grain number
15430 ip, & !< integration point number
15432 real(preal),
intent(in),
dimension(3,3) :: &
15434 real(preal),
intent(out),
dimension(3,3) :: &
15436 real(preal),
intent(out),
dimension(3,3,3,3) :: &
15440 homog, damageoffset, &
15443 traction_d, traction_t, traction_n, traction_crit, &
15444 udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt
15446 homog = material_homogenizationat(el)
15447 damageoffset = damagemapping(homog)%p(ip,el)
15450 dld_dtstar = 0.0_preal
15452 do i = 1,prm%sum_N_cl
15453 traction_crit = prm%critLoad(i)* damage(homog)%p(damageoffset)**2.0_preal
15455 traction_d = math_tensordot(s,prm%cleavage_systems(1:3,1:3,1,i))
15456 if (abs(traction_d) > traction_crit + tol_math_check)
then
15457 udotd = sign(1.0_preal,traction_d)* prm%sdot0 * ((abs(traction_d) - traction_crit)/traction_crit)**prm%n
15458 ld = ld + udotd*prm%cleavage_systems(1:3,1:3,1,i)
15459 dudotd_dt = sign(1.0_preal,traction_d)*udotd*prm%n / (abs(traction_d) - traction_crit)
15460 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
15461 dld_dtstar(k,l,m,n) = dld_dtstar(k,l,m,n) &
15462 + dudotd_dt*prm%cleavage_systems(k,l,1,i) * prm%cleavage_systems(m,n,1,i)
15465 traction_t = math_tensordot(s,prm%cleavage_systems(1:3,1:3,2,i))
15466 if (abs(traction_t) > traction_crit + tol_math_check)
then
15467 udott = sign(1.0_preal,traction_t)* prm%sdot0 * ((abs(traction_t) - traction_crit)/traction_crit)**prm%n
15468 ld = ld + udott*prm%cleavage_systems(1:3,1:3,2,i)
15469 dudott_dt = sign(1.0_preal,traction_t)*udott*prm%n / (abs(traction_t) - traction_crit)
15470 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
15471 dld_dtstar(k,l,m,n) = dld_dtstar(k,l,m,n) &
15472 + dudott_dt*prm%cleavage_systems(k,l,2,i) * prm%cleavage_systems(m,n,2,i)
15475 traction_n = math_tensordot(s,prm%cleavage_systems(1:3,1:3,3,i))
15476 if (abs(traction_n) > traction_crit + tol_math_check)
then
15477 udotn = sign(1.0_preal,traction_n)* prm%sdot0 * ((abs(traction_n) - traction_crit)/traction_crit)**prm%n
15478 ld = ld + udotn*prm%cleavage_systems(1:3,1:3,3,i)
15479 dudotn_dt = sign(1.0_preal,traction_n)*udotn*prm%n / (abs(traction_n) - traction_crit)
15480 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
15481 dld_dtstar(k,l,m,n) = dld_dtstar(k,l,m,n) &
15482 + dudotn_dt*prm%cleavage_systems(k,l,3,i) * prm%cleavage_systems(m,n,3,i)
15490 # 34 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
15492 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/kinematics_slipplane_opening.f90" 1
15521 real(
preal),
dimension(:,:,:),
allocatable :: &
15542 integer :: ninstance,p,i
15543 character(len=pStringLen) :: extmsg =
''
15544 integer,
dimension(:),
allocatable :: n_sl
15545 real(
preal),
dimension(:,:),
allocatable :: d,n,t
15551 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
15554 allocate(
param(ninstance))
15562 prm%sdot0 =
config%getFloat(
'anisoductile_sdot0')
15563 prm%n =
config%getFloat(
'anisoductile_ratesensitivity')
15564 n_sl =
config%getInts(
'nslip')
15565 prm%sum_N_sl = sum(abs(n_sl))
15568 config%getFloat(
'c/a',defaultval=0.0_preal))
15570 config%getFloat(
'c/a',defaultval=0.0_preal))
15572 config%getFloat(
'c/a',defaultval=0.0_preal))
15573 allocate(prm%P_d(3,3,
size(d,2)),prm%P_t(3,3,
size(t,2)),prm%P_n(3,3,
size(n,2)))
15576 prm%P_d(1:3,1:3,i) =
math_outer(d(1:3,i), n(1:3,i))
15577 prm%P_t(1:3,1:3,i) =
math_outer(t(1:3,i), n(1:3,i))
15578 prm%P_n(1:3,1:3,i) =
math_outer(n(1:3,i), n(1:3,i))
15581 prm%critLoad =
config%getFloats(
'anisoductile_criticalload',requiredsize=
size(n_sl))
15587 if (prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' anisoDuctile_n'
15588 if (prm%sdot0 <= 0.0_preal) extmsg = trim(extmsg)//
' anisoDuctile_sdot0'
15589 if (any(prm%critLoad < 0.0_preal)) extmsg = trim(extmsg)//
' anisoDuctile_critLoad'
15606 integer,
intent(in) :: &
15607 ipc, & !< grain number
15608 ip, & !< integration point number
15610 real(preal),
intent(in),
dimension(3,3) :: &
15612 real(preal),
intent(out),
dimension(3,3) :: &
15614 real(preal),
intent(out),
dimension(3,3,3,3) :: &
15619 homog, damageoffset, &
15622 traction_d, traction_t, traction_n, traction_crit, &
15623 udotd, dudotd_dt, udott, dudott_dt, udotn, dudotn_dt
15625 phase = material_phaseat(ipc,el)
15627 homog = material_homogenizationat(el)
15628 damageoffset = damagemapping(homog)%p(ip,el)
15630 associate(prm =>
param(instance))
15632 dld_dtstar = 0.0_preal
15633 do i = 1, prm%sum_N_sl
15635 traction_d = math_tensordot(s,prm%P_d(1:3,1:3,i))
15636 traction_t = math_tensordot(s,prm%P_t(1:3,1:3,i))
15637 traction_n = math_tensordot(s,prm%P_n(1:3,1:3,i))
15639 traction_crit = prm%critLoad(i)* damage(homog)%p(damageoffset)
15641 udotd = sign(1.0_preal,traction_d)* prm%sdot0* ( abs(traction_d)/traction_crit &
15642 - abs(traction_d)/prm%critLoad(i))**prm%n
15643 udott = sign(1.0_preal,traction_t)* prm%sdot0* ( abs(traction_t)/traction_crit &
15644 - abs(traction_t)/prm%critLoad(i))**prm%n
15645 udotn = prm%sdot0* ( max(0.0_preal,traction_n)/traction_crit &
15646 - max(0.0_preal,traction_n)/prm%critLoad(i))**prm%n
15648 if (dneq0(traction_d))
then
15649 dudotd_dt = udotd*prm%n/traction_d
15651 dudotd_dt = 0.0_preal
15653 if (dneq0(traction_t))
then
15654 dudott_dt = udott*prm%n/traction_t
15656 dudott_dt = 0.0_preal
15658 if (dneq0(traction_n))
then
15659 dudotn_dt = udotn*prm%n/traction_n
15661 dudotn_dt = 0.0_preal
15664 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
15665 dld_dtstar(k,l,m,n) = dld_dtstar(k,l,m,n) &
15666 + dudotd_dt*prm%P_d(k,l,i)*prm%P_d(m,n,i) &
15667 + dudott_dt*prm%P_t(k,l,i)*prm%P_t(m,n,i) &
15668 + dudotn_dt*prm%P_n(k,l,i)*prm%P_n(m,n,i)
15671 + udotd*prm%P_d(1:3,1:3,i) &
15672 + udott*prm%P_t(1:3,1:3,i) &
15673 + udotn*prm%P_n(1:3,1:3,i)
15681 # 35 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
15683 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/kinematics_thermal_expansion.f90" 1
15707 expansion = 0.0_preal
15726 integer :: ninstance,p,i
15727 real(
preal),
dimension(:),
allocatable :: temp
15733 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
15736 allocate(
param(ninstance))
15745 prm%T_ref =
config%getFloat(
'reference_temperature', defaultval=0.0_preal)
15748 temp =
config%getFloats(
'thermal_expansion11')
15749 prm%expansion(1,1,1:
size(temp)) = temp
15750 temp =
config%getFloats(
'thermal_expansion22',defaultval=[(0.0_preal, i=1,
size(temp))],requiredsize=
size(temp))
15751 prm%expansion(2,2,1:
size(temp)) = temp
15752 temp =
config%getFloats(
'thermal_expansion33',defaultval=[(0.0_preal, i=1,
size(temp))],requiredsize=
size(temp))
15753 prm%expansion(3,3,1:
size(temp)) = temp
15754 do i=1,
size(prm%expansion,3)
15769 integer,
intent(in) :: &
15774 real(preal),
dimension(3,3) :: &
15779 (temperature(homog)%p(offset) - prm%T_ref)**1 / 1. * prm%expansion(1:3,1:3,1) + &
15780 (temperature(homog)%p(offset) - prm%T_ref)**2 / 2. * prm%expansion(1:3,1:3,2) + &
15781 (temperature(homog)%p(offset) - prm%T_ref)**3 / 3. * prm%expansion(1:3,1:3,3)
15792 integer,
intent(in) :: &
15793 ipc, & !< grain number
15794 ip, & !< integration point number
15796 real(preal),
intent(out),
dimension(3,3) :: &
15798 real(preal),
intent(out),
dimension(3,3,3,3) :: &
15807 phase = material_phaseat(ipc,el)
15808 homog = material_homogenizationat(el)
15809 t = temperature(homog)%p(thermalmapping(homog)%p(ip,el))
15810 tdot = temperaturerate(homog)%p(thermalmapping(homog)%p(ip,el))
15814 prm%expansion(1:3,1:3,1)*(t - prm%T_ref)**0 &
15815 + prm%expansion(1:3,1:3,2)*(t - prm%T_ref)**1 &
15816 + prm%expansion(1:3,1:3,3)*(t - prm%T_ref)**2 &
15819 + prm%expansion(1:3,1:3,1)*(t - prm%T_ref)**1 / 1. &
15820 + prm%expansion(1:3,1:3,2)*(t - prm%T_ref)**2 / 2. &
15821 + prm%expansion(1:3,1:3,3)*(t - prm%T_ref)**3 / 3. &
15824 dli_dtstar = 0.0_preal
15829 # 36 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
15831 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive.f90" 1
15863 integer,
public,
protected :: &
15869 module subroutine plastic_none_init
15870 end subroutine plastic_none_init
15872 module subroutine plastic_isotropic_init
15873 end subroutine plastic_isotropic_init
15875 module subroutine plastic_phenopowerlaw_init
15876 end subroutine plastic_phenopowerlaw_init
15878 module subroutine plastic_kinehardening_init
15879 end subroutine plastic_kinehardening_init
15881 module subroutine plastic_dislotwin_init
15882 end subroutine plastic_dislotwin_init
15884 module subroutine plastic_disloucla_init
15885 end subroutine plastic_disloucla_init
15887 module subroutine plastic_nonlocal_init
15888 end subroutine plastic_nonlocal_init
15891 module subroutine plastic_isotropic_lpanditstangent(lp,dlp_dmp,mp,instance,of)
15892 real(
preal),
dimension(3,3),
intent(out) :: &
15894 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15897 real(
preal),
dimension(3,3),
intent(in) :: &
15899 integer,
intent(in) :: &
15902 end subroutine plastic_isotropic_lpanditstangent
15904 pure module subroutine plastic_phenopowerlaw_lpanditstangent(lp,dlp_dmp,mp,instance,of)
15905 real(
preal),
dimension(3,3),
intent(out) :: &
15907 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15910 real(
preal),
dimension(3,3),
intent(in) :: &
15912 integer,
intent(in) :: &
15915 end subroutine plastic_phenopowerlaw_lpanditstangent
15917 pure module subroutine plastic_kinehardening_lpanditstangent(lp,dlp_dmp,mp,instance,of)
15918 real(
preal),
dimension(3,3),
intent(out) :: &
15920 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15923 real(
preal),
dimension(3,3),
intent(in) :: &
15925 integer,
intent(in) :: &
15928 end subroutine plastic_kinehardening_lpanditstangent
15930 module subroutine plastic_dislotwin_lpanditstangent(lp,dlp_dmp,mp,t,instance,of)
15931 real(
preal),
dimension(3,3),
intent(out) :: &
15933 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15936 real(
preal),
dimension(3,3),
intent(in) :: &
15938 real(
preal),
intent(in) :: &
15940 integer,
intent(in) :: &
15943 end subroutine plastic_dislotwin_lpanditstangent
15945 pure module subroutine plastic_disloucla_lpanditstangent(lp,dlp_dmp,mp,t,instance,of)
15946 real(
preal),
dimension(3,3),
intent(out) :: &
15948 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15951 real(
preal),
dimension(3,3),
intent(in) :: &
15953 real(
preal),
intent(in) :: &
15955 integer,
intent(in) :: &
15958 end subroutine plastic_disloucla_lpanditstangent
15960 module subroutine plastic_nonlocal_lpanditstangent(lp,dlp_dmp, &
15962 real(
preal),
dimension(3,3),
intent(out) :: &
15964 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15967 real(
preal),
dimension(3,3),
intent(in) :: &
15969 real(
preal),
intent(in) :: &
15971 integer,
intent(in) :: &
15974 ip, & !< current integration point
15976 end subroutine plastic_nonlocal_lpanditstangent
15979 module subroutine plastic_isotropic_lianditstangent(li,dli_dmi,mi,instance,of)
15980 real(
preal),
dimension(3,3),
intent(out) :: &
15982 real(
preal),
dimension(3,3,3,3),
intent(out) :: &
15985 real(
preal),
dimension(3,3),
intent(in) :: &
15987 integer,
intent(in) :: &
15990 end subroutine plastic_isotropic_lianditstangent
15993 module subroutine plastic_isotropic_dotstate(mp,instance,of)
15994 real(
preal),
dimension(3,3),
intent(in) :: &
15996 integer,
intent(in) :: &
15999 end subroutine plastic_isotropic_dotstate
16001 module subroutine plastic_phenopowerlaw_dotstate(mp,instance,of)
16002 real(
preal),
dimension(3,3),
intent(in) :: &
16004 integer,
intent(in) :: &
16007 end subroutine plastic_phenopowerlaw_dotstate
16009 module subroutine plastic_kinehardening_dotstate(mp,instance,of)
16010 real(
preal),
dimension(3,3),
intent(in) :: &
16012 integer,
intent(in) :: &
16015 end subroutine plastic_kinehardening_dotstate
16017 module subroutine plastic_dislotwin_dotstate(mp,t,instance,of)
16018 real(
preal),
dimension(3,3),
intent(in) :: &
16020 real(
preal),
intent(in) :: &
16022 integer,
intent(in) :: &
16025 end subroutine plastic_dislotwin_dotstate
16027 module subroutine plastic_disloucla_dotstate(mp,t,instance,of)
16028 real(
preal),
dimension(3,3),
intent(in) :: &
16030 real(
preal),
intent(in) :: &
16032 integer,
intent(in) :: &
16035 end subroutine plastic_disloucla_dotstate
16037 module subroutine plastic_nonlocal_dotstate(mp, f, fp,
temperature,timestep, &
16039 real(
preal),
dimension(3,3),
intent(in) ::&
16041 real(
preal),
dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem),
intent(in) :: &
16042 f, & !< deformation gradient
16044 real(
preal),
intent(in) :: &
16047 integer,
intent(in) :: &
16050 ip, & !< current integration point
16052 end subroutine plastic_nonlocal_dotstate
16055 module subroutine plastic_dislotwin_dependentstate(t,instance,of)
16056 integer,
intent(in) :: &
16059 real(
preal),
intent(in) :: &
16061 end subroutine plastic_dislotwin_dependentstate
16063 module subroutine plastic_disloucla_dependentstate(instance,of)
16064 integer,
intent(in) :: &
16067 end subroutine plastic_disloucla_dependentstate
16069 module subroutine plastic_nonlocal_dependentstate(f, fp, instance, of, ip, el)
16070 real(
preal),
dimension(3,3),
intent(in) :: &
16073 integer,
intent(in) :: &
16078 end subroutine plastic_nonlocal_dependentstate
16081 module subroutine plastic_kinehardening_deltastate(mp,instance,of)
16082 real(
preal),
dimension(3,3),
intent(in) :: &
16084 integer,
intent(in) :: &
16087 end subroutine plastic_kinehardening_deltastate
16089 module subroutine plastic_nonlocal_deltastate(mp,instance,of,ip,el)
16090 real(
preal),
dimension(3,3),
intent(in) :: &
16092 integer,
intent(in) :: &
16097 end subroutine plastic_nonlocal_deltastate
16100 module function plastic_dislotwin_homogenizedc(ipc,ip,el) result(homogenizedc)
16101 real(
preal),
dimension(6,6) :: &
16103 integer,
intent(in) :: &
16104 ipc, & !< component-ID of integration point
16105 ip, & !< integration point
16107 end function plastic_dislotwin_homogenizedc
16109 module subroutine plastic_nonlocal_updatecompatibility(orientation,instance,i,e)
16110 integer,
intent(in) :: &
16114 type(
rotation),
dimension(1,discretization_nIP,discretization_nElem),
intent(in) :: &
16116 end subroutine plastic_nonlocal_updatecompatibility
16119 module subroutine plastic_isotropic_results(instance,group)
16120 integer,
intent(in) :: instance
16121 character(len=*),
intent(in) :: group
16122 end subroutine plastic_isotropic_results
16124 module subroutine plastic_phenopowerlaw_results(instance,group)
16125 integer,
intent(in) :: instance
16126 character(len=*),
intent(in) :: group
16127 end subroutine plastic_phenopowerlaw_results
16129 module subroutine plastic_kinehardening_results(instance,group)
16130 integer,
intent(in) :: instance
16131 character(len=*),
intent(in) :: group
16132 end subroutine plastic_kinehardening_results
16134 module subroutine plastic_dislotwin_results(instance,group)
16135 integer,
intent(in) :: instance
16136 character(len=*),
intent(in) :: group
16137 end subroutine plastic_dislotwin_results
16139 module subroutine plastic_disloucla_results(instance,group)
16140 integer,
intent(in) :: instance
16141 character(len=*),
intent(in) :: group
16142 end subroutine plastic_disloucla_results
16144 module subroutine plastic_nonlocal_results(instance,group)
16145 integer,
intent(in) :: instance
16146 character(len=*),
intent(in) :: group
16147 end subroutine plastic_nonlocal_results
16152 plastic_nonlocal_updatecompatibility, &
16153 constitutive_init, &
16154 constitutive_homogenizedc, &
16155 constitutive_dependentstate, &
16156 constitutive_lpanditstangents, &
16157 constitutive_lianditstangents, &
16158 constitutive_initialfi, &
16159 constitutive_sanditstangents, &
16160 constitutive_collectdotstate, &
16161 constitutive_collectdeltastate, &
16162 constitutive_results
16170 subroutine constitutive_init
16173 ph, & !< counter in phase loop
16185 call plastic_nonlocal_init
16204 write(6,
'(/,a)')
' <<<+- constitutive init -+>>>';
flush(6)
16206 constitutive_source_maxsizedotstate = 0
16218 constitutive_source_maxsizedotstate = max(constitutive_source_maxsizedotstate, &
16221 constitutive_plasticity_maxsizedotstate = maxval(
plasticstate%sizeDotState)
16223 end subroutine constitutive_init
16230 function constitutive_homogenizedc(ipc,ip,el)
16232 real(
preal),
dimension(6,6) :: constitutive_homogenizedc
16233 integer,
intent(in) :: &
16234 ipc, & !< component-ID of integration point
16235 ip, & !< integration point
16240 constitutive_homogenizedc = plastic_dislotwin_homogenizedc(ipc,ip,el)
16241 case default plasticitytype
16243 end select plasticitytype
16245 end function constitutive_homogenizedc
16251 subroutine constitutive_dependentstate(F, Fp, ipc, ip, el)
16253 integer,
intent(in) :: &
16254 ipc, & !< component-ID of integration point
16255 ip, & !< integration point
16257 real(
preal),
intent(in),
dimension(3,3) :: &
16258 f, & !< elastic deformation gradient
16261 ho, & !< homogenization
16262 tme, & !< thermal member position
16272 call plastic_dislotwin_dependentstate(
temperature(ho)%p(tme),instance,of)
16274 call plastic_disloucla_dependentstate(instance,of)
16276 call plastic_nonlocal_dependentstate (f,fp,instance,of,ip,el)
16277 end select plasticitytype
16279 end subroutine constitutive_dependentstate
16287 subroutine constitutive_lpanditstangents(Lp, dLp_dS, dLp_dFi, &
16288 S, Fi, ipc, ip, el)
16289 integer,
intent(in) :: &
16290 ipc, & !< component-ID of integration point
16291 ip, & !< integration point
16293 real(
preal),
intent(in),
dimension(3,3) :: &
16294 s, & !< 2nd Piola-Kirchhoff stress
16296 real(
preal),
intent(out),
dimension(3,3) :: &
16298 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
16301 real(
preal),
dimension(3,3,3,3) :: &
16303 real(
preal),
dimension(3,3) :: &
16306 ho, & !< homogenization
16314 mp = matmul(matmul(transpose(fi),fi),s)
16322 dlp_dmp = 0.0_preal
16325 call plastic_isotropic_lpanditstangent (lp,dlp_dmp,mp,instance,of)
16328 call plastic_phenopowerlaw_lpanditstangent(lp,dlp_dmp,mp,instance,of)
16331 call plastic_kinehardening_lpanditstangent(lp,dlp_dmp,mp,instance,of)
16334 call plastic_nonlocal_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of,ip,el)
16337 call plastic_dislotwin_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of)
16340 call plastic_disloucla_lpanditstangent (lp,dlp_dmp,mp,
temperature(ho)%p(tme),instance,of)
16342 end select plasticitytype
16345 dlp_dfi(i,j,1:3,1:3) = matmul(matmul(fi,s),transpose(dlp_dmp(i,j,1:3,1:3))) + &
16346 matmul(matmul(fi,dlp_dmp(i,j,1:3,1:3)),s)
16347 dlp_ds(i,j,1:3,1:3) = matmul(matmul(transpose(fi),fi),dlp_dmp(i,j,1:3,1:3))
16350 end subroutine constitutive_lpanditstangents
16357 subroutine constitutive_lianditstangents(Li, dLi_dS, dLi_dFi, &
16358 S, Fi, ipc, ip, el)
16360 integer,
intent(in) :: &
16361 ipc, & !< component-ID of integration point
16362 ip, & !< integration point
16364 real(
preal),
intent(in),
dimension(3,3) :: &
16366 real(
preal),
intent(in),
dimension(3,3) :: &
16368 real(
preal),
intent(out),
dimension(3,3) :: &
16370 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
16371 dli_ds, & !< derivative of Li with respect to S
16374 real(
preal),
dimension(3,3) :: &
16375 my_li, & !< intermediate velocity gradient
16378 real(
preal),
dimension(3,3,3,3) :: &
16388 dli_dfi = 0.0_preal
16394 call plastic_isotropic_lianditstangent(my_li, my_dli_ds, s ,instance,of)
16395 case default plasticitytype
16397 my_dli_ds = 0.0_preal
16398 end select plasticitytype
16401 dli_ds = dli_ds + my_dli_ds
16411 case default kinematicstype
16413 my_dli_ds = 0.0_preal
16414 end select kinematicstype
16416 dli_ds = dli_ds + my_dli_ds
16417 enddo kinematicsloop
16421 li = matmul(matmul(fi,li),fiinv)*detfi
16422 temp_33 = matmul(fiinv,li)
16424 do i = 1,3;
do j = 1,3
16425 dli_ds(1:3,1:3,i,j) = matmul(matmul(fi,dli_ds(1:3,1:3,i,j)),fiinv)*detfi
16426 dli_dfi(1:3,1:3,i,j) = dli_dfi(1:3,1:3,i,j) + li*fiinv(j,i)
16427 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)
16430 end subroutine constitutive_lianditstangents
16436 pure function constitutive_initialfi(ipc, ip, el)
16438 integer,
intent(in) :: &
16439 ipc, & !< component-ID of integration point
16440 ip, & !< integration point
16442 real(
preal),
dimension(3,3) :: &
16443 constitutive_initialfi
16450 constitutive_initialfi =
math_i3
16458 constitutive_initialfi = &
16460 end select kinematicstype
16461 enddo kinematicsloop
16463 end function constitutive_initialfi
16471 subroutine constitutive_sanditstangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el)
16473 integer,
intent(in) :: &
16474 ipc, & !< component-ID of integration point
16475 ip, & !< integration point
16477 real(
preal),
intent(in),
dimension(3,3) :: &
16478 fe, & !< elastic deformation gradient
16480 real(
preal),
intent(out),
dimension(3,3) :: &
16482 real(
preal),
intent(out),
dimension(3,3,3,3) :: &
16483 ds_dfe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
16486 call constitutive_hooke_sanditstangents(s, ds_dfe, ds_dfi, fe, fi, ipc, ip, el)
16489 end subroutine constitutive_sanditstangents
16496 subroutine constitutive_hooke_sanditstangents(S, dS_dFe, dS_dFi, &
16497 Fe, Fi, ipc, ip, el)
16499 integer,
intent(in) :: &
16500 ipc, & !< component-ID of integration point
16501 ip, & !< integration point
16503 real(pReal),
intent(in),
dimension(3,3) :: &
16504 Fe, & !< elastic deformation gradient
16506 real(pReal),
intent(out),
dimension(3,3) :: &
16508 real(pReal),
intent(out),
dimension(3,3,3,3) :: &
16509 dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
16511 real(pReal),
dimension(3,3) :: E
16512 real(pReal),
dimension(3,3,3,3) :: C
16514 ho, & !< homogenization
16526 end select degradationtype
16527 enddo degradationloop
16529 e = 0.5_preal*(matmul(transpose(fe),fe)-
math_i3)
16532 do i =1, 3;
do j=1,3
16533 ds_dfe(i,j,1:3,1:3) = matmul(fe,matmul(matmul(fi,c(i,j,1:3,1:3)),transpose(fi)))
16534 ds_dfi(i,j,1:3,1:3) = 2.0_preal*matmul(matmul(e,fi),c(i,j,1:3,1:3))
16537 end subroutine constitutive_hooke_sanditstangents
16543 subroutine constitutive_collectdotstate(S, FArray, Fi, FpArray, subdt, ipc, ip, el)
16545 integer,
intent(in) :: &
16546 ipc, & !< component-ID of integration point
16547 ip, & !< integration point
16549 real(
preal),
intent(in) :: &
16551 real(
preal),
intent(in),
dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
16552 farray, & !< elastic deformation gradient
16554 real(
preal),
intent(in),
dimension(3,3) :: &
16556 real(
preal),
intent(in),
dimension(3,3) :: &
16558 real(
preal),
dimension(3,3) :: &
16561 ho, & !< homogenization
16562 tme, & !< thermal member position
16563 i, & !< counter in source loop
16571 mp = matmul(matmul(transpose(fi),fi),s)
16576 call plastic_isotropic_dotstate (mp,instance,of)
16579 call plastic_phenopowerlaw_dotstate(mp,instance,of)
16582 call plastic_kinehardening_dotstate(mp,instance,of)
16585 call plastic_dislotwin_dotstate (mp,
temperature(ho)%p(tme),instance,of)
16588 call plastic_disloucla_dotstate (mp,
temperature(ho)%p(tme),instance,of)
16591 call plastic_nonlocal_dotstate (mp,farray,fparray,
temperature(ho)%p(tme),subdt, &
16593 end select plasticitytype
16611 end select sourcetype
16615 end subroutine constitutive_collectdotstate
16622 subroutine constitutive_collectdeltastate(S, Fe, Fi, ipc, ip, el)
16624 integer,
intent(in) :: &
16625 ipc, & !< component-ID of integration point
16626 ip, & !< integration point
16628 real(
preal),
intent(in),
dimension(3,3) :: &
16629 s, & !< 2nd Piola Kirchhoff stress
16630 fe, & !< elastic deformation gradient
16632 real(
preal),
dimension(3,3) :: &
16638 mp = matmul(matmul(transpose(fi),fi),s)
16645 call plastic_kinehardening_deltastate(mp,instance,of)
16648 call plastic_nonlocal_deltastate(mp,instance,of,ip,el)
16650 end select plasticitytype
16660 end select sourcetype
16664 end subroutine constitutive_collectdeltastate
16670 subroutine constitutive_results
16673 character(len=pStringLen) :: group
16678 group = trim(group)//
'/plastic'
16704 end subroutine constitutive_results
16707 # 37 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
16709 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_none.f90" 1
16724 module subroutine plastic_none_init
16731 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_none_label//
' init -+>>>';
flush(6)
16733 ninstance = count(phase_plasticity == plasticity_none_id)
16734 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
16735 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
16737 do p = 1,
size(phase_plasticity)
16738 if (phase_plasticity(p) /= plasticity_none_id) cycle
16740 nipcmyphase = count(material_phaseat == p) * discretization_nip
16741 call material_allocateplasticstate(p,nipcmyphase,0,0,0)
16745 end subroutine plastic_none_init
16747 end submodule plastic_none
16748 # 38 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
16750 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_isotropic.f90" 1
16762 type :: tparameters
16764 m, & !< Taylor factor
16765 dot_gamma_0, & !< reference strain rate
16766 n, & !< stress exponent
16769 xi_inf, & !< maximum critical stress
16779 character(len=pStringLen),
allocatable,
dimension(:) :: &
16781 end type tparameters
16783 type :: tisotropicstate
16784 real(preal),
pointer,
dimension(:) :: &
16787 end type tisotropicstate
16791 type(tparameters),
allocatable,
dimension(:) :: param
16792 type(tisotropicstate),
allocatable,
dimension(:) :: &
16802 module subroutine plastic_isotropic_init
16808 sizestate, sizedotstate
16811 character(len=pStringLen) :: &
16814 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_isotropic_label//
' init -+>>>';
flush(6)
16816 write(6,
'(/,a)')
' Maiti and Eisenlohr, Scripta Materialia 145:37–40, 2018'
16817 write(6,
'(a)')
' https://doi.org/10.1016/j.scriptamat.2017.09.047'
16819 ninstance = count(phase_plasticity == plasticity_isotropic_id)
16820 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
16821 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
16823 allocate(param(ninstance))
16824 allocate(state(ninstance))
16825 allocate(dotstate(ninstance))
16827 do p = 1,
size(phase_plasticity)
16828 if (phase_plasticity(p) /= plasticity_isotropic_id) cycle
16829 associate(prm => param(phase_plasticityinstance(p)), &
16830 dot => dotstate(phase_plasticityinstance(p)), &
16831 stt => state(phase_plasticityinstance(p)), &
16832 config => config_phase(p))
16834 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
16841 xi_0 =
config%getFloat(
'tau0')
16842 prm%xi_inf =
config%getFloat(
'tausat')
16843 prm%dot_gamma_0 =
config%getFloat(
'gdot0')
16844 prm%n =
config%getFloat(
'n')
16845 prm%h0 =
config%getFloat(
'h0')
16846 prm%M =
config%getFloat(
'm')
16847 prm%h_ln =
config%getFloat(
'h0_slopelnrate', defaultval=0.0_preal)
16848 prm%c_1 =
config%getFloat(
'tausat_sinhfita',defaultval=0.0_preal)
16849 prm%c_4 =
config%getFloat(
'tausat_sinhfitb',defaultval=0.0_preal)
16850 prm%c_3 =
config%getFloat(
'tausat_sinhfitc',defaultval=0.0_preal)
16851 prm%c_2 =
config%getFloat(
'tausat_sinhfitd',defaultval=0.0_preal)
16852 prm%a =
config%getFloat(
'a')
16854 prm%dilatation =
config%keyExists(
'/dilatation/')
16858 if (xi_0 < 0.0_preal) extmsg = trim(extmsg)//
' xi_0'
16859 if (prm%dot_gamma_0 <= 0.0_preal) extmsg = trim(extmsg)//
' dot_gamma_0'
16860 if (prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' n'
16861 if (prm%a <= 0.0_preal) extmsg = trim(extmsg)//
' a'
16862 if (prm%M <= 0.0_preal) extmsg = trim(extmsg)//
' M'
16866 nipcmyphase = count(material_phaseat == p) * discretization_nip
16867 sizedotstate =
size([
'xi ',
'accumulated_shear'])
16868 sizestate = sizedotstate
16870 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,0)
16874 stt%xi => plasticstate(p)%state (1,:)
16876 dot%xi => plasticstate(p)%dotState(1,:)
16877 plasticstate(p)%atol(1) =
config%getFloat(
'atol_xi',defaultval=1.0_preal)
16878 if (plasticstate(p)%atol(1) < 0.0_preal) extmsg = trim(extmsg)//
' atol_xi'
16880 stt%gamma => plasticstate(p)%state (2,:)
16881 dot%gamma => plasticstate(p)%dotState(2,:)
16882 plasticstate(p)%atol(2) =
config%getFloat(
'atol_gamma',defaultval=1.0e-6_preal)
16883 if (plasticstate(p)%atol(2) < 0.0_preal) extmsg = trim(extmsg)//
' atol_gamma'
16885 plasticstate(p)%slipRate => plasticstate(p)%dotState(2:2,:)
16887 plasticstate(p)%state0 = plasticstate(p)%state
16893 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_isotropic_label//
')')
16897 end subroutine plastic_isotropic_init
16903 module subroutine plastic_isotropic_lpanditstangent(lp,dlp_dmp,mp,instance,of)
16905 real(preal),
dimension(3,3),
intent(out) :: &
16907 real(preal),
dimension(3,3,3,3),
intent(out) :: &
16910 real(preal),
dimension(3,3),
intent(in) :: &
16912 integer,
intent(in) :: &
16916 real(preal),
dimension(3,3) :: &
16919 dot_gamma, & !< strainrate
16920 norm_mp_dev, & !< norm of the deviatoric part of the Mandel stress
16925 associate(prm => param(instance), stt => state(instance))
16927 mp_dev = math_deviatoric33(mp)
16928 squarenorm_mp_dev = math_tensordot(mp_dev,mp_dev)
16929 norm_mp_dev = sqrt(squarenorm_mp_dev)
16931 if (norm_mp_dev > 0.0_preal)
then
16932 dot_gamma = prm%dot_gamma_0 * (sqrt(1.5_preal) * norm_mp_dev/(prm%M*stt%xi(of))) **prm%n
16934 lp = dot_gamma/prm%M * mp_dev/norm_mp_dev
16935 # 194 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_isotropic.f90"
16936 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
16937 dlp_dmp(k,l,m,n) = (prm%n-1.0_preal) * mp_dev(k,l)*mp_dev(m,n) / squarenorm_mp_dev
16938 forall (k=1:3,l=1:3) &
16939 dlp_dmp(k,l,k,l) = dlp_dmp(k,l,k,l) + 1.0_preal
16940 forall (k=1:3,m=1:3) &
16941 dlp_dmp(k,k,m,m) = dlp_dmp(k,k,m,m) - 1.0_preal/3.0_preal
16942 dlp_dmp = dot_gamma / prm%M * dlp_dmp / norm_mp_dev
16945 dlp_dmp = 0.0_preal
16950 end subroutine plastic_isotropic_lpanditstangent
16956 module subroutine plastic_isotropic_lianditstangent(li,dli_dmi,mi,instance,of)
16958 real(preal),
dimension(3,3),
intent(out) :: &
16960 real(preal),
dimension(3,3,3,3),
intent(out) :: &
16963 real(preal),
dimension(3,3),
intent(in) :: &
16965 integer,
intent(in) :: &
16974 associate(prm => param(instance), stt => state(instance))
16976 tr=math_trace33(math_spherical33(mi))
16978 if (prm%dilatation .and. abs(tr) > 0.0_preal)
then
16980 * prm%dot_gamma_0/prm%M * (3.0_preal*prm%M*stt%xi(of))**(-prm%n) &
16981 * tr * abs(tr)**(prm%n-1.0_preal)
16983 # 249 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_isotropic.f90"
16985 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
16986 dli_dmi(k,l,m,n) = prm%n / tr * li(k,l) * math_i3(m,n)
16990 dli_dmi = 0.0_preal
16995 end subroutine plastic_isotropic_lianditstangent
17001 module subroutine plastic_isotropic_dotstate(mp,instance,of)
17003 real(preal),
dimension(3,3),
intent(in) :: &
17005 integer,
intent(in) :: &
17010 dot_gamma, & !< strainrate
17011 xi_inf_star, & !< saturation xi
17014 associate(prm => param(instance), stt => state(instance), dot => dotstate(instance))
17016 if (prm%dilatation)
then
17017 norm_mp = sqrt(math_tensordot(mp,mp))
17019 norm_mp = sqrt(math_tensordot(math_deviatoric33(mp),math_deviatoric33(mp)))
17022 dot_gamma = prm%dot_gamma_0 * (sqrt(1.5_preal) * norm_mp /(prm%M*stt%xi(of))) **prm%n
17024 if (dot_gamma > 1e-12_preal)
then
17025 if (deq0(prm%c_1))
then
17026 xi_inf_star = prm%xi_inf
17028 xi_inf_star = prm%xi_inf &
17029 + asinh( (dot_gamma / prm%c_1)**(1.0_preal / prm%c_2))**(1.0_preal / prm%c_3) &
17030 / prm%c_4 * (dot_gamma / prm%dot_gamma_0)**(1.0_preal / prm%n)
17032 dot%xi(of) = dot_gamma &
17033 * ( prm%h0 + prm%h_ln * log(dot_gamma) ) &
17034 * abs( 1.0_preal - stt%xi(of)/xi_inf_star )**prm%a &
17035 * sign(1.0_preal, 1.0_preal - stt%xi(of)/xi_inf_star)
17037 dot%xi(of) = 0.0_preal
17040 dot%gamma(of) = dot_gamma
17044 end subroutine plastic_isotropic_dotstate
17050 module subroutine plastic_isotropic_results(instance,group)
17052 integer,
intent(in) :: instance
17053 character(len=*),
intent(in) :: group
17057 associate(prm => param(instance), stt => state(instance))
17058 outputsloop:
do o = 1,
size(prm%output)
17059 select case(trim(prm%output(o)))
17060 case (
'flowstress')
17061 call results_writedataset(group,stt%xi,
'xi',
'resistance against plastic flow',
'Pa')
17066 end subroutine plastic_isotropic_results
17069 end submodule plastic_isotropic
17070 # 39 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
17072 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_phenopowerlaw.f90" 1
17081 type :: tparameters
17083 gdot0_slip = 1.0_preal, &
17084 gdot0_twin = 1.0_preal, &
17085 n_slip = 1.0_preal, &
17086 n_twin = 1.0_preal, &
17092 h0_slipslip = 1.0_preal, &
17093 h0_twinslip = 1.0_preal, &
17094 h0_twintwin = 1.0_preal, &
17096 real(preal),
allocatable,
dimension(:) :: &
17097 xi_slip_sat, & !< maximum critical shear stress for slip
17098 h_int, & !< per family hardening activity (optional)
17100 real(preal),
allocatable,
dimension(:,:) :: &
17101 interaction_slipslip, & !< slip resistance from slip activity
17102 interaction_sliptwin, & !< slip resistance from twin activity
17103 interaction_twinslip, & !< twin resistance from slip activity
17104 interaction_twintwin
17105 real(preal),
allocatable,
dimension(:,:,:) :: &
17111 sum_n_sl, & !< total number of active slip system
17114 nonschmidactive = .false.
17115 character(len=pStringLen),
allocatable,
dimension(:) :: &
17117 end type tparameters
17119 type :: tphenopowerlawstate
17120 real(preal),
pointer,
dimension(:,:) :: &
17125 end type tphenopowerlawstate
17129 type(tparameters),
allocatable,
dimension(:) :: param
17130 type(tphenopowerlawstate),
allocatable,
dimension(:) :: &
17141 module subroutine plastic_phenopowerlaw_init
17147 sizestate, sizedotstate, &
17148 startindex, endindex
17149 integer,
dimension(:),
allocatable :: &
17151 real(preal),
dimension(:),
allocatable :: &
17152 xi_slip_0, & !< initial critical shear stress for slip
17153 xi_twin_0, & !< initial critical shear stress for twin
17155 character(len=pStringLen) :: &
17158 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_phenopowerlaw_label//
' init -+>>>';
flush(6)
17160 ninstance = count(phase_plasticity == plasticity_phenopowerlaw_id)
17161 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
17162 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
17164 allocate(param(ninstance))
17165 allocate(state(ninstance))
17166 allocate(dotstate(ninstance))
17168 do p = 1,
size(phase_plasticity)
17169 if (phase_plasticity(p) /= plasticity_phenopowerlaw_id) cycle
17170 associate(prm => param(phase_plasticityinstance(p)), &
17171 dot => dotstate(phase_plasticityinstance(p)), &
17172 stt => state(phase_plasticityinstance(p)), &
17173 config => config_phase(p))
17177 n_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
17178 prm%sum_N_sl = sum(abs(n_sl))
17179 slipactive:
if (prm%sum_N_sl > 0)
then
17180 prm%P_sl = lattice_schmidmatrix_slip(n_sl,
config%getString(
'lattice_structure'),&
17181 config%getFloat(
'c/a',defaultval=0.0_preal))
17183 if(trim(
config%getString(
'lattice_structure')) ==
'bcc')
then
17184 a =
config%getFloats(
'nonschmid_coefficients',defaultval = emptyrealarray)
17185 if(
size(a) > 0) prm%nonSchmidActive = .true.
17186 prm%nonSchmid_pos = lattice_nonschmidmatrix(n_sl,a,+1)
17187 prm%nonSchmid_neg = lattice_nonschmidmatrix(n_sl,a,-1)
17189 prm%nonSchmid_pos = prm%P_sl
17190 prm%nonSchmid_neg = prm%P_sl
17192 prm%interaction_SlipSlip = lattice_interaction_slipbyslip(n_sl, &
17193 config%getFloats(
'interaction_slipslip'), &
17194 config%getString(
'lattice_structure'))
17196 xi_slip_0 =
config%getFloats(
'tau0_slip', requiredsize=
size(n_sl))
17197 prm%xi_slip_sat =
config%getFloats(
'tausat_slip', requiredsize=
size(n_sl))
17198 prm%H_int =
config%getFloats(
'h_int', requiredsize=
size(n_sl), &
17199 defaultval=[(0.0_preal,i=1,
size(n_sl))])
17201 prm%gdot0_slip =
config%getFloat(
'gdot0_slip')
17202 prm%n_slip =
config%getFloat(
'n_slip')
17203 prm%a_slip =
config%getFloat(
'a_slip')
17204 prm%h0_SlipSlip =
config%getFloat(
'h0_slipslip')
17207 xi_slip_0 = math_expand(xi_slip_0, n_sl)
17208 prm%xi_slip_sat = math_expand(prm%xi_slip_sat,n_sl)
17209 prm%H_int = math_expand(prm%H_int, n_sl)
17212 if ( prm%gdot0_slip <= 0.0_preal) extmsg = trim(extmsg)//
' gdot0_slip'
17213 if ( prm%a_slip <= 0.0_preal) extmsg = trim(extmsg)//
' a_slip'
17214 if ( prm%n_slip <= 0.0_preal) extmsg = trim(extmsg)//
' n_slip'
17215 if (any(xi_slip_0 <= 0.0_preal)) extmsg = trim(extmsg)//
' xi_slip_0'
17216 if (any(prm%xi_slip_sat <= 0.0_preal)) extmsg = trim(extmsg)//
' xi_slip_sat'
17219 xi_slip_0 = emptyrealarray
17220 allocate(prm%xi_slip_sat,prm%H_int,source=emptyrealarray)
17221 allocate(prm%interaction_SlipSlip(0,0))
17226 n_tw =
config%getInts(
'ntwin', defaultval=emptyintarray)
17227 prm%sum_N_tw = sum(abs(n_tw))
17228 twinactive:
if (prm%sum_N_tw > 0)
then
17229 prm%P_tw = lattice_schmidmatrix_twin(n_tw,
config%getString(
'lattice_structure'),&
17230 config%getFloat(
'c/a',defaultval=0.0_preal))
17231 prm%interaction_TwinTwin = lattice_interaction_twinbytwin(n_tw,&
17232 config%getFloats(
'interaction_twintwin'), &
17233 config%getString(
'lattice_structure'))
17234 prm%gamma_twin_char = lattice_characteristicshear_twin(n_tw,
config%getString(
'lattice_structure'),&
17237 xi_twin_0 =
config%getFloats(
'tau0_twin',requiredsize=
size(n_tw))
17239 prm%c_1 =
config%getFloat(
'twin_c',defaultval=0.0_preal)
17240 prm%c_2 =
config%getFloat(
'twin_b',defaultval=1.0_preal)
17241 prm%c_3 =
config%getFloat(
'twin_e',defaultval=0.0_preal)
17242 prm%c_4 =
config%getFloat(
'twin_d',defaultval=0.0_preal)
17243 prm%gdot0_twin =
config%getFloat(
'gdot0_twin')
17244 prm%n_twin =
config%getFloat(
'n_twin')
17245 prm%spr =
config%getFloat(
's_pr')
17246 prm%h0_TwinTwin =
config%getFloat(
'h0_twintwin')
17249 xi_twin_0 = math_expand(xi_twin_0,n_tw)
17252 if (prm%gdot0_twin <= 0.0_preal) extmsg = trim(extmsg)//
' gdot0_twin'
17253 if (prm%n_twin <= 0.0_preal) extmsg = trim(extmsg)//
' n_twin'
17256 xi_twin_0 = emptyrealarray
17257 allocate(prm%gamma_twin_char,source=emptyrealarray)
17258 allocate(prm%interaction_TwinTwin(0,0))
17263 slipandtwinactive:
if (prm%sum_N_sl > 0 .and. prm%sum_N_tw > 0)
then
17264 prm%h0_TwinSlip =
config%getFloat(
'h0_twinslip')
17265 prm%interaction_SlipTwin = lattice_interaction_slipbytwin(n_sl,n_tw,&
17266 config%getFloats(
'interaction_sliptwin'), &
17267 config%getString(
'lattice_structure'))
17268 prm%interaction_TwinSlip = lattice_interaction_twinbyslip(n_tw,n_sl,&
17269 config%getFloats(
'interaction_twinslip'), &
17270 config%getString(
'lattice_structure'))
17271 else slipandtwinactive
17272 allocate(prm%interaction_SlipTwin(prm%sum_N_sl,prm%sum_N_tw))
17273 allocate(prm%interaction_TwinSlip(prm%sum_N_tw,prm%sum_N_sl))
17274 prm%h0_TwinSlip = 0.0_preal
17275 endif slipandtwinactive
17279 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
17283 nipcmyphase = count(material_phaseat == p) * discretization_nip
17284 sizedotstate =
size([
'xi_sl ',
'gamma_sl']) * prm%sum_N_sl &
17285 +
size([
'xi_tw ',
'gamma_tw']) * prm%sum_N_tw
17286 sizestate = sizedotstate
17288 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,0)
17293 endindex = prm%sum_N_sl
17294 stt%xi_slip => plasticstate(p)%state (startindex:endindex,:)
17295 stt%xi_slip = spread(xi_slip_0, 2, nipcmyphase)
17296 dot%xi_slip => plasticstate(p)%dotState(startindex:endindex,:)
17297 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_xi',defaultval=1.0_preal)
17298 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_xi'
17300 startindex = endindex + 1
17301 endindex = endindex + prm%sum_N_tw
17302 stt%xi_twin => plasticstate(p)%state (startindex:endindex,:)
17303 stt%xi_twin = spread(xi_twin_0, 2, nipcmyphase)
17304 dot%xi_twin => plasticstate(p)%dotState(startindex:endindex,:)
17305 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_xi',defaultval=1.0_preal)
17306 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_xi'
17308 startindex = endindex + 1
17309 endindex = endindex + prm%sum_N_sl
17310 stt%gamma_slip => plasticstate(p)%state (startindex:endindex,:)
17311 dot%gamma_slip => plasticstate(p)%dotState(startindex:endindex,:)
17312 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_gamma',defaultval=1.0e-6_preal)
17313 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_gamma'
17315 plasticstate(p)%slipRate => plasticstate(p)%dotState(startindex:endindex,:)
17317 startindex = endindex + 1
17318 endindex = endindex + prm%sum_N_tw
17319 stt%gamma_twin => plasticstate(p)%state (startindex:endindex,:)
17320 dot%gamma_twin => plasticstate(p)%dotState(startindex:endindex,:)
17321 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_gamma',defaultval=1.0e-6_preal)
17322 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_gamma'
17324 plasticstate(p)%state0 = plasticstate(p)%state
17330 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_phenopowerlaw_label//
')')
17334 end subroutine plastic_phenopowerlaw_init
17342 pure module subroutine plastic_phenopowerlaw_lpanditstangent(lp,dlp_dmp,mp,instance,of)
17344 real(preal),
dimension(3,3),
intent(out) :: &
17346 real(preal),
dimension(3,3,3,3),
intent(out) :: &
17349 real(preal),
dimension(3,3),
intent(in) :: &
17351 integer,
intent(in) :: &
17357 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17358 gdot_slip_pos,gdot_slip_neg, &
17359 dgdot_dtauslip_pos,dgdot_dtauslip_neg
17360 real(preal),
dimension(param(instance)%sum_N_tw) :: &
17361 gdot_twin,dgdot_dtautwin
17364 dlp_dmp = 0.0_preal
17366 associate(prm => param(instance))
17368 call kinetics_slip(mp,instance,of,gdot_slip_pos,gdot_slip_neg,dgdot_dtauslip_pos,dgdot_dtauslip_neg)
17369 slipsystems:
do i = 1, prm%sum_N_sl
17370 lp = lp + (gdot_slip_pos(i)+gdot_slip_neg(i))*prm%P_sl(1:3,1:3,i)
17371 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
17372 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
17373 + dgdot_dtauslip_pos(i) * prm%P_sl(k,l,i) * prm%nonSchmid_pos(m,n,i) &
17374 + dgdot_dtauslip_neg(i) * prm%P_sl(k,l,i) * prm%nonSchmid_neg(m,n,i)
17377 call kinetics_twin(mp,instance,of,gdot_twin,dgdot_dtautwin)
17378 twinsystems:
do i = 1, prm%sum_N_tw
17379 lp = lp + gdot_twin(i)*prm%P_tw(1:3,1:3,i)
17380 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
17381 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
17382 + dgdot_dtautwin(i)*prm%P_tw(k,l,i)*prm%P_tw(m,n,i)
17387 end subroutine plastic_phenopowerlaw_lpanditstangent
17393 module subroutine plastic_phenopowerlaw_dotstate(mp,instance,of)
17395 real(preal),
dimension(3,3),
intent(in) :: &
17397 integer,
intent(in) :: &
17402 c_slipslip,c_twinslip,c_twintwin, &
17403 xi_slip_sat_offset,&
17405 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17406 left_slipslip,right_slipslip, &
17407 gdot_slip_pos,gdot_slip_neg
17409 associate(prm => param(instance), stt => state(instance), dot => dotstate(instance))
17411 sumgamma = sum(stt%gamma_slip(:,of))
17412 sumf = sum(stt%gamma_twin(:,of)/prm%gamma_twin_char)
17416 c_slipslip = prm%h0_slipslip * (1.0_preal + prm%c_1*sumf** prm%c_2)
17417 c_twinslip = prm%h0_TwinSlip * sumgamma**prm%c_3
17418 c_twintwin = prm%h0_TwinTwin * sumf**prm%c_4
17422 left_slipslip = 1.0_preal + prm%H_int
17423 xi_slip_sat_offset = prm%spr*sqrt(sumf)
17424 right_slipslip = abs(1.0_preal-stt%xi_slip(:,of) / (prm%xi_slip_sat+xi_slip_sat_offset)) **prm%a_slip &
17425 * sign(1.0_preal,1.0_preal-stt%xi_slip(:,of) / (prm%xi_slip_sat+xi_slip_sat_offset))
17429 call kinetics_slip(mp,instance,of,gdot_slip_pos,gdot_slip_neg)
17430 dot%gamma_slip(:,of) = abs(gdot_slip_pos+gdot_slip_neg)
17435 dot%xi_slip(:,of) = c_slipslip * left_slipslip * &
17436 matmul(prm%interaction_SlipSlip,dot%gamma_slip(:,of)*right_slipslip) &
17437 + matmul(prm%interaction_SlipTwin,dot%gamma_twin(:,of))
17439 dot%xi_twin(:,of) = c_twinslip * matmul(prm%interaction_TwinSlip,dot%gamma_slip(:,of)) &
17440 + c_twintwin * matmul(prm%interaction_TwinTwin,dot%gamma_twin(:,of))
17443 end subroutine plastic_phenopowerlaw_dotstate
17449 module subroutine plastic_phenopowerlaw_results(instance,group)
17451 integer,
intent(in) :: instance
17452 character(len=*),
intent(in) :: group
17456 associate(prm => param(instance), stt => state(instance))
17457 outputsloop:
do o = 1,
size(prm%output)
17458 select case(trim(prm%output(o)))
17460 case(
'resistance_slip')
17461 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%xi_slip,
'xi_sl', &
17462 'resistance against plastic slip',
'Pa')
17463 case(
'accumulatedshear_slip')
17464 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma_slip,
'gamma_sl', &
17465 'plastic shear',
'1')
17467 case(
'resistance_twin')
17468 if(prm%sum_N_tw>0)
call results_writedataset(group,stt%xi_twin,
'xi_tw', &
17469 'resistance against twinning',
'Pa')
17470 case(
'accumulatedshear_twin')
17471 if(prm%sum_N_tw>0)
call results_writedataset(group,stt%gamma_twin,
'gamma_tw', &
17472 'twinning shear',
'1')
17478 end subroutine plastic_phenopowerlaw_results
17489 gdot_slip_pos,gdot_slip_neg,dgdot_dtau_slip_pos,dgdot_dtau_slip_neg)
17491 real(preal),
dimension(3,3),
intent(in) :: &
17493 integer,
intent(in) :: &
17497 real(preal),
intent(out),
dimension(param(instance)%sum_N_sl) :: &
17500 real(preal),
intent(out),
optional,
dimension(param(instance)%sum_N_sl) :: &
17501 dgdot_dtau_slip_pos, &
17502 dgdot_dtau_slip_neg
17504 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17509 associate(prm => param(instance), stt => state(instance))
17511 do i = 1, prm%sum_N_sl
17512 tau_slip_pos(i) = math_tensordot(mp,prm%nonSchmid_pos(1:3,1:3,i))
17513 tau_slip_neg(i) = merge(math_tensordot(mp,prm%nonSchmid_neg(1:3,1:3,i)), &
17514 0.0_preal, prm%nonSchmidActive)
17517 where(dneq0(tau_slip_pos))
17518 gdot_slip_pos = prm%gdot0_slip * merge(0.5_preal,1.0_preal, prm%nonSchmidActive) &
17519 * sign(abs(tau_slip_pos/stt%xi_slip(:,of))**prm%n_slip, tau_slip_pos)
17521 gdot_slip_pos = 0.0_preal
17524 where(dneq0(tau_slip_neg))
17525 gdot_slip_neg = prm%gdot0_slip * 0.5_preal &
17526 * sign(abs(tau_slip_neg/stt%xi_slip(:,of))**prm%n_slip, tau_slip_neg)
17528 gdot_slip_neg = 0.0_preal
17531 if (
present(dgdot_dtau_slip_pos))
then
17532 where(dneq0(gdot_slip_pos))
17533 dgdot_dtau_slip_pos = gdot_slip_pos*prm%n_slip/tau_slip_pos
17535 dgdot_dtau_slip_pos = 0.0_preal
17538 if (
present(dgdot_dtau_slip_neg))
then
17539 where(dneq0(gdot_slip_neg))
17540 dgdot_dtau_slip_neg = gdot_slip_neg*prm%n_slip/tau_slip_neg
17542 dgdot_dtau_slip_neg = 0.0_preal
17558 gdot_twin,dgdot_dtau_twin)
17560 real(preal),
dimension(3,3),
intent(in) :: &
17562 integer,
intent(in) :: &
17566 real(preal),
dimension(param(instance)%sum_N_tw),
intent(out) :: &
17568 real(preal),
dimension(param(instance)%sum_N_tw),
intent(out),
optional :: &
17571 real(preal),
dimension(param(instance)%sum_N_tw) :: &
17575 associate(prm => param(instance), stt => state(instance))
17577 do i = 1, prm%sum_N_tw
17578 tau_twin(i) = math_tensordot(mp,prm%P_tw(1:3,1:3,i))
17581 where(tau_twin > 0.0_preal)
17582 gdot_twin = (1.0_preal-sum(stt%gamma_twin(:,of)/prm%gamma_twin_char)) &
17583 * prm%gdot0_twin*(abs(tau_twin)/stt%xi_twin(:,of))**prm%n_twin
17585 gdot_twin = 0.0_preal
17588 if (
present(dgdot_dtau_twin))
then
17589 where(dneq0(gdot_twin))
17590 dgdot_dtau_twin = gdot_twin*prm%n_twin/tau_twin
17592 dgdot_dtau_twin = 0.0_preal
17600 end submodule plastic_phenopowerlaw
17601 # 40 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
17603 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_kinehardening.f90" 1
17613 type :: tparameters
17615 gdot0 = 1.0_preal, &
17617 real(preal),
allocatable,
dimension(:) :: &
17618 theta0, & !< initial hardening rate of forward stress for each slip
17619 theta1, & !< asymptotic hardening rate of forward stress for each slip
17620 theta0_b, & !< initial hardening rate of back stress for each slip
17621 theta1_b, & !< asymptotic hardening rate of back stress for each slip
17624 real(preal),
allocatable,
dimension(:,:) :: &
17625 interaction_slipslip
17626 real(preal),
allocatable,
dimension(:,:,:) :: &
17631 sum_n_sl, & !< total number of active slip system
17634 nonschmidactive = .false.
17635 character(len=pStringLen),
allocatable,
dimension(:) :: &
17637 end type tparameters
17639 type :: tkinehardeningstate
17640 real(preal),
pointer,
dimension(:,:) :: & !< vectors along NipcMyInstance
17641 crss, & !< critical resolved stress
17642 crss_back, & !< critical resolved back stress
17643 sense, & !< sense of acting shear stress (-1 or +1)
17644 chi0, & !< backstress at last switch of stress sense
17645 gamma0, & !< accumulated shear at last switch of stress sense
17647 end type tkinehardeningstate
17651 type(tparameters),
allocatable,
dimension(:) :: param
17652 type(tkinehardeningstate),
allocatable,
dimension(:) :: &
17664 module subroutine plastic_kinehardening_init
17670 sizestate, sizedeltastate, sizedotstate, &
17671 startindex, endindex
17672 integer,
dimension(:),
allocatable :: &
17674 real(preal),
dimension(:),
allocatable :: &
17675 xi_0, & !< initial resistance against plastic flow
17677 character(len=pStringLen) :: &
17680 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_kinehardening_label//
' init -+>>>';
flush(6)
17682 ninstance = count(phase_plasticity == plasticity_kinehardening_id)
17683 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
17684 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
17686 allocate(param(ninstance))
17687 allocate(state(ninstance))
17688 allocate(dotstate(ninstance))
17689 allocate(deltastate(ninstance))
17691 do p = 1,
size(phase_plasticityinstance)
17692 if (phase_plasticity(p) /= plasticity_kinehardening_id) cycle
17693 associate(prm => param(phase_plasticityinstance(p)), &
17694 dot => dotstate(phase_plasticityinstance(p)), &
17695 dlt => deltastate(phase_plasticityinstance(p)), &
17696 stt => state(phase_plasticityinstance(p)),&
17697 config => config_phase(p))
17699 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
17709 n_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
17710 prm%sum_N_sl = sum(abs(n_sl))
17711 slipactive:
if (prm%sum_N_sl > 0)
then
17712 prm%P = lattice_schmidmatrix_slip(n_sl,
config%getString(
'lattice_structure'),&
17713 config%getFloat(
'c/a',defaultval=0.0_preal))
17715 if(trim(
config%getString(
'lattice_structure')) ==
'bcc')
then
17716 a =
config%getFloats(
'nonschmid_coefficients',defaultval = emptyrealarray)
17717 if(
size(a) > 0) prm%nonSchmidActive = .true.
17718 prm%nonSchmid_pos = lattice_nonschmidmatrix(n_sl,a,+1)
17719 prm%nonSchmid_neg = lattice_nonschmidmatrix(n_sl,a,-1)
17721 prm%nonSchmid_pos = prm%P
17722 prm%nonSchmid_neg = prm%P
17724 prm%interaction_SlipSlip = lattice_interaction_slipbyslip(n_sl, &
17725 config%getFloats(
'interaction_slipslip'), &
17726 config%getString(
'lattice_structure'))
17728 xi_0 =
config%getFloats(
'crss0', requiredsize=
size(n_sl))
17729 prm%tau1 =
config%getFloats(
'tau1', requiredsize=
size(n_sl))
17730 prm%tau1_b =
config%getFloats(
'tau1_b', requiredsize=
size(n_sl))
17731 prm%theta0 =
config%getFloats(
'theta0', requiredsize=
size(n_sl))
17732 prm%theta1 =
config%getFloats(
'theta1', requiredsize=
size(n_sl))
17733 prm%theta0_b =
config%getFloats(
'theta0_b', requiredsize=
size(n_sl))
17734 prm%theta1_b =
config%getFloats(
'theta1_b', requiredsize=
size(n_sl))
17736 prm%gdot0 =
config%getFloat(
'gdot0')
17737 prm%n =
config%getFloat(
'n_slip')
17740 xi_0 = math_expand(xi_0, n_sl)
17741 prm%tau1 = math_expand(prm%tau1, n_sl)
17742 prm%tau1_b = math_expand(prm%tau1_b, n_sl)
17743 prm%theta0 = math_expand(prm%theta0, n_sl)
17744 prm%theta1 = math_expand(prm%theta1, n_sl)
17745 prm%theta0_b = math_expand(prm%theta0_b,n_sl)
17746 prm%theta1_b = math_expand(prm%theta1_b,n_sl)
17750 if ( prm%gdot0 <= 0.0_preal) extmsg = trim(extmsg)//
' gdot0'
17751 if ( prm%n <= 0.0_preal) extmsg = trim(extmsg)//
' n_slip'
17752 if (any(xi_0 <= 0.0_preal)) extmsg = trim(extmsg)//
' crss0'
17753 if (any(prm%tau1 <= 0.0_preal)) extmsg = trim(extmsg)//
' tau1'
17754 if (any(prm%tau1_b <= 0.0_preal)) extmsg = trim(extmsg)//
' tau1_b'
17758 xi_0 = emptyrealarray
17759 allocate(prm%tau1,prm%tau1_b,prm%theta0,prm%theta1,prm%theta0_b,prm%theta1_b,source=emptyrealarray)
17760 allocate(prm%interaction_SlipSlip(0,0))
17765 nipcmyphase = count(material_phaseat == p) * discretization_nip
17766 sizedotstate =
size([
'crss ',
'crss_back',
'accshear ']) * prm%sum_N_sl
17767 sizedeltastate =
size([
'sense ',
'chi0 ',
'gamma0' ]) * prm%sum_N_sl
17768 sizestate = sizedotstate + sizedeltastate
17770 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,sizedeltastate)
17775 endindex = prm%sum_N_sl
17776 stt%crss => plasticstate(p)%state (startindex:endindex,:)
17777 stt%crss = spread(xi_0, 2, nipcmyphase)
17778 dot%crss => plasticstate(p)%dotState(startindex:endindex,:)
17779 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_xi',defaultval=1.0_preal)
17780 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_xi'
17782 startindex = endindex + 1
17783 endindex = endindex + prm%sum_N_sl
17784 stt%crss_back => plasticstate(p)%state (startindex:endindex,:)
17785 dot%crss_back => plasticstate(p)%dotState(startindex:endindex,:)
17786 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_xi',defaultval=1.0_preal)
17788 startindex = endindex + 1
17789 endindex = endindex + prm%sum_N_sl
17790 stt%accshear => plasticstate(p)%state (startindex:endindex,:)
17791 dot%accshear => plasticstate(p)%dotState(startindex:endindex,:)
17792 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_gamma',defaultval=1.0e-6_preal)
17793 if(any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_gamma'
17795 plasticstate(p)%slipRate => plasticstate(p)%dotState(startindex:endindex,:)
17797 o = plasticstate(p)%offsetDeltaState
17798 startindex = endindex + 1
17799 endindex = endindex + prm%sum_N_sl
17800 stt%sense => plasticstate(p)%state (startindex :endindex ,:)
17801 dlt%sense => plasticstate(p)%deltaState(startindex-o:endindex-o,:)
17803 startindex = endindex + 1
17804 endindex = endindex + prm%sum_N_sl
17805 stt%chi0 => plasticstate(p)%state (startindex :endindex ,:)
17806 dlt%chi0 => plasticstate(p)%deltaState(startindex-o:endindex-o,:)
17808 startindex = endindex + 1
17809 endindex = endindex + prm%sum_N_sl
17810 stt%gamma0 => plasticstate(p)%state (startindex :endindex ,:)
17811 dlt%gamma0 => plasticstate(p)%deltaState(startindex-o:endindex-o,:)
17813 plasticstate(p)%state0 = plasticstate(p)%state
17819 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_kinehardening_label//
')')
17824 end subroutine plastic_kinehardening_init
17830 pure module subroutine plastic_kinehardening_lpanditstangent(lp,dlp_dmp,mp,instance,of)
17832 real(preal),
dimension(3,3),
intent(out) :: &
17834 real(preal),
dimension(3,3,3,3),
intent(out) :: &
17837 real(preal),
dimension(3,3),
intent(in) :: &
17839 integer,
intent(in) :: &
17845 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17846 gdot_pos,gdot_neg, &
17847 dgdot_dtau_pos,dgdot_dtau_neg
17850 dlp_dmp = 0.0_preal
17852 associate(prm => param(instance))
17854 call kinetics(mp,instance,of,gdot_pos,gdot_neg,dgdot_dtau_pos,dgdot_dtau_neg)
17856 do i = 1, prm%sum_N_sl
17857 lp = lp + (gdot_pos(i)+gdot_neg(i))*prm%P(1:3,1:3,i)
17858 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
17859 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
17860 + dgdot_dtau_pos(i) * prm%P(k,l,i) * prm%nonSchmid_pos(m,n,i) &
17861 + dgdot_dtau_neg(i) * prm%P(k,l,i) * prm%nonSchmid_neg(m,n,i)
17866 end subroutine plastic_kinehardening_lpanditstangent
17872 module subroutine plastic_kinehardening_dotstate(mp,instance,of)
17874 real(preal),
dimension(3,3),
intent(in) :: &
17876 integer,
intent(in) :: &
17882 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17886 associate(prm => param(instance), stt => state(instance), dot => dotstate(instance))
17888 call kinetics(mp,instance,of,gdot_pos,gdot_neg)
17889 dot%accshear(:,of) = abs(gdot_pos+gdot_neg)
17890 sumgamma = sum(stt%accshear(:,of))
17893 dot%crss(:,of) = matmul(prm%interaction_SlipSlip,dot%accshear(:,of)) &
17895 + (prm%theta0 - prm%theta1 + prm%theta0*prm%theta1*sumgamma/prm%tau1) &
17896 * exp(-sumgamma*prm%theta0/prm%tau1) &
17899 dot%crss_back(:,of) = stt%sense(:,of)*dot%accshear(:,of) * &
17901 (prm%theta0_b - prm%theta1_b &
17902 + prm%theta0_b*prm%theta1_b/(prm%tau1_b+stt%chi0(:,of))*(stt%accshear(:,of)-stt%gamma0(:,of))&
17903 ) *exp(-(stt%accshear(:,of)-stt%gamma0(:,of)) *prm%theta0_b/(prm%tau1_b+stt%chi0(:,of))) &
17908 end subroutine plastic_kinehardening_dotstate
17914 module subroutine plastic_kinehardening_deltastate(mp,instance,of)
17916 real(preal),
dimension(3,3),
intent(in) :: &
17918 integer,
intent(in) :: &
17922 real(preal),
dimension(param(instance)%sum_N_sl) :: &
17923 gdot_pos,gdot_neg, &
17926 associate(prm => param(instance), stt => state(instance), dlt => deltastate(instance))
17928 call kinetics(mp,instance,of,gdot_pos,gdot_neg)
17929 sense = merge(state(instance)%sense(:,of), &
17930 sign(1.0_preal,gdot_pos+gdot_neg), &
17931 deq0(gdot_pos+gdot_neg,1e-10_preal))
17933 # 338 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_kinehardening.f90"
17937 where(dneq(sense,stt%sense(:,of),0.1_preal))
17938 dlt%sense (:,of) = sense - stt%sense(:,of)
17939 dlt%chi0 (:,of) = abs(stt%crss_back(:,of)) - stt%chi0(:,of)
17940 dlt%gamma0(:,of) = stt%accshear(:,of) - stt%gamma0(:,of)
17942 dlt%sense (:,of) = 0.0_preal
17943 dlt%chi0 (:,of) = 0.0_preal
17944 dlt%gamma0(:,of) = 0.0_preal
17949 end subroutine plastic_kinehardening_deltastate
17955 module subroutine plastic_kinehardening_results(instance,group)
17957 integer,
intent(in) :: instance
17958 character(len=*),
intent(in) :: group
17962 associate(prm => param(instance), stt => state(instance))
17963 outputsloop:
do o = 1,
size(prm%output)
17964 select case(trim(prm%output(o)))
17966 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%crss,
'xi_sl', &
17967 'resistance against plastic slip',
'Pa')
17969 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%crss_back,
'tau_back', &
17970 'back stress against plastic slip',
'Pa')
17972 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%sense,
'sense_of_shear', &
17975 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%chi0,
'chi0', &
17978 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma0,
'gamma0', &
17980 case (
'accumulatedshear')
17981 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%accshear,
'gamma_sl', &
17982 'plastic shear',
'1')
17987 end subroutine plastic_kinehardening_results
17997 pure subroutine kinetics(Mp,instance,of, &
17998 gdot_pos,gdot_neg,dgdot_dtau_pos,dgdot_dtau_neg)
18000 real(preal),
dimension(3,3),
intent(in) :: &
18002 integer,
intent(in) :: &
18006 real(preal),
intent(out),
dimension(param(instance)%sum_N_sl) :: &
18009 real(preal),
intent(out),
optional,
dimension(param(instance)%sum_N_sl) :: &
18013 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18018 associate(prm => param(instance), stt => state(instance))
18020 do i = 1, prm%sum_N_sl
18021 tau_pos(i) = math_tensordot(mp,prm%nonSchmid_pos(1:3,1:3,i)) - stt%crss_back(i,of)
18022 tau_neg(i) = merge(math_tensordot(mp,prm%nonSchmid_neg(1:3,1:3,i)) - stt%crss_back(i,of), &
18023 0.0_preal, prm%nonSchmidActive)
18026 where(dneq0(tau_pos))
18027 gdot_pos = prm%gdot0 * merge(0.5_preal,1.0_preal, prm%nonSchmidActive) &
18028 * sign(abs(tau_pos/stt%crss(:,of))**prm%n, tau_pos)
18030 gdot_pos = 0.0_preal
18033 where(dneq0(tau_neg))
18034 gdot_neg = prm%gdot0 * 0.5_preal &
18035 * sign(abs(tau_neg/stt%crss(:,of))**prm%n, tau_neg)
18037 gdot_neg = 0.0_preal
18040 if (
present(dgdot_dtau_pos))
then
18041 where(dneq0(gdot_pos))
18042 dgdot_dtau_pos = gdot_pos*prm%n/tau_pos
18044 dgdot_dtau_pos = 0.0_preal
18047 if (
present(dgdot_dtau_neg))
then
18048 where(dneq0(gdot_neg))
18049 dgdot_dtau_neg = gdot_neg*prm%n/tau_neg
18051 dgdot_dtau_neg = 0.0_preal
18058 end submodule plastic_kinehardening
18059 # 41 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
18061 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_dislotwin.f90" 1
18073 real(preal),
parameter :: &
18074 kb = 1.38e-23_preal
18076 type :: tparameters
18082 omega = 1.0_preal, &
18084 p_sb = 1.0_preal, &
18085 q_sb = 1.0_preal, &
18086 cedgedipmindistance = 1.0_preal, &
18087 i_tw = 1.0_preal, &
18088 tau_0 = 1.0_preal, &
18089 l_tw = 1.0_preal, &
18090 l_tr = 1.0_preal, &
18091 xc_twin = 1.0_preal, &
18092 xc_trans = 1.0_preal, &
18093 v_cs = 1.0_preal, &
18094 sbresistance = 1.0_preal, &
18095 sbvelocity = 1.0_preal, &
18096 e_sb = 1.0_preal, &
18097 sfe_0k = 1.0_preal, &
18098 dsfe_dt = 1.0_preal, &
18099 gamma_fcc_hex = 1.0_preal, &
18100 i_tr = 1.0_preal, &
18102 real(preal),
allocatable,
dimension(:) :: &
18103 b_sl, & !< absolute length of burgers vector [m] for each slip system
18104 b_tw, & !< absolute length of burgers vector [m] for each twin system
18105 b_tr, & !< absolute length of burgers vector [m] for each transformation system
18106 delta_f,& !< activation energy for glide [J] for each slip system
18107 v0, & !< dislocation velocity prefactor [m/s] for each slip system
18108 dot_n_0_tw, & !< twin nucleation rate [1/m� s] for each twin system
dot_N_0_tr, & !< trans nucleation rate [1/m³s] for each trans system
t_tw, & !< twin thickness [m] for each twin system
CLambdaSlip, & !< Adj. parameter for distance between 2 forest dislocations for each slip system
t_tr, & !< martensite lamellar thickness [m] for each trans system and instance
p, & !< p-exponent in glide velocity
q, & !< q-exponent in glide velocity
r, & !< r-exponent in twin nucleation rate
s, & !< s-exponent in trans nucleation rate
gamma_char, & !< characteristic shear for twins
B !< drag coefficient
real(pReal), allocatable, dimension(:,:) :: &
h_sl_sl, & !<
h_sl_tw, & !<
h_tw_tw, & !<
h_sl_tr, & !<
h_tr_tr, & !<
n0_sl, & !< slip system normal
forestProjection, &
C66
real(pReal), allocatable, dimension(:,:,:) :: &
P_sl, &
P_tw, &
P_tr, &
C66_tw, &
C66_tr
integer :: &
sum_N_sl, & !< total number of active slip system
sum_N_tw, & !< total number of active twin system
sum_N_tr !< total number of active transformation system
integer, allocatable, dimension(:,:) :: &
fcc_twinNucleationSlipPair ! ToDo: Better name? Is also use for trans
character(len=pStringLen), allocatable, dimension(:) :: &
output
logical :: &
ExtendedDislocations, & !< consider split into partials for climb calculation
fccTwinTransNucleation, & !< twinning and transformation models are for fcc
dipoleFormation !< flag indicating consideration of dipole formation
end type !< container type for internal constitutive parameters
type :: tDislotwinState
real(pReal), dimension(:,:), pointer :: &
rho_mob, &
rho_dip, &
gamma_sl, &
f_tw, &
f_tr
end type tDislotwinState
type :: tDislotwinMicrostructure
real(pReal), dimension(:,:), allocatable :: &
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_tr, & !< mean free path between 2 obstacles seen by a growing martensite
tau_pass, &
tau_hat_tw, &
tau_hat_tr, &
V_tw, & !< volume of a new twin
V_tr, & !< volume of a new martensite disc
tau_r_tw, & !< stress to bring partials close together (twin)
tau_r_tr !< stress to bring partials close together (trans)
end type tDislotwinMicrostructure
!--------------------------------------------------------------------------------------------------
! containers for parameters and state
type(tParameters), allocatable, dimension(:) :: param
type(tDislotwinState), allocatable, dimension(:) :: &
dotState, &
state
type(tDislotwinMicrostructure), allocatable, dimension(:) :: dependentState
contains
!--------------------------------------------------------------------------------------------------
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_init
integer :: &
Ninstance, &
p, i, &
NipcMyPhase, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
N_sl, N_tw, N_tr
real(pReal), allocatable, dimension(:) :: &
rho_mob_0, & !< initial unipolar dislocation density per slip system
rho_dip_0 !< initial dipole dislocation density per slip system
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Ma and Roters, Acta Materialia 52(12):3603–3612, 2004'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2004.04.012'
write(6,'(/,a)') ' Roters et al., Computational Materials Science 39:91–95, 2007'
write(6,'(a)') ' https://doi.org/10.1016/j.commatsci.2006.04.014'
write(6,'(/,a)') ' Wong et al., Acta Materialia 118:140–151, 2016'
write(6,'(a,/)') ' https://doi.org/10.1016/j.actamat.2016.07.032'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOTWIN_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(dotState(Ninstance))
allocate(dependentState(Ninstance))
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_DISLOTWIN_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
dst => dependentState(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)', defaultVal=emptyStringArray)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
prm%nu = lattice_nu(p)
prm%C66 = lattice_C66(1:6,1:6,p)
!--------------------------------------------------------------------------------------------------
! slip related parameters
N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_sl_sl = lattice_interaction_SlipBySlip(N_sl,config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection = lattice_forestProjection_edge(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection = transpose(prm%forestProjection)
prm%n0_sl = lattice_slip_normal(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%fccTwinTransNucleation = merge(.true., .false., lattice_structure(p) == lattice_FCC_ID) &
.and. (N_sl(1) == 12)
if(prm%fccTwinTransNucleation) prm%fcc_twinNucleationSlipPair = lattice_FCC_TWINNUCLEATIONSLIPPAIR
rho_mob_0 = config%getFloats('rhoedge0', requiredSize=size(N_sl))
rho_dip_0 = config%getFloats('rhoedgedip0',requiredSize=size(N_sl))
prm%v0 = config%getFloats('v0', requiredSize=size(N_sl))
prm%b_sl = config%getFloats('slipburgers',requiredSize=size(N_sl))
prm%Delta_F = config%getFloats('qedge', requiredSize=size(N_sl))
prm%CLambdaSlip = config%getFloats('clambdaslip',requiredSize=size(N_sl))
prm%p = config%getFloats('p_slip', requiredSize=size(N_sl))
prm%q = config%getFloats('q_slip', requiredSize=size(N_sl))
prm%B = config%getFloats('b', requiredSize=size(N_sl), &
defaultVal=[(0.0_pReal, i=1,size(N_sl))])
prm%tau_0 = config%getFloat('solidsolutionstrength')
prm%CEdgeDipMinDistance = config%getFloat('cedgedipmindistance')
prm%D0 = config%getFloat('d0')
prm%Qsd = config%getFloat('qsd')
prm%ExtendedDislocations = config%keyExists('/extend_dislocations/')
if (prm%ExtendedDislocations) then
prm%SFE_0K = config%getFloat('sfe_0k')
prm%dSFE_dT = config%getFloat('dsfe_dt')
endif
prm%dipoleformation = .not. config%keyExists('/nodipoleformation/')
! multiplication factor according to crystal structure (nearest neighbors bcc vs fcc/hex)
! details: Argon & Moffat, Acta Metallurgica, Vol. 29, pg 293 to 299, 1981
prm%omega = config%getFloat('omega', defaultVal = 1000.0_pReal) &
* merge(12.0_pReal,8.0_pReal,any(lattice_structure(p) == [lattice_FCC_ID,lattice_HEX_ID]))
! expand: family => system
rho_mob_0 = math_expand(rho_mob_0, N_sl)
rho_dip_0 = math_expand(rho_dip_0, N_sl)
prm%v0 = math_expand(prm%v0, N_sl)
prm%b_sl = math_expand(prm%b_sl, N_sl)
prm%Delta_F = math_expand(prm%Delta_F, N_sl)
prm%CLambdaSlip = math_expand(prm%CLambdaSlip, N_sl)
prm%p = math_expand(prm%p, N_sl)
prm%q = math_expand(prm%q, N_sl)
prm%B = math_expand(prm%B, N_sl)
! sanity checks
if ( prm%D0 <= 0.0_pReal) extmsg = trim(extmsg)//' D0'
if ( prm%Qsd <= 0.0_pReal) extmsg = trim(extmsg)//' Qsd'
if (any(rho_mob_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_mob_0'
if (any(rho_dip_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_dip_0'
if (any(prm%v0 < 0.0_pReal)) extmsg = trim(extmsg)//' v0'
if (any(prm%b_sl <= 0.0_pReal)) extmsg = trim(extmsg)//' b_sl'
if (any(prm%Delta_F <= 0.0_pReal)) extmsg = trim(extmsg)//' Delta_F'
if (any(prm%CLambdaSlip <= 0.0_pReal)) extmsg = trim(extmsg)//' CLambdaSlip'
if (any(prm%B < 0.0_pReal)) extmsg = trim(extmsg)//' B'
if (any(prm%p<=0.0_pReal .or. prm%p>1.0_pReal)) extmsg = trim(extmsg)//' p'
if (any(prm%q< 1.0_pReal .or. prm%q>2.0_pReal)) extmsg = trim(extmsg)//' q'
else slipActive
rho_mob_0 = emptyRealArray; rho_dip_0 = emptyRealArray
allocate(prm%b_sl,prm%Delta_F,prm%v0,prm%CLambdaSlip,prm%p,prm%q,prm%B,source=emptyRealArray)
allocate(prm%forestProjection(0,0),prm%h_sl_sl(0,0))
endif slipActive
!--------------------------------------------------------------------------------------------------
! twin related parameters
N_tw = config%getInts('ntwin', defaultVal=emptyIntArray)
prm%sum_N_tw = sum(abs(N_tw))
twinActive: if (prm%sum_N_tw > 0) then
prm%P_tw = lattice_SchmidMatrix_twin(N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_tw_tw = lattice_interaction_TwinByTwin(N_tw,&
config%getFloats('interaction_twintwin'), &
config%getString('lattice_structure'))
prm%b_tw = config%getFloats('twinburgers', requiredSize=size(N_tw))
prm%t_tw = config%getFloats('twinsize', requiredSize=size(N_tw))
prm%r = config%getFloats('r_twin', requiredSize=size(N_tw))
prm%xc_twin = config%getFloat('xc_twin')
prm%L_tw = config%getFloat('l0_twin')
prm%i_tw = config%getFloat('cmfptwin')
prm%gamma_char= lattice_characteristicShear_Twin(N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%C66_tw = lattice_C66_twin(N_tw,prm%C66,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if (.not. prm%fccTwinTransNucleation) then
prm%dot_N_0_tw = config%getFloats('ndot0_twin')
prm%dot_N_0_tw = math_expand(prm%dot_N_0_tw,N_tw)
endif
! expand: family => system
prm%b_tw = math_expand(prm%b_tw,N_tw)
prm%t_tw = math_expand(prm%t_tw,N_tw)
prm%r = math_expand(prm%r,N_tw)
! sanity checks
if ( prm%xc_twin < 0.0_pReal) extmsg = trim(extmsg)//' xc_twin'
if ( prm%L_tw < 0.0_pReal) extmsg = trim(extmsg)//' L_tw'
if ( prm%i_tw < 0.0_pReal) extmsg = trim(extmsg)//' i_tw'
if (any(prm%b_tw < 0.0_pReal)) extmsg = trim(extmsg)//' b_tw'
if (any(prm%t_tw < 0.0_pReal)) extmsg = trim(extmsg)//' t_tw'
if (any(prm%r < 0.0_pReal)) extmsg = trim(extmsg)//' r'
if (.not. prm%fccTwinTransNucleation) then
if (any(prm%dot_N_0_tw < 0.0_pReal)) extmsg = trim(extmsg)//' dot_N_0_tw'
endif
else twinActive
allocate(prm%gamma_char,prm%b_tw,prm%dot_N_0_tw,prm%t_tw,prm%r,source=emptyRealArray)
allocate(prm%h_tw_tw(0,0))
endif twinActive
!--------------------------------------------------------------------------------------------------
! transformation related parameters
N_tr = config%getInts('ntrans', defaultVal=emptyIntArray)
prm%sum_N_tr = sum(abs(N_tr))
transActive: if (prm%sum_N_tr > 0) then
prm%b_tr = config%getFloats('transburgers')
prm%b_tr = math_expand(prm%b_tr,N_tr)
prm%h = config%getFloat('transstackheight', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%i_tr = config%getFloat('cmfptrans', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%gamma_fcc_hex = config%getFloat('deltag')
prm%xc_trans = config%getFloat('xc_trans', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%L_tr = config%getFloat('l0_trans')
prm%h_tr_tr = lattice_interaction_TransByTrans(N_tr,config%getFloats('interaction_transtrans'), &
config%getString('lattice_structure'))
prm%C66_tr = lattice_C66_trans(N_tr,prm%C66,config%getString('trans_lattice_structure'), &
0.0_pReal, &
config%getFloat('a_bcc', defaultVal=0.0_pReal), &
config%getFloat('a_fcc', defaultVal=0.0_pReal))
prm%P_tr = lattice_SchmidMatrix_trans(N_tr,config%getString('trans_lattice_structure'), &
0.0_pReal, &
config%getFloat('a_bcc', defaultVal=0.0_pReal), &
config%getFloat('a_fcc', defaultVal=0.0_pReal))
if (lattice_structure(p) /= lattice_FCC_ID) then
prm%dot_N_0_tr = config%getFloats('ndot0_trans')
prm%dot_N_0_tr = math_expand(prm%dot_N_0_tr,N_tr)
endif
prm%t_tr = config%getFloats('lamellarsize')
prm%t_tr = math_expand(prm%t_tr,N_tr)
prm%s = config%getFloats('s_trans',defaultVal=[0.0_pReal])
prm%s = math_expand(prm%s,N_tr)
! sanity checks
if ( prm%xc_trans < 0.0_pReal) extmsg = trim(extmsg)//' xc_trans'
if ( prm%L_tr < 0.0_pReal) extmsg = trim(extmsg)//' L_tr'
if ( prm%i_tr < 0.0_pReal) extmsg = trim(extmsg)//' i_tr'
if (any(prm%t_tr < 0.0_pReal)) extmsg = trim(extmsg)//' t_tr'
if (any(prm%s < 0.0_pReal)) extmsg = trim(extmsg)//' s'
if (lattice_structure(p) /= lattice_FCC_ID) then
if (any(prm%dot_N_0_tr < 0.0_pReal)) extmsg = trim(extmsg)//' dot_N_0_tr'
endif
else transActive
allocate(prm%s,prm%b_tr,prm%t_tr,prm%dot_N_0_tr,source=emptyRealArray)
allocate(prm%h_tr_tr(0,0))
endif transActive
!--------------------------------------------------------------------------------------------------
! shearband related parameters
prm%sbVelocity = config%getFloat('shearbandvelocity',defaultVal=0.0_pReal)
if (prm%sbVelocity > 0.0_pReal) then
prm%sbResistance = config%getFloat('shearbandresistance')
prm%E_sb = config%getFloat('qedgepersbsystem')
prm%p_sb = config%getFloat('p_shearband')
prm%q_sb = config%getFloat('q_shearband')
! sanity checks
if (prm%sbResistance < 0.0_pReal) extmsg = trim(extmsg)//' shearbandresistance'
if (prm%E_sb < 0.0_pReal) extmsg = trim(extmsg)//' qedgepersbsystem'
if (prm%p_sb <= 0.0_pReal) extmsg = trim(extmsg)//' p_shearband'
if (prm%q_sb <= 0.0_pReal) extmsg = trim(extmsg)//' q_shearband'
endif
!--------------------------------------------------------------------------------------------------
! parameters required for several mechanisms and their interactions
if(prm%sum_N_sl + prm%sum_N_tw + prm%sum_N_tw > 0) &
prm%D = config%getFloat('grainsize')
twinOrSlipActive: if (prm%sum_N_tw + prm%sum_N_tr > 0) then
prm%SFE_0K = config%getFloat('sfe_0k')
prm%dSFE_dT = config%getFloat('dsfe_dt')
prm%V_cs = config%getFloat('vcrossslip')
endif twinOrSlipActive
slipAndTwinActive: if (prm%sum_N_sl * prm%sum_N_tw > 0) then
prm%h_sl_tw = lattice_interaction_SlipByTwin(N_sl,N_tw,&
config%getFloats('interaction_sliptwin'), &
config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. size(N_tw) /= 1) extmsg = trim(extmsg)//' interaction_sliptwin'
endif slipAndTwinActive
slipAndTransActive: if (prm%sum_N_sl * prm%sum_N_tr > 0) then
prm%h_sl_tr = lattice_interaction_SlipByTrans(N_sl,N_tr,&
config%getFloats('interaction_sliptrans'), &
config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. size(N_tr) /= 1) extmsg = trim(extmsg)//' interaction_sliptrans'
endif slipAndTransActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl &
+ size(['f_tw']) * prm%sum_N_tw &
+ size(['f_tr']) * prm%sum_N_tr
sizeState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! locally defined state aliases and initialization of state0 and atol
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob=>plasticState(p)%state(startIndex:endIndex,:)
stt%rho_mob= spread(rho_mob_0,2,NipcMyPhase)
dot%rho_mob=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip=>plasticState(p)%state(startIndex:endIndex,:)
stt%rho_dip= spread(rho_dip_0,2,NipcMyPhase)
dot%rho_dip=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%gamma_sl=>plasticState(p)%state(startIndex:endIndex,:)
dot%gamma_sl=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = 1.0e-2_pReal
! global alias
plasticState(p)%slipRate => plasticState(p)%dotState(startIndex:endIndex,:)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_tw
stt%f_tw=>plasticState(p)%state(startIndex:endIndex,:)
dot%f_tw=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('f_twin',defaultVal=1.0e-7_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' f_twin'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_tr
stt%f_tr=>plasticState(p)%state(startIndex:endIndex,:)
dot%f_tr=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('f_trans',defaultVal=1.0e-6_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' f_trans'
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%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_r_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%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%V_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_DISLOTWIN_LABEL//')')
enddo
end subroutine plastic_dislotwin_init
!--------------------------------------------------------------------------------------------------
!> @brief Return the homogenized elasticity matrix.
!--------------------------------------------------------------------------------------------------
module function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
integer :: i, &
of
real(pReal) :: f_unrotated
of = material_phasememberAt(ipc,ip,el)
associate(prm => param(phase_plasticityInstance(material_phaseAt(ipc,el))),&
stt => state(phase_plasticityInstance(material_phaseAT(ipc,el))))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
homogenizedC = f_unrotated * prm%C66
do i=1,prm%sum_N_tw
homogenizedC = homogenizedC &
+ stt%f_tw(i,of)*prm%C66_tw(1:6,1:6,i)
enddo
do i=1,prm%sum_N_tr
homogenizedC = homogenizedC &
+ stt%f_tr(i,of)*prm%C66_tr(1:6,1:6,i)
enddo
end associate
end function plastic_dislotwin_homogenizedC
!--------------------------------------------------------------------------------------------------
!> @brief Calculate plastic velocity gradient and its tangent.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: Lp
real(pReal), dimension(3,3,3,3), intent(out) :: dLp_dMp
real(pReal), dimension(3,3), intent(in) :: Mp
integer, intent(in) :: instance,of
real(pReal), intent(in) :: T
integer :: i,k,l,m,n
real(pReal) :: &
f_unrotated,StressRatio_p,&
BoltzmannRatio, &
ddot_gamma_dtau, &
tau
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_sl,ddot_gamma_dtau_slip
real(pReal), dimension(param(instance)%sum_N_tw) :: &
dot_gamma_twin,ddot_gamma_dtau_twin
real(pReal), dimension(param(instance)%sum_N_tr) :: &
dot_gamma_tr,ddot_gamma_dtau_trans
real(pReal):: dot_gamma_sb
real(pReal), dimension(3,3) :: eigVectors, P_sb
real(pReal), dimension(3) :: eigValues
real(pReal), dimension(3,6), parameter :: &
sb_sComposition = &
reshape(real([&
1, 0, 1, &
1, 0,-1, &
1, 1, 0, &
1,-1, 0, &
0, 1, 1, &
0, 1,-1 &
],pReal),[ 3,6]), &
sb_mComposition = &
reshape(real([&
1, 0,-1, &
1, 0,+1, &
1,-1, 0, &
1, 1, 0, &
0, 1,-1, &
0, 1, 1 &
],pReal),[ 3,6])
associate(prm => param(instance), stt => state(instance))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
call kinetics_slip(Mp,T,instance,of,dot_gamma_sl,ddot_gamma_dtau_slip)
slipContribution: do i = 1, prm%sum_N_sl
Lp = Lp + dot_gamma_sl(i)*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_slip(i) * prm%P_sl(k,l,i) * prm%P_sl(m,n,i)
enddo slipContribution
!ToDo: Why do this before shear banding?
Lp = Lp * f_unrotated
dLp_dMp = dLp_dMp * f_unrotated
shearBandingContribution: if(dNeq0(prm%sbVelocity)) then
BoltzmannRatio = prm%E_sb/(kB*T)
call math_eigh33(Mp,eigValues,eigVectors) ! is Mp symmetric by design?
do i = 1,6
P_sb = 0.5_pReal * math_outer(matmul(eigVectors,sb_sComposition(1:3,i)),&
matmul(eigVectors,sb_mComposition(1:3,i)))
tau = math_tensordot(Mp,P_sb)
significantShearBandStress: if (abs(tau) > tol_math_check) then
StressRatio_p = (abs(tau)/prm%sbResistance)**prm%p_sb
dot_gamma_sb = sign(prm%sbVelocity*exp(-BoltzmannRatio*(1-StressRatio_p)**prm%q_sb), tau)
ddot_gamma_dtau = abs(dot_gamma_sb)*BoltzmannRatio* prm%p_sb*prm%q_sb/ prm%sbResistance &
* (abs(tau)/prm%sbResistance)**(prm%p_sb-1.0_pReal) &
* (1.0_pReal-StressRatio_p)**(prm%q_sb-1.0_pReal)
Lp = Lp + dot_gamma_sb * P_sb
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau * P_sb(k,l) * P_sb(m,n)
endif significantShearBandStress
enddo
endif shearBandingContribution
call kinetics_twin(Mp,T,dot_gamma_sl,instance,of,dot_gamma_twin,ddot_gamma_dtau_twin)
twinContibution: do i = 1, prm%sum_N_tw
Lp = Lp + dot_gamma_twin(i)*prm%P_tw(1:3,1:3,i) * f_unrotated
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_twin(i)* prm%P_tw(k,l,i)*prm%P_tw(m,n,i) * f_unrotated
enddo twinContibution
call kinetics_trans(Mp,T,dot_gamma_sl,instance,of,dot_gamma_tr,ddot_gamma_dtau_trans)
transContibution: do i = 1, prm%sum_N_tr
Lp = Lp + dot_gamma_tr(i)*prm%P_tr(1:3,1:3,i) * f_unrotated
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_trans(i)* prm%P_tr(k,l,i)*prm%P_tr(m,n,i) * f_unrotated
enddo transContibution
end associate
end subroutine plastic_dislotwin_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief Calculate the rate of change of microstructure.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
real(pReal), dimension(3,3), intent(in):: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature at integration point
integer, intent(in) :: &
instance, &
of
integer :: i
real(pReal) :: &
f_unrotated, &
rho_dip_distance, &
v_cl, & !< climb velocity
Gamma, & !< stacking fault energy
tau, &
sigma_cl, & !< climb stress
b_d !< ratio of burgers vector to stacking fault width
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_rho_dip_formation, &
dot_rho_dip_climb, &
rho_dip_distance_min, &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tw) :: &
dot_gamma_twin
real(pReal), dimension(param(instance)%sum_N_tr) :: &
dot_gamma_tr
associate(prm => param(instance), stt => state(instance), &
dot => dotState(instance), dst => dependentState(instance))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
call kinetics_slip(Mp,T,instance,of,dot_gamma_sl)
dot%gamma_sl(:,of) = abs(dot_gamma_sl)
rho_dip_distance_min = prm%CEdgeDipMinDistance*prm%b_sl
slipState: do i = 1, prm%sum_N_sl
tau = math_tensordot(Mp,prm%P_sl(1:3,1:3,i))
significantSlipStress: if (dEq0(tau)) then
dot_rho_dip_formation(i) = 0.0_pReal
dot_rho_dip_climb(i) = 0.0_pReal
else significantSlipStress
rho_dip_distance = 3.0_pReal*prm%mu*prm%b_sl(i)/(16.0_pReal*PI*abs(tau))
rho_dip_distance = math_clip(rho_dip_distance, right = dst%Lambda_sl(i,of))
rho_dip_distance = math_clip(rho_dip_distance, left = rho_dip_distance_min(i))
if (prm%dipoleFormation) then
dot_rho_dip_formation(i) = 2.0_pReal*(rho_dip_distance-rho_dip_distance_min(i))/prm%b_sl(i) &
* stt%rho_mob(i,of)*abs(dot_gamma_sl(i))
else
dot_rho_dip_formation(i) = 0.0_pReal
endif
if (dEq(rho_dip_distance,rho_dip_distance_min(i))) then
dot_rho_dip_climb(i) = 0.0_pReal
else
!@details: Refer: Argon & Moffat, Acta Metallurgica, Vol. 29, pg 293 to 299, 1981
sigma_cl = dot_product(prm%n0_sl(1:3,i),matmul(Mp,prm%n0_sl(1:3,i)))
if (prm%ExtendedDislocations) then
Gamma = prm%SFE_0K + prm%dSFE_dT * T
b_d = 24.0_pReal*PI*(1.0_pReal - prm%nu)/(2.0_pReal + prm%nu)* Gamma/(prm%mu*prm%b_sl(i))
else
b_d = 1.0_pReal
endif
v_cl = 2.0_pReal*prm%omega*b_d**2.0_pReal*exp(-prm%Qsd/(kB*T)) &
* (exp(abs(sigma_cl)*prm%b_sl(i)**3.0_pReal/(kB*T)) - 1.0_pReal)
dot_rho_dip_climb(i) = 4.0_pReal*v_cl*stt%rho_dip(i,of) &
/ (rho_dip_distance-rho_dip_distance_min(i))
endif
endif significantSlipStress
enddo slipState
dot%rho_mob(:,of) = abs(dot_gamma_sl)/(prm%b_sl*dst%Lambda_sl(:,of)) &
- dot_rho_dip_formation &
- 2.0_pReal*rho_dip_distance_min/prm%b_sl * stt%rho_mob(:,of)*abs(dot_gamma_sl)
dot%rho_dip(:,of) = dot_rho_dip_formation &
- 2.0_pReal*rho_dip_distance_min/prm%b_sl * stt%rho_dip(:,of)*abs(dot_gamma_sl) &
- dot_rho_dip_climb
call kinetics_twin(Mp,T,dot_gamma_sl,instance,of,dot_gamma_twin)
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)
dot%f_tr(:,of) = f_unrotated*dot_gamma_tr
end associate
end subroutine plastic_dislotwin_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Calculate derived quantities from state.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_dependentState(T,instance,of)
integer, intent(in) :: &
instance, &
of
real(pReal), intent(in) :: &
T
real(pReal) :: &
sumf_twin,Gamma,sumf_trans
real(pReal), dimension(param(instance)%sum_N_sl) :: &
inv_lambda_sl_sl, & !< 1/mean free distance between 2 forest dislocations 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
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
f_over_t_tw
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
f_over_t_tr
real(pReal), dimension(:), allocatable :: &
x0
associate(prm => param(instance),&
stt => state(instance),&
dst => dependentState(instance))
sumf_twin = sum(stt%f_tw(1:prm%sum_N_tw,of))
sumf_trans = sum(stt%f_tr(1:prm%sum_N_tr,of))
Gamma = prm%SFE_0K + prm%dSFE_dT * T
!* rescaled volume fraction for topology
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 ! but this not
! ToDo ...Physically correct, but naming could be adjusted
inv_lambda_sl_sl = sqrt(matmul(prm%forestProjection, &
stt%rho_mob(:,of)+stt%rho_dip(:,of)))/prm%CLambdaSlip
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_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) &
inv_lambda_sl_tr = matmul(prm%h_sl_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: better logic needed here
dst%Lambda_sl(:,of) = prm%D &
/ (1.0_pReal+prm%D*(inv_lambda_sl_sl + inv_lambda_sl_tw + inv_lambda_sl_tr))
else
dst%Lambda_sl(:,of) = prm%D &
/ (1.0_pReal+prm%D*inv_lambda_sl_sl) !!!!!! correct?
endif
dst%Lambda_tw(:,of) = prm%i_tw*prm%D/(1.0_pReal+prm%D*inv_lambda_tw_tw)
dst%Lambda_tr(:,of) = prm%i_tr*prm%D/(1.0_pReal+prm%D*inv_lambda_tr_tr)
!* threshold stress for dislocation motion
dst%tau_pass(:,of) = prm%mu*prm%b_sl* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
!* threshold stress for growing twin/martensite
if(prm%sum_N_tw == prm%sum_N_sl) &
dst%tau_hat_tw(:,of) = Gamma/(3.0_pReal*prm%b_tw) &
+ 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) &
dst%tau_hat_tr(:,of) = Gamma/(3.0_pReal*prm%b_tr) &
+ 3.0_pReal*prm%b_tr*prm%mu/(prm%L_tr*prm%b_sl) & ! slip burgers here correct?
+ prm%h*prm%gamma_fcc_hex/ (3.0_pReal*prm%b_tr)
dst%V_tw(:,of) = (PI/4.0_pReal)*prm%t_tw*dst%Lambda_tw(:,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/(Gamma*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
dst%tau_r_tw(:,of) = prm%mu*prm%b_tw/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_twin)+cos(pi/3.0_pReal)/x0)
x0 = prm%mu*prm%b_tr**2.0_pReal/(Gamma*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
dst%tau_r_tr(:,of) = prm%mu*prm%b_tr/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_trans)+cos(pi/3.0_pReal)/x0)
end associate
end subroutine plastic_dislotwin_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief Write results to HDF5 output file.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
integer :: o
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('rho_mob')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_mob,'rho_mob',&
'mobile dislocation density','1/m²')
case('rho_dip')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip,'rho_dip',&
'dislocation dipole density''1/m²')
case('gamma_sl')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma_sl,'gamma_sl',&
'plastic shear','1')
case('lambda_sl')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case('tau_pass')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')
case('f_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,stt%f_tw,'f_tw',&
'twinned volume fraction','m³/m³')
case('lambda_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,dst%Lambda_tw,'Lambda_tw',&
'mean free path for twinning','m')
case('tau_hat_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,dst%tau_hat_tw,'tau_hat_tw',&
'threshold stress for twinning','Pa')
case('f_tr')
if(prm%sum_N_tr>0) call results_writeDataset(group,stt%f_tr,'f_tr',&
'martensite volume fraction','m³/m³')
end select
enddo outputsLoop
end associate
end subroutine plastic_dislotwin_results
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on slip systems, their derivatives with respect to resolved
! stress, and the resolved stress.
!> @details Derivatives and resolved stress are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_slip(Mp,T,instance,of, &
dot_gamma_sl,ddot_gamma_dtau_slip,tau_slip)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(out) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_sl), optional, intent(out) :: &
ddot_gamma_dtau_slip, &
tau_slip
real(pReal), dimension(param(instance)%sum_N_sl) :: &
ddot_gamma_dtau
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, &
stressRatio, &
StressRatio_p, &
BoltzmannRatio, &
v_wait_inverse, & !< inverse of the effective velocity of a dislocation waiting at obstacles (unsigned)
v_run_inverse, & !< inverse of the velocity of a free moving dislocation (unsigned)
dV_wait_inverse_dTau, &
dV_run_inverse_dTau, &
dV_dTau, &
tau_eff !< effective resolved stress
integer :: i
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_sl
tau(i) = math_tensordot(Mp,prm%P_sl(1:3,1:3,i))
enddo
tau_eff = abs(tau)-dst%tau_pass(:,of)
significantStress: where(tau_eff > tol_math_check)
stressRatio = tau_eff/prm%tau_0
StressRatio_p = stressRatio** prm%p
BoltzmannRatio = prm%Delta_F/(kB*T)
v_wait_inverse = prm%v0**(-1.0_pReal) * exp(BoltzmannRatio*(1.0_pReal-StressRatio_p)** prm%q)
v_run_inverse = prm%B/(tau_eff*prm%b_sl)
dot_gamma_sl = sign(stt%rho_mob(:,of)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau)
dV_wait_inverse_dTau = -1.0_pReal * v_wait_inverse * prm%p * prm%q * BoltzmannRatio &
* (stressRatio**(prm%p-1.0_pReal)) &
* (1.0_pReal-StressRatio_p)**(prm%q-1.0_pReal) &
/ prm%tau_0
dV_run_inverse_dTau = -1.0_pReal * v_run_inverse/tau_eff
dV_dTau = -1.0_pReal * (dV_wait_inverse_dTau+dV_run_inverse_dTau) &
/ (v_wait_inverse+v_run_inverse)**2.0_pReal
ddot_gamma_dtau = dV_dTau*stt%rho_mob(:,of)*prm%b_sl
else where significantStress
dot_gamma_sl = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_slip)) ddot_gamma_dtau_slip = ddot_gamma_dtau
if(present(tau_slip)) tau_slip = tau
end subroutine kinetics_slip
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on twin systems and their derivatives with respect to resolved
! stress.
!> @details Derivatives are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end.
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_twin(Mp,T,dot_gamma_sl,instance,of,&
dot_gamma_twin,ddot_gamma_dtau_twin)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tw), intent(out) :: &
dot_gamma_twin
real(pReal), dimension(param(instance)%sum_N_tw), optional, intent(out) :: &
ddot_gamma_dtau_twin
real, dimension(param(instance)%sum_N_tw) :: &
tau, &
Ndot0, &
stressRatio_r, &
ddot_gamma_dtau
integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_tw
tau(i) = math_tensordot(Mp,prm%P_tw(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i)
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))+&
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))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tw(i,of)-tau(i)))) ! P_ncs
else
Ndot0=0.0_pReal
end if
else isFCC
Ndot0=prm%dot_N_0_tw(i)
endif isFCC
enddo
significantStress: where(tau > tol_math_check)
StressRatio_r = (dst%tau_hat_tw(:,of)/tau)**prm%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
else where significantStress
dot_gamma_twin = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_twin)) ddot_gamma_dtau_twin = ddot_gamma_dtau
end subroutine kinetics_twin
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on transformation systems and their derivatives with respect to
! resolved stress.
!> @details Derivatives are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end.
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_trans(Mp,T,dot_gamma_sl,instance,of,&
dot_gamma_tr,ddot_gamma_dtau_trans)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tr), intent(out) :: &
dot_gamma_tr
real(pReal), dimension(param(instance)%sum_N_tr), optional, intent(out) :: &
ddot_gamma_dtau_trans
real, dimension(param(instance)%sum_N_tr) :: &
tau, &
Ndot0, &
stressRatio_s, &
ddot_gamma_dtau
integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_tr
tau(i) = math_tensordot(Mp,prm%P_tr(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i)
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))+&
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))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tr(i,of)-tau(i)))) ! P_ncs
else
Ndot0=0.0_pReal
end if
else isFCC
Ndot0=prm%dot_N_0_tr(i)
endif isFCC
enddo
significantStress: where(tau > tol_math_check)
StressRatio_s = (dst%tau_hat_tr(:,of)/tau)**prm%s
dot_gamma_tr = dst%V_tr(:,of) * Ndot0*exp(-StressRatio_s)
ddot_gamma_dtau = (dot_gamma_tr*prm%s/tau)*StressRatio_s
else where significantStress
dot_gamma_tr = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_trans)) ddot_gamma_dtau_trans = ddot_gamma_dtau
end subroutine kinetics_trans
end submodule plastic_dislotwin
# 42 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_disloUCLA.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @author David Cereceda, Lawrence Livermore National Laboratory
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief crystal plasticity model for bcc metals, especially Tungsten
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_disloUCLA
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
type :: tParameters
real(pReal) :: &
D = 1.0_pReal, & !< grain size
mu = 1.0_pReal, & !< equivalent shear modulus
D_0 = 1.0_pReal, & !< prefactor for self-diffusion coefficient
Q_cl = 1.0_pReal !< activation energy for dislocation climb
real(pReal), allocatable, dimension(:) :: &
b_sl, & !< magnitude of burgers vector [m]
D_a, &
i_sl, & !< Adj. parameter for distance between 2 forest dislocations
atomicVolume, &
tau_0, &
!* mobility law parameters
delta_F, & !< activation energy for glide [J]
v0, & !< dislocation velocity prefactor [m/s]
p, & !< p-exponent in glide velocity
q, & !< q-exponent in glide velocity
B, & !< friction coefficient
kink_height, & !< height of the kink pair
w, & !< width of the kink pair
omega !< attempt frequency for kink pair nucleation
real(pReal), allocatable, dimension(:,:) :: &
h_sl_sl, & !< slip resistance from slip activity
forestProjection
real(pReal), allocatable, dimension(:,:,:) :: &
P_sl, &
nonSchmid_pos, &
nonSchmid_neg
integer :: &
sum_N_sl !< total number of active slip system
character(len=pStringLen), allocatable, dimension(:) :: &
output
logical :: &
dipoleFormation !< flag indicating consideration of dipole formation
end type !< container type for internal constitutive parameters
type :: tDisloUCLAState
real(pReal), dimension(:,:), pointer :: &
rho_mob, &
rho_dip, &
gamma_sl
end type tDisloUCLAState
type :: tDisloUCLAdependentState
real(pReal), dimension(:,:), allocatable :: &
Lambda_sl, &
threshold_stress
end type tDisloUCLAdependentState
!--------------------------------------------------------------------------------------------------
! containers for parameters and state
type(tParameters), allocatable, dimension(:) :: param
type(tDisloUCLAState), allocatable, dimension(:) :: &
dotState, &
state
type(tDisloUCLAdependentState), allocatable, dimension(:) :: dependentState
contains
!--------------------------------------------------------------------------------------------------
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_init
integer :: &
Ninstance, &
p, i, &
NipcMyPhase, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
N_sl
real(pReal),dimension(:), allocatable :: &
rho_mob_0, & !< initial dislocation density
rho_dip_0, & !< initial dipole density
a !< non-Schmid coefficients
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Cereceda et al., International Journal of Plasticity 78:242–256, 2016'
write(6,'(a)') ' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOUCLA_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(dotState(Ninstance))
allocate(dependentState(Ninstance))
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_DISLOUCLA_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
dst => dependentState(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
!--------------------------------------------------------------------------------------------------
! slip related parameters
N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if(trim(config%getString('lattice_structure')) == 'bcc') then
a = config%getFloats('nonschmid_coefficients',defaultVal = emptyRealArray)
prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1)
prm%nonSchmid_neg = lattice_nonSchmidMatrix(N_sl,a,-1)
else
prm%nonSchmid_pos = prm%P_sl
prm%nonSchmid_neg = prm%P_sl
endif
prm%h_sl_sl = lattice_interaction_SlipBySlip(N_sl,config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection = lattice_forestProjection_edge(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection = transpose(prm%forestProjection)
rho_mob_0 = config%getFloats('rhoedge0', requiredSize=size(N_sl))
rho_dip_0 = config%getFloats('rhoedgedip0', requiredSize=size(N_sl))
prm%v0 = config%getFloats('v0', requiredSize=size(N_sl))
prm%b_sl = config%getFloats('slipburgers', requiredSize=size(N_sl))
prm%delta_F = config%getFloats('qedge', requiredSize=size(N_sl))
prm%i_sl = config%getFloats('clambdaslip', requiredSize=size(N_sl))
prm%tau_0 = config%getFloats('tau_peierls', requiredSize=size(N_sl))
prm%p = config%getFloats('p_slip', requiredSize=size(N_sl), &
defaultVal=[(1.0_pReal,i=1,size(N_sl))])
prm%q = config%getFloats('q_slip', requiredSize=size(N_sl), &
defaultVal=[(1.0_pReal,i=1,size(N_sl))])
prm%kink_height = config%getFloats('kink_height', requiredSize=size(N_sl))
prm%w = config%getFloats('kink_width', requiredSize=size(N_sl))
prm%omega = config%getFloats('omega', requiredSize=size(N_sl))
prm%B = config%getFloats('friction_coeff', requiredSize=size(N_sl))
prm%D = config%getFloat('grainsize')
prm%D_0 = config%getFloat('d0')
prm%Q_cl = config%getFloat('qsd')
prm%atomicVolume = config%getFloat('catomicvolume') * prm%b_sl**3.0_pReal
prm%D_a = config%getFloat('cedgedipmindistance') * prm%b_sl
prm%dipoleformation = config%getFloat('dipoleformationfactor') > 0.0_pReal !should be on by default, ToDo: change to /key/-type key
! expand: family => system
rho_mob_0 = math_expand(rho_mob_0, N_sl)
rho_dip_0 = math_expand(rho_dip_0, N_sl)
prm%q = math_expand(prm%q, N_sl)
prm%p = math_expand(prm%p, N_sl)
prm%delta_F = math_expand(prm%delta_F, N_sl)
prm%b_sl = math_expand(prm%b_sl, N_sl)
prm%kink_height = math_expand(prm%kink_height, N_sl)
prm%w = math_expand(prm%w, N_sl)
prm%omega = math_expand(prm%omega, N_sl)
prm%tau_0 = math_expand(prm%tau_0, N_sl)
prm%v0 = math_expand(prm%v0, N_sl)
prm%B = math_expand(prm%B, N_sl)
prm%i_sl = math_expand(prm%i_sl, N_sl)
prm%atomicVolume = math_expand(prm%atomicVolume, N_sl)
prm%D_a = math_expand(prm%D_a, N_sl)
! sanity checks
if ( prm%D_0 <= 0.0_pReal) extmsg = trim(extmsg)//' D_0'
if ( prm%Q_cl <= 0.0_pReal) extmsg = trim(extmsg)//' Q_cl'
if (any(rho_mob_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoedge0'
if (any(rho_dip_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoedgedip0'
if (any(prm%v0 < 0.0_pReal)) extmsg = trim(extmsg)//' v0'
if (any(prm%b_sl <= 0.0_pReal)) extmsg = trim(extmsg)//' b_sl'
if (any(prm%delta_F <= 0.0_pReal)) extmsg = trim(extmsg)//' qedge'
if (any(prm%tau_0 < 0.0_pReal)) extmsg = trim(extmsg)//' tau_0'
if (any(prm%D_a <= 0.0_pReal)) extmsg = trim(extmsg)//' cedgedipmindistance or b_sl'
if (any(prm%atomicVolume <= 0.0_pReal)) extmsg = trim(extmsg)//' catomicvolume or b_sl'
else slipActive
rho_mob_0= emptyRealArray; rho_dip_0 = emptyRealArray
allocate(prm%b_sl,prm%D_a,prm%i_sl,prm%atomicVolume,prm%tau_0, &
prm%delta_F,prm%v0,prm%p,prm%q,prm%B,prm%kink_height,prm%w,prm%omega, &
source = emptyRealArray)
allocate(prm%forestProjection(0,0))
allocate(prm%h_sl_sl (0,0))
endif slipActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl
sizeState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob => plasticState(p)%state(startIndex:endIndex,:)
stt%rho_mob = spread(rho_mob_0,2,NipcMyPhase)
dot%rho_mob => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip => plasticState(p)%state(startIndex:endIndex,:)
stt%rho_dip = spread(rho_dip_0,2,NipcMyPhase)
dot%rho_dip => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%gamma_sl => plasticState(p)%state(startIndex:endIndex,:)
dot%gamma_sl => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = 1.0e-2_pReal
! global alias
plasticState(p)%slipRate => plasticState(p)%dotState(startIndex:endIndex,:)
allocate(dst%Lambda_sl(prm%sum_N_sl,NipcMyPhase), source=0.0_pReal)
allocate(dst%threshold_stress(prm%sum_N_sl,NipcMyPhase), source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_DISLOUCLA_LABEL//')')
enddo
end subroutine plastic_disloUCLA_init
!--------------------------------------------------------------------------------------------------
!> @brief Calculate plastic velocity gradient and its tangent.
!--------------------------------------------------------------------------------------------------
pure module subroutine plastic_disloUCLA_LpAndItsTangent(Lp,dLp_dMp, &
Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
integer :: &
i,k,l,m,n
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_pos,dot_gamma_neg, &
ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
associate(prm => param(instance))
call kinetics(Mp,T,instance,of,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
do i = 1, prm%sum_N_sl
Lp = Lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%nonSchmid_pos(m,n,i) &
+ ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%nonSchmid_neg(m,n,i)
enddo
end associate
end subroutine plastic_disloUCLA_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief Calculate the rate of change of microstructure.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_dotState(Mp,T,instance,of)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal) :: &
VacancyDiffusion
real(pReal), dimension(param(instance)%sum_N_sl) :: &
gdot_pos, gdot_neg,&
tau_pos,&
tau_neg, &
v_cl, &
dot_rho_dip_formation, &
dot_rho_dip_climb, &
dip_distance
associate(prm => param(instance), stt => state(instance),dot => dotState(instance), dst => dependentState(instance))
call kinetics(Mp,T,instance,of,&
gdot_pos,gdot_neg, &
tau_pos_out = tau_pos,tau_neg_out = tau_neg)
dot%gamma_sl(:,of) = (gdot_pos+gdot_neg) ! ToDo: needs to be abs
VacancyDiffusion = prm%D_0*exp(-prm%Q_cl/(kB*T))
where(dEq0(tau_pos)) ! ToDo: use avg of pos and neg
dot_rho_dip_formation = 0.0_pReal
dot_rho_dip_climb = 0.0_pReal
else where
dip_distance = math_clip(3.0_pReal*prm%mu*prm%b_sl/(16.0_pReal*PI*abs(tau_pos)), &
prm%D_a, & ! lower limit
dst%Lambda_sl(:,of)) ! upper limit
dot_rho_dip_formation = merge(2.0_pReal*dip_distance* stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))/prm%b_sl, & ! ToDo: ignore region of spontaneous annihilation
0.0_pReal, &
prm%dipoleformation)
v_cl = (3.0_pReal*prm%mu*VacancyDiffusion*prm%atomicVolume/(2.0_pReal*pi*kB*T)) &
* (1.0_pReal/(dip_distance+prm%D_a))
dot_rho_dip_climb = (4.0_pReal*v_cl*stt%rho_dip(:,of))/(dip_distance-prm%D_a) ! ToDo: Discuss with Franz: Stress dependency?
end where
dot%rho_mob(:,of) = abs(dot%gamma_sl(:,of))/(prm%b_sl*dst%Lambda_sl(:,of)) & ! multiplication
- dot_rho_dip_formation &
- (2.0_pReal*prm%D_a)/prm%b_sl*stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of)) ! Spontaneous annihilation of 2 single edge dislocations
dot%rho_dip(:,of) = dot_rho_dip_formation &
- (2.0_pReal*prm%D_a)/prm%b_sl*stt%rho_dip(:,of)*abs(dot%gamma_sl(:,of)) & ! Spontaneous annihilation of a single edge dislocation with a dipole constituent
- dot_rho_dip_climb
end associate
end subroutine plastic_disloUCLA_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Calculate derived quantities from state.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_dependentState(instance,of)
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dislocationSpacing
associate(prm => param(instance), stt => state(instance),dst => dependentState(instance))
dislocationSpacing = sqrt(matmul(prm%forestProjection,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
dst%threshold_stress(:,of) = prm%mu*prm%b_sl &
* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
dst%Lambda_sl(:,of) = prm%D/(1.0_pReal+prm%D*dislocationSpacing/prm%i_sl)
end associate
end subroutine plastic_disloUCLA_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief Write results to HDF5 output file.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
integer :: o
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('edge_density') ! ToDo: should be rho_mob
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_mob,'rho_mob',&
'mobile dislocation density','1/m²')
case('dipole_density') ! ToDo: should be rho_dip
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip,'rho_dip',&
'dislocation dipole density''1/m²')
case('shear_rate_slip') ! should be gamma
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',& ! this is not dot!!
'plastic shear','1')
case('mfp_slip') !ToDo: should be Lambda
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case('threshold_stress_slip') !ToDo: should be tau_pass
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%threshold_stress,'tau_pass',&
'threshold stress for slip','Pa')
end select
enddo outputsLoop
end associate
end subroutine plastic_disloUCLA_results
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on slip systems, their derivatives with respect to resolved
! stress, and the resolved stress.
!> @details Derivatives and resolved stress are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics(Mp,T,instance,of, &
dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg,tau_pos_out,tau_neg_out)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), intent(out), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_pos, &
dot_gamma_neg
real(pReal), intent(out), optional, dimension(param(instance)%sum_N_sl) :: &
ddot_gamma_dtau_pos, &
ddot_gamma_dtau_neg, &
tau_pos_out, &
tau_neg_out
real(pReal), dimension(param(instance)%sum_N_sl) :: &
StressRatio, &
StressRatio_p,StressRatio_pminus1, &
dvel, vel, &
tau_pos,tau_neg, &
t_n, t_k, dtk,dtn, &
needsGoodName ! ToDo: @Karo: any idea?
integer :: j
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do j = 1, prm%sum_N_sl
tau_pos(j) = math_tensordot(Mp,prm%nonSchmid_pos(1:3,1:3,j))
tau_neg(j) = math_tensordot(Mp,prm%nonSchmid_neg(1:3,1:3,j))
enddo
if (present(tau_pos_out)) tau_pos_out = tau_pos
if (present(tau_neg_out)) tau_neg_out = tau_neg
associate(BoltzmannRatio => prm%delta_F/(kB*T), &
dot_gamma_0 => stt%rho_mob(:,of)*prm%b_sl*prm%v0, &
effectiveLength => dst%Lambda_sl(:,of) - prm%w)
significantPositiveTau: where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
StressRatio = (abs(tau_pos)-dst%threshold_stress(:,of))/prm%tau_0
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
needsGoodName = exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)
t_n = prm%b_sl/(needsGoodName*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
vel = prm%kink_height/(t_n + t_k)
dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_pReal
else where significantPositiveTau
dot_gamma_pos = 0.0_pReal
end where significantPositiveTau
if (present(ddot_gamma_dtau_pos)) then
significantPositiveTau2: where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_0
dtk = -1.0_pReal * t_k / tau_pos
dvel = -1.0_pReal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_pReal
else where significantPositiveTau2
ddot_gamma_dtau_pos = 0.0_pReal
end where significantPositiveTau2
endif
significantNegativeTau: where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
StressRatio = (abs(tau_neg)-dst%threshold_stress(:,of))/prm%tau_0
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
needsGoodName = exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)
t_n = prm%b_sl/(needsGoodName*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
vel = prm%kink_height/(t_n + t_k)
dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_pReal
else where significantNegativeTau
dot_gamma_neg = 0.0_pReal
end where significantNegativeTau
if (present(ddot_gamma_dtau_neg)) then
significantNegativeTau2: where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_0
dtk = -1.0_pReal * t_k / tau_neg
dvel = -1.0_pReal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_pReal
else where significantNegativeTau2
ddot_gamma_dtau_neg = 0.0_pReal
end where significantNegativeTau2
end if
end associate
end associate
end subroutine kinetics
end submodule plastic_disloUCLA
# 43 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine for plasticity including dislocation flux
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_nonlocal
use geometry_plastic_nonlocal, only: &
nIPneighbors => geometry_plastic_nonlocal_nIPneighbors, &
IPneighborhood => geometry_plastic_nonlocal_IPneighborhood, &
IPvolume => geometry_plastic_nonlocal_IPvolume0, &
IParea => geometry_plastic_nonlocal_IParea0, &
IPareaNormal => geometry_plastic_nonlocal_IPareaNormal0
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
! storage order of dislocation types
integer, dimension(8), parameter :: &
sgl = [1,2,3,4,5,6,7,8] !< signed (single)
integer, dimension(5), parameter :: &
edg = [1,2,5,6,9], & !< edge
scr = [3,4,7,8,10] !< screw
integer, dimension(4), parameter :: &
mob = [1,2,3,4], & !< mobile
imm = [5,6,7,8] !< immobile (blocked)
integer, dimension(2), parameter :: &
dip = [9,10], & !< dipole
imm_edg = imm(1:2), & !< immobile edge
imm_scr = imm(3:4) !< immobile screw
integer, parameter :: &
mob_edg_pos = 1, & !< mobile edge positive
mob_edg_neg = 2, & !< mobile edge negative
mob_scr_pos = 3, & !< mobile screw positive
mob_scr_neg = 4 !< mobile screw positive
! BEGIN DEPRECATED
integer, dimension(:,:,:), allocatable :: &
iRhoU, & !< state indices for unblocked density
iV, & !< state indices for dislcation velocities
iD !< state indices for stable dipole height
!END DEPRECATED
real(pReal), dimension(:,:,:,:,:,:), allocatable :: &
compatibility !< slip system compatibility between me and my neighbors
type :: tInitialParameters !< container type for internal constitutive parameters
real(pReal) :: &
rhoSglScatter, & !< standard deviation of scatter in initial dislocation density
rhoSglRandom, &
rhoSglRandomBinning
real(pReal), dimension(:), allocatable :: &
rhoSglEdgePos0, & !< initial edge_pos dislocation density
rhoSglEdgeNeg0, & !< initial edge_neg dislocation density
rhoSglScrewPos0, & !< initial screw_pos dislocation density
rhoSglScrewNeg0, & !< initial screw_neg dislocation density
rhoDipEdge0, & !< initial edge dipole dislocation density
rhoDipScrew0 !< initial screw dipole dislocation density
integer, dimension(:) ,allocatable :: &
N_sl
end type tInitialParameters
type :: tParameters !< container type for internal constitutive parameters
real(pReal) :: &
atomicVolume, & !< atomic volume
Dsd0, & !< prefactor for self-diffusion coefficient
selfDiffusionEnergy, & !< activation enthalpy for diffusion
atol_rho, & !< absolute tolerance for dislocation density in state integration
significantRho, & !< density considered significant
significantN, & !< number of dislocations considered significant
doublekinkwidth, & !< width of a doubkle kink in multiples of the burgers vector length b
solidSolutionEnergy, & !< activation energy for solid solution in J
solidSolutionSize, & !< solid solution obstacle size in multiples of the burgers vector length
solidSolutionConcentration, & !< concentration of solid solution in atomic parts
p, & !< parameter for kinetic law (Kocks,Argon,Ashby)
q, & !< parameter for kinetic law (Kocks,Argon,Ashby)
viscosity, & !< viscosity for dislocation glide in Pa s
fattack, & !< attack frequency in Hz
surfaceTransmissivity, & !< transmissivity at free surface
grainboundaryTransmissivity, & !< transmissivity at grain boundary (identified by different texture)
CFLfactor, & !< safety factor for CFL flux condition
fEdgeMultiplication, & !< factor that determines how much edge dislocations contribute to multiplication (0...1)
linetensionEffect, &
edgeJogFactor, &
mu, &
nu
real(pReal), dimension(:), allocatable :: &
minDipoleHeight_edge, & !< minimum stable edge dipole height
minDipoleHeight_screw, & !< minimum stable screw dipole height
peierlsstress_edge, &
peierlsstress_screw, &
lambda0, & !< mean free path prefactor for each
burgers !< absolute length of burgers vector [m]
real(pReal), dimension(:,:), allocatable :: &
slip_normal, &
slip_direction, &
slip_transverse, &
minDipoleHeight, & ! edge and screw
peierlsstress, & ! edge and screw
interactionSlipSlip ,& !< coefficients for slip-slip interaction
forestProjection_Edge, & !< matrix of forest projections of edge dislocations
forestProjection_Screw !< matrix of forest projections of screw dislocations
real(pReal), dimension(:,:,:), allocatable :: &
Schmid, & !< Schmid contribution
nonSchmid_pos, &
nonSchmid_neg !< combined projection of Schmid and non-Schmid contributions to the resolved shear stress (only for screws)
integer :: &
sum_N_sl
integer, dimension(:), allocatable :: &
colinearSystem !< colinear system to the active slip system (only valid for fcc!)
character(len=pStringLen), dimension(:), allocatable :: &
output
logical :: &
shortRangeStressCorrection, & !< use of short range stress correction by excess density gradient term
nonSchmidActive = .false.
end type tParameters
type :: tNonlocalMicrostructure
real(pReal), allocatable, dimension(:,:) :: &
tau_pass, &
tau_Back
end type tNonlocalMicrostructure
type :: tNonlocalState
real(pReal), pointer, dimension(:,:) :: &
rho, & ! < all dislocations
rhoSgl, &
rhoSglMobile, & ! iRhoU
rho_sgl_mob_edg_pos, &
rho_sgl_mob_edg_neg, &
rho_sgl_mob_scr_pos, &
rho_sgl_mob_scr_neg, &
rhoSglImmobile, &
rho_sgl_imm_edg_pos, &
rho_sgl_imm_edg_neg, &
rho_sgl_imm_scr_pos, &
rho_sgl_imm_scr_neg, &
rhoDip, &
rho_dip_edg, &
rho_dip_scr, &
rho_forest, &
gamma, &
v, &
v_edg_pos, &
v_edg_neg, &
v_scr_pos, &
v_scr_neg
end type tNonlocalState
type(tNonlocalState), allocatable, dimension(:) :: &
deltaState, &
dotState, &
state, &
state0
type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstance)
type(tNonlocalMicrostructure), dimension(:), allocatable :: microstructure
contains
!--------------------------------------------------------------------------------------------------
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_init
integer :: &
Ninstance, &
p, &
NipcMyPhase, &
sizeState, sizeDotState, sizeDependentState, sizeDeltaState, &
s1, s2, &
s, t, l
real(pReal), dimension(:), allocatable :: &
a
character(len=pStringLen) :: &
extmsg = ''
type(tInitialParameters) :: &
ini
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Reuber et al., Acta Materialia 71:333–348, 2014'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2014.03.012'
write(6,'(/,a)') ' Kords, Dissertation RWTH Aachen, 2014'
write(6,'(a)') ' http://publications.rwth-aachen.de/record/229993'
Ninstance = count(phase_plasticity == PLASTICITY_NONLOCAL_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(state0(Ninstance))
allocate(dotState(Ninstance))
allocate(deltaState(Ninstance))
allocate(microstructure(Ninstance))
do p=1, size(config_phase)
if (phase_plasticity(p) /= PLASTICITY_NONLOCAL_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
st0 => state0(phase_plasticityInstance(p)), &
del => deltaState(phase_plasticityInstance(p)), &
dst => microstructure(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
prm%atol_rho = config%getFloat('atol_rho',defaultVal=1.0e4_pReal)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
prm%nu = lattice_nu(p)
ini%N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(ini%N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%Schmid = lattice_SchmidMatrix_slip(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if(trim(config%getString('lattice_structure')) == 'bcc') then
a = config%getFloats('nonschmid_coefficients',defaultVal = emptyRealArray)
if(size(a) > 0) prm%nonSchmidActive = .true.
prm%nonSchmid_pos = lattice_nonSchmidMatrix(ini%N_sl,a,+1)
prm%nonSchmid_neg = lattice_nonSchmidMatrix(ini%N_sl,a,-1)
else
prm%nonSchmid_pos = prm%Schmid
prm%nonSchmid_neg = prm%Schmid
endif
prm%interactionSlipSlip = lattice_interaction_SlipBySlip(ini%N_sl, &
config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection_edge = lattice_forestProjection_edge (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection_screw = lattice_forestProjection_screw(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_direction = lattice_slip_direction (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_transverse = lattice_slip_transverse(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_normal = lattice_slip_normal (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
! collinear systems (only for octahedral slip systems in fcc)
allocate(prm%colinearSystem(prm%sum_N_sl), source = -1)
do s1 = 1, prm%sum_N_sl
do s2 = 1, prm%sum_N_sl
if (all(dEq0 (math_cross(prm%slip_direction(1:3,s1),prm%slip_direction(1:3,s2)))) .and. &
any(dNeq0(math_cross(prm%slip_normal (1:3,s1),prm%slip_normal (1:3,s2))))) &
prm%colinearSystem(s1) = s2
enddo
enddo
ini%rhoSglEdgePos0 = config%getFloats('rhosgledgepos0', requiredSize=size(ini%N_sl))
ini%rhoSglEdgeNeg0 = config%getFloats('rhosgledgeneg0', requiredSize=size(ini%N_sl))
ini%rhoSglScrewPos0 = config%getFloats('rhosglscrewpos0', requiredSize=size(ini%N_sl))
ini%rhoSglScrewNeg0 = config%getFloats('rhosglscrewneg0', requiredSize=size(ini%N_sl))
ini%rhoDipEdge0 = config%getFloats('rhodipedge0', requiredSize=size(ini%N_sl))
ini%rhoDipScrew0 = config%getFloats('rhodipscrew0', requiredSize=size(ini%N_sl))
prm%lambda0 = config%getFloats('lambda0', requiredSize=size(ini%N_sl))
prm%burgers = config%getFloats('burgers', requiredSize=size(ini%N_sl))
prm%lambda0 = math_expand(prm%lambda0,ini%N_sl)
prm%burgers = math_expand(prm%burgers,ini%N_sl)
prm%minDipoleHeight_edge = config%getFloats('minimumdipoleheightedge', requiredSize=size(ini%N_sl))
prm%minDipoleHeight_screw = config%getFloats('minimumdipoleheightscrew', requiredSize=size(ini%N_sl))
prm%minDipoleHeight_edge = math_expand(prm%minDipoleHeight_edge, ini%N_sl)
prm%minDipoleHeight_screw = math_expand(prm%minDipoleHeight_screw,ini%N_sl)
allocate(prm%minDipoleHeight(prm%sum_N_sl,2))
prm%minDipoleHeight(:,1) = prm%minDipoleHeight_edge
prm%minDipoleHeight(:,2) = prm%minDipoleHeight_screw
prm%peierlsstress_edge = config%getFloats('peierlsstressedge', requiredSize=size(ini%N_sl))
prm%peierlsstress_screw = config%getFloats('peierlsstressscrew', requiredSize=size(ini%N_sl))
prm%peierlsstress_edge = math_expand(prm%peierlsstress_edge, ini%N_sl)
prm%peierlsstress_screw = math_expand(prm%peierlsstress_screw,ini%N_sl)
allocate(prm%peierlsstress(prm%sum_N_sl,2))
prm%peierlsstress(:,1) = prm%peierlsstress_edge
prm%peierlsstress(:,2) = prm%peierlsstress_screw
prm%significantRho = config%getFloat('significantrho')
prm%significantN = config%getFloat('significantn', 0.0_pReal)
prm%CFLfactor = config%getFloat('cflfactor',defaultVal=2.0_pReal)
prm%atomicVolume = config%getFloat('atomicvolume')
prm%Dsd0 = config%getFloat('selfdiffusionprefactor') !,'dsd0'
prm%selfDiffusionEnergy = config%getFloat('selfdiffusionenergy') !,'qsd'
prm%linetensionEffect = config%getFloat('linetension')
prm%edgeJogFactor = config%getFloat('edgejog')!,'edgejogs'
prm%doublekinkwidth = config%getFloat('doublekinkwidth')
prm%solidSolutionEnergy = config%getFloat('solidsolutionenergy')
prm%solidSolutionSize = config%getFloat('solidsolutionsize')
prm%solidSolutionConcentration = config%getFloat('solidsolutionconcentration')
prm%p = config%getFloat('p')
prm%q = config%getFloat('q')
prm%viscosity = config%getFloat('viscosity')
prm%fattack = config%getFloat('attackfrequency')
! ToDo: discuss logic
ini%rhoSglScatter = config%getFloat('rhosglscatter')
ini%rhoSglRandom = config%getFloat('rhosglrandom',0.0_pReal)
if (config%keyExists('/rhosglrandom/')) &
ini%rhoSglRandomBinning = config%getFloat('rhosglrandombinning',0.0_pReal) !ToDo: useful default?
! if (rhoSglRandom(instance) < 0.0_pReal) &
! if (rhoSglRandomBinning(instance) <= 0.0_pReal) &
prm%surfaceTransmissivity = config%getFloat('surfacetransmissivity',defaultVal=1.0_pReal)
prm%grainboundaryTransmissivity = config%getFloat('grainboundarytransmissivity',defaultVal=-1.0_pReal)
prm%fEdgeMultiplication = config%getFloat('edgemultiplication')
prm%shortRangeStressCorrection = config%keyExists('/shortrangestresscorrection/')
!--------------------------------------------------------------------------------------------------
! sanity checks
if (any(prm%burgers < 0.0_pReal)) extmsg = trim(extmsg)//' burgers'
if (any(prm%lambda0 <= 0.0_pReal)) extmsg = trim(extmsg)//' lambda0'
if (any(ini%rhoSglEdgePos0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglEdgePos0'
if (any(ini%rhoSglEdgeNeg0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglEdgeNeg0'
if (any(ini%rhoSglScrewPos0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglScrewPos0'
if (any(ini%rhoSglScrewNeg0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglScrewNeg0'
if (any(ini%rhoDipEdge0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoDipEdge0'
if (any(ini%rhoDipScrew0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoDipScrew0'
if (any(prm%peierlsstress < 0.0_pReal)) extmsg = trim(extmsg)//' peierlsstress'
if (any(prm%minDipoleHeight < 0.0_pReal)) extmsg = trim(extmsg)//' minDipoleHeight'
if (prm%viscosity <= 0.0_pReal) extmsg = trim(extmsg)//' viscosity'
if (prm%selfDiffusionEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' selfDiffusionEnergy'
if (prm%fattack <= 0.0_pReal) extmsg = trim(extmsg)//' fattack'
if (prm%doublekinkwidth <= 0.0_pReal) extmsg = trim(extmsg)//' doublekinkwidth'
if (prm%Dsd0 < 0.0_pReal) extmsg = trim(extmsg)//' Dsd0'
if (prm%atomicVolume <= 0.0_pReal) extmsg = trim(extmsg)//' atomicVolume' ! ToDo: in disloUCLA, the atomic volume is given as a factor
if (prm%significantN < 0.0_pReal) extmsg = trim(extmsg)//' significantN'
if (prm%significantrho < 0.0_pReal) extmsg = trim(extmsg)//' significantrho'
if (prm%atol_rho < 0.0_pReal) extmsg = trim(extmsg)//' atol_rho'
if (prm%CFLfactor < 0.0_pReal) extmsg = trim(extmsg)//' CFLfactor'
if (prm%p <= 0.0_pReal .or. prm%p > 1.0_pReal) extmsg = trim(extmsg)//' p'
if (prm%q < 1.0_pReal .or. prm%q > 2.0_pReal) extmsg = trim(extmsg)//' q'
if (prm%linetensionEffect < 0.0_pReal .or. prm%linetensionEffect > 1.0_pReal) &
extmsg = trim(extmsg)//' linetensionEffect'
if (prm%edgeJogFactor < 0.0_pReal .or. prm%edgeJogFactor > 1.0_pReal) &
extmsg = trim(extmsg)//' edgeJogFactor'
if (prm%solidSolutionEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionEnergy'
if (prm%solidSolutionSize <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionSize'
if (prm%solidSolutionConcentration <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionConcentration'
if (prm%grainboundaryTransmissivity > 1.0_pReal) extmsg = trim(extmsg)//' grainboundaryTransmissivity'
if (prm%surfaceTransmissivity < 0.0_pReal .or. prm%surfaceTransmissivity > 1.0_pReal) &
extmsg = trim(extmsg)//' surfaceTransmissivity'
if (prm%fEdgeMultiplication < 0.0_pReal .or. prm%fEdgeMultiplication > 1.0_pReal) &
extmsg = trim(extmsg)//' fEdgeMultiplication'
endif slipActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', &
'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', &
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
'rhoSglScrewPosImmobile','rhoSglScrewNegImmobile', &
'rhoDipEdge ','rhoDipScrew ', &
'gamma ' ]) * prm%sum_N_sl !< "basic" microstructural state variables that are independent from other state variables
sizeDependentState = size([ 'rhoForest ']) * prm%sum_N_sl !< microstructural state variables that depend on other state variables
sizeState = sizeDotState + sizeDependentState &
+ size([ 'velocityEdgePos ','velocityEdgeNeg ', &
'velocityScrewPos ','velocityScrewNeg ', &
'maxDipoleHeightEdge ','maxDipoleHeightScrew' ]) * prm%sum_N_sl !< other dependent state variables that are not updated by microstructure
sizeDeltaState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,sizeDeltaState)
plasticState(p)%nonlocal = .true.
plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention
st0%rho => plasticState(p)%state0 (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%rho => plasticState(p)%state (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rho => plasticState(p)%dotState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rho => plasticState(p)%deltaState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
plasticState(p)%atol(1:10*prm%sum_N_sl) = prm%atol_rho
stt%rhoSgl => plasticState(p)%state (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rhoSgl => plasticState(p)%dotState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rhoSgl => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rhoSglMobile => plasticState(p)%state (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
dot%rhoSglMobile => plasticState(p)%dotState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
del%rhoSglMobile => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
stt%rho_sgl_mob_edg_pos => plasticState(p)%state (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
dot%rho_sgl_mob_edg_pos => plasticState(p)%dotState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
del%rho_sgl_mob_edg_pos => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
stt%rho_sgl_mob_edg_neg => plasticState(p)%state (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
dot%rho_sgl_mob_edg_neg => plasticState(p)%dotState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
del%rho_sgl_mob_edg_neg => plasticState(p)%deltaState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
stt%rhoSglImmobile => plasticState(p)%state (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rhoSglImmobile => plasticState(p)%dotState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
del%rho_sgl_imm_edg_pos => plasticState(p)%deltaState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
del%rho_sgl_imm_edg_neg => plasticState(p)%deltaState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rhoDip => plasticState(p)%state (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rhoDip => plasticState(p)%dotState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rhoDip => plasticState(p)%deltaState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%rho_dip_edg => plasticState(p)%state (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
dot%rho_dip_edg => plasticState(p)%dotState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
del%rho_dip_edg => plasticState(p)%deltaState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
stt%rho_dip_scr => plasticState(p)%state (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rho_dip_scr => plasticState(p)%dotState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rho_dip_scr => plasticState(p)%deltaState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%gamma => plasticState(p)%state (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
dot%gamma => plasticState(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
del%gamma => plasticState(p)%deltaState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
plasticState(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl ) = config%getFloat('atol_gamma', defaultVal = 1.0e-2_pReal)
if(any(plasticState(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl) < 0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma'
plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
stt%rho_forest => plasticState(p)%state (11*prm%sum_N_sl + 1:12*prm%sum_N_sl,1:NipcMyPhase)
stt%v => plasticState(p)%state (12*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:NipcMyPhase)
stt%v_edg_pos => plasticState(p)%state (12*prm%sum_N_sl + 1:13*prm%sum_N_sl,1:NipcMyPhase)
stt%v_edg_neg => plasticState(p)%state (13*prm%sum_N_sl + 1:14*prm%sum_N_sl,1:NipcMyPhase)
stt%v_scr_pos => plasticState(p)%state (14*prm%sum_N_sl + 1:15*prm%sum_N_sl,1:NipcMyPhase)
stt%v_scr_neg => plasticState(p)%state (15*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:NipcMyPhase)
allocate(dst%tau_pass(prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_back(prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
end associate
if (NipcMyPhase > 0) call stateInit(ini,p,NipcMyPhase)
plasticState(p)%state0 = plasticState(p)%state
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_NONLOCAL_LABEL//')')
enddo
allocate(compatibility(2,maxval(param%sum_N_sl),maxval(param%sum_N_sl),nIPneighbors,&
discretization_nIP,discretization_nElem), source=0.0_pReal)
! BEGIN DEPRECATED----------------------------------------------------------------------------------
allocate(iRhoU(maxval(param%sum_N_sl),4,Ninstance), source=0)
allocate(iV(maxval(param%sum_N_sl),4,Ninstance), source=0)
allocate(iD(maxval(param%sum_N_sl),2,Ninstance), source=0)
initializeInstances: do p = 1, size(phase_plasticity)
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then
l = 0
do t = 1,4
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iRhoU(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
l = l + (4+2+1+1)*param(phase_plasticityInstance(p))%sum_N_sl ! immobile(4), dipole(2), shear, forest
do t = 1,4
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iV(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
do t = 1,2
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iD(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
if (iD(param(phase_plasticityInstance(p))%sum_N_sl,2,phase_plasticityInstance(p)) /= plasticState(p)%sizeState) &
call IO_error(0, ext_msg = 'state indices not properly set ('//PLASTICITY_NONLOCAL_LABEL//')')
endif myPhase2
enddo initializeInstances
end subroutine plastic_nonlocal_init
!--------------------------------------------------------------------------------------------------
!> @brief calculates quantities characterizing the microstructure
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
real(pReal), dimension(3,3), intent(in) :: &
F, &
Fp
integer, intent(in) :: &
instance, &
of, &
ip, &
el
integer :: &
no, & !< neighbor offset
neighbor_el, & ! element number of neighboring material point
neighbor_ip, & ! integration point of neighboring material point
neighbor_instance, & ! instance of this plasticity of neighboring material point
c, & ! index of dilsocation character (edge, screw)
s, & ! slip system index
dir, &
n
real(pReal) :: &
FVsize, &
nRealNeighbors ! number of really existing neighbors
integer, dimension(2) :: &
neighbors
real(pReal), dimension(2) :: &
rhoExcessGradient, &
rhoExcessGradient_over_rho, &
rhoTotal
real(pReal), dimension(3) :: &
rhoExcessDifferences, &
normal_latticeConf
real(pReal), dimension(3,3) :: &
invFe, & !< inverse of elastic deformation gradient
invFp, & !< inverse of plastic deformation gradient
connections, &
invConnections
real(pReal), dimension(3,nIPneighbors) :: &
connection_latticeConf
real(pReal), dimension(2,param(instance)%sum_N_sl) :: &
rhoExcess
real(pReal), dimension(param(instance)%sum_N_sl) :: &
rho_edg_delta, &
rho_scr_delta
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho, &
rho0, &
rho_neighbor0
real(pReal), dimension(param(instance)%sum_N_sl,param(instance)%sum_N_sl) :: &
myInteractionMatrix ! corrected slip interaction matrix
real(pReal), dimension(param(instance)%sum_N_sl,nIPneighbors) :: &
rho_edg_delta_neighbor, &
rho_scr_delta_neighbor
real(pReal), dimension(2,maxval(param%sum_N_sl),nIPneighbors) :: &
neighbor_rhoExcess, & ! excess density at neighboring material point
neighbor_rhoTotal ! total density at neighboring material point
real(pReal), dimension(3,param(instance)%sum_N_sl,2) :: &
m ! direction of dislocation motion
associate(prm => param(instance),dst => microstructure(instance), stt => state(instance))
rho = getRho(instance,of,ip,el)
stt%rho_forest(:,of) = matmul(prm%forestProjection_Edge, sum(abs(rho(:,edg)),2)) &
+ matmul(prm%forestProjection_Screw,sum(abs(rho(:,scr)),2))
! coefficients are corrected for the line tension effect
! (see Kubin,Devincre,Hoc; 2008; Modeling dislocation storage rates and mean free paths in face-centered cubic crystals)
if (any(lattice_structure(material_phaseAt(1,el)) == [LATTICE_bcc_ID,LATTICE_fcc_ID])) then
myInteractionMatrix = prm%interactionSlipSlip &
* spread(( 1.0_pReal - prm%linetensionEffect &
+ prm%linetensionEffect &
* log(0.35_pReal * prm%burgers * sqrt(max(stt%rho_forest(:,of),prm%significantRho))) &
/ log(0.35_pReal * prm%burgers * 1e6_pReal))** 2.0_pReal,2,prm%sum_N_sl)
else
myInteractionMatrix = prm%interactionSlipSlip
endif
dst%tau_pass(:,of) = prm%mu * prm%burgers &
* sqrt(matmul(myInteractionMatrix,sum(abs(rho),2)))
!*** calculate the dislocation stress of the neighboring excess dislocation densities
!*** zero for material points of local plasticity
!#################################################################################################
! ToDo: MD: this is most likely only correct for F_i = I
!#################################################################################################
rho0 = getRho0(instance,of,ip,el)
if (.not. phase_localPlasticity(material_phaseAt(1,el)) .and. prm%shortRangeStressCorrection) then
invFp = math_inv33(Fp)
invFe = matmul(Fp,math_inv33(F))
rho_edg_delta = rho0(:,mob_edg_pos) - rho0(:,mob_edg_neg)
rho_scr_delta = rho0(:,mob_scr_pos) - rho0(:,mob_scr_neg)
rhoExcess(1,:) = rho_edg_delta
rhoExcess(2,:) = rho_scr_delta
FVsize = IPvolume(ip,el) ** (1.0_pReal/3.0_pReal)
!* loop through my neighborhood and get the connection vectors (in lattice frame) and the excess densities
nRealNeighbors = 0.0_pReal
neighbor_rhoTotal = 0.0_pReal
do n = 1,nIPneighbors
neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el)
no = material_phasememberAt(1,neighbor_ip,neighbor_el)
if (neighbor_el > 0 .and. neighbor_ip > 0) then
neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
if (neighbor_instance == instance) then
nRealNeighbors = nRealNeighbors + 1.0_pReal
rho_neighbor0 = getRho0(instance,no,neighbor_ip,neighbor_el)
rho_edg_delta_neighbor(:,n) = rho_neighbor0(:,mob_edg_pos) - rho_neighbor0(:,mob_edg_neg)
rho_scr_delta_neighbor(:,n) = rho_neighbor0(:,mob_scr_pos) - rho_neighbor0(:,mob_scr_neg)
neighbor_rhoTotal(1,:,n) = sum(abs(rho_neighbor0(:,edg)),2)
neighbor_rhoTotal(2,:,n) = sum(abs(rho_neighbor0(:,scr)),2)
connection_latticeConf(1:3,n) = matmul(invFe, discretization_IPcoords(1:3,neighbor_el+neighbor_ip-1) &
- discretization_IPcoords(1:3,el+neighbor_ip-1))
normal_latticeConf = matmul(transpose(invFp), IPareaNormal(1:3,n,ip,el))
if (math_inner(normal_latticeConf,connection_latticeConf(1:3,n)) < 0.0_pReal) & ! neighboring connection points in opposite direction to face normal: must be periodic image
connection_latticeConf(1:3,n) = normal_latticeConf * IPvolume(ip,el)/IParea(n,ip,el) ! instead take the surface normal scaled with the diameter of the cell
else
! local neighbor or different lattice structure or different constitution instance -> use central values instead
connection_latticeConf(1:3,n) = 0.0_pReal
rho_edg_delta_neighbor(:,n) = rho_edg_delta
rho_scr_delta_neighbor(:,n) = rho_scr_delta
endif
else
! free surface -> use central values instead
connection_latticeConf(1:3,n) = 0.0_pReal
rho_edg_delta_neighbor(:,n) = rho_edg_delta
rho_scr_delta_neighbor(:,n) = rho_scr_delta
endif
enddo
neighbor_rhoExcess(1,:,:) = rho_edg_delta_neighbor
neighbor_rhoExcess(2,:,:) = rho_scr_delta_neighbor
!* loop through the slip systems and calculate the dislocation gradient by
!* 1. interpolation of the excess density in the neighorhood
!* 2. interpolation of the dead dislocation density in the central volume
m(1:3,:,1) = prm%slip_direction
m(1:3,:,2) = -prm%slip_transverse
do s = 1,prm%sum_N_sl
! gradient from interpolation of neighboring excess density ...
do c = 1,2
do dir = 1,3
neighbors(1) = 2 * dir - 1
neighbors(2) = 2 * dir
connections(dir,1:3) = connection_latticeConf(1:3,neighbors(1)) &
- connection_latticeConf(1:3,neighbors(2))
rhoExcessDifferences(dir) = neighbor_rhoExcess(c,s,neighbors(1)) &
- neighbor_rhoExcess(c,s,neighbors(2))
enddo
invConnections = math_inv33(connections)
if (all(dEq0(invConnections))) call IO_error(-1,ext_msg='back stress calculation: inversion error')
rhoExcessGradient(c) = math_inner(m(1:3,s,c), matmul(invConnections,rhoExcessDifferences))
enddo
! ... plus gradient from deads ...
rhoExcessGradient(1) = rhoExcessGradient(1) + sum(rho(s,imm_edg)) / FVsize
rhoExcessGradient(2) = rhoExcessGradient(2) + sum(rho(s,imm_scr)) / FVsize
! ... normalized with the total density ...
rhoTotal(1) = (sum(abs(rho(s,edg))) + sum(neighbor_rhoTotal(1,s,:))) / (1.0_pReal + nRealNeighbors)
rhoTotal(2) = (sum(abs(rho(s,scr))) + sum(neighbor_rhoTotal(2,s,:))) / (1.0_pReal + nRealNeighbors)
rhoExcessGradient_over_rho = 0.0_pReal
where(rhoTotal > 0.0_pReal) rhoExcessGradient_over_rho = rhoExcessGradient / rhoTotal
! ... gives the local stress correction when multiplied with a factor
dst%tau_back(s,of) = - prm%mu * prm%burgers(s) / (2.0_pReal * PI) &
* ( rhoExcessGradient_over_rho(1) / (1.0_pReal - prm%nu) &
+ rhoExcessGradient_over_rho(2))
enddo
endif
# 721 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
end associate
end subroutine plastic_nonlocal_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief calculates plastic velocity gradient and its tangent
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, &
Mp,Temperature,instance,of,ip,el)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
real(pReal), intent(in) :: &
Temperature !< temperature
real(pReal), dimension(3,3), intent(in) :: &
Mp
!< derivative of Lp with respect to Mp
integer :: &
ns, & !< short notation for the total number of active slip systems
i, &
j, &
k, &
l, &
t, & !< dislocation type
s !< index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,8) :: &
rhoSgl !< single dislocation densities (including blocked)
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v, & !< velocity
tauNS, & !< resolved shear stress including non Schmid and backstress terms
dv_dtau, & !< velocity derivative with respect to the shear stress
dv_dtauNS !< velocity derivative with respect to the shear stress
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, & !< resolved shear stress including backstress terms
gdotTotal !< shear rate
associate(prm => param(instance),dst=>microstructure(instance),stt=>state(instance))
ns = prm%sum_N_sl
!*** shortcut to state variables
rho = getRho(instance,of,ip,el)
rhoSgl = rho(:,sgl)
do s = 1,ns
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s))
tauNS(s,1) = tau(s)
tauNS(s,2) = tau(s)
if (tau(s) > 0.0_pReal) then
tauNS(s,3) = math_tensordot(Mp, +prm%nonSchmid_pos(1:3,1:3,s))
tauNS(s,4) = math_tensordot(Mp, -prm%nonSchmid_neg(1:3,1:3,s))
else
tauNS(s,3) = math_tensordot(Mp, +prm%nonSchmid_neg(1:3,1:3,s))
tauNS(s,4) = math_tensordot(Mp, -prm%nonSchmid_pos(1:3,1:3,s))
endif
enddo
tauNS = tauNS + spread(dst%tau_back(:,of),2,4)
tau = tau + dst%tau_back(:,of)
! edges
call kinetics(v(:,1), dv_dtau(:,1), dv_dtauNS(:,1), &
tau, tauNS(:,1), dst%tau_pass(:,of),1,Temperature, instance)
v(:,2) = v(:,1)
dv_dtau(:,2) = dv_dtau(:,1)
dv_dtauNS(:,2) = dv_dtauNS(:,1)
!screws
if (prm%nonSchmidActive) then
v(:,3:4) = spread(v(:,1),2,2)
dv_dtau(:,3:4) = spread(dv_dtau(:,1),2,2)
dv_dtauNS(:,3:4) = spread(dv_dtauNS(:,1),2,2)
else
do t = 3,4
call kinetics(v(:,t), dv_dtau(:,t), dv_dtauNS(:,t), &
tau, tauNS(:,t), dst%tau_pass(:,of),2,Temperature, instance)
enddo
endif
stt%v(:,of) = pack(v,.true.)
!*** Bauschinger effect
forall (s = 1:ns, t = 5:8, rhoSgl(s,t) * v(s,t-4) < 0.0_pReal) &
rhoSgl(s,t-4) = rhoSgl(s,t-4) + abs(rhoSgl(s,t))
gdotTotal = sum(rhoSgl(:,1:4) * v, 2) * prm%burgers
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
do s = 1,ns
Lp = Lp + gdotTotal(s) * prm%Schmid(1:3,1:3,s)
forall (i=1:3,j=1:3,k=1:3,l=1:3) &
dLp_dMp(i,j,k,l) = dLp_dMp(i,j,k,l) &
+ prm%Schmid(i,j,s) * prm%Schmid(k,l,s) &
* sum(rhoSgl(s,1:4) * dv_dtau(s,1:4)) * prm%burgers(s) &
+ prm%Schmid(i,j,s) &
* ( prm%nonSchmid_pos(k,l,s) * rhoSgl(s,3) * dv_dtauNS(s,3) &
- prm%nonSchmid_neg(k,l,s) * rhoSgl(s,4) * dv_dtauNS(s,4)) * prm%burgers(s)
enddo
end associate
end subroutine plastic_nonlocal_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief (instantaneous) incremental change of microstructure
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_deltaState(Mp,instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< MandelStress
integer, intent(in) :: &
instance, & ! current instance of this plasticity
of, & !< offset
ip, &
el
integer :: &
ph, & !< phase
ns, & ! short notation for the total number of active slip systems
c, & ! character of dislocation
t, & ! type of dislocation
s ! index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
deltaRhoRemobilization, & ! density increment by remobilization
deltaRhoDipole2SingleStress ! density increment by dipole dissociation (by stress change)
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho ! current dislocation densities
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v ! dislocation glide velocity
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau ! current resolved shear stress
real(pReal), dimension(param(instance)%sum_N_sl,2) :: &
rhoDip, & ! current dipole dislocation densities (screw and edge dipoles)
dUpper, & ! current 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
ph = material_phaseAt(1,el)
associate(prm => param(instance),dst => microstructure(instance),del => deltaState(instance))
ns = prm%sum_N_sl
!*** shortcut to state variables
forall (s = 1:ns, t = 1:4) v(s,t) = plasticState(ph)%state(iV(s,t,instance),of)
forall (s = 1:ns, c = 1:2) dUpperOld(s,c) = plasticState(ph)%state(iD(s,c,instance),of)
rho = getRho(instance,of,ip,el)
rhoDip = rho(:,dip)
!****************************************************************************
!*** dislocation remobilization (bauschinger effect)
where(rho(:,imm) * v < 0.0_pReal)
deltaRhoRemobilization(:,mob) = abs(rho(:,imm))
deltaRhoRemobilization(:,imm) = - rho(:,imm)
rho(:,mob) = rho(:,mob) + abs(rho(:,imm))
rho(:,imm) = 0.0_pReal
elsewhere
deltaRhoRemobilization(:,mob) = 0.0_pReal
deltaRhoRemobilization(:,imm) = 0.0_pReal
endwhere
deltaRhoRemobilization(:,dip) = 0.0_pReal
!****************************************************************************
!*** calculate dipole formation and dissociation by stress change
!*** calculate limits for stable dipole height
do s = 1,prm%sum_N_sl
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s)) +dst%tau_back(s,of)
if (abs(tau(s)) < 1.0e-15_pReal) tau(s) = 1.0e-15_pReal
enddo
dUpper(:,1) = prm%mu * prm%burgers/(8.0_pReal * PI * (1.0_pReal - prm%nu) * abs(tau))
dUpper(:,2) = prm%mu * prm%burgers/(4.0_pReal * PI * abs(tau))
where(dNeq0(sqrt(sum(abs(rho(:,edg)),2)))) &
dUpper(:,1) = min(1.0_pReal/sqrt(sum(abs(rho(:,edg)),2)),dUpper(:,1))
where(dNeq0(sqrt(sum(abs(rho(:,scr)),2)))) &
dUpper(:,2) = min(1.0_pReal/sqrt(sum(abs(rho(:,scr)),2)),dUpper(:,2))
dUpper = max(dUpper,prm%minDipoleHeight)
deltaDUpper = dUpper - dUpperOld
!*** dissociation by stress increase
deltaRhoDipole2SingleStress = 0.0_pReal
forall (c=1:2, s=1:ns, deltaDUpper(s,c) < 0.0_pReal .and. &
dNeq0(dUpperOld(s,c) - prm%minDipoleHeight(s,c))) &
deltaRhoDipole2SingleStress(s,8+c) = rhoDip(s,c) * deltaDUpper(s,c) &
/ (dUpperOld(s,c) - prm%minDipoleHeight(s,c))
forall (t=1:4) deltaRhoDipole2SingleStress(:,t) = -0.5_pReal * deltaRhoDipole2SingleStress(:,(t-1)/2+9)
forall (s = 1:ns, c = 1:2) plasticState(ph)%state(iD(s,c,instance),of) = dUpper(s,c)
plasticState(ph)%deltaState(:,of) = 0.0_pReal
del%rho(:,of) = reshape(deltaRhoRemobilization + deltaRhoDipole2SingleStress, [10*ns])
# 936 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
end associate
end subroutine plastic_nonlocal_deltaState
!---------------------------------------------------------------------------------------------------
!> @brief calculates the rate of change of microstructure
!---------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_dotState(Mp, F, Fp, Temperature,timestep, &
instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< MandelStress
real(pReal), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem), intent(in) :: &
F, & !< elastic deformation gradient
Fp !< plastic deformation gradient
real(pReal), intent(in) :: &
Temperature, & !< temperature
timestep !< substepped crystallite time increment
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
integer :: &
ph, &
neighbor_instance, & !< instance of my neighbor's plasticity
ns, & !< short notation for the total number of active slip systems
c, & !< character of dislocation
n, & !< index of my current neighbor
neighbor_el, & !< element number of my neighbor
neighbor_ip, & !< integration point of my neighbor
neighbor_n, & !< neighbor index pointing to me when looking from my neighbor
opposite_neighbor, & !< index of my opposite neighbor
opposite_ip, & !< ip of my opposite neighbor
opposite_el, & !< element index of my opposite neighbor
opposite_n, & !< neighbor index pointing to me when looking from my opposite neighbor
t, & !< type of dislocation
no,& !< neighbor offset shortcut
np,& !< neighbor phase shortcut
topp, & !< type of dislocation with opposite sign to t
s !< index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho, &
rho0, & !< dislocation density at beginning of time step
rhoDot, & !< density evolution
rhoDotMultiplication, & !< density evolution by multiplication
rhoDotFlux, & !< density evolution by flux
rhoDotSingle2DipoleGlide, & !< density evolution by dipole formation (by glide)
rhoDotAthermalAnnihilation, & !< density evolution by athermal annihilation
rhoDotThermalAnnihilation !< density evolution by thermal annihilation
real(pReal), dimension(param(instance)%sum_N_sl,8) :: &
rhoSgl, & !< current single dislocation densities (positive/negative screw and edge without dipoles)
neighbor_rhoSgl0, & !< current single dislocation densities of neighboring ip (positive/negative screw and edge without dipoles)
my_rhoSgl0 !< single dislocation densities of central ip (positive/negative screw and edge without dipoles)
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v, & !< current dislocation glide velocity
v0, &
neighbor_v0, & !< dislocation glide velocity of enighboring ip
gdot !< shear rates
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, & !< current resolved shear stress
vClimb !< climb velocity of edge dipoles
real(pReal), dimension(param(instance)%sum_N_sl,2) :: &
rhoDip, & !< current dipole dislocation densities (screw and edge dipoles)
dLower, & !< minimum stable dipole distance for edges and screws
dUpper !< current maximum stable dipole distance for edges and screws
real(pReal), dimension(3,param(instance)%sum_N_sl,4) :: &
m !< direction of dislocation motion
real(pReal), dimension(3,3) :: &
my_F, & !< my total deformation gradient
neighbor_F, & !< total deformation gradient of my neighbor
my_Fe, & !< my elastic deformation gradient
neighbor_Fe, & !< elastic deformation gradient of my neighbor
Favg !< average total deformation gradient of me and my neighbor
real(pReal), dimension(3) :: &
normal_neighbor2me, & !< interface normal pointing from my neighbor to me in neighbor's lattice configuration
normal_neighbor2me_defConf, & !< interface normal pointing from my neighbor to me in shared deformed configuration
normal_me2neighbor, & !< interface normal pointing from me to my neighbor in my lattice configuration
normal_me2neighbor_defConf !< interface normal pointing from me to my neighbor in shared deformed configuration
real(pReal) :: &
area, & !< area of the current interface
transmissivity, & !< overall transmissivity of dislocation flux to neighboring material point
lineLength, & !< dislocation line length leaving the current interface
selfDiffusion !< self diffusion
ph = material_phaseAt(1,el)
if (timestep <= 0.0_pReal) then
plasticState(ph)%dotState = 0.0_pReal
return
endif
associate(prm => param(instance), &
dst => microstructure(instance), &
dot => dotState(instance), &
stt => state(instance))
ns = prm%sum_N_sl
tau = 0.0_pReal
gdot = 0.0_pReal
rho = getRho(instance,of,ip,el)
rhoSgl = rho(:,sgl)
rhoDip = rho(:,dip)
rho0 = getRho0(instance,of,ip,el)
my_rhoSgl0 = rho0(:,sgl)
forall (s = 1:ns, t = 1:4) v(s,t) = plasticState(ph)%state(iV(s,t,instance),of)
gdot = rhoSgl(:,1:4) * v * spread(prm%burgers,2,4)
# 1056 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
!****************************************************************************
!*** limits for stable dipole height
do s = 1,ns
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s)) + dst%tau_back(s,of)
if (abs(tau(s)) < 1.0e-15_pReal) tau(s) = 1.0e-15_pReal
enddo
dLower = prm%minDipoleHeight
dUpper(:,1) = prm%mu * prm%burgers/(8.0_pReal * PI * (1.0_pReal - prm%nu) * abs(tau))
dUpper(:,2) = prm%mu * prm%burgers/(4.0_pReal * PI * abs(tau))
where(dNeq0(sqrt(sum(abs(rho(:,edg)),2)))) &
dUpper(:,1) = min(1.0_pReal/sqrt(sum(abs(rho(:,edg)),2)),dUpper(:,1))
where(dNeq0(sqrt(sum(abs(rho(:,scr)),2)))) &
dUpper(:,2) = min(1.0_pReal/sqrt(sum(abs(rho(:,scr)),2)),dUpper(:,2))
dUpper = max(dUpper,dLower)
!****************************************************************************
!*** dislocation multiplication
rhoDotMultiplication = 0.0_pReal
isBCC: if (lattice_structure(ph) == LATTICE_bcc_ID) then
forall (s = 1:ns, sum(abs(v(s,1:4))) > 0.0_pReal)
rhoDotMultiplication(s,1:2) = sum(abs(gdot(s,3:4))) / prm%burgers(s) & ! assuming double-cross-slip of screws to be decisive for multiplication
* sqrt(stt%rho_forest(s,of)) / prm%lambda0(s) ! & ! mean free path
! * 2.0_pReal * sum(abs(v(s,3:4))) / sum(abs(v(s,1:4))) ! ratio of screw to overall velocity determines edge generation
rhoDotMultiplication(s,3:4) = sum(abs(gdot(s,3:4))) /prm%burgers(s) & ! assuming double-cross-slip of screws to be decisive for multiplication
* sqrt(stt%rho_forest(s,of)) / prm%lambda0(s) ! & ! mean free path
! * 2.0_pReal * sum(abs(v(s,1:2))) / sum(abs(v(s,1:4))) ! ratio of edge to overall velocity determines screw generation
endforall
else isBCC
rhoDotMultiplication(:,1:4) = spread( &
(sum(abs(gdot(:,1:2)),2) * prm%fEdgeMultiplication + sum(abs(gdot(:,3:4)),2)) &
* sqrt(stt%rho_forest(:,of)) / prm%lambda0 / prm%burgers, 2, 4)
endif isBCC
forall (s = 1:ns, t = 1:4) v0(s,t) = plasticState(ph)%state0(iV(s,t,instance),of)
!****************************************************************************
!*** calculate dislocation fluxes (only for nonlocal plasticity)
rhoDotFlux = 0.0_pReal
if (.not. phase_localPlasticity(material_phaseAt(1,el))) then
!*** check CFL (Courant-Friedrichs-Lewy) condition for flux
if (any( abs(gdot) > 0.0_pReal & ! any active slip system ...
.and. prm%CFLfactor * abs(v0) * timestep &
> IPvolume(ip,el) / maxval(IParea(:,ip,el)))) then ! ...with velocity above critical value (we use the reference volume and area for simplicity here)
# 1116 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
plasticState(ph)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN) ! -> return NaN and, hence, enforce cutback
return
endif
!*** be aware of the definition of slip_transverse = slip_direction x slip_normal !!!
!*** opposite sign to our t vector in the (s,t,n) triplet !!!
m(1:3,:,1) = prm%slip_direction
m(1:3,:,2) = -prm%slip_direction
m(1:3,:,3) = -prm%slip_transverse
m(1:3,:,4) = prm%slip_transverse
my_F = F(1:3,1:3,1,ip,el)
my_Fe = matmul(my_F, math_inv33(Fp(1:3,1:3,1,ip,el)))
neighbors: do n = 1,nIPneighbors
neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el)
neighbor_n = IPneighborhood(3,n,ip,el)
np = material_phaseAt(1,neighbor_el)
no = material_phasememberAt(1,neighbor_ip,neighbor_el)
opposite_neighbor = n + mod(n,2) - mod(n+1,2)
opposite_el = IPneighborhood(1,opposite_neighbor,ip,el)
opposite_ip = IPneighborhood(2,opposite_neighbor,ip,el)
opposite_n = IPneighborhood(3,opposite_neighbor,ip,el)
if (neighbor_n > 0) then ! if neighbor exists, average deformation gradient
neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
neighbor_F = F(1:3,1:3,1,neighbor_ip,neighbor_el)
neighbor_Fe = matmul(neighbor_F, math_inv33(Fp(1:3,1:3,1,neighbor_ip,neighbor_el)))
Favg = 0.5_pReal * (my_F + neighbor_F)
else ! if no neighbor, take my value as average
Favg = my_F
endif
neighbor_v0 = 0.0_pReal ! needed for check of sign change in flux density below
!* FLUX FROM MY NEIGHBOR TO ME
!* This is only considered, if I have a neighbor of nonlocal plasticity
!* (also nonlocal constitutive law with local properties) that is at least a little bit
!* compatible.
!* If it's not at all compatible, no flux is arriving, because everything is dammed in front of
!* my neighbor's interface.
!* The entering flux from my neighbor will be distributed on my slip systems according to the
!* compatibility
if (neighbor_n > 0) then
if (phase_plasticity(material_phaseAt(1,neighbor_el)) == PLASTICITY_NONLOCAL_ID .and. &
any(compatibility(:,:,:,n,ip,el) > 0.0_pReal)) then
forall (s = 1:ns, t = 1:4)
neighbor_v0(s,t) = plasticState(np)%state0(iV (s,t,neighbor_instance),no)
neighbor_rhoSgl0(s,t) = max(plasticState(np)%state0(iRhoU(s,t,neighbor_instance),no),0.0_pReal)
endforall
where (neighbor_rhoSgl0 * IPvolume(neighbor_ip,neighbor_el) ** 0.667_pReal < prm%significantN &
.or. neighbor_rhoSgl0 < prm%significantRho) &
neighbor_rhoSgl0 = 0.0_pReal
normal_neighbor2me_defConf = math_det33(Favg) * matmul(math_inv33(transpose(Favg)), &
IPareaNormal(1:3,neighbor_n,neighbor_ip,neighbor_el)) ! normal of the interface in (average) deformed configuration (pointing neighbor => me)
normal_neighbor2me = matmul(transpose(neighbor_Fe), normal_neighbor2me_defConf) &
/ math_det33(neighbor_Fe) ! interface normal in the lattice configuration of my neighbor
area = IParea(neighbor_n,neighbor_ip,neighbor_el) * norm2(normal_neighbor2me)
normal_neighbor2me = normal_neighbor2me / norm2(normal_neighbor2me) ! normalize the surface normal to unit length
do s = 1,ns
do t = 1,4
c = (t + 1) / 2
topp = t + mod(t,2) - mod(t+1,2)
if (neighbor_v0(s,t) * math_inner(m(1:3,s,t), normal_neighbor2me) > 0.0_pReal & ! flux from my neighbor to me == entering flux for me
.and. v0(s,t) * neighbor_v0(s,t) >= 0.0_pReal ) then ! ... only if no sign change in flux density
lineLength = neighbor_rhoSgl0(s,t) * neighbor_v0(s,t) &
* math_inner(m(1:3,s,t), normal_neighbor2me) * area ! positive line length that wants to enter through this interface
where (compatibility(c,:,s,n,ip,el) > 0.0_pReal) &
rhoDotFlux(:,t) = rhoDotFlux(1:ns,t) &
+ lineLength/IPvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_pReal ! transferring to equally signed mobile dislocation type
where (compatibility(c,:,s,n,ip,el) < 0.0_pReal) &
rhoDotFlux(:,topp) = rhoDotFlux(:,topp) &
+ lineLength/IPvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_pReal ! transferring to opposite signed mobile dislocation type
endif
enddo
enddo
endif; endif
!* FLUX FROM ME TO MY NEIGHBOR
!* This is not considered, if my opposite neighbor has a different constitutive law than nonlocal (still considered for nonlocal law with local properties).
!* Then, we assume, that the opposite(!) neighbor sends an equal amount of dislocations to me.
!* So the net flux in the direction of my neighbor is equal to zero:
!* leaving flux to neighbor == entering flux from opposite neighbor
!* In case of reduced transmissivity, part of the leaving flux is stored as dead dislocation density.
!* That means for an interface of zero transmissivity the leaving flux is fully converted to dead dislocations.
if (opposite_n > 0) then
if (phase_plasticity(material_phaseAt(1,opposite_el)) == PLASTICITY_NONLOCAL_ID) then
normal_me2neighbor_defConf = math_det33(Favg) &
* matmul(math_inv33(transpose(Favg)),IPareaNormal(1:3,n,ip,el)) ! normal of the interface in (average) deformed configuration (pointing me => neighbor)
normal_me2neighbor = matmul(transpose(my_Fe), normal_me2neighbor_defConf) &
/ math_det33(my_Fe) ! interface normal in my lattice configuration
area = IParea(n,ip,el) * norm2(normal_me2neighbor)
normal_me2neighbor = normal_me2neighbor / norm2(normal_me2neighbor) ! normalize the surface normal to unit length
do s = 1,ns
do t = 1,4
c = (t + 1) / 2
if (v0(s,t) * math_inner(m(1:3,s,t), normal_me2neighbor) > 0.0_pReal ) then ! flux from me to my neighbor == leaving flux for me (might also be a pure flux from my mobile density to dead density if interface not at all transmissive)
if (v0(s,t) * neighbor_v0(s,t) >= 0.0_pReal) then ! no sign change in flux density
transmissivity = sum(compatibility(c,:,s,n,ip,el)**2.0_pReal) ! overall transmissivity from this slip system to my neighbor
else ! sign change in flux density means sign change in stress which does not allow for dislocations to arive at the neighbor
transmissivity = 0.0_pReal
endif
lineLength = my_rhoSgl0(s,t) * v0(s,t) &
* math_inner(m(1:3,s,t), normal_me2neighbor) * area ! positive line length of mobiles that wants to leave through this interface
rhoDotFlux(s,t) = rhoDotFlux(s,t) - lineLength / IPvolume(ip,el) ! subtract dislocation flux from current type
rhoDotFlux(s,t+4) = rhoDotFlux(s,t+4) &
+ lineLength / IPvolume(ip,el) * (1.0_pReal - transmissivity) &
* sign(1.0_pReal, v0(s,t)) ! dislocation flux that is not able to leave through interface (because of low transmissivity) will remain as immobile single density at the material point
endif
enddo
enddo
endif; endif
enddo neighbors
endif
!****************************************************************************
!*** calculate dipole formation and annihilation
!*** formation by glide
do c = 1,2
rhoDotSingle2DipoleGlide(:,2*c-1) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* ( rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) & ! negative mobile --> positive mobile
+ rhoSgl(:,2*c) * abs(gdot(:,2*c-1)) & ! positive mobile --> negative mobile
+ abs(rhoSgl(:,2*c+4)) * abs(gdot(:,2*c-1))) ! positive mobile --> negative immobile
rhoDotSingle2DipoleGlide(:,2*c) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* ( rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) & ! negative mobile --> positive mobile
+ rhoSgl(:,2*c) * abs(gdot(:,2*c-1)) & ! positive mobile --> negative mobile
+ abs(rhoSgl(:,2*c+3)) * abs(gdot(:,2*c))) ! negative mobile --> positive immobile
rhoDotSingle2DipoleGlide(:,2*c+3) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* rhoSgl(:,2*c+3) * abs(gdot(:,2*c)) ! negative mobile --> positive immobile
rhoDotSingle2DipoleGlide(:,2*c+4) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* rhoSgl(:,2*c+4) * abs(gdot(:,2*c-1)) ! positive mobile --> negative immobile
rhoDotSingle2DipoleGlide(:,c+8) = abs(rhoDotSingle2DipoleGlide(:,2*c+3)) &
+ abs(rhoDotSingle2DipoleGlide(:,2*c+4)) &
- rhoDotSingle2DipoleGlide(:,2*c-1) &
- rhoDotSingle2DipoleGlide(:,2*c)
enddo
!*** athermal annihilation
rhoDotAthermalAnnihilation = 0.0_pReal
forall (c=1:2) &
rhoDotAthermalAnnihilation(:,c+8) = -2.0_pReal * dLower(:,c) / prm%burgers &
* ( 2.0_pReal * (rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) + rhoSgl(:,2*c) * abs(gdot(:,2*c-1))) & ! was single hitting single
+ 2.0_pReal * (abs(rhoSgl(:,2*c+3)) * abs(gdot(:,2*c)) + abs(rhoSgl(:,2*c+4)) * abs(gdot(:,2*c-1))) & ! was single hitting immobile single or was immobile single hit by single
+ rhoDip(:,c) * (abs(gdot(:,2*c-1)) + abs(gdot(:,2*c)))) ! single knocks dipole constituent
! annihilated screw dipoles leave edge jogs behind on the colinear system
if (lattice_structure(ph) == LATTICE_fcc_ID) &
forall (s = 1:ns, prm%colinearSystem(s) > 0) &
rhoDotAthermalAnnihilation(prm%colinearSystem(s),1:2) = - rhoDotAthermalAnnihilation(s,10) &
* 0.25_pReal * sqrt(stt%rho_forest(s,of)) * (dUpper(s,2) + dLower(s,2)) * prm%edgeJogFactor
!*** thermally activated annihilation of edge dipoles by climb
rhoDotThermalAnnihilation = 0.0_pReal
selfDiffusion = prm%Dsd0 * exp(-prm%selfDiffusionEnergy / (kB * Temperature))
vClimb = prm%atomicVolume * selfDiffusion * prm%mu &
/ ( kB * Temperature * PI * (1.0_pReal-prm%nu) * (dUpper(:,1) + dLower(:,1)))
forall (s = 1:ns, dUpper(s,1) > dLower(s,1)) &
rhoDotThermalAnnihilation(s,9) = max(- 4.0_pReal * rhoDip(s,1) * vClimb(s) / (dUpper(s,1) - dLower(s,1)), &
- rhoDip(s,1) / timestep - rhoDotAthermalAnnihilation(s,9) &
- rhoDotSingle2DipoleGlide(s,9)) ! make sure that we do not annihilate more dipoles than we have
rhoDot = rhoDotFlux &
+ rhoDotMultiplication &
+ rhoDotSingle2DipoleGlide &
+ rhoDotAthermalAnnihilation &
+ rhoDotThermalAnnihilation
# 1325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
if ( any(rho(:,mob) + rhoDot(:,1:4) * timestep < -prm%atol_rho) &
.or. any(rho(:,dip) + rhoDot(:,9:10) * timestep < -prm%atol_rho)) then
plasticState(ph)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN)
else
dot%rho(:,of) = pack(rhoDot,.true.)
dot%gamma(:,of) = sum(gdot,2)
endif
end associate
end subroutine plastic_nonlocal_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Compatibility update
!> @detail Compatibility is defined as normalized product of signed cosine of the angle between the slip
! plane normals and signed cosine of the angle between the slip directions. Only the largest values
! that sum up to a total of 1 are considered, all others are set to zero.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_updateCompatibility(orientation,instance,i,e)
type(rotation), dimension(1,discretization_nIP,discretization_nElem), intent(in) :: &
orientation ! crystal orientation
integer, intent(in) :: &
instance, &
i, &
e
integer :: &
n, & ! neighbor index
neighbor_e, & ! element index of my neighbor
neighbor_i, & ! integration point index of my neighbor
ph, &
neighbor_phase, &
ns, & ! number of active slip systems
s1, & ! slip system index (me)
s2 ! slip system index (my neighbor)
real(pReal), dimension(2,param(instance)%sum_N_sl,param(instance)%sum_N_sl,nIPneighbors) :: &
my_compatibility ! my_compatibility for current element and ip
real(pReal) :: &
my_compatibilitySum, &
thresholdValue, &
nThresholdValues
logical, dimension(param(instance)%sum_N_sl) :: &
belowThreshold
type(rotation) :: mis
ph = material_phaseAt(1,e)
associate(prm => param(instance))
ns = prm%sum_N_sl
!*** start out fully compatible
my_compatibility = 0.0_pReal
forall(s1 = 1:ns) my_compatibility(:,s1,s1,:) = 1.0_pReal
neighbors: do n = 1,nIPneighbors
neighbor_e = IPneighborhood(1,n,i,e)
neighbor_i = IPneighborhood(2,n,i,e)
neighbor_phase = material_phaseAt(1,neighbor_e)
if (neighbor_e <= 0 .or. neighbor_i <= 0) then
!* FREE SURFACE
!* Set surface transmissivity to the value specified in the material.config
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%surfaceTransmissivity)
elseif (neighbor_phase /= ph) then
!* PHASE BOUNDARY
!* If we encounter a different nonlocal phase at the neighbor,
!* we consider this to be a real "physical" phase boundary, so completely incompatible.
!* If one of the two phases has a local plasticity law,
!* we do not consider this to be a phase boundary, so completely compatible.
if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph)) &
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = 0.0_pReal
elseif (prm%grainboundaryTransmissivity >= 0.0_pReal) then
!* GRAIN BOUNDARY !
!* fixed transmissivity for adjacent ips with different texture (only if explicitly given in material.config)
if (material_texture(1,i,e) /= material_texture(1,neighbor_i,neighbor_e) .and. &
(.not. phase_localPlasticity(neighbor_phase))) &
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%grainboundaryTransmissivity)
else
!* GRAIN BOUNDARY ?
!* Compatibility defined by relative orientation of slip systems:
!* The my_compatibility value is defined as the product of the slip normal projection and the slip direction projection.
!* Its sign is always positive for screws, for edges it has the same sign as the slip normal projection.
!* Since the sum for each slip system can easily exceed one (which would result in a transmissivity larger than one),
!* only values above or equal to a certain threshold value are considered. This threshold value is chosen, such that
!* the number of compatible slip systems is minimized with the sum of the original compatibility values exceeding one.
!* Finally the smallest compatibility value is decreased until the sum is exactly equal to one.
!* All values below the threshold are set to zero.
mis = orientation(1,i,e)%misorientation(orientation(1,neighbor_i,neighbor_e))
mySlipSystems: do s1 = 1,ns
neighborSlipSystems: do s2 = 1,ns
my_compatibility(1,s2,s1,n) = math_inner(prm%slip_normal(1:3,s1), &
mis%rotate(prm%slip_normal(1:3,s2))) &
* abs(math_inner(prm%slip_direction(1:3,s1), &
mis%rotate(prm%slip_direction(1:3,s2))))
my_compatibility(2,s2,s1,n) = abs(math_inner(prm%slip_normal(1:3,s1), &
mis%rotate(prm%slip_normal(1:3,s2)))) &
* abs(math_inner(prm%slip_direction(1:3,s1), &
mis%rotate(prm%slip_direction(1:3,s2))))
enddo neighborSlipSystems
my_compatibilitySum = 0.0_pReal
belowThreshold = .true.
do while (my_compatibilitySum < 1.0_pReal .and. any(belowThreshold))
thresholdValue = maxval(my_compatibility(2,:,s1,n), belowThreshold) ! screws always positive
nThresholdValues = real(count(my_compatibility(2,:,s1,n) >= thresholdValue),pReal)
where (my_compatibility(2,:,s1,n) >= thresholdValue) belowThreshold = .false.
if (my_compatibilitySum + thresholdValue * nThresholdValues > 1.0_pReal) &
where (abs(my_compatibility(:,:,s1,n)) >= thresholdValue) &
my_compatibility(:,:,s1,n) = sign((1.0_pReal - my_compatibilitySum)/nThresholdValues,&
my_compatibility(:,:,s1,n))
my_compatibilitySum = my_compatibilitySum + nThresholdValues * thresholdValue
enddo
where(belowThreshold) my_compatibility(1,:,s1,n) = 0.0_pReal
where(belowThreshold) my_compatibility(2,:,s1,n) = 0.0_pReal
enddo mySlipSystems
endif
enddo neighbors
compatibility(:,:,:,:,i,e) = my_compatibility
end associate
end subroutine plastic_nonlocal_updateCompatibility
!--------------------------------------------------------------------------------------------------
!> @brief writes results to HDF5 output file
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_results(instance,group)
integer, intent(in) :: instance
character(len=*),intent(in) :: group
integer :: o
associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('rho_sgl_mob_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_edg_pos, 'rho_sgl_mob_edg_pos', &
'positive mobile edge density','1/m²')
case('rho_sgl_imm_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_edg_pos, 'rho_sgl_imm_edg_pos',&
'positive immobile edge density','1/m²')
case('rho_sgl_mob_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_edg_neg, 'rho_sgl_mob_edg_neg',&
'negative mobile edge density','1/m²')
case('rho_sgl_imm_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_edg_neg, 'rho_sgl_imm_edg_neg',&
'negative immobile edge density','1/m²')
case('rho_dip_edg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip_edg, 'rho_dip_edg',&
'edge dipole density','1/m²')
case('rho_sgl_mob_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_scr_pos, 'rho_sgl_mob_scr_pos',&
'positive mobile screw density','1/m²')
case('rho_sgl_imm_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_scr_pos, 'rho_sgl_imm_scr_pos',&
'positive immobile screw density','1/m²')
case('rho_sgl_mob_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_scr_neg, 'rho_sgl_mob_scr_neg',&
'negative mobile screw density','1/m²')
case('rho_sgl_imm_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_scr_neg, 'rho_sgl_imm_scr_neg',&
'negative immobile screw density','1/m²')
case('rho_dip_scr')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip_scr, 'rho_dip_scr',&
'screw dipole density','1/m²')
case('rho_forest')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_forest, 'rho_forest',&
'forest density','1/m²')
case('v_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_edg_pos, 'v_edg_pos',&
'positive edge velocity','m/s')
case('v_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_edg_neg, 'v_edg_neg',&
'negative edge velocity','m/s')
case('v_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_scr_pos, 'v_scr_pos',&
'positive srew velocity','m/s')
case('v_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_scr_neg, 'v_scr_neg',&
'negative screw velocity','m/s')
case('gamma')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma,'gamma',&
'plastic shear','1')
case('tau_pass')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')
end select
enddo outputsLoop
end associate
end subroutine plastic_nonlocal_results
!--------------------------------------------------------------------------------------------------
!> @brief populates the initial dislocation density
!--------------------------------------------------------------------------------------------------
subroutine stateInit(ini,phase,NipcMyPhase)
type(tInitialParameters) :: &
ini
integer,intent(in) :: &
phase, &
NipcMyPhase
integer :: &
e, &
i, &
f, &
from, &
upto, &
s, &
instance, &
phasemember
real(pReal), dimension(2) :: &
noise, &
rnd
real(pReal) :: &
meanDensity, &
totalVolume, &
densityBinning, &
minimumIpVolume
real(pReal), dimension(NipcMyPhase) :: &
volume
instance = phase_plasticityInstance(phase)
associate(stt => state(instance))
if (ini%rhoSglRandom > 0.0_pReal) then ! randomly distribute dislocation segments on random slip system and of random type in the volume
do e = 1,discretization_nElem
do i = 1,discretization_nIP
if (material_phaseAt(1,e) == phase) volume(material_phasememberAt(1,i,e)) = IPvolume(i,e)
enddo
enddo
totalVolume = sum(volume)
minimumIPVolume = minval(volume)
densityBinning = ini%rhoSglRandomBinning / minimumIpVolume ** (2.0_pReal / 3.0_pReal)
! fill random material points with dislocation segments until the desired overall density is reached
meanDensity = 0.0_pReal
do while(meanDensity < ini%rhoSglRandom)
call random_number(rnd)
phasemember = nint(rnd(1)*real(NipcMyPhase,pReal) + 0.5_pReal)
s = nint(rnd(2)*real(sum(ini%N_sl),pReal)*4.0_pReal + 0.5_pReal)
meanDensity = meanDensity + densityBinning * volume(phasemember) / totalVolume
stt%rhoSglMobile(s,phasemember) = densityBinning
enddo
else ! homogeneous distribution with noise
do e = 1, NipcMyPhase
do f = 1,size(ini%N_sl,1)
from = 1 + sum(ini%N_sl(1:f-1))
upto = sum(ini%N_sl(1:f))
do s = from,upto
noise = [math_sampleGaussVar(0.0_pReal, ini%rhoSglScatter), &
math_sampleGaussVar(0.0_pReal, ini%rhoSglScatter)]
stt%rho_sgl_mob_edg_pos(s,e) = ini%rhoSglEdgePos0(f) + noise(1)
stt%rho_sgl_mob_edg_neg(s,e) = ini%rhoSglEdgeNeg0(f) + noise(1)
stt%rho_sgl_mob_scr_pos(s,e) = ini%rhoSglScrewPos0(f) + noise(2)
stt%rho_sgl_mob_scr_neg(s,e) = ini%rhoSglScrewNeg0(f) + noise(2)
enddo
stt%rho_dip_edg(from:upto,e) = ini%rhoDipEdge0(f)
stt%rho_dip_scr(from:upto,e) = ini%rhoDipScrew0(f)
enddo
enddo
endif
end associate
end subroutine stateInit
!--------------------------------------------------------------------------------------------------
!> @brief calculates kinetics
!--------------------------------------------------------------------------------------------------
subroutine kinetics(v, dv_dtau, dv_dtauNS, tau, tauNS, tauThreshold, c, Temperature, instance)
integer, intent(in) :: &
c, & !< dislocation character (1:edge, 2:screw)
instance
real(pReal), intent(in) :: &
Temperature !< temperature
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
tau, & !< resolved external shear stress (without non Schmid effects)
tauNS, & !< resolved external shear stress (including non Schmid effects)
tauThreshold !< threshold shear stress
real(pReal), dimension(param(instance)%sum_N_sl), intent(out) :: &
v, & !< velocity
dv_dtau, & !< velocity derivative with respect to resolved shear stress (without non Schmid contributions)
dv_dtauNS !< velocity derivative with respect to resolved shear stress (including non Schmid contributions)
integer :: &
ns, & !< short notation for the total number of active slip systems
s !< index of my current slip system
real(pReal) :: &
tauRel_P, &
tauRel_S, &
tauEff, & !< effective shear stress
tPeierls, & !< waiting time in front of a peierls barriers
tSolidSolution, & !< waiting time in front of a solid solution obstacle
vViscous, & !< viscous glide velocity
dtPeierls_dtau, & !< derivative with respect to resolved shear stress
dtSolidSolution_dtau, & !< derivative with respect to resolved shear stress
meanfreepath_S, & !< mean free travel distance for dislocations between two solid solution obstacles
meanfreepath_P, & !< mean free travel distance for dislocations between two Peierls barriers
jumpWidth_P, & !< depth of activated area
jumpWidth_S, & !< depth of activated area
activationLength_P, & !< length of activated dislocation line
activationLength_S, & !< length of activated dislocation line
activationVolume_P, & !< volume that needs to be activated to overcome barrier
activationVolume_S, & !< volume that needs to be activated to overcome barrier
activationEnergy_P, & !< energy that is needed to overcome barrier
activationEnergy_S, & !< energy that is needed to overcome barrier
criticalStress_P, & !< maximum obstacle strength
criticalStress_S, & !< maximum obstacle strength
mobility !< dislocation mobility
associate(prm => param(instance))
ns = prm%sum_N_sl
v = 0.0_pReal
dv_dtau = 0.0_pReal
dv_dtauNS = 0.0_pReal
do s = 1,ns
if (abs(tau(s)) > tauThreshold(s)) then
!* Peierls contribution
!* Effective stress includes non Schmid constributions
!* The derivative only gives absolute values; the correct sign is taken care of in the formula for the derivative of the velocity
tauEff = max(0.0_pReal, abs(tauNS(s)) - tauThreshold(s)) ! ensure that the effective stress is positive
meanfreepath_P = prm%burgers(s)
jumpWidth_P = prm%burgers(s)
activationLength_P = prm%doublekinkwidth *prm%burgers(s)
activationVolume_P = activationLength_P * jumpWidth_P * prm%burgers(s)
criticalStress_P = prm%peierlsStress(s,c)
activationEnergy_P = criticalStress_P * activationVolume_P
tauRel_P = min(1.0_pReal, tauEff / criticalStress_P) ! ensure that the activation probability cannot become greater than one
tPeierls = 1.0_pReal / prm%fattack &
* exp(activationEnergy_P / (kB * Temperature) &
* (1.0_pReal - tauRel_P**prm%p)**prm%q)
if (tauEff < criticalStress_P) then
dtPeierls_dtau = tPeierls * prm%p * prm%q * activationVolume_P / (kB * Temperature) &
* (1.0_pReal - tauRel_P**prm%p)**(prm%q-1.0_pReal) * tauRel_P**(prm%p-1.0_pReal)
else
dtPeierls_dtau = 0.0_pReal
endif
!* Contribution from solid solution strengthening
!* The derivative only gives absolute values; the correct sign is taken care of in the formula for the derivative of the velocity
tauEff = abs(tau(s)) - tauThreshold(s)
meanfreepath_S = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
jumpWidth_S = prm%solidSolutionSize * prm%burgers(s)
activationLength_S = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
activationVolume_S = activationLength_S * jumpWidth_S * prm%burgers(s)
activationEnergy_S = prm%solidSolutionEnergy
criticalStress_S = activationEnergy_S / activationVolume_S
tauRel_S = min(1.0_pReal, tauEff / criticalStress_S) ! ensure that the activation probability cannot become greater than one
tSolidSolution = 1.0_pReal / prm%fattack &
* exp(activationEnergy_S / (kB * Temperature)* (1.0_pReal - tauRel_S**prm%p)**prm%q)
if (tauEff < criticalStress_S) then
dtSolidSolution_dtau = tSolidSolution * prm%p * prm%q * activationVolume_S / (kB * Temperature) &
* (1.0_pReal - tauRel_S**prm%p)**(prm%q-1.0_pReal)* tauRel_S**(prm%p-1.0_pReal)
else
dtSolidSolution_dtau = 0.0_pReal
endif
!* viscous glide velocity
tauEff = abs(tau(s)) - tauThreshold(s)
mobility = prm%burgers(s) / prm%viscosity
vViscous = mobility * tauEff
!* Mean velocity results from waiting time at peierls barriers and solid solution obstacles with respective meanfreepath of
!* free flight at glide velocity in between.
!* adopt sign from resolved stress
v(s) = sign(1.0_pReal,tau(s)) &
/ (tPeierls / meanfreepath_P + tSolidSolution / meanfreepath_S + 1.0_pReal / vViscous)
dv_dtau(s) = v(s)**2.0_pReal * (dtSolidSolution_dtau / meanfreepath_S + mobility /vViscous**2.0_pReal)
dv_dtauNS(s) = v(s)**2.0_pReal * dtPeierls_dtau / meanfreepath_P
endif
enddo
end associate
end subroutine kinetics
!--------------------------------------------------------------------------------------------------
!> @brief returns copy of current dislocation densities from state
!> @details raw values is rectified
!--------------------------------------------------------------------------------------------------
function getRho(instance,of,ip,el)
integer, intent(in) :: instance, of,ip,el
real(pReal), dimension(param(instance)%sum_N_sl,10) :: getRho
associate(prm => param(instance))
getRho = reshape(state(instance)%rho(:,of),[prm%sum_N_sl,10])
! ensure positive densities (not for imm, they have a sign)
getRho(:,mob) = max(getRho(:,mob),0.0_pReal)
getRho(:,dip) = max(getRho(:,dip),0.0_pReal)
where(abs(getRho) < max(prm%significantN/IPvolume(ip,el)**(2.0_pReal/3.0_pReal),prm%significantRho)) &
getRho = 0.0_pReal
end associate
end function getRho
!--------------------------------------------------------------------------------------------------
!> @brief returns copy of current dislocation densities from state
!> @details raw values is rectified
!--------------------------------------------------------------------------------------------------
function getRho0(instance,of,ip,el)
integer, intent(in) :: instance, of,ip,el
real(pReal), dimension(param(instance)%sum_N_sl,10) :: getRho0
associate(prm => param(instance))
getRho0 = reshape(state0(instance)%rho(:,of),[prm%sum_N_sl,10])
! ensure positive densities (not for imm, they have a sign)
getRho0(:,mob) = max(getRho0(:,mob),0.0_pReal)
getRho0(:,dip) = max(getRho0(:,dip),0.0_pReal)
where(abs(getRho0) < max(prm%significantN/IPvolume(ip,el)**(2.0_pReal/3.0_pReal),prm%significantRho)) &
getRho0 = 0.0_pReal
end associate
end function getRho0
end submodule plastic_nonlocal
# 44 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
!> @author Chen Zhang, Michigan State University
!> @brief crystallite state integration functions and reporting of results
!--------------------------------------------------------------------------------------------------
module crystallite
use prec
use IO
use HDF5_utilities
use DAMASK_interface
use config
use debug
use numerics
use rotations
use math
use FEsolving
use material
use constitutive
use discretization
use lattice
use results
implicit none
private
real(pReal), dimension(:,:,:), allocatable, public :: &
crystallite_dt !< requested time increment of each grain
real(pReal), dimension(:,:,:), allocatable :: &
crystallite_subdt, & !< substepped time increment of each grain
crystallite_subFrac, & !< already calculated fraction of increment
crystallite_subStep !< size of next integration step
type(rotation), dimension(:,:,:), allocatable :: &
crystallite_orientation !< current orientation
real(pReal), dimension(:,:,:,:,:), allocatable, public, protected :: &
crystallite_Fe, & !< current "elastic" def grad (end of converged time step)
crystallite_P, & !< 1st Piola-Kirchhoff stress per grain
crystallite_S0, & !< 2nd Piola-Kirchhoff stress vector at start of FE inc
crystallite_Fp0, & !< plastic def grad at start of FE inc
crystallite_Fi0, & !< intermediate def grad at start of FE inc
crystallite_F0, & !< def grad at start of FE inc
crystallite_Lp0, & !< plastic velocitiy grad at start of FE inc
crystallite_Li0 !< intermediate velocitiy grad at start of FE inc
real(pReal), dimension(:,:,:,:,:), allocatable, public :: &
crystallite_S, & !< current 2nd Piola-Kirchhoff stress vector (end of converged time step)
crystallite_partionedS0, & !< 2nd Piola-Kirchhoff stress vector at start of homog inc
crystallite_Fp, & !< current plastic def grad (end of converged time step)
crystallite_partionedFp0,& !< plastic def grad at start of homog inc
crystallite_Fi, & !< current intermediate def grad (end of converged time step)
crystallite_partionedFi0,& !< intermediate def grad at start of homog inc
crystallite_partionedF, & !< def grad to be reached at end of homog inc
crystallite_partionedF0, & !< def grad at start of homog inc
crystallite_Lp, & !< current plastic velocitiy grad (end of converged time step)
crystallite_partionedLp0, & !< plastic velocity grad at start of homog inc
crystallite_Li, & !< current intermediate velocitiy grad (end of converged time step)
crystallite_partionedLi0 !< intermediate velocity grad at start of homog inc
real(pReal), dimension(:,:,:,:,:), allocatable :: &
crystallite_subFp0,& !< plastic def grad at start of crystallite inc
crystallite_subFi0,& !< intermediate def grad at start of crystallite inc
crystallite_subF, & !< def grad to be reached at end of crystallite inc
crystallite_subF0, & !< def grad at start of crystallite inc
crystallite_subLp0,& !< plastic velocity grad at start of crystallite inc
crystallite_subLi0 !< intermediate velocity grad at start of crystallite inc
real(pReal), dimension(:,:,:,:,:,:,:), allocatable, public, protected :: &
crystallite_dPdF !< current individual dPdF per grain (end of converged time step)
logical, dimension(:,:,:), allocatable, public :: &
crystallite_requested !< used by upper level (homogenization) to request crystallite calculation
logical, dimension(:,:,:), allocatable :: &
crystallite_converged, & !< convergence flag
crystallite_todo, & !< flag to indicate need for further computation
crystallite_localPlasticity !< indicates this grain to have purely local constitutive law
type :: tOutput !< new requested output (per phase)
character(len=pStringLen), allocatable, dimension(:) :: &
label
end type tOutput
type(tOutput), allocatable, dimension(:) :: output_constituent
type :: tNumerics
integer :: &
iJacoLpresiduum, & !< frequency of Jacobian update of residuum in Lp
nState, & !< state loop limit
nStress !< stress loop limit
real(pReal) :: &
subStepMinCryst, & !< minimum (relative) size of sub-step allowed during cutback
subStepSizeCryst, & !< size of first substep when cutback
subStepSizeLp, & !< size of first substep when cutback in Lp calculation
subStepSizeLi, & !< size of first substep when cutback in Li calculation
stepIncreaseCryst, & !< increase of next substep size when previous substep converged
rtol_crystalliteState, & !< relative tolerance in state loop
rtol_crystalliteStress, & !< relative tolerance in stress loop
atol_crystalliteStress !< absolute tolerance in stress loop
end type tNumerics
type(tNumerics) :: num ! numerics parameters. Better name?
procedure(), pointer :: integrateState
public :: &
crystallite_init, &
crystallite_stress, &
crystallite_stressTangent, &
crystallite_orientations, &
crystallite_push33ToRef, &
crystallite_results, &
crystallite_restartWrite, &
crystallite_restartRead, &
crystallite_forward
contains
!--------------------------------------------------------------------------------------------------
!> @brief allocates and initialize per grain variables
!--------------------------------------------------------------------------------------------------
subroutine crystallite_init
logical, dimension(discretization_nIP,discretization_nElem) :: devNull
integer :: &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
cMax, & !< maximum number of integration point components
iMax, & !< maximum number of integration points
eMax, & !< maximum number of elements
myNcomponents !< number of components at current IP
write(6,'(/,a)') ' <<<+- crystallite init -+>>>'
cMax = homogenization_maxNgrains
iMax = discretization_nIP
eMax = discretization_nElem
allocate(crystallite_partionedF(3,3,cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_S0, &
crystallite_F0, crystallite_Fi0,crystallite_Fp0, &
crystallite_Li0,crystallite_Lp0, &
crystallite_partionedS0, &
crystallite_partionedF0,crystallite_partionedFp0,crystallite_partionedFi0, &
crystallite_partionedLp0,crystallite_partionedLi0, &
crystallite_S,crystallite_P, &
crystallite_Fe,crystallite_Fi,crystallite_Fp, &
crystallite_Li,crystallite_Lp, &
crystallite_subF,crystallite_subF0, &
crystallite_subFp0,crystallite_subFi0, &
crystallite_subLi0,crystallite_subLp0, &
source = crystallite_partionedF)
allocate(crystallite_dPdF(3,3,3,3,cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_dt(cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_subdt,crystallite_subFrac,crystallite_subStep, &
source = crystallite_dt)
allocate(crystallite_orientation(cMax,iMax,eMax))
allocate(crystallite_localPlasticity(cMax,iMax,eMax), source=.true.)
allocate(crystallite_requested(cMax,iMax,eMax), source=.false.)
allocate(crystallite_todo(cMax,iMax,eMax), source=.false.)
allocate(crystallite_converged(cMax,iMax,eMax), source=.true.)
num%subStepMinCryst = config_numerics%getFloat('substepmincryst', defaultVal=1.0e-3_pReal)
num%subStepSizeCryst = config_numerics%getFloat('substepsizecryst', defaultVal=0.25_pReal)
num%stepIncreaseCryst = config_numerics%getFloat('stepincreasecryst', defaultVal=1.5_pReal)
num%subStepSizeLp = config_numerics%getFloat('substepsizelp', defaultVal=0.5_pReal)
num%subStepSizeLi = config_numerics%getFloat('substepsizeli', defaultVal=0.5_pReal)
num%rtol_crystalliteState = config_numerics%getFloat('rtol_crystallitestate', defaultVal=1.0e-6_pReal)
num%rtol_crystalliteStress = config_numerics%getFloat('rtol_crystallitestress',defaultVal=1.0e-6_pReal)
num%atol_crystalliteStress = config_numerics%getFloat('atol_crystallitestress',defaultVal=1.0e-8_pReal)
num%iJacoLpresiduum = config_numerics%getInt ('ijacolpresiduum', defaultVal=1)
num%nState = config_numerics%getInt ('nstate', defaultVal=20)
num%nStress = config_numerics%getInt ('nstress', defaultVal=40)
if(num%subStepMinCryst <= 0.0_pReal) call IO_error(301,ext_msg='subStepMinCryst')
if(num%subStepSizeCryst <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeCryst')
if(num%stepIncreaseCryst <= 0.0_pReal) call IO_error(301,ext_msg='stepIncreaseCryst')
if(num%subStepSizeLp <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeLp')
if(num%subStepSizeLi <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeLi')
if(num%rtol_crystalliteState <= 0.0_pReal) call IO_error(301,ext_msg='rtol_crystalliteState')
if(num%rtol_crystalliteStress <= 0.0_pReal) call IO_error(301,ext_msg='rtol_crystalliteStress')
if(num%atol_crystalliteStress <= 0.0_pReal) call IO_error(301,ext_msg='atol_crystalliteStress')
if(num%iJacoLpresiduum < 1) call IO_error(301,ext_msg='iJacoLpresiduum')
if(num%nState < 1) call IO_error(301,ext_msg='nState')
if(num%nStress< 1) call IO_error(301,ext_msg='nStress')
select case(numerics_integrator)
case(1)
integrateState => integrateStateFPI
case(2)
integrateState => integrateStateEuler
case(3)
integrateState => integrateStateAdaptiveEuler
case(4)
integrateState => integrateStateRK4
case(5)
integrateState => integrateStateRKCK45
end select
allocate(output_constituent(size(config_phase)))
do c = 1, size(config_phase)
allocate(output_constituent(c)%label(1))
output_constituent(c)%label(1)= 'GfortranBug86277'
output_constituent(c)%label = config_phase(c)%getStrings('(output)',defaultVal=output_constituent(c)%label )
if (output_constituent(c)%label (1) == 'GfortranBug86277') output_constituent(c)%label = [character(len=pStringLen)::]
enddo
call config_deallocate('material.config/phase')
!--------------------------------------------------------------------------------------------------
! initialize
!$OMP PARALLEL DO PRIVATE(myNcomponents,i,c)
do e = FEsolving_execElem(1),FEsolving_execElem(2)
myNcomponents = homogenization_Ngrains(material_homogenizationAt(e))
do i = FEsolving_execIP(1), FEsolving_execIP(2); do c = 1, myNcomponents
crystallite_Fp0(1:3,1:3,c,i,e) = material_orientation0(c,i,e)%asMatrix() ! plastic def gradient reflects init orientation
crystallite_Fp0(1:3,1:3,c,i,e) = crystallite_Fp0(1:3,1:3,c,i,e) &
/ math_det33(crystallite_Fp0(1:3,1:3,c,i,e))**(1.0_pReal/3.0_pReal)
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_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_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_Fi(1:3,1:3,c,i,e) = crystallite_Fi0(1:3,1:3,c,i,e)
crystallite_requested(c,i,e) = .true.
enddo; enddo
enddo
!$OMP END PARALLEL DO
if(any(.not. crystallite_localPlasticity) .and. .not. usePingPong) call IO_error(601) ! exit if nonlocal but no ping-pong ToDo: Why not check earlier? or in nonlocal?
crystallite_partionedFp0 = crystallite_Fp0
crystallite_partionedFi0 = crystallite_Fi0
crystallite_partionedF0 = crystallite_F0
crystallite_partionedF = crystallite_F0
call crystallite_orientations()
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call constitutive_dependentState(crystallite_partionedF0(1:3,1:3,c,i,e), &
crystallite_partionedFp0(1:3,1:3,c,i,e), &
c,i,e) ! update dependent state variables to be consistent with basic states
enddo
enddo
enddo
!$OMP END PARALLEL DO
devNull = crystallite_stress()
call crystallite_stressTangent
# 283 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
end subroutine crystallite_init
!--------------------------------------------------------------------------------------------------
!> @brief calculate stress (P)
!--------------------------------------------------------------------------------------------------
function crystallite_stress(dummyArgumentToPreventInternalCompilerErrorWithGCC)
logical, dimension(discretization_nIP,discretization_nElem) :: crystallite_stress
real(pReal), intent(in), optional :: &
dummyArgumentToPreventInternalCompilerErrorWithGCC
real(pReal) :: &
formerSubStep
integer :: &
NiterationCrystallite, & ! number of iterations in crystallite loop
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
startIP, endIP, &
s
# 325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
!--------------------------------------------------------------------------------------------------
! initialize to starting condition
crystallite_subStep = 0.0_pReal
!$OMP PARALLEL DO
elementLooping1: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2); do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
homogenizationRequestsCalculation: if (crystallite_requested(c,i,e)) then
plasticState (material_phaseAt(c,e))%subState0( :,material_phaseMemberAt(c,i,e)) = &
plasticState (material_phaseAt(c,e))%partionedState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState(material_phaseAt(c,e))%p(s)%subState0( :,material_phaseMemberAt(c,i,e)) = &
sourceState(material_phaseAt(c,e))%p(s)%partionedState0(:,material_phaseMemberAt(c,i,e))
enddo
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_subFi0(1:3,1:3,c,i,e) = crystallite_partionedFi0(1:3,1:3,c,i,e)
crystallite_subLi0(1:3,1:3,c,i,e) = crystallite_partionedLi0(1:3,1:3,c,i,e)
crystallite_subF0(1:3,1:3,c,i,e) = crystallite_partionedF0(1:3,1:3,c,i,e)
crystallite_subFrac(c,i,e) = 0.0_pReal
crystallite_subStep(c,i,e) = 1.0_pReal/num%subStepSizeCryst
crystallite_todo(c,i,e) = .true.
crystallite_converged(c,i,e) = .false. ! pretend failed step of 1/subStepSizeCryst
endif homogenizationRequestsCalculation
enddo; enddo
enddo elementLooping1
!$OMP END PARALLEL DO
singleRun: if (FEsolving_execELem(1) == FEsolving_execElem(2) .and. &
FEsolving_execIP (1) == FEsolving_execIP (2)) then
startIP = FEsolving_execIP(1)
endIP = startIP
else singleRun
startIP = 1
endIP = discretization_nIP
endif singleRun
NiterationCrystallite = 0
cutbackLooping: do while (any(crystallite_todo(:,startIP:endIP,FEsolving_execELem(1):FEsolving_execElem(2))))
NiterationCrystallite = NiterationCrystallite + 1
!$OMP PARALLEL DO PRIVATE(formerSubStep)
elementLooping3: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
!--------------------------------------------------------------------------------------------------
! wind forward
if (crystallite_converged(c,i,e)) then
formerSubStep = crystallite_subStep(c,i,e)
crystallite_subFrac(c,i,e) = crystallite_subFrac(c,i,e) + crystallite_subStep(c,i,e)
crystallite_subStep(c,i,e) = min(1.0_pReal - crystallite_subFrac(c,i,e), &
num%stepIncreaseCryst * crystallite_subStep(c,i,e))
crystallite_todo(c,i,e) = crystallite_subStep(c,i,e) > 0.0_pReal ! still time left to integrate on?
if (crystallite_todo(c,i,e)) then
crystallite_subF0 (1:3,1:3,c,i,e) = crystallite_subF(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_subLi0(1:3,1:3,c,i,e) = crystallite_Li (1:3,1:3,c,i,e)
crystallite_subFp0(1:3,1:3,c,i,e) = crystallite_Fp (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)
!if abbrevation, make c and p private in omp
plasticState( material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e)) &
= plasticState(material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e)) &
= sourceState(material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e))
enddo
endif
!--------------------------------------------------------------------------------------------------
! cut back (reduced time and restore)
else
crystallite_subStep(c,i,e) = num%subStepSizeCryst * crystallite_subStep(c,i,e)
crystallite_Fp (1:3,1:3,c,i,e) = crystallite_subFp0(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_S (1:3,1:3,c,i,e) = crystallite_S0 (1:3,1:3,c,i,e)
if (crystallite_subStep(c,i,e) < 1.0_pReal) then ! actual (not initial) cutback
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)
endif
plasticState (material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e)) &
= plasticState(material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e)) &
= sourceState(material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e))
enddo
! cant restore dotState here, since not yet calculated in first cutback after initialization
crystallite_todo(c,i,e) = crystallite_subStep(c,i,e) > num%subStepMinCryst ! still on track or already done (beyond repair)
endif
!--------------------------------------------------------------------------------------------------
! prepare for integration
if (crystallite_todo(c,i,e)) then
crystallite_subF(1:3,1:3,c,i,e) = crystallite_subF0(1:3,1:3,c,i,e) &
+ crystallite_subStep(c,i,e) *( crystallite_partionedF (1:3,1:3,c,i,e) &
-crystallite_partionedF0(1:3,1:3,c,i,e))
crystallite_Fe(1:3,1:3,c,i,e) = matmul(matmul(crystallite_subF(1:3,1:3,c,i,e), &
math_inv33(crystallite_Fp(1:3,1:3,c,i,e))), &
math_inv33(crystallite_Fi(1:3,1:3,c,i,e)))
crystallite_subdt(c,i,e) = crystallite_subStep(c,i,e) * crystallite_dt(c,i,e)
crystallite_converged(c,i,e) = .false.
endif
enddo
enddo
enddo elementLooping3
!$OMP END PARALLEL DO
!--------------------------------------------------------------------------------------------------
! integrate --- requires fully defined state array (basic + dependent state)
if (any(crystallite_todo)) call integrateState ! TODO: unroll into proper elementloop to avoid N^2 for single point evaluation
where(.not. crystallite_converged .and. crystallite_subStep > num%subStepMinCryst) & ! do not try non-converged but fully cutbacked any further
crystallite_todo = .true. ! TODO: again unroll this into proper elementloop to avoid N^2 for single point evaluation
enddo cutbackLooping
! return whether converged or not
crystallite_stress = .false.
elementLooping5: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
crystallite_stress(i,e) = all(crystallite_converged(:,i,e))
enddo
enddo elementLooping5
end function crystallite_stress
!--------------------------------------------------------------------------------------------------
!> @brief calculate tangent (dPdF)
!--------------------------------------------------------------------------------------------------
subroutine crystallite_stressTangent
integer :: &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
o, &
p
real(pReal), dimension(3,3) :: devNull, &
invSubFp0,invSubFi0,invFp,invFi, &
temp_33_1, temp_33_2, temp_33_3, temp_33_4
real(pReal), dimension(3,3,3,3) :: dSdFe, &
dSdF, &
dSdFi, &
dLidS, & ! tangent in lattice configuration
dLidFi, &
dLpdS, &
dLpdFi, &
dFidS, &
dFpinvdF, &
rhs_3333, &
lhs_3333, &
temp_3333
real(pReal), dimension(9,9):: temp_99
logical :: error
!$OMP PARALLEL DO PRIVATE(dSdF,dSdFe,dSdFi,dLpdS,dLpdFi,dFpinvdF,dLidS,dLidFi,dFidS,o,p, &
!$OMP invSubFp0,invSubFi0,invFp,invFi, &
!$OMP rhs_3333,lhs_3333,temp_99,temp_33_1,temp_33_2,temp_33_3,temp_33_4,temp_3333,error)
elementLooping: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call constitutive_SandItsTangents(devNull,dSdFe,dSdFi, &
crystallite_Fe(1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e),c,i,e)
call constitutive_LiAndItsTangents(devNull,dLidS,dLidFi, &
crystallite_S (1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e), &
c,i,e)
invFp = math_inv33(crystallite_Fp(1:3,1:3,c,i,e))
invFi = math_inv33(crystallite_Fi(1:3,1:3,c,i,e))
invSubFp0 = math_inv33(crystallite_subFp0(1:3,1:3,c,i,e))
invSubFi0 = math_inv33(crystallite_subFi0(1:3,1:3,c,i,e))
if (sum(abs(dLidS)) < tol_math_check) then
dFidS = 0.0_pReal
else
lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal
do o=1,3; do p=1,3
lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) &
+ crystallite_subdt(c,i,e)*matmul(invSubFi0,dLidFi(1:3,1:3,o,p))
lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) &
+ invFi*invFi(p,o)
rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) &
- crystallite_subdt(c,i,e)*matmul(invSubFi0,dLidS(1:3,1:3,o,p))
enddo; enddo
call math_invert(temp_99,error,math_3333to99(lhs_3333))
if (error) then
call IO_warning(warning_ID=600,el=e,ip=i,g=c, &
ext_msg='inversion error in analytic tangent calculation')
dFidS = 0.0_pReal
else
dFidS = math_mul3333xx3333(math_99to3333(temp_99),rhs_3333)
endif
dLidS = math_mul3333xx3333(dLidFi,dFidS) + dLidS
endif
call constitutive_LpAndItsTangents(devNull,dLpdS,dLpdFi, &
crystallite_S (1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate Lp tangent in lattice configuration
dLpdS = math_mul3333xx3333(dLpdFi,dFidS) + dLpdS
!--------------------------------------------------------------------------------------------------
! calculate dSdF
temp_33_1 = transpose(matmul(invFp,invFi))
temp_33_2 = matmul(crystallite_subF(1:3,1:3,c,i,e),invSubFp0)
temp_33_3 = matmul(matmul(crystallite_subF(1:3,1:3,c,i,e),invFp), invSubFi0)
do o=1,3; do p=1,3
rhs_3333(p,o,1:3,1:3) = matmul(dSdFe(p,o,1:3,1:3),temp_33_1)
temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dLpdS(1:3,1:3,p,o)), invFi) &
+ matmul(temp_33_3,dLidS(1:3,1:3,p,o))
enddo; enddo
lhs_3333 = crystallite_subdt(c,i,e)*math_mul3333xx3333(dSdFe,temp_3333) &
+ math_mul3333xx3333(dSdFi,dFidS)
call math_invert(temp_99,error,math_identity2nd(9)+math_3333to99(lhs_3333))
if (error) then
call IO_warning(warning_ID=600,el=e,ip=i,g=c, &
ext_msg='inversion error in analytic tangent calculation')
dSdF = rhs_3333
else
dSdF = math_mul3333xx3333(math_99to3333(temp_99),rhs_3333)
endif
!--------------------------------------------------------------------------------------------------
! calculate dFpinvdF
temp_3333 = math_mul3333xx3333(dLpdS,dSdF)
do o=1,3; do p=1,3
dFpinvdF(1:3,1:3,p,o) = -crystallite_subdt(c,i,e) &
* matmul(invSubFp0, matmul(temp_3333(1:3,1:3,p,o),invFi))
enddo; enddo
!--------------------------------------------------------------------------------------------------
! assemble dPdF
temp_33_1 = matmul(crystallite_S(1:3,1:3,c,i,e),transpose(invFp))
temp_33_2 = matmul(invFp,temp_33_1)
temp_33_3 = matmul(crystallite_subF(1:3,1:3,c,i,e),invFp)
temp_33_4 = matmul(temp_33_3,crystallite_S(1:3,1:3,c,i,e))
crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = 0.0_pReal
do p=1,3
crystallite_dPdF(p,1:3,p,1:3,c,i,e) = transpose(temp_33_2)
enddo
do o=1,3; do p=1,3
crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) &
+ matmul(matmul(crystallite_subF(1:3,1:3,c,i,e), &
dFpinvdF(1:3,1:3,p,o)),temp_33_1) &
+ matmul(matmul(temp_33_3,dSdF(1:3,1:3,p,o)), &
transpose(invFp)) &
+ matmul(temp_33_4,transpose(dFpinvdF(1:3,1:3,p,o)))
enddo; enddo
enddo; enddo
enddo elementLooping
!$OMP END PARALLEL DO
end subroutine crystallite_stressTangent
!--------------------------------------------------------------------------------------------------
!> @brief calculates orientations
!--------------------------------------------------------------------------------------------------
subroutine crystallite_orientations
integer &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e !< counter in element loop
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call crystallite_orientation(c,i,e)%fromMatrix(transpose(math_rotationalPart(crystallite_Fe(1:3,1:3,c,i,e))))
enddo; enddo; enddo
!$OMP END PARALLEL DO
nonlocalPresent: if (any(plasticState%nonLocal)) then
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
if (plasticState(material_phaseAt(1,e))%nonLocal) &
call plastic_nonlocal_updateCompatibility(crystallite_orientation, &
phase_plasticityInstance(material_phaseAt(i,e)),i,e)
enddo; enddo
!$OMP END PARALLEL DO
endif nonlocalPresent
end subroutine crystallite_orientations
!--------------------------------------------------------------------------------------------------
!> @brief Map 2nd order tensor to reference config
!--------------------------------------------------------------------------------------------------
function crystallite_push33ToRef(ipc,ip,el, tensor33)
real(pReal), dimension(3,3) :: crystallite_push33ToRef
real(pReal), dimension(3,3), intent(in) :: tensor33
real(pReal), dimension(3,3) :: T
integer, intent(in):: &
el, &
ip, &
ipc
T = matmul(material_orientation0(ipc,ip,el)%asMatrix(), & ! ToDo: initial orientation correct?
transpose(math_inv33(crystallite_subF(1:3,1:3,ipc,ip,el))))
crystallite_push33ToRef = matmul(transpose(T),matmul(tensor33,T))
end function crystallite_push33ToRef
!--------------------------------------------------------------------------------------------------
!> @brief writes crystallite results to HDF5 output file
!--------------------------------------------------------------------------------------------------
subroutine crystallite_results
integer :: p,o
real(pReal), allocatable, dimension(:,:,:) :: selected_tensors
type(rotation), allocatable, dimension(:) :: selected_rotations
character(len=pStringLen) :: group,structureLabel
do p=1,size(config_name_phase)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))//'/generic'
call results_closeGroup(results_addGroup(group))
do o = 1, size(output_constituent(p)%label)
select case (output_constituent(p)%label(o))
case('f')
selected_tensors = select_tensors(crystallite_partionedF,p)
call results_writeDataset(group,selected_tensors,'F',&
'deformation gradient','1')
case('fe')
selected_tensors = select_tensors(crystallite_Fe,p)
call results_writeDataset(group,selected_tensors,'Fe',&
'elastic deformation gradient','1')
case('fp')
selected_tensors = select_tensors(crystallite_Fp,p)
call results_writeDataset(group,selected_tensors,'Fp',&
'plastic deformation gradient','1')
case('fi')
selected_tensors = select_tensors(crystallite_Fi,p)
call results_writeDataset(group,selected_tensors,'Fi',&
'inelastic deformation gradient','1')
case('lp')
selected_tensors = select_tensors(crystallite_Lp,p)
call results_writeDataset(group,selected_tensors,'Lp',&
'plastic velocity gradient','1/s')
case('li')
selected_tensors = select_tensors(crystallite_Li,p)
call results_writeDataset(group,selected_tensors,'Li',&
'inelastic velocity gradient','1/s')
case('p')
selected_tensors = select_tensors(crystallite_P,p)
call results_writeDataset(group,selected_tensors,'P',&
'First Piola-Kirchoff stress','Pa')
case('s')
selected_tensors = select_tensors(crystallite_S,p)
call results_writeDataset(group,selected_tensors,'S',&
'Second Piola-Kirchoff stress','Pa')
case('orientation')
select case(lattice_structure(p))
case(lattice_ISO_ID)
structureLabel = 'iso'
case(lattice_FCC_ID)
structureLabel = 'fcc'
case(lattice_BCC_ID)
structureLabel = 'bcc'
case(lattice_BCT_ID)
structureLabel = 'bct'
case(lattice_HEX_ID)
structureLabel = 'hex'
case(lattice_ORT_ID)
structureLabel = 'ort'
end select
selected_rotations = select_rotations(crystallite_orientation,p)
call results_writeDataset(group,selected_rotations,'orientation',&
'crystal orientation as quaternion',structureLabel)
end select
enddo
enddo
contains
!------------------------------------------------------------------------------------------------
!> @brief select tensors for output
!------------------------------------------------------------------------------------------------
function select_tensors(dataset,instance)
integer, intent(in) :: instance
real(pReal), dimension(:,:,:,:,:), intent(in) :: dataset
real(pReal), allocatable, dimension(:,:,:) :: select_tensors
integer :: e,i,c,j
allocate(select_tensors(3,3,count(material_phaseAt==instance)*discretization_nIP))
j=0
do e = 1, size(material_phaseAt,2)
do i = 1, discretization_nIP
do c = 1, size(material_phaseAt,1) !ToDo: this needs to be changed for varying Ngrains
if (material_phaseAt(c,e) == instance) then
j = j + 1
select_tensors(1:3,1:3,j) = dataset(1:3,1:3,c,i,e)
endif
enddo
enddo
enddo
end function select_tensors
!--------------------------------------------------------------------------------------------------
!> @brief select rotations for output
!--------------------------------------------------------------------------------------------------
function select_rotations(dataset,instance)
integer, intent(in) :: instance
type(rotation), dimension(:,:,:), intent(in) :: dataset
type(rotation), allocatable, dimension(:) :: select_rotations
integer :: e,i,c,j
allocate(select_rotations(count(material_phaseAt==instance)*homogenization_maxNgrains*discretization_nIP))
j=0
do e = 1, size(material_phaseAt,2)
do i = 1, discretization_nIP
do c = 1, size(material_phaseAt,1) !ToDo: this needs to be changed for varying Ngrains
if (material_phaseAt(c,e) == instance) then
j = j + 1
select_rotations(j) = dataset(c,i,e)
endif
enddo
enddo
enddo
end function select_rotations
end subroutine crystallite_results
!--------------------------------------------------------------------------------------------------
!> @brief calculation of stress (P) with time integration based on a residuum in Lp and
!> intermediate acceleration of the Newton-Raphson correction
!--------------------------------------------------------------------------------------------------
logical function integrateStress(ipc,ip,el,timeFraction)
integer, intent(in):: el, & ! element index
ip, & ! integration point index
ipc ! grain index
real(pReal), optional, intent(in) :: timeFraction ! fraction of timestep
real(pReal), dimension(3,3):: F, & ! deformation gradient at end of timestep
Fp_new, & ! plastic deformation gradient at end of timestep
invFp_new, & ! inverse of Fp_new
invFp_current, & ! inverse of Fp_current
Lpguess, & ! current guess for plastic velocity gradient
Lpguess_old, & ! known last good guess for plastic velocity gradient
Lp_constitutive, & ! plastic velocity gradient resulting from constitutive law
residuumLp, & ! current residuum of plastic velocity gradient
residuumLp_old, & ! last residuum of plastic velocity gradient
deltaLp, & ! direction of next guess
Fi_new, & ! gradient of intermediate deformation stages
invFi_new, &
invFi_current, & ! inverse of Fi_current
Liguess, & ! current guess for intermediate velocity gradient
Liguess_old, & ! known last good guess for intermediate velocity gradient
Li_constitutive, & ! intermediate velocity gradient resulting from constitutive law
residuumLi, & ! current residuum of intermediate velocity gradient
residuumLi_old, & ! last residuum of intermediate velocity gradient
deltaLi, & ! direction of next guess
Fe, & ! elastic deformation gradient
Fe_new, &
S, & ! 2nd Piola-Kirchhoff Stress in plastic (lattice) configuration
A, &
B, &
temp_33
real(pReal), dimension(9) :: temp_9 ! needed for matrix inversion by LAPACK
integer, dimension(9) :: devNull_9 ! needed for matrix inversion by LAPACK
real(pReal), dimension(9,9) :: dRLp_dLp, & ! partial derivative of residuum (Jacobian for Newton-Raphson scheme)
dRLi_dLi ! partial derivative of residuumI (Jacobian for Newton-Raphson scheme)
real(pReal), dimension(3,3,3,3):: dS_dFe, & ! partial derivative of 2nd Piola-Kirchhoff stress
dS_dFi, &
dFe_dLp, & ! partial derivative of elastic deformation gradient
dFe_dLi, &
dFi_dLi, &
dLp_dFi, &
dLi_dFi, &
dLp_dS, &
dLi_dS
real(pReal) steplengthLp, &
steplengthLi, &
dt, & ! time increment
atol_Lp, &
atol_Li, &
devNull
integer NiterationStressLp, & ! number of stress integrations
NiterationStressLi, & ! number of inner stress integrations
ierr, & ! error indicator for LAPACK
o, &
p, &
jacoCounterLp, &
jacoCounterLi ! counters to check for Jacobian update
logical :: error
external :: &
dgesv
integrateStress = .false.
if (present(timeFraction)) then
dt = crystallite_subdt(ipc,ip,el) * timeFraction
F = crystallite_subF0(1:3,1:3,ipc,ip,el) &
+ (crystallite_subF(1:3,1:3,ipc,ip,el) - crystallite_subF0(1:3,1:3,ipc,ip,el)) * timeFraction
else
dt = crystallite_subdt(ipc,ip,el)
F = crystallite_subF(1:3,1:3,ipc,ip,el)
endif
Lpguess = crystallite_Lp(1:3,1:3,ipc,ip,el) ! take as first guess
Liguess = crystallite_Li(1:3,1:3,ipc,ip,el) ! take as first guess
call math_invert33(invFp_current,devNull,error,crystallite_subFp0(1:3,1:3,ipc,ip,el))
if (error) return ! error
call math_invert33(invFi_current,devNull,error,crystallite_subFi0(1:3,1:3,ipc,ip,el))
if (error) return ! error
A = matmul(F,invFp_current) ! intermediate tensor needed later to calculate dFe_dLp
jacoCounterLi = 0
steplengthLi = 1.0_pReal
residuumLi_old = 0.0_pReal
Liguess_old = Liguess
NiterationStressLi = 0
LiLoop: do
NiterationStressLi = NiterationStressLi + 1
if (NiterationStressLi>num%nStress) return ! error
invFi_new = matmul(invFi_current,math_I3 - dt*Liguess)
Fi_new = math_inv33(invFi_new)
jacoCounterLp = 0
steplengthLp = 1.0_pReal
residuumLp_old = 0.0_pReal
Lpguess_old = Lpguess
NiterationStressLp = 0
LpLoop: do
NiterationStressLp = NiterationStressLp + 1
if (NiterationStressLp>num%nStress) return ! error
B = math_I3 - dt*Lpguess
Fe = matmul(matmul(A,B), invFi_new)
call constitutive_SandItsTangents(S, dS_dFe, dS_dFi, &
Fe, Fi_new, ipc, ip, el)
call constitutive_LpAndItsTangents(Lp_constitutive, dLp_dS, dLp_dFi, &
S, Fi_new, ipc, ip, el)
!* update current residuum and check for convergence of loop
atol_Lp = max(num%rtol_crystalliteStress * max(norm2(Lpguess),norm2(Lp_constitutive)), & ! absolute tolerance from largest acceptable relative error
num%atol_crystalliteStress) ! minimum lower cutoff
residuumLp = Lpguess - Lp_constitutive
if (any(IEEE_is_NaN(residuumLp))) then
return ! error
elseif (norm2(residuumLp) < atol_Lp) then ! converged if below absolute tolerance
exit LpLoop
elseif (NiterationStressLp == 1 .or. norm2(residuumLp) < norm2(residuumLp_old)) then ! not converged, but improved norm of residuum (always proceed in first iteration)...
residuumLp_old = residuumLp ! ...remember old values and...
Lpguess_old = Lpguess
steplengthLp = 1.0_pReal ! ...proceed with normal step length (calculate new search direction)
else ! not converged and residuum not improved...
steplengthLp = num%subStepSizeLp * steplengthLp ! ...try with smaller step length in same direction
Lpguess = Lpguess_old &
+ deltaLp * stepLengthLp
cycle LpLoop
endif
!* calculate Jacobian for correction term
if (mod(jacoCounterLp, num%iJacoLpresiduum) == 0) then
jacoCounterLp = jacoCounterLp + 1
do o=1,3; do p=1,3
dFe_dLp(o,1:3,p,1:3) = A(o,p)*transpose(invFi_new) ! dFe_dLp(i,j,k,l) = -dt * A(i,k) invFi(l,j)
enddo; enddo
dFe_dLp = - dt * dFe_dLp
dRLp_dLp = math_identity2nd(9) &
- math_3333to99(math_mul3333xx3333(math_mul3333xx3333(dLp_dS,dS_dFe),dFe_dLp))
temp_9 = math_33to9(residuumLp)
call dgesv(9,1,dRLp_dLp,9,devNull_9,temp_9,9,ierr) ! solve dRLp/dLp * delta Lp = -res for delta Lp
if (ierr /= 0) return ! error
deltaLp = - math_9to33(temp_9)
endif
Lpguess = Lpguess &
+ deltaLp * steplengthLp
enddo LpLoop
call constitutive_LiAndItsTangents(Li_constitutive, dLi_dS, dLi_dFi, &
S, Fi_new, ipc, ip, el)
!* update current residuum and check for convergence of loop
atol_Li = max(num%rtol_crystalliteStress * max(norm2(Liguess),norm2(Li_constitutive)), & ! absolute tolerance from largest acceptable relative error
num%atol_crystalliteStress) ! minimum lower cutoff
residuumLi = Liguess - Li_constitutive
if (any(IEEE_is_NaN(residuumLi))) then
return ! error
elseif (norm2(residuumLi) < atol_Li) then ! converged if below absolute tolerance
exit LiLoop
elseif (NiterationStressLi == 1 .or. norm2(residuumLi) < norm2(residuumLi_old)) then ! not converged, but improved norm of residuum (always proceed in first iteration)...
residuumLi_old = residuumLi ! ...remember old values and...
Liguess_old = Liguess
steplengthLi = 1.0_pReal ! ...proceed with normal step length (calculate new search direction)
else ! not converged and residuum not improved...
steplengthLi = num%subStepSizeLi �s] for each twin system
18109 dot_n_0_tr, & !< trans nucleation rate [1/m� s] for each trans system
t_tw, & !< twin thickness [m] for each twin system
CLambdaSlip, & !< Adj. parameter for distance between 2 forest dislocations for each slip system
t_tr, & !< martensite lamellar thickness [m] for each trans system and instance
p, & !< p-exponent in glide velocity
q, & !< q-exponent in glide velocity
r, & !< r-exponent in twin nucleation rate
s, & !< s-exponent in trans nucleation rate
gamma_char, & !< characteristic shear for twins
B !< drag coefficient
real(pReal), allocatable, dimension(:,:) :: &
h_sl_sl, & !<
h_sl_tw, & !<
h_tw_tw, & !<
h_sl_tr, & !<
h_tr_tr, & !<
n0_sl, & !< slip system normal
forestProjection, &
C66
real(pReal), allocatable, dimension(:,:,:) :: &
P_sl, &
P_tw, &
P_tr, &
C66_tw, &
C66_tr
integer :: &
sum_N_sl, & !< total number of active slip system
sum_N_tw, & !< total number of active twin system
sum_N_tr !< total number of active transformation system
integer, allocatable, dimension(:,:) :: &
fcc_twinNucleationSlipPair ! ToDo: Better name? Is also use for trans
character(len=pStringLen), allocatable, dimension(:) :: &
output
logical :: &
ExtendedDislocations, & !< consider split into partials for climb calculation
fccTwinTransNucleation, & !< twinning and transformation models are for fcc
dipoleFormation !< flag indicating consideration of dipole formation
end type !< container type for internal constitutive parameters
type :: tDislotwinState
real(pReal), dimension(:,:), pointer :: &
rho_mob, &
rho_dip, &
gamma_sl, &
f_tw, &
f_tr
end type tDislotwinState
type :: tDislotwinMicrostructure
real(pReal), dimension(:,:), allocatable :: &
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_tr, & !< mean free path between 2 obstacles seen by a growing martensite
tau_pass, &
tau_hat_tw, &
tau_hat_tr, &
V_tw, & !< volume of a new twin
V_tr, & !< volume of a new martensite disc
tau_r_tw, & !< stress to bring partials close together (twin)
tau_r_tr !< stress to bring partials close together (trans)
end type tDislotwinMicrostructure
!--------------------------------------------------------------------------------------------------
! containers for parameters and state
type(tParameters), allocatable, dimension(:) :: param
type(tDislotwinState), allocatable, dimension(:) :: &
dotState, &
state
type(tDislotwinMicrostructure), allocatable, dimension(:) :: dependentState
contains
!--------------------------------------------------------------------------------------------------
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_init
integer :: &
Ninstance, &
p, i, &
NipcMyPhase, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
N_sl, N_tw, N_tr
real(pReal), allocatable, dimension(:) :: &
rho_mob_0, & !< initial unipolar dislocation density per slip system
rho_dip_0 !< initial dipole dislocation density per slip system
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Ma and Roters, Acta Materialia 52(12):3603–3612, 2004'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2004.04.012'
write(6,'(/,a)') ' Roters et al., Computational Materials Science 39:91–95, 2007'
write(6,'(a)') ' https://doi.org/10.1016/j.commatsci.2006.04.014'
write(6,'(/,a)') ' Wong et al., Acta Materialia 118:140–151, 2016'
write(6,'(a,/)') ' https://doi.org/10.1016/j.actamat.2016.07.032'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOTWIN_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(dotState(Ninstance))
allocate(dependentState(Ninstance))
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_DISLOTWIN_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
dst => dependentState(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)', defaultVal=emptyStringArray)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
prm%nu = lattice_nu(p)
prm%C66 = lattice_C66(1:6,1:6,p)
!--------------------------------------------------------------------------------------------------
! slip related parameters
N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_sl_sl = lattice_interaction_SlipBySlip(N_sl,config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection = lattice_forestProjection_edge(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection = transpose(prm%forestProjection)
prm%n0_sl = lattice_slip_normal(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%fccTwinTransNucleation = merge(.true., .false., lattice_structure(p) == lattice_FCC_ID) &
.and. (N_sl(1) == 12)
if(prm%fccTwinTransNucleation) prm%fcc_twinNucleationSlipPair = lattice_FCC_TWINNUCLEATIONSLIPPAIR
rho_mob_0 = config%getFloats('rhoedge0', requiredSize=size(N_sl))
rho_dip_0 = config%getFloats('rhoedgedip0',requiredSize=size(N_sl))
prm%v0 = config%getFloats('v0', requiredSize=size(N_sl))
prm%b_sl = config%getFloats('slipburgers',requiredSize=size(N_sl))
prm%Delta_F = config%getFloats('qedge', requiredSize=size(N_sl))
prm%CLambdaSlip = config%getFloats('clambdaslip',requiredSize=size(N_sl))
prm%p = config%getFloats('p_slip', requiredSize=size(N_sl))
prm%q = config%getFloats('q_slip', requiredSize=size(N_sl))
prm%B = config%getFloats('b', requiredSize=size(N_sl), &
defaultVal=[(0.0_pReal, i=1,size(N_sl))])
prm%tau_0 = config%getFloat('solidsolutionstrength')
prm%CEdgeDipMinDistance = config%getFloat('cedgedipmindistance')
prm%D0 = config%getFloat('d0')
prm%Qsd = config%getFloat('qsd')
prm%ExtendedDislocations = config%keyExists('/extend_dislocations/')
if (prm%ExtendedDislocations) then
prm%SFE_0K = config%getFloat('sfe_0k')
prm%dSFE_dT = config%getFloat('dsfe_dt')
endif
prm%dipoleformation = .not. config%keyExists('/nodipoleformation/')
! multiplication factor according to crystal structure (nearest neighbors bcc vs fcc/hex)
! details: Argon & Moffat, Acta Metallurgica, Vol. 29, pg 293 to 299, 1981
prm%omega = config%getFloat('omega', defaultVal = 1000.0_pReal) &
* merge(12.0_pReal,8.0_pReal,any(lattice_structure(p) == [lattice_FCC_ID,lattice_HEX_ID]))
! expand: family => system
rho_mob_0 = math_expand(rho_mob_0, N_sl)
rho_dip_0 = math_expand(rho_dip_0, N_sl)
prm%v0 = math_expand(prm%v0, N_sl)
prm%b_sl = math_expand(prm%b_sl, N_sl)
prm%Delta_F = math_expand(prm%Delta_F, N_sl)
prm%CLambdaSlip = math_expand(prm%CLambdaSlip, N_sl)
prm%p = math_expand(prm%p, N_sl)
prm%q = math_expand(prm%q, N_sl)
prm%B = math_expand(prm%B, N_sl)
! sanity checks
if ( prm%D0 <= 0.0_pReal) extmsg = trim(extmsg)//' D0'
if ( prm%Qsd <= 0.0_pReal) extmsg = trim(extmsg)//' Qsd'
if (any(rho_mob_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_mob_0'
if (any(rho_dip_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rho_dip_0'
if (any(prm%v0 < 0.0_pReal)) extmsg = trim(extmsg)//' v0'
if (any(prm%b_sl <= 0.0_pReal)) extmsg = trim(extmsg)//' b_sl'
if (any(prm%Delta_F <= 0.0_pReal)) extmsg = trim(extmsg)//' Delta_F'
if (any(prm%CLambdaSlip <= 0.0_pReal)) extmsg = trim(extmsg)//' CLambdaSlip'
if (any(prm%B < 0.0_pReal)) extmsg = trim(extmsg)//' B'
if (any(prm%p<=0.0_pReal .or. prm%p>1.0_pReal)) extmsg = trim(extmsg)//' p'
if (any(prm%q< 1.0_pReal .or. prm%q>2.0_pReal)) extmsg = trim(extmsg)//' q'
else slipActive
rho_mob_0 = emptyRealArray; rho_dip_0 = emptyRealArray
allocate(prm%b_sl,prm%Delta_F,prm%v0,prm%CLambdaSlip,prm%p,prm%q,prm%B,source=emptyRealArray)
allocate(prm%forestProjection(0,0),prm%h_sl_sl(0,0))
endif slipActive
!--------------------------------------------------------------------------------------------------
! twin related parameters
N_tw = config%getInts('ntwin', defaultVal=emptyIntArray)
prm%sum_N_tw = sum(abs(N_tw))
twinActive: if (prm%sum_N_tw > 0) then
prm%P_tw = lattice_SchmidMatrix_twin(N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%h_tw_tw = lattice_interaction_TwinByTwin(N_tw,&
config%getFloats('interaction_twintwin'), &
config%getString('lattice_structure'))
prm%b_tw = config%getFloats('twinburgers', requiredSize=size(N_tw))
prm%t_tw = config%getFloats('twinsize', requiredSize=size(N_tw))
prm%r = config%getFloats('r_twin', requiredSize=size(N_tw))
prm%xc_twin = config%getFloat('xc_twin')
prm%L_tw = config%getFloat('l0_twin')
prm%i_tw = config%getFloat('cmfptwin')
prm%gamma_char= lattice_characteristicShear_Twin(N_tw,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%C66_tw = lattice_C66_twin(N_tw,prm%C66,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if (.not. prm%fccTwinTransNucleation) then
prm%dot_N_0_tw = config%getFloats('ndot0_twin')
prm%dot_N_0_tw = math_expand(prm%dot_N_0_tw,N_tw)
endif
! expand: family => system
prm%b_tw = math_expand(prm%b_tw,N_tw)
prm%t_tw = math_expand(prm%t_tw,N_tw)
prm%r = math_expand(prm%r,N_tw)
! sanity checks
if ( prm%xc_twin < 0.0_pReal) extmsg = trim(extmsg)//' xc_twin'
if ( prm%L_tw < 0.0_pReal) extmsg = trim(extmsg)//' L_tw'
if ( prm%i_tw < 0.0_pReal) extmsg = trim(extmsg)//' i_tw'
if (any(prm%b_tw < 0.0_pReal)) extmsg = trim(extmsg)//' b_tw'
if (any(prm%t_tw < 0.0_pReal)) extmsg = trim(extmsg)//' t_tw'
if (any(prm%r < 0.0_pReal)) extmsg = trim(extmsg)//' r'
if (.not. prm%fccTwinTransNucleation) then
if (any(prm%dot_N_0_tw < 0.0_pReal)) extmsg = trim(extmsg)//' dot_N_0_tw'
endif
else twinActive
allocate(prm%gamma_char,prm%b_tw,prm%dot_N_0_tw,prm%t_tw,prm%r,source=emptyRealArray)
allocate(prm%h_tw_tw(0,0))
endif twinActive
!--------------------------------------------------------------------------------------------------
! transformation related parameters
N_tr = config%getInts('ntrans', defaultVal=emptyIntArray)
prm%sum_N_tr = sum(abs(N_tr))
transActive: if (prm%sum_N_tr > 0) then
prm%b_tr = config%getFloats('transburgers')
prm%b_tr = math_expand(prm%b_tr,N_tr)
prm%h = config%getFloat('transstackheight', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%i_tr = config%getFloat('cmfptrans', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%gamma_fcc_hex = config%getFloat('deltag')
prm%xc_trans = config%getFloat('xc_trans', defaultVal=0.0_pReal) ! ToDo: How to handle that???
prm%L_tr = config%getFloat('l0_trans')
prm%h_tr_tr = lattice_interaction_TransByTrans(N_tr,config%getFloats('interaction_transtrans'), &
config%getString('lattice_structure'))
prm%C66_tr = lattice_C66_trans(N_tr,prm%C66,config%getString('trans_lattice_structure'), &
0.0_pReal, &
config%getFloat('a_bcc', defaultVal=0.0_pReal), &
config%getFloat('a_fcc', defaultVal=0.0_pReal))
prm%P_tr = lattice_SchmidMatrix_trans(N_tr,config%getString('trans_lattice_structure'), &
0.0_pReal, &
config%getFloat('a_bcc', defaultVal=0.0_pReal), &
config%getFloat('a_fcc', defaultVal=0.0_pReal))
if (lattice_structure(p) /= lattice_FCC_ID) then
prm%dot_N_0_tr = config%getFloats('ndot0_trans')
prm%dot_N_0_tr = math_expand(prm%dot_N_0_tr,N_tr)
endif
prm%t_tr = config%getFloats('lamellarsize')
prm%t_tr = math_expand(prm%t_tr,N_tr)
prm%s = config%getFloats('s_trans',defaultVal=[0.0_pReal])
prm%s = math_expand(prm%s,N_tr)
! sanity checks
if ( prm%xc_trans < 0.0_pReal) extmsg = trim(extmsg)//' xc_trans'
if ( prm%L_tr < 0.0_pReal) extmsg = trim(extmsg)//' L_tr'
if ( prm%i_tr < 0.0_pReal) extmsg = trim(extmsg)//' i_tr'
if (any(prm%t_tr < 0.0_pReal)) extmsg = trim(extmsg)//' t_tr'
if (any(prm%s < 0.0_pReal)) extmsg = trim(extmsg)//' s'
if (lattice_structure(p) /= lattice_FCC_ID) then
if (any(prm%dot_N_0_tr < 0.0_pReal)) extmsg = trim(extmsg)//' dot_N_0_tr'
endif
else transActive
allocate(prm%s,prm%b_tr,prm%t_tr,prm%dot_N_0_tr,source=emptyRealArray)
allocate(prm%h_tr_tr(0,0))
endif transActive
!--------------------------------------------------------------------------------------------------
! shearband related parameters
prm%sbVelocity = config%getFloat('shearbandvelocity',defaultVal=0.0_pReal)
if (prm%sbVelocity > 0.0_pReal) then
prm%sbResistance = config%getFloat('shearbandresistance')
prm%E_sb = config%getFloat('qedgepersbsystem')
prm%p_sb = config%getFloat('p_shearband')
prm%q_sb = config%getFloat('q_shearband')
! sanity checks
if (prm%sbResistance < 0.0_pReal) extmsg = trim(extmsg)//' shearbandresistance'
if (prm%E_sb < 0.0_pReal) extmsg = trim(extmsg)//' qedgepersbsystem'
if (prm%p_sb <= 0.0_pReal) extmsg = trim(extmsg)//' p_shearband'
if (prm%q_sb <= 0.0_pReal) extmsg = trim(extmsg)//' q_shearband'
endif
!--------------------------------------------------------------------------------------------------
! parameters required for several mechanisms and their interactions
if(prm%sum_N_sl + prm%sum_N_tw + prm%sum_N_tw > 0) &
prm%D = config%getFloat('grainsize')
twinOrSlipActive: if (prm%sum_N_tw + prm%sum_N_tr > 0) then
prm%SFE_0K = config%getFloat('sfe_0k')
prm%dSFE_dT = config%getFloat('dsfe_dt')
prm%V_cs = config%getFloat('vcrossslip')
endif twinOrSlipActive
slipAndTwinActive: if (prm%sum_N_sl * prm%sum_N_tw > 0) then
prm%h_sl_tw = lattice_interaction_SlipByTwin(N_sl,N_tw,&
config%getFloats('interaction_sliptwin'), &
config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. size(N_tw) /= 1) extmsg = trim(extmsg)//' interaction_sliptwin'
endif slipAndTwinActive
slipAndTransActive: if (prm%sum_N_sl * prm%sum_N_tr > 0) then
prm%h_sl_tr = lattice_interaction_SlipByTrans(N_sl,N_tr,&
config%getFloats('interaction_sliptrans'), &
config%getString('lattice_structure'))
if (prm%fccTwinTransNucleation .and. size(N_tr) /= 1) extmsg = trim(extmsg)//' interaction_sliptrans'
endif slipAndTransActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl &
+ size(['f_tw']) * prm%sum_N_tw &
+ size(['f_tr']) * prm%sum_N_tr
sizeState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! locally defined state aliases and initialization of state0 and atol
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob=>plasticState(p)%state(startIndex:endIndex,:)
stt%rho_mob= spread(rho_mob_0,2,NipcMyPhase)
dot%rho_mob=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip=>plasticState(p)%state(startIndex:endIndex,:)
stt%rho_dip= spread(rho_dip_0,2,NipcMyPhase)
dot%rho_dip=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%gamma_sl=>plasticState(p)%state(startIndex:endIndex,:)
dot%gamma_sl=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = 1.0e-2_pReal
! global alias
plasticState(p)%slipRate => plasticState(p)%dotState(startIndex:endIndex,:)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_tw
stt%f_tw=>plasticState(p)%state(startIndex:endIndex,:)
dot%f_tw=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('f_twin',defaultVal=1.0e-7_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' f_twin'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_tr
stt%f_tr=>plasticState(p)%state(startIndex:endIndex,:)
dot%f_tr=>plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('f_trans',defaultVal=1.0e-6_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' f_trans'
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%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_r_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%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%V_tr (prm%sum_N_tr,NipcMyPhase),source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_DISLOTWIN_LABEL//')')
enddo
end subroutine plastic_dislotwin_init
!--------------------------------------------------------------------------------------------------
!> @brief Return the homogenized elasticity matrix.
!--------------------------------------------------------------------------------------------------
module function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
integer :: i, &
of
real(pReal) :: f_unrotated
of = material_phasememberAt(ipc,ip,el)
associate(prm => param(phase_plasticityInstance(material_phaseAt(ipc,el))),&
stt => state(phase_plasticityInstance(material_phaseAT(ipc,el))))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
homogenizedC = f_unrotated * prm%C66
do i=1,prm%sum_N_tw
homogenizedC = homogenizedC &
+ stt%f_tw(i,of)*prm%C66_tw(1:6,1:6,i)
enddo
do i=1,prm%sum_N_tr
homogenizedC = homogenizedC &
+ stt%f_tr(i,of)*prm%C66_tr(1:6,1:6,i)
enddo
end associate
end function plastic_dislotwin_homogenizedC
!--------------------------------------------------------------------------------------------------
!> @brief Calculate plastic velocity gradient and its tangent.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: Lp
real(pReal), dimension(3,3,3,3), intent(out) :: dLp_dMp
real(pReal), dimension(3,3), intent(in) :: Mp
integer, intent(in) :: instance,of
real(pReal), intent(in) :: T
integer :: i,k,l,m,n
real(pReal) :: &
f_unrotated,StressRatio_p,&
BoltzmannRatio, &
ddot_gamma_dtau, &
tau
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_sl,ddot_gamma_dtau_slip
real(pReal), dimension(param(instance)%sum_N_tw) :: &
dot_gamma_twin,ddot_gamma_dtau_twin
real(pReal), dimension(param(instance)%sum_N_tr) :: &
dot_gamma_tr,ddot_gamma_dtau_trans
real(pReal):: dot_gamma_sb
real(pReal), dimension(3,3) :: eigVectors, P_sb
real(pReal), dimension(3) :: eigValues
real(pReal), dimension(3,6), parameter :: &
sb_sComposition = &
reshape(real([&
1, 0, 1, &
1, 0,-1, &
1, 1, 0, &
1,-1, 0, &
0, 1, 1, &
0, 1,-1 &
],pReal),[ 3,6]), &
sb_mComposition = &
reshape(real([&
1, 0,-1, &
1, 0,+1, &
1,-1, 0, &
1, 1, 0, &
0, 1,-1, &
0, 1, 1 &
],pReal),[ 3,6])
associate(prm => param(instance), stt => state(instance))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
call kinetics_slip(Mp,T,instance,of,dot_gamma_sl,ddot_gamma_dtau_slip)
slipContribution: do i = 1, prm%sum_N_sl
Lp = Lp + dot_gamma_sl(i)*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_slip(i) * prm%P_sl(k,l,i) * prm%P_sl(m,n,i)
enddo slipContribution
!ToDo: Why do this before shear banding?
Lp = Lp * f_unrotated
dLp_dMp = dLp_dMp * f_unrotated
shearBandingContribution: if(dNeq0(prm%sbVelocity)) then
BoltzmannRatio = prm%E_sb/(kB*T)
call math_eigh33(Mp,eigValues,eigVectors) ! is Mp symmetric by design?
do i = 1,6
P_sb = 0.5_pReal * math_outer(matmul(eigVectors,sb_sComposition(1:3,i)),&
matmul(eigVectors,sb_mComposition(1:3,i)))
tau = math_tensordot(Mp,P_sb)
significantShearBandStress: if (abs(tau) > tol_math_check) then
StressRatio_p = (abs(tau)/prm%sbResistance)**prm%p_sb
dot_gamma_sb = sign(prm%sbVelocity*exp(-BoltzmannRatio*(1-StressRatio_p)**prm%q_sb), tau)
ddot_gamma_dtau = abs(dot_gamma_sb)*BoltzmannRatio* prm%p_sb*prm%q_sb/ prm%sbResistance &
* (abs(tau)/prm%sbResistance)**(prm%p_sb-1.0_pReal) &
* (1.0_pReal-StressRatio_p)**(prm%q_sb-1.0_pReal)
Lp = Lp + dot_gamma_sb * P_sb
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau * P_sb(k,l) * P_sb(m,n)
endif significantShearBandStress
enddo
endif shearBandingContribution
call kinetics_twin(Mp,T,dot_gamma_sl,instance,of,dot_gamma_twin,ddot_gamma_dtau_twin)
twinContibution: do i = 1, prm%sum_N_tw
Lp = Lp + dot_gamma_twin(i)*prm%P_tw(1:3,1:3,i) * f_unrotated
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_twin(i)* prm%P_tw(k,l,i)*prm%P_tw(m,n,i) * f_unrotated
enddo twinContibution
call kinetics_trans(Mp,T,dot_gamma_sl,instance,of,dot_gamma_tr,ddot_gamma_dtau_trans)
transContibution: do i = 1, prm%sum_N_tr
Lp = Lp + dot_gamma_tr(i)*prm%P_tr(1:3,1:3,i) * f_unrotated
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_trans(i)* prm%P_tr(k,l,i)*prm%P_tr(m,n,i) * f_unrotated
enddo transContibution
end associate
end subroutine plastic_dislotwin_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief Calculate the rate of change of microstructure.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_dotState(Mp,T,instance,of)
real(pReal), dimension(3,3), intent(in):: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature at integration point
integer, intent(in) :: &
instance, &
of
integer :: i
real(pReal) :: &
f_unrotated, &
rho_dip_distance, &
v_cl, & !< climb velocity
Gamma, & !< stacking fault energy
tau, &
sigma_cl, & !< climb stress
b_d !< ratio of burgers vector to stacking fault width
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_rho_dip_formation, &
dot_rho_dip_climb, &
rho_dip_distance_min, &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tw) :: &
dot_gamma_twin
real(pReal), dimension(param(instance)%sum_N_tr) :: &
dot_gamma_tr
associate(prm => param(instance), stt => state(instance), &
dot => dotState(instance), dst => dependentState(instance))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
call kinetics_slip(Mp,T,instance,of,dot_gamma_sl)
dot%gamma_sl(:,of) = abs(dot_gamma_sl)
rho_dip_distance_min = prm%CEdgeDipMinDistance*prm%b_sl
slipState: do i = 1, prm%sum_N_sl
tau = math_tensordot(Mp,prm%P_sl(1:3,1:3,i))
significantSlipStress: if (dEq0(tau)) then
dot_rho_dip_formation(i) = 0.0_pReal
dot_rho_dip_climb(i) = 0.0_pReal
else significantSlipStress
rho_dip_distance = 3.0_pReal*prm%mu*prm%b_sl(i)/(16.0_pReal*PI*abs(tau))
rho_dip_distance = math_clip(rho_dip_distance, right = dst%Lambda_sl(i,of))
rho_dip_distance = math_clip(rho_dip_distance, left = rho_dip_distance_min(i))
if (prm%dipoleFormation) then
dot_rho_dip_formation(i) = 2.0_pReal*(rho_dip_distance-rho_dip_distance_min(i))/prm%b_sl(i) &
* stt%rho_mob(i,of)*abs(dot_gamma_sl(i))
else
dot_rho_dip_formation(i) = 0.0_pReal
endif
if (dEq(rho_dip_distance,rho_dip_distance_min(i))) then
dot_rho_dip_climb(i) = 0.0_pReal
else
!@details: Refer: Argon & Moffat, Acta Metallurgica, Vol. 29, pg 293 to 299, 1981
sigma_cl = dot_product(prm%n0_sl(1:3,i),matmul(Mp,prm%n0_sl(1:3,i)))
if (prm%ExtendedDislocations) then
Gamma = prm%SFE_0K + prm%dSFE_dT * T
b_d = 24.0_pReal*PI*(1.0_pReal - prm%nu)/(2.0_pReal + prm%nu)* Gamma/(prm%mu*prm%b_sl(i))
else
b_d = 1.0_pReal
endif
v_cl = 2.0_pReal*prm%omega*b_d**2.0_pReal*exp(-prm%Qsd/(kB*T)) &
* (exp(abs(sigma_cl)*prm%b_sl(i)**3.0_pReal/(kB*T)) - 1.0_pReal)
dot_rho_dip_climb(i) = 4.0_pReal*v_cl*stt%rho_dip(i,of) &
/ (rho_dip_distance-rho_dip_distance_min(i))
endif
endif significantSlipStress
enddo slipState
dot%rho_mob(:,of) = abs(dot_gamma_sl)/(prm%b_sl*dst%Lambda_sl(:,of)) &
- dot_rho_dip_formation &
- 2.0_pReal*rho_dip_distance_min/prm%b_sl * stt%rho_mob(:,of)*abs(dot_gamma_sl)
dot%rho_dip(:,of) = dot_rho_dip_formation &
- 2.0_pReal*rho_dip_distance_min/prm%b_sl * stt%rho_dip(:,of)*abs(dot_gamma_sl) &
- dot_rho_dip_climb
call kinetics_twin(Mp,T,dot_gamma_sl,instance,of,dot_gamma_twin)
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)
dot%f_tr(:,of) = f_unrotated*dot_gamma_tr
end associate
end subroutine plastic_dislotwin_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Calculate derived quantities from state.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_dependentState(T,instance,of)
integer, intent(in) :: &
instance, &
of
real(pReal), intent(in) :: &
T
real(pReal) :: &
sumf_twin,Gamma,sumf_trans
real(pReal), dimension(param(instance)%sum_N_sl) :: &
inv_lambda_sl_sl, & !< 1/mean free distance between 2 forest dislocations 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
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
f_over_t_tw
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
f_over_t_tr
real(pReal), dimension(:), allocatable :: &
x0
associate(prm => param(instance),&
stt => state(instance),&
dst => dependentState(instance))
sumf_twin = sum(stt%f_tw(1:prm%sum_N_tw,of))
sumf_trans = sum(stt%f_tr(1:prm%sum_N_tr,of))
Gamma = prm%SFE_0K + prm%dSFE_dT * T
!* rescaled volume fraction for topology
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 ! but this not
! ToDo ...Physically correct, but naming could be adjusted
inv_lambda_sl_sl = sqrt(matmul(prm%forestProjection, &
stt%rho_mob(:,of)+stt%rho_dip(:,of)))/prm%CLambdaSlip
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_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) &
inv_lambda_sl_tr = matmul(prm%h_sl_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: better logic needed here
dst%Lambda_sl(:,of) = prm%D &
/ (1.0_pReal+prm%D*(inv_lambda_sl_sl + inv_lambda_sl_tw + inv_lambda_sl_tr))
else
dst%Lambda_sl(:,of) = prm%D &
/ (1.0_pReal+prm%D*inv_lambda_sl_sl) !!!!!! correct?
endif
dst%Lambda_tw(:,of) = prm%i_tw*prm%D/(1.0_pReal+prm%D*inv_lambda_tw_tw)
dst%Lambda_tr(:,of) = prm%i_tr*prm%D/(1.0_pReal+prm%D*inv_lambda_tr_tr)
!* threshold stress for dislocation motion
dst%tau_pass(:,of) = prm%mu*prm%b_sl* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
!* threshold stress for growing twin/martensite
if(prm%sum_N_tw == prm%sum_N_sl) &
dst%tau_hat_tw(:,of) = Gamma/(3.0_pReal*prm%b_tw) &
+ 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) &
dst%tau_hat_tr(:,of) = Gamma/(3.0_pReal*prm%b_tr) &
+ 3.0_pReal*prm%b_tr*prm%mu/(prm%L_tr*prm%b_sl) & ! slip burgers here correct?
+ prm%h*prm%gamma_fcc_hex/ (3.0_pReal*prm%b_tr)
dst%V_tw(:,of) = (PI/4.0_pReal)*prm%t_tw*dst%Lambda_tw(:,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/(Gamma*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
dst%tau_r_tw(:,of) = prm%mu*prm%b_tw/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_twin)+cos(pi/3.0_pReal)/x0)
x0 = prm%mu*prm%b_tr**2.0_pReal/(Gamma*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
dst%tau_r_tr(:,of) = prm%mu*prm%b_tr/(2.0_pReal*PI)*(1.0_pReal/(x0+prm%xc_trans)+cos(pi/3.0_pReal)/x0)
end associate
end subroutine plastic_dislotwin_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief Write results to HDF5 output file.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
integer :: o
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('rho_mob')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_mob,'rho_mob',&
'mobile dislocation density','1/m²')
case('rho_dip')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip,'rho_dip',&
'dislocation dipole density''1/m²')
case('gamma_sl')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma_sl,'gamma_sl',&
'plastic shear','1')
case('lambda_sl')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case('tau_pass')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')
case('f_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,stt%f_tw,'f_tw',&
'twinned volume fraction','m³/m³')
case('lambda_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,dst%Lambda_tw,'Lambda_tw',&
'mean free path for twinning','m')
case('tau_hat_tw')
if(prm%sum_N_tw>0) call results_writeDataset(group,dst%tau_hat_tw,'tau_hat_tw',&
'threshold stress for twinning','Pa')
case('f_tr')
if(prm%sum_N_tr>0) call results_writeDataset(group,stt%f_tr,'f_tr',&
'martensite volume fraction','m³/m³')
end select
enddo outputsLoop
end associate
end subroutine plastic_dislotwin_results
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on slip systems, their derivatives with respect to resolved
! stress, and the resolved stress.
!> @details Derivatives and resolved stress are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_slip(Mp,T,instance,of, &
dot_gamma_sl,ddot_gamma_dtau_slip,tau_slip)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(out) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_sl), optional, intent(out) :: &
ddot_gamma_dtau_slip, &
tau_slip
real(pReal), dimension(param(instance)%sum_N_sl) :: &
ddot_gamma_dtau
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, &
stressRatio, &
StressRatio_p, &
BoltzmannRatio, &
v_wait_inverse, & !< inverse of the effective velocity of a dislocation waiting at obstacles (unsigned)
v_run_inverse, & !< inverse of the velocity of a free moving dislocation (unsigned)
dV_wait_inverse_dTau, &
dV_run_inverse_dTau, &
dV_dTau, &
tau_eff !< effective resolved stress
integer :: i
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_sl
tau(i) = math_tensordot(Mp,prm%P_sl(1:3,1:3,i))
enddo
tau_eff = abs(tau)-dst%tau_pass(:,of)
significantStress: where(tau_eff > tol_math_check)
stressRatio = tau_eff/prm%tau_0
StressRatio_p = stressRatio** prm%p
BoltzmannRatio = prm%Delta_F/(kB*T)
v_wait_inverse = prm%v0**(-1.0_pReal) * exp(BoltzmannRatio*(1.0_pReal-StressRatio_p)** prm%q)
v_run_inverse = prm%B/(tau_eff*prm%b_sl)
dot_gamma_sl = sign(stt%rho_mob(:,of)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau)
dV_wait_inverse_dTau = -1.0_pReal * v_wait_inverse * prm%p * prm%q * BoltzmannRatio &
* (stressRatio**(prm%p-1.0_pReal)) &
* (1.0_pReal-StressRatio_p)**(prm%q-1.0_pReal) &
/ prm%tau_0
dV_run_inverse_dTau = -1.0_pReal * v_run_inverse/tau_eff
dV_dTau = -1.0_pReal * (dV_wait_inverse_dTau+dV_run_inverse_dTau) &
/ (v_wait_inverse+v_run_inverse)**2.0_pReal
ddot_gamma_dtau = dV_dTau*stt%rho_mob(:,of)*prm%b_sl
else where significantStress
dot_gamma_sl = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_slip)) ddot_gamma_dtau_slip = ddot_gamma_dtau
if(present(tau_slip)) tau_slip = tau
end subroutine kinetics_slip
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on twin systems and their derivatives with respect to resolved
! stress.
!> @details Derivatives are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end.
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_twin(Mp,T,dot_gamma_sl,instance,of,&
dot_gamma_twin,ddot_gamma_dtau_twin)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tw), intent(out) :: &
dot_gamma_twin
real(pReal), dimension(param(instance)%sum_N_tw), optional, intent(out) :: &
ddot_gamma_dtau_twin
real, dimension(param(instance)%sum_N_tw) :: &
tau, &
Ndot0, &
stressRatio_r, &
ddot_gamma_dtau
integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_tw
tau(i) = math_tensordot(Mp,prm%P_tw(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i)
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))+&
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))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tw(i,of)-tau(i)))) ! P_ncs
else
Ndot0=0.0_pReal
end if
else isFCC
Ndot0=prm%dot_N_0_tw(i)
endif isFCC
enddo
significantStress: where(tau > tol_math_check)
StressRatio_r = (dst%tau_hat_tw(:,of)/tau)**prm%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
else where significantStress
dot_gamma_twin = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_twin)) ddot_gamma_dtau_twin = ddot_gamma_dtau
end subroutine kinetics_twin
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on transformation systems and their derivatives with respect to
! resolved stress.
!> @details Derivatives are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end.
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics_trans(Mp,T,dot_gamma_sl,instance,of,&
dot_gamma_tr,ddot_gamma_dtau_trans)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
dot_gamma_sl
real(pReal), dimension(param(instance)%sum_N_tr), intent(out) :: &
dot_gamma_tr
real(pReal), dimension(param(instance)%sum_N_tr), optional, intent(out) :: &
ddot_gamma_dtau_trans
real, dimension(param(instance)%sum_N_tr) :: &
tau, &
Ndot0, &
stressRatio_s, &
ddot_gamma_dtau
integer :: i,s1,s2
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do i = 1, prm%sum_N_tr
tau(i) = math_tensordot(Mp,prm%P_tr(1:3,1:3,i))
isFCC: if (prm%fccTwinTransNucleation) then
s1=prm%fcc_twinNucleationSlipPair(1,i)
s2=prm%fcc_twinNucleationSlipPair(2,i)
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))+&
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))*&
(1.0_pReal-exp(-prm%V_cs/(kB*T)*(dst%tau_r_tr(i,of)-tau(i)))) ! P_ncs
else
Ndot0=0.0_pReal
end if
else isFCC
Ndot0=prm%dot_N_0_tr(i)
endif isFCC
enddo
significantStress: where(tau > tol_math_check)
StressRatio_s = (dst%tau_hat_tr(:,of)/tau)**prm%s
dot_gamma_tr = dst%V_tr(:,of) * Ndot0*exp(-StressRatio_s)
ddot_gamma_dtau = (dot_gamma_tr*prm%s/tau)*StressRatio_s
else where significantStress
dot_gamma_tr = 0.0_pReal
ddot_gamma_dtau = 0.0_pReal
end where significantStress
end associate
if(present(ddot_gamma_dtau_trans)) ddot_gamma_dtau_trans = ddot_gamma_dtau
end subroutine kinetics_trans
end submodule plastic_dislotwin
# 42 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_disloUCLA.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @author David Cereceda, Lawrence Livermore National Laboratory
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief crystal plasticity model for bcc metals, especially Tungsten
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_disloUCLA
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
type :: tParameters
real(pReal) :: &
D = 1.0_pReal, & !< grain size
mu = 1.0_pReal, & !< equivalent shear modulus
D_0 = 1.0_pReal, & !< prefactor for self-diffusion coefficient
Q_cl = 1.0_pReal !< activation energy for dislocation climb
real(pReal), allocatable, dimension(:) :: &
b_sl, & !< magnitude of burgers vector [m]
D_a, &
i_sl, & !< Adj. parameter for distance between 2 forest dislocations
atomicVolume, &
tau_0, &
!* mobility law parameters
delta_F, & !< activation energy for glide [J]
v0, & !< dislocation velocity prefactor [m/s]
p, & !< p-exponent in glide velocity
q, & !< q-exponent in glide velocity
B, & !< friction coefficient
kink_height, & !< height of the kink pair
w, & !< width of the kink pair
omega !< attempt frequency for kink pair nucleation
real(pReal), allocatable, dimension(:,:) :: &
h_sl_sl, & !< slip resistance from slip activity
forestProjection
real(pReal), allocatable, dimension(:,:,:) :: &
P_sl, &
nonSchmid_pos, &
nonSchmid_neg
integer :: &
sum_N_sl !< total number of active slip system
character(len=pStringLen), allocatable, dimension(:) :: &
output
logical :: &
dipoleFormation !< flag indicating consideration of dipole formation
end type !< container type for internal constitutive parameters
type :: tDisloUCLAState
real(pReal), dimension(:,:), pointer :: &
rho_mob, &
rho_dip, &
gamma_sl
end type tDisloUCLAState
type :: tDisloUCLAdependentState
real(pReal), dimension(:,:), allocatable :: &
Lambda_sl, &
threshold_stress
end type tDisloUCLAdependentState
!--------------------------------------------------------------------------------------------------
! containers for parameters and state
type(tParameters), allocatable, dimension(:) :: param
type(tDisloUCLAState), allocatable, dimension(:) :: &
dotState, &
state
type(tDisloUCLAdependentState), allocatable, dimension(:) :: dependentState
contains
!--------------------------------------------------------------------------------------------------
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_init
integer :: &
Ninstance, &
p, i, &
NipcMyPhase, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
N_sl
real(pReal),dimension(:), allocatable :: &
rho_mob_0, & !< initial dislocation density
rho_dip_0, & !< initial dipole density
a !< non-Schmid coefficients
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Cereceda et al., International Journal of Plasticity 78:242–256, 2016'
write(6,'(a)') ' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOUCLA_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(dotState(Ninstance))
allocate(dependentState(Ninstance))
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_DISLOUCLA_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
dst => dependentState(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
!--------------------------------------------------------------------------------------------------
! slip related parameters
N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%P_sl = lattice_SchmidMatrix_slip(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if(trim(config%getString('lattice_structure')) == 'bcc') then
a = config%getFloats('nonschmid_coefficients',defaultVal = emptyRealArray)
prm%nonSchmid_pos = lattice_nonSchmidMatrix(N_sl,a,+1)
prm%nonSchmid_neg = lattice_nonSchmidMatrix(N_sl,a,-1)
else
prm%nonSchmid_pos = prm%P_sl
prm%nonSchmid_neg = prm%P_sl
endif
prm%h_sl_sl = lattice_interaction_SlipBySlip(N_sl,config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection = lattice_forestProjection_edge(N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection = transpose(prm%forestProjection)
rho_mob_0 = config%getFloats('rhoedge0', requiredSize=size(N_sl))
rho_dip_0 = config%getFloats('rhoedgedip0', requiredSize=size(N_sl))
prm%v0 = config%getFloats('v0', requiredSize=size(N_sl))
prm%b_sl = config%getFloats('slipburgers', requiredSize=size(N_sl))
prm%delta_F = config%getFloats('qedge', requiredSize=size(N_sl))
prm%i_sl = config%getFloats('clambdaslip', requiredSize=size(N_sl))
prm%tau_0 = config%getFloats('tau_peierls', requiredSize=size(N_sl))
prm%p = config%getFloats('p_slip', requiredSize=size(N_sl), &
defaultVal=[(1.0_pReal,i=1,size(N_sl))])
prm%q = config%getFloats('q_slip', requiredSize=size(N_sl), &
defaultVal=[(1.0_pReal,i=1,size(N_sl))])
prm%kink_height = config%getFloats('kink_height', requiredSize=size(N_sl))
prm%w = config%getFloats('kink_width', requiredSize=size(N_sl))
prm%omega = config%getFloats('omega', requiredSize=size(N_sl))
prm%B = config%getFloats('friction_coeff', requiredSize=size(N_sl))
prm%D = config%getFloat('grainsize')
prm%D_0 = config%getFloat('d0')
prm%Q_cl = config%getFloat('qsd')
prm%atomicVolume = config%getFloat('catomicvolume') * prm%b_sl**3.0_pReal
prm%D_a = config%getFloat('cedgedipmindistance') * prm%b_sl
prm%dipoleformation = config%getFloat('dipoleformationfactor') > 0.0_pReal !should be on by default, ToDo: change to /key/-type key
! expand: family => system
rho_mob_0 = math_expand(rho_mob_0, N_sl)
rho_dip_0 = math_expand(rho_dip_0, N_sl)
prm%q = math_expand(prm%q, N_sl)
prm%p = math_expand(prm%p, N_sl)
prm%delta_F = math_expand(prm%delta_F, N_sl)
prm%b_sl = math_expand(prm%b_sl, N_sl)
prm%kink_height = math_expand(prm%kink_height, N_sl)
prm%w = math_expand(prm%w, N_sl)
prm%omega = math_expand(prm%omega, N_sl)
prm%tau_0 = math_expand(prm%tau_0, N_sl)
prm%v0 = math_expand(prm%v0, N_sl)
prm%B = math_expand(prm%B, N_sl)
prm%i_sl = math_expand(prm%i_sl, N_sl)
prm%atomicVolume = math_expand(prm%atomicVolume, N_sl)
prm%D_a = math_expand(prm%D_a, N_sl)
! sanity checks
if ( prm%D_0 <= 0.0_pReal) extmsg = trim(extmsg)//' D_0'
if ( prm%Q_cl <= 0.0_pReal) extmsg = trim(extmsg)//' Q_cl'
if (any(rho_mob_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoedge0'
if (any(rho_dip_0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoedgedip0'
if (any(prm%v0 < 0.0_pReal)) extmsg = trim(extmsg)//' v0'
if (any(prm%b_sl <= 0.0_pReal)) extmsg = trim(extmsg)//' b_sl'
if (any(prm%delta_F <= 0.0_pReal)) extmsg = trim(extmsg)//' qedge'
if (any(prm%tau_0 < 0.0_pReal)) extmsg = trim(extmsg)//' tau_0'
if (any(prm%D_a <= 0.0_pReal)) extmsg = trim(extmsg)//' cedgedipmindistance or b_sl'
if (any(prm%atomicVolume <= 0.0_pReal)) extmsg = trim(extmsg)//' catomicvolume or b_sl'
else slipActive
rho_mob_0= emptyRealArray; rho_dip_0 = emptyRealArray
allocate(prm%b_sl,prm%D_a,prm%i_sl,prm%atomicVolume,prm%tau_0, &
prm%delta_F,prm%v0,prm%p,prm%q,prm%B,prm%kink_height,prm%w,prm%omega, &
source = emptyRealArray)
allocate(prm%forestProjection(0,0))
allocate(prm%h_sl_sl (0,0))
endif slipActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt == p) * discretization_nIP
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl
sizeState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob => plasticState(p)%state(startIndex:endIndex,:)
stt%rho_mob = spread(rho_mob_0,2,NipcMyPhase)
dot%rho_mob => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(p)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip => plasticState(p)%state(startIndex:endIndex,:)
stt%rho_dip = spread(rho_dip_0,2,NipcMyPhase)
dot%rho_dip => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = config%getFloat('atol_rho',defaultVal=1.0_pReal)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%gamma_sl => plasticState(p)%state(startIndex:endIndex,:)
dot%gamma_sl => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%atol(startIndex:endIndex) = 1.0e-2_pReal
! global alias
plasticState(p)%slipRate => plasticState(p)%dotState(startIndex:endIndex,:)
allocate(dst%Lambda_sl(prm%sum_N_sl,NipcMyPhase), source=0.0_pReal)
allocate(dst%threshold_stress(prm%sum_N_sl,NipcMyPhase), source=0.0_pReal)
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_DISLOUCLA_LABEL//')')
enddo
end subroutine plastic_disloUCLA_init
!--------------------------------------------------------------------------------------------------
!> @brief Calculate plastic velocity gradient and its tangent.
!--------------------------------------------------------------------------------------------------
pure module subroutine plastic_disloUCLA_LpAndItsTangent(Lp,dLp_dMp, &
Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
integer :: &
i,k,l,m,n
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_pos,dot_gamma_neg, &
ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
associate(prm => param(instance))
call kinetics(Mp,T,instance,of,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
do i = 1, prm%sum_N_sl
Lp = Lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
forall (k=1:3,l=1:3,m=1:3,n=1:3) &
dLp_dMp(k,l,m,n) = dLp_dMp(k,l,m,n) &
+ ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%nonSchmid_pos(m,n,i) &
+ ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%nonSchmid_neg(m,n,i)
enddo
end associate
end subroutine plastic_disloUCLA_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief Calculate the rate of change of microstructure.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_dotState(Mp,T,instance,of)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal) :: &
VacancyDiffusion
real(pReal), dimension(param(instance)%sum_N_sl) :: &
gdot_pos, gdot_neg,&
tau_pos,&
tau_neg, &
v_cl, &
dot_rho_dip_formation, &
dot_rho_dip_climb, &
dip_distance
associate(prm => param(instance), stt => state(instance),dot => dotState(instance), dst => dependentState(instance))
call kinetics(Mp,T,instance,of,&
gdot_pos,gdot_neg, &
tau_pos_out = tau_pos,tau_neg_out = tau_neg)
dot%gamma_sl(:,of) = (gdot_pos+gdot_neg) ! ToDo: needs to be abs
VacancyDiffusion = prm%D_0*exp(-prm%Q_cl/(kB*T))
where(dEq0(tau_pos)) ! ToDo: use avg of pos and neg
dot_rho_dip_formation = 0.0_pReal
dot_rho_dip_climb = 0.0_pReal
else where
dip_distance = math_clip(3.0_pReal*prm%mu*prm%b_sl/(16.0_pReal*PI*abs(tau_pos)), &
prm%D_a, & ! lower limit
dst%Lambda_sl(:,of)) ! upper limit
dot_rho_dip_formation = merge(2.0_pReal*dip_distance* stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))/prm%b_sl, & ! ToDo: ignore region of spontaneous annihilation
0.0_pReal, &
prm%dipoleformation)
v_cl = (3.0_pReal*prm%mu*VacancyDiffusion*prm%atomicVolume/(2.0_pReal*pi*kB*T)) &
* (1.0_pReal/(dip_distance+prm%D_a))
dot_rho_dip_climb = (4.0_pReal*v_cl*stt%rho_dip(:,of))/(dip_distance-prm%D_a) ! ToDo: Discuss with Franz: Stress dependency?
end where
dot%rho_mob(:,of) = abs(dot%gamma_sl(:,of))/(prm%b_sl*dst%Lambda_sl(:,of)) & ! multiplication
- dot_rho_dip_formation &
- (2.0_pReal*prm%D_a)/prm%b_sl*stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of)) ! Spontaneous annihilation of 2 single edge dislocations
dot%rho_dip(:,of) = dot_rho_dip_formation &
- (2.0_pReal*prm%D_a)/prm%b_sl*stt%rho_dip(:,of)*abs(dot%gamma_sl(:,of)) & ! Spontaneous annihilation of a single edge dislocation with a dipole constituent
- dot_rho_dip_climb
end associate
end subroutine plastic_disloUCLA_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Calculate derived quantities from state.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_dependentState(instance,of)
integer, intent(in) :: &
instance, &
of
real(pReal), dimension(param(instance)%sum_N_sl) :: &
dislocationSpacing
associate(prm => param(instance), stt => state(instance),dst => dependentState(instance))
dislocationSpacing = sqrt(matmul(prm%forestProjection,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
dst%threshold_stress(:,of) = prm%mu*prm%b_sl &
* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
dst%Lambda_sl(:,of) = prm%D/(1.0_pReal+prm%D*dislocationSpacing/prm%i_sl)
end associate
end subroutine plastic_disloUCLA_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief Write results to HDF5 output file.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
integer :: o
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('edge_density') ! ToDo: should be rho_mob
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_mob,'rho_mob',&
'mobile dislocation density','1/m²')
case('dipole_density') ! ToDo: should be rho_dip
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip,'rho_dip',&
'dislocation dipole density''1/m²')
case('shear_rate_slip') ! should be gamma
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',& ! this is not dot!!
'plastic shear','1')
case('mfp_slip') !ToDo: should be Lambda
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',&
'mean free path for slip','m')
case('threshold_stress_slip') !ToDo: should be tau_pass
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%threshold_stress,'tau_pass',&
'threshold stress for slip','Pa')
end select
enddo outputsLoop
end associate
end subroutine plastic_disloUCLA_results
!--------------------------------------------------------------------------------------------------
!> @brief Calculate shear rates on slip systems, their derivatives with respect to resolved
! stress, and the resolved stress.
!> @details Derivatives and resolved stress are calculated only optionally.
! NOTE: Against the common convention, the result (i.e. intent(out)) variables are the last to
! have the optional arguments at the end
!--------------------------------------------------------------------------------------------------
pure subroutine kinetics(Mp,T,instance,of, &
dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg,tau_pos_out,tau_neg_out)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T !< temperature
integer, intent(in) :: &
instance, &
of
real(pReal), intent(out), dimension(param(instance)%sum_N_sl) :: &
dot_gamma_pos, &
dot_gamma_neg
real(pReal), intent(out), optional, dimension(param(instance)%sum_N_sl) :: &
ddot_gamma_dtau_pos, &
ddot_gamma_dtau_neg, &
tau_pos_out, &
tau_neg_out
real(pReal), dimension(param(instance)%sum_N_sl) :: &
StressRatio, &
StressRatio_p,StressRatio_pminus1, &
dvel, vel, &
tau_pos,tau_neg, &
t_n, t_k, dtk,dtn, &
needsGoodName ! ToDo: @Karo: any idea?
integer :: j
associate(prm => param(instance), stt => state(instance), dst => dependentState(instance))
do j = 1, prm%sum_N_sl
tau_pos(j) = math_tensordot(Mp,prm%nonSchmid_pos(1:3,1:3,j))
tau_neg(j) = math_tensordot(Mp,prm%nonSchmid_neg(1:3,1:3,j))
enddo
if (present(tau_pos_out)) tau_pos_out = tau_pos
if (present(tau_neg_out)) tau_neg_out = tau_neg
associate(BoltzmannRatio => prm%delta_F/(kB*T), &
dot_gamma_0 => stt%rho_mob(:,of)*prm%b_sl*prm%v0, &
effectiveLength => dst%Lambda_sl(:,of) - prm%w)
significantPositiveTau: where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
StressRatio = (abs(tau_pos)-dst%threshold_stress(:,of))/prm%tau_0
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
needsGoodName = exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)
t_n = prm%b_sl/(needsGoodName*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
vel = prm%kink_height/(t_n + t_k)
dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_pReal
else where significantPositiveTau
dot_gamma_pos = 0.0_pReal
end where significantPositiveTau
if (present(ddot_gamma_dtau_pos)) then
significantPositiveTau2: where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_0
dtk = -1.0_pReal * t_k / tau_pos
dvel = -1.0_pReal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_pReal
else where significantPositiveTau2
ddot_gamma_dtau_pos = 0.0_pReal
end where significantPositiveTau2
endif
significantNegativeTau: where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
StressRatio = (abs(tau_neg)-dst%threshold_stress(:,of))/prm%tau_0
StressRatio_p = StressRatio** prm%p
StressRatio_pminus1 = StressRatio**(prm%p-1.0_pReal)
needsGoodName = exp(-BoltzmannRatio*(1-StressRatio_p) ** prm%q)
t_n = prm%b_sl/(needsGoodName*prm%omega*effectiveLength)
t_k = effectiveLength * prm%B /(2.0_pReal*prm%b_sl*tau_pos)
vel = prm%kink_height/(t_n + t_k)
dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_pReal
else where significantNegativeTau
dot_gamma_neg = 0.0_pReal
end where significantNegativeTau
if (present(ddot_gamma_dtau_neg)) then
significantNegativeTau2: where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
dtn = -1.0_pReal * t_n * BoltzmannRatio * prm%p * prm%q * (1.0_pReal-StressRatio_p)**(prm%q - 1.0_pReal) &
* (StressRatio)**(prm%p - 1.0_pReal) / prm%tau_0
dtk = -1.0_pReal * t_k / tau_neg
dvel = -1.0_pReal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_pReal
ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_pReal
else where significantNegativeTau2
ddot_gamma_dtau_neg = 0.0_pReal
end where significantNegativeTau2
end if
end associate
end associate
end subroutine kinetics
end submodule plastic_disloUCLA
# 43 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine for plasticity including dislocation flux
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_nonlocal
use geometry_plastic_nonlocal, only: &
nIPneighbors => geometry_plastic_nonlocal_nIPneighbors, &
IPneighborhood => geometry_plastic_nonlocal_IPneighborhood, &
IPvolume => geometry_plastic_nonlocal_IPvolume0, &
IParea => geometry_plastic_nonlocal_IParea0, &
IPareaNormal => geometry_plastic_nonlocal_IPareaNormal0
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
! storage order of dislocation types
integer, dimension(8), parameter :: &
sgl = [1,2,3,4,5,6,7,8] !< signed (single)
integer, dimension(5), parameter :: &
edg = [1,2,5,6,9], & !< edge
scr = [3,4,7,8,10] !< screw
integer, dimension(4), parameter :: &
mob = [1,2,3,4], & !< mobile
imm = [5,6,7,8] !< immobile (blocked)
integer, dimension(2), parameter :: &
dip = [9,10], & !< dipole
imm_edg = imm(1:2), & !< immobile edge
imm_scr = imm(3:4) !< immobile screw
integer, parameter :: &
mob_edg_pos = 1, & !< mobile edge positive
mob_edg_neg = 2, & !< mobile edge negative
mob_scr_pos = 3, & !< mobile screw positive
mob_scr_neg = 4 !< mobile screw positive
! BEGIN DEPRECATED
integer, dimension(:,:,:), allocatable :: &
iRhoU, & !< state indices for unblocked density
iV, & !< state indices for dislcation velocities
iD !< state indices for stable dipole height
!END DEPRECATED
real(pReal), dimension(:,:,:,:,:,:), allocatable :: &
compatibility !< slip system compatibility between me and my neighbors
type :: tInitialParameters !< container type for internal constitutive parameters
real(pReal) :: &
rhoSglScatter, & !< standard deviation of scatter in initial dislocation density
rhoSglRandom, &
rhoSglRandomBinning
real(pReal), dimension(:), allocatable :: &
rhoSglEdgePos0, & !< initial edge_pos dislocation density
rhoSglEdgeNeg0, & !< initial edge_neg dislocation density
rhoSglScrewPos0, & !< initial screw_pos dislocation density
rhoSglScrewNeg0, & !< initial screw_neg dislocation density
rhoDipEdge0, & !< initial edge dipole dislocation density
rhoDipScrew0 !< initial screw dipole dislocation density
integer, dimension(:) ,allocatable :: &
N_sl
end type tInitialParameters
type :: tParameters !< container type for internal constitutive parameters
real(pReal) :: &
atomicVolume, & !< atomic volume
Dsd0, & !< prefactor for self-diffusion coefficient
selfDiffusionEnergy, & !< activation enthalpy for diffusion
atol_rho, & !< absolute tolerance for dislocation density in state integration
significantRho, & !< density considered significant
significantN, & !< number of dislocations considered significant
doublekinkwidth, & !< width of a doubkle kink in multiples of the burgers vector length b
solidSolutionEnergy, & !< activation energy for solid solution in J
solidSolutionSize, & !< solid solution obstacle size in multiples of the burgers vector length
solidSolutionConcentration, & !< concentration of solid solution in atomic parts
p, & !< parameter for kinetic law (Kocks,Argon,Ashby)
q, & !< parameter for kinetic law (Kocks,Argon,Ashby)
viscosity, & !< viscosity for dislocation glide in Pa s
fattack, & !< attack frequency in Hz
surfaceTransmissivity, & !< transmissivity at free surface
grainboundaryTransmissivity, & !< transmissivity at grain boundary (identified by different texture)
CFLfactor, & !< safety factor for CFL flux condition
fEdgeMultiplication, & !< factor that determines how much edge dislocations contribute to multiplication (0...1)
linetensionEffect, &
edgeJogFactor, &
mu, &
nu
real(pReal), dimension(:), allocatable :: &
minDipoleHeight_edge, & !< minimum stable edge dipole height
minDipoleHeight_screw, & !< minimum stable screw dipole height
peierlsstress_edge, &
peierlsstress_screw, &
lambda0, & !< mean free path prefactor for each
burgers !< absolute length of burgers vector [m]
real(pReal), dimension(:,:), allocatable :: &
slip_normal, &
slip_direction, &
slip_transverse, &
minDipoleHeight, & ! edge and screw
peierlsstress, & ! edge and screw
interactionSlipSlip ,& !< coefficients for slip-slip interaction
forestProjection_Edge, & !< matrix of forest projections of edge dislocations
forestProjection_Screw !< matrix of forest projections of screw dislocations
real(pReal), dimension(:,:,:), allocatable :: &
Schmid, & !< Schmid contribution
nonSchmid_pos, &
nonSchmid_neg !< combined projection of Schmid and non-Schmid contributions to the resolved shear stress (only for screws)
integer :: &
sum_N_sl
integer, dimension(:), allocatable :: &
colinearSystem !< colinear system to the active slip system (only valid for fcc!)
character(len=pStringLen), dimension(:), allocatable :: &
output
logical :: &
shortRangeStressCorrection, & !< use of short range stress correction by excess density gradient term
nonSchmidActive = .false.
end type tParameters
type :: tNonlocalMicrostructure
real(pReal), allocatable, dimension(:,:) :: &
tau_pass, &
tau_Back
end type tNonlocalMicrostructure
type :: tNonlocalState
real(pReal), pointer, dimension(:,:) :: &
rho, & ! < all dislocations
rhoSgl, &
rhoSglMobile, & ! iRhoU
rho_sgl_mob_edg_pos, &
rho_sgl_mob_edg_neg, &
rho_sgl_mob_scr_pos, &
rho_sgl_mob_scr_neg, &
rhoSglImmobile, &
rho_sgl_imm_edg_pos, &
rho_sgl_imm_edg_neg, &
rho_sgl_imm_scr_pos, &
rho_sgl_imm_scr_neg, &
rhoDip, &
rho_dip_edg, &
rho_dip_scr, &
rho_forest, &
gamma, &
v, &
v_edg_pos, &
v_edg_neg, &
v_scr_pos, &
v_scr_neg
end type tNonlocalState
type(tNonlocalState), allocatable, dimension(:) :: &
deltaState, &
dotState, &
state, &
state0
type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstance)
type(tNonlocalMicrostructure), dimension(:), allocatable :: microstructure
contains
!--------------------------------------------------------------------------------------------------
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_init
integer :: &
Ninstance, &
p, &
NipcMyPhase, &
sizeState, sizeDotState, sizeDependentState, sizeDeltaState, &
s1, s2, &
s, t, l
real(pReal), dimension(:), allocatable :: &
a
character(len=pStringLen) :: &
extmsg = ''
type(tInitialParameters) :: &
ini
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' Reuber et al., Acta Materialia 71:333–348, 2014'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2014.03.012'
write(6,'(/,a)') ' Kords, Dissertation RWTH Aachen, 2014'
write(6,'(a)') ' http://publications.rwth-aachen.de/record/229993'
Ninstance = count(phase_plasticity == PLASTICITY_NONLOCAL_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
allocate(param(Ninstance))
allocate(state(Ninstance))
allocate(state0(Ninstance))
allocate(dotState(Ninstance))
allocate(deltaState(Ninstance))
allocate(microstructure(Ninstance))
do p=1, size(config_phase)
if (phase_plasticity(p) /= PLASTICITY_NONLOCAL_ID) cycle
associate(prm => param(phase_plasticityInstance(p)), &
dot => dotState(phase_plasticityInstance(p)), &
stt => state(phase_plasticityInstance(p)), &
st0 => state0(phase_plasticityInstance(p)), &
del => deltaState(phase_plasticityInstance(p)), &
dst => microstructure(phase_plasticityInstance(p)), &
config => config_phase(p))
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
prm%atol_rho = config%getFloat('atol_rho',defaultVal=1.0e4_pReal)
! This data is read in already in lattice
prm%mu = lattice_mu(p)
prm%nu = lattice_nu(p)
ini%N_sl = config%getInts('nslip',defaultVal=emptyIntArray)
prm%sum_N_sl = sum(abs(ini%N_sl))
slipActive: if (prm%sum_N_sl > 0) then
prm%Schmid = lattice_SchmidMatrix_slip(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
if(trim(config%getString('lattice_structure')) == 'bcc') then
a = config%getFloats('nonschmid_coefficients',defaultVal = emptyRealArray)
if(size(a) > 0) prm%nonSchmidActive = .true.
prm%nonSchmid_pos = lattice_nonSchmidMatrix(ini%N_sl,a,+1)
prm%nonSchmid_neg = lattice_nonSchmidMatrix(ini%N_sl,a,-1)
else
prm%nonSchmid_pos = prm%Schmid
prm%nonSchmid_neg = prm%Schmid
endif
prm%interactionSlipSlip = lattice_interaction_SlipBySlip(ini%N_sl, &
config%getFloats('interaction_slipslip'), &
config%getString('lattice_structure'))
prm%forestProjection_edge = lattice_forestProjection_edge (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%forestProjection_screw = lattice_forestProjection_screw(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_direction = lattice_slip_direction (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_transverse = lattice_slip_transverse(ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
prm%slip_normal = lattice_slip_normal (ini%N_sl,config%getString('lattice_structure'),&
config%getFloat('c/a',defaultVal=0.0_pReal))
! collinear systems (only for octahedral slip systems in fcc)
allocate(prm%colinearSystem(prm%sum_N_sl), source = -1)
do s1 = 1, prm%sum_N_sl
do s2 = 1, prm%sum_N_sl
if (all(dEq0 (math_cross(prm%slip_direction(1:3,s1),prm%slip_direction(1:3,s2)))) .and. &
any(dNeq0(math_cross(prm%slip_normal (1:3,s1),prm%slip_normal (1:3,s2))))) &
prm%colinearSystem(s1) = s2
enddo
enddo
ini%rhoSglEdgePos0 = config%getFloats('rhosgledgepos0', requiredSize=size(ini%N_sl))
ini%rhoSglEdgeNeg0 = config%getFloats('rhosgledgeneg0', requiredSize=size(ini%N_sl))
ini%rhoSglScrewPos0 = config%getFloats('rhosglscrewpos0', requiredSize=size(ini%N_sl))
ini%rhoSglScrewNeg0 = config%getFloats('rhosglscrewneg0', requiredSize=size(ini%N_sl))
ini%rhoDipEdge0 = config%getFloats('rhodipedge0', requiredSize=size(ini%N_sl))
ini%rhoDipScrew0 = config%getFloats('rhodipscrew0', requiredSize=size(ini%N_sl))
prm%lambda0 = config%getFloats('lambda0', requiredSize=size(ini%N_sl))
prm%burgers = config%getFloats('burgers', requiredSize=size(ini%N_sl))
prm%lambda0 = math_expand(prm%lambda0,ini%N_sl)
prm%burgers = math_expand(prm%burgers,ini%N_sl)
prm%minDipoleHeight_edge = config%getFloats('minimumdipoleheightedge', requiredSize=size(ini%N_sl))
prm%minDipoleHeight_screw = config%getFloats('minimumdipoleheightscrew', requiredSize=size(ini%N_sl))
prm%minDipoleHeight_edge = math_expand(prm%minDipoleHeight_edge, ini%N_sl)
prm%minDipoleHeight_screw = math_expand(prm%minDipoleHeight_screw,ini%N_sl)
allocate(prm%minDipoleHeight(prm%sum_N_sl,2))
prm%minDipoleHeight(:,1) = prm%minDipoleHeight_edge
prm%minDipoleHeight(:,2) = prm%minDipoleHeight_screw
prm%peierlsstress_edge = config%getFloats('peierlsstressedge', requiredSize=size(ini%N_sl))
prm%peierlsstress_screw = config%getFloats('peierlsstressscrew', requiredSize=size(ini%N_sl))
prm%peierlsstress_edge = math_expand(prm%peierlsstress_edge, ini%N_sl)
prm%peierlsstress_screw = math_expand(prm%peierlsstress_screw,ini%N_sl)
allocate(prm%peierlsstress(prm%sum_N_sl,2))
prm%peierlsstress(:,1) = prm%peierlsstress_edge
prm%peierlsstress(:,2) = prm%peierlsstress_screw
prm%significantRho = config%getFloat('significantrho')
prm%significantN = config%getFloat('significantn', 0.0_pReal)
prm%CFLfactor = config%getFloat('cflfactor',defaultVal=2.0_pReal)
prm%atomicVolume = config%getFloat('atomicvolume')
prm%Dsd0 = config%getFloat('selfdiffusionprefactor') !,'dsd0'
prm%selfDiffusionEnergy = config%getFloat('selfdiffusionenergy') !,'qsd'
prm%linetensionEffect = config%getFloat('linetension')
prm%edgeJogFactor = config%getFloat('edgejog')!,'edgejogs'
prm%doublekinkwidth = config%getFloat('doublekinkwidth')
prm%solidSolutionEnergy = config%getFloat('solidsolutionenergy')
prm%solidSolutionSize = config%getFloat('solidsolutionsize')
prm%solidSolutionConcentration = config%getFloat('solidsolutionconcentration')
prm%p = config%getFloat('p')
prm%q = config%getFloat('q')
prm%viscosity = config%getFloat('viscosity')
prm%fattack = config%getFloat('attackfrequency')
! ToDo: discuss logic
ini%rhoSglScatter = config%getFloat('rhosglscatter')
ini%rhoSglRandom = config%getFloat('rhosglrandom',0.0_pReal)
if (config%keyExists('/rhosglrandom/')) &
ini%rhoSglRandomBinning = config%getFloat('rhosglrandombinning',0.0_pReal) !ToDo: useful default?
! if (rhoSglRandom(instance) < 0.0_pReal) &
! if (rhoSglRandomBinning(instance) <= 0.0_pReal) &
prm%surfaceTransmissivity = config%getFloat('surfacetransmissivity',defaultVal=1.0_pReal)
prm%grainboundaryTransmissivity = config%getFloat('grainboundarytransmissivity',defaultVal=-1.0_pReal)
prm%fEdgeMultiplication = config%getFloat('edgemultiplication')
prm%shortRangeStressCorrection = config%keyExists('/shortrangestresscorrection/')
!--------------------------------------------------------------------------------------------------
! sanity checks
if (any(prm%burgers < 0.0_pReal)) extmsg = trim(extmsg)//' burgers'
if (any(prm%lambda0 <= 0.0_pReal)) extmsg = trim(extmsg)//' lambda0'
if (any(ini%rhoSglEdgePos0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglEdgePos0'
if (any(ini%rhoSglEdgeNeg0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglEdgeNeg0'
if (any(ini%rhoSglScrewPos0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglScrewPos0'
if (any(ini%rhoSglScrewNeg0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoSglScrewNeg0'
if (any(ini%rhoDipEdge0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoDipEdge0'
if (any(ini%rhoDipScrew0 < 0.0_pReal)) extmsg = trim(extmsg)//' rhoDipScrew0'
if (any(prm%peierlsstress < 0.0_pReal)) extmsg = trim(extmsg)//' peierlsstress'
if (any(prm%minDipoleHeight < 0.0_pReal)) extmsg = trim(extmsg)//' minDipoleHeight'
if (prm%viscosity <= 0.0_pReal) extmsg = trim(extmsg)//' viscosity'
if (prm%selfDiffusionEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' selfDiffusionEnergy'
if (prm%fattack <= 0.0_pReal) extmsg = trim(extmsg)//' fattack'
if (prm%doublekinkwidth <= 0.0_pReal) extmsg = trim(extmsg)//' doublekinkwidth'
if (prm%Dsd0 < 0.0_pReal) extmsg = trim(extmsg)//' Dsd0'
if (prm%atomicVolume <= 0.0_pReal) extmsg = trim(extmsg)//' atomicVolume' ! ToDo: in disloUCLA, the atomic volume is given as a factor
if (prm%significantN < 0.0_pReal) extmsg = trim(extmsg)//' significantN'
if (prm%significantrho < 0.0_pReal) extmsg = trim(extmsg)//' significantrho'
if (prm%atol_rho < 0.0_pReal) extmsg = trim(extmsg)//' atol_rho'
if (prm%CFLfactor < 0.0_pReal) extmsg = trim(extmsg)//' CFLfactor'
if (prm%p <= 0.0_pReal .or. prm%p > 1.0_pReal) extmsg = trim(extmsg)//' p'
if (prm%q < 1.0_pReal .or. prm%q > 2.0_pReal) extmsg = trim(extmsg)//' q'
if (prm%linetensionEffect < 0.0_pReal .or. prm%linetensionEffect > 1.0_pReal) &
extmsg = trim(extmsg)//' linetensionEffect'
if (prm%edgeJogFactor < 0.0_pReal .or. prm%edgeJogFactor > 1.0_pReal) &
extmsg = trim(extmsg)//' edgeJogFactor'
if (prm%solidSolutionEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionEnergy'
if (prm%solidSolutionSize <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionSize'
if (prm%solidSolutionConcentration <= 0.0_pReal) extmsg = trim(extmsg)//' solidSolutionConcentration'
if (prm%grainboundaryTransmissivity > 1.0_pReal) extmsg = trim(extmsg)//' grainboundaryTransmissivity'
if (prm%surfaceTransmissivity < 0.0_pReal .or. prm%surfaceTransmissivity > 1.0_pReal) &
extmsg = trim(extmsg)//' surfaceTransmissivity'
if (prm%fEdgeMultiplication < 0.0_pReal .or. prm%fEdgeMultiplication > 1.0_pReal) &
extmsg = trim(extmsg)//' fEdgeMultiplication'
endif slipActive
!--------------------------------------------------------------------------------------------------
! allocate state arrays
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', &
'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', &
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
'rhoSglScrewPosImmobile','rhoSglScrewNegImmobile', &
'rhoDipEdge ','rhoDipScrew ', &
'gamma ' ]) * prm%sum_N_sl !< "basic" microstructural state variables that are independent from other state variables
sizeDependentState = size([ 'rhoForest ']) * prm%sum_N_sl !< microstructural state variables that depend on other state variables
sizeState = sizeDotState + sizeDependentState &
+ size([ 'velocityEdgePos ','velocityEdgeNeg ', &
'velocityScrewPos ','velocityScrewNeg ', &
'maxDipoleHeightEdge ','maxDipoleHeightScrew' ]) * prm%sum_N_sl !< other dependent state variables that are not updated by microstructure
sizeDeltaState = sizeDotState
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,sizeDeltaState)
plasticState(p)%nonlocal = .true.
plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention
st0%rho => plasticState(p)%state0 (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%rho => plasticState(p)%state (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rho => plasticState(p)%dotState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rho => plasticState(p)%deltaState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
plasticState(p)%atol(1:10*prm%sum_N_sl) = prm%atol_rho
stt%rhoSgl => plasticState(p)%state (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rhoSgl => plasticState(p)%dotState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rhoSgl => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rhoSglMobile => plasticState(p)%state (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
dot%rhoSglMobile => plasticState(p)%dotState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
del%rhoSglMobile => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
stt%rho_sgl_mob_edg_pos => plasticState(p)%state (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
dot%rho_sgl_mob_edg_pos => plasticState(p)%dotState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
del%rho_sgl_mob_edg_pos => plasticState(p)%deltaState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
stt%rho_sgl_mob_edg_neg => plasticState(p)%state (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
dot%rho_sgl_mob_edg_neg => plasticState(p)%dotState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
del%rho_sgl_mob_edg_neg => plasticState(p)%deltaState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
stt%rhoSglImmobile => plasticState(p)%state (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rhoSglImmobile => plasticState(p)%dotState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
del%rho_sgl_imm_edg_pos => plasticState(p)%deltaState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
del%rho_sgl_imm_edg_neg => plasticState(p)%deltaState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
stt%rhoDip => plasticState(p)%state (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rhoDip => plasticState(p)%dotState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rhoDip => plasticState(p)%deltaState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%rho_dip_edg => plasticState(p)%state (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
dot%rho_dip_edg => plasticState(p)%dotState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
del%rho_dip_edg => plasticState(p)%deltaState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
stt%rho_dip_scr => plasticState(p)%state (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
dot%rho_dip_scr => plasticState(p)%dotState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rho_dip_scr => plasticState(p)%deltaState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%gamma => plasticState(p)%state (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
dot%gamma => plasticState(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
del%gamma => plasticState(p)%deltaState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
plasticState(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl ) = config%getFloat('atol_gamma', defaultVal = 1.0e-2_pReal)
if(any(plasticState(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl) < 0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma'
plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:NipcMyPhase)
stt%rho_forest => plasticState(p)%state (11*prm%sum_N_sl + 1:12*prm%sum_N_sl,1:NipcMyPhase)
stt%v => plasticState(p)%state (12*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:NipcMyPhase)
stt%v_edg_pos => plasticState(p)%state (12*prm%sum_N_sl + 1:13*prm%sum_N_sl,1:NipcMyPhase)
stt%v_edg_neg => plasticState(p)%state (13*prm%sum_N_sl + 1:14*prm%sum_N_sl,1:NipcMyPhase)
stt%v_scr_pos => plasticState(p)%state (14*prm%sum_N_sl + 1:15*prm%sum_N_sl,1:NipcMyPhase)
stt%v_scr_neg => plasticState(p)%state (15*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:NipcMyPhase)
allocate(dst%tau_pass(prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
allocate(dst%tau_back(prm%sum_N_sl,NipcMyPhase),source=0.0_pReal)
end associate
if (NipcMyPhase > 0) call stateInit(ini,p,NipcMyPhase)
plasticState(p)%state0 = plasticState(p)%state
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_NONLOCAL_LABEL//')')
enddo
allocate(compatibility(2,maxval(param%sum_N_sl),maxval(param%sum_N_sl),nIPneighbors,&
discretization_nIP,discretization_nElem), source=0.0_pReal)
! BEGIN DEPRECATED----------------------------------------------------------------------------------
allocate(iRhoU(maxval(param%sum_N_sl),4,Ninstance), source=0)
allocate(iV(maxval(param%sum_N_sl),4,Ninstance), source=0)
allocate(iD(maxval(param%sum_N_sl),2,Ninstance), source=0)
initializeInstances: do p = 1, size(phase_plasticity)
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
myPhase2: if (phase_plasticity(p) == PLASTICITY_NONLOCAL_ID) then
l = 0
do t = 1,4
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iRhoU(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
l = l + (4+2+1+1)*param(phase_plasticityInstance(p))%sum_N_sl ! immobile(4), dipole(2), shear, forest
do t = 1,4
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iV(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
do t = 1,2
do s = 1,param(phase_plasticityInstance(p))%sum_N_sl
l = l + 1
iD(s,t,phase_plasticityInstance(p)) = l
enddo
enddo
if (iD(param(phase_plasticityInstance(p))%sum_N_sl,2,phase_plasticityInstance(p)) /= plasticState(p)%sizeState) &
call IO_error(0, ext_msg = 'state indices not properly set ('//PLASTICITY_NONLOCAL_LABEL//')')
endif myPhase2
enddo initializeInstances
end subroutine plastic_nonlocal_init
!--------------------------------------------------------------------------------------------------
!> @brief calculates quantities characterizing the microstructure
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
real(pReal), dimension(3,3), intent(in) :: &
F, &
Fp
integer, intent(in) :: &
instance, &
of, &
ip, &
el
integer :: &
no, & !< neighbor offset
neighbor_el, & ! element number of neighboring material point
neighbor_ip, & ! integration point of neighboring material point
neighbor_instance, & ! instance of this plasticity of neighboring material point
c, & ! index of dilsocation character (edge, screw)
s, & ! slip system index
dir, &
n
real(pReal) :: &
FVsize, &
nRealNeighbors ! number of really existing neighbors
integer, dimension(2) :: &
neighbors
real(pReal), dimension(2) :: &
rhoExcessGradient, &
rhoExcessGradient_over_rho, &
rhoTotal
real(pReal), dimension(3) :: &
rhoExcessDifferences, &
normal_latticeConf
real(pReal), dimension(3,3) :: &
invFe, & !< inverse of elastic deformation gradient
invFp, & !< inverse of plastic deformation gradient
connections, &
invConnections
real(pReal), dimension(3,nIPneighbors) :: &
connection_latticeConf
real(pReal), dimension(2,param(instance)%sum_N_sl) :: &
rhoExcess
real(pReal), dimension(param(instance)%sum_N_sl) :: &
rho_edg_delta, &
rho_scr_delta
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho, &
rho0, &
rho_neighbor0
real(pReal), dimension(param(instance)%sum_N_sl,param(instance)%sum_N_sl) :: &
myInteractionMatrix ! corrected slip interaction matrix
real(pReal), dimension(param(instance)%sum_N_sl,nIPneighbors) :: &
rho_edg_delta_neighbor, &
rho_scr_delta_neighbor
real(pReal), dimension(2,maxval(param%sum_N_sl),nIPneighbors) :: &
neighbor_rhoExcess, & ! excess density at neighboring material point
neighbor_rhoTotal ! total density at neighboring material point
real(pReal), dimension(3,param(instance)%sum_N_sl,2) :: &
m ! direction of dislocation motion
associate(prm => param(instance),dst => microstructure(instance), stt => state(instance))
rho = getRho(instance,of,ip,el)
stt%rho_forest(:,of) = matmul(prm%forestProjection_Edge, sum(abs(rho(:,edg)),2)) &
+ matmul(prm%forestProjection_Screw,sum(abs(rho(:,scr)),2))
! coefficients are corrected for the line tension effect
! (see Kubin,Devincre,Hoc; 2008; Modeling dislocation storage rates and mean free paths in face-centered cubic crystals)
if (any(lattice_structure(material_phaseAt(1,el)) == [LATTICE_bcc_ID,LATTICE_fcc_ID])) then
myInteractionMatrix = prm%interactionSlipSlip &
* spread(( 1.0_pReal - prm%linetensionEffect &
+ prm%linetensionEffect &
* log(0.35_pReal * prm%burgers * sqrt(max(stt%rho_forest(:,of),prm%significantRho))) &
/ log(0.35_pReal * prm%burgers * 1e6_pReal))** 2.0_pReal,2,prm%sum_N_sl)
else
myInteractionMatrix = prm%interactionSlipSlip
endif
dst%tau_pass(:,of) = prm%mu * prm%burgers &
* sqrt(matmul(myInteractionMatrix,sum(abs(rho),2)))
!*** calculate the dislocation stress of the neighboring excess dislocation densities
!*** zero for material points of local plasticity
!#################################################################################################
! ToDo: MD: this is most likely only correct for F_i = I
!#################################################################################################
rho0 = getRho0(instance,of,ip,el)
if (.not. phase_localPlasticity(material_phaseAt(1,el)) .and. prm%shortRangeStressCorrection) then
invFp = math_inv33(Fp)
invFe = matmul(Fp,math_inv33(F))
rho_edg_delta = rho0(:,mob_edg_pos) - rho0(:,mob_edg_neg)
rho_scr_delta = rho0(:,mob_scr_pos) - rho0(:,mob_scr_neg)
rhoExcess(1,:) = rho_edg_delta
rhoExcess(2,:) = rho_scr_delta
FVsize = IPvolume(ip,el) ** (1.0_pReal/3.0_pReal)
!* loop through my neighborhood and get the connection vectors (in lattice frame) and the excess densities
nRealNeighbors = 0.0_pReal
neighbor_rhoTotal = 0.0_pReal
do n = 1,nIPneighbors
neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el)
no = material_phasememberAt(1,neighbor_ip,neighbor_el)
if (neighbor_el > 0 .and. neighbor_ip > 0) then
neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
if (neighbor_instance == instance) then
nRealNeighbors = nRealNeighbors + 1.0_pReal
rho_neighbor0 = getRho0(instance,no,neighbor_ip,neighbor_el)
rho_edg_delta_neighbor(:,n) = rho_neighbor0(:,mob_edg_pos) - rho_neighbor0(:,mob_edg_neg)
rho_scr_delta_neighbor(:,n) = rho_neighbor0(:,mob_scr_pos) - rho_neighbor0(:,mob_scr_neg)
neighbor_rhoTotal(1,:,n) = sum(abs(rho_neighbor0(:,edg)),2)
neighbor_rhoTotal(2,:,n) = sum(abs(rho_neighbor0(:,scr)),2)
connection_latticeConf(1:3,n) = matmul(invFe, discretization_IPcoords(1:3,neighbor_el+neighbor_ip-1) &
- discretization_IPcoords(1:3,el+neighbor_ip-1))
normal_latticeConf = matmul(transpose(invFp), IPareaNormal(1:3,n,ip,el))
if (math_inner(normal_latticeConf,connection_latticeConf(1:3,n)) < 0.0_pReal) & ! neighboring connection points in opposite direction to face normal: must be periodic image
connection_latticeConf(1:3,n) = normal_latticeConf * IPvolume(ip,el)/IParea(n,ip,el) ! instead take the surface normal scaled with the diameter of the cell
else
! local neighbor or different lattice structure or different constitution instance -> use central values instead
connection_latticeConf(1:3,n) = 0.0_pReal
rho_edg_delta_neighbor(:,n) = rho_edg_delta
rho_scr_delta_neighbor(:,n) = rho_scr_delta
endif
else
! free surface -> use central values instead
connection_latticeConf(1:3,n) = 0.0_pReal
rho_edg_delta_neighbor(:,n) = rho_edg_delta
rho_scr_delta_neighbor(:,n) = rho_scr_delta
endif
enddo
neighbor_rhoExcess(1,:,:) = rho_edg_delta_neighbor
neighbor_rhoExcess(2,:,:) = rho_scr_delta_neighbor
!* loop through the slip systems and calculate the dislocation gradient by
!* 1. interpolation of the excess density in the neighorhood
!* 2. interpolation of the dead dislocation density in the central volume
m(1:3,:,1) = prm%slip_direction
m(1:3,:,2) = -prm%slip_transverse
do s = 1,prm%sum_N_sl
! gradient from interpolation of neighboring excess density ...
do c = 1,2
do dir = 1,3
neighbors(1) = 2 * dir - 1
neighbors(2) = 2 * dir
connections(dir,1:3) = connection_latticeConf(1:3,neighbors(1)) &
- connection_latticeConf(1:3,neighbors(2))
rhoExcessDifferences(dir) = neighbor_rhoExcess(c,s,neighbors(1)) &
- neighbor_rhoExcess(c,s,neighbors(2))
enddo
invConnections = math_inv33(connections)
if (all(dEq0(invConnections))) call IO_error(-1,ext_msg='back stress calculation: inversion error')
rhoExcessGradient(c) = math_inner(m(1:3,s,c), matmul(invConnections,rhoExcessDifferences))
enddo
! ... plus gradient from deads ...
rhoExcessGradient(1) = rhoExcessGradient(1) + sum(rho(s,imm_edg)) / FVsize
rhoExcessGradient(2) = rhoExcessGradient(2) + sum(rho(s,imm_scr)) / FVsize
! ... normalized with the total density ...
rhoTotal(1) = (sum(abs(rho(s,edg))) + sum(neighbor_rhoTotal(1,s,:))) / (1.0_pReal + nRealNeighbors)
rhoTotal(2) = (sum(abs(rho(s,scr))) + sum(neighbor_rhoTotal(2,s,:))) / (1.0_pReal + nRealNeighbors)
rhoExcessGradient_over_rho = 0.0_pReal
where(rhoTotal > 0.0_pReal) rhoExcessGradient_over_rho = rhoExcessGradient / rhoTotal
! ... gives the local stress correction when multiplied with a factor
dst%tau_back(s,of) = - prm%mu * prm%burgers(s) / (2.0_pReal * PI) &
* ( rhoExcessGradient_over_rho(1) / (1.0_pReal - prm%nu) &
+ rhoExcessGradient_over_rho(2))
enddo
endif
# 721 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
end associate
end subroutine plastic_nonlocal_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief calculates plastic velocity gradient and its tangent
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, &
Mp,Temperature,instance,of,ip,el)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
real(pReal), intent(in) :: &
Temperature !< temperature
real(pReal), dimension(3,3), intent(in) :: &
Mp
!< derivative of Lp with respect to Mp
integer :: &
ns, & !< short notation for the total number of active slip systems
i, &
j, &
k, &
l, &
t, & !< dislocation type
s !< index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,8) :: &
rhoSgl !< single dislocation densities (including blocked)
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v, & !< velocity
tauNS, & !< resolved shear stress including non Schmid and backstress terms
dv_dtau, & !< velocity derivative with respect to the shear stress
dv_dtauNS !< velocity derivative with respect to the shear stress
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, & !< resolved shear stress including backstress terms
gdotTotal !< shear rate
associate(prm => param(instance),dst=>microstructure(instance),stt=>state(instance))
ns = prm%sum_N_sl
!*** shortcut to state variables
rho = getRho(instance,of,ip,el)
rhoSgl = rho(:,sgl)
do s = 1,ns
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s))
tauNS(s,1) = tau(s)
tauNS(s,2) = tau(s)
if (tau(s) > 0.0_pReal) then
tauNS(s,3) = math_tensordot(Mp, +prm%nonSchmid_pos(1:3,1:3,s))
tauNS(s,4) = math_tensordot(Mp, -prm%nonSchmid_neg(1:3,1:3,s))
else
tauNS(s,3) = math_tensordot(Mp, +prm%nonSchmid_neg(1:3,1:3,s))
tauNS(s,4) = math_tensordot(Mp, -prm%nonSchmid_pos(1:3,1:3,s))
endif
enddo
tauNS = tauNS + spread(dst%tau_back(:,of),2,4)
tau = tau + dst%tau_back(:,of)
! edges
call kinetics(v(:,1), dv_dtau(:,1), dv_dtauNS(:,1), &
tau, tauNS(:,1), dst%tau_pass(:,of),1,Temperature, instance)
v(:,2) = v(:,1)
dv_dtau(:,2) = dv_dtau(:,1)
dv_dtauNS(:,2) = dv_dtauNS(:,1)
!screws
if (prm%nonSchmidActive) then
v(:,3:4) = spread(v(:,1),2,2)
dv_dtau(:,3:4) = spread(dv_dtau(:,1),2,2)
dv_dtauNS(:,3:4) = spread(dv_dtauNS(:,1),2,2)
else
do t = 3,4
call kinetics(v(:,t), dv_dtau(:,t), dv_dtauNS(:,t), &
tau, tauNS(:,t), dst%tau_pass(:,of),2,Temperature, instance)
enddo
endif
stt%v(:,of) = pack(v,.true.)
!*** Bauschinger effect
forall (s = 1:ns, t = 5:8, rhoSgl(s,t) * v(s,t-4) < 0.0_pReal) &
rhoSgl(s,t-4) = rhoSgl(s,t-4) + abs(rhoSgl(s,t))
gdotTotal = sum(rhoSgl(:,1:4) * v, 2) * prm%burgers
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
do s = 1,ns
Lp = Lp + gdotTotal(s) * prm%Schmid(1:3,1:3,s)
forall (i=1:3,j=1:3,k=1:3,l=1:3) &
dLp_dMp(i,j,k,l) = dLp_dMp(i,j,k,l) &
+ prm%Schmid(i,j,s) * prm%Schmid(k,l,s) &
* sum(rhoSgl(s,1:4) * dv_dtau(s,1:4)) * prm%burgers(s) &
+ prm%Schmid(i,j,s) &
* ( prm%nonSchmid_pos(k,l,s) * rhoSgl(s,3) * dv_dtauNS(s,3) &
- prm%nonSchmid_neg(k,l,s) * rhoSgl(s,4) * dv_dtauNS(s,4)) * prm%burgers(s)
enddo
end associate
end subroutine plastic_nonlocal_LpAndItsTangent
!--------------------------------------------------------------------------------------------------
!> @brief (instantaneous) incremental change of microstructure
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_deltaState(Mp,instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< MandelStress
integer, intent(in) :: &
instance, & ! current instance of this plasticity
of, & !< offset
ip, &
el
integer :: &
ph, & !< phase
ns, & ! short notation for the total number of active slip systems
c, & ! character of dislocation
t, & ! type of dislocation
s ! index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
deltaRhoRemobilization, & ! density increment by remobilization
deltaRhoDipole2SingleStress ! density increment by dipole dissociation (by stress change)
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho ! current dislocation densities
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v ! dislocation glide velocity
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau ! current resolved shear stress
real(pReal), dimension(param(instance)%sum_N_sl,2) :: &
rhoDip, & ! current dipole dislocation densities (screw and edge dipoles)
dUpper, & ! current 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
ph = material_phaseAt(1,el)
associate(prm => param(instance),dst => microstructure(instance),del => deltaState(instance))
ns = prm%sum_N_sl
!*** shortcut to state variables
forall (s = 1:ns, t = 1:4) v(s,t) = plasticState(ph)%state(iV(s,t,instance),of)
forall (s = 1:ns, c = 1:2) dUpperOld(s,c) = plasticState(ph)%state(iD(s,c,instance),of)
rho = getRho(instance,of,ip,el)
rhoDip = rho(:,dip)
!****************************************************************************
!*** dislocation remobilization (bauschinger effect)
where(rho(:,imm) * v < 0.0_pReal)
deltaRhoRemobilization(:,mob) = abs(rho(:,imm))
deltaRhoRemobilization(:,imm) = - rho(:,imm)
rho(:,mob) = rho(:,mob) + abs(rho(:,imm))
rho(:,imm) = 0.0_pReal
elsewhere
deltaRhoRemobilization(:,mob) = 0.0_pReal
deltaRhoRemobilization(:,imm) = 0.0_pReal
endwhere
deltaRhoRemobilization(:,dip) = 0.0_pReal
!****************************************************************************
!*** calculate dipole formation and dissociation by stress change
!*** calculate limits for stable dipole height
do s = 1,prm%sum_N_sl
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s)) +dst%tau_back(s,of)
if (abs(tau(s)) < 1.0e-15_pReal) tau(s) = 1.0e-15_pReal
enddo
dUpper(:,1) = prm%mu * prm%burgers/(8.0_pReal * PI * (1.0_pReal - prm%nu) * abs(tau))
dUpper(:,2) = prm%mu * prm%burgers/(4.0_pReal * PI * abs(tau))
where(dNeq0(sqrt(sum(abs(rho(:,edg)),2)))) &
dUpper(:,1) = min(1.0_pReal/sqrt(sum(abs(rho(:,edg)),2)),dUpper(:,1))
where(dNeq0(sqrt(sum(abs(rho(:,scr)),2)))) &
dUpper(:,2) = min(1.0_pReal/sqrt(sum(abs(rho(:,scr)),2)),dUpper(:,2))
dUpper = max(dUpper,prm%minDipoleHeight)
deltaDUpper = dUpper - dUpperOld
!*** dissociation by stress increase
deltaRhoDipole2SingleStress = 0.0_pReal
forall (c=1:2, s=1:ns, deltaDUpper(s,c) < 0.0_pReal .and. &
dNeq0(dUpperOld(s,c) - prm%minDipoleHeight(s,c))) &
deltaRhoDipole2SingleStress(s,8+c) = rhoDip(s,c) * deltaDUpper(s,c) &
/ (dUpperOld(s,c) - prm%minDipoleHeight(s,c))
forall (t=1:4) deltaRhoDipole2SingleStress(:,t) = -0.5_pReal * deltaRhoDipole2SingleStress(:,(t-1)/2+9)
forall (s = 1:ns, c = 1:2) plasticState(ph)%state(iD(s,c,instance),of) = dUpper(s,c)
plasticState(ph)%deltaState(:,of) = 0.0_pReal
del%rho(:,of) = reshape(deltaRhoRemobilization + deltaRhoDipole2SingleStress, [10*ns])
# 936 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
end associate
end subroutine plastic_nonlocal_deltaState
!---------------------------------------------------------------------------------------------------
!> @brief calculates the rate of change of microstructure
!---------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_dotState(Mp, F, Fp, Temperature,timestep, &
instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< MandelStress
real(pReal), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem), intent(in) :: &
F, & !< elastic deformation gradient
Fp !< plastic deformation gradient
real(pReal), intent(in) :: &
Temperature, & !< temperature
timestep !< substepped crystallite time increment
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
integer :: &
ph, &
neighbor_instance, & !< instance of my neighbor's plasticity
ns, & !< short notation for the total number of active slip systems
c, & !< character of dislocation
n, & !< index of my current neighbor
neighbor_el, & !< element number of my neighbor
neighbor_ip, & !< integration point of my neighbor
neighbor_n, & !< neighbor index pointing to me when looking from my neighbor
opposite_neighbor, & !< index of my opposite neighbor
opposite_ip, & !< ip of my opposite neighbor
opposite_el, & !< element index of my opposite neighbor
opposite_n, & !< neighbor index pointing to me when looking from my opposite neighbor
t, & !< type of dislocation
no,& !< neighbor offset shortcut
np,& !< neighbor phase shortcut
topp, & !< type of dislocation with opposite sign to t
s !< index of my current slip system
real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
rho, &
rho0, & !< dislocation density at beginning of time step
rhoDot, & !< density evolution
rhoDotMultiplication, & !< density evolution by multiplication
rhoDotFlux, & !< density evolution by flux
rhoDotSingle2DipoleGlide, & !< density evolution by dipole formation (by glide)
rhoDotAthermalAnnihilation, & !< density evolution by athermal annihilation
rhoDotThermalAnnihilation !< density evolution by thermal annihilation
real(pReal), dimension(param(instance)%sum_N_sl,8) :: &
rhoSgl, & !< current single dislocation densities (positive/negative screw and edge without dipoles)
neighbor_rhoSgl0, & !< current single dislocation densities of neighboring ip (positive/negative screw and edge without dipoles)
my_rhoSgl0 !< single dislocation densities of central ip (positive/negative screw and edge without dipoles)
real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
v, & !< current dislocation glide velocity
v0, &
neighbor_v0, & !< dislocation glide velocity of enighboring ip
gdot !< shear rates
real(pReal), dimension(param(instance)%sum_N_sl) :: &
tau, & !< current resolved shear stress
vClimb !< climb velocity of edge dipoles
real(pReal), dimension(param(instance)%sum_N_sl,2) :: &
rhoDip, & !< current dipole dislocation densities (screw and edge dipoles)
dLower, & !< minimum stable dipole distance for edges and screws
dUpper !< current maximum stable dipole distance for edges and screws
real(pReal), dimension(3,param(instance)%sum_N_sl,4) :: &
m !< direction of dislocation motion
real(pReal), dimension(3,3) :: &
my_F, & !< my total deformation gradient
neighbor_F, & !< total deformation gradient of my neighbor
my_Fe, & !< my elastic deformation gradient
neighbor_Fe, & !< elastic deformation gradient of my neighbor
Favg !< average total deformation gradient of me and my neighbor
real(pReal), dimension(3) :: &
normal_neighbor2me, & !< interface normal pointing from my neighbor to me in neighbor's lattice configuration
normal_neighbor2me_defConf, & !< interface normal pointing from my neighbor to me in shared deformed configuration
normal_me2neighbor, & !< interface normal pointing from me to my neighbor in my lattice configuration
normal_me2neighbor_defConf !< interface normal pointing from me to my neighbor in shared deformed configuration
real(pReal) :: &
area, & !< area of the current interface
transmissivity, & !< overall transmissivity of dislocation flux to neighboring material point
lineLength, & !< dislocation line length leaving the current interface
selfDiffusion !< self diffusion
ph = material_phaseAt(1,el)
if (timestep <= 0.0_pReal) then
plasticState(ph)%dotState = 0.0_pReal
return
endif
associate(prm => param(instance), &
dst => microstructure(instance), &
dot => dotState(instance), &
stt => state(instance))
ns = prm%sum_N_sl
tau = 0.0_pReal
gdot = 0.0_pReal
rho = getRho(instance,of,ip,el)
rhoSgl = rho(:,sgl)
rhoDip = rho(:,dip)
rho0 = getRho0(instance,of,ip,el)
my_rhoSgl0 = rho0(:,sgl)
forall (s = 1:ns, t = 1:4) v(s,t) = plasticState(ph)%state(iV(s,t,instance),of)
gdot = rhoSgl(:,1:4) * v * spread(prm%burgers,2,4)
# 1056 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
!****************************************************************************
!*** limits for stable dipole height
do s = 1,ns
tau(s) = math_tensordot(Mp, prm%Schmid(1:3,1:3,s)) + dst%tau_back(s,of)
if (abs(tau(s)) < 1.0e-15_pReal) tau(s) = 1.0e-15_pReal
enddo
dLower = prm%minDipoleHeight
dUpper(:,1) = prm%mu * prm%burgers/(8.0_pReal * PI * (1.0_pReal - prm%nu) * abs(tau))
dUpper(:,2) = prm%mu * prm%burgers/(4.0_pReal * PI * abs(tau))
where(dNeq0(sqrt(sum(abs(rho(:,edg)),2)))) &
dUpper(:,1) = min(1.0_pReal/sqrt(sum(abs(rho(:,edg)),2)),dUpper(:,1))
where(dNeq0(sqrt(sum(abs(rho(:,scr)),2)))) &
dUpper(:,2) = min(1.0_pReal/sqrt(sum(abs(rho(:,scr)),2)),dUpper(:,2))
dUpper = max(dUpper,dLower)
!****************************************************************************
!*** dislocation multiplication
rhoDotMultiplication = 0.0_pReal
isBCC: if (lattice_structure(ph) == LATTICE_bcc_ID) then
forall (s = 1:ns, sum(abs(v(s,1:4))) > 0.0_pReal)
rhoDotMultiplication(s,1:2) = sum(abs(gdot(s,3:4))) / prm%burgers(s) & ! assuming double-cross-slip of screws to be decisive for multiplication
* sqrt(stt%rho_forest(s,of)) / prm%lambda0(s) ! & ! mean free path
! * 2.0_pReal * sum(abs(v(s,3:4))) / sum(abs(v(s,1:4))) ! ratio of screw to overall velocity determines edge generation
rhoDotMultiplication(s,3:4) = sum(abs(gdot(s,3:4))) /prm%burgers(s) & ! assuming double-cross-slip of screws to be decisive for multiplication
* sqrt(stt%rho_forest(s,of)) / prm%lambda0(s) ! & ! mean free path
! * 2.0_pReal * sum(abs(v(s,1:2))) / sum(abs(v(s,1:4))) ! ratio of edge to overall velocity determines screw generation
endforall
else isBCC
rhoDotMultiplication(:,1:4) = spread( &
(sum(abs(gdot(:,1:2)),2) * prm%fEdgeMultiplication + sum(abs(gdot(:,3:4)),2)) &
* sqrt(stt%rho_forest(:,of)) / prm%lambda0 / prm%burgers, 2, 4)
endif isBCC
forall (s = 1:ns, t = 1:4) v0(s,t) = plasticState(ph)%state0(iV(s,t,instance),of)
!****************************************************************************
!*** calculate dislocation fluxes (only for nonlocal plasticity)
rhoDotFlux = 0.0_pReal
if (.not. phase_localPlasticity(material_phaseAt(1,el))) then
!*** check CFL (Courant-Friedrichs-Lewy) condition for flux
if (any( abs(gdot) > 0.0_pReal & ! any active slip system ...
.and. prm%CFLfactor * abs(v0) * timestep &
> IPvolume(ip,el) / maxval(IParea(:,ip,el)))) then ! ...with velocity above critical value (we use the reference volume and area for simplicity here)
# 1116 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
plasticState(ph)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN) ! -> return NaN and, hence, enforce cutback
return
endif
!*** be aware of the definition of slip_transverse = slip_direction x slip_normal !!!
!*** opposite sign to our t vector in the (s,t,n) triplet !!!
m(1:3,:,1) = prm%slip_direction
m(1:3,:,2) = -prm%slip_direction
m(1:3,:,3) = -prm%slip_transverse
m(1:3,:,4) = prm%slip_transverse
my_F = F(1:3,1:3,1,ip,el)
my_Fe = matmul(my_F, math_inv33(Fp(1:3,1:3,1,ip,el)))
neighbors: do n = 1,nIPneighbors
neighbor_el = IPneighborhood(1,n,ip,el)
neighbor_ip = IPneighborhood(2,n,ip,el)
neighbor_n = IPneighborhood(3,n,ip,el)
np = material_phaseAt(1,neighbor_el)
no = material_phasememberAt(1,neighbor_ip,neighbor_el)
opposite_neighbor = n + mod(n,2) - mod(n+1,2)
opposite_el = IPneighborhood(1,opposite_neighbor,ip,el)
opposite_ip = IPneighborhood(2,opposite_neighbor,ip,el)
opposite_n = IPneighborhood(3,opposite_neighbor,ip,el)
if (neighbor_n > 0) then ! if neighbor exists, average deformation gradient
neighbor_instance = phase_plasticityInstance(material_phaseAt(1,neighbor_el))
neighbor_F = F(1:3,1:3,1,neighbor_ip,neighbor_el)
neighbor_Fe = matmul(neighbor_F, math_inv33(Fp(1:3,1:3,1,neighbor_ip,neighbor_el)))
Favg = 0.5_pReal * (my_F + neighbor_F)
else ! if no neighbor, take my value as average
Favg = my_F
endif
neighbor_v0 = 0.0_pReal ! needed for check of sign change in flux density below
!* FLUX FROM MY NEIGHBOR TO ME
!* This is only considered, if I have a neighbor of nonlocal plasticity
!* (also nonlocal constitutive law with local properties) that is at least a little bit
!* compatible.
!* If it's not at all compatible, no flux is arriving, because everything is dammed in front of
!* my neighbor's interface.
!* The entering flux from my neighbor will be distributed on my slip systems according to the
!* compatibility
if (neighbor_n > 0) then
if (phase_plasticity(material_phaseAt(1,neighbor_el)) == PLASTICITY_NONLOCAL_ID .and. &
any(compatibility(:,:,:,n,ip,el) > 0.0_pReal)) then
forall (s = 1:ns, t = 1:4)
neighbor_v0(s,t) = plasticState(np)%state0(iV (s,t,neighbor_instance),no)
neighbor_rhoSgl0(s,t) = max(plasticState(np)%state0(iRhoU(s,t,neighbor_instance),no),0.0_pReal)
endforall
where (neighbor_rhoSgl0 * IPvolume(neighbor_ip,neighbor_el) ** 0.667_pReal < prm%significantN &
.or. neighbor_rhoSgl0 < prm%significantRho) &
neighbor_rhoSgl0 = 0.0_pReal
normal_neighbor2me_defConf = math_det33(Favg) * matmul(math_inv33(transpose(Favg)), &
IPareaNormal(1:3,neighbor_n,neighbor_ip,neighbor_el)) ! normal of the interface in (average) deformed configuration (pointing neighbor => me)
normal_neighbor2me = matmul(transpose(neighbor_Fe), normal_neighbor2me_defConf) &
/ math_det33(neighbor_Fe) ! interface normal in the lattice configuration of my neighbor
area = IParea(neighbor_n,neighbor_ip,neighbor_el) * norm2(normal_neighbor2me)
normal_neighbor2me = normal_neighbor2me / norm2(normal_neighbor2me) ! normalize the surface normal to unit length
do s = 1,ns
do t = 1,4
c = (t + 1) / 2
topp = t + mod(t,2) - mod(t+1,2)
if (neighbor_v0(s,t) * math_inner(m(1:3,s,t), normal_neighbor2me) > 0.0_pReal & ! flux from my neighbor to me == entering flux for me
.and. v0(s,t) * neighbor_v0(s,t) >= 0.0_pReal ) then ! ... only if no sign change in flux density
lineLength = neighbor_rhoSgl0(s,t) * neighbor_v0(s,t) &
* math_inner(m(1:3,s,t), normal_neighbor2me) * area ! positive line length that wants to enter through this interface
where (compatibility(c,:,s,n,ip,el) > 0.0_pReal) &
rhoDotFlux(:,t) = rhoDotFlux(1:ns,t) &
+ lineLength/IPvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_pReal ! transferring to equally signed mobile dislocation type
where (compatibility(c,:,s,n,ip,el) < 0.0_pReal) &
rhoDotFlux(:,topp) = rhoDotFlux(:,topp) &
+ lineLength/IPvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_pReal ! transferring to opposite signed mobile dislocation type
endif
enddo
enddo
endif; endif
!* FLUX FROM ME TO MY NEIGHBOR
!* This is not considered, if my opposite neighbor has a different constitutive law than nonlocal (still considered for nonlocal law with local properties).
!* Then, we assume, that the opposite(!) neighbor sends an equal amount of dislocations to me.
!* So the net flux in the direction of my neighbor is equal to zero:
!* leaving flux to neighbor == entering flux from opposite neighbor
!* In case of reduced transmissivity, part of the leaving flux is stored as dead dislocation density.
!* That means for an interface of zero transmissivity the leaving flux is fully converted to dead dislocations.
if (opposite_n > 0) then
if (phase_plasticity(material_phaseAt(1,opposite_el)) == PLASTICITY_NONLOCAL_ID) then
normal_me2neighbor_defConf = math_det33(Favg) &
* matmul(math_inv33(transpose(Favg)),IPareaNormal(1:3,n,ip,el)) ! normal of the interface in (average) deformed configuration (pointing me => neighbor)
normal_me2neighbor = matmul(transpose(my_Fe), normal_me2neighbor_defConf) &
/ math_det33(my_Fe) ! interface normal in my lattice configuration
area = IParea(n,ip,el) * norm2(normal_me2neighbor)
normal_me2neighbor = normal_me2neighbor / norm2(normal_me2neighbor) ! normalize the surface normal to unit length
do s = 1,ns
do t = 1,4
c = (t + 1) / 2
if (v0(s,t) * math_inner(m(1:3,s,t), normal_me2neighbor) > 0.0_pReal ) then ! flux from me to my neighbor == leaving flux for me (might also be a pure flux from my mobile density to dead density if interface not at all transmissive)
if (v0(s,t) * neighbor_v0(s,t) >= 0.0_pReal) then ! no sign change in flux density
transmissivity = sum(compatibility(c,:,s,n,ip,el)**2.0_pReal) ! overall transmissivity from this slip system to my neighbor
else ! sign change in flux density means sign change in stress which does not allow for dislocations to arive at the neighbor
transmissivity = 0.0_pReal
endif
lineLength = my_rhoSgl0(s,t) * v0(s,t) &
* math_inner(m(1:3,s,t), normal_me2neighbor) * area ! positive line length of mobiles that wants to leave through this interface
rhoDotFlux(s,t) = rhoDotFlux(s,t) - lineLength / IPvolume(ip,el) ! subtract dislocation flux from current type
rhoDotFlux(s,t+4) = rhoDotFlux(s,t+4) &
+ lineLength / IPvolume(ip,el) * (1.0_pReal - transmissivity) &
* sign(1.0_pReal, v0(s,t)) ! dislocation flux that is not able to leave through interface (because of low transmissivity) will remain as immobile single density at the material point
endif
enddo
enddo
endif; endif
enddo neighbors
endif
!****************************************************************************
!*** calculate dipole formation and annihilation
!*** formation by glide
do c = 1,2
rhoDotSingle2DipoleGlide(:,2*c-1) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* ( rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) & ! negative mobile --> positive mobile
+ rhoSgl(:,2*c) * abs(gdot(:,2*c-1)) & ! positive mobile --> negative mobile
+ abs(rhoSgl(:,2*c+4)) * abs(gdot(:,2*c-1))) ! positive mobile --> negative immobile
rhoDotSingle2DipoleGlide(:,2*c) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* ( rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) & ! negative mobile --> positive mobile
+ rhoSgl(:,2*c) * abs(gdot(:,2*c-1)) & ! positive mobile --> negative mobile
+ abs(rhoSgl(:,2*c+3)) * abs(gdot(:,2*c))) ! negative mobile --> positive immobile
rhoDotSingle2DipoleGlide(:,2*c+3) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* rhoSgl(:,2*c+3) * abs(gdot(:,2*c)) ! negative mobile --> positive immobile
rhoDotSingle2DipoleGlide(:,2*c+4) = -2.0_pReal * dUpper(:,c) / prm%burgers &
* rhoSgl(:,2*c+4) * abs(gdot(:,2*c-1)) ! positive mobile --> negative immobile
rhoDotSingle2DipoleGlide(:,c+8) = abs(rhoDotSingle2DipoleGlide(:,2*c+3)) &
+ abs(rhoDotSingle2DipoleGlide(:,2*c+4)) &
- rhoDotSingle2DipoleGlide(:,2*c-1) &
- rhoDotSingle2DipoleGlide(:,2*c)
enddo
!*** athermal annihilation
rhoDotAthermalAnnihilation = 0.0_pReal
forall (c=1:2) &
rhoDotAthermalAnnihilation(:,c+8) = -2.0_pReal * dLower(:,c) / prm%burgers &
* ( 2.0_pReal * (rhoSgl(:,2*c-1) * abs(gdot(:,2*c)) + rhoSgl(:,2*c) * abs(gdot(:,2*c-1))) & ! was single hitting single
+ 2.0_pReal * (abs(rhoSgl(:,2*c+3)) * abs(gdot(:,2*c)) + abs(rhoSgl(:,2*c+4)) * abs(gdot(:,2*c-1))) & ! was single hitting immobile single or was immobile single hit by single
+ rhoDip(:,c) * (abs(gdot(:,2*c-1)) + abs(gdot(:,2*c)))) ! single knocks dipole constituent
! annihilated screw dipoles leave edge jogs behind on the colinear system
if (lattice_structure(ph) == LATTICE_fcc_ID) &
forall (s = 1:ns, prm%colinearSystem(s) > 0) &
rhoDotAthermalAnnihilation(prm%colinearSystem(s),1:2) = - rhoDotAthermalAnnihilation(s,10) &
* 0.25_pReal * sqrt(stt%rho_forest(s,of)) * (dUpper(s,2) + dLower(s,2)) * prm%edgeJogFactor
!*** thermally activated annihilation of edge dipoles by climb
rhoDotThermalAnnihilation = 0.0_pReal
selfDiffusion = prm%Dsd0 * exp(-prm%selfDiffusionEnergy / (kB * Temperature))
vClimb = prm%atomicVolume * selfDiffusion * prm%mu &
/ ( kB * Temperature * PI * (1.0_pReal-prm%nu) * (dUpper(:,1) + dLower(:,1)))
forall (s = 1:ns, dUpper(s,1) > dLower(s,1)) &
rhoDotThermalAnnihilation(s,9) = max(- 4.0_pReal * rhoDip(s,1) * vClimb(s) / (dUpper(s,1) - dLower(s,1)), &
- rhoDip(s,1) / timestep - rhoDotAthermalAnnihilation(s,9) &
- rhoDotSingle2DipoleGlide(s,9)) ! make sure that we do not annihilate more dipoles than we have
rhoDot = rhoDotFlux &
+ rhoDotMultiplication &
+ rhoDotSingle2DipoleGlide &
+ rhoDotAthermalAnnihilation &
+ rhoDotThermalAnnihilation
# 1325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
if ( any(rho(:,mob) + rhoDot(:,1:4) * timestep < -prm%atol_rho) &
.or. any(rho(:,dip) + rhoDot(:,9:10) * timestep < -prm%atol_rho)) then
plasticState(ph)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN)
else
dot%rho(:,of) = pack(rhoDot,.true.)
dot%gamma(:,of) = sum(gdot,2)
endif
end associate
end subroutine plastic_nonlocal_dotState
!--------------------------------------------------------------------------------------------------
!> @brief Compatibility update
!> @detail Compatibility is defined as normalized product of signed cosine of the angle between the slip
! plane normals and signed cosine of the angle between the slip directions. Only the largest values
! that sum up to a total of 1 are considered, all others are set to zero.
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_updateCompatibility(orientation,instance,i,e)
type(rotation), dimension(1,discretization_nIP,discretization_nElem), intent(in) :: &
orientation ! crystal orientation
integer, intent(in) :: &
instance, &
i, &
e
integer :: &
n, & ! neighbor index
neighbor_e, & ! element index of my neighbor
neighbor_i, & ! integration point index of my neighbor
ph, &
neighbor_phase, &
ns, & ! number of active slip systems
s1, & ! slip system index (me)
s2 ! slip system index (my neighbor)
real(pReal), dimension(2,param(instance)%sum_N_sl,param(instance)%sum_N_sl,nIPneighbors) :: &
my_compatibility ! my_compatibility for current element and ip
real(pReal) :: &
my_compatibilitySum, &
thresholdValue, &
nThresholdValues
logical, dimension(param(instance)%sum_N_sl) :: &
belowThreshold
type(rotation) :: mis
ph = material_phaseAt(1,e)
associate(prm => param(instance))
ns = prm%sum_N_sl
!*** start out fully compatible
my_compatibility = 0.0_pReal
forall(s1 = 1:ns) my_compatibility(:,s1,s1,:) = 1.0_pReal
neighbors: do n = 1,nIPneighbors
neighbor_e = IPneighborhood(1,n,i,e)
neighbor_i = IPneighborhood(2,n,i,e)
neighbor_phase = material_phaseAt(1,neighbor_e)
if (neighbor_e <= 0 .or. neighbor_i <= 0) then
!* FREE SURFACE
!* Set surface transmissivity to the value specified in the material.config
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%surfaceTransmissivity)
elseif (neighbor_phase /= ph) then
!* PHASE BOUNDARY
!* If we encounter a different nonlocal phase at the neighbor,
!* we consider this to be a real "physical" phase boundary, so completely incompatible.
!* If one of the two phases has a local plasticity law,
!* we do not consider this to be a phase boundary, so completely compatible.
if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph)) &
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = 0.0_pReal
elseif (prm%grainboundaryTransmissivity >= 0.0_pReal) then
!* GRAIN BOUNDARY !
!* fixed transmissivity for adjacent ips with different texture (only if explicitly given in material.config)
if (material_texture(1,i,e) /= material_texture(1,neighbor_i,neighbor_e) .and. &
(.not. phase_localPlasticity(neighbor_phase))) &
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%grainboundaryTransmissivity)
else
!* GRAIN BOUNDARY ?
!* Compatibility defined by relative orientation of slip systems:
!* The my_compatibility value is defined as the product of the slip normal projection and the slip direction projection.
!* Its sign is always positive for screws, for edges it has the same sign as the slip normal projection.
!* Since the sum for each slip system can easily exceed one (which would result in a transmissivity larger than one),
!* only values above or equal to a certain threshold value are considered. This threshold value is chosen, such that
!* the number of compatible slip systems is minimized with the sum of the original compatibility values exceeding one.
!* Finally the smallest compatibility value is decreased until the sum is exactly equal to one.
!* All values below the threshold are set to zero.
mis = orientation(1,i,e)%misorientation(orientation(1,neighbor_i,neighbor_e))
mySlipSystems: do s1 = 1,ns
neighborSlipSystems: do s2 = 1,ns
my_compatibility(1,s2,s1,n) = math_inner(prm%slip_normal(1:3,s1), &
mis%rotate(prm%slip_normal(1:3,s2))) &
* abs(math_inner(prm%slip_direction(1:3,s1), &
mis%rotate(prm%slip_direction(1:3,s2))))
my_compatibility(2,s2,s1,n) = abs(math_inner(prm%slip_normal(1:3,s1), &
mis%rotate(prm%slip_normal(1:3,s2)))) &
* abs(math_inner(prm%slip_direction(1:3,s1), &
mis%rotate(prm%slip_direction(1:3,s2))))
enddo neighborSlipSystems
my_compatibilitySum = 0.0_pReal
belowThreshold = .true.
do while (my_compatibilitySum < 1.0_pReal .and. any(belowThreshold))
thresholdValue = maxval(my_compatibility(2,:,s1,n), belowThreshold) ! screws always positive
nThresholdValues = real(count(my_compatibility(2,:,s1,n) >= thresholdValue),pReal)
where (my_compatibility(2,:,s1,n) >= thresholdValue) belowThreshold = .false.
if (my_compatibilitySum + thresholdValue * nThresholdValues > 1.0_pReal) &
where (abs(my_compatibility(:,:,s1,n)) >= thresholdValue) &
my_compatibility(:,:,s1,n) = sign((1.0_pReal - my_compatibilitySum)/nThresholdValues,&
my_compatibility(:,:,s1,n))
my_compatibilitySum = my_compatibilitySum + nThresholdValues * thresholdValue
enddo
where(belowThreshold) my_compatibility(1,:,s1,n) = 0.0_pReal
where(belowThreshold) my_compatibility(2,:,s1,n) = 0.0_pReal
enddo mySlipSystems
endif
enddo neighbors
compatibility(:,:,:,:,i,e) = my_compatibility
end associate
end subroutine plastic_nonlocal_updateCompatibility
!--------------------------------------------------------------------------------------------------
!> @brief writes results to HDF5 output file
!--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_results(instance,group)
integer, intent(in) :: instance
character(len=*),intent(in) :: group
integer :: o
associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance))
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case('rho_sgl_mob_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_edg_pos, 'rho_sgl_mob_edg_pos', &
'positive mobile edge density','1/m²')
case('rho_sgl_imm_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_edg_pos, 'rho_sgl_imm_edg_pos',&
'positive immobile edge density','1/m²')
case('rho_sgl_mob_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_edg_neg, 'rho_sgl_mob_edg_neg',&
'negative mobile edge density','1/m²')
case('rho_sgl_imm_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_edg_neg, 'rho_sgl_imm_edg_neg',&
'negative immobile edge density','1/m²')
case('rho_dip_edg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip_edg, 'rho_dip_edg',&
'edge dipole density','1/m²')
case('rho_sgl_mob_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_scr_pos, 'rho_sgl_mob_scr_pos',&
'positive mobile screw density','1/m²')
case('rho_sgl_imm_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_scr_pos, 'rho_sgl_imm_scr_pos',&
'positive immobile screw density','1/m²')
case('rho_sgl_mob_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_mob_scr_neg, 'rho_sgl_mob_scr_neg',&
'negative mobile screw density','1/m²')
case('rho_sgl_imm_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_sgl_imm_scr_neg, 'rho_sgl_imm_scr_neg',&
'negative immobile screw density','1/m²')
case('rho_dip_scr')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_dip_scr, 'rho_dip_scr',&
'screw dipole density','1/m²')
case('rho_forest')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%rho_forest, 'rho_forest',&
'forest density','1/m²')
case('v_edg_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_edg_pos, 'v_edg_pos',&
'positive edge velocity','m/s')
case('v_edg_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_edg_neg, 'v_edg_neg',&
'negative edge velocity','m/s')
case('v_scr_pos')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_scr_pos, 'v_scr_pos',&
'positive srew velocity','m/s')
case('v_scr_neg')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%v_scr_neg, 'v_scr_neg',&
'negative screw velocity','m/s')
case('gamma')
if(prm%sum_N_sl>0) call results_writeDataset(group,stt%gamma,'gamma',&
'plastic shear','1')
case('tau_pass')
if(prm%sum_N_sl>0) call results_writeDataset(group,dst%tau_pass,'tau_pass',&
'passing stress for slip','Pa')
end select
enddo outputsLoop
end associate
end subroutine plastic_nonlocal_results
!--------------------------------------------------------------------------------------------------
!> @brief populates the initial dislocation density
!--------------------------------------------------------------------------------------------------
subroutine stateInit(ini,phase,NipcMyPhase)
type(tInitialParameters) :: &
ini
integer,intent(in) :: &
phase, &
NipcMyPhase
integer :: &
e, &
i, &
f, &
from, &
upto, &
s, &
instance, &
phasemember
real(pReal), dimension(2) :: &
noise, &
rnd
real(pReal) :: &
meanDensity, &
totalVolume, &
densityBinning, &
minimumIpVolume
real(pReal), dimension(NipcMyPhase) :: &
volume
instance = phase_plasticityInstance(phase)
associate(stt => state(instance))
if (ini%rhoSglRandom > 0.0_pReal) then ! randomly distribute dislocation segments on random slip system and of random type in the volume
do e = 1,discretization_nElem
do i = 1,discretization_nIP
if (material_phaseAt(1,e) == phase) volume(material_phasememberAt(1,i,e)) = IPvolume(i,e)
enddo
enddo
totalVolume = sum(volume)
minimumIPVolume = minval(volume)
densityBinning = ini%rhoSglRandomBinning / minimumIpVolume ** (2.0_pReal / 3.0_pReal)
! fill random material points with dislocation segments until the desired overall density is reached
meanDensity = 0.0_pReal
do while(meanDensity < ini%rhoSglRandom)
call random_number(rnd)
phasemember = nint(rnd(1)*real(NipcMyPhase,pReal) + 0.5_pReal)
s = nint(rnd(2)*real(sum(ini%N_sl),pReal)*4.0_pReal + 0.5_pReal)
meanDensity = meanDensity + densityBinning * volume(phasemember) / totalVolume
stt%rhoSglMobile(s,phasemember) = densityBinning
enddo
else ! homogeneous distribution with noise
do e = 1, NipcMyPhase
do f = 1,size(ini%N_sl,1)
from = 1 + sum(ini%N_sl(1:f-1))
upto = sum(ini%N_sl(1:f))
do s = from,upto
noise = [math_sampleGaussVar(0.0_pReal, ini%rhoSglScatter), &
math_sampleGaussVar(0.0_pReal, ini%rhoSglScatter)]
stt%rho_sgl_mob_edg_pos(s,e) = ini%rhoSglEdgePos0(f) + noise(1)
stt%rho_sgl_mob_edg_neg(s,e) = ini%rhoSglEdgeNeg0(f) + noise(1)
stt%rho_sgl_mob_scr_pos(s,e) = ini%rhoSglScrewPos0(f) + noise(2)
stt%rho_sgl_mob_scr_neg(s,e) = ini%rhoSglScrewNeg0(f) + noise(2)
enddo
stt%rho_dip_edg(from:upto,e) = ini%rhoDipEdge0(f)
stt%rho_dip_scr(from:upto,e) = ini%rhoDipScrew0(f)
enddo
enddo
endif
end associate
end subroutine stateInit
!--------------------------------------------------------------------------------------------------
!> @brief calculates kinetics
!--------------------------------------------------------------------------------------------------
subroutine kinetics(v, dv_dtau, dv_dtauNS, tau, tauNS, tauThreshold, c, Temperature, instance)
integer, intent(in) :: &
c, & !< dislocation character (1:edge, 2:screw)
instance
real(pReal), intent(in) :: &
Temperature !< temperature
real(pReal), dimension(param(instance)%sum_N_sl), intent(in) :: &
tau, & !< resolved external shear stress (without non Schmid effects)
tauNS, & !< resolved external shear stress (including non Schmid effects)
tauThreshold !< threshold shear stress
real(pReal), dimension(param(instance)%sum_N_sl), intent(out) :: &
v, & !< velocity
dv_dtau, & !< velocity derivative with respect to resolved shear stress (without non Schmid contributions)
dv_dtauNS !< velocity derivative with respect to resolved shear stress (including non Schmid contributions)
integer :: &
ns, & !< short notation for the total number of active slip systems
s !< index of my current slip system
real(pReal) :: &
tauRel_P, &
tauRel_S, &
tauEff, & !< effective shear stress
tPeierls, & !< waiting time in front of a peierls barriers
tSolidSolution, & !< waiting time in front of a solid solution obstacle
vViscous, & !< viscous glide velocity
dtPeierls_dtau, & !< derivative with respect to resolved shear stress
dtSolidSolution_dtau, & !< derivative with respect to resolved shear stress
meanfreepath_S, & !< mean free travel distance for dislocations between two solid solution obstacles
meanfreepath_P, & !< mean free travel distance for dislocations between two Peierls barriers
jumpWidth_P, & !< depth of activated area
jumpWidth_S, & !< depth of activated area
activationLength_P, & !< length of activated dislocation line
activationLength_S, & !< length of activated dislocation line
activationVolume_P, & !< volume that needs to be activated to overcome barrier
activationVolume_S, & !< volume that needs to be activated to overcome barrier
activationEnergy_P, & !< energy that is needed to overcome barrier
activationEnergy_S, & !< energy that is needed to overcome barrier
criticalStress_P, & !< maximum obstacle strength
criticalStress_S, & !< maximum obstacle strength
mobility !< dislocation mobility
associate(prm => param(instance))
ns = prm%sum_N_sl
v = 0.0_pReal
dv_dtau = 0.0_pReal
dv_dtauNS = 0.0_pReal
do s = 1,ns
if (abs(tau(s)) > tauThreshold(s)) then
!* Peierls contribution
!* Effective stress includes non Schmid constributions
!* The derivative only gives absolute values; the correct sign is taken care of in the formula for the derivative of the velocity
tauEff = max(0.0_pReal, abs(tauNS(s)) - tauThreshold(s)) ! ensure that the effective stress is positive
meanfreepath_P = prm%burgers(s)
jumpWidth_P = prm%burgers(s)
activationLength_P = prm%doublekinkwidth *prm%burgers(s)
activationVolume_P = activationLength_P * jumpWidth_P * prm%burgers(s)
criticalStress_P = prm%peierlsStress(s,c)
activationEnergy_P = criticalStress_P * activationVolume_P
tauRel_P = min(1.0_pReal, tauEff / criticalStress_P) ! ensure that the activation probability cannot become greater than one
tPeierls = 1.0_pReal / prm%fattack &
* exp(activationEnergy_P / (kB * Temperature) &
* (1.0_pReal - tauRel_P**prm%p)**prm%q)
if (tauEff < criticalStress_P) then
dtPeierls_dtau = tPeierls * prm%p * prm%q * activationVolume_P / (kB * Temperature) &
* (1.0_pReal - tauRel_P**prm%p)**(prm%q-1.0_pReal) * tauRel_P**(prm%p-1.0_pReal)
else
dtPeierls_dtau = 0.0_pReal
endif
!* Contribution from solid solution strengthening
!* The derivative only gives absolute values; the correct sign is taken care of in the formula for the derivative of the velocity
tauEff = abs(tau(s)) - tauThreshold(s)
meanfreepath_S = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
jumpWidth_S = prm%solidSolutionSize * prm%burgers(s)
activationLength_S = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
activationVolume_S = activationLength_S * jumpWidth_S * prm%burgers(s)
activationEnergy_S = prm%solidSolutionEnergy
criticalStress_S = activationEnergy_S / activationVolume_S
tauRel_S = min(1.0_pReal, tauEff / criticalStress_S) ! ensure that the activation probability cannot become greater than one
tSolidSolution = 1.0_pReal / prm%fattack &
* exp(activationEnergy_S / (kB * Temperature)* (1.0_pReal - tauRel_S**prm%p)**prm%q)
if (tauEff < criticalStress_S) then
dtSolidSolution_dtau = tSolidSolution * prm%p * prm%q * activationVolume_S / (kB * Temperature) &
* (1.0_pReal - tauRel_S**prm%p)**(prm%q-1.0_pReal)* tauRel_S**(prm%p-1.0_pReal)
else
dtSolidSolution_dtau = 0.0_pReal
endif
!* viscous glide velocity
tauEff = abs(tau(s)) - tauThreshold(s)
mobility = prm%burgers(s) / prm%viscosity
vViscous = mobility * tauEff
!* Mean velocity results from waiting time at peierls barriers and solid solution obstacles with respective meanfreepath of
!* free flight at glide velocity in between.
!* adopt sign from resolved stress
v(s) = sign(1.0_pReal,tau(s)) &
/ (tPeierls / meanfreepath_P + tSolidSolution / meanfreepath_S + 1.0_pReal / vViscous)
dv_dtau(s) = v(s)**2.0_pReal * (dtSolidSolution_dtau / meanfreepath_S + mobility /vViscous**2.0_pReal)
dv_dtauNS(s) = v(s)**2.0_pReal * dtPeierls_dtau / meanfreepath_P
endif
enddo
end associate
end subroutine kinetics
!--------------------------------------------------------------------------------------------------
!> @brief returns copy of current dislocation densities from state
!> @details raw values is rectified
!--------------------------------------------------------------------------------------------------
function getRho(instance,of,ip,el)
integer, intent(in) :: instance, of,ip,el
real(pReal), dimension(param(instance)%sum_N_sl,10) :: getRho
associate(prm => param(instance))
getRho = reshape(state(instance)%rho(:,of),[prm%sum_N_sl,10])
! ensure positive densities (not for imm, they have a sign)
getRho(:,mob) = max(getRho(:,mob),0.0_pReal)
getRho(:,dip) = max(getRho(:,dip),0.0_pReal)
where(abs(getRho) < max(prm%significantN/IPvolume(ip,el)**(2.0_pReal/3.0_pReal),prm%significantRho)) &
getRho = 0.0_pReal
end associate
end function getRho
!--------------------------------------------------------------------------------------------------
!> @brief returns copy of current dislocation densities from state
!> @details raw values is rectified
!--------------------------------------------------------------------------------------------------
function getRho0(instance,of,ip,el)
integer, intent(in) :: instance, of,ip,el
real(pReal), dimension(param(instance)%sum_N_sl,10) :: getRho0
associate(prm => param(instance))
getRho0 = reshape(state0(instance)%rho(:,of),[prm%sum_N_sl,10])
! ensure positive densities (not for imm, they have a sign)
getRho0(:,mob) = max(getRho0(:,mob),0.0_pReal)
getRho0(:,dip) = max(getRho0(:,dip),0.0_pReal)
where(abs(getRho0) < max(prm%significantN/IPvolume(ip,el)**(2.0_pReal/3.0_pReal),prm%significantRho)) &
getRho0 = 0.0_pReal
end associate
end function getRho0
end submodule plastic_nonlocal
# 44 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
# 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90" 1
!--------------------------------------------------------------------------------------------------
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH
!> @author Chen Zhang, Michigan State University
!> @brief crystallite state integration functions and reporting of results
!--------------------------------------------------------------------------------------------------
module crystallite
use prec
use IO
use HDF5_utilities
use DAMASK_interface
use config
use debug
use numerics
use rotations
use math
use FEsolving
use material
use constitutive
use discretization
use lattice
use results
implicit none
private
real(pReal), dimension(:,:,:), allocatable, public :: &
crystallite_dt !< requested time increment of each grain
real(pReal), dimension(:,:,:), allocatable :: &
crystallite_subdt, & !< substepped time increment of each grain
crystallite_subFrac, & !< already calculated fraction of increment
crystallite_subStep !< size of next integration step
type(rotation), dimension(:,:,:), allocatable :: &
crystallite_orientation !< current orientation
real(pReal), dimension(:,:,:,:,:), allocatable, public, protected :: &
crystallite_Fe, & !< current "elastic" def grad (end of converged time step)
crystallite_P, & !< 1st Piola-Kirchhoff stress per grain
crystallite_S0, & !< 2nd Piola-Kirchhoff stress vector at start of FE inc
crystallite_Fp0, & !< plastic def grad at start of FE inc
crystallite_Fi0, & !< intermediate def grad at start of FE inc
crystallite_F0, & !< def grad at start of FE inc
crystallite_Lp0, & !< plastic velocitiy grad at start of FE inc
crystallite_Li0 !< intermediate velocitiy grad at start of FE inc
real(pReal), dimension(:,:,:,:,:), allocatable, public :: &
crystallite_S, & !< current 2nd Piola-Kirchhoff stress vector (end of converged time step)
crystallite_partionedS0, & !< 2nd Piola-Kirchhoff stress vector at start of homog inc
crystallite_Fp, & !< current plastic def grad (end of converged time step)
crystallite_partionedFp0,& !< plastic def grad at start of homog inc
crystallite_Fi, & !< current intermediate def grad (end of converged time step)
crystallite_partionedFi0,& !< intermediate def grad at start of homog inc
crystallite_partionedF, & !< def grad to be reached at end of homog inc
crystallite_partionedF0, & !< def grad at start of homog inc
crystallite_Lp, & !< current plastic velocitiy grad (end of converged time step)
crystallite_partionedLp0, & !< plastic velocity grad at start of homog inc
crystallite_Li, & !< current intermediate velocitiy grad (end of converged time step)
crystallite_partionedLi0 !< intermediate velocity grad at start of homog inc
real(pReal), dimension(:,:,:,:,:), allocatable :: &
crystallite_subFp0,& !< plastic def grad at start of crystallite inc
crystallite_subFi0,& !< intermediate def grad at start of crystallite inc
crystallite_subF, & !< def grad to be reached at end of crystallite inc
crystallite_subF0, & !< def grad at start of crystallite inc
crystallite_subLp0,& !< plastic velocity grad at start of crystallite inc
crystallite_subLi0 !< intermediate velocity grad at start of crystallite inc
real(pReal), dimension(:,:,:,:,:,:,:), allocatable, public, protected :: &
crystallite_dPdF !< current individual dPdF per grain (end of converged time step)
logical, dimension(:,:,:), allocatable, public :: &
crystallite_requested !< used by upper level (homogenization) to request crystallite calculation
logical, dimension(:,:,:), allocatable :: &
crystallite_converged, & !< convergence flag
crystallite_todo, & !< flag to indicate need for further computation
crystallite_localPlasticity !< indicates this grain to have purely local constitutive law
type :: tOutput !< new requested output (per phase)
character(len=pStringLen), allocatable, dimension(:) :: &
label
end type tOutput
type(tOutput), allocatable, dimension(:) :: output_constituent
type :: tNumerics
integer :: &
iJacoLpresiduum, & !< frequency of Jacobian update of residuum in Lp
nState, & !< state loop limit
nStress !< stress loop limit
real(pReal) :: &
subStepMinCryst, & !< minimum (relative) size of sub-step allowed during cutback
subStepSizeCryst, & !< size of first substep when cutback
subStepSizeLp, & !< size of first substep when cutback in Lp calculation
subStepSizeLi, & !< size of first substep when cutback in Li calculation
stepIncreaseCryst, & !< increase of next substep size when previous substep converged
rtol_crystalliteState, & !< relative tolerance in state loop
rtol_crystalliteStress, & !< relative tolerance in stress loop
atol_crystalliteStress !< absolute tolerance in stress loop
end type tNumerics
type(tNumerics) :: num ! numerics parameters. Better name?
procedure(), pointer :: integrateState
public :: &
crystallite_init, &
crystallite_stress, &
crystallite_stressTangent, &
crystallite_orientations, &
crystallite_push33ToRef, &
crystallite_results, &
crystallite_restartWrite, &
crystallite_restartRead, &
crystallite_forward
contains
!--------------------------------------------------------------------------------------------------
!> @brief allocates and initialize per grain variables
!--------------------------------------------------------------------------------------------------
subroutine crystallite_init
logical, dimension(discretization_nIP,discretization_nElem) :: devNull
integer :: &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
cMax, & !< maximum number of integration point components
iMax, & !< maximum number of integration points
eMax, & !< maximum number of elements
myNcomponents !< number of components at current IP
write(6,'(/,a)') ' <<<+- crystallite init -+>>>'
cMax = homogenization_maxNgrains
iMax = discretization_nIP
eMax = discretization_nElem
allocate(crystallite_partionedF(3,3,cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_S0, &
crystallite_F0, crystallite_Fi0,crystallite_Fp0, &
crystallite_Li0,crystallite_Lp0, &
crystallite_partionedS0, &
crystallite_partionedF0,crystallite_partionedFp0,crystallite_partionedFi0, &
crystallite_partionedLp0,crystallite_partionedLi0, &
crystallite_S,crystallite_P, &
crystallite_Fe,crystallite_Fi,crystallite_Fp, &
crystallite_Li,crystallite_Lp, &
crystallite_subF,crystallite_subF0, &
crystallite_subFp0,crystallite_subFi0, &
crystallite_subLi0,crystallite_subLp0, &
source = crystallite_partionedF)
allocate(crystallite_dPdF(3,3,3,3,cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_dt(cMax,iMax,eMax),source=0.0_pReal)
allocate(crystallite_subdt,crystallite_subFrac,crystallite_subStep, &
source = crystallite_dt)
allocate(crystallite_orientation(cMax,iMax,eMax))
allocate(crystallite_localPlasticity(cMax,iMax,eMax), source=.true.)
allocate(crystallite_requested(cMax,iMax,eMax), source=.false.)
allocate(crystallite_todo(cMax,iMax,eMax), source=.false.)
allocate(crystallite_converged(cMax,iMax,eMax), source=.true.)
num%subStepMinCryst = config_numerics%getFloat('substepmincryst', defaultVal=1.0e-3_pReal)
num%subStepSizeCryst = config_numerics%getFloat('substepsizecryst', defaultVal=0.25_pReal)
num%stepIncreaseCryst = config_numerics%getFloat('stepincreasecryst', defaultVal=1.5_pReal)
num%subStepSizeLp = config_numerics%getFloat('substepsizelp', defaultVal=0.5_pReal)
num%subStepSizeLi = config_numerics%getFloat('substepsizeli', defaultVal=0.5_pReal)
num%rtol_crystalliteState = config_numerics%getFloat('rtol_crystallitestate', defaultVal=1.0e-6_pReal)
num%rtol_crystalliteStress = config_numerics%getFloat('rtol_crystallitestress',defaultVal=1.0e-6_pReal)
num%atol_crystalliteStress = config_numerics%getFloat('atol_crystallitestress',defaultVal=1.0e-8_pReal)
num%iJacoLpresiduum = config_numerics%getInt ('ijacolpresiduum', defaultVal=1)
num%nState = config_numerics%getInt ('nstate', defaultVal=20)
num%nStress = config_numerics%getInt ('nstress', defaultVal=40)
if(num%subStepMinCryst <= 0.0_pReal) call IO_error(301,ext_msg='subStepMinCryst')
if(num%subStepSizeCryst <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeCryst')
if(num%stepIncreaseCryst <= 0.0_pReal) call IO_error(301,ext_msg='stepIncreaseCryst')
if(num%subStepSizeLp <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeLp')
if(num%subStepSizeLi <= 0.0_pReal) call IO_error(301,ext_msg='subStepSizeLi')
if(num%rtol_crystalliteState <= 0.0_pReal) call IO_error(301,ext_msg='rtol_crystalliteState')
if(num%rtol_crystalliteStress <= 0.0_pReal) call IO_error(301,ext_msg='rtol_crystalliteStress')
if(num%atol_crystalliteStress <= 0.0_pReal) call IO_error(301,ext_msg='atol_crystalliteStress')
if(num%iJacoLpresiduum < 1) call IO_error(301,ext_msg='iJacoLpresiduum')
if(num%nState < 1) call IO_error(301,ext_msg='nState')
if(num%nStress< 1) call IO_error(301,ext_msg='nStress')
select case(numerics_integrator)
case(1)
integrateState => integrateStateFPI
case(2)
integrateState => integrateStateEuler
case(3)
integrateState => integrateStateAdaptiveEuler
case(4)
integrateState => integrateStateRK4
case(5)
integrateState => integrateStateRKCK45
end select
allocate(output_constituent(size(config_phase)))
do c = 1, size(config_phase)
allocate(output_constituent(c)%label(1))
output_constituent(c)%label(1)= 'GfortranBug86277'
output_constituent(c)%label = config_phase(c)%getStrings('(output)',defaultVal=output_constituent(c)%label )
if (output_constituent(c)%label (1) == 'GfortranBug86277') output_constituent(c)%label = [character(len=pStringLen)::]
enddo
call config_deallocate('material.config/phase')
!--------------------------------------------------------------------------------------------------
! initialize
!$OMP PARALLEL DO PRIVATE(myNcomponents,i,c)
do e = FEsolving_execElem(1),FEsolving_execElem(2)
myNcomponents = homogenization_Ngrains(material_homogenizationAt(e))
do i = FEsolving_execIP(1), FEsolving_execIP(2); do c = 1, myNcomponents
crystallite_Fp0(1:3,1:3,c,i,e) = material_orientation0(c,i,e)%asMatrix() ! plastic def gradient reflects init orientation
crystallite_Fp0(1:3,1:3,c,i,e) = crystallite_Fp0(1:3,1:3,c,i,e) &
/ math_det33(crystallite_Fp0(1:3,1:3,c,i,e))**(1.0_pReal/3.0_pReal)
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_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_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_Fi(1:3,1:3,c,i,e) = crystallite_Fi0(1:3,1:3,c,i,e)
crystallite_requested(c,i,e) = .true.
enddo; enddo
enddo
!$OMP END PARALLEL DO
if(any(.not. crystallite_localPlasticity) .and. .not. usePingPong) call IO_error(601) ! exit if nonlocal but no ping-pong ToDo: Why not check earlier? or in nonlocal?
crystallite_partionedFp0 = crystallite_Fp0
crystallite_partionedFi0 = crystallite_Fi0
crystallite_partionedF0 = crystallite_F0
crystallite_partionedF = crystallite_F0
call crystallite_orientations()
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call constitutive_dependentState(crystallite_partionedF0(1:3,1:3,c,i,e), &
crystallite_partionedFp0(1:3,1:3,c,i,e), &
c,i,e) ! update dependent state variables to be consistent with basic states
enddo
enddo
enddo
!$OMP END PARALLEL DO
devNull = crystallite_stress()
call crystallite_stressTangent
# 283 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
end subroutine crystallite_init
!--------------------------------------------------------------------------------------------------
!> @brief calculate stress (P)
!--------------------------------------------------------------------------------------------------
function crystallite_stress(dummyArgumentToPreventInternalCompilerErrorWithGCC)
logical, dimension(discretization_nIP,discretization_nElem) :: crystallite_stress
real(pReal), intent(in), optional :: &
dummyArgumentToPreventInternalCompilerErrorWithGCC
real(pReal) :: &
formerSubStep
integer :: &
NiterationCrystallite, & ! number of iterations in crystallite loop
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
startIP, endIP, &
s
# 325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
!--------------------------------------------------------------------------------------------------
! initialize to starting condition
crystallite_subStep = 0.0_pReal
!$OMP PARALLEL DO
elementLooping1: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2); do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
homogenizationRequestsCalculation: if (crystallite_requested(c,i,e)) then
plasticState (material_phaseAt(c,e))%subState0( :,material_phaseMemberAt(c,i,e)) = &
plasticState (material_phaseAt(c,e))%partionedState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState(material_phaseAt(c,e))%p(s)%subState0( :,material_phaseMemberAt(c,i,e)) = &
sourceState(material_phaseAt(c,e))%p(s)%partionedState0(:,material_phaseMemberAt(c,i,e))
enddo
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_subFi0(1:3,1:3,c,i,e) = crystallite_partionedFi0(1:3,1:3,c,i,e)
crystallite_subLi0(1:3,1:3,c,i,e) = crystallite_partionedLi0(1:3,1:3,c,i,e)
crystallite_subF0(1:3,1:3,c,i,e) = crystallite_partionedF0(1:3,1:3,c,i,e)
crystallite_subFrac(c,i,e) = 0.0_pReal
crystallite_subStep(c,i,e) = 1.0_pReal/num%subStepSizeCryst
crystallite_todo(c,i,e) = .true.
crystallite_converged(c,i,e) = .false. ! pretend failed step of 1/subStepSizeCryst
endif homogenizationRequestsCalculation
enddo; enddo
enddo elementLooping1
!$OMP END PARALLEL DO
singleRun: if (FEsolving_execELem(1) == FEsolving_execElem(2) .and. &
FEsolving_execIP (1) == FEsolving_execIP (2)) then
startIP = FEsolving_execIP(1)
endIP = startIP
else singleRun
startIP = 1
endIP = discretization_nIP
endif singleRun
NiterationCrystallite = 0
cutbackLooping: do while (any(crystallite_todo(:,startIP:endIP,FEsolving_execELem(1):FEsolving_execElem(2))))
NiterationCrystallite = NiterationCrystallite + 1
!$OMP PARALLEL DO PRIVATE(formerSubStep)
elementLooping3: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
!--------------------------------------------------------------------------------------------------
! wind forward
if (crystallite_converged(c,i,e)) then
formerSubStep = crystallite_subStep(c,i,e)
crystallite_subFrac(c,i,e) = crystallite_subFrac(c,i,e) + crystallite_subStep(c,i,e)
crystallite_subStep(c,i,e) = min(1.0_pReal - crystallite_subFrac(c,i,e), &
num%stepIncreaseCryst * crystallite_subStep(c,i,e))
crystallite_todo(c,i,e) = crystallite_subStep(c,i,e) > 0.0_pReal ! still time left to integrate on?
if (crystallite_todo(c,i,e)) then
crystallite_subF0 (1:3,1:3,c,i,e) = crystallite_subF(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_subLi0(1:3,1:3,c,i,e) = crystallite_Li (1:3,1:3,c,i,e)
crystallite_subFp0(1:3,1:3,c,i,e) = crystallite_Fp (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)
!if abbrevation, make c and p private in omp
plasticState( material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e)) &
= plasticState(material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e)) &
= sourceState(material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e))
enddo
endif
!--------------------------------------------------------------------------------------------------
! cut back (reduced time and restore)
else
crystallite_subStep(c,i,e) = num%subStepSizeCryst * crystallite_subStep(c,i,e)
crystallite_Fp (1:3,1:3,c,i,e) = crystallite_subFp0(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_S (1:3,1:3,c,i,e) = crystallite_S0 (1:3,1:3,c,i,e)
if (crystallite_subStep(c,i,e) < 1.0_pReal) then ! actual (not initial) cutback
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)
endif
plasticState (material_phaseAt(c,e))%state( :,material_phaseMemberAt(c,i,e)) &
= plasticState(material_phaseAt(c,e))%subState0(:,material_phaseMemberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState( material_phaseAt(c,e))%p(s)%state( :,material_phaseMemberAt(c,i,e)) &
= sourceState(material_phaseAt(c,e))%p(s)%subState0(:,material_phaseMemberAt(c,i,e))
enddo
! cant restore dotState here, since not yet calculated in first cutback after initialization
crystallite_todo(c,i,e) = crystallite_subStep(c,i,e) > num%subStepMinCryst ! still on track or already done (beyond repair)
endif
!--------------------------------------------------------------------------------------------------
! prepare for integration
if (crystallite_todo(c,i,e)) then
crystallite_subF(1:3,1:3,c,i,e) = crystallite_subF0(1:3,1:3,c,i,e) &
+ crystallite_subStep(c,i,e) *( crystallite_partionedF (1:3,1:3,c,i,e) &
-crystallite_partionedF0(1:3,1:3,c,i,e))
crystallite_Fe(1:3,1:3,c,i,e) = matmul(matmul(crystallite_subF(1:3,1:3,c,i,e), &
math_inv33(crystallite_Fp(1:3,1:3,c,i,e))), &
math_inv33(crystallite_Fi(1:3,1:3,c,i,e)))
crystallite_subdt(c,i,e) = crystallite_subStep(c,i,e) * crystallite_dt(c,i,e)
crystallite_converged(c,i,e) = .false.
endif
enddo
enddo
enddo elementLooping3
!$OMP END PARALLEL DO
!--------------------------------------------------------------------------------------------------
! integrate --- requires fully defined state array (basic + dependent state)
if (any(crystallite_todo)) call integrateState ! TODO: unroll into proper elementloop to avoid N^2 for single point evaluation
where(.not. crystallite_converged .and. crystallite_subStep > num%subStepMinCryst) & ! do not try non-converged but fully cutbacked any further
crystallite_todo = .true. ! TODO: again unroll this into proper elementloop to avoid N^2 for single point evaluation
enddo cutbackLooping
! return whether converged or not
crystallite_stress = .false.
elementLooping5: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
crystallite_stress(i,e) = all(crystallite_converged(:,i,e))
enddo
enddo elementLooping5
end function crystallite_stress
!--------------------------------------------------------------------------------------------------
!> @brief calculate tangent (dPdF)
!--------------------------------------------------------------------------------------------------
subroutine crystallite_stressTangent
integer :: &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e, & !< counter in element loop
o, &
p
real(pReal), dimension(3,3) :: devNull, &
invSubFp0,invSubFi0,invFp,invFi, &
temp_33_1, temp_33_2, temp_33_3, temp_33_4
real(pReal), dimension(3,3,3,3) :: dSdFe, &
dSdF, &
dSdFi, &
dLidS, & ! tangent in lattice configuration
dLidFi, &
dLpdS, &
dLpdFi, &
dFidS, &
dFpinvdF, &
rhs_3333, &
lhs_3333, &
temp_3333
real(pReal), dimension(9,9):: temp_99
logical :: error
!$OMP PARALLEL DO PRIVATE(dSdF,dSdFe,dSdFi,dLpdS,dLpdFi,dFpinvdF,dLidS,dLidFi,dFidS,o,p, &
!$OMP invSubFp0,invSubFi0,invFp,invFi, &
!$OMP rhs_3333,lhs_3333,temp_99,temp_33_1,temp_33_2,temp_33_3,temp_33_4,temp_3333,error)
elementLooping: do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call constitutive_SandItsTangents(devNull,dSdFe,dSdFi, &
crystallite_Fe(1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e),c,i,e)
call constitutive_LiAndItsTangents(devNull,dLidS,dLidFi, &
crystallite_S (1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e), &
c,i,e)
invFp = math_inv33(crystallite_Fp(1:3,1:3,c,i,e))
invFi = math_inv33(crystallite_Fi(1:3,1:3,c,i,e))
invSubFp0 = math_inv33(crystallite_subFp0(1:3,1:3,c,i,e))
invSubFi0 = math_inv33(crystallite_subFi0(1:3,1:3,c,i,e))
if (sum(abs(dLidS)) < tol_math_check) then
dFidS = 0.0_pReal
else
lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal
do o=1,3; do p=1,3
lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) &
+ crystallite_subdt(c,i,e)*matmul(invSubFi0,dLidFi(1:3,1:3,o,p))
lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) &
+ invFi*invFi(p,o)
rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) &
- crystallite_subdt(c,i,e)*matmul(invSubFi0,dLidS(1:3,1:3,o,p))
enddo; enddo
call math_invert(temp_99,error,math_3333to99(lhs_3333))
if (error) then
call IO_warning(warning_ID=600,el=e,ip=i,g=c, &
ext_msg='inversion error in analytic tangent calculation')
dFidS = 0.0_pReal
else
dFidS = math_mul3333xx3333(math_99to3333(temp_99),rhs_3333)
endif
dLidS = math_mul3333xx3333(dLidFi,dFidS) + dLidS
endif
call constitutive_LpAndItsTangents(devNull,dLpdS,dLpdFi, &
crystallite_S (1:3,1:3,c,i,e), &
crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate Lp tangent in lattice configuration
dLpdS = math_mul3333xx3333(dLpdFi,dFidS) + dLpdS
!--------------------------------------------------------------------------------------------------
! calculate dSdF
temp_33_1 = transpose(matmul(invFp,invFi))
temp_33_2 = matmul(crystallite_subF(1:3,1:3,c,i,e),invSubFp0)
temp_33_3 = matmul(matmul(crystallite_subF(1:3,1:3,c,i,e),invFp), invSubFi0)
do o=1,3; do p=1,3
rhs_3333(p,o,1:3,1:3) = matmul(dSdFe(p,o,1:3,1:3),temp_33_1)
temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dLpdS(1:3,1:3,p,o)), invFi) &
+ matmul(temp_33_3,dLidS(1:3,1:3,p,o))
enddo; enddo
lhs_3333 = crystallite_subdt(c,i,e)*math_mul3333xx3333(dSdFe,temp_3333) &
+ math_mul3333xx3333(dSdFi,dFidS)
call math_invert(temp_99,error,math_identity2nd(9)+math_3333to99(lhs_3333))
if (error) then
call IO_warning(warning_ID=600,el=e,ip=i,g=c, &
ext_msg='inversion error in analytic tangent calculation')
dSdF = rhs_3333
else
dSdF = math_mul3333xx3333(math_99to3333(temp_99),rhs_3333)
endif
!--------------------------------------------------------------------------------------------------
! calculate dFpinvdF
temp_3333 = math_mul3333xx3333(dLpdS,dSdF)
do o=1,3; do p=1,3
dFpinvdF(1:3,1:3,p,o) = -crystallite_subdt(c,i,e) &
* matmul(invSubFp0, matmul(temp_3333(1:3,1:3,p,o),invFi))
enddo; enddo
!--------------------------------------------------------------------------------------------------
! assemble dPdF
temp_33_1 = matmul(crystallite_S(1:3,1:3,c,i,e),transpose(invFp))
temp_33_2 = matmul(invFp,temp_33_1)
temp_33_3 = matmul(crystallite_subF(1:3,1:3,c,i,e),invFp)
temp_33_4 = matmul(temp_33_3,crystallite_S(1:3,1:3,c,i,e))
crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = 0.0_pReal
do p=1,3
crystallite_dPdF(p,1:3,p,1:3,c,i,e) = transpose(temp_33_2)
enddo
do o=1,3; do p=1,3
crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) &
+ matmul(matmul(crystallite_subF(1:3,1:3,c,i,e), &
dFpinvdF(1:3,1:3,p,o)),temp_33_1) &
+ matmul(matmul(temp_33_3,dSdF(1:3,1:3,p,o)), &
transpose(invFp)) &
+ matmul(temp_33_4,transpose(dFpinvdF(1:3,1:3,p,o)))
enddo; enddo
enddo; enddo
enddo elementLooping
!$OMP END PARALLEL DO
end subroutine crystallite_stressTangent
!--------------------------------------------------------------------------------------------------
!> @brief calculates orientations
!--------------------------------------------------------------------------------------------------
subroutine crystallite_orientations
integer &
c, & !< counter in integration point component loop
i, & !< counter in integration point loop
e !< counter in element loop
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do c = 1,homogenization_Ngrains(material_homogenizationAt(e))
call crystallite_orientation(c,i,e)%fromMatrix(transpose(math_rotationalPart(crystallite_Fe(1:3,1:3,c,i,e))))
enddo; enddo; enddo
!$OMP END PARALLEL DO
nonlocalPresent: if (any(plasticState%nonLocal)) then
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
if (plasticState(material_phaseAt(1,e))%nonLocal) &
call plastic_nonlocal_updateCompatibility(crystallite_orientation, &
phase_plasticityInstance(material_phaseAt(i,e)),i,e)
enddo; enddo
!$OMP END PARALLEL DO
endif nonlocalPresent
end subroutine crystallite_orientations
!--------------------------------------------------------------------------------------------------
!> @brief Map 2nd order tensor to reference config
!--------------------------------------------------------------------------------------------------
function crystallite_push33ToRef(ipc,ip,el, tensor33)
real(pReal), dimension(3,3) :: crystallite_push33ToRef
real(pReal), dimension(3,3), intent(in) :: tensor33
real(pReal), dimension(3,3) :: T
integer, intent(in):: &
el, &
ip, &
ipc
T = matmul(material_orientation0(ipc,ip,el)%asMatrix(), & ! ToDo: initial orientation correct?
transpose(math_inv33(crystallite_subF(1:3,1:3,ipc,ip,el))))
crystallite_push33ToRef = matmul(transpose(T),matmul(tensor33,T))
end function crystallite_push33ToRef
!--------------------------------------------------------------------------------------------------
!> @brief writes crystallite results to HDF5 output file
!--------------------------------------------------------------------------------------------------
subroutine crystallite_results
integer :: p,o
real(pReal), allocatable, dimension(:,:,:) :: selected_tensors
type(rotation), allocatable, dimension(:) :: selected_rotations
character(len=pStringLen) :: group,structureLabel
do p=1,size(config_name_phase)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))//'/generic'
call results_closeGroup(results_addGroup(group))
do o = 1, size(output_constituent(p)%label)
select case (output_constituent(p)%label(o))
case('f')
selected_tensors = select_tensors(crystallite_partionedF,p)
call results_writeDataset(group,selected_tensors,'F',&
'deformation gradient','1')
case('fe')
selected_tensors = select_tensors(crystallite_Fe,p)
call results_writeDataset(group,selected_tensors,'Fe',&
'elastic deformation gradient','1')
case('fp')
selected_tensors = select_tensors(crystallite_Fp,p)
call results_writeDataset(group,selected_tensors,'Fp',&
'plastic deformation gradient','1')
case('fi')
selected_tensors = select_tensors(crystallite_Fi,p)
call results_writeDataset(group,selected_tensors,'Fi',&
'inelastic deformation gradient','1')
case('lp')
selected_tensors = select_tensors(crystallite_Lp,p)
call results_writeDataset(group,selected_tensors,'Lp',&
'plastic velocity gradient','1/s')
case('li')
selected_tensors = select_tensors(crystallite_Li,p)
call results_writeDataset(group,selected_tensors,'Li',&
'inelastic velocity gradient','1/s')
case('p')
selected_tensors = select_tensors(crystallite_P,p)
call results_writeDataset(group,selected_tensors,'P',&
'First Piola-Kirchoff stress','Pa')
case('s')
selected_tensors = select_tensors(crystallite_S,p)
call results_writeDataset(group,selected_tensors,'S',&
'Second Piola-Kirchoff stress','Pa')
case('orientation')
select case(lattice_structure(p))
case(lattice_ISO_ID)
structureLabel = 'iso'
case(lattice_FCC_ID)
structureLabel = 'fcc'
case(lattice_BCC_ID)
structureLabel = 'bcc'
case(lattice_BCT_ID)
structureLabel = 'bct'
case(lattice_HEX_ID)
structureLabel = 'hex'
case(lattice_ORT_ID)
structureLabel = 'ort'
end select
selected_rotations = select_rotations(crystallite_orientation,p)
call results_writeDataset(group,selected_rotations,'orientation',&
'crystal orientation as quaternion',structureLabel)
end select
enddo
enddo
contains
!------------------------------------------------------------------------------------------------
!> @brief select tensors for output
!------------------------------------------------------------------------------------------------
function select_tensors(dataset,instance)
integer, intent(in) :: instance
real(pReal), dimension(:,:,:,:,:), intent(in) :: dataset
real(pReal), allocatable, dimension(:,:,:) :: select_tensors
integer :: e,i,c,j
allocate(select_tensors(3,3,count(material_phaseAt==instance)*discretization_nIP))
j=0
do e = 1, size(material_phaseAt,2)
do i = 1, discretization_nIP
do c = 1, size(material_phaseAt,1) !ToDo: this needs to be changed for varying Ngrains
if (material_phaseAt(c,e) == instance) then
j = j + 1
select_tensors(1:3,1:3,j) = dataset(1:3,1:3,c,i,e)
endif
enddo
enddo
enddo
end function select_tensors
!--------------------------------------------------------------------------------------------------
!> @brief select rotations for output
!--------------------------------------------------------------------------------------------------
function select_rotations(dataset,instance)
integer, intent(in) :: instance
type(rotation), dimension(:,:,:), intent(in) :: dataset
type(rotation), allocatable, dimension(:) :: select_rotations
integer :: e,i,c,j
allocate(select_rotations(count(material_phaseAt==instance)*homogenization_maxNgrains*discretization_nIP))
j=0
do e = 1, size(material_phaseAt,2)
do i = 1, discretization_nIP
do c = 1, size(material_phaseAt,1) !ToDo: this needs to be changed for varying Ngrains
if (material_phaseAt(c,e) == instance) then
j = j + 1
select_rotations(j) = dataset(c,i,e)
endif
enddo
enddo
enddo
end function select_rotations
end subroutine crystallite_results
!--------------------------------------------------------------------------------------------------
!> @brief calculation of stress (P) with time integration based on a residuum in Lp and
!> intermediate acceleration of the Newton-Raphson correction
!--------------------------------------------------------------------------------------------------
logical function integrateStress(ipc,ip,el,timeFraction)
integer, intent(in):: el, & ! element index
ip, & ! integration point index
ipc ! grain index
real(pReal), optional, intent(in) :: timeFraction ! fraction of timestep
real(pReal), dimension(3,3):: F, & ! deformation gradient at end of timestep
Fp_new, & ! plastic deformation gradient at end of timestep
invFp_new, & ! inverse of Fp_new
invFp_current, & ! inverse of Fp_current
Lpguess, & ! current guess for plastic velocity gradient
Lpguess_old, & ! known last good guess for plastic velocity gradient
Lp_constitutive, & ! plastic velocity gradient resulting from constitutive law
residuumLp, & ! current residuum of plastic velocity gradient
residuumLp_old, & ! last residuum of plastic velocity gradient
deltaLp, & ! direction of next guess
Fi_new, & ! gradient of intermediate deformation stages
invFi_new, &
invFi_current, & ! inverse of Fi_current
Liguess, & ! current guess for intermediate velocity gradient
Liguess_old, & ! known last good guess for intermediate velocity gradient
Li_constitutive, & ! intermediate velocity gradient resulting from constitutive law
residuumLi, & ! current residuum of intermediate velocity gradient
residuumLi_old, & ! last residuum of intermediate velocity gradient
deltaLi, & ! direction of next guess
Fe, & ! elastic deformation gradient
Fe_new, &
S, & ! 2nd Piola-Kirchhoff Stress in plastic (lattice) configuration
A, &
B, &
temp_33
real(pReal), dimension(9) :: temp_9 ! needed for matrix inversion by LAPACK
integer, dimension(9) :: devNull_9 ! needed for matrix inversion by LAPACK
real(pReal), dimension(9,9) :: dRLp_dLp, & ! partial derivative of residuum (Jacobian for Newton-Raphson scheme)
dRLi_dLi ! partial derivative of residuumI (Jacobian for Newton-Raphson scheme)
real(pReal), dimension(3,3,3,3):: dS_dFe, & ! partial derivative of 2nd Piola-Kirchhoff stress
dS_dFi, &
dFe_dLp, & ! partial derivative of elastic deformation gradient
dFe_dLi, &
dFi_dLi, &
dLp_dFi, &
dLi_dFi, &
dLp_dS, &
dLi_dS
real(pReal) steplengthLp, &
steplengthLi, &
dt, & ! time increment
atol_Lp, &
atol_Li, &
devNull
integer NiterationStressLp, & ! number of stress integrations
NiterationStressLi, & ! number of inner stress integrations
ierr, & ! error indicator for LAPACK
o, &
p, &
jacoCounterLp, &
jacoCounterLi ! counters to check for Jacobian update
logical :: error
external :: &
dgesv
integrateStress = .false.
if (present(timeFraction)) then
dt = crystallite_subdt(ipc,ip,el) * timeFraction
F = crystallite_subF0(1:3,1:3,ipc,ip,el) &
+ (crystallite_subF(1:3,1:3,ipc,ip,el) - crystallite_subF0(1:3,1:3,ipc,ip,el)) * timeFraction
else
dt = crystallite_subdt(ipc,ip,el)
F = crystallite_subF(1:3,1:3,ipc,ip,el)
endif
Lpguess = crystallite_Lp(1:3,1:3,ipc,ip,el) ! take as first guess
Liguess = crystallite_Li(1:3,1:3,ipc,ip,el) ! take as first guess
call math_invert33(invFp_current,devNull,error,crystallite_subFp0(1:3,1:3,ipc,ip,el))
if (error) return ! error
call math_invert33(invFi_current,devNull,error,crystallite_subFi0(1:3,1:3,ipc,ip,el))
if (error) return ! error
A = matmul(F,invFp_current) ! intermediate tensor needed later to calculate dFe_dLp
jacoCounterLi = 0
steplengthLi = 1.0_pReal
residuumLi_old = 0.0_pReal
Liguess_old = Liguess
NiterationStressLi = 0
LiLoop: do
NiterationStressLi = NiterationStressLi + 1
if (NiterationStressLi>num%nStress) return ! error
invFi_new = matmul(invFi_current,math_I3 - dt*Liguess)
Fi_new = math_inv33(invFi_new)
jacoCounterLp = 0
steplengthLp = 1.0_pReal
residuumLp_old = 0.0_pReal
Lpguess_old = Lpguess
NiterationStressLp = 0
LpLoop: do
NiterationStressLp = NiterationStressLp + 1
if (NiterationStressLp>num%nStress) return ! error
B = math_I3 - dt*Lpguess
Fe = matmul(matmul(A,B), invFi_new)
call constitutive_SandItsTangents(S, dS_dFe, dS_dFi, &
Fe, Fi_new, ipc, ip, el)
call constitutive_LpAndItsTangents(Lp_constitutive, dLp_dS, dLp_dFi, &
S, Fi_new, ipc, ip, el)
!* update current residuum and check for convergence of loop
atol_Lp = max(num%rtol_crystalliteStress * max(norm2(Lpguess),norm2(Lp_constitutive)), & ! absolute tolerance from largest acceptable relative error
num%atol_crystalliteStress) ! minimum lower cutoff
residuumLp = Lpguess - Lp_constitutive
if (any(IEEE_is_NaN(residuumLp))) then
return ! error
elseif (norm2(residuumLp) < atol_Lp) then ! converged if below absolute tolerance
exit LpLoop
elseif (NiterationStressLp == 1 .or. norm2(residuumLp) < norm2(residuumLp_old)) then ! not converged, but improved norm of residuum (always proceed in first iteration)...
residuumLp_old = residuumLp ! ...remember old values and...
Lpguess_old = Lpguess
steplengthLp = 1.0_pReal ! ...proceed with normal step length (calculate new search direction)
else ! not converged and residuum not improved...
steplengthLp = num%subStepSizeLp * steplengthLp ! ...try with smaller step length in same direction
Lpguess = Lpguess_old &
+ deltaLp * stepLengthLp
cycle LpLoop
endif
!* calculate Jacobian for correction term
if (mod(jacoCounterLp, num%iJacoLpresiduum) == 0) then
jacoCounterLp = jacoCounterLp + 1
do o=1,3; do p=1,3
dFe_dLp(o,1:3,p,1:3) = A(o,p)*transpose(invFi_new) ! dFe_dLp(i,j,k,l) = -dt * A(i,k) invFi(l,j)
enddo; enddo
dFe_dLp = - dt * dFe_dLp
dRLp_dLp = math_identity2nd(9) &
- math_3333to99(math_mul3333xx3333(math_mul3333xx3333(dLp_dS,dS_dFe),dFe_dLp))
temp_9 = math_33to9(residuumLp)
call dgesv(9,1,dRLp_dLp,9,devNull_9,temp_9,9,ierr) ! solve dRLp/dLp * delta Lp = -res for delta Lp
if (ierr /= 0) return ! error
deltaLp = - math_9to33(temp_9)
endif
Lpguess = Lpguess &
+ deltaLp * steplengthLp
enddo LpLoop
call constitutive_LiAndItsTangents(Li_constitutive, dLi_dS, dLi_dFi, &
S, Fi_new, ipc, ip, el)
!* update current residuum and check for convergence of loop
atol_Li = max(num%rtol_crystalliteStress * max(norm2(Liguess),norm2(Li_constitutive)), & ! absolute tolerance from largest acceptable relative error
num%atol_crystalliteStress) ! minimum lower cutoff
residuumLi = Liguess - Li_constitutive
if (any(IEEE_is_NaN(residuumLi))) then
return ! error
elseif (norm2(residuumLi) < atol_Li) then ! converged if below absolute tolerance
exit LiLoop
elseif (NiterationStressLi == 1 .or. norm2(residuumLi) < norm2(residuumLi_old)) then ! not converged, but improved norm of residuum (always proceed in first iteration)...
residuumLi_old = residuumLi ! ...remember old values and...
Liguess_old = Liguess
steplengthLi = 1.0_pReal ! ...proceed with normal step length (calculate new search direction)
else ! not converged and residuum not improved...
steplengthLi = num%subStepSizeLi �s] for each trans system
18110 t_tw, & !< twin thickness [m] for each twin system
18111 clambdaslip, & !< Adj. parameter for distance between 2 forest dislocations for each slip system
18112 t_tr, & !< martensite lamellar thickness [m] for each trans system and instance
18113 p, & !< p-exponent in glide velocity
18114 q, & !< q-exponent in glide velocity
18115 r, & !< r-exponent in twin nucleation rate
18116 s, & !< s-exponent in trans nucleation rate
18117 gamma_char, & !< characteristic shear for twins
18119 real(preal),
allocatable,
dimension(:,:) :: &
18125 n0_sl, & !< slip system normal
18126 forestprojection, &
18128 real(preal),
allocatable,
dimension(:,:,:) :: &
18135 sum_n_sl, & !< total number of active slip system
18136 sum_n_tw, & !< total number of active twin system
18138 integer,
allocatable,
dimension(:,:) :: &
18139 fcc_twinnucleationslippair
18140 character(len=pStringLen),
allocatable,
dimension(:) :: &
18143 extendeddislocations, & !< consider split into partials for climb calculation
18144 fcctwintransnucleation, & !< twinning and transformation models are for fcc
18148 type :: tdislotwinstate
18149 real(preal),
dimension(:,:),
pointer :: &
18155 end type tdislotwinstate
18157 type :: tdislotwinmicrostructure
18158 real(preal),
dimension(:,:),
allocatable :: &
18159 lambda_sl, & !< mean free path between 2 obstacles seen by a moving dislocation
18160 lambda_tw, & !< mean free path between 2 obstacles seen by a growing twin
18161 lambda_tr, & !< mean free path between 2 obstacles seen by a growing martensite
18165 v_tw, & !< volume of a new twin
18166 v_tr, & !< volume of a new martensite disc
18167 tau_r_tw, & !< stress to bring partials close together (twin)
18169 end type tdislotwinmicrostructure
18173 type(tparameters),
allocatable,
dimension(:) :: param
18174 type(tdislotwinstate),
allocatable,
dimension(:) :: &
18177 type(tdislotwinmicrostructure),
allocatable,
dimension(:) :: dependentstate
18186 module subroutine plastic_dislotwin_init
18192 sizestate, sizedotstate, &
18193 startindex, endindex
18194 integer,
dimension(:),
allocatable :: &
18196 real(preal),
allocatable,
dimension(:) :: &
18197 rho_mob_0, & !< initial unipolar dislocation density per slip system
18199 character(len=pStringLen) :: &
18202 write(6,
'(/,a)')
' <<<+- constitutive_'//plasticity_dislotwin_label//
' init -+>>>';
flush(6)
18204 write(6,
'(/,a)')
' Ma and Roters, Acta Materialia 52(12):3603–3612, 2004'
18205 write(6,
'(a)')
' https://doi.org/10.1016/j.actamat.2004.04.012'
18207 write(6,
'(/,a)')
' Roters et al., Computational Materials Science 39:91–95, 2007'
18208 write(6,
'(a)')
' https://doi.org/10.1016/j.commatsci.2006.04.014'
18210 write(6,
'(/,a)')
' Wong et al., Acta Materialia 118:140–151, 2016'
18211 write(6,
'(a,/)')
' https://doi.org/10.1016/j.actamat.2016.07.032'
18213 ninstance = count(phase_plasticity == plasticity_dislotwin_id)
18215 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
18216 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
18218 allocate(param(ninstance))
18219 allocate(state(ninstance))
18220 allocate(dotstate(ninstance))
18221 allocate(dependentstate(ninstance))
18223 do p = 1,
size(phase_plasticity)
18224 if (phase_plasticity(p) /= plasticity_dislotwin_id) cycle
18225 associate(prm => param(phase_plasticityinstance(p)), &
18226 dot => dotstate(phase_plasticityinstance(p)), &
18227 stt => state(phase_plasticityinstance(p)), &
18228 dst => dependentstate(phase_plasticityinstance(p)), &
18229 config => config_phase(p))
18231 prm%output =
config%getStrings(
'(output)', defaultval=emptystringarray)
18234 prm%mu = lattice_mu(p)
18235 prm%nu = lattice_nu(p)
18236 prm%C66 = lattice_c66(1:6,1:6,p)
18240 n_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
18241 prm%sum_N_sl = sum(abs(n_sl))
18242 slipactive:
if (prm%sum_N_sl > 0)
then
18243 prm%P_sl = lattice_schmidmatrix_slip(n_sl,
config%getString(
'lattice_structure'),&
18244 config%getFloat(
'c/a',defaultval=0.0_preal))
18245 prm%h_sl_sl = lattice_interaction_slipbyslip(n_sl,
config%getFloats(
'interaction_slipslip'), &
18246 config%getString(
'lattice_structure'))
18247 prm%forestProjection = lattice_forestprojection_edge(n_sl,
config%getString(
'lattice_structure'),&
18248 config%getFloat(
'c/a',defaultval=0.0_preal))
18249 prm%forestProjection = transpose(prm%forestProjection)
18251 prm%n0_sl = lattice_slip_normal(n_sl,
config%getString(
'lattice_structure'),&
18252 config%getFloat(
'c/a',defaultval=0.0_preal))
18253 prm%fccTwinTransNucleation = merge(.true., .false., lattice_structure(p) == lattice_fcc_id) &
18254 .and. (n_sl(1) == 12)
18255 if(prm%fccTwinTransNucleation) prm%fcc_twinNucleationSlipPair = lattice_fcc_twinnucleationslippair
18257 rho_mob_0 =
config%getFloats(
'rhoedge0', requiredsize=
size(n_sl))
18258 rho_dip_0 =
config%getFloats(
'rhoedgedip0',requiredsize=
size(n_sl))
18259 prm%v0 =
config%getFloats(
'v0', requiredsize=
size(n_sl))
18260 prm%b_sl =
config%getFloats(
'slipburgers',requiredsize=
size(n_sl))
18261 prm%Delta_F =
config%getFloats(
'qedge', requiredsize=
size(n_sl))
18262 prm%CLambdaSlip =
config%getFloats(
'clambdaslip',requiredsize=
size(n_sl))
18263 prm%p =
config%getFloats(
'p_slip', requiredsize=
size(n_sl))
18264 prm%q =
config%getFloats(
'q_slip', requiredsize=
size(n_sl))
18265 prm%B =
config%getFloats(
'b', requiredsize=
size(n_sl), &
18266 defaultval=[(0.0_preal, i=1,
size(n_sl))])
18268 prm%tau_0 =
config%getFloat(
'solidsolutionstrength')
18269 prm%CEdgeDipMinDistance =
config%getFloat(
'cedgedipmindistance')
18270 prm%D0 =
config%getFloat(
'd0')
18271 prm%Qsd =
config%getFloat(
'qsd')
18272 prm%ExtendedDislocations =
config%keyExists(
'/extend_dislocations/')
18273 if (prm%ExtendedDislocations)
then
18274 prm%SFE_0K =
config%getFloat(
'sfe_0k')
18275 prm%dSFE_dT =
config%getFloat(
'dsfe_dt')
18278 prm%dipoleformation = .not.
config%keyExists(
'/nodipoleformation/')
18282 prm%omega =
config%getFloat(
'omega', defaultval = 1000.0_preal) &
18283 * merge(12.0_preal,8.0_preal,any(lattice_structure(p) == [lattice_fcc_id,lattice_hex_id]))
18286 rho_mob_0 = math_expand(rho_mob_0, n_sl)
18287 rho_dip_0 = math_expand(rho_dip_0, n_sl)
18288 prm%v0 = math_expand(prm%v0, n_sl)
18289 prm%b_sl = math_expand(prm%b_sl, n_sl)
18290 prm%Delta_F = math_expand(prm%Delta_F, n_sl)
18291 prm%CLambdaSlip = math_expand(prm%CLambdaSlip, n_sl)
18292 prm%p = math_expand(prm%p, n_sl)
18293 prm%q = math_expand(prm%q, n_sl)
18294 prm%B = math_expand(prm%B, n_sl)
18297 if ( prm%D0 <= 0.0_preal) extmsg = trim(extmsg)//
' D0'
18298 if ( prm%Qsd <= 0.0_preal) extmsg = trim(extmsg)//
' Qsd'
18299 if (any(rho_mob_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rho_mob_0'
18300 if (any(rho_dip_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rho_dip_0'
18301 if (any(prm%v0 < 0.0_preal)) extmsg = trim(extmsg)//
' v0'
18302 if (any(prm%b_sl <= 0.0_preal)) extmsg = trim(extmsg)//
' b_sl'
18303 if (any(prm%Delta_F <= 0.0_preal)) extmsg = trim(extmsg)//
' Delta_F'
18304 if (any(prm%CLambdaSlip <= 0.0_preal)) extmsg = trim(extmsg)//
' CLambdaSlip'
18305 if (any(prm%B < 0.0_preal)) extmsg = trim(extmsg)//
' B'
18306 if (any(prm%p<=0.0_preal .or. prm%p>1.0_preal)) extmsg = trim(extmsg)//
' p'
18307 if (any(prm%q< 1.0_preal .or. prm%q>2.0_preal)) extmsg = trim(extmsg)//
' q'
18309 rho_mob_0 = emptyrealarray; rho_dip_0 = emptyrealarray
18310 allocate(prm%b_sl,prm%Delta_F,prm%v0,prm%CLambdaSlip,prm%p,prm%q,prm%B,source=emptyrealarray)
18311 allocate(prm%forestProjection(0,0),prm%h_sl_sl(0,0))
18316 n_tw =
config%getInts(
'ntwin', defaultval=emptyintarray)
18317 prm%sum_N_tw = sum(abs(n_tw))
18318 twinactive:
if (prm%sum_N_tw > 0)
then
18319 prm%P_tw = lattice_schmidmatrix_twin(n_tw,
config%getString(
'lattice_structure'),&
18320 config%getFloat(
'c/a',defaultval=0.0_preal))
18321 prm%h_tw_tw = lattice_interaction_twinbytwin(n_tw,&
18322 config%getFloats(
'interaction_twintwin'), &
18323 config%getString(
'lattice_structure'))
18325 prm%b_tw =
config%getFloats(
'twinburgers', requiredsize=
size(n_tw))
18326 prm%t_tw =
config%getFloats(
'twinsize', requiredsize=
size(n_tw))
18327 prm%r =
config%getFloats(
'r_twin', requiredsize=
size(n_tw))
18329 prm%xc_twin =
config%getFloat(
'xc_twin')
18330 prm%L_tw =
config%getFloat(
'l0_twin')
18331 prm%i_tw =
config%getFloat(
'cmfptwin')
18333 prm%gamma_char= lattice_characteristicshear_twin(n_tw,
config%getString(
'lattice_structure'),&
18334 config%getFloat(
'c/a',defaultval=0.0_preal))
18336 prm%C66_tw = lattice_c66_twin(n_tw,prm%C66,
config%getString(
'lattice_structure'),&
18337 config%getFloat(
'c/a',defaultval=0.0_preal))
18339 if (.not. prm%fccTwinTransNucleation)
then
18340 prm%dot_N_0_tw =
config%getFloats(
'ndot0_twin')
18341 prm%dot_N_0_tw = math_expand(prm%dot_N_0_tw,n_tw)
18345 prm%b_tw = math_expand(prm%b_tw,n_tw)
18346 prm%t_tw = math_expand(prm%t_tw,n_tw)
18347 prm%r = math_expand(prm%r,n_tw)
18350 if ( prm%xc_twin < 0.0_preal) extmsg = trim(extmsg)//
' xc_twin'
18351 if ( prm%L_tw < 0.0_preal) extmsg = trim(extmsg)//
' L_tw'
18352 if ( prm%i_tw < 0.0_preal) extmsg = trim(extmsg)//
' i_tw'
18353 if (any(prm%b_tw < 0.0_preal)) extmsg = trim(extmsg)//
' b_tw'
18354 if (any(prm%t_tw < 0.0_preal)) extmsg = trim(extmsg)//
' t_tw'
18355 if (any(prm%r < 0.0_preal)) extmsg = trim(extmsg)//
' r'
18356 if (.not. prm%fccTwinTransNucleation)
then
18357 if (any(prm%dot_N_0_tw < 0.0_preal)) extmsg = trim(extmsg)//
' dot_N_0_tw'
18360 allocate(prm%gamma_char,prm%b_tw,prm%dot_N_0_tw,prm%t_tw,prm%r,source=emptyrealarray)
18361 allocate(prm%h_tw_tw(0,0))
18366 n_tr =
config%getInts(
'ntrans', defaultval=emptyintarray)
18367 prm%sum_N_tr = sum(abs(n_tr))
18368 transactive:
if (prm%sum_N_tr > 0)
then
18369 prm%b_tr =
config%getFloats(
'transburgers')
18370 prm%b_tr = math_expand(prm%b_tr,n_tr)
18372 prm%h =
config%getFloat(
'transstackheight', defaultval=0.0_preal)
18373 prm%i_tr =
config%getFloat(
'cmfptrans', defaultval=0.0_preal)
18374 prm%gamma_fcc_hex =
config%getFloat(
'deltag')
18375 prm%xc_trans =
config%getFloat(
'xc_trans', defaultval=0.0_preal)
18376 prm%L_tr =
config%getFloat(
'l0_trans')
18378 prm%h_tr_tr = lattice_interaction_transbytrans(n_tr,
config%getFloats(
'interaction_transtrans'), &
18379 config%getString(
'lattice_structure'))
18381 prm%C66_tr = lattice_c66_trans(n_tr,prm%C66,
config%getString(
'trans_lattice_structure'), &
18383 config%getFloat(
'a_bcc', defaultval=0.0_preal), &
18384 config%getFloat(
'a_fcc', defaultval=0.0_preal))
18386 prm%P_tr = lattice_schmidmatrix_trans(n_tr,
config%getString(
'trans_lattice_structure'), &
18388 config%getFloat(
'a_bcc', defaultval=0.0_preal), &
18389 config%getFloat(
'a_fcc', defaultval=0.0_preal))
18391 if (lattice_structure(p) /= lattice_fcc_id)
then
18392 prm%dot_N_0_tr =
config%getFloats(
'ndot0_trans')
18393 prm%dot_N_0_tr = math_expand(prm%dot_N_0_tr,n_tr)
18395 prm%t_tr =
config%getFloats(
'lamellarsize')
18396 prm%t_tr = math_expand(prm%t_tr,n_tr)
18397 prm%s =
config%getFloats(
's_trans',defaultval=[0.0_preal])
18398 prm%s = math_expand(prm%s,n_tr)
18401 if ( prm%xc_trans < 0.0_preal) extmsg = trim(extmsg)//
' xc_trans'
18402 if ( prm%L_tr < 0.0_preal) extmsg = trim(extmsg)//
' L_tr'
18403 if ( prm%i_tr < 0.0_preal) extmsg = trim(extmsg)//
' i_tr'
18404 if (any(prm%t_tr < 0.0_preal)) extmsg = trim(extmsg)//
' t_tr'
18405 if (any(prm%s < 0.0_preal)) extmsg = trim(extmsg)//
' s'
18406 if (lattice_structure(p) /= lattice_fcc_id)
then
18407 if (any(prm%dot_N_0_tr < 0.0_preal)) extmsg = trim(extmsg)//
' dot_N_0_tr'
18410 allocate(prm%s,prm%b_tr,prm%t_tr,prm%dot_N_0_tr,source=emptyrealarray)
18411 allocate(prm%h_tr_tr(0,0))
18416 prm%sbVelocity =
config%getFloat(
'shearbandvelocity',defaultval=0.0_preal)
18417 if (prm%sbVelocity > 0.0_preal)
then
18418 prm%sbResistance =
config%getFloat(
'shearbandresistance')
18419 prm%E_sb =
config%getFloat(
'qedgepersbsystem')
18420 prm%p_sb =
config%getFloat(
'p_shearband')
18421 prm%q_sb =
config%getFloat(
'q_shearband')
18424 if (prm%sbResistance < 0.0_preal) extmsg = trim(extmsg)//
' shearbandresistance'
18425 if (prm%E_sb < 0.0_preal) extmsg = trim(extmsg)//
' qedgepersbsystem'
18426 if (prm%p_sb <= 0.0_preal) extmsg = trim(extmsg)//
' p_shearband'
18427 if (prm%q_sb <= 0.0_preal) extmsg = trim(extmsg)//
' q_shearband'
18432 if(prm%sum_N_sl + prm%sum_N_tw + prm%sum_N_tw > 0) &
18433 prm%D =
config%getFloat(
'grainsize')
18435 twinorslipactive:
if (prm%sum_N_tw + prm%sum_N_tr > 0)
then
18436 prm%SFE_0K =
config%getFloat(
'sfe_0k')
18437 prm%dSFE_dT =
config%getFloat(
'dsfe_dt')
18438 prm%V_cs =
config%getFloat(
'vcrossslip')
18439 endif twinorslipactive
18441 slipandtwinactive:
if (prm%sum_N_sl * prm%sum_N_tw > 0)
then
18442 prm%h_sl_tw = lattice_interaction_slipbytwin(n_sl,n_tw,&
18443 config%getFloats(
'interaction_sliptwin'), &
18444 config%getString(
'lattice_structure'))
18445 if (prm%fccTwinTransNucleation .and.
size(n_tw) /= 1) extmsg = trim(extmsg)//
' interaction_sliptwin'
18446 endif slipandtwinactive
18448 slipandtransactive:
if (prm%sum_N_sl * prm%sum_N_tr > 0)
then
18449 prm%h_sl_tr = lattice_interaction_slipbytrans(n_sl,n_tr,&
18450 config%getFloats(
'interaction_sliptrans'), &
18451 config%getString(
'lattice_structure'))
18452 if (prm%fccTwinTransNucleation .and.
size(n_tr) /= 1) extmsg = trim(extmsg)//
' interaction_sliptrans'
18453 endif slipandtransactive
18457 nipcmyphase = count(material_phaseat == p) * discretization_nip
18458 sizedotstate =
size([
'rho_mob ',
'rho_dip ',
'gamma_sl']) * prm%sum_N_sl &
18459 +
size([
'f_tw']) * prm%sum_N_tw &
18460 +
size([
'f_tr']) * prm%sum_N_tr
18461 sizestate = sizedotstate
18463 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,0)
18468 endindex = prm%sum_N_sl
18469 stt%rho_mob=>plasticstate(p)%state(startindex:endindex,:)
18470 stt%rho_mob= spread(rho_mob_0,2,nipcmyphase)
18471 dot%rho_mob=>plasticstate(p)%dotState(startindex:endindex,:)
18472 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
18473 if (any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_rho'
18475 startindex = endindex + 1
18476 endindex = endindex + prm%sum_N_sl
18477 stt%rho_dip=>plasticstate(p)%state(startindex:endindex,:)
18478 stt%rho_dip= spread(rho_dip_0,2,nipcmyphase)
18479 dot%rho_dip=>plasticstate(p)%dotState(startindex:endindex,:)
18480 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
18482 startindex = endindex + 1
18483 endindex = endindex + prm%sum_N_sl
18484 stt%gamma_sl=>plasticstate(p)%state(startindex:endindex,:)
18485 dot%gamma_sl=>plasticstate(p)%dotState(startindex:endindex,:)
18486 plasticstate(p)%atol(startindex:endindex) = 1.0e-2_preal
18488 plasticstate(p)%slipRate => plasticstate(p)%dotState(startindex:endindex,:)
18490 startindex = endindex + 1
18491 endindex = endindex + prm%sum_N_tw
18492 stt%f_tw=>plasticstate(p)%state(startindex:endindex,:)
18493 dot%f_tw=>plasticstate(p)%dotState(startindex:endindex,:)
18494 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'f_twin',defaultval=1.0e-7_preal)
18495 if (any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' f_twin'
18497 startindex = endindex + 1
18498 endindex = endindex + prm%sum_N_tr
18499 stt%f_tr=>plasticstate(p)%state(startindex:endindex,:)
18500 dot%f_tr=>plasticstate(p)%dotState(startindex:endindex,:)
18501 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'f_trans',defaultval=1.0e-6_preal)
18502 if (any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' f_trans'
18504 allocate(dst%Lambda_sl (prm%sum_N_sl,nipcmyphase),source=0.0_preal)
18505 allocate(dst%tau_pass (prm%sum_N_sl,nipcmyphase),source=0.0_preal)
18507 allocate(dst%Lambda_tw (prm%sum_N_tw,nipcmyphase),source=0.0_preal)
18508 allocate(dst%tau_hat_tw (prm%sum_N_tw,nipcmyphase),source=0.0_preal)
18509 allocate(dst%tau_r_tw (prm%sum_N_tw,nipcmyphase),source=0.0_preal)
18510 allocate(dst%V_tw (prm%sum_N_tw,nipcmyphase),source=0.0_preal)
18512 allocate(dst%Lambda_tr (prm%sum_N_tr,nipcmyphase),source=0.0_preal)
18513 allocate(dst%tau_hat_tr (prm%sum_N_tr,nipcmyphase),source=0.0_preal)
18514 allocate(dst%tau_r_tr (prm%sum_N_tr,nipcmyphase),source=0.0_preal)
18515 allocate(dst%V_tr (prm%sum_N_tr,nipcmyphase),source=0.0_preal)
18517 plasticstate(p)%state0 = plasticstate(p)%state
18523 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_dislotwin_label//
')')
18527 end subroutine plastic_dislotwin_init
18533 module function plastic_dislotwin_homogenizedc(ipc,ip,el) result(homogenizedc)
18535 real(preal),
dimension(6,6) :: &
18537 integer,
intent(in) :: &
18538 ipc, & !< component-ID of integration point
18539 ip, & !< integration point
18544 real(preal) :: f_unrotated
18546 of = material_phasememberat(ipc,ip,el)
18547 associate(prm => param(phase_plasticityinstance(material_phaseat(ipc,el))),&
18548 stt => state(phase_plasticityinstance(material_phaseat(ipc,el))))
18550 f_unrotated = 1.0_preal &
18551 - sum(stt%f_tw(1:prm%sum_N_tw,of)) &
18552 - sum(stt%f_tr(1:prm%sum_N_tr,of))
18554 homogenizedc = f_unrotated * prm%C66
18555 do i=1,prm%sum_N_tw
18556 homogenizedc = homogenizedc &
18557 + stt%f_tw(i,of)*prm%C66_tw(1:6,1:6,i)
18559 do i=1,prm%sum_N_tr
18560 homogenizedc = homogenizedc &
18561 + stt%f_tr(i,of)*prm%C66_tr(1:6,1:6,i)
18566 end function plastic_dislotwin_homogenizedc
18572 module subroutine plastic_dislotwin_lpanditstangent(lp,dlp_dmp,mp,t,instance,of)
18574 real(preal),
dimension(3,3),
intent(out) :: lp
18575 real(preal),
dimension(3,3,3,3),
intent(out) :: dlp_dmp
18576 real(preal),
dimension(3,3),
intent(in) :: mp
18577 integer,
intent(in) :: instance,of
18578 real(preal),
intent(in) :: t
18580 integer :: i,k,l,m,n
18582 f_unrotated,stressratio_p,&
18586 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18587 dot_gamma_sl,ddot_gamma_dtau_slip
18588 real(preal),
dimension(param(instance)%sum_N_tw) :: &
18589 dot_gamma_twin,ddot_gamma_dtau_twin
18590 real(preal),
dimension(param(instance)%sum_N_tr) :: &
18591 dot_gamma_tr,ddot_gamma_dtau_trans
18592 real(preal):: dot_gamma_sb
18593 real(preal),
dimension(3,3) :: eigvectors, p_sb
18594 real(preal),
dimension(3) :: eigvalues
18595 real(preal),
dimension(3,6),
parameter :: &
18596 sb_scomposition = &
18604 ],preal),[ 3,6]), &
18605 sb_mcomposition = &
18615 associate(prm => param(instance), stt => state(instance))
18617 f_unrotated = 1.0_preal &
18618 - sum(stt%f_tw(1:prm%sum_N_tw,of)) &
18619 - sum(stt%f_tr(1:prm%sum_N_tr,of))
18622 dlp_dmp = 0.0_preal
18624 call kinetics_slip(mp,t,instance,of,dot_gamma_sl,ddot_gamma_dtau_slip)
18625 slipcontribution:
do i = 1, prm%sum_N_sl
18626 lp = lp + dot_gamma_sl(i)*prm%P_sl(1:3,1:3,i)
18627 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
18628 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
18629 + ddot_gamma_dtau_slip(i) * prm%P_sl(k,l,i) * prm%P_sl(m,n,i)
18630 enddo slipcontribution
18633 lp = lp * f_unrotated
18634 dlp_dmp = dlp_dmp * f_unrotated
18636 shearbandingcontribution:
if(dneq0(prm%sbVelocity))
then
18638 boltzmannratio = prm%E_sb/(kb*t)
18639 call math_eigh33(mp,eigvalues,eigvectors)
18642 p_sb = 0.5_preal * math_outer(matmul(eigvectors,sb_scomposition(1:3,i)),&
18643 matmul(eigvectors,sb_mcomposition(1:3,i)))
18644 tau = math_tensordot(mp,p_sb)
18646 significantshearbandstress:
if (abs(tau) > tol_math_check)
then
18647 stressratio_p = (abs(tau)/prm%sbResistance)**prm%p_sb
18648 dot_gamma_sb = sign(prm%sbVelocity*exp(-boltzmannratio*(1-stressratio_p)**prm%q_sb), tau)
18649 ddot_gamma_dtau = abs(dot_gamma_sb)*boltzmannratio* prm%p_sb*prm%q_sb/ prm%sbResistance &
18650 * (abs(tau)/prm%sbResistance)**(prm%p_sb-1.0_preal) &
18651 * (1.0_preal-stressratio_p)**(prm%q_sb-1.0_preal)
18653 lp = lp + dot_gamma_sb * p_sb
18654 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
18655 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
18656 + ddot_gamma_dtau * p_sb(k,l) * p_sb(m,n)
18657 endif significantshearbandstress
18660 endif shearbandingcontribution
18662 call kinetics_twin(mp,t,dot_gamma_sl,instance,of,dot_gamma_twin,ddot_gamma_dtau_twin)
18663 twincontibution:
do i = 1, prm%sum_N_tw
18664 lp = lp + dot_gamma_twin(i)*prm%P_tw(1:3,1:3,i) * f_unrotated
18665 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
18666 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
18667 + ddot_gamma_dtau_twin(i)* prm%P_tw(k,l,i)*prm%P_tw(m,n,i) * f_unrotated
18668 enddo twincontibution
18670 call kinetics_trans(mp,t,dot_gamma_sl,instance,of,dot_gamma_tr,ddot_gamma_dtau_trans)
18671 transcontibution:
do i = 1, prm%sum_N_tr
18672 lp = lp + dot_gamma_tr(i)*prm%P_tr(1:3,1:3,i) * f_unrotated
18673 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
18674 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
18675 + ddot_gamma_dtau_trans(i)* prm%P_tr(k,l,i)*prm%P_tr(m,n,i) * f_unrotated
18676 enddo transcontibution
18681 end subroutine plastic_dislotwin_lpanditstangent
18687 module subroutine plastic_dislotwin_dotstate(mp,t,instance,of)
18689 real(preal),
dimension(3,3),
intent(in):: &
18691 real(preal),
intent(in) :: &
18693 integer,
intent(in) :: &
18700 rho_dip_distance, &
18701 v_cl, & !< climb velocity
18702 gamma, & !< stacking fault energy
18704 sigma_cl, & !< climb stress
18706 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18707 dot_rho_dip_formation, &
18708 dot_rho_dip_climb, &
18709 rho_dip_distance_min, &
18711 real(preal),
dimension(param(instance)%sum_N_tw) :: &
18713 real(preal),
dimension(param(instance)%sum_N_tr) :: &
18716 associate(prm => param(instance), stt => state(instance), &
18717 dot => dotstate(instance), dst => dependentstate(instance))
18719 f_unrotated = 1.0_preal &
18720 - sum(stt%f_tw(1:prm%sum_N_tw,of)) &
18721 - sum(stt%f_tr(1:prm%sum_N_tr,of))
18724 dot%gamma_sl(:,of) = abs(dot_gamma_sl)
18726 rho_dip_distance_min = prm%CEdgeDipMinDistance*prm%b_sl
18728 slipstate:
do i = 1, prm%sum_N_sl
18729 tau = math_tensordot(mp,prm%P_sl(1:3,1:3,i))
18731 significantslipstress:
if (deq0(tau))
then
18732 dot_rho_dip_formation(i) = 0.0_preal
18733 dot_rho_dip_climb(i) = 0.0_preal
18734 else significantslipstress
18735 rho_dip_distance = 3.0_preal*prm%mu*prm%b_sl(i)/(16.0_preal*pi*abs(tau))
18736 rho_dip_distance = math_clip(rho_dip_distance, right = dst%Lambda_sl(i,of))
18737 rho_dip_distance = math_clip(rho_dip_distance, left = rho_dip_distance_min(i))
18739 if (prm%dipoleFormation)
then
18740 dot_rho_dip_formation(i) = 2.0_preal*(rho_dip_distance-rho_dip_distance_min(i))/prm%b_sl(i) &
18741 * stt%rho_mob(i,of)*abs(dot_gamma_sl(i))
18743 dot_rho_dip_formation(i) = 0.0_preal
18746 if (deq(rho_dip_distance,rho_dip_distance_min(i)))
then
18747 dot_rho_dip_climb(i) = 0.0_preal
18750 sigma_cl = dot_product(prm%n0_sl(1:3,i),matmul(mp,prm%n0_sl(1:3,i)))
18751 if (prm%ExtendedDislocations)
then
18752 gamma = prm%SFE_0K + prm%dSFE_dT * t
18753 b_d = 24.0_preal*pi*(1.0_preal - prm%nu)/(2.0_preal + prm%nu)* gamma/(prm%mu*prm%b_sl(i))
18757 v_cl = 2.0_preal*prm%omega*b_d**2.0_preal*exp(-prm%Qsd/(kb*t)) &
18758 * (exp(abs(sigma_cl)*prm%b_sl(i)**3.0_preal/(kb*t)) - 1.0_preal)
18760 dot_rho_dip_climb(i) = 4.0_preal*v_cl*stt%rho_dip(i,of) &
18761 / (rho_dip_distance-rho_dip_distance_min(i))
18763 endif significantslipstress
18766 dot%rho_mob(:,of) = abs(dot_gamma_sl)/(prm%b_sl*dst%Lambda_sl(:,of)) &
18767 - dot_rho_dip_formation &
18768 - 2.0_preal*rho_dip_distance_min/prm%b_sl * stt%rho_mob(:,of)*abs(dot_gamma_sl)
18770 dot%rho_dip(:,of) = dot_rho_dip_formation &
18771 - 2.0_preal*rho_dip_distance_min/prm%b_sl * stt%rho_dip(:,of)*abs(dot_gamma_sl) &
18772 - dot_rho_dip_climb
18774 call kinetics_twin(mp,t,dot_gamma_sl,instance,of,dot_gamma_twin)
18775 dot%f_tw(:,of) = f_unrotated*dot_gamma_twin/prm%gamma_char
18778 dot%f_tr(:,of) = f_unrotated*dot_gamma_tr
18782 end subroutine plastic_dislotwin_dotstate
18788 module subroutine plastic_dislotwin_dependentstate(t,instance,of)
18790 integer,
intent(in) :: &
18793 real(preal),
intent(in) :: &
18797 sumf_twin,gamma,sumf_trans
18798 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18799 inv_lambda_sl_sl, & !< 1/mean free distance between 2 forest dislocations seen by a moving dislocation
18800 inv_lambda_sl_tw, & !< 1/mean free distance between 2 twin stacks from different systems seen by a moving dislocation
18802 real(preal),
dimension(param(instance)%sum_N_tw) :: &
18803 inv_lambda_tw_tw, & !< 1/mean free distance between 2 twin stacks from different systems seen by a growing twin
18805 real(preal),
dimension(param(instance)%sum_N_tr) :: &
18806 inv_lambda_tr_tr, & !< 1/mean free distance between 2 martensite stacks from different systems seen by a growing martensite
18808 real(preal),
dimension(:),
allocatable :: &
18812 associate(prm => param(instance),&
18813 stt => state(instance),&
18814 dst => dependentstate(instance))
18816 sumf_twin = sum(stt%f_tw(1:prm%sum_N_tw,of))
18817 sumf_trans = sum(stt%f_tr(1:prm%sum_N_tr,of))
18819 gamma = prm%SFE_0K + prm%dSFE_dT * t
18822 f_over_t_tw = stt%f_tw(1:prm%sum_N_tw,of)/prm%t_tw
18823 f_over_t_tr = sumf_trans/prm%t_tr
18826 inv_lambda_sl_sl = sqrt(matmul(prm%forestProjection, &
18827 stt%rho_mob(:,of)+stt%rho_dip(:,of)))/prm%CLambdaSlip
18829 if (prm%sum_N_tw > 0 .and. prm%sum_N_sl > 0) &
18830 inv_lambda_sl_tw = matmul(prm%h_sl_tw,f_over_t_tw)/(1.0_preal-sumf_twin)
18832 inv_lambda_tw_tw = matmul(prm%h_tw_tw,f_over_t_tw)/(1.0_preal-sumf_twin)
18834 if (prm%sum_N_tr > 0 .and. prm%sum_N_sl > 0) &
18835 inv_lambda_sl_tr = matmul(prm%h_sl_tr,f_over_t_tr)/(1.0_preal-sumf_trans)
18837 inv_lambda_tr_tr = matmul(prm%h_tr_tr,f_over_t_tr)/(1.0_preal-sumf_trans)
18839 if ((prm%sum_N_tw > 0) .or. (prm%sum_N_tr > 0))
then
18840 dst%Lambda_sl(:,of) = prm%D &
18841 / (1.0_preal+prm%D*(inv_lambda_sl_sl + inv_lambda_sl_tw + inv_lambda_sl_tr))
18843 dst%Lambda_sl(:,of) = prm%D &
18844 / (1.0_preal+prm%D*inv_lambda_sl_sl)
18847 dst%Lambda_tw(:,of) = prm%i_tw*prm%D/(1.0_preal+prm%D*inv_lambda_tw_tw)
18848 dst%Lambda_tr(:,of) = prm%i_tr*prm%D/(1.0_preal+prm%D*inv_lambda_tr_tr)
18851 dst%tau_pass(:,of) = prm%mu*prm%b_sl* sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
18854 if(prm%sum_N_tw == prm%sum_N_sl) &
18855 dst%tau_hat_tw(:,of) = gamma/(3.0_preal*prm%b_tw) &
18856 + 3.0_preal*prm%b_tw*prm%mu/(prm%L_tw*prm%b_sl)
18857 if(prm%sum_N_tr == prm%sum_N_sl) &
18858 dst%tau_hat_tr(:,of) = gamma/(3.0_preal*prm%b_tr) &
18859 + 3.0_preal*prm%b_tr*prm%mu/(prm%L_tr*prm%b_sl) &
18860 + prm%h*prm%gamma_fcc_hex/ (3.0_preal*prm%b_tr)
18862 dst%V_tw(:,of) = (pi/4.0_preal)*prm%t_tw*dst%Lambda_tw(:,of)**2.0_preal
18863 dst%V_tr(:,of) = (pi/4.0_preal)*prm%t_tr*dst%Lambda_tr(:,of)**2.0_preal
18866 x0 = prm%mu*prm%b_tw**2.0_preal/(gamma*8.0_preal*pi)*(2.0_preal+prm%nu)/(1.0_preal-prm%nu)
18867 dst%tau_r_tw(:,of) = prm%mu*prm%b_tw/(2.0_preal*pi)*(1.0_preal/(x0+prm%xc_twin)+cos(pi/3.0_preal)/x0)
18869 x0 = prm%mu*prm%b_tr**2.0_preal/(gamma*8.0_preal*pi)*(2.0_preal+prm%nu)/(1.0_preal-prm%nu)
18870 dst%tau_r_tr(:,of) = prm%mu*prm%b_tr/(2.0_preal*pi)*(1.0_preal/(x0+prm%xc_trans)+cos(pi/3.0_preal)/x0)
18874 end subroutine plastic_dislotwin_dependentstate
18880 module subroutine plastic_dislotwin_results(instance,group)
18882 integer,
intent(in) :: instance
18883 character(len=*),
intent(in) :: group
18887 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
18888 outputsloop:
do o = 1,
size(prm%output)
18889 select case(trim(prm%output(o)))
18892 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_mob,
'rho_mob',&
18893 'mobile dislocation density',
'1/m²')
18895 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_dip,
'rho_dip',&
18896 'dislocation dipole density''1/m²')
18898 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma_sl,
'gamma_sl',&
18899 'plastic shear',
'1')
18901 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%Lambda_sl,
'Lambda_sl',&
18902 'mean free path for slip',
'm')
18904 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%tau_pass,
'tau_pass',&
18905 'passing stress for slip',
'Pa')
18908 if(prm%sum_N_tw>0)
call results_writedataset(group,stt%f_tw,
'f_tw',&
18909 'twinned volume fraction',
'm³/m³')
18911 if(prm%sum_N_tw>0)
call results_writedataset(group,dst%Lambda_tw,
'Lambda_tw',&
18912 'mean free path for twinning',
'm')
18914 if(prm%sum_N_tw>0)
call results_writedataset(group,dst%tau_hat_tw,
'tau_hat_tw',&
18915 'threshold stress for twinning',
'Pa')
18918 if(prm%sum_N_tr>0)
call results_writedataset(group,stt%f_tr,
'f_tr',&
18919 'martensite volume fraction',
'm³/m³')
18925 end subroutine plastic_dislotwin_results
18936 dot_gamma_sl,ddot_gamma_dtau_slip,tau_slip)
18938 real(preal),
dimension(3,3),
intent(in) :: &
18940 real(preal),
intent(in) :: &
18942 integer,
intent(in) :: &
18946 real(preal),
dimension(param(instance)%sum_N_sl),
intent(out) :: &
18948 real(preal),
dimension(param(instance)%sum_N_sl),
optional,
intent(out) :: &
18949 ddot_gamma_dtau_slip, &
18951 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18954 real(preal),
dimension(param(instance)%sum_N_sl) :: &
18959 v_wait_inverse, & !< inverse of the effective velocity of a dislocation waiting at obstacles (unsigned)
18960 v_run_inverse, & !< inverse of the velocity of a free moving dislocation (unsigned)
18961 dv_wait_inverse_dtau, &
18962 dv_run_inverse_dtau, &
18967 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
18969 do i = 1, prm%sum_N_sl
18970 tau(i) = math_tensordot(mp,prm%P_sl(1:3,1:3,i))
18973 tau_eff = abs(tau)-dst%tau_pass(:,of)
18975 significantstress:
where(tau_eff > tol_math_check)
18976 stressratio = tau_eff/prm%tau_0
18977 stressratio_p = stressratio** prm%p
18978 boltzmannratio = prm%Delta_F/(kb*t)
18979 v_wait_inverse = prm%v0**(-1.0_preal) * exp(boltzmannratio*(1.0_preal-stressratio_p)** prm%q)
18980 v_run_inverse = prm%B/(tau_eff*prm%b_sl)
18982 dot_gamma_sl = sign(stt%rho_mob(:,of)*prm%b_sl/(v_wait_inverse+v_run_inverse),tau)
18984 dv_wait_inverse_dtau = -1.0_preal * v_wait_inverse * prm%p * prm%q * boltzmannratio &
18985 * (stressratio**(prm%p-1.0_preal)) &
18986 * (1.0_preal-stressratio_p)**(prm%q-1.0_preal) &
18988 dv_run_inverse_dtau = -1.0_preal * v_run_inverse/tau_eff
18989 dv_dtau = -1.0_preal * (dv_wait_inverse_dtau+dv_run_inverse_dtau) &
18990 / (v_wait_inverse+v_run_inverse)**2.0_preal
18991 ddot_gamma_dtau = dv_dtau*stt%rho_mob(:,of)*prm%b_sl
18992 else where significantstress
18993 dot_gamma_sl = 0.0_preal
18994 ddot_gamma_dtau = 0.0_preal
18995 end where significantstress
18999 if(
present(ddot_gamma_dtau_slip)) ddot_gamma_dtau_slip = ddot_gamma_dtau
19000 if(
present(tau_slip)) tau_slip = tau
19012 pure subroutine kinetics_twin(Mp,T,dot_gamma_sl,instance,of,&
19013 dot_gamma_twin,ddot_gamma_dtau_twin)
19015 real(preal),
dimension(3,3),
intent(in) :: &
19017 real(preal),
intent(in) :: &
19019 integer,
intent(in) :: &
19022 real(preal),
dimension(param(instance)%sum_N_sl),
intent(in) :: &
19025 real(preal),
dimension(param(instance)%sum_N_tw),
intent(out) :: &
19027 real(preal),
dimension(param(instance)%sum_N_tw),
optional,
intent(out) :: &
19028 ddot_gamma_dtau_twin
19030 real,
dimension(param(instance)%sum_N_tw) :: &
19038 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
19040 do i = 1, prm%sum_N_tw
19041 tau(i) = math_tensordot(mp,prm%P_tw(1:3,1:3,i))
19042 isfcc:
if (prm%fccTwinTransNucleation)
then
19043 s1=prm%fcc_twinNucleationSlipPair(1,i)
19044 s2=prm%fcc_twinNucleationSlipPair(2,i)
19045 if (tau(i) < dst%tau_r_tw(i,of))
then
19046 ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+&
19047 abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/&
19048 (prm%L_tw*prm%b_sl(i))*&
19049 (1.0_preal-exp(-prm%V_cs/(kb*t)*(dst%tau_r_tw(i,of)-tau(i))))
19054 ndot0=prm%dot_N_0_tw(i)
19058 significantstress:
where(tau > tol_math_check)
19059 stressratio_r = (dst%tau_hat_tw(:,of)/tau)**prm%r
19060 dot_gamma_twin = prm%gamma_char * dst%V_tw(:,of) * ndot0*exp(-stressratio_r)
19061 ddot_gamma_dtau = (dot_gamma_twin*prm%r/tau)*stressratio_r
19062 else where significantstress
19063 dot_gamma_twin = 0.0_preal
19064 ddot_gamma_dtau = 0.0_preal
19065 end where significantstress
19069 if(
present(ddot_gamma_dtau_twin)) ddot_gamma_dtau_twin = ddot_gamma_dtau
19082 dot_gamma_tr,ddot_gamma_dtau_trans)
19084 real(preal),
dimension(3,3),
intent(in) :: &
19086 real(preal),
intent(in) :: &
19088 integer,
intent(in) :: &
19091 real(preal),
dimension(param(instance)%sum_N_sl),
intent(in) :: &
19094 real(preal),
dimension(param(instance)%sum_N_tr),
intent(out) :: &
19096 real(preal),
dimension(param(instance)%sum_N_tr),
optional,
intent(out) :: &
19097 ddot_gamma_dtau_trans
19099 real,
dimension(param(instance)%sum_N_tr) :: &
19106 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
19108 do i = 1, prm%sum_N_tr
19109 tau(i) = math_tensordot(mp,prm%P_tr(1:3,1:3,i))
19110 isfcc:
if (prm%fccTwinTransNucleation)
then
19111 s1=prm%fcc_twinNucleationSlipPair(1,i)
19112 s2=prm%fcc_twinNucleationSlipPair(2,i)
19113 if (tau(i) < dst%tau_r_tr(i,of))
then
19114 ndot0=(abs(dot_gamma_sl(s1))*(stt%rho_mob(s2,of)+stt%rho_dip(s2,of))+&
19115 abs(dot_gamma_sl(s2))*(stt%rho_mob(s1,of)+stt%rho_dip(s1,of)))/&
19116 (prm%L_tr*prm%b_sl(i))*&
19117 (1.0_preal-exp(-prm%V_cs/(kb*t)*(dst%tau_r_tr(i,of)-tau(i))))
19122 ndot0=prm%dot_N_0_tr(i)
19126 significantstress:
where(tau > tol_math_check)
19127 stressratio_s = (dst%tau_hat_tr(:,of)/tau)**prm%s
19128 dot_gamma_tr = dst%V_tr(:,of) * ndot0*exp(-stressratio_s)
19129 ddot_gamma_dtau = (dot_gamma_tr*prm%s/tau)*stressratio_s
19130 else where significantstress
19131 dot_gamma_tr = 0.0_preal
19132 ddot_gamma_dtau = 0.0_preal
19133 end where significantstress
19137 if(
present(ddot_gamma_dtau_trans)) ddot_gamma_dtau_trans = ddot_gamma_dtau
19141 end submodule plastic_dislotwin
19142 # 42 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
19144 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_disloUCLA.f90" 1
19154 real(preal),
parameter :: &
19155 kb = 1.38e-23_preal
19157 type :: tparameters
19163 real(preal),
allocatable,
dimension(:) :: &
19164 b_sl, & !< magnitude of burgers vector [m]
19166 i_sl, & !< Adj. parameter for distance between 2 forest dislocations
19178 real(preal),
allocatable,
dimension(:,:) :: &
19179 h_sl_sl, & !< slip resistance from slip activity
19181 real(preal),
allocatable,
dimension(:,:,:) :: &
19187 character(len=pStringLen),
allocatable,
dimension(:) :: &
19193 type :: tdislouclastate
19194 real(preal),
dimension(:,:),
pointer :: &
19198 end type tdislouclastate
19200 type :: tdisloucladependentstate
19201 real(preal),
dimension(:,:),
allocatable :: &
19204 end type tdisloucladependentstate
19208 type(tparameters),
allocatable,
dimension(:) :: param
19209 type(tdislouclastate),
allocatable,
dimension(:) :: &
19212 type(tdisloucladependentstate),
allocatable,
dimension(:) :: dependentstate
19221 module subroutine plastic_disloucla_init
19227 sizestate, sizedotstate, &
19228 startindex, endindex
19229 integer,
dimension(:),
allocatable :: &
19231 real(preal),
dimension(:),
allocatable :: &
19232 rho_mob_0, & !< initial dislocation density
19233 rho_dip_0, & !< initial dipole density
19235 character(len=pStringLen) :: &
19238 write(6,
'(/,a)')
' <<<+- plastic_'//plasticity_disloucla_label//
' init -+>>>';
flush(6)
19240 write(6,
'(/,a)')
' Cereceda et al., International Journal of Plasticity 78:242–256, 2016'
19241 write(6,
'(a)')
' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
19243 ninstance = count(phase_plasticity == plasticity_disloucla_id)
19244 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
19245 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
19247 allocate(param(ninstance))
19248 allocate(state(ninstance))
19249 allocate(dotstate(ninstance))
19250 allocate(dependentstate(ninstance))
19252 do p = 1,
size(phase_plasticity)
19253 if (phase_plasticity(p) /= plasticity_disloucla_id) cycle
19254 associate(prm => param(phase_plasticityinstance(p)), &
19255 dot => dotstate(phase_plasticityinstance(p)), &
19256 stt => state(phase_plasticityinstance(p)), &
19257 dst => dependentstate(phase_plasticityinstance(p)), &
19258 config => config_phase(p))
19260 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
19263 prm%mu = lattice_mu(p)
19267 n_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
19268 prm%sum_N_sl = sum(abs(n_sl))
19269 slipactive:
if (prm%sum_N_sl > 0)
then
19270 prm%P_sl = lattice_schmidmatrix_slip(n_sl,
config%getString(
'lattice_structure'),&
19271 config%getFloat(
'c/a',defaultval=0.0_preal))
19273 if(trim(
config%getString(
'lattice_structure')) ==
'bcc')
then
19274 a =
config%getFloats(
'nonschmid_coefficients',defaultval = emptyrealarray)
19275 prm%nonSchmid_pos = lattice_nonschmidmatrix(n_sl,a,+1)
19276 prm%nonSchmid_neg = lattice_nonschmidmatrix(n_sl,a,-1)
19278 prm%nonSchmid_pos = prm%P_sl
19279 prm%nonSchmid_neg = prm%P_sl
19282 prm%h_sl_sl = lattice_interaction_slipbyslip(n_sl,
config%getFloats(
'interaction_slipslip'), &
19283 config%getString(
'lattice_structure'))
19284 prm%forestProjection = lattice_forestprojection_edge(n_sl,
config%getString(
'lattice_structure'),&
19285 config%getFloat(
'c/a',defaultval=0.0_preal))
19286 prm%forestProjection = transpose(prm%forestProjection)
19288 rho_mob_0 =
config%getFloats(
'rhoedge0', requiredsize=
size(n_sl))
19289 rho_dip_0 =
config%getFloats(
'rhoedgedip0', requiredsize=
size(n_sl))
19290 prm%v0 =
config%getFloats(
'v0', requiredsize=
size(n_sl))
19291 prm%b_sl =
config%getFloats(
'slipburgers', requiredsize=
size(n_sl))
19292 prm%delta_F =
config%getFloats(
'qedge', requiredsize=
size(n_sl))
19294 prm%i_sl =
config%getFloats(
'clambdaslip', requiredsize=
size(n_sl))
19295 prm%tau_0 =
config%getFloats(
'tau_peierls', requiredsize=
size(n_sl))
19296 prm%p =
config%getFloats(
'p_slip', requiredsize=
size(n_sl), &
19297 defaultval=[(1.0_preal,i=1,
size(n_sl))])
19298 prm%q =
config%getFloats(
'q_slip', requiredsize=
size(n_sl), &
19299 defaultval=[(1.0_preal,i=1,
size(n_sl))])
19300 prm%kink_height =
config%getFloats(
'kink_height', requiredsize=
size(n_sl))
19301 prm%w =
config%getFloats(
'kink_width', requiredsize=
size(n_sl))
19302 prm%omega =
config%getFloats(
'omega', requiredsize=
size(n_sl))
19303 prm%B =
config%getFloats(
'friction_coeff', requiredsize=
size(n_sl))
19305 prm%D =
config%getFloat(
'grainsize')
19306 prm%D_0 =
config%getFloat(
'd0')
19307 prm%Q_cl =
config%getFloat(
'qsd')
19308 prm%atomicVolume =
config%getFloat(
'catomicvolume') * prm%b_sl**3.0_preal
19309 prm%D_a =
config%getFloat(
'cedgedipmindistance') * prm%b_sl
19310 prm%dipoleformation =
config%getFloat(
'dipoleformationfactor') > 0.0_preal
19313 rho_mob_0 = math_expand(rho_mob_0, n_sl)
19314 rho_dip_0 = math_expand(rho_dip_0, n_sl)
19315 prm%q = math_expand(prm%q, n_sl)
19316 prm%p = math_expand(prm%p, n_sl)
19317 prm%delta_F = math_expand(prm%delta_F, n_sl)
19318 prm%b_sl = math_expand(prm%b_sl, n_sl)
19319 prm%kink_height = math_expand(prm%kink_height, n_sl)
19320 prm%w = math_expand(prm%w, n_sl)
19321 prm%omega = math_expand(prm%omega, n_sl)
19322 prm%tau_0 = math_expand(prm%tau_0, n_sl)
19323 prm%v0 = math_expand(prm%v0, n_sl)
19324 prm%B = math_expand(prm%B, n_sl)
19325 prm%i_sl = math_expand(prm%i_sl, n_sl)
19326 prm%atomicVolume = math_expand(prm%atomicVolume, n_sl)
19327 prm%D_a = math_expand(prm%D_a, n_sl)
19330 if ( prm%D_0 <= 0.0_preal) extmsg = trim(extmsg)//
' D_0'
19331 if ( prm%Q_cl <= 0.0_preal) extmsg = trim(extmsg)//
' Q_cl'
19332 if (any(rho_mob_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoedge0'
19333 if (any(rho_dip_0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoedgedip0'
19334 if (any(prm%v0 < 0.0_preal)) extmsg = trim(extmsg)//
' v0'
19335 if (any(prm%b_sl <= 0.0_preal)) extmsg = trim(extmsg)//
' b_sl'
19336 if (any(prm%delta_F <= 0.0_preal)) extmsg = trim(extmsg)//
' qedge'
19337 if (any(prm%tau_0 < 0.0_preal)) extmsg = trim(extmsg)//
' tau_0'
19338 if (any(prm%D_a <= 0.0_preal)) extmsg = trim(extmsg)//
' cedgedipmindistance or b_sl'
19339 if (any(prm%atomicVolume <= 0.0_preal)) extmsg = trim(extmsg)//
' catomicvolume or b_sl'
19342 rho_mob_0= emptyrealarray; rho_dip_0 = emptyrealarray
19343 allocate(prm%b_sl,prm%D_a,prm%i_sl,prm%atomicVolume,prm%tau_0, &
19344 prm%delta_F,prm%v0,prm%p,prm%q,prm%B,prm%kink_height,prm%w,prm%omega, &
19345 source = emptyrealarray)
19346 allocate(prm%forestProjection(0,0))
19347 allocate(prm%h_sl_sl (0,0))
19352 nipcmyphase = count(material_phaseat == p) * discretization_nip
19353 sizedotstate =
size([
'rho_mob ',
'rho_dip ',
'gamma_sl']) * prm%sum_N_sl
19354 sizestate = sizedotstate
19356 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,0)
19361 endindex = prm%sum_N_sl
19362 stt%rho_mob => plasticstate(p)%state(startindex:endindex,:)
19363 stt%rho_mob = spread(rho_mob_0,2,nipcmyphase)
19364 dot%rho_mob => plasticstate(p)%dotState(startindex:endindex,:)
19365 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
19366 if (any(plasticstate(p)%atol(startindex:endindex) < 0.0_preal)) extmsg = trim(extmsg)//
' atol_rho'
19368 startindex = endindex + 1
19369 endindex = endindex + prm%sum_N_sl
19370 stt%rho_dip => plasticstate(p)%state(startindex:endindex,:)
19371 stt%rho_dip = spread(rho_dip_0,2,nipcmyphase)
19372 dot%rho_dip => plasticstate(p)%dotState(startindex:endindex,:)
19373 plasticstate(p)%atol(startindex:endindex) =
config%getFloat(
'atol_rho',defaultval=1.0_preal)
19375 startindex = endindex + 1
19376 endindex = endindex + prm%sum_N_sl
19377 stt%gamma_sl => plasticstate(p)%state(startindex:endindex,:)
19378 dot%gamma_sl => plasticstate(p)%dotState(startindex:endindex,:)
19379 plasticstate(p)%atol(startindex:endindex) = 1.0e-2_preal
19381 plasticstate(p)%slipRate => plasticstate(p)%dotState(startindex:endindex,:)
19383 allocate(dst%Lambda_sl(prm%sum_N_sl,nipcmyphase), source=0.0_preal)
19384 allocate(dst%threshold_stress(prm%sum_N_sl,nipcmyphase), source=0.0_preal)
19386 plasticstate(p)%state0 = plasticstate(p)%state
19392 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_disloucla_label//
')')
19396 end subroutine plastic_disloucla_init
19402 pure module subroutine plastic_disloucla_lpanditstangent(lp,dlp_dmp, &
19404 real(preal),
dimension(3,3),
intent(out) :: &
19406 real(preal),
dimension(3,3,3,3),
intent(out) :: &
19409 real(preal),
dimension(3,3),
intent(in) :: &
19411 real(preal),
intent(in) :: &
19413 integer,
intent(in) :: &
19419 real(preal),
dimension(param(instance)%sum_N_sl) :: &
19420 dot_gamma_pos,dot_gamma_neg, &
19421 ddot_gamma_dtau_pos,ddot_gamma_dtau_neg
19424 dlp_dmp = 0.0_preal
19426 associate(prm => param(instance))
19428 call kinetics(mp,t,instance,of,dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg)
19429 do i = 1, prm%sum_N_sl
19430 lp = lp + (dot_gamma_pos(i)+dot_gamma_neg(i))*prm%P_sl(1:3,1:3,i)
19431 forall (k=1:3,l=1:3,m=1:3,n=1:3) &
19432 dlp_dmp(k,l,m,n) = dlp_dmp(k,l,m,n) &
19433 + ddot_gamma_dtau_pos(i) * prm%P_sl(k,l,i) * prm%nonSchmid_pos(m,n,i) &
19434 + ddot_gamma_dtau_neg(i) * prm%P_sl(k,l,i) * prm%nonSchmid_neg(m,n,i)
19439 end subroutine plastic_disloucla_lpanditstangent
19445 module subroutine plastic_disloucla_dotstate(mp,t,instance,of)
19447 real(preal),
dimension(3,3),
intent(in) :: &
19449 real(preal),
intent(in) :: &
19451 integer,
intent(in) :: &
19457 real(preal),
dimension(param(instance)%sum_N_sl) :: &
19458 gdot_pos, gdot_neg,&
19462 dot_rho_dip_formation, &
19463 dot_rho_dip_climb, &
19466 associate(prm => param(instance), stt => state(instance),dot => dotstate(instance), dst => dependentstate(instance))
19469 gdot_pos,gdot_neg, &
19470 tau_pos_out = tau_pos,tau_neg_out = tau_neg)
19472 dot%gamma_sl(:,of) = (gdot_pos+gdot_neg)
19473 vacancydiffusion = prm%D_0*exp(-prm%Q_cl/(kb*t))
19475 where(deq0(tau_pos))
19476 dot_rho_dip_formation = 0.0_preal
19477 dot_rho_dip_climb = 0.0_preal
19479 dip_distance = math_clip(3.0_preal*prm%mu*prm%b_sl/(16.0_preal*pi*abs(tau_pos)), &
19481 dst%Lambda_sl(:,of))
19482 dot_rho_dip_formation = merge(2.0_preal*dip_distance* stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))/prm%b_sl, &
19484 prm%dipoleformation)
19485 v_cl = (3.0_preal*prm%mu*vacancydiffusion*prm%atomicVolume/(2.0_preal*pi*kb*t)) &
19486 * (1.0_preal/(dip_distance+prm%D_a))
19487 dot_rho_dip_climb = (4.0_preal*v_cl*stt%rho_dip(:,of))/(dip_distance-prm%D_a)
19490 dot%rho_mob(:,of) = abs(dot%gamma_sl(:,of))/(prm%b_sl*dst%Lambda_sl(:,of)) &
19491 - dot_rho_dip_formation &
19492 - (2.0_preal*prm%D_a)/prm%b_sl*stt%rho_mob(:,of)*abs(dot%gamma_sl(:,of))
19493 dot%rho_dip(:,of) = dot_rho_dip_formation &
19494 - (2.0_preal*prm%D_a)/prm%b_sl*stt%rho_dip(:,of)*abs(dot%gamma_sl(:,of)) &
19495 - dot_rho_dip_climb
19499 end subroutine plastic_disloucla_dotstate
19505 module subroutine plastic_disloucla_dependentstate(instance,of)
19507 integer,
intent(in) :: &
19511 real(preal),
dimension(param(instance)%sum_N_sl) :: &
19514 associate(prm => param(instance), stt => state(instance),dst => dependentstate(instance))
19516 dislocationspacing = sqrt(matmul(prm%forestProjection,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
19517 dst%threshold_stress(:,of) = prm%mu*prm%b_sl &
19518 * sqrt(matmul(prm%h_sl_sl,stt%rho_mob(:,of)+stt%rho_dip(:,of)))
19520 dst%Lambda_sl(:,of) = prm%D/(1.0_preal+prm%D*dislocationspacing/prm%i_sl)
19524 end subroutine plastic_disloucla_dependentstate
19530 module subroutine plastic_disloucla_results(instance,group)
19532 integer,
intent(in) :: instance
19533 character(len=*),
intent(in) :: group
19537 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
19538 outputsloop:
do o = 1,
size(prm%output)
19539 select case(trim(prm%output(o)))
19540 case(
'edge_density')
19541 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_mob,
'rho_mob',&
19542 'mobile dislocation density',
'1/m²')
19543 case(
'dipole_density')
19544 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_dip,
'rho_dip',&
19545 'dislocation dipole density''1/m²')
19546 case(
'shear_rate_slip')
19547 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma_sl,
'dot_gamma_sl',&
19548 'plastic shear',
'1')
19550 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%Lambda_sl,
'Lambda_sl',&
19551 'mean free path for slip',
'm')
19552 case(
'threshold_stress_slip')
19553 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%threshold_stress,
'tau_pass',&
19554 'threshold stress for slip',
'Pa')
19559 end subroutine plastic_disloucla_results
19569 pure subroutine kinetics(Mp,T,instance,of, &
19570 dot_gamma_pos,dot_gamma_neg,ddot_gamma_dtau_pos,ddot_gamma_dtau_neg,tau_pos_out,tau_neg_out)
19572 real(preal),
dimension(3,3),
intent(in) :: &
19574 real(preal),
intent(in) :: &
19576 integer,
intent(in) :: &
19580 real(preal),
intent(out),
dimension(param(instance)%sum_N_sl) :: &
19583 real(preal),
intent(out),
optional,
dimension(param(instance)%sum_N_sl) :: &
19584 ddot_gamma_dtau_pos, &
19585 ddot_gamma_dtau_neg, &
19588 real(preal),
dimension(param(instance)%sum_N_sl) :: &
19590 stressratio_p,stressratio_pminus1, &
19593 t_n, t_k, dtk,dtn, &
19597 associate(prm => param(instance), stt => state(instance), dst => dependentstate(instance))
19599 do j = 1, prm%sum_N_sl
19600 tau_pos(j) = math_tensordot(mp,prm%nonSchmid_pos(1:3,1:3,j))
19601 tau_neg(j) = math_tensordot(mp,prm%nonSchmid_neg(1:3,1:3,j))
19605 if (
present(tau_pos_out)) tau_pos_out = tau_pos
19606 if (
present(tau_neg_out)) tau_neg_out = tau_neg
19608 associate(boltzmannratio => prm%delta_F/(kb*t), &
19609 dot_gamma_0 => stt%rho_mob(:,of)*prm%b_sl*prm%v0, &
19610 effectivelength => dst%Lambda_sl(:,of) - prm%w)
19612 significantpositivetau:
where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
19613 stressratio = (abs(tau_pos)-dst%threshold_stress(:,of))/prm%tau_0
19614 stressratio_p = stressratio** prm%p
19615 stressratio_pminus1 = stressratio**(prm%p-1.0_preal)
19616 needsgoodname = exp(-boltzmannratio*(1-stressratio_p) ** prm%q)
19618 t_n = prm%b_sl/(needsgoodname*prm%omega*effectivelength)
19619 t_k = effectivelength * prm%B /(2.0_preal*prm%b_sl*tau_pos)
19621 vel = prm%kink_height/(t_n + t_k)
19623 dot_gamma_pos = dot_gamma_0 * sign(vel,tau_pos) * 0.5_preal
19624 else where significantpositivetau
19625 dot_gamma_pos = 0.0_preal
19626 end where significantpositivetau
19628 if (
present(ddot_gamma_dtau_pos))
then
19629 significantpositivetau2:
where(abs(tau_pos)-dst%threshold_stress(:,of) > tol_math_check)
19630 dtn = -1.0_preal * t_n * boltzmannratio * prm%p * prm%q * (1.0_preal-stressratio_p)**(prm%q - 1.0_preal) &
19631 * (stressratio)**(prm%p - 1.0_preal) / prm%tau_0
19632 dtk = -1.0_preal * t_k / tau_pos
19634 dvel = -1.0_preal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_preal
19636 ddot_gamma_dtau_pos = dot_gamma_0 * dvel* 0.5_preal
19637 else where significantpositivetau2
19638 ddot_gamma_dtau_pos = 0.0_preal
19639 end where significantpositivetau2
19642 significantnegativetau:
where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
19643 stressratio = (abs(tau_neg)-dst%threshold_stress(:,of))/prm%tau_0
19644 stressratio_p = stressratio** prm%p
19645 stressratio_pminus1 = stressratio**(prm%p-1.0_preal)
19646 needsgoodname = exp(-boltzmannratio*(1-stressratio_p) ** prm%q)
19648 t_n = prm%b_sl/(needsgoodname*prm%omega*effectivelength)
19649 t_k = effectivelength * prm%B /(2.0_preal*prm%b_sl*tau_pos)
19651 vel = prm%kink_height/(t_n + t_k)
19653 dot_gamma_neg = dot_gamma_0 * sign(vel,tau_neg) * 0.5_preal
19654 else where significantnegativetau
19655 dot_gamma_neg = 0.0_preal
19656 end where significantnegativetau
19658 if (
present(ddot_gamma_dtau_neg))
then
19659 significantnegativetau2:
where(abs(tau_neg)-dst%threshold_stress(:,of) > tol_math_check)
19660 dtn = -1.0_preal * t_n * boltzmannratio * prm%p * prm%q * (1.0_preal-stressratio_p)**(prm%q - 1.0_preal) &
19661 * (stressratio)**(prm%p - 1.0_preal) / prm%tau_0
19662 dtk = -1.0_preal * t_k / tau_neg
19664 dvel = -1.0_preal * prm%kink_height * (dtk + dtn) / (t_n + t_k)**2.0_preal
19666 ddot_gamma_dtau_neg = dot_gamma_0 * dvel * 0.5_preal
19667 else where significantnegativetau2
19668 ddot_gamma_dtau_neg = 0.0_preal
19669 end where significantnegativetau2
19677 end submodule plastic_disloucla
19678 # 43 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
19680 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90" 1
19695 real(preal),
parameter :: &
19696 kb = 1.38e-23_preal
19699 integer,
dimension(8),
parameter :: &
19700 sgl = [1,2,3,4,5,6,7,8]
19701 integer,
dimension(5),
parameter :: &
19702 edg = [1,2,5,6,9], & !< edge
19704 integer,
dimension(4),
parameter :: &
19705 mob = [1,2,3,4], & !< mobile
19707 integer,
dimension(2),
parameter :: &
19708 dip = [9,10], & !< dipole
19709 imm_edg = imm(1:2), &
19711 integer,
parameter :: &
19712 mob_edg_pos = 1, & !< mobile edge positive
19718 integer,
dimension(:,:,:),
allocatable :: &
19719 irhou, & !< state indices for unblocked density
19720 iv, & !< state indices for dislcation velocities
19724 real(preal),
dimension(:,:,:,:,:,:),
allocatable :: &
19727 type :: tinitialparameters
19729 rhosglscatter, & !< standard deviation of scatter in initial dislocation density
19731 rhosglrandombinning
19732 real(preal),
dimension(:),
allocatable :: &
19733 rhosgledgepos0, & !< initial edge_pos dislocation density
19734 rhosgledgeneg0, & !< initial edge_neg dislocation density
19735 rhosglscrewpos0, & !< initial screw_pos dislocation density
19736 rhosglscrewneg0, & !< initial screw_neg dislocation density
19737 rhodipedge0, & !< initial edge dipole dislocation density
19739 integer,
dimension(:) ,
allocatable :: &
19741 end type tinitialparameters
19743 type :: tparameters
19745 atomicvolume, & !< atomic volume
19746 dsd0, & !< prefactor for self-diffusion coefficient
19747 selfdiffusionenergy, & !< activation enthalpy for diffusion
19748 atol_rho, & !< absolute tolerance for dislocation density in state integration
19749 significantrho, & !< density considered significant
19750 significantn, & !< number of dislocations considered significant
19751 doublekinkwidth, & !< width of a doubkle kink in multiples of the burgers vector length b
19752 solidsolutionenergy, & !< activation energy for solid solution in J
19753 solidsolutionsize, & !< solid solution obstacle size in multiples of the burgers vector length
19754 solidsolutionconcentration, & !< concentration of solid solution in atomic parts
19755 p, & !< parameter for kinetic law (Kocks,Argon,Ashby)
19756 q, & !< parameter for kinetic law (Kocks,Argon,Ashby)
19757 viscosity, & !< viscosity for dislocation glide in Pa s
19758 fattack, & !< attack frequency in Hz
19759 surfacetransmissivity, & !< transmissivity at free surface
19760 grainboundarytransmissivity, & !< transmissivity at grain boundary (identified by different texture)
19761 cflfactor, & !< safety factor for CFL flux condition
19762 fedgemultiplication, & !< factor that determines how much edge dislocations contribute to multiplication (0...1)
19763 linetensioneffect, &
19767 real(preal),
dimension(:),
allocatable :: &
19768 mindipoleheight_edge, & !< minimum stable edge dipole height
19769 mindipoleheight_screw, & !< minimum stable screw dipole height
19770 peierlsstress_edge, &
19771 peierlsstress_screw, &
19772 lambda0, & !< mean free path prefactor for each
19774 real(preal),
dimension(:,:),
allocatable :: &
19780 interactionslipslip ,& !< coefficients for slip-slip interaction
19781 forestprojection_edge, & !< matrix of forest projections of edge dislocations
19782 forestprojection_screw
19783 real(preal),
dimension(:,:,:),
allocatable :: &
19784 schmid, & !< Schmid contribution
19789 integer,
dimension(:),
allocatable :: &
19791 character(len=pStringLen),
dimension(:),
allocatable :: &
19794 shortrangestresscorrection, & !< use of short range stress correction by excess density gradient term
19795 nonschmidactive = .false.
19796 end type tparameters
19798 type :: tnonlocalmicrostructure
19799 real(preal),
allocatable,
dimension(:,:) :: &
19802 end type tnonlocalmicrostructure
19804 type :: tnonlocalstate
19805 real(preal),
pointer,
dimension(:,:) :: &
19809 rho_sgl_mob_edg_pos, &
19810 rho_sgl_mob_edg_neg, &
19811 rho_sgl_mob_scr_pos, &
19812 rho_sgl_mob_scr_neg, &
19814 rho_sgl_imm_edg_pos, &
19815 rho_sgl_imm_edg_neg, &
19816 rho_sgl_imm_scr_pos, &
19817 rho_sgl_imm_scr_neg, &
19828 end type tnonlocalstate
19830 type(tnonlocalstate),
allocatable,
dimension(:) :: &
19836 type(tparameters),
dimension(:),
allocatable :: param
19838 type(tnonlocalmicrostructure),
dimension(:),
allocatable :: microstructure
19846 module subroutine plastic_nonlocal_init
19852 sizestate, sizedotstate, sizedependentstate, sizedeltastate, &
19855 real(preal),
dimension(:),
allocatable :: &
19857 character(len=pStringLen) :: &
19859 type(tinitialparameters) :: &
19862 write(6,
'(/,a)')
' <<<+- constitutive_'//plasticity_nonlocal_label//
' init -+>>>';
flush(6)
19864 write(6,
'(/,a)')
' Reuber et al., Acta Materialia 71:333–348, 2014'
19865 write(6,
'(a)')
' https://doi.org/10.1016/j.actamat.2014.03.012'
19867 write(6,
'(/,a)')
' Kords, Dissertation RWTH Aachen, 2014'
19868 write(6,
'(a)')
' http://publications.rwth-aachen.de/record/229993'
19870 ninstance = count(phase_plasticity == plasticity_nonlocal_id)
19871 if (iand(debug_level(debug_constitutive),debug_levelbasic) /= 0) &
19872 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
19874 allocate(param(ninstance))
19875 allocate(state(ninstance))
19876 allocate(state0(ninstance))
19877 allocate(dotstate(ninstance))
19878 allocate(deltastate(ninstance))
19879 allocate(microstructure(ninstance))
19881 do p=1,
size(config_phase)
19882 if (phase_plasticity(p) /= plasticity_nonlocal_id) cycle
19884 associate(prm => param(phase_plasticityinstance(p)), &
19885 dot => dotstate(phase_plasticityinstance(p)), &
19886 stt => state(phase_plasticityinstance(p)), &
19887 st0 => state0(phase_plasticityinstance(p)), &
19888 del => deltastate(phase_plasticityinstance(p)), &
19889 dst => microstructure(phase_plasticityinstance(p)), &
19890 config => config_phase(p))
19892 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
19894 prm%atol_rho =
config%getFloat(
'atol_rho',defaultval=1.0e4_preal)
19897 prm%mu = lattice_mu(p)
19898 prm%nu = lattice_nu(p)
19900 ini%N_sl =
config%getInts(
'nslip',defaultval=emptyintarray)
19901 prm%sum_N_sl = sum(abs(ini%N_sl))
19902 slipactive:
if (prm%sum_N_sl > 0)
then
19903 prm%Schmid = lattice_schmidmatrix_slip(ini%N_sl,
config%getString(
'lattice_structure'),&
19904 config%getFloat(
'c/a',defaultval=0.0_preal))
19906 if(trim(
config%getString(
'lattice_structure')) ==
'bcc')
then
19907 a =
config%getFloats(
'nonschmid_coefficients',defaultval = emptyrealarray)
19908 if(
size(a) > 0) prm%nonSchmidActive = .true.
19909 prm%nonSchmid_pos = lattice_nonschmidmatrix(ini%N_sl,a,+1)
19910 prm%nonSchmid_neg = lattice_nonschmidmatrix(ini%N_sl,a,-1)
19912 prm%nonSchmid_pos = prm%Schmid
19913 prm%nonSchmid_neg = prm%Schmid
19916 prm%interactionSlipSlip = lattice_interaction_slipbyslip(ini%N_sl, &
19917 config%getFloats(
'interaction_slipslip'), &
19918 config%getString(
'lattice_structure'))
19920 prm%forestProjection_edge = lattice_forestprojection_edge(ini%N_sl,
config%getString(
'lattice_structure'),&
19921 config%getFloat(
'c/a',defaultval=0.0_preal))
19922 prm%forestProjection_screw = lattice_forestprojection_screw(ini%N_sl,
config%getString(
'lattice_structure'),&
19923 config%getFloat(
'c/a',defaultval=0.0_preal))
19925 prm%slip_direction = lattice_slip_direction(ini%N_sl,
config%getString(
'lattice_structure'),&
19926 config%getFloat(
'c/a',defaultval=0.0_preal))
19927 prm%slip_transverse = lattice_slip_transverse(ini%N_sl,
config%getString(
'lattice_structure'),&
19928 config%getFloat(
'c/a',defaultval=0.0_preal))
19929 prm%slip_normal = lattice_slip_normal(ini%N_sl,
config%getString(
'lattice_structure'),&
19930 config%getFloat(
'c/a',defaultval=0.0_preal))
19933 allocate(prm%colinearSystem(prm%sum_N_sl), source = -1)
19934 do s1 = 1, prm%sum_N_sl
19935 do s2 = 1, prm%sum_N_sl
19936 if (all(deq0(math_cross(prm%slip_direction(1:3,s1),prm%slip_direction(1:3,s2)))) .and. &
19937 any(dneq0(math_cross(prm%slip_normal (1:3,s1),prm%slip_normal (1:3,s2))))) &
19938 prm%colinearSystem(s1) = s2
19942 ini%rhoSglEdgePos0 =
config%getFloats(
'rhosgledgepos0', requiredsize=
size(ini%N_sl))
19943 ini%rhoSglEdgeNeg0 =
config%getFloats(
'rhosgledgeneg0', requiredsize=
size(ini%N_sl))
19944 ini%rhoSglScrewPos0 =
config%getFloats(
'rhosglscrewpos0', requiredsize=
size(ini%N_sl))
19945 ini%rhoSglScrewNeg0 =
config%getFloats(
'rhosglscrewneg0', requiredsize=
size(ini%N_sl))
19946 ini%rhoDipEdge0 =
config%getFloats(
'rhodipedge0', requiredsize=
size(ini%N_sl))
19947 ini%rhoDipScrew0 =
config%getFloats(
'rhodipscrew0', requiredsize=
size(ini%N_sl))
19949 prm%lambda0 =
config%getFloats(
'lambda0', requiredsize=
size(ini%N_sl))
19950 prm%burgers =
config%getFloats(
'burgers', requiredsize=
size(ini%N_sl))
19952 prm%lambda0 = math_expand(prm%lambda0,ini%N_sl)
19953 prm%burgers = math_expand(prm%burgers,ini%N_sl)
19955 prm%minDipoleHeight_edge =
config%getFloats(
'minimumdipoleheightedge', requiredsize=
size(ini%N_sl))
19956 prm%minDipoleHeight_screw =
config%getFloats(
'minimumdipoleheightscrew', requiredsize=
size(ini%N_sl))
19957 prm%minDipoleHeight_edge = math_expand(prm%minDipoleHeight_edge, ini%N_sl)
19958 prm%minDipoleHeight_screw = math_expand(prm%minDipoleHeight_screw,ini%N_sl)
19959 allocate(prm%minDipoleHeight(prm%sum_N_sl,2))
19960 prm%minDipoleHeight(:,1) = prm%minDipoleHeight_edge
19961 prm%minDipoleHeight(:,2) = prm%minDipoleHeight_screw
19963 prm%peierlsstress_edge =
config%getFloats(
'peierlsstressedge', requiredsize=
size(ini%N_sl))
19964 prm%peierlsstress_screw =
config%getFloats(
'peierlsstressscrew', requiredsize=
size(ini%N_sl))
19965 prm%peierlsstress_edge = math_expand(prm%peierlsstress_edge, ini%N_sl)
19966 prm%peierlsstress_screw = math_expand(prm%peierlsstress_screw,ini%N_sl)
19967 allocate(prm%peierlsstress(prm%sum_N_sl,2))
19968 prm%peierlsstress(:,1) = prm%peierlsstress_edge
19969 prm%peierlsstress(:,2) = prm%peierlsstress_screw
19971 prm%significantRho =
config%getFloat(
'significantrho')
19972 prm%significantN =
config%getFloat(
'significantn', 0.0_preal)
19973 prm%CFLfactor =
config%getFloat(
'cflfactor',defaultval=2.0_preal)
19975 prm%atomicVolume =
config%getFloat(
'atomicvolume')
19976 prm%Dsd0 =
config%getFloat(
'selfdiffusionprefactor')
19977 prm%selfDiffusionEnergy =
config%getFloat(
'selfdiffusionenergy')
19978 prm%linetensionEffect =
config%getFloat(
'linetension')
19979 prm%edgeJogFactor =
config%getFloat(
'edgejog')
19980 prm%doublekinkwidth =
config%getFloat(
'doublekinkwidth')
19981 prm%solidSolutionEnergy =
config%getFloat(
'solidsolutionenergy')
19982 prm%solidSolutionSize =
config%getFloat(
'solidsolutionsize')
19983 prm%solidSolutionConcentration =
config%getFloat(
'solidsolutionconcentration')
19985 prm%p =
config%getFloat(
'p')
19986 prm%q =
config%getFloat(
'q')
19987 prm%viscosity =
config%getFloat(
'viscosity')
19988 prm%fattack =
config%getFloat(
'attackfrequency')
19991 ini%rhoSglScatter =
config%getFloat(
'rhosglscatter')
19992 ini%rhoSglRandom =
config%getFloat(
'rhosglrandom',0.0_preal)
19993 if (
config%keyExists(
'/rhosglrandom/')) &
19994 ini%rhoSglRandomBinning =
config%getFloat(
'rhosglrandombinning',0.0_preal)
19998 prm%surfaceTransmissivity =
config%getFloat(
'surfacetransmissivity',defaultval=1.0_preal)
19999 prm%grainboundaryTransmissivity =
config%getFloat(
'grainboundarytransmissivity',defaultval=-1.0_preal)
20000 prm%fEdgeMultiplication =
config%getFloat(
'edgemultiplication')
20001 prm%shortRangeStressCorrection =
config%keyExists(
'/shortrangestresscorrection/')
20005 if (any(prm%burgers < 0.0_preal)) extmsg = trim(extmsg)//
' burgers'
20006 if (any(prm%lambda0 <= 0.0_preal)) extmsg = trim(extmsg)//
' lambda0'
20008 if (any(ini%rhoSglEdgePos0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoSglEdgePos0'
20009 if (any(ini%rhoSglEdgeNeg0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoSglEdgeNeg0'
20010 if (any(ini%rhoSglScrewPos0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoSglScrewPos0'
20011 if (any(ini%rhoSglScrewNeg0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoSglScrewNeg0'
20012 if (any(ini%rhoDipEdge0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoDipEdge0'
20013 if (any(ini%rhoDipScrew0 < 0.0_preal)) extmsg = trim(extmsg)//
' rhoDipScrew0'
20015 if (any(prm%peierlsstress < 0.0_preal)) extmsg = trim(extmsg)//
' peierlsstress'
20016 if (any(prm%minDipoleHeight < 0.0_preal)) extmsg = trim(extmsg)//
' minDipoleHeight'
20018 if (prm%viscosity <= 0.0_preal) extmsg = trim(extmsg)//
' viscosity'
20019 if (prm%selfDiffusionEnergy <= 0.0_preal) extmsg = trim(extmsg)//
' selfDiffusionEnergy'
20020 if (prm%fattack <= 0.0_preal) extmsg = trim(extmsg)//
' fattack'
20021 if (prm%doublekinkwidth <= 0.0_preal) extmsg = trim(extmsg)//
' doublekinkwidth'
20022 if (prm%Dsd0 < 0.0_preal) extmsg = trim(extmsg)//
' Dsd0'
20023 if (prm%atomicVolume <= 0.0_preal) extmsg = trim(extmsg)//
' atomicVolume'
20025 if (prm%significantN < 0.0_preal) extmsg = trim(extmsg)//
' significantN'
20026 if (prm%significantrho < 0.0_preal) extmsg = trim(extmsg)//
' significantrho'
20027 if (prm%atol_rho < 0.0_preal) extmsg = trim(extmsg)//
' atol_rho'
20028 if (prm%CFLfactor < 0.0_preal) extmsg = trim(extmsg)//
' CFLfactor'
20030 if (prm%p <= 0.0_preal .or. prm%p > 1.0_preal) extmsg = trim(extmsg)//
' p'
20031 if (prm%q < 1.0_preal .or. prm%q > 2.0_preal) extmsg = trim(extmsg)//
' q'
20033 if (prm%linetensionEffect < 0.0_preal .or. prm%linetensionEffect > 1.0_preal) &
20034 extmsg = trim(extmsg)//
' linetensionEffect'
20035 if (prm%edgeJogFactor < 0.0_preal .or. prm%edgeJogFactor > 1.0_preal) &
20036 extmsg = trim(extmsg)//
' edgeJogFactor'
20038 if (prm%solidSolutionEnergy <= 0.0_preal) extmsg = trim(extmsg)//
' solidSolutionEnergy'
20039 if (prm%solidSolutionSize <= 0.0_preal) extmsg = trim(extmsg)//
' solidSolutionSize'
20040 if (prm%solidSolutionConcentration <= 0.0_preal) extmsg = trim(extmsg)//
' solidSolutionConcentration'
20042 if (prm%grainboundaryTransmissivity > 1.0_preal) extmsg = trim(extmsg)//
' grainboundaryTransmissivity'
20043 if (prm%surfaceTransmissivity < 0.0_preal .or. prm%surfaceTransmissivity > 1.0_preal) &
20044 extmsg = trim(extmsg)//
' surfaceTransmissivity'
20046 if (prm%fEdgeMultiplication < 0.0_preal .or. prm%fEdgeMultiplication > 1.0_preal) &
20047 extmsg = trim(extmsg)//
' fEdgeMultiplication'
20053 nipcmyphase = count(material_phaseat==p) * discretization_nip
20054 sizedotstate =
size([
'rhoSglEdgePosMobile ',
'rhoSglEdgeNegMobile ', &
20055 'rhoSglScrewPosMobile ',
'rhoSglScrewNegMobile ', &
20056 'rhoSglEdgePosImmobile ',
'rhoSglEdgeNegImmobile ', &
20057 'rhoSglScrewPosImmobile',
'rhoSglScrewNegImmobile', &
20058 'rhoDipEdge ',
'rhoDipScrew ', &
20059 'gamma ' ]) * prm%sum_N_sl
20060 sizedependentstate =
size([
'rhoForest ']) * prm%sum_N_sl
20061 sizestate = sizedotstate + sizedependentstate &
20062 +
size([
'velocityEdgePos ',
'velocityEdgeNeg ', &
20063 'velocityScrewPos ',
'velocityScrewNeg ', &
20064 'maxDipoleHeightEdge ',
'maxDipoleHeightScrew' ]) * prm%sum_N_sl
20065 sizedeltastate = sizedotstate
20067 call material_allocateplasticstate(p,nipcmyphase,sizestate,sizedotstate,sizedeltastate)
20069 plasticstate(p)%nonlocal = .true.
20070 plasticstate(p)%offsetDeltaState = 0
20072 st0%rho => plasticstate(p)%state0 (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20073 stt%rho => plasticstate(p)%state (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20074 dot%rho => plasticstate(p)%dotState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20075 del%rho => plasticstate(p)%deltaState (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20076 plasticstate(p)%atol(1:10*prm%sum_N_sl) = prm%atol_rho
20078 stt%rhoSgl => plasticstate(p)%state (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20079 dot%rhoSgl => plasticstate(p)%dotState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20080 del%rhoSgl => plasticstate(p)%deltaState (0*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20082 stt%rhoSglMobile => plasticstate(p)%state (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20083 dot%rhoSglMobile => plasticstate(p)%dotState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20084 del%rhoSglMobile => plasticstate(p)%deltaState (0*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20086 stt%rho_sgl_mob_edg_pos => plasticstate(p)%state (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
20087 dot%rho_sgl_mob_edg_pos => plasticstate(p)%dotState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
20088 del%rho_sgl_mob_edg_pos => plasticstate(p)%deltaState (0*prm%sum_N_sl+1: 1*prm%sum_N_sl,:)
20090 stt%rho_sgl_mob_edg_neg => plasticstate(p)%state (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
20091 dot%rho_sgl_mob_edg_neg => plasticstate(p)%dotState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
20092 del%rho_sgl_mob_edg_neg => plasticstate(p)%deltaState (1*prm%sum_N_sl+1: 2*prm%sum_N_sl,:)
20094 stt%rho_sgl_mob_scr_pos => plasticstate(p)%state (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
20095 dot%rho_sgl_mob_scr_pos => plasticstate(p)%dotState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
20096 del%rho_sgl_mob_scr_pos => plasticstate(p)%deltaState (2*prm%sum_N_sl+1: 3*prm%sum_N_sl,:)
20098 stt%rho_sgl_mob_scr_neg => plasticstate(p)%state (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20099 dot%rho_sgl_mob_scr_neg => plasticstate(p)%dotState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20100 del%rho_sgl_mob_scr_neg => plasticstate(p)%deltaState (3*prm%sum_N_sl+1: 4*prm%sum_N_sl,:)
20102 stt%rhoSglImmobile => plasticstate(p)%state (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20103 dot%rhoSglImmobile => plasticstate(p)%dotState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20104 del%rhoSglImmobile => plasticstate(p)%deltaState (4*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20106 stt%rho_sgl_imm_edg_pos => plasticstate(p)%state (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
20107 dot%rho_sgl_imm_edg_pos => plasticstate(p)%dotState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
20108 del%rho_sgl_imm_edg_pos => plasticstate(p)%deltaState (4*prm%sum_N_sl+1: 5*prm%sum_N_sl,:)
20110 stt%rho_sgl_imm_edg_neg => plasticstate(p)%state (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
20111 dot%rho_sgl_imm_edg_neg => plasticstate(p)%dotState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
20112 del%rho_sgl_imm_edg_neg => plasticstate(p)%deltaState (5*prm%sum_N_sl+1: 6*prm%sum_N_sl,:)
20114 stt%rho_sgl_imm_scr_pos => plasticstate(p)%state (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
20115 dot%rho_sgl_imm_scr_pos => plasticstate(p)%dotState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
20116 del%rho_sgl_imm_scr_pos => plasticstate(p)%deltaState (6*prm%sum_N_sl+1: 7*prm%sum_N_sl,:)
20118 stt%rho_sgl_imm_scr_neg => plasticstate(p)%state (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20119 dot%rho_sgl_imm_scr_neg => plasticstate(p)%dotState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20120 del%rho_sgl_imm_scr_neg => plasticstate(p)%deltaState (7*prm%sum_N_sl+1: 8*prm%sum_N_sl,:)
20122 stt%rhoDip => plasticstate(p)%state (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20123 dot%rhoDip => plasticstate(p)%dotState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20124 del%rhoDip => plasticstate(p)%deltaState (8*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20126 stt%rho_dip_edg => plasticstate(p)%state (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
20127 dot%rho_dip_edg => plasticstate(p)%dotState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
20128 del%rho_dip_edg => plasticstate(p)%deltaState (8*prm%sum_N_sl+1: 9*prm%sum_N_sl,:)
20130 stt%rho_dip_scr => plasticstate(p)%state (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20131 dot%rho_dip_scr => plasticstate(p)%dotState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20132 del%rho_dip_scr => plasticstate(p)%deltaState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
20134 stt%gamma => plasticstate(p)%state (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:nipcmyphase)
20135 dot%gamma => plasticstate(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:nipcmyphase)
20136 del%gamma => plasticstate(p)%deltaState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:nipcmyphase)
20137 plasticstate(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl ) =
config%getFloat(
'atol_gamma', defaultval = 1.0e-2_preal)
20138 if(any(plasticstate(p)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl) < 0.0_preal)) &
20139 extmsg = trim(extmsg)//
' atol_gamma'
20140 plasticstate(p)%slipRate => plasticstate(p)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:nipcmyphase)
20142 stt%rho_forest => plasticstate(p)%state (11*prm%sum_N_sl + 1:12*prm%sum_N_sl,1:nipcmyphase)
20143 stt%v => plasticstate(p)%state (12*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:nipcmyphase)
20144 stt%v_edg_pos => plasticstate(p)%state (12*prm%sum_N_sl + 1:13*prm%sum_N_sl,1:nipcmyphase)
20145 stt%v_edg_neg => plasticstate(p)%state (13*prm%sum_N_sl + 1:14*prm%sum_N_sl,1:nipcmyphase)
20146 stt%v_scr_pos => plasticstate(p)%state (14*prm%sum_N_sl + 1:15*prm%sum_N_sl,1:nipcmyphase)
20147 stt%v_scr_neg => plasticstate(p)%state (15*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:nipcmyphase)
20149 allocate(dst%tau_pass(prm%sum_N_sl,nipcmyphase),source=0.0_preal)
20150 allocate(dst%tau_back(prm%sum_N_sl,nipcmyphase),source=0.0_preal)
20153 if (nipcmyphase > 0)
call stateinit(ini,p,nipcmyphase)
20154 plasticstate(p)%state0 = plasticstate(p)%state
20158 if (extmsg /=
'')
call io_error(211,ext_msg=trim(extmsg)//
'('//plasticity_nonlocal_label//
')')
20162 allocate(compatibility(2,maxval(param%sum_N_sl),maxval(param%sum_N_sl),nipneighbors,&
20163 discretization_nip,discretization_nelem), source=0.0_preal)
20166 allocate(irhou(maxval(param%sum_N_sl),4,ninstance), source=0)
20167 allocate(iv(maxval(param%sum_N_sl),4,ninstance), source=0)
20168 allocate(id(maxval(param%sum_N_sl),2,ninstance), source=0)
20170 initializeinstances:
do p = 1,
size(phase_plasticity)
20171 nipcmyphase = count(material_phaseat==p) * discretization_nip
20172 myphase2:
if (phase_plasticity(p) == plasticity_nonlocal_id)
then
20175 do s = 1,param(phase_plasticityinstance(p))%sum_N_sl
20177 irhou(s,t,phase_plasticityinstance(p)) = l
20180 l = l + (4+2+1+1)*param(phase_plasticityinstance(p))%sum_N_sl
20182 do s = 1,param(phase_plasticityinstance(p))%sum_N_sl
20184 iv(s,t,phase_plasticityinstance(p)) = l
20188 do s = 1,param(phase_plasticityinstance(p))%sum_N_sl
20190 id(s,t,phase_plasticityinstance(p)) = l
20193 if (id(param(phase_plasticityinstance(p))%sum_N_sl,2,phase_plasticityinstance(p)) /= plasticstate(p)%sizeState) &
20194 call io_error(0, ext_msg =
'state indices not properly set ('//plasticity_nonlocal_label//
')')
20196 enddo initializeinstances
20198 end subroutine plastic_nonlocal_init
20204 module subroutine plastic_nonlocal_dependentstate(f, fp, instance, of, ip, el)
20206 real(preal),
dimension(3,3),
intent(in) :: &
20209 integer,
intent(in) :: &
20216 no, & !< neighbor offset
20219 neighbor_instance, &
20227 integer,
dimension(2) :: &
20229 real(preal),
dimension(2) :: &
20230 rhoexcessgradient, &
20231 rhoexcessgradient_over_rho, &
20233 real(preal),
dimension(3) :: &
20234 rhoexcessdifferences, &
20236 real(preal),
dimension(3,3) :: &
20237 invfe, & !< inverse of elastic deformation gradient
20238 invfp, & !< inverse of plastic deformation gradient
20241 real(preal),
dimension(3,nIPneighbors) :: &
20242 connection_latticeconf
20243 real(preal),
dimension(2,param(instance)%sum_N_sl) :: &
20245 real(preal),
dimension(param(instance)%sum_N_sl) :: &
20248 real(preal),
dimension(param(instance)%sum_N_sl,10) :: &
20252 real(preal),
dimension(param(instance)%sum_N_sl,param(instance)%sum_N_sl) :: &
20253 myinteractionmatrix
20254 real(preal),
dimension(param(instance)%sum_N_sl,nIPneighbors) :: &
20255 rho_edg_delta_neighbor, &
20256 rho_scr_delta_neighbor
20257 real(preal),
dimension(2,maxval(param%sum_N_sl),nIPneighbors) :: &
20258 neighbor_rhoexcess, &
20260 real(preal),
dimension(3,param(instance)%sum_N_sl,2) :: &
20263 associate(prm => param(instance),dst => microstructure(instance), stt => state(instance))
20265 rho =
getrho(instance,of,ip,el)
20267 stt%rho_forest(:,of) = matmul(prm%forestProjection_Edge, sum(abs(rho(:,edg)),2)) &
20268 + matmul(prm%forestProjection_Screw,sum(abs(rho(:,scr)),2))
20273 if (any(lattice_structure(material_phaseat(1,el)) == [lattice_bcc_id,lattice_fcc_id]))
then
20274 myinteractionmatrix = prm%interactionSlipSlip &
20275 * spread(( 1.0_preal - prm%linetensionEffect &
20276 + prm%linetensionEffect &
20277 * log(0.35_preal * prm%burgers * sqrt(max(stt%rho_forest(:,of),prm%significantRho))) &
20278 / log(0.35_preal * prm%burgers * 1e6_preal))** 2.0_preal,2,prm%sum_N_sl)
20280 myinteractionmatrix = prm%interactionSlipSlip
20283 dst%tau_pass(:,of) = prm%mu * prm%burgers &
20284 * sqrt(matmul(myinteractionmatrix,sum(abs(rho),2)))
20293 rho0 =
getrho0(instance,of,ip,el)
20294 if (.not. phase_localplasticity(material_phaseat(1,el)) .and. prm%shortRangeStressCorrection)
then
20295 invfp = math_inv33(fp)
20296 invfe = matmul(fp,math_inv33(f))
20298 rho_edg_delta = rho0(:,mob_edg_pos) - rho0(:,mob_edg_neg)
20299 rho_scr_delta = rho0(:,mob_scr_pos) - rho0(:,mob_scr_neg)
20301 rhoexcess(1,:) = rho_edg_delta
20302 rhoexcess(2,:) = rho_scr_delta
20304 fvsize = ipvolume(ip,el) ** (1.0_preal/3.0_preal)
20308 nrealneighbors = 0.0_preal
20309 neighbor_rhototal = 0.0_preal
20310 do n = 1,nipneighbors
20311 neighbor_el = ipneighborhood(1,n,ip,el)
20312 neighbor_ip = ipneighborhood(2,n,ip,el)
20313 no = material_phasememberat(1,neighbor_ip,neighbor_el)
20314 if (neighbor_el > 0 .and. neighbor_ip > 0)
then
20315 neighbor_instance = phase_plasticityinstance(material_phaseat(1,neighbor_el))
20316 if (neighbor_instance == instance)
then
20318 nrealneighbors = nrealneighbors + 1.0_preal
20319 rho_neighbor0 =
getrho0(instance,no,neighbor_ip,neighbor_el)
20321 rho_edg_delta_neighbor(:,n) = rho_neighbor0(:,mob_edg_pos) - rho_neighbor0(:,mob_edg_neg)
20322 rho_scr_delta_neighbor(:,n) = rho_neighbor0(:,mob_scr_pos) - rho_neighbor0(:,mob_scr_neg)
20324 neighbor_rhototal(1,:,n) = sum(abs(rho_neighbor0(:,edg)),2)
20325 neighbor_rhototal(2,:,n) = sum(abs(rho_neighbor0(:,scr)),2)
20327 connection_latticeconf(1:3,n) = matmul(invfe, discretization_ipcoords(1:3,neighbor_el+neighbor_ip-1) &
20328 - discretization_ipcoords(1:3,el+neighbor_ip-1))
20329 normal_latticeconf = matmul(transpose(invfp), ipareanormal(1:3,n,ip,el))
20330 if (math_inner(normal_latticeconf,connection_latticeconf(1:3,n)) < 0.0_preal) &
20331 connection_latticeconf(1:3,n) = normal_latticeconf * ipvolume(ip,el)/iparea(n,ip,el)
20334 connection_latticeconf(1:3,n) = 0.0_preal
20335 rho_edg_delta_neighbor(:,n) = rho_edg_delta
20336 rho_scr_delta_neighbor(:,n) = rho_scr_delta
20340 connection_latticeconf(1:3,n) = 0.0_preal
20341 rho_edg_delta_neighbor(:,n) = rho_edg_delta
20342 rho_scr_delta_neighbor(:,n) = rho_scr_delta
20346 neighbor_rhoexcess(1,:,:) = rho_edg_delta_neighbor
20347 neighbor_rhoexcess(2,:,:) = rho_scr_delta_neighbor
20352 m(1:3,:,1) = prm%slip_direction
20353 m(1:3,:,2) = -prm%slip_transverse
20355 do s = 1,prm%sum_N_sl
20360 neighbors(1) = 2 * dir - 1
20361 neighbors(2) = 2 * dir
20362 connections(dir,1:3) = connection_latticeconf(1:3,neighbors(1)) &
20363 - connection_latticeconf(1:3,neighbors(2))
20364 rhoexcessdifferences(dir) = neighbor_rhoexcess(c,s,neighbors(1)) &
20365 - neighbor_rhoexcess(c,s,neighbors(2))
20367 invconnections = math_inv33(connections)
20368 if (all(deq0(invconnections)))
call io_error(-1,ext_msg=
'back stress calculation: inversion error')
20370 rhoexcessgradient(c) = math_inner(m(1:3,s,c), matmul(invconnections,rhoexcessdifferences))
20374 rhoexcessgradient(1) = rhoexcessgradient(1) + sum(rho(s,imm_edg)) / fvsize
20375 rhoexcessgradient(2) = rhoexcessgradient(2) + sum(rho(s,imm_scr)) / fvsize
20378 rhototal(1) = (sum(abs(rho(s,edg))) + sum(neighbor_rhototal(1,s,:))) / (1.0_preal + nrealneighbors)
20379 rhototal(2) = (sum(abs(rho(s,scr))) + sum(neighbor_rhototal(2,s,:))) / (1.0_preal + nrealneighbors)
20381 rhoexcessgradient_over_rho = 0.0_preal
20382 where(rhototal > 0.0_preal) rhoexcessgradient_over_rho = rhoexcessgradient / rhototal
20385 dst%tau_back(s,of) = - prm%mu * prm%burgers(s) / (2.0_preal * pi) &
20386 * ( rhoexcessgradient_over_rho(1) / (1.0_preal - prm%nu) &
20387 + rhoexcessgradient_over_rho(2))
20391 # 721 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
20395 end subroutine plastic_nonlocal_dependentstate
20401 module subroutine plastic_nonlocal_lpanditstangent(lp,dlp_dmp, &
20402 mp,temperature,instance,of,ip,el)
20403 real(preal),
dimension(3,3),
intent(out) :: &
20405 real(preal),
dimension(3,3,3,3),
intent(out) :: &
20407 integer,
intent(in) :: &
20410 ip, & !< current integration point
20412 real(preal),
intent(in) :: &
20415 real(preal),
dimension(3,3),
intent(in) :: &
20419 ns, & !< short notation for the total number of active slip systems
20424 t, & !< dislocation type
20426 real(preal),
dimension(param(instance)%sum_N_sl,8) :: &
20428 real(preal),
dimension(param(instance)%sum_N_sl,10) :: &
20430 real(preal),
dimension(param(instance)%sum_N_sl,4) :: &
20432 tauns, & !< resolved shear stress including non Schmid and backstress terms
20433 dv_dtau, & !< velocity derivative with respect to the shear stress
20435 real(preal),
dimension(param(instance)%sum_N_sl) :: &
20436 tau, & !< resolved shear stress including backstress terms
20439 associate(prm => param(instance),dst=>microstructure(instance),stt=>state(instance))
20443 rho =
getrho(instance,of,ip,el)
20444 rhosgl = rho(:,sgl)
20447 tau(s) = math_tensordot(mp, prm%Schmid(1:3,1:3,s))
20448 tauns(s,1) = tau(s)
20449 tauns(s,2) = tau(s)
20450 if (tau(s) > 0.0_preal)
then
20451 tauns(s,3) = math_tensordot(mp, +prm%nonSchmid_pos(1:3,1:3,s))
20452 tauns(s,4) = math_tensordot(mp, -prm%nonSchmid_neg(1:3,1:3,s))
20454 tauns(s,3) = math_tensordot(mp, +prm%nonSchmid_neg(1:3,1:3,s))
20455 tauns(s,4) = math_tensordot(mp, -prm%nonSchmid_pos(1:3,1:3,s))
20458 tauns = tauns + spread(dst%tau_back(:,of),2,4)
20459 tau = tau + dst%tau_back(:,of)
20462 call kinetics(v(:,1), dv_dtau(:,1), dv_dtauns(:,1), &
20463 tau, tauns(:,1), dst%tau_pass(:,of),1,temperature, instance)
20465 dv_dtau(:,2) = dv_dtau(:,1)
20466 dv_dtauns(:,2) = dv_dtauns(:,1)
20469 if (prm%nonSchmidActive)
then
20470 v(:,3:4) = spread(v(:,1),2,2)
20471 dv_dtau(:,3:4) = spread(dv_dtau(:,1),2,2)
20472 dv_dtauns(:,3:4) = spread(dv_dtauns(:,1),2,2)
20475 call kinetics(v(:,t), dv_dtau(:,t), dv_dtauns(:,t), &
20476 tau, tauns(:,t), dst%tau_pass(:,of),2,temperature, instance)
20480 stt%v(:,of) = pack(v,.true.)
20483 forall (s = 1:ns, t = 5:8, rhosgl(s,t) * v(s,t-4) < 0.0_preal) &
20484 rhosgl(s,t-4) = rhosgl(s,t-4) + abs(rhosgl(s,t))
20486 gdottotal = sum(rhosgl(:,1:4) * v, 2) * prm%burgers
20489 dlp_dmp = 0.0_preal
20491 lp = lp + gdottotal(s) * prm%Schmid(1:3,1:3,s)
20492 forall (i=1:3,j=1:3,k=1:3,l=1:3) &
20493 dlp_dmp(i,j,k,l) = dlp_dmp(i,j,k,l) &
20494 + prm%Schmid(i,j,s) * prm%Schmid(k,l,s) &
20495 * sum(rhosgl(s,1:4) * dv_dtau(s,1:4)) * prm%burgers(s) &
20496 + prm%Schmid(i,j,s) &
20497 * ( prm%nonSchmid_pos(k,l,s) * rhosgl(s,3) * dv_dtauns(s,3) &
20498 - prm%nonSchmid_neg(k,l,s) * rhosgl(s,4) * dv_dtauns(s,4)) * prm%burgers(s)
20503 end subroutine plastic_nonlocal_lpanditstangent
20509 module subroutine plastic_nonlocal_deltastate(mp,instance,of,ip,el)
20511 real(preal),
dimension(3,3),
intent(in) :: &
20513 integer,
intent(in) :: &
20525 real(preal),
dimension(param(instance)%sum_N_sl,10) :: &
20526 deltarhoremobilization, &
20527 deltarhodipole2singlestress
20528 real(preal),
dimension(param(instance)%sum_N_sl,10) :: &
20530 real(preal),
dimension(param(instance)%sum_N_sl,4) :: &
20532 real(preal),
dimension(param(instance)%sum_N_sl) :: &
20534 real(preal),
dimension(param(instance)%sum_N_sl,2) :: &
20540 ph = material_phaseat(1,el)
20542 associate(prm => param(instance),dst => microstructure(instance),del => deltastate(instance))
20546 forall (s = 1:ns, t = 1:4) v(s,t) = plasticstate(ph)%state(iv(s,t,instance),of)
20547 forall (s = 1:ns, c = 1:2) dupperold(s,c) = plasticstate(ph)%state(id(s,c,instance),of)
20549 rho =
getrho(instance,of,ip,el)
20550 rhodip = rho(:,dip)
20554 where(rho(:,imm) * v < 0.0_preal)
20555 deltarhoremobilization(:,mob) = abs(rho(:,imm))
20556 deltarhoremobilization(:,imm) = - rho(:,imm)
20557 rho(:,mob) = rho(:,mob) + abs(rho(:,imm))
20558 rho(:,imm) = 0.0_preal
20560 deltarhoremobilization(:,mob) = 0.0_preal
20561 deltarhoremobilization(:,imm) = 0.0_preal
20563 deltarhoremobilization(:,dip) = 0.0_preal
20569 do s = 1,prm%sum_N_sl
20570 tau(s) = math_tensordot(mp, prm%Schmid(1:3,1:3,s)) +dst%tau_back(s,of)
20571 if (abs(tau(s)) < 1.0e-15_preal) tau(s) = 1.0e-15_preal
20574 dupper(:,1) = prm%mu * prm%burgers/(8.0_preal * pi * (1.0_preal - prm%nu) * abs(tau))
20575 dupper(:,2) = prm%mu * prm%burgers/(4.0_preal * pi * abs(tau))
20577 where(dneq0(sqrt(sum(abs(rho(:,edg)),2)))) &
20578 dupper(:,1) = min(1.0_preal/sqrt(sum(abs(rho(:,edg)),2)),dupper(:,1))
20579 where(dneq0(sqrt(sum(abs(rho(:,scr)),2)))) &
20580 dupper(:,2) = min(1.0_preal/sqrt(sum(abs(rho(:,scr)),2)),dupper(:,2))
20582 dupper = max(dupper,prm%minDipoleHeight)
20583 deltadupper = dupper - dupperold
20587 deltarhodipole2singlestress = 0.0_preal
20588 forall (c=1:2, s=1:ns, deltadupper(s,c) < 0.0_preal .and. &
20589 dneq0(dupperold(s,c) - prm%minDipoleHeight(s,c))) &
20590 deltarhodipole2singlestress(s,8+c) = rhodip(s,c) * deltadupper(s,c) &
20591 / (dupperold(s,c) - prm%minDipoleHeight(s,c))
20593 forall (t=1:4) deltarhodipole2singlestress(:,t) = -0.5_preal * deltarhodipole2singlestress(:,(t-1)/2+9)
20594 forall (s = 1:ns, c = 1:2) plasticstate(ph)%state(id(s,c,instance),of) = dupper(s,c)
20596 plasticstate(ph)%deltaState(:,of) = 0.0_preal
20597 del%rho(:,of) = reshape(deltarhoremobilization + deltarhodipole2singlestress, [10*ns])
20599 # 936 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
20603 end subroutine plastic_nonlocal_deltastate
20609 module subroutine plastic_nonlocal_dotstate(mp, f, fp, temperature,timestep, &
20612 real(preal),
dimension(3,3),
intent(in) :: &
20614 real(preal),
dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem),
intent(in) :: &
20615 f, & !< elastic deformation gradient
20617 real(preal),
intent(in) :: &
20618 temperature, & !< temperature
20620 integer,
intent(in) :: &
20623 ip, & !< current integration point
20628 neighbor_instance, & !< instance of my neighbor
's plasticity
20629 ns, & !< short notation for the total number of active slip systems
20630 c, & !< character of dislocation
20631 n, & !< index of my current neighbor
20632 neighbor_el, & !< element number of my neighbor
20633 neighbor_ip, & !< integration point of my neighbor
20634 neighbor_n, & !< neighbor index pointing to me when looking from my neighbor
20635 opposite_neighbor, & !< index of my opposite neighbor
20636 opposite_ip, & !< ip of my opposite neighbor
20637 opposite_el, & !< element index of my opposite neighbor
20638 opposite_n, & !< neighbor index pointing to me when looking from my opposite neighbor
20639 t, & !< type of dislocation
20640 no,& !< neighbor offset shortcut
20641 np,& !< neighbor phase shortcut
20642 topp, & !< type of dislocation with opposite sign to t
20643 s !< index of my current slip system
20644 real(pReal), dimension(param(instance)%sum_N_sl,10) :: &
20646 rho0, & !< dislocation density at beginning of time step
20647 rhoDot, & !< density evolution
20648 rhoDotMultiplication, & !< density evolution by multiplication
20649 rhoDotFlux, & !< density evolution by flux
20650 rhoDotSingle2DipoleGlide, & !< density evolution by dipole formation (by glide)
20651 rhoDotAthermalAnnihilation, & !< density evolution by athermal annihilation
20652 rhoDotThermalAnnihilation !< density evolution by thermal annihilation
20653 real(pReal), dimension(param(instance)%sum_N_sl,8) :: &
20654 rhoSgl, & !< current single dislocation densities (positive/negative screw and edge without dipoles)
20655 neighbor_rhoSgl0, & !< current single dislocation densities of neighboring ip (positive/negative screw and edge without dipoles)
20656 my_rhoSgl0 !< single dislocation densities of central ip (positive/negative screw and edge without dipoles)
20657 real(pReal), dimension(param(instance)%sum_N_sl,4) :: &
20658 v, & !< current dislocation glide velocity
20660 neighbor_v0, & !< dislocation glide velocity of enighboring ip
20661 gdot !< shear rates
20662 real(pReal), dimension(param(instance)%sum_N_sl) :: &
20663 tau, & !< current resolved shear stress
20664 vClimb !< climb velocity of edge dipoles
20665 real(pReal), dimension(param(instance)%sum_N_sl,2) :: &
20666 rhoDip, & !< current dipole dislocation densities (screw and edge dipoles)
20667 dLower, & !< minimum stable dipole distance for edges and screws
20668 dUpper !< current maximum stable dipole distance for edges and screws
20669 real(pReal), dimension(3,param(instance)%sum_N_sl,4) :: &
20670 m !< direction of dislocation motion
20671 real(pReal), dimension(3,3) :: &
20672 my_F, & !< my total deformation gradient
20673 neighbor_F, & !< total deformation gradient of my neighbor
20674 my_Fe, & !< my elastic deformation gradient
20675 neighbor_Fe, & !< elastic deformation gradient of my neighbor
20676 Favg !< average total deformation gradient of me and my neighbor
20677 real(pReal), dimension(3) :: &
20678 normal_neighbor2me, & !< interface normal pointing from my neighbor to me in neighbor's lattice configuration
20679 normal_neighbor2me_defconf, & !< interface normal pointing from my neighbor to me in shared deformed configuration
20680 normal_me2neighbor, & !< interface normal pointing from me to my neighbor in my lattice configuration
20681 normal_me2neighbor_defconf
20683 area, & !< area of the current interface
20684 transmissivity, & !< overall transmissivity of dislocation flux to neighboring material point
20685 linelength, & !< dislocation line length leaving the current interface
20688 ph = material_phaseat(1,el)
20689 if (timestep <= 0.0_preal)
then
20690 plasticstate(ph)%dotState = 0.0_preal
20694 associate(prm => param(instance), &
20695 dst => microstructure(instance), &
20696 dot => dotstate(instance), &
20697 stt => state(instance))
20703 rho =
getrho(instance,of,ip,el)
20704 rhosgl = rho(:,sgl)
20705 rhodip = rho(:,dip)
20706 rho0 =
getrho0(instance,of,ip,el)
20707 my_rhosgl0 = rho0(:,sgl)
20709 forall (s = 1:ns, t = 1:4) v(s,t) = plasticstate(ph)%state(iv(s,t,instance),of)
20710 gdot = rhosgl(:,1:4) * v * spread(prm%burgers,2,4)
20712 # 1056 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
20717 tau(s) = math_tensordot(mp, prm%Schmid(1:3,1:3,s)) + dst%tau_back(s,of)
20718 if (abs(tau(s)) < 1.0e-15_preal) tau(s) = 1.0e-15_preal
20721 dlower = prm%minDipoleHeight
20722 dupper(:,1) = prm%mu * prm%burgers/(8.0_preal * pi * (1.0_preal - prm%nu) * abs(tau))
20723 dupper(:,2) = prm%mu * prm%burgers/(4.0_preal * pi * abs(tau))
20725 where(dneq0(sqrt(sum(abs(rho(:,edg)),2)))) &
20726 dupper(:,1) = min(1.0_preal/sqrt(sum(abs(rho(:,edg)),2)),dupper(:,1))
20727 where(dneq0(sqrt(sum(abs(rho(:,scr)),2)))) &
20728 dupper(:,2) = min(1.0_preal/sqrt(sum(abs(rho(:,scr)),2)),dupper(:,2))
20730 dupper = max(dupper,dlower)
20734 rhodotmultiplication = 0.0_preal
20735 isbcc:
if (lattice_structure(ph) == lattice_bcc_id)
then
20736 forall (s = 1:ns, sum(abs(v(s,1:4))) > 0.0_preal)
20737 rhodotmultiplication(s,1:2) = sum(abs(gdot(s,3:4))) / prm%burgers(s) &
20738 * sqrt(stt%rho_forest(s,of)) / prm%lambda0(s)
20740 rhodotmultiplication(s,3:4) = sum(abs(gdot(s,3:4))) /prm%burgers(s) &
20741 * sqrt(stt%rho_forest(s,of)) / prm%lambda0(s)
20746 rhodotmultiplication(:,1:4) = spread( &
20747 (sum(abs(gdot(:,1:2)),2) * prm%fEdgeMultiplication + sum(abs(gdot(:,3:4)),2)) &
20748 * sqrt(stt%rho_forest(:,of)) / prm%lambda0 / prm%burgers, 2, 4)
20751 forall (s = 1:ns, t = 1:4) v0(s,t) = plasticstate(ph)%state0(iv(s,t,instance),of)
20755 rhodotflux = 0.0_preal
20756 if (.not. phase_localplasticity(material_phaseat(1,el)))
then
20759 if (any( abs(gdot) > 0.0_preal &
20760 .and. prm%CFLfactor * abs(v0) * timestep &
20761 > ipvolume(ip,el) / maxval(iparea(:,ip,el))))
then
20762 # 1116 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
20763 plasticstate(ph)%dotState = ieee_value(1.0_preal,ieee_quiet_nan)
20771 m(1:3,:,1) = prm%slip_direction
20772 m(1:3,:,2) = -prm%slip_direction
20773 m(1:3,:,3) = -prm%slip_transverse
20774 m(1:3,:,4) = prm%slip_transverse
20776 my_f = f(1:3,1:3,1,ip,el)
20777 my_fe = matmul(my_f, math_inv33(fp(1:3,1:3,1,ip,el)))
20779 neighbors:
do n = 1,nipneighbors
20781 neighbor_el = ipneighborhood(1,n,ip,el)
20782 neighbor_ip = ipneighborhood(2,n,ip,el)
20783 neighbor_n = ipneighborhood(3,n,ip,el)
20784 np = material_phaseat(1,neighbor_el)
20785 no = material_phasememberat(1,neighbor_ip,neighbor_el)
20787 opposite_neighbor = n + mod(n,2) - mod(n+1,2)
20788 opposite_el = ipneighborhood(1,opposite_neighbor,ip,el)
20789 opposite_ip = ipneighborhood(2,opposite_neighbor,ip,el)
20790 opposite_n = ipneighborhood(3,opposite_neighbor,ip,el)
20792 if (neighbor_n > 0)
then
20793 neighbor_instance = phase_plasticityinstance(material_phaseat(1,neighbor_el))
20794 neighbor_f = f(1:3,1:3,1,neighbor_ip,neighbor_el)
20795 neighbor_fe = matmul(neighbor_f, math_inv33(fp(1:3,1:3,1,neighbor_ip,neighbor_el)))
20796 favg = 0.5_preal * (my_f + neighbor_f)
20801 neighbor_v0 = 0.0_preal
20811 if (neighbor_n > 0)
then
20812 if (phase_plasticity(material_phaseat(1,neighbor_el)) == plasticity_nonlocal_id .and. &
20813 any(compatibility(:,:,:,n,ip,el) > 0.0_preal))
then
20815 forall (s = 1:ns, t = 1:4)
20816 neighbor_v0(s,t) = plasticstate(np)%state0(iv(s,t,neighbor_instance),no)
20817 neighbor_rhosgl0(s,t) = max(plasticstate(np)%state0(irhou(s,t,neighbor_instance),no),0.0_preal)
20820 where (neighbor_rhosgl0 * ipvolume(neighbor_ip,neighbor_el) ** 0.667_preal < prm%significantN &
20821 .or. neighbor_rhosgl0 < prm%significantRho) &
20822 neighbor_rhosgl0 = 0.0_preal
20823 normal_neighbor2me_defconf = math_det33(favg) * matmul(math_inv33(transpose(favg)), &
20824 ipareanormal(1:3,neighbor_n,neighbor_ip,neighbor_el))
20825 normal_neighbor2me = matmul(transpose(neighbor_fe), normal_neighbor2me_defconf) &
20826 / math_det33(neighbor_fe)
20827 area = iparea(neighbor_n,neighbor_ip,neighbor_el) * norm2(normal_neighbor2me)
20828 normal_neighbor2me = normal_neighbor2me / norm2(normal_neighbor2me)
20832 topp = t + mod(t,2) - mod(t+1,2)
20833 if (neighbor_v0(s,t) * math_inner(m(1:3,s,t), normal_neighbor2me) > 0.0_preal &
20834 .and. v0(s,t) * neighbor_v0(s,t) >= 0.0_preal )
then
20835 linelength = neighbor_rhosgl0(s,t) * neighbor_v0(s,t) &
20836 * math_inner(m(1:3,s,t), normal_neighbor2me) * area
20837 where (compatibility(c,:,s,n,ip,el) > 0.0_preal) &
20838 rhodotflux(:,t) = rhodotflux(1:ns,t) &
20839 + linelength/ipvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_preal
20840 where (compatibility(c,:,s,n,ip,el) < 0.0_preal) &
20841 rhodotflux(:,topp) = rhodotflux(:,topp) &
20842 + linelength/ipvolume(ip,el)*compatibility(c,:,s,n,ip,el)**2.0_preal
20857 if (opposite_n > 0)
then
20858 if (phase_plasticity(material_phaseat(1,opposite_el)) == plasticity_nonlocal_id)
then
20860 normal_me2neighbor_defconf = math_det33(favg) &
20861 * matmul(math_inv33(transpose(favg)),ipareanormal(1:3,n,ip,el))
20862 normal_me2neighbor = matmul(transpose(my_fe), normal_me2neighbor_defconf) &
20863 / math_det33(my_fe)
20864 area = iparea(n,ip,el) * norm2(normal_me2neighbor)
20865 normal_me2neighbor = normal_me2neighbor / norm2(normal_me2neighbor)
20869 if (v0(s,t) * math_inner(m(1:3,s,t), normal_me2neighbor) > 0.0_preal )
then
20870 if (v0(s,t) * neighbor_v0(s,t) >= 0.0_preal)
then
20871 transmissivity = sum(compatibility(c,:,s,n,ip,el)**2.0_preal)
20873 transmissivity = 0.0_preal
20875 linelength = my_rhosgl0(s,t) * v0(s,t) &
20876 * math_inner(m(1:3,s,t), normal_me2neighbor) * area
20877 rhodotflux(s,t) = rhodotflux(s,t) - linelength / ipvolume(ip,el)
20878 rhodotflux(s,t+4) = rhodotflux(s,t+4) &
20879 + linelength / ipvolume(ip,el) * (1.0_preal - transmissivity) &
20880 * sign(1.0_preal, v0(s,t))
20896 rhodotsingle2dipoleglide(:,2*c-1) = -2.0_preal * dupper(:,c) / prm%burgers &
20897 * ( rhosgl(:,2*c-1) * abs(gdot(:,2*c)) &
20898 + rhosgl(:,2*c) * abs(gdot(:,2*c-1)) &
20899 + abs(rhosgl(:,2*c+4)) * abs(gdot(:,2*c-1)))
20901 rhodotsingle2dipoleglide(:,2*c) = -2.0_preal * dupper(:,c) / prm%burgers &
20902 * ( rhosgl(:,2*c-1) * abs(gdot(:,2*c)) &
20903 + rhosgl(:,2*c) * abs(gdot(:,2*c-1)) &
20904 + abs(rhosgl(:,2*c+3)) * abs(gdot(:,2*c)))
20906 rhodotsingle2dipoleglide(:,2*c+3) = -2.0_preal * dupper(:,c) / prm%burgers &
20907 * rhosgl(:,2*c+3) * abs(gdot(:,2*c))
20909 rhodotsingle2dipoleglide(:,2*c+4) = -2.0_preal * dupper(:,c) / prm%burgers &
20910 * rhosgl(:,2*c+4) * abs(gdot(:,2*c-1))
20912 rhodotsingle2dipoleglide(:,c+8) = abs(rhodotsingle2dipoleglide(:,2*c+3)) &
20913 + abs(rhodotsingle2dipoleglide(:,2*c+4)) &
20914 - rhodotsingle2dipoleglide(:,2*c-1) &
20915 - rhodotsingle2dipoleglide(:,2*c)
20920 rhodotathermalannihilation = 0.0_preal
20922 rhodotathermalannihilation(:,c+8) = -2.0_preal * dlower(:,c) / prm%burgers &
20923 * ( 2.0_preal * (rhosgl(:,2*c-1) * abs(gdot(:,2*c)) + rhosgl(:,2*c) * abs(gdot(:,2*c-1))) &
20924 + 2.0_preal * (abs(rhosgl(:,2*c+3)) * abs(gdot(:,2*c)) + abs(rhosgl(:,2*c+4)) * abs(gdot(:,2*c-1))) &
20925 + rhodip(:,c) * (abs(gdot(:,2*c-1)) + abs(gdot(:,2*c))))
20928 if (lattice_structure(ph) == lattice_fcc_id) &
20929 forall (s = 1:ns, prm%colinearSystem(s) > 0) &
20930 rhodotathermalannihilation(prm%colinearSystem(s),1:2) = - rhodotathermalannihilation(s,10) &
20931 * 0.25_preal * sqrt(stt%rho_forest(s,of)) * (dupper(s,2) + dlower(s,2)) * prm%edgeJogFactor
20935 rhodotthermalannihilation = 0.0_preal
20936 selfdiffusion = prm%Dsd0 * exp(-prm%selfDiffusionEnergy / (kb * temperature))
20937 vclimb = prm%atomicVolume * selfdiffusion * prm%mu &
20938 / ( kb * temperature * pi * (1.0_preal-prm%nu) * (dupper(:,1) + dlower(:,1)))
20939 forall (s = 1:ns, dupper(s,1) > dlower(s,1)) &
20940 rhodotthermalannihilation(s,9) = max(- 4.0_preal * rhodip(s,1) * vclimb(s) / (dupper(s,1) - dlower(s,1)), &
20941 - rhodip(s,1) / timestep - rhodotathermalannihilation(s,9) &
20942 - rhodotsingle2dipoleglide(s,9))
20944 rhodot = rhodotflux &
20945 + rhodotmultiplication &
20946 + rhodotsingle2dipoleglide &
20947 + rhodotathermalannihilation &
20948 + rhodotthermalannihilation
20950 # 1325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/constitutive_plastic_nonlocal.f90"
20953 if ( any(rho(:,mob) + rhodot(:,1:4) * timestep < -prm%atol_rho) &
20954 .or. any(rho(:,dip) + rhodot(:,9:10) * timestep < -prm%atol_rho))
then
20961 plasticstate(ph)%dotState = ieee_value(1.0_preal,ieee_quiet_nan)
20963 dot%rho(:,of) = pack(rhodot,.true.)
20964 dot%gamma(:,of) = sum(gdot,2)
20969 end subroutine plastic_nonlocal_dotstate
20978 module subroutine plastic_nonlocal_updatecompatibility(orientation,instance,i,e)
20980 type(rotation),
dimension(1,discretization_nIP,discretization_nElem),
intent(in) :: &
20982 integer,
intent(in) :: &
20996 real(preal),
dimension(2,param(instance)%sum_N_sl,param(instance)%sum_N_sl,nIPneighbors) :: &
20999 my_compatibilitysum, &
21002 logical,
dimension(param(instance)%sum_N_sl) :: &
21004 type(rotation) :: mis
21006 ph = material_phaseat(1,e)
21008 associate(prm => param(instance))
21012 my_compatibility = 0.0_preal
21013 forall(s1 = 1:ns) my_compatibility(:,s1,s1,:) = 1.0_preal
21015 neighbors:
do n = 1,nipneighbors
21016 neighbor_e = ipneighborhood(1,n,i,e)
21017 neighbor_i = ipneighborhood(2,n,i,e)
21019 neighbor_phase = material_phaseat(1,neighbor_e)
21021 if (neighbor_e <= 0 .or. neighbor_i <= 0)
then
21024 forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%surfaceTransmissivity)
21025 elseif (neighbor_phase /= ph)
then
21031 if (.not. phase_localplasticity(neighbor_phase) .and. .not. phase_localplasticity(ph)) &
21032 forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = 0.0_preal
21033 elseif (prm%grainboundaryTransmissivity >= 0.0_preal)
then
21036 if (material_texture(1,i,e) /= material_texture(1,neighbor_i,neighbor_e) .and. &
21037 (.not. phase_localplasticity(neighbor_phase))) &
21038 forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%grainboundaryTransmissivity)
21049 mis = orientation(1,i,e)%misorientation(orientation(1,neighbor_i,neighbor_e))
21050 myslipsystems:
do s1 = 1,ns
21051 neighborslipsystems:
do s2 = 1,ns
21052 my_compatibility(1,s2,s1,n) = math_inner(prm%slip_normal(1:3,s1), &
21053 mis%rotate(prm%slip_normal(1:3,s2))) &
21054 * abs(math_inner(prm%slip_direction(1:3,s1), &
21055 mis%rotate(prm%slip_direction(1:3,s2))))
21056 my_compatibility(2,s2,s1,n) = abs(math_inner(prm%slip_normal(1:3,s1), &
21057 mis%rotate(prm%slip_normal(1:3,s2)))) &
21058 * abs(math_inner(prm%slip_direction(1:3,s1), &
21059 mis%rotate(prm%slip_direction(1:3,s2))))
21060 enddo neighborslipsystems
21062 my_compatibilitysum = 0.0_preal
21063 belowthreshold = .true.
21064 do while (my_compatibilitysum < 1.0_preal .and. any(belowthreshold))
21065 thresholdvalue = maxval(my_compatibility(2,:,s1,n), belowthreshold)
21066 nthresholdvalues = real(count(my_compatibility(2,:,s1,n) >= thresholdvalue),preal)
21067 where (my_compatibility(2,:,s1,n) >= thresholdvalue) belowthreshold = .false.
21068 if (my_compatibilitysum + thresholdvalue * nthresholdvalues > 1.0_preal) &
21069 where (abs(my_compatibility(:,:,s1,n)) >= thresholdvalue) &
21070 my_compatibility(:,:,s1,n) = sign((1.0_preal - my_compatibilitysum)/nthresholdvalues,&
21071 my_compatibility(:,:,s1,n))
21072 my_compatibilitysum = my_compatibilitysum + nthresholdvalues * thresholdvalue
21075 where(belowthreshold) my_compatibility(1,:,s1,n) = 0.0_preal
21076 where(belowthreshold) my_compatibility(2,:,s1,n) = 0.0_preal
21078 enddo myslipsystems
21083 compatibility(:,:,:,:,i,e) = my_compatibility
21087 end subroutine plastic_nonlocal_updatecompatibility
21093 module subroutine plastic_nonlocal_results(instance,group)
21095 integer,
intent(in) :: instance
21096 character(len=*),
intent(in) :: group
21100 associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance))
21101 outputsloop:
do o = 1,
size(prm%output)
21102 select case(trim(prm%output(o)))
21103 case(
'rho_sgl_mob_edg_pos')
21104 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_mob_edg_pos,
'rho_sgl_mob_edg_pos', &
21105 'positive mobile edge density',
'1/m²')
21106 case(
'rho_sgl_imm_edg_pos')
21107 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_imm_edg_pos,
'rho_sgl_imm_edg_pos',&
21108 'positive immobile edge density',
'1/m²')
21109 case(
'rho_sgl_mob_edg_neg')
21110 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_mob_edg_neg,
'rho_sgl_mob_edg_neg',&
21111 'negative mobile edge density',
'1/m²')
21112 case(
'rho_sgl_imm_edg_neg')
21113 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_imm_edg_neg,
'rho_sgl_imm_edg_neg',&
21114 'negative immobile edge density',
'1/m²')
21115 case(
'rho_dip_edg')
21116 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_dip_edg,
'rho_dip_edg',&
21117 'edge dipole density',
'1/m²')
21118 case(
'rho_sgl_mob_scr_pos')
21119 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_mob_scr_pos,
'rho_sgl_mob_scr_pos',&
21120 'positive mobile screw density',
'1/m²')
21121 case(
'rho_sgl_imm_scr_pos')
21122 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_imm_scr_pos,
'rho_sgl_imm_scr_pos',&
21123 'positive immobile screw density',
'1/m²')
21124 case(
'rho_sgl_mob_scr_neg')
21125 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_mob_scr_neg,
'rho_sgl_mob_scr_neg',&
21126 'negative mobile screw density',
'1/m²')
21127 case(
'rho_sgl_imm_scr_neg')
21128 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_sgl_imm_scr_neg,
'rho_sgl_imm_scr_neg',&
21129 'negative immobile screw density',
'1/m²')
21130 case(
'rho_dip_scr')
21131 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_dip_scr,
'rho_dip_scr',&
21132 'screw dipole density',
'1/m²')
21134 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%rho_forest,
'rho_forest',&
21135 'forest density',
'1/m²')
21137 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%v_edg_pos,
'v_edg_pos',&
21138 'positive edge velocity',
'm/s')
21140 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%v_edg_neg,
'v_edg_neg',&
21141 'negative edge velocity',
'm/s')
21143 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%v_scr_pos,
'v_scr_pos',&
21144 'positive srew velocity',
'm/s')
21146 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%v_scr_neg,
'v_scr_neg',&
21147 'negative screw velocity',
'm/s')
21149 if(prm%sum_N_sl>0)
call results_writedataset(group,stt%gamma,
'gamma',&
21150 'plastic shear',
'1')
21152 if(prm%sum_N_sl>0)
call results_writedataset(group,dst%tau_pass,
'tau_pass',&
21153 'passing stress for slip',
'Pa')
21158 end subroutine plastic_nonlocal_results
21164 subroutine stateinit(ini,phase,NipcMyPhase)
21166 type(tinitialparameters) :: &
21168 integer,
intent(in) :: &
21180 real(pReal),
dimension(2) :: &
21188 real(pReal),
dimension(NipcMyPhase) :: &
21191 instance = phase_plasticityinstance(phase)
21192 associate(stt => state(instance))
21194 if (ini%rhoSglRandom > 0.0_preal)
then
21195 do e = 1,discretization_nelem
21196 do i = 1,discretization_nip
21197 if (material_phaseat(1,e) == phase) volume(material_phasememberat(1,i,e)) = ipvolume(i,e)
21200 totalvolume = sum(volume)
21201 minimumipvolume = minval(volume)
21202 densitybinning = ini%rhoSglRandomBinning / minimumipvolume ** (2.0_preal / 3.0_preal)
21205 meandensity = 0.0_preal
21206 do while(meandensity < ini%rhoSglRandom)
21207 call random_number(rnd)
21208 phasemember = nint(rnd(1)*real(nipcmyphase,preal) + 0.5_preal)
21209 s = nint(rnd(2)*real(sum(ini%N_sl),preal)*4.0_preal + 0.5_preal)
21210 meandensity = meandensity + densitybinning * volume(phasemember) / totalvolume
21211 stt%rhoSglMobile(s,phasemember) = densitybinning
21214 do e = 1, nipcmyphase
21215 do f = 1,
size(ini%N_sl,1)
21216 from = 1 + sum(ini%N_sl(1:f-1))
21217 upto = sum(ini%N_sl(1:f))
21219 noise = [math_samplegaussvar(0.0_preal, ini%rhoSglScatter), &
21220 math_samplegaussvar(0.0_preal, ini%rhoSglScatter)]
21221 stt%rho_sgl_mob_edg_pos(s,e) = ini%rhoSglEdgePos0(f) + noise(1)
21222 stt%rho_sgl_mob_edg_neg(s,e) = ini%rhoSglEdgeNeg0(f) + noise(1)
21223 stt%rho_sgl_mob_scr_pos(s,e) = ini%rhoSglScrewPos0(f) + noise(2)
21224 stt%rho_sgl_mob_scr_neg(s,e) = ini%rhoSglScrewNeg0(f) + noise(2)
21226 stt%rho_dip_edg(from:upto,e) = ini%rhoDipEdge0(f)
21227 stt%rho_dip_scr(from:upto,e) = ini%rhoDipScrew0(f)
21240 subroutine kinetics(v, dv_dtau, dv_dtauNS, tau, tauNS, tauThreshold, c, Temperature, instance)
21242 integer,
intent(in) :: &
21243 c, & !< dislocation character (1:edge, 2:screw)
21245 real(pReal),
intent(in) :: &
21247 real(pReal),
dimension(param(instance)%sum_N_sl),
intent(in) :: &
21248 tau, & !< resolved external shear stress (without non Schmid effects)
21249 tauNS, & !< resolved external shear stress (including non Schmid effects)
21251 real(pReal),
dimension(param(instance)%sum_N_sl),
intent(out) :: &
21253 dv_dtau, & !< velocity derivative with respect to resolved shear stress (without non Schmid contributions)
21257 ns, & !< short notation for the total number of active slip systems
21262 tauEff, & !< effective shear stress
21263 tPeierls, & !< waiting time in front of a peierls barriers
21264 tSolidSolution, & !< waiting time in front of a solid solution obstacle
21265 vViscous, & !< viscous glide velocity
21266 dtPeierls_dtau, & !< derivative with respect to resolved shear stress
21267 dtSolidSolution_dtau, & !< derivative with respect to resolved shear stress
21268 meanfreepath_S, & !< mean free travel distance for dislocations between two solid solution obstacles
21269 meanfreepath_P, & !< mean free travel distance for dislocations between two Peierls barriers
21270 jumpWidth_P, & !< depth of activated area
21271 jumpWidth_S, & !< depth of activated area
21272 activationLength_P, & !< length of activated dislocation line
21273 activationLength_S, & !< length of activated dislocation line
21274 activationVolume_P, & !< volume that needs to be activated to overcome barrier
21275 activationVolume_S, & !< volume that needs to be activated to overcome barrier
21276 activationEnergy_P, & !< energy that is needed to overcome barrier
21277 activationEnergy_S, & !< energy that is needed to overcome barrier
21278 criticalStress_P, & !< maximum obstacle strength
21279 criticalStress_S, & !< maximum obstacle strength
21282 associate(prm => param(instance))
21285 dv_dtau = 0.0_preal
21286 dv_dtauns = 0.0_preal
21289 if (abs(tau(s)) > tauthreshold(s))
then
21294 taueff = max(0.0_preal, abs(tauns(s)) - tauthreshold(s))
21295 meanfreepath_p = prm%burgers(s)
21296 jumpwidth_p = prm%burgers(s)
21297 activationlength_p = prm%doublekinkwidth *prm%burgers(s)
21298 activationvolume_p = activationlength_p * jumpwidth_p * prm%burgers(s)
21299 criticalstress_p = prm%peierlsStress(s,c)
21300 activationenergy_p = criticalstress_p * activationvolume_p
21301 taurel_p = min(1.0_preal, taueff / criticalstress_p)
21302 tpeierls = 1.0_preal / prm%fattack &
21303 * exp(activationenergy_p / (kb * temperature) &
21304 * (1.0_preal - taurel_p**prm%p)**prm%q)
21305 if (taueff < criticalstress_p)
then
21306 dtpeierls_dtau = tpeierls * prm%p * prm%q * activationvolume_p / (kb * temperature) &
21307 * (1.0_preal - taurel_p**prm%p)**(prm%q-1.0_preal) * taurel_p**(prm%p-1.0_preal)
21309 dtpeierls_dtau = 0.0_preal
21314 taueff = abs(tau(s)) - tauthreshold(s)
21315 meanfreepath_s = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
21316 jumpwidth_s = prm%solidSolutionSize * prm%burgers(s)
21317 activationlength_s = prm%burgers(s) / sqrt(prm%solidSolutionConcentration)
21318 activationvolume_s = activationlength_s * jumpwidth_s * prm%burgers(s)
21319 activationenergy_s = prm%solidSolutionEnergy
21320 criticalstress_s = activationenergy_s / activationvolume_s
21321 taurel_s = min(1.0_preal, taueff / criticalstress_s)
21322 tsolidsolution = 1.0_preal / prm%fattack &
21323 * exp(activationenergy_s / (kb * temperature)* (1.0_preal - taurel_s**prm%p)**prm%q)
21324 if (taueff < criticalstress_s)
then
21325 dtsolidsolution_dtau = tsolidsolution * prm%p * prm%q * activationvolume_s / (kb * temperature) &
21326 * (1.0_preal - taurel_s**prm%p)**(prm%q-1.0_preal)* taurel_s**(prm%p-1.0_preal)
21328 dtsolidsolution_dtau = 0.0_preal
21332 taueff = abs(tau(s)) - tauthreshold(s)
21333 mobility = prm%burgers(s) / prm%viscosity
21334 vviscous = mobility * taueff
21339 v(s) = sign(1.0_preal,tau(s)) &
21340 / (tpeierls / meanfreepath_p + tsolidsolution / meanfreepath_s + 1.0_preal / vviscous)
21341 dv_dtau(s) = v(s)**2.0_preal * (dtsolidsolution_dtau / meanfreepath_s + mobility /vviscous**2.0_preal)
21342 dv_dtauns(s) = v(s)**2.0_preal * dtpeierls_dtau / meanfreepath_p
21355 function getrho(instance,of,ip,el)
21357 integer,
intent(in) :: instance, of,ip,el
21358 real(preal),
dimension(param(instance)%sum_N_sl,10) ::
getrho
21360 associate(prm => param(instance))
21362 getrho = reshape(state(instance)%rho(:,of),[prm%sum_N_sl,10])
21368 where(abs(
getrho) < max(prm%significantN/ipvolume(ip,el)**(2.0_preal/3.0_preal),prm%significantRho)) &
21380 function getrho0(instance,of,ip,el)
21382 integer,
intent(in) :: instance, of,ip,el
21383 real(preal),
dimension(param(instance)%sum_N_sl,10) ::
getrho0
21385 associate(prm => param(instance))
21387 getrho0 = reshape(state0(instance)%rho(:,of),[prm%sum_N_sl,10])
21393 where(abs(
getrho0) < max(prm%significantN/ipvolume(ip,el)**(2.0_preal/3.0_preal),prm%significantRho)) &
21400 end submodule plastic_nonlocal
21401 # 44 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
21403 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90" 1
21434 real(
preal),
dimension(:,:,:),
allocatable,
public :: &
21436 real(
preal),
dimension(:,:,:),
allocatable :: &
21437 crystallite_subdt, & !< substepped time increment of each grain
21438 crystallite_subfrac, & !< already calculated fraction of increment
21439 crystallite_substep
21440 type(
rotation),
dimension(:,:,:),
allocatable :: &
21441 crystallite_orientation
21442 real(
preal),
dimension(:,:,:,:,:),
allocatable,
public,
protected :: &
21443 crystallite_fe, & !< current
"elastic" def grad (end of converged time step)
21444 crystallite_p, & !< 1st Piola-Kirchhoff stress per grain
21445 crystallite_s0, & !< 2nd Piola-Kirchhoff stress vector at start of FE inc
21446 crystallite_fp0, & !< plastic def grad at start of FE inc
21447 crystallite_fi0, & !< intermediate def grad at start of FE inc
21448 crystallite_f0, & !< def grad at start of FE inc
21449 crystallite_lp0, & !< plastic velocitiy grad at start of FE inc
21451 real(
preal),
dimension(:,:,:,:,:),
allocatable,
public :: &
21452 crystallite_s, & !< current 2nd Piola-Kirchhoff stress vector (end of converged time step)
21453 crystallite_partioneds0, & !< 2nd Piola-Kirchhoff stress vector at start of homog inc
21454 crystallite_fp, & !< current plastic def grad (end of converged time step)
21455 crystallite_partionedfp0,& !< plastic def grad at start of homog inc
21456 crystallite_fi, & !< current intermediate def grad (end of converged time step)
21457 crystallite_partionedfi0,& !< intermediate def grad at start of homog inc
21458 crystallite_partionedf, & !< def grad to be reached at end of homog inc
21459 crystallite_partionedf0, & !< def grad at start of homog inc
21460 crystallite_lp, & !< current plastic velocitiy grad (end of converged time step)
21461 crystallite_partionedlp0, & !< plastic velocity grad at start of homog inc
21462 crystallite_li, & !< current intermediate velocitiy grad (end of converged time step)
21463 crystallite_partionedli0
21464 real(
preal),
dimension(:,:,:,:,:),
allocatable :: &
21465 crystallite_subfp0,& !< plastic def grad at start of crystallite inc
21466 crystallite_subfi0,& !< intermediate def grad at start of crystallite inc
21467 crystallite_subf, & !< def grad to be reached at end of crystallite inc
21468 crystallite_subf0, & !< def grad at start of crystallite inc
21469 crystallite_sublp0,& !< plastic velocity grad at start of crystallite inc
21471 real(
preal),
dimension(:,:,:,:,:,:,:),
allocatable,
public,
protected :: &
21473 logical,
dimension(:,:,:),
allocatable,
public :: &
21474 crystallite_requested
21475 logical,
dimension(:,:,:),
allocatable :: &
21476 crystallite_converged, & !< convergence flag
21477 crystallite_todo, & !< flag to indicate need for further computation
21478 crystallite_localplasticity
21481 character(len=pStringLen),
allocatable,
dimension(:) :: &
21484 type(toutput),
allocatable,
dimension(:) :: output_constituent
21488 ijacolpresiduum, & !< frequency of Jacobian update of residuum in Lp
21489 nstate, & !< state loop limit
21492 substepmincryst, & !< minimum (relative) size of sub-step allowed during cutback
21493 substepsizecryst, & !< size of first substep when cutback
21494 substepsizelp, & !< size of first substep when cutback in Lp calculation
21495 substepsizeli, & !< size of first substep when cutback in Li calculation
21496 stepincreasecryst, & !< increase of next substep size when previous substep converged
21497 rtol_crystallitestate, & !< relative tolerance in state loop
21498 rtol_crystallitestress, & !< relative tolerance in stress loop
21499 atol_crystallitestress
21502 type(tnumerics) :: num
21504 procedure(),
pointer :: integratestate
21525 logical,
dimension(discretization_nIP,discretization_nElem) :: devNull
21527 c, & !< counter in integration point component loop
21528 i, & !< counter in integration point loop
21529 e, & !< counter in element loop
21530 cMax, & !< maximum number of integration point components
21531 iMax, & !< maximum number of integration points
21532 eMax, & !< maximum number of elements
21535 write(6,
'(/,a)')
' <<<+- crystallite init -+>>>'
21541 allocate(crystallite_partionedf(3,3,cmax,imax,emax),source=0.0_preal)
21543 allocate(crystallite_s0, &
21544 crystallite_f0, crystallite_fi0,crystallite_fp0, &
21545 crystallite_li0,crystallite_lp0, &
21546 crystallite_partioneds0, &
21547 crystallite_partionedf0,crystallite_partionedfp0,crystallite_partionedfi0, &
21548 crystallite_partionedlp0,crystallite_partionedli0, &
21549 crystallite_s,crystallite_p, &
21550 crystallite_fe,crystallite_fi,crystallite_fp, &
21551 crystallite_li,crystallite_lp, &
21552 crystallite_subf,crystallite_subf0, &
21553 crystallite_subfp0,crystallite_subfi0, &
21554 crystallite_subli0,crystallite_sublp0, &
21555 source = crystallite_partionedf)
21557 allocate(crystallite_dpdf(3,3,3,3,cmax,imax,emax),source=0.0_preal)
21559 allocate(crystallite_dt(cmax,imax,emax),source=0.0_preal)
21560 allocate(crystallite_subdt,crystallite_subfrac,crystallite_substep, &
21561 source = crystallite_dt)
21563 allocate(crystallite_orientation(cmax,imax,emax))
21565 allocate(crystallite_localplasticity(cmax,imax,emax), source=.true.)
21566 allocate(crystallite_requested(cmax,imax,emax), source=.false.)
21567 allocate(crystallite_todo(cmax,imax,emax), source=.false.)
21568 allocate(crystallite_converged(cmax,imax,emax), source=.true.)
21570 num%subStepMinCryst =
config_numerics%getFloat(
'substepmincryst', defaultval=1.0e-3_preal)
21571 num%subStepSizeCryst =
config_numerics%getFloat(
'substepsizecryst', defaultval=0.25_preal)
21572 num%stepIncreaseCryst =
config_numerics%getFloat(
'stepincreasecryst', defaultval=1.5_preal)
21574 num%subStepSizeLp =
config_numerics%getFloat(
'substepsizelp', defaultval=0.5_preal)
21575 num%subStepSizeLi =
config_numerics%getFloat(
'substepsizeli', defaultval=0.5_preal)
21577 num%rtol_crystalliteState =
config_numerics%getFloat(
'rtol_crystallitestate', defaultval=1.0e-6_preal)
21578 num%rtol_crystalliteStress =
config_numerics%getFloat(
'rtol_crystallitestress',defaultval=1.0e-6_preal)
21579 num%atol_crystalliteStress =
config_numerics%getFloat(
'atol_crystallitestress',defaultval=1.0e-8_preal)
21581 num%iJacoLpresiduum =
config_numerics%getInt (
'ijacolpresiduum', defaultval=1)
21586 if(num%subStepMinCryst <= 0.0_preal)
call io_error(301,ext_msg=
'subStepMinCryst')
21587 if(num%subStepSizeCryst <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeCryst')
21588 if(num%stepIncreaseCryst <= 0.0_preal)
call io_error(301,ext_msg=
'stepIncreaseCryst')
21590 if(num%subStepSizeLp <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeLp')
21591 if(num%subStepSizeLi <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeLi')
21593 if(num%rtol_crystalliteState <= 0.0_preal)
call io_error(301,ext_msg=
'rtol_crystalliteState')
21594 if(num%rtol_crystalliteStress <= 0.0_preal)
call io_error(301,ext_msg=
'rtol_crystalliteStress')
21595 if(num%atol_crystalliteStress <= 0.0_preal)
call io_error(301,ext_msg=
'atol_crystalliteStress')
21597 if(num%iJacoLpresiduum < 1)
call io_error(301,ext_msg=
'iJacoLpresiduum')
21599 if(num%nState < 1)
call io_error(301,ext_msg=
'nState')
21600 if(num%nStress< 1)
call io_error(301,ext_msg=
'nStress')
21618 allocate(output_constituent(c)%label(1))
21619 output_constituent(c)%label(1)=
'GfortranBug86277'
21620 output_constituent(c)%label =
config_phase(c)%getStrings(
'(output)',defaultval=output_constituent(c)%label )
21621 if (output_constituent(c)%label (1) ==
'GfortranBug86277') output_constituent(c)%label = [
character(len=pStringLen)::]
21636 crystallite_fp0(1:3,1:3,c,i,e) = crystallite_fp0(1:3,1:3,c,i,e) &
21637 /
math_det33(crystallite_fp0(1:3,1:3,c,i,e))**(1.0_preal/3.0_preal)
21639 crystallite_f0(1:3,1:3,c,i,e) =
math_i3
21641 crystallite_fe(1:3,1:3,c,i,e) =
math_inv33(matmul(crystallite_fi0(1:3,1:3,c,i,e), &
21642 crystallite_fp0(1:3,1:3,c,i,e)))
21643 crystallite_fp(1:3,1:3,c,i,e) = crystallite_fp0(1:3,1:3,c,i,e)
21644 crystallite_fi(1:3,1:3,c,i,e) = crystallite_fi0(1:3,1:3,c,i,e)
21645 crystallite_requested(c,i,e) = .true.
21652 crystallite_partionedfp0 = crystallite_fp0
21653 crystallite_partionedfi0 = crystallite_fi0
21654 crystallite_partionedf0 = crystallite_f0
21655 crystallite_partionedf = crystallite_f0
21664 crystallite_partionedfp0(1:3,1:3,c,i,e), &
21674 # 283 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
21685 real(
preal),
intent(in),
optional :: &
21686 dummyargumenttopreventinternalcompilererrorwithgcc
21690 niterationcrystallite, &
21691 c, & !< counter in integration point component loop
21692 i, & !< counter in integration point loop
21693 e, & !< counter in element loop
21697 # 325 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/crystallite.f90"
21701 crystallite_substep = 0.0_preal
21705 homogenizationrequestscalculation:
if (crystallite_requested(c,i,e))
then
21713 crystallite_subfp0(1:3,1:3,c,i,e) = crystallite_partionedfp0(1:3,1:3,c,i,e)
21714 crystallite_sublp0(1:3,1:3,c,i,e) = crystallite_partionedlp0(1:3,1:3,c,i,e)
21715 crystallite_subfi0(1:3,1:3,c,i,e) = crystallite_partionedfi0(1:3,1:3,c,i,e)
21716 crystallite_subli0(1:3,1:3,c,i,e) = crystallite_partionedli0(1:3,1:3,c,i,e)
21717 crystallite_subf0(1:3,1:3,c,i,e) = crystallite_partionedf0(1:3,1:3,c,i,e)
21718 crystallite_subfrac(c,i,e) = 0.0_preal
21719 crystallite_substep(c,i,e) = 1.0_preal/num%subStepSizeCryst
21720 crystallite_todo(c,i,e) = .true.
21721 crystallite_converged(c,i,e) = .false.
21722 endif homogenizationrequestscalculation
21724 enddo elementlooping1
21736 niterationcrystallite = 0
21738 niterationcrystallite = niterationcrystallite + 1
21750 if (crystallite_converged(c,i,e))
then
21751 formersubstep = crystallite_substep(c,i,e)
21752 crystallite_subfrac(c,i,e) = crystallite_subfrac(c,i,e) + crystallite_substep(c,i,e)
21753 crystallite_substep(c,i,e) = min(1.0_preal - crystallite_subfrac(c,i,e), &
21754 num%stepIncreaseCryst * crystallite_substep(c,i,e))
21756 crystallite_todo(c,i,e) = crystallite_substep(c,i,e) > 0.0_preal
21757 if (crystallite_todo(c,i,e))
then
21758 crystallite_subf0(1:3,1:3,c,i,e) = crystallite_subf(1:3,1:3,c,i,e)
21759 crystallite_sublp0(1:3,1:3,c,i,e) = crystallite_lp(1:3,1:3,c,i,e)
21760 crystallite_subli0(1:3,1:3,c,i,e) = crystallite_li(1:3,1:3,c,i,e)
21761 crystallite_subfp0(1:3,1:3,c,i,e) = crystallite_fp(1:3,1:3,c,i,e)
21762 crystallite_subfi0(1:3,1:3,c,i,e) = crystallite_fi(1:3,1:3,c,i,e)
21775 crystallite_substep(c,i,e) = num%subStepSizeCryst * crystallite_substep(c,i,e)
21776 crystallite_fp(1:3,1:3,c,i,e) = crystallite_subfp0(1:3,1:3,c,i,e)
21777 crystallite_fi(1:3,1:3,c,i,e) = crystallite_subfi0(1:3,1:3,c,i,e)
21778 crystallite_s(1:3,1:3,c,i,e) = crystallite_s0(1:3,1:3,c,i,e)
21779 if (crystallite_substep(c,i,e) < 1.0_preal)
then
21780 crystallite_lp(1:3,1:3,c,i,e) = crystallite_sublp0(1:3,1:3,c,i,e)
21781 crystallite_li(1:3,1:3,c,i,e) = crystallite_subli0(1:3,1:3,c,i,e)
21791 crystallite_todo(c,i,e) = crystallite_substep(c,i,e) > num%subStepMinCryst
21796 if (crystallite_todo(c,i,e))
then
21797 crystallite_subf(1:3,1:3,c,i,e) = crystallite_subf0(1:3,1:3,c,i,e) &
21798 + crystallite_substep(c,i,e) *( crystallite_partionedf(1:3,1:3,c,i,e) &
21799 -crystallite_partionedf0(1:3,1:3,c,i,e))
21800 crystallite_fe(1:3,1:3,c,i,e) = matmul(matmul(crystallite_subf(1:3,1:3,c,i,e), &
21801 math_inv33(crystallite_fp(1:3,1:3,c,i,e))), &
21803 crystallite_subdt(c,i,e) = crystallite_substep(c,i,e) * crystallite_dt(c,i,e)
21804 crystallite_converged(c,i,e) = .false.
21809 enddo elementlooping3
21814 if (any(crystallite_todo))
call integratestate
21815 where(.not. crystallite_converged .and. crystallite_substep > num%subStepMinCryst) &
21816 crystallite_todo = .true.
21819 enddo cutbacklooping
21827 enddo elementlooping5
21838 c, & !< counter in integration point component loop
21839 i, & !< counter in integration point loop
21840 e, & !< counter in element loop
21844 real(pReal),
dimension(3,3) :: devNull, &
21845 invSubFp0,invSubFi0,invFp,invFi, &
21846 temp_33_1, temp_33_2, temp_33_3, temp_33_4
21847 real(pReal),
dimension(3,3,3,3) :: dSdFe, &
21859 real(pReal),
dimension(9,9):: temp_99
21870 crystallite_fe(1:3,1:3,c,i,e), &
21871 crystallite_fi(1:3,1:3,c,i,e),c,i,e)
21873 crystallite_s(1:3,1:3,c,i,e), &
21874 crystallite_fi(1:3,1:3,c,i,e), &
21877 invfp =
math_inv33(crystallite_fp(1:3,1:3,c,i,e))
21878 invfi =
math_inv33(crystallite_fi(1:3,1:3,c,i,e))
21879 invsubfp0 =
math_inv33(crystallite_subfp0(1:3,1:3,c,i,e))
21880 invsubfi0 =
math_inv33(crystallite_subfi0(1:3,1:3,c,i,e))
21885 lhs_3333 = 0.0_preal; rhs_3333 = 0.0_preal
21887 lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) &
21888 + crystallite_subdt(c,i,e)*matmul(invsubfi0,dlidfi(1:3,1:3,o,p))
21889 lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) &
21891 rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) &
21892 - crystallite_subdt(c,i,e)*matmul(invsubfi0,dlids(1:3,1:3,o,p))
21896 call io_warning(warning_id=600,el=e,ip=i,g=c, &
21897 ext_msg=
'inversion error in analytic tangent calculation')
21906 crystallite_s(1:3,1:3,c,i,e), &
21907 crystallite_fi(1:3,1:3,c,i,e),c,i,e)
21912 temp_33_1 = transpose(matmul(invfp,invfi))
21913 temp_33_2 = matmul(crystallite_subf(1:3,1:3,c,i,e),invsubfp0)
21914 temp_33_3 = matmul(matmul(crystallite_subf(1:3,1:3,c,i,e),invfp), invsubfi0)
21917 rhs_3333(p,o,1:3,1:3) = matmul(dsdfe(p,o,1:3,1:3),temp_33_1)
21918 temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dlpds(1:3,1:3,p,o)), invfi) &
21919 + matmul(temp_33_3,dlids(1:3,1:3,p,o))
21926 call io_warning(warning_id=600,el=e,ip=i,g=c, &
21927 ext_msg=
'inversion error in analytic tangent calculation')
21937 dfpinvdf(1:3,1:3,p,o) = -crystallite_subdt(c,i,e) &
21938 * matmul(invsubfp0, matmul(temp_3333(1:3,1:3,p,o),invfi))
21943 temp_33_1 = matmul(crystallite_s(1:3,1:3,c,i,e),transpose(invfp))
21944 temp_33_2 = matmul(invfp,temp_33_1)
21945 temp_33_3 = matmul(crystallite_subf(1:3,1:3,c,i,e),invfp)
21946 temp_33_4 = matmul(temp_33_3,crystallite_s(1:3,1:3,c,i,e))
21948 crystallite_dpdf(1:3,1:3,1:3,1:3,c,i,e) = 0.0_preal
21950 crystallite_dpdf(p,1:3,p,1:3,c,i,e) = transpose(temp_33_2)
21953 crystallite_dpdf(1:3,1:3,p,o,c,i,e) = crystallite_dpdf(1:3,1:3,p,o,c,i,e) &
21954 + matmul(matmul(crystallite_subf(1:3,1:3,c,i,e), &
21955 dfpinvdf(1:3,1:3,p,o)),temp_33_1) &
21956 + matmul(matmul(temp_33_3,dsdf(1:3,1:3,p,o)), &
21957 transpose(invfp)) &
21958 + matmul(temp_33_4,transpose(dfpinvdf(1:3,1:3,p,o)))
21962 enddo elementlooping
21974 c, & !< counter in integration point component loop
21975 i, & !< counter in integration point loop
21982 call crystallite_orientation(c,i,e)%fromMatrix(transpose(
math_rotationalpart(crystallite_fe(1:3,1:3,c,i,e))))
21983 enddo; enddo;
enddo
21991 call plastic_nonlocal_updatecompatibility(crystallite_orientation, &
21995 endif nonlocalpresent
22006 real(
preal),
dimension(3,3),
intent(in) :: tensor33
22007 real(
preal),
dimension(3,3) :: t
22008 integer,
intent(in):: &
22014 transpose(
math_inv33(crystallite_subf(1:3,1:3,ipc,ip,el))))
22026 real(pReal),
allocatable,
dimension(:,:,:) :: selected_tensors
22027 type(
rotation),
allocatable,
dimension(:) :: selected_rotations
22028 character(len=pStringLen) :: group,structureLabel
22031 group = trim(
'current/constituent')//
'/'//trim(
config_name_phase(p))//
'/generic'
22035 do o = 1,
size(output_constituent(p)%label)
22036 select case (output_constituent(p)%label(o))
22040 'deformation gradient',
'1')
22044 'elastic deformation gradient',
'1')
22048 'plastic deformation gradient',
'1')
22052 'inelastic deformation gradient',
'1')
22056 'plastic velocity gradient',
'1/s')
22060 'inelastic velocity gradient',
'1/s')
22064 'First Piola-Kirchoff stress',
'Pa')
22068 'Second Piola-Kirchoff stress',
'Pa')
22069 case(
'orientation')
22072 structurelabel =
'iso'
22074 structurelabel =
'fcc'
22076 structurelabel =
'bcc'
22078 structurelabel =
'bct'
22080 structurelabel =
'hex'
22082 structurelabel =
'ort'
22086 'crystal orientation as quaternion',structurelabel)
22098 integer,
intent(in) :: instance
22099 real(preal),
dimension(:,:,:,:,:),
intent(in) :: dataset
22125 integer,
intent(in) :: instance
22126 type(
rotation),
dimension(:,:,:),
intent(in) :: dataset
22155 integer,
intent(in):: el, &
22158 real(
preal),
optional,
intent(in) :: timefraction
22160 real(
preal),
dimension(3,3):: f, &
22185 real(
preal),
dimension(9) :: temp_9
22186 integer,
dimension(9) :: devnull_9
22187 real(
preal),
dimension(9,9) :: drlp_dlp, &
22189 real(
preal),
dimension(3,3,3,3):: ds_dfe, &
22198 real(
preal) steplengthlp, &
22204 integer niterationstresslp, &
22205 niterationstressli, &
22217 if (
present(timefraction))
then
22218 dt = crystallite_subdt(ipc,ip,el) * timefraction
22219 f = crystallite_subf0(1:3,1:3,ipc,ip,el) &
22220 + (crystallite_subf(1:3,1:3,ipc,ip,el) - crystallite_subf0(1:3,1:3,ipc,ip,el)) * timefraction
22222 dt = crystallite_subdt(ipc,ip,el)
22223 f = crystallite_subf(1:3,1:3,ipc,ip,el)
22226 lpguess = crystallite_lp(1:3,1:3,ipc,ip,el)
22227 liguess = crystallite_li(1:3,1:3,ipc,ip,el)
22229 call math_invert33(invfp_current,devnull,error,crystallite_subfp0(1:3,1:3,ipc,ip,el))
22231 call math_invert33(invfi_current,devnull,error,crystallite_subfi0(1:3,1:3,ipc,ip,el))
22234 a = matmul(f,invfp_current)
22237 steplengthli = 1.0_preal
22238 residuumli_old = 0.0_preal
22239 liguess_old = liguess
22241 niterationstressli = 0
22243 niterationstressli = niterationstressli + 1
22244 if (niterationstressli>num%nStress)
return
22246 invfi_new = matmul(invfi_current,
math_i3 - dt*liguess)
22250 steplengthlp = 1.0_preal
22251 residuumlp_old = 0.0_preal
22252 lpguess_old = lpguess
22254 niterationstresslp = 0
22256 niterationstresslp = niterationstresslp + 1
22257 if (niterationstresslp>num%nStress)
return
22260 fe = matmul(matmul(a,b), invfi_new)
22262 fe, fi_new, ipc, ip, el)
22265 s, fi_new, ipc, ip, el)
22268 atol_lp = max(num%rtol_crystalliteStress * max(norm2(lpguess),norm2(lp_constitutive)), &
22269 num%atol_crystalliteStress)
22270 residuumlp = lpguess - lp_constitutive
22272 if (any(ieee_is_nan(residuumlp)))
then
22274 elseif (norm2(residuumlp) < atol_lp)
then
22276 elseif (niterationstresslp == 1 .or. norm2(residuumlp) < norm2(residuumlp_old))
then
22277 residuumlp_old = residuumlp
22278 lpguess_old = lpguess
22279 steplengthlp = 1.0_preal
22281 steplengthlp = num%subStepSizeLp * steplengthlp
22282 lpguess = lpguess_old &
22283 + deltalp * steplengthlp
22288 if (mod(jacocounterlp, num%iJacoLpresiduum) == 0)
then
22289 jacocounterlp = jacocounterlp + 1
22292 dfe_dlp(o,1:3,p,1:3) = a(o,p)*transpose(invfi_new)
22294 dfe_dlp = - dt * dfe_dlp
22298 call dgesv(9,1,drlp_dlp,9,devnull_9,temp_9,9,ierr)
22299 if (ierr /= 0)
return
22303 lpguess = lpguess &
22304 + deltalp * steplengthlp
22308 s, fi_new, ipc, ip, el)
22311 atol_li = max(num%rtol_crystalliteStress * max(norm2(liguess),norm2(li_constitutive)), &
22312 num%atol_crystalliteStress)
22313 residuumli = liguess - li_constitutive
22314 if (any(ieee_is_nan(residuumli)))
then
22316 elseif (norm2(residuumli) < atol_li)
then
22318 elseif (niterationstressli == 1 .or. norm2(residuumli) < norm2(residuumli_old))
then
22319 residuumli_old = residuumli
22320 liguess_old = liguess
22321 steplengthli = 1.0_preal
22323 steplengthli = num%subStepSizeLi * steplengthli
22324 liguess = liguess_old &
22325 + deltali * steplengthli
22330 if (mod(jacocounterli, num%iJacoLpresiduum) == 0)
then
22331 jacocounterli = jacocounterli + 1
22333 temp_33 = matmul(matmul(a,b),invfi_current)
22335 dfe_dli(1:3,o,1:3,p) = -dt*
math_i3(o,p)*temp_33
22336 dfi_dli(1:3,o,1:3,p) = -dt*
math_i3(o,p)*invfi_current
22339 dfi_dli(1:3,1:3,o,p) = matmul(matmul(fi_new,dfi_dli(1:3,1:3,o,p)),fi_new)
22346 call dgesv(9,1,drli_dli,9,devnull_9,temp_9,9,ierr)
22347 if (ierr /= 0)
return
22351 liguess = liguess &
22352 + deltali * steplengthli
22355 invfp_new = matmul(invfp_current,b)
22358 fp_new = fp_new /
math_det33(fp_new)**(1.0_preal/3.0_preal)
22359 fe_new = matmul(matmul(f,invfp_new),invfi_new)
22362 crystallite_p(1:3,1:3,ipc,ip,el) = matmul(matmul(f,invfp_new),matmul(s,transpose(invfp_new)))
22363 crystallite_s(1:3,1:3,ipc,ip,el) = s
22364 crystallite_lp(1:3,1:3,ipc,ip,el) = lpguess
22365 crystallite_li(1:3,1:3,ipc,ip,el) = liguess
22366 crystallite_fp(1:3,1:3,ipc,ip,el) = fp_new
22367 crystallite_fi(1:3,1:3,ipc,ip,el) = fi_new
22368 crystallite_fe(1:3,1:3,ipc,ip,el) = fe_new
22380 NiterationState, & !< number of iterations in state loop
22381 e, & !< element index in element loop
22382 i, & !< integration point index in ip loop
22383 g, & !< grain index in grain loop
22390 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState) :: &
22392 real(pReal),
dimension(constitutive_source_maxSizeDotState) :: &
22397 nonlocalbroken = .false.
22402 if(crystallite_todo(g,i,e) .and. (.not. nonlocalbroken .or. crystallite_localplasticity(g,i,e)) )
then
22407 crystallite_partionedf0, &
22408 crystallite_fi(1:3,1:3,g,i,e), &
22409 crystallite_partionedfp0, &
22410 crystallite_subdt(g,i,e), g,i,e)
22411 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(
plasticstate(p)%dotState(:,c)))
22413 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(
sourcestate(p)%p(s)%dotState(:,c)))
22415 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22416 nonlocalbroken = .true.
22417 if(.not. crystallite_todo(g,i,e)) cycle
22422 * crystallite_subdt(g,i,e)
22426 +
sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22427 * crystallite_subdt(g,i,e)
22430 iteration:
do niterationstate = 1, num%nState
22434 niterationstate > 1)
22439 niterationstate > 1)
22444 crystallite_fp(1:3,1:3,g,i,e), &
22448 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22449 nonlocalbroken = .true.
22450 if(.not. crystallite_todo(g,i,e))
exit iteration
22453 crystallite_partionedf0, &
22454 crystallite_fi(1:3,1:3,g,i,e), &
22455 crystallite_partionedfp0, &
22456 crystallite_subdt(g,i,e), g,i,e)
22457 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(
plasticstate(p)%dotState(:,c)))
22459 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(
sourcestate(p)%p(s)%dotState(:,c)))
22461 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22462 nonlocalbroken = .true.
22463 if(.not. crystallite_todo(g,i,e))
exit iteration
22470 +
plasticstate(p)%previousDotState(:,c) * (1.0_preal - zeta)
22471 residuum_plastic(1:sizedotstate) =
plasticstate(p)%state (1:sizedotstate,c) &
22474 * crystallite_subdt(g,i,e)
22476 - residuum_plastic(1:sizedotstate)
22477 crystallite_converged(g,i,e) =
converged(residuum_plastic(1:sizedotstate), &
22486 +
sourcestate(p)%p(s)%previousDotState(:,c)* (1.0_preal - zeta)
22487 residuum_source(1:sizedotstate) =
sourcestate(p)%p(s)%state (1:sizedotstate,c) &
22488 -
sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22489 -
sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22490 * crystallite_subdt(g,i,e)
22492 - residuum_source(1:sizedotstate)
22493 crystallite_converged(g,i,e) = &
22494 crystallite_converged(g,i,e) .and.
converged(residuum_source(1:sizedotstate), &
22499 if(crystallite_converged(g,i,e))
then
22500 crystallite_todo(g,i,e) =
statejump(g,i,e)
22501 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22502 nonlocalbroken = .true.
22509 enddo; enddo;
enddo
22512 if(nonlocalbroken)
where(.not. crystallite_localplasticity) crystallite_todo = .false.
22520 real(pReal)
pure function damper(current,previous,previous2)
22522 real(preal),
dimension(:),
intent(in) ::&
22523 current, previous, previous2
22525 real(preal) :: dot_prod12, dot_prod22
22527 dot_prod12 = dot_product(current - previous, previous - previous2)
22528 dot_prod22 = dot_product(previous - previous2, previous - previous2)
22529 if ((dot_product(current,previous) < 0.0_preal .or. dot_prod12 < 0.0_preal) .and. dot_prod22 > 0.0_preal)
then
22530 damper = 0.75_preal + 0.25_preal * tanh(2.0_preal + 4.0_preal * dot_prod12 / dot_prod22)
22546 e, & !< element index in element loop
22547 i, & !< integration point index in ip loop
22548 g, & !< grain index in grain loop
22556 nonlocalbroken = .false.
22558 do e = fesolving_execelem(1),fesolving_execelem(2)
22559 do i = fesolving_execip(1),fesolving_execip(2)
22560 do g = 1,homogenization_ngrains(material_homogenizationat(e))
22561 if(crystallite_todo(g,i,e) .and. (.not. nonlocalbroken .or. crystallite_localplasticity(g,i,e)) )
then
22563 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
22565 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22566 crystallite_partionedf0, &
22567 crystallite_fi(1:3,1:3,g,i,e), &
22568 crystallite_partionedfp0, &
22569 crystallite_subdt(g,i,e), g,i,e)
22570 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22571 do s = 1, phase_nsources(p)
22572 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22574 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22575 nonlocalbroken = .true.
22576 if(.not. crystallite_todo(g,i,e)) cycle
22578 sizedotstate = plasticstate(p)%sizeDotState
22579 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
22580 + plasticstate(p)%dotState (1:sizedotstate,c) &
22581 * crystallite_subdt(g,i,e)
22582 do s = 1, phase_nsources(p)
22583 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22584 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22585 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22586 * crystallite_subdt(g,i,e)
22589 crystallite_todo(g,i,e) =
statejump(g,i,e)
22590 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22591 nonlocalbroken = .true.
22592 if(.not. crystallite_todo(g,i,e)) cycle
22594 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
22595 crystallite_fp(1:3,1:3,g,i,e), &
22599 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22600 nonlocalbroken = .true.
22602 crystallite_converged(g,i,e) = crystallite_todo(g,i,e)
22605 enddo; enddo;
enddo
22608 if(nonlocalbroken)
where(.not. crystallite_localplasticity) crystallite_todo = .false.
22630 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState, &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
22632 real(pReal),
dimension(constitutive_source_maxSizeDotState,&
maxval(phase_Nsources), &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
22636 nonlocalbroken = .false.
22638 do e = fesolving_execelem(1),fesolving_execelem(2)
22639 do i = fesolving_execip(1),fesolving_execip(2)
22640 do g = 1,homogenization_ngrains(material_homogenizationat(e))
22641 if(crystallite_todo(g,i,e) .and. (.not. nonlocalbroken .or. crystallite_localplasticity(g,i,e)) )
then
22643 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
22645 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22646 crystallite_partionedf0, &
22647 crystallite_fi(1:3,1:3,g,i,e), &
22648 crystallite_partionedfp0, &
22649 crystallite_subdt(g,i,e), g,i,e)
22650 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22651 do s = 1, phase_nsources(p)
22652 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22654 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22655 nonlocalbroken = .true.
22656 if(.not. crystallite_todo(g,i,e)) cycle
22658 sizedotstate = plasticstate(p)%sizeDotState
22660 residuum_plastic(1:sizedotstate,g,i,e) = plasticstate(p)%dotstate(1:sizedotstate,c) &
22661 * (- 0.5_preal * crystallite_subdt(g,i,e))
22662 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
22663 + plasticstate(p)%dotstate(1:sizedotstate,c) * crystallite_subdt(g,i,e)
22664 do s = 1, phase_nsources(p)
22665 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22667 residuum_source(1:sizedotstate,s,g,i,e) = sourcestate(p)%p(s)%dotstate(1:sizedotstate,c) &
22668 * (- 0.5_preal * crystallite_subdt(g,i,e))
22669 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22670 + sourcestate(p)%p(s)%dotstate(1:sizedotstate,c) * crystallite_subdt(g,i,e)
22673 crystallite_todo(g,i,e) =
statejump(g,i,e)
22674 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22675 nonlocalbroken = .true.
22676 if(.not. crystallite_todo(g,i,e)) cycle
22678 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
22679 crystallite_fp(1:3,1:3,g,i,e), &
22683 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22684 nonlocalbroken = .true.
22685 if(.not. crystallite_todo(g,i,e)) cycle
22687 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22688 crystallite_partionedf0, &
22689 crystallite_fi(1:3,1:3,g,i,e), &
22690 crystallite_partionedfp0, &
22691 crystallite_subdt(g,i,e), g,i,e)
22692 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22693 do s = 1, phase_nsources(p)
22694 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22696 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22697 nonlocalbroken = .true.
22698 if(.not. crystallite_todo(g,i,e)) cycle
22701 sizedotstate = plasticstate(p)%sizeDotState
22703 residuum_plastic(1:sizedotstate,g,i,e) = residuum_plastic(1:sizedotstate,g,i,e) &
22704 + 0.5_preal * plasticstate(p)%dotState(:,c) * crystallite_subdt(g,i,e)
22706 crystallite_converged(g,i,e) =
converged(residuum_plastic(1:sizedotstate,g,i,e), &
22707 plasticstate(p)%state(1:sizedotstate,c), &
22708 plasticstate(p)%atol(1:sizedotstate))
22710 do s = 1, phase_nsources(p)
22711 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22713 residuum_source(1:sizedotstate,s,g,i,e) = &
22714 residuum_source(1:sizedotstate,s,g,i,e) + 0.5_preal * sourcestate(p)%p(s)%dotState(:,c) * crystallite_subdt(g,i,e)
22716 crystallite_converged(g,i,e) = &
22717 crystallite_converged(g,i,e) .and.
converged(residuum_source(1:sizedotstate,s,g,i,e), &
22718 sourcestate(p)%p(s)%state(1:sizedotstate,c), &
22719 sourcestate(p)%p(s)%atol(1:sizedotstate))
22723 enddo; enddo;
enddo
22736 real(pReal),
dimension(3,3),
parameter :: &
22738 0.5_preal, 0.0_preal, 0.0_preal, &
22739 0.0_preal, 0.5_preal, 0.0_preal, &
22740 0.0_preal, 0.0_preal, 1.0_preal], &
22742 real(pReal),
dimension(3),
parameter :: &
22743 CC = [0.5_preal, 0.5_preal, 1.0_preal]
22744 real(pReal),
dimension(4),
parameter :: &
22745 B = [1.0_preal/6.0_preal, 1.0_preal/3.0_preal, 1.0_preal/3.0_preal, 1.0_preal/6.0_preal]
22760 nonlocalbroken = .false.
22762 do e = fesolving_execelem(1),fesolving_execelem(2)
22763 do i = fesolving_execip(1),fesolving_execip(2)
22764 do g = 1,homogenization_ngrains(material_homogenizationat(e))
22765 if(crystallite_todo(g,i,e) .and. (.not. nonlocalbroken .or. crystallite_localplasticity(g,i,e)) )
then
22767 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
22769 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22770 crystallite_partionedf0, &
22771 crystallite_fi(1:3,1:3,g,i,e), &
22772 crystallite_partionedfp0, &
22773 crystallite_subdt(g,i,e), g,i,e)
22774 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22775 do s = 1, phase_nsources(p)
22776 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22778 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22779 nonlocalbroken = .true.
22780 if(.not. crystallite_todo(g,i,e)) cycle
22784 plasticstate(p)%RK4dotState(stage,:,c) = plasticstate(p)%dotState(:,c)
22785 plasticstate(p)%dotState(:,c) = a(1,stage) * plasticstate(p)%RK4dotState(1,:,c)
22786 do s = 1, phase_nsources(p)
22787 sourcestate(p)%p(s)%RK4dotState(stage,:,c) = sourcestate(p)%p(s)%dotState(:,c)
22788 sourcestate(p)%p(s)%dotState(:,c) = a(1,stage) * sourcestate(p)%p(s)%RK4dotState(1,:,c)
22792 plasticstate(p)%dotState(:,c) = plasticstate(p)%dotState(:,c) &
22793 + a(n,stage) * plasticstate(p)%RK4dotState(n,:,c)
22794 do s = 1, phase_nsources(p)
22795 sourcestate(p)%p(s)%dotState(:,c) = sourcestate(p)%p(s)%dotState(:,c) &
22796 + a(n,stage) * sourcestate(p)%p(s)%RK4dotState(n,:,c)
22800 sizedotstate = plasticstate(p)%sizeDotState
22801 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
22802 + plasticstate(p)%dotState (1:sizedotstate,c) &
22803 * crystallite_subdt(g,i,e)
22804 do s = 1, phase_nsources(p)
22805 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22806 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22807 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22808 * crystallite_subdt(g,i,e)
22811 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
22812 crystallite_fp(1:3,1:3,g,i,e), &
22816 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22817 nonlocalbroken = .true.
22818 if(.not. crystallite_todo(g,i,e))
exit
22820 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22821 crystallite_partionedf0, &
22822 crystallite_fi(1:3,1:3,g,i,e), &
22823 crystallite_partionedfp0, &
22824 crystallite_subdt(g,i,e)*cc(stage), g,i,e)
22825 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22826 do s = 1, phase_nsources(p)
22827 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22829 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22830 nonlocalbroken = .true.
22831 if(.not. crystallite_todo(g,i,e))
exit
22835 if(.not. crystallite_todo(g,i,e)) cycle
22837 sizedotstate = plasticstate(p)%sizeDotState
22839 plasticstate(p)%RK4dotState(4,:,c) = plasticstate(p)%dotState(:,c)
22841 plasticstate(p)%dotState(:,c) = matmul(b,plasticstate(p)%RK4dotState(1:4,1:sizedotstate,c))
22842 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
22843 + plasticstate(p)%dotState (1:sizedotstate,c) &
22844 * crystallite_subdt(g,i,e)
22846 do s = 1, phase_nsources(p)
22847 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22849 sourcestate(p)%p(s)%RK4dotState(4,:,c) = sourcestate(p)%p(s)%dotState(:,c)
22851 sourcestate(p)%p(s)%dotState(:,c) = matmul(b,sourcestate(p)%p(s)%RK4dotState(1:4,1:sizedotstate,c))
22852 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22853 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22854 * crystallite_subdt(g,i,e)
22857 crystallite_todo(g,i,e) =
statejump(g,i,e)
22858 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22859 nonlocalbroken = .true.
22860 if(.not. crystallite_todo(g,i,e)) cycle
22862 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
22863 crystallite_fp(1:3,1:3,g,i,e), &
22866 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22867 nonlocalbroken = .true.
22868 if(.not. crystallite_todo(g,i,e)) cycle
22871 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22872 nonlocalbroken = .true.
22873 crystallite_converged(g,i,e) = crystallite_todo(g,i,e)
22876 enddo; enddo;
enddo
22879 if(nonlocalbroken)
where(.not. crystallite_localplasticity) crystallite_todo = .false.
22891 real(pReal),
dimension(5,5),
parameter :: &
22893 .2_preal, .075_preal, .3_preal, -11.0_preal/54.0_preal, 1631.0_preal/55296.0_preal, &
22894 .0_preal, .225_preal, -.9_preal, 2.5_preal, 175.0_preal/512.0_preal, &
22895 .0_preal, .0_preal, 1.2_preal, -70.0_preal/27.0_preal, 575.0_preal/13824.0_preal, &
22896 .0_preal, .0_preal, .0_preal, 35.0_preal/27.0_preal, 44275.0_preal/110592.0_preal, &
22897 .0_preal, .0_preal, .0_preal, .0_preal, 253.0_preal/4096.0_preal], &
22898 [5,5], order=[2,1])
22900 real(pReal),
dimension(6),
parameter :: &
22902 [37.0_preal/378.0_preal, .0_preal, 250.0_preal/621.0_preal, &
22903 125.0_preal/594.0_preal, .0_preal, 512.0_preal/1771.0_preal], &
22905 [2825.0_preal/27648.0_preal, .0_preal, 18575.0_preal/48384.0_preal,&
22906 13525.0_preal/55296.0_preal, 277.0_preal/14336.0_preal, 0.25_preal]
22908 real(pReal),
dimension(5),
parameter :: &
22909 CC = [0.2_preal, 0.3_preal, 0.6_preal, 1.0_preal, 0.875_preal]
22924 real(pReal),
dimension(constitutive_plasticity_maxSizeDotState, &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
22926 real(pReal),
dimension(constitutive_source_maxSizeDotState, &
maxval(phase_Nsources), &
homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: &
22930 nonlocalbroken = .false.
22932 do e = fesolving_execelem(1),fesolving_execelem(2)
22933 do i = fesolving_execip(1),fesolving_execip(2)
22934 do g = 1,homogenization_ngrains(material_homogenizationat(e))
22935 if(crystallite_todo(g,i,e) .and. (.not. nonlocalbroken .or. crystallite_localplasticity(g,i,e)) )
then
22937 p = material_phaseat(g,e); c = material_phasememberat(g,i,e)
22939 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22940 crystallite_partionedf0, &
22941 crystallite_fi(1:3,1:3,g,i,e), &
22942 crystallite_partionedfp0, &
22943 crystallite_subdt(g,i,e), g,i,e)
22944 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22945 do s = 1, phase_nsources(p)
22946 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22948 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22949 nonlocalbroken = .true.
22950 if(.not. crystallite_todo(g,i,e)) cycle
22954 plasticstate(p)%RKCK45dotState(stage,:,c) = plasticstate(p)%dotState(:,c)
22955 plasticstate(p)%dotState(:,c) = a(1,stage) * plasticstate(p)%RKCK45dotState(1,:,c)
22956 do s = 1, phase_nsources(p)
22957 sourcestate(p)%p(s)%RKCK45dotState(stage,:,c) = sourcestate(p)%p(s)%dotState(:,c)
22958 sourcestate(p)%p(s)%dotState(:,c) = a(1,stage) * sourcestate(p)%p(s)%RKCK45dotState(1,:,c)
22962 plasticstate(p)%dotState(:,c) = plasticstate(p)%dotState(:,c) &
22963 + a(n,stage) * plasticstate(p)%RKCK45dotState(n,:,c)
22964 do s = 1, phase_nsources(p)
22965 sourcestate(p)%p(s)%dotState(:,c) = sourcestate(p)%p(s)%dotState(:,c) &
22966 + a(n,stage) * sourcestate(p)%p(s)%RKCK45dotState(n,:,c)
22970 sizedotstate = plasticstate(p)%sizeDotState
22971 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
22972 + plasticstate(p)%dotState (1:sizedotstate,c) &
22973 * crystallite_subdt(g,i,e)
22974 do s = 1, phase_nsources(p)
22975 sizedotstate = sourcestate(p)%p(s)%sizeDotState
22976 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
22977 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
22978 * crystallite_subdt(g,i,e)
22981 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
22982 crystallite_fp(1:3,1:3,g,i,e), &
22986 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
22987 nonlocalbroken = .true.
22988 if(.not. crystallite_todo(g,i,e))
exit
22990 call constitutive_collectdotstate(crystallite_s(1:3,1:3,g,i,e), &
22991 crystallite_partionedf0, &
22992 crystallite_fi(1:3,1:3,g,i,e), &
22993 crystallite_partionedfp0, &
22994 crystallite_subdt(g,i,e)*cc(stage), g,i,e)
22995 crystallite_todo(g,i,e) = all(.not. ieee_is_nan(plasticstate(p)%dotState(:,c)))
22996 do s = 1, phase_nsources(p)
22997 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. ieee_is_nan(sourcestate(p)%p(s)%dotState(:,c)))
22999 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
23000 nonlocalbroken = .true.
23001 if(.not. crystallite_todo(g,i,e))
exit
23005 if(.not. crystallite_todo(g,i,e)) cycle
23007 sizedotstate = plasticstate(p)%sizeDotState
23009 plasticstate(p)%RKCK45dotState(6,:,c) = plasticstate(p)%dotState(:,c)
23010 residuum_plastic(1:sizedotstate,g,i,e) = matmul(db,plasticstate(p)%RKCK45dotState(1:6,1:sizedotstate,c)) &
23011 * crystallite_subdt(g,i,e)
23012 plasticstate(p)%dotState(:,c) = matmul(b,plasticstate(p)%RKCK45dotState(1:6,1:sizedotstate,c))
23013 plasticstate(p)%state(1:sizedotstate,c) = plasticstate(p)%subState0(1:sizedotstate,c) &
23014 + plasticstate(p)%dotState (1:sizedotstate,c) &
23015 * crystallite_subdt(g,i,e)
23016 crystallite_todo(g,i,e) =
converged(residuum_plastic(1:sizedotstate,g,i,e), &
23017 plasticstate(p)%state(1:sizedotstate,c), &
23018 plasticstate(p)%atol(1:sizedotstate))
23020 do s = 1, phase_nsources(p)
23021 sizedotstate = sourcestate(p)%p(s)%sizeDotState
23023 sourcestate(p)%p(s)%RKCK45dotState(6,:,c) = sourcestate(p)%p(s)%dotState(:,c)
23024 residuum_source(1:sizedotstate,s,g,i,e) = matmul(db,sourcestate(p)%p(s)%RKCK45dotState(1:6,1:sizedotstate,c)) &
23025 * crystallite_subdt(g,i,e)
23026 sourcestate(p)%p(s)%dotState(:,c) = matmul(b,sourcestate(p)%p(s)%RKCK45dotState(1:6,1:sizedotstate,c))
23027 sourcestate(p)%p(s)%state(1:sizedotstate,c) = sourcestate(p)%p(s)%subState0(1:sizedotstate,c) &
23028 + sourcestate(p)%p(s)%dotState (1:sizedotstate,c) &
23029 * crystallite_subdt(g,i,e)
23030 crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. &
23031 converged(residuum_source(1:sizedotstate,s,g,i,e), &
23032 sourcestate(p)%p(s)%state(1:sizedotstate,c), &
23033 sourcestate(p)%p(s)%atol(1:sizedotstate))
23035 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
23036 nonlocalbroken = .true.
23037 if(.not. crystallite_todo(g,i,e)) cycle
23039 crystallite_todo(g,i,e) =
statejump(g,i,e)
23040 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
23041 nonlocalbroken = .true.
23042 if(.not. crystallite_todo(g,i,e)) cycle
23044 call constitutive_dependentstate(crystallite_partionedf(1:3,1:3,g,i,e), &
23045 crystallite_fp(1:3,1:3,g,i,e), &
23049 if(.not. (crystallite_todo(g,i,e) .or. crystallite_localplasticity(g,i,e))) &
23050 nonlocalbroken = .true.
23051 crystallite_converged(g,i,e) = crystallite_todo(g,i,e)
23054 enddo; enddo;
enddo
23057 if(nonlocalbroken)
where(.not. crystallite_localplasticity) crystallite_todo = .false.
23069 if (any(.not. crystallite_converged .and. .not. crystallite_localplasticity)) &
23070 where( .not. crystallite_localplasticity) crystallite_converged = .false.
23078 logical pure function converged(residuum,state,atol)
23080 real(pReal),
intent(in),
dimension(:) ::&
23081 residuum, state, atol
23085 rtol = num%rTol_crystalliteState
23087 converged = all(abs(residuum) <= max(atol, rtol*abs(state)))
23098 integer,
intent(in):: &
23110 c = material_phasememberat(ipc,ip,el)
23111 p = material_phaseat(ipc,el)
23113 call constitutive_collectdeltastate(crystallite_s(1:3,1:3,ipc,ip,el), &
23114 crystallite_fe(1:3,1:3,ipc,ip,el), &
23115 crystallite_fi(1:3,1:3,ipc,ip,el), &
23118 myoffset = plasticstate(p)%offsetDeltaState
23119 mysize = plasticstate(p)%sizeDeltaState
23121 if( any(ieee_is_nan(plasticstate(p)%deltaState(1:mysize,c))))
then
23126 plasticstate(p)%state(myoffset + 1:myoffset + mysize,c) = &
23127 plasticstate(p)%state(myoffset + 1:myoffset + mysize,c) + plasticstate(p)%deltaState(1:mysize,c)
23129 do mysource = 1, phase_nsources(p)
23130 myoffset = sourcestate(p)%p(mysource)%offsetDeltaState
23131 mysize = sourcestate(p)%p(mysource)%sizeDeltaState
23132 if (any(ieee_is_nan(sourcestate(p)%p(mysource)%deltaState(1:mysize,c))))
then
23136 sourcestate(p)%p(mysource)%state(myoffset + 1: myoffset + mysize,c) = &
23137 sourcestate(p)%p(mysource)%state(myoffset + 1: myoffset + mysize,c) + sourcestate(p)%p(mysource)%deltaState(1:mysize,c)
23152 integer(HID_T) :: filehandle, grouphandle
23153 character(len=pStringLen) :: filename, datasetname
23155 write(6,
'(a)')
' writing field and constitutive data required for restart to file';
flush(6)
23157 write(filename,
'(a,i0,a)') trim(getsolverjobname())//
'_',worldrank,
'.hdf5'
23158 filehandle = hdf5_openfile(filename,
'a')
23160 call hdf5_write(filehandle,crystallite_partionedf,
'F')
23161 call hdf5_write(filehandle,crystallite_fp,
'Fp')
23162 call hdf5_write(filehandle,crystallite_fi,
'Fi')
23163 call hdf5_write(filehandle,crystallite_lp,
'Lp')
23164 call hdf5_write(filehandle,crystallite_li,
'Li')
23165 call hdf5_write(filehandle,crystallite_s,
'S')
23167 grouphandle = hdf5_addgroup(filehandle,
'constituent')
23168 do i = 1,
size(phase_plasticity)
23169 write(datasetname,
'(i0,a)') i,
'_omega_plastic'
23170 call hdf5_write(grouphandle,plasticstate(i)%state,datasetname)
23172 call hdf5_closegroup(grouphandle)
23174 grouphandle = hdf5_addgroup(filehandle,
'materialpoint')
23175 do i = 1, material_nhomogenization
23176 write(datasetname,
'(i0,a)') i,
'_omega_homogenization'
23177 call hdf5_write(grouphandle,homogstate(i)%state,datasetname)
23179 call hdf5_closegroup(grouphandle)
23181 call hdf5_closefile(filehandle)
23193 integer(HID_T) :: fileHandle, groupHandle
23194 character(len=pStringLen) :: fileName, datasetName
23196 write(6,
'(/,a,i0,a)')
' reading restart information of increment from file'
23198 write(filename,
'(a,i0,a)') trim(getsolverjobname())//
'_',worldrank,
'.hdf5'
23199 filehandle = hdf5_openfile(filename)
23201 call hdf5_read(filehandle,crystallite_f0,
'F')
23202 call hdf5_read(filehandle,crystallite_fp0,
'Fp')
23203 call hdf5_read(filehandle,crystallite_fi0,
'Fi')
23204 call hdf5_read(filehandle,crystallite_lp0,
'Lp')
23205 call hdf5_read(filehandle,crystallite_li0,
'Li')
23206 call hdf5_read(filehandle,crystallite_s0,
'S')
23208 grouphandle = hdf5_opengroup(filehandle,
'constituent')
23209 do i = 1,
size(phase_plasticity)
23210 write(datasetname,
'(i0,a)') i,
'_omega_plastic'
23211 call hdf5_read(grouphandle,plasticstate(i)%state0,datasetname)
23213 call hdf5_closegroup(grouphandle)
23215 grouphandle = hdf5_opengroup(filehandle,
'materialpoint')
23216 do i = 1, material_nhomogenization
23217 write(datasetname,
'(i0,a)') i,
'_omega_homogenization'
23218 call hdf5_read(grouphandle,homogstate(i)%state0,datasetname)
23220 call hdf5_closegroup(grouphandle)
23222 call hdf5_closefile(filehandle)
23235 crystallite_f0 = crystallite_partionedf
23236 crystallite_fp0 = crystallite_fp
23237 crystallite_lp0 = crystallite_lp
23238 crystallite_fi0 = crystallite_fi
23239 crystallite_li0 = crystallite_li
23240 crystallite_s0 = crystallite_s
23242 do i = 1,
size(plasticstate)
23243 plasticstate(i)%state0 = plasticstate(i)%state
23245 do i = 1,
size(sourcestate)
23246 do j = 1,phase_nsources(i)
23247 sourcestate(i)%p(j)%state0 = sourcestate(i)%p(j)%state
23249 do i = 1, material_nhomogenization
23250 homogstate(i)%state0 = homogstate(i)%state
23251 thermalstate(i)%state0 = thermalstate(i)%state
23252 damagestate(i)%state0 = damagestate(i)%state
23257 end module crystallite
23258 # 45 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
23260 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/thermal_isothermal.f90" 1
23279 integer :: h,NofMyHomog
23302 # 46 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
23304 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/thermal_adiabatic.f90" 1
23324 character(len=pStringLen),
allocatable,
dimension(:) :: &
23328 type(tparameters),
dimension(:),
allocatable :: &
23348 integer :: maxninstance,h,nofmyhomog
23353 if (maxninstance == 0)
return
23355 allocate(param(maxninstance))
23386 integer,
intent(in) :: &
23387 ip, & !< integration point number
23389 real(preal),
intent(in) :: &
23392 logical,
dimension(2) :: &
23400 homog = material_homogenizationat(el)
23401 offset = material_homogenizationmemberat(ip,el)
23403 t = thermalstate(homog)%subState0(1,offset)
23408 <= err_thermal_tolabs &
23409 .or. abs(t - thermalstate(homog)%state(1,offset)) &
23410 <= err_thermal_tolrel*abs(thermalstate(homog)%state(1,offset)), &
23413 temperature(homog)%p(thermalmapping(homog)%p(ip,el)) = t
23414 temperaturerate(homog)%p(thermalmapping(homog)%p(ip,el)) = &
23415 (thermalstate(homog)%state(1,offset) - thermalstate(homog)%subState0(1,offset))/(subdt+tiny(0.0_preal))
23425 integer,
intent(in) :: &
23426 ip, & !< integration point number
23428 real(preal),
intent(in) :: &
23430 real(preal),
intent(out) :: &
23434 my_tdot, my_dtdot_dt
23443 homog = material_homogenizationat(el)
23444 instance = thermal_typeinstance(homog)
23447 dtdot_dt = 0.0_preal
23448 do grain = 1, homogenization_ngrains(homog)
23449 phase = material_phaseat(grain,el)
23450 constituent = material_phasememberat(grain,ip,el)
23451 do source = 1, phase_nsources(phase)
23452 select case(phase_source(source,phase))
23453 case (source_thermal_dissipation_id)
23454 call source_thermal_dissipation_getrateanditstangent(my_tdot, my_dtdot_dt, &
23455 crystallite_s(1:3,1:3,grain,ip,el), &
23456 crystallite_lp(1:3,1:3,grain,ip,el), &
23459 case (source_thermal_externalheat_id)
23460 call source_thermal_externalheat_getrateanditstangent(my_tdot, my_dtdot_dt, &
23461 phase, constituent)
23464 my_tdot = 0.0_preal
23465 my_dtdot_dt = 0.0_preal
23467 tdot = tdot + my_tdot
23468 dtdot_dt = dtdot_dt + my_dtdot_dt
23472 tdot = tdot/real(homogenization_ngrains(homog),preal)
23473 dtdot_dt = dtdot_dt/real(homogenization_ngrains(homog),preal)
23483 integer,
intent(in) :: &
23484 ip, & !< integration point number
23494 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23496 + lattice_specificheat(material_phaseat(grain,el))
23500 / real(homogenization_ngrains(material_homogenizationat(el)),preal)
23510 integer,
intent(in) :: &
23511 ip, & !< integration point number
23520 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23522 + lattice_massdensity(material_phaseat(grain,el))
23526 / real(homogenization_ngrains(material_homogenizationat(el)),preal)
23536 integer,
intent(in) :: homog
23537 character(len=*),
intent(in) :: group
23541 associate(prm =>
param(damage_typeinstance(homog)))
23542 outputsloop:
do o = 1,
size(prm%output)
23543 select case(trim(prm%output(o)))
23544 case(
'temperature')
23545 call results_writedataset(group,temperature(homog)%p,
'T',&
23554 # 47 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
23556 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/thermal_conduction.f90" 1
23575 character(len=pStringLen),
allocatable,
dimension(:) :: &
23579 type(tparameters),
dimension(:),
allocatable :: &
23600 integer :: ninstance,nofmyhomog,h
23605 allocate(param(ninstance))
23636 integer,
intent(in) :: &
23637 ip, & !< integration point number
23639 real(preal),
intent(in) :: &
23641 real(preal),
intent(out) :: &
23644 my_tdot, my_dtdot_dt
23654 homog = material_homogenizationat(el)
23655 offset = material_homogenizationmemberat(ip,el)
23656 instance = thermal_typeinstance(homog)
23659 dtdot_dt = 0.0_preal
23660 do grain = 1, homogenization_ngrains(homog)
23661 phase = material_phaseat(grain,el)
23662 constituent = material_phasememberat(grain,ip,el)
23663 do source = 1, phase_nsources(phase)
23664 select case(phase_source(source,phase))
23665 case (source_thermal_dissipation_id)
23666 call source_thermal_dissipation_getrateanditstangent(my_tdot, my_dtdot_dt, &
23667 crystallite_s(1:3,1:3,grain,ip,el), &
23668 crystallite_lp(1:3,1:3,grain,ip,el), &
23671 case (source_thermal_externalheat_id)
23672 call source_thermal_externalheat_getrateanditstangent(my_tdot, my_dtdot_dt, &
23673 phase, constituent)
23675 my_tdot = 0.0_preal
23676 my_dtdot_dt = 0.0_preal
23679 tdot = tdot + my_tdot
23680 dtdot_dt = dtdot_dt + my_dtdot_dt
23684 tdot = tdot/real(homogenization_ngrains(homog),preal)
23685 dtdot_dt = dtdot_dt/real(homogenization_ngrains(homog),preal)
23695 integer,
intent(in) :: &
23696 ip, & !< integration point number
23698 real(preal),
dimension(3,3) :: &
23705 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23711 / real(homogenization_ngrains(material_homogenizationat(el)),preal)
23721 integer,
intent(in) :: &
23722 ip, & !< integration point number
23731 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23733 + lattice_specificheat(material_phaseat(grain,el))
23737 / real(homogenization_ngrains(material_homogenizationat(el)),preal)
23747 integer,
intent(in) :: &
23748 ip, & !< integration point number
23758 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23760 + lattice_massdensity(material_phaseat(grain,el))
23764 / real(homogenization_ngrains(material_homogenizationat(el)),preal)
23774 integer,
intent(in) :: &
23775 ip, & !< integration point number
23777 real(preal),
intent(in) :: &
23784 homog = material_homogenizationat(el)
23785 offset = thermalmapping(homog)%p(ip,el)
23786 temperature(homog)%p(offset) = t
23787 temperaturerate(homog)%p(offset) = tdot
23797 integer,
intent(in) :: homog
23798 character(len=*),
intent(in) :: group
23802 associate(prm =>
param(damage_typeinstance(homog)))
23803 outputsloop:
do o = 1,
size(prm%output)
23804 select case(trim(prm%output(o)))
23805 case(
'temperature')
23806 call results_writedataset(group,temperature(homog)%p,
'T',&
23815 # 48 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
23817 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/damage_none.f90" 1
23836 integer :: h,NofMyHomog
23857 # 49 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
23859 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/damage_local.f90" 1
23879 character(len=pStringLen),
allocatable,
dimension(:) :: &
23883 type(tparameters),
dimension(:),
allocatable :: &
23899 integer :: ninstance,nofmyhomog,h
23904 allocate(param(ninstance))
23934 integer,
intent(in) :: &
23935 ip, & !< integration point number
23937 real(preal),
intent(in) :: &
23939 logical,
dimension(2) :: &
23945 phi, phidot, dphidot_dphi
23947 homog = material_homogenizationat(el)
23948 offset = material_homogenizationmemberat(ip,el)
23949 phi = damagestate(homog)%subState0(1,offset)
23951 phi = max(residualstiffness,min(1.0_preal,phi + subdt*phidot))
23954 <= err_damage_tolabs &
23955 .or. abs(phi - damagestate(homog)%state(1,offset)) &
23956 <= err_damage_tolrel*abs(damagestate(homog)%state(1,offset)), &
23959 damagestate(homog)%state(1,offset) = phi
23969 integer,
intent(in) :: &
23970 ip, & !< integration point number
23972 real(preal),
intent(in) :: &
23980 phiDot, dPhiDot_dPhi, localphiDot, dLocalphiDot_dPhi
23983 dphidot_dphi = 0.0_preal
23984 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
23985 phase = material_phaseat(grain,el)
23986 constituent = material_phasememberat(grain,ip,el)
23987 do source = 1, phase_nsources(phase)
23988 select case(phase_source(source,phase))
23989 case (source_damage_isobrittle_id)
23990 call source_damage_isobrittle_getrateanditstangent (localphidot, dlocalphidot_dphi, phi, phase, constituent)
23992 case (source_damage_isoductile_id)
23993 call source_damage_isoductile_getrateanditstangent (localphidot, dlocalphidot_dphi, phi, phase, constituent)
23995 case (source_damage_anisobrittle_id)
23996 call source_damage_anisobrittle_getrateanditstangent(localphidot, dlocalphidot_dphi, phi, phase, constituent)
23998 case (source_damage_anisoductile_id)
23999 call source_damage_anisoductile_getrateanditstangent(localphidot, dlocalphidot_dphi, phi, phase, constituent)
24002 localphidot = 0.0_preal
24003 dlocalphidot_dphi = 0.0_preal
24006 phidot = phidot + localphidot
24007 dphidot_dphi = dphidot_dphi + dlocalphidot_dphi
24011 phidot = phidot/real(homogenization_ngrains(material_homogenizationat(el)),preal)
24012 dphidot_dphi = dphidot_dphi/real(homogenization_ngrains(material_homogenizationat(el)),preal)
24022 integer,
intent(in) :: homog
24023 character(len=*),
intent(in) :: group
24027 associate(prm =>
param(damage_typeinstance(homog)))
24028 outputsloop:
do o = 1,
size(prm%output)
24029 select case(prm%output(o))
24031 call results_writedataset(group,damage(homog)%p,
'phi',&
24032 'damage indicator',
'-')
24041 # 50 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
24043 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/damage_nonlocal.f90" 1
24065 character(len=pStringLen),
allocatable,
dimension(:) :: &
24069 type(tparameters),
dimension(:),
allocatable :: &
24088 integer :: ninstance,nofmyhomog,h
24093 allocate(param(ninstance))
24123 integer,
intent(in) :: &
24124 ip, & !< integration point number
24126 real(preal),
intent(in) :: &
24134 phidot, dphidot_dphi, localphidot, dlocalphidot_dphi
24137 dphidot_dphi = 0.0_preal
24138 do grain = 1, homogenization_ngrains(material_homogenizationat(el))
24139 phase = material_phaseat(grain,el)
24140 constituent = material_phasememberat(grain,ip,el)
24141 do source = 1, phase_nsources(phase)
24142 select case(phase_source(source,phase))
24143 case (source_damage_isobrittle_id)
24144 call source_damage_isobrittle_getrateanditstangent (localphidot, dlocalphidot_dphi, phi, phase, constituent)
24146 case (source_damage_isoductile_id)
24147 call source_damage_isoductile_getrateanditstangent (localphidot, dlocalphidot_dphi, phi, phase, constituent)
24149 case (source_damage_anisobrittle_id)
24150 call source_damage_anisobrittle_getrateanditstangent(localphidot, dlocalphidot_dphi, phi, phase, constituent)
24152 case (source_damage_anisoductile_id)
24153 call source_damage_anisoductile_getrateanditstangent(localphidot, dlocalphidot_dphi, phi, phase, constituent)
24156 localphidot = 0.0_preal
24157 dlocalphidot_dphi = 0.0_preal
24160 phidot = phidot + localphidot
24161 dphidot_dphi = dphidot_dphi + dlocalphidot_dphi
24165 phidot = phidot/real(homogenization_ngrains(material_homogenizationat(el)),preal)
24166 dphidot_dphi = dphidot_dphi/real(homogenization_ngrains(material_homogenizationat(el)),preal)
24176 integer,
intent(in) :: &
24177 ip, & !< integration point number
24179 real(preal),
dimension(3,3) :: &
24185 homog = material_homogenizationat(el)
24187 do grain = 1, homogenization_ngrains(homog)
24203 integer,
intent(in) :: &
24204 ip, & !< integration point number
24211 do ipc = 1, homogenization_ngrains(material_homogenizationat(el))
24216 real(homogenization_ngrains(material_homogenizationat(el)),preal)
24226 integer,
intent(in) :: &
24227 ip, & !< integration point number
24229 real(preal),
intent(in) :: &
24235 homog = material_homogenizationat(el)
24236 offset = damagemapping(homog)%p(ip,el)
24237 damage(homog)%p(offset) = phi
24247 integer,
intent(in) :: homog
24248 character(len=*),
intent(in) :: group
24252 associate(prm =>
param(damage_typeinstance(homog)))
24253 outputsloop:
do o = 1,
size(prm%output)
24254 select case(prm%output(o))
24256 call results_writedataset(group,damage(homog)%p,
'phi',&
24257 'damage indicator',
'-')
24265 # 51 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
24267 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization.f90" 1
24299 real(pReal),
dimension(:,:,:,:),
allocatable,
public :: &
24300 materialpoint_F0, & !< def grad of IP at start of FE increment
24301 materialpoint_F, & !< def grad of IP to be reached at end of FE increment
24303 real(pReal),
dimension(:,:,:,:,:,:),
allocatable,
public :: &
24306 real(preal),
dimension(:,:,:,:),
allocatable :: &
24309 real(preal),
dimension(:,:),
allocatable :: &
24313 logical,
dimension(:,:),
allocatable :: &
24316 logical,
dimension(:,:,:),
allocatable :: &
24323 substepminhomog, & !< minimum (relative) size of sub-step allowed during cutback in homogenization
24324 substepsizehomog, & !< size of first substep when cutback in homogenization
24332 module subroutine mech_none_init
24333 end subroutine mech_none_init
24335 module subroutine mech_isostrain_init
24336 end subroutine mech_isostrain_init
24338 module subroutine mech_rgc_init
24339 end subroutine mech_rgc_init
24342 module subroutine mech_isostrain_partitiondeformation(f,avgf)
24343 real(preal),
dimension (:,:,:),
intent(out) :: f
24344 real(preal),
dimension (3,3),
intent(in) :: avgf
24345 end subroutine mech_isostrain_partitiondeformation
24347 module subroutine mech_rgc_partitiondeformation(f,avgf,instance,of)
24348 real(preal),
dimension (:,:,:),
intent(out) :: f
24349 real(preal),
dimension (3,3),
intent(in) :: avgf
24350 integer,
intent(in) :: &
24353 end subroutine mech_rgc_partitiondeformation
24356 module subroutine mech_isostrain_averagestressanditstangent(avgp,davgpdavgf,p,dpdf,instance)
24357 real(preal),
dimension (3,3),
intent(out) :: avgp
24358 real(preal),
dimension (3,3,3,3),
intent(out) :: davgpdavgf
24360 real(preal),
dimension (:,:,:),
intent(in) :: p
24361 real(preal),
dimension (:,:,:,:,:),
intent(in) :: dpdf
24362 integer,
intent(in) :: instance
24363 end subroutine mech_isostrain_averagestressanditstangent
24365 module subroutine mech_rgc_averagestressanditstangent(avgp,davgpdavgf,p,dpdf,instance)
24366 real(preal),
dimension (3,3),
intent(out) :: avgp
24367 real(preal),
dimension (3,3,3,3),
intent(out) :: davgpdavgf
24369 real(preal),
dimension (:,:,:),
intent(in) :: p
24370 real(preal),
dimension (:,:,:,:,:),
intent(in) :: dpdf
24371 integer,
intent(in) :: instance
24372 end subroutine mech_rgc_averagestressanditstangent
24375 module function mech_rgc_updatestate(p,f,f0,avgf,dt,dpdf,ip,el)
24376 logical,
dimension(2) :: mech_rgc_updatestate
24377 real(preal),
dimension(:,:,:),
intent(in) :: &
24378 p,& !< partitioned stresses
24379 f,& !< partitioned deformation gradients
24381 real(preal),
dimension(:,:,:,:,:),
intent(in) :: dpdf
24382 real(preal),
dimension(3,3),
intent(in) :: avgf
24383 real(preal),
intent(in) :: dt
24384 integer,
intent(in) :: &
24385 ip, & !< integration point number
24387 end function mech_rgc_updatestate
24390 module subroutine mech_rgc_results(instance,group)
24391 integer,
intent(in) :: instance
24392 character(len=*),
intent(in) :: group
24393 end subroutine mech_rgc_results
24398 homogenization_init, &
24399 materialpoint_stressanditstangent, &
24400 homogenization_results
24408 subroutine homogenization_init
24428 materialpoint_f = materialpoint_f0
24439 write(6,
'(/,a)')
' <<<+- homogenization init -+>>>';
flush(6)
24442 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_dPdF: ', shape(materialpoint_dpdf)
24443 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_F0: ', shape(materialpoint_f0)
24444 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_F: ', shape(materialpoint_f)
24445 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_subF0: ', shape(materialpoint_subf0)
24446 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_subF: ', shape(materialpoint_subf)
24447 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_P: ', shape(materialpoint_p)
24448 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_subFrac: ', shape(materialpoint_subfrac)
24449 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_subStep: ', shape(materialpoint_substep)
24450 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_subdt: ', shape(materialpoint_subdt)
24451 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_requested: ', shape(materialpoint_requested)
24452 write(6,
'(a32,1x,7(i8,1x))')
'materialpoint_converged: ', shape(materialpoint_converged)
24453 write(6,
'(a32,1x,7(i8,1x),/)')
'materialpoint_doneAndHappy: ', shape(materialpoint_doneandhappy)
24461 num%subStepMinHomog =
config_numerics%getFloat(
'substepminhomog', defaultval=1.0e-3_preal)
24462 num%subStepSizeHomog =
config_numerics%getFloat(
'substepsizehomog', defaultval=0.25_preal)
24463 num%stepIncreaseHomog =
config_numerics%getFloat(
'stepincreasehomog', defaultval=1.5_preal)
24464 if (num%nMPstate < 1)
call io_error(301,ext_msg=
'nMPstate')
24465 if (num%subStepMinHomog <= 0.0_preal)
call io_error(301,ext_msg=
'subStepMinHomog')
24466 if (num%subStepSizeHomog <= 0.0_preal)
call io_error(301,ext_msg=
'subStepSizeHomog')
24467 if (num%stepIncreaseHomog <= 0.0_preal)
call io_error(301,ext_msg=
'stepIncreaseHomog')
24469 end subroutine homogenization_init
24475 subroutine materialpoint_stressanditstangent(updateJaco,dt)
24477 real(preal),
intent(in) :: dt
24478 logical,
intent(in) :: updatejaco
24481 niterationmpstate, &
24482 g, & !< grain number
24483 i, & !< integration point number
24484 e, & !< element number
24488 # 231 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization.f90"
24504 crystallite_partionedfp0(1:3,1:3,g,i,e) = crystallite_fp0(1:3,1:3,g,i,e)
24505 crystallite_partionedlp0(1:3,1:3,g,i,e) = crystallite_lp0(1:3,1:3,g,i,e)
24506 crystallite_partionedfi0(1:3,1:3,g,i,e) = crystallite_fi0(1:3,1:3,g,i,e)
24507 crystallite_partionedli0(1:3,1:3,g,i,e) = crystallite_li0(1:3,1:3,g,i,e)
24508 crystallite_partionedf0(1:3,1:3,g,i,e) = crystallite_f0(1:3,1:3,g,i,e)
24509 crystallite_partioneds0(1:3,1:3,g,i,e) = crystallite_s0(1:3,1:3,g,i,e)
24514 materialpoint_subf0(1:3,1:3,i,e) = materialpoint_f0(1:3,1:3,i,e)
24515 materialpoint_subfrac(i,e) = 0.0_preal
24516 materialpoint_substep(i,e) = 1.0_preal/num%subStepSizeHomog
24517 materialpoint_converged(i,e) = .false.
24518 materialpoint_requested(i,e) = .true.
24534 niterationhomog = 0
24544 converged:
if (materialpoint_converged(i,e))
then
24545 # 296 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization.f90"
24549 materialpoint_subfrac(i,e) = materialpoint_subfrac(i,e) + materialpoint_substep(i,e)
24550 materialpoint_substep(i,e) = min(1.0_preal-materialpoint_subfrac(i,e), &
24551 num%stepIncreaseHomog*materialpoint_substep(i,e))
24553 steppingneeded:
if (materialpoint_substep(i,e) > num%subStepMinHomog)
then
24556 crystallite_partionedf0(1:3,1:3,1:myngrains,i,e) = &
24557 crystallite_partionedf(1:3,1:3,1:myngrains,i,e)
24559 crystallite_partionedfp0(1:3,1:3,1:myngrains,i,e) = &
24560 crystallite_fp(1:3,1:3,1:myngrains,i,e)
24562 crystallite_partionedlp0(1:3,1:3,1:myngrains,i,e) = &
24563 crystallite_lp(1:3,1:3,1:myngrains,i,e)
24565 crystallite_partionedfi0(1:3,1:3,1:myngrains,i,e) = &
24566 crystallite_fi(1:3,1:3,1:myngrains,i,e)
24568 crystallite_partionedli0(1:3,1:3,1:myngrains,i,e) = &
24569 crystallite_li(1:3,1:3,1:myngrains,i,e)
24571 crystallite_partioneds0(1:3,1:3,1:myngrains,i,e) = &
24572 crystallite_s(1:3,1:3,1:myngrains,i,e)
24593 materialpoint_subf0(1:3,1:3,i,e) = materialpoint_subf(1:3,1:3,i,e)
24595 endif steppingneeded
24598 if ( (myngrains == 1 .and. materialpoint_substep(i,e) <= 1.0 ) .or. &
24599 num%subStepSizeHomog * materialpoint_substep(i,e) <= num%subStepMinHomog )
then
24604 write(6,*)
'Integration point ', i,
' at element ', e,
' terminally ill'
24609 materialpoint_substep(i,e) = num%subStepSizeHomog * materialpoint_substep(i,e)
24611 # 370 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization.f90"
24615 if (materialpoint_substep(i,e) < 1.0_preal)
then
24616 crystallite_lp(1:3,1:3,1:myngrains,i,e) = &
24617 crystallite_partionedlp0(1:3,1:3,1:myngrains,i,e)
24618 crystallite_li(1:3,1:3,1:myngrains,i,e) = &
24619 crystallite_partionedli0(1:3,1:3,1:myngrains,i,e)
24621 crystallite_fp(1:3,1:3,1:myngrains,i,e) = &
24622 crystallite_partionedfp0(1:3,1:3,1:myngrains,i,e)
24623 crystallite_fi(1:3,1:3,1:myngrains,i,e) = &
24624 crystallite_partionedfi0(1:3,1:3,1:myngrains,i,e)
24625 crystallite_s(1:3,1:3,1:myngrains,i,e) = &
24626 crystallite_partioneds0(1:3,1:3,1:myngrains,i,e)
24627 do g = 1, myngrains
24647 if (materialpoint_substep(i,e) > num%subStepMinHomog)
then
24648 materialpoint_requested(i,e) = .true.
24649 materialpoint_subf(1:3,1:3,i,e) = materialpoint_subf0(1:3,1:3,i,e) &
24650 + materialpoint_substep(i,e) * (materialpoint_f(1:3,1:3,i,e) &
24651 - materialpoint_f0(1:3,1:3,i,e))
24652 materialpoint_subdt(i,e) = materialpoint_substep(i,e) * dt
24653 materialpoint_doneandhappy(1:2,i,e) = [.false.,.true.]
24656 enddo elementlooping1
24659 niterationmpstate = 0
24665 niterationmpstate < num%nMPstate)
24666 niterationmpstate = niterationmpstate + 1
24676 if ( materialpoint_requested(i,e) .and. &
24677 .not. materialpoint_doneandhappy(1,i,e))
then
24678 call partitiondeformation(i,e)
24679 crystallite_dt(1:myngrains,i,e) = materialpoint_subdt(i,e)
24680 crystallite_requested(1:myngrains,i,e) = .true.
24682 crystallite_requested(1:myngrains,i,e) = .false.
24685 enddo elementlooping2
24700 if ( materialpoint_requested(i,e) .and. &
24701 .not. materialpoint_doneandhappy(1,i,e))
then
24702 if (.not. materialpoint_converged(i,e))
then
24703 materialpoint_doneandhappy(1:2,i,e) = [.true.,.false.]
24705 materialpoint_doneandhappy(1:2,i,e) = updatestate(i,e)
24706 materialpoint_converged(i,e) = all(materialpoint_doneandhappy(1:2,i,e))
24710 enddo elementlooping3
24713 enddo convergencelooping
24715 niterationhomog = niterationhomog + 1
24717 enddo cutbacklooping
24726 call averagestressanditstangent(i,e)
24728 enddo elementlooping4
24731 write(6,
'(/,a,/)')
'<< HOMOG >> Material Point terminally ill'
24734 end subroutine materialpoint_stressanditstangent
24740 subroutine partitiondeformation(ip,el)
24742 integer,
intent(in) :: &
24743 ip, & !< integration point
24749 crystallite_partionedf(1:3,1:3,1,ip,el) = materialpoint_subf(1:3,1:3,ip,el)
24752 call mech_isostrain_partitiondeformation(&
24754 materialpoint_subf(1:3,1:3,ip,el))
24757 call mech_rgc_partitiondeformation(&
24759 materialpoint_subf(1:3,1:3,ip,el),&
24762 end select chosenhomogenization
24764 end subroutine partitiondeformation
24771 function updatestate(ip,el)
24773 integer,
intent(in) :: &
24774 ip, & !< integration point
24776 logical,
dimension(2) :: updateState
24778 updatestate = .true.
24782 updatestate .and. &
24786 materialpoint_subf(1:3,1:3,ip,el),&
24787 materialpoint_subdt(ip,el), &
24791 end select chosenhomogenization
24796 updatestate .and. &
24800 end select chosenthermal
24805 updatestate .and. &
24809 end select chosendamage
24811 end function updatestate
24817 subroutine averagestressanditstangent(ip,el)
24819 integer,
intent(in) :: &
24820 ip, & !< integration point
24825 materialpoint_p(1:3,1:3,ip,el) = crystallite_p(1:3,1:3,1,ip,el)
24826 materialpoint_dpdf(1:3,1:3,1:3,1:3,ip,el) = crystallite_dpdf(1:3,1:3,1:3,1:3,1,ip,el)
24829 call mech_isostrain_averagestressanditstangent(&
24830 materialpoint_p(1:3,1:3,ip,el), &
24831 materialpoint_dpdf(1:3,1:3,1:3,1:3,ip,el),&
24837 call mech_rgc_averagestressanditstangent(&
24838 materialpoint_p(1:3,1:3,ip,el), &
24839 materialpoint_dpdf(1:3,1:3,1:3,1:3,ip,el),&
24843 end select chosenhomogenization
24845 end subroutine averagestressanditstangent
24851 subroutine homogenization_results
24856 character(len=pStringLen) :: group_base,group
24864 group = trim(group_base)//
'/generic'
24873 group = trim(group_base)//
'/mech'
24875 select case(material_homogenization_type(p))
24876 case(homogenization_rgc_id)
24877 call mech_rgc_results(homogenization_typeinstance(p),group)
24880 group = trim(group_base)//
'/damage'
24882 select case(damage_type(p))
24883 case(damage_local_id)
24885 case(damage_nonlocal_id)
24889 group = trim(group_base)//
'/thermal'
24891 select case(thermal_type(p))
24892 case(thermal_adiabatic_id)
24894 case(thermal_conduction_id)
24900 end subroutine homogenization_results
24903 # 52 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
24905 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_none.f90" 1
24919 module subroutine mech_none_init
24926 write(6,
'(/,a)')
' <<<+- homogenization_'//homogenization_none_label//
' init -+>>>';
flush(6)
24928 ninstance = count(homogenization_type == homogenization_none_id)
24929 if (iand(debug_level(debug_homogenization),debug_levelbasic) /= 0) &
24930 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
24932 do h = 1,
size(homogenization_type)
24933 if (homogenization_type(h) /= homogenization_none_id) cycle
24935 nofmyhomog = count(material_homogenizationat == h)
24936 homogstate(h)%sizeState = 0
24937 allocate(homogstate(h)%state0 (0,nofmyhomog))
24938 allocate(homogstate(h)%subState0(0,nofmyhomog))
24939 allocate(homogstate(h)%state (0,nofmyhomog))
24943 end subroutine mech_none_init
24945 end submodule homogenization_mech_none
24946 # 53 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
24948 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_isostrain.f90" 1
24957 enum,
bind(c); enumerator :: &
24962 type :: tparameters
24965 integer(kind(average_ID)) :: &
24969 type(tparameters),
dimension(:),
allocatable :: param
24977 module subroutine mech_isostrain_init
24983 character(len=pStringLen) :: &
24986 write(6,
'(/,a)')
' <<<+- homogenization_'//homogenization_isostrain_label//
' init -+>>>'
24988 ninstance = count(homogenization_type == homogenization_isostrain_id)
24989 if (iand(debug_level(debug_homogenization),debug_levelbasic) /= 0) &
24990 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
24992 allocate(param(ninstance))
24994 do h = 1,
size(homogenization_type)
24995 if (homogenization_type(h) /= homogenization_isostrain_id) cycle
24997 associate(prm => param(homogenization_typeinstance(h)),&
24998 config => config_homogenization(h))
25000 prm%Nconstituents = config_homogenization(h)%getInt(
'nconstituents')
25002 select case(trim(
config%getString(
'mapping',defaultval = tag)))
25008 call io_error(211,ext_msg=trim(tag)//
' ('//homogenization_isostrain_label//
')')
25011 nofmyhomog = count(material_homogenizationat == h)
25012 homogstate(h)%sizeState = 0
25013 allocate(homogstate(h)%state0 (0,nofmyhomog))
25014 allocate(homogstate(h)%subState0(0,nofmyhomog))
25015 allocate(homogstate(h)%state (0,nofmyhomog))
25021 end subroutine mech_isostrain_init
25027 module subroutine mech_isostrain_partitiondeformation(f,avgf)
25029 real(preal),
dimension (:,:,:),
intent(out) :: f
25031 real(preal),
dimension (3,3),
intent(in) :: avgf
25033 f = spread(avgf,3,
size(f,3))
25035 end subroutine mech_isostrain_partitiondeformation
25041 module subroutine mech_isostrain_averagestressanditstangent(avgp,davgpdavgf,p,dpdf,instance)
25043 real(preal),
dimension (3,3),
intent(out) :: avgp
25044 real(preal),
dimension (3,3,3,3),
intent(out) :: davgpdavgf
25046 real(preal),
dimension (:,:,:),
intent(in) :: p
25047 real(preal),
dimension (:,:,:,:,:),
intent(in) :: dpdf
25048 integer,
intent(in) :: instance
25050 associate(prm => param(instance))
25052 select case (prm%mapping)
25055 davgpdavgf = sum(dpdf,5)
25057 avgp = sum(p,3) /real(prm%Nconstituents,preal)
25058 davgpdavgf = sum(dpdf,5)/real(prm%Nconstituents,preal)
25063 end subroutine mech_isostrain_averagestressanditstangent
25065 end submodule homogenization_mech_isostrain
25066 # 54 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
25068 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90" 1
25080 type :: tparameters
25081 integer,
dimension(:),
allocatable :: &
25086 real(preal),
dimension(:),
allocatable :: &
25091 character(len=pStringLen),
allocatable,
dimension(:) :: &
25093 end type tparameters
25096 real(preal),
pointer,
dimension(:) :: &
25099 real(preal),
pointer,
dimension(:,:) :: &
25103 type :: trgcdependentstate
25104 real(preal),
allocatable,
dimension(:) :: &
25105 volumediscrepancy, &
25106 relaxationrate_avg, &
25108 real(preal),
allocatable,
dimension(:,:) :: &
25110 real(preal),
allocatable,
dimension(:,:,:) :: &
25112 end type trgcdependentstate
25114 type :: tnumerics_rgc
25116 atol, & !< absolute tolerance of RGC residuum
25117 rtol, & !< relative tolerance of RGC residuum
25118 absmax, & !< absolute maximum of RGC residuum
25119 relmax, & !< relative maximum of RGC residuum
25120 ppert, & !< perturbation for computing RGC penalty tangent
25121 xsmoo, & !< RGC penalty smoothing parameter (hyperbolic tangent)
25122 viscpower, & !< power (sensitivity rate) of numerical viscosity in RGC scheme, Default 1.0e0: Newton viscosity (linear model)
25123 viscmodus, & !< stress modulus of RGC numerical viscosity, Default 0.0e0: No viscosity is applied
25124 refrelaxrate, & !< reference relaxation rate in RGC viscosity
25125 maxdrelax, & !< threshold of maximum relaxation vector increment (if exceed this then cutback)
25126 maxvoldiscr, & !< threshold of maximum volume discrepancy allowed
25127 voldiscrmod, & !< stiffness of RGC volume discrepancy (zero = without volume discrepancy constraint)
25129 end type tnumerics_rgc
25131 type(tparameters),
dimension(:),
allocatable :: &
25133 type(trgcstate),
dimension(:),
allocatable :: &
25136 type(trgcdependentstate),
dimension(:),
allocatable :: &
25138 type(tnumerics_rgc) :: &
25146 module subroutine mech_rgc_init
25152 sizestate, nintfacetot
25154 write(6,
'(/,a)')
' <<<+- homogenization_'//homogenization_rgc_label//
' init -+>>>';
flush(6)
25156 write(6,
'(/,a)')
' Tjahjanto et al., International Journal of Material Forming 2(1):939–942, 2009'
25157 write(6,
'(a)')
' https://doi.org/10.1007/s12289-009-0619-1'
25159 write(6,
'(/,a)')
' Tjahjanto et al., Modelling and Simulation in Materials Science and Engineering 18:015006, 2010'
25160 write(6,
'(a)')
' https://doi.org/10.1088/0965-0393/18/1/015006'
25162 ninstance = count(homogenization_type == homogenization_rgc_id)
25163 if (iand(debug_level(debug_homogenization),debug_levelbasic) /= 0) &
25164 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
25166 allocate(param(ninstance))
25167 allocate(state(ninstance))
25168 allocate(state0(ninstance))
25169 allocate(dependentstate(ninstance))
25171 num%atol = config_numerics%getFloat(
'atol_rgc', defaultval=1.0e+4_preal)
25172 num%rtol = config_numerics%getFloat(
'rtol_rgc', defaultval=1.0e-3_preal)
25173 num%absMax = config_numerics%getFloat(
'amax_rgc', defaultval=1.0e+10_preal)
25174 num%relMax = config_numerics%getFloat(
'rmax_rgc', defaultval=1.0e+2_preal)
25175 num%pPert = config_numerics%getFloat(
'perturbpenalty_rgc', defaultval=1.0e-7_preal)
25176 num%xSmoo = config_numerics%getFloat(
'relvantmismatch_rgc', defaultval=1.0e-5_preal)
25177 num%viscPower = config_numerics%getFloat(
'viscositypower_rgc', defaultval=1.0e+0_preal)
25178 num%viscModus = config_numerics%getFloat(
'viscositymodulus_rgc', defaultval=0.0e+0_preal)
25179 num%refRelaxRate = config_numerics%getFloat(
'refrelaxationrate_rgc',defaultval=1.0e-3_preal)
25180 num%maxdRelax = config_numerics%getFloat(
'maxrelaxationrate_rgc',defaultval=1.0e+0_preal)
25181 num%maxVolDiscr = config_numerics%getFloat(
'maxvoldiscrepancy_rgc',defaultval=1.0e-5_preal)
25182 num%volDiscrMod = config_numerics%getFloat(
'voldiscrepancymod_rgc',defaultval=1.0e+12_preal)
25183 num%volDiscrPow = config_numerics%getFloat(
'dicrepancypower_rgc', defaultval=5.0_preal)
25185 if (num%atol <= 0.0_preal)
call io_error(301,ext_msg=
'absTol_RGC')
25186 if (num%rtol <= 0.0_preal)
call io_error(301,ext_msg=
'relTol_RGC')
25187 if (num%absMax <= 0.0_preal)
call io_error(301,ext_msg=
'absMax_RGC')
25188 if (num%relMax <= 0.0_preal)
call io_error(301,ext_msg=
'relMax_RGC')
25189 if (num%pPert <= 0.0_preal)
call io_error(301,ext_msg=
'pPert_RGC')
25190 if (num%xSmoo <= 0.0_preal)
call io_error(301,ext_msg=
'xSmoo_RGC')
25191 if (num%viscPower < 0.0_preal)
call io_error(301,ext_msg=
'viscPower_RGC')
25192 if (num%viscModus < 0.0_preal)
call io_error(301,ext_msg=
'viscModus_RGC')
25193 if (num%refRelaxRate <= 0.0_preal)
call io_error(301,ext_msg=
'refRelaxRate_RGC')
25194 if (num%maxdRelax <= 0.0_preal)
call io_error(301,ext_msg=
'maxdRelax_RGC')
25195 if (num%maxVolDiscr <= 0.0_preal)
call io_error(301,ext_msg=
'maxVolDiscr_RGC')
25196 if (num%volDiscrMod < 0.0_preal)
call io_error(301,ext_msg=
'volDiscrMod_RGC')
25197 if (num%volDiscrPow <= 0.0_preal)
call io_error(301,ext_msg=
'volDiscrPw_RGC')
25199 do h = 1,
size(homogenization_type)
25200 if (homogenization_type(h) /= homogenization_rgc_id) cycle
25201 associate(prm => param(homogenization_typeinstance(h)), &
25202 stt => state(homogenization_typeinstance(h)), &
25203 st0 => state0(homogenization_typeinstance(h)), &
25204 dst => dependentstate(homogenization_typeinstance(h)), &
25205 config => config_homogenization(h))
25213 prm%output =
config%getStrings(
'(output)',defaultval=emptystringarray)
25215 prm%Nconstituents =
config%getInts(
'clustersize',requiredsize=3)
25216 if (homogenization_ngrains(h) /= product(prm%Nconstituents)) &
25217 call io_error(211,ext_msg=
'clustersize ('//homogenization_rgc_label//
')')
25219 prm%xiAlpha =
config%getFloat(
'scalingparameter')
25220 prm%ciAlpha =
config%getFloat(
'overproportionality')
25222 prm%dAlpha =
config%getFloats(
'grainsize', requiredsize=3)
25223 prm%angles =
config%getFloats(
'clusterorientation',requiredsize=3)
25225 nofmyhomog = count(material_homogenizationat == h)
25226 nintfacetot = 3*( (prm%Nconstituents(1)-1)*prm%Nconstituents(2)*prm%Nconstituents(3) &
25227 + prm%Nconstituents(1)*(prm%Nconstituents(2)-1)*prm%Nconstituents(3) &
25228 + prm%Nconstituents(1)*prm%Nconstituents(2)*(prm%Nconstituents(3)-1))
25229 sizestate = nintfacetot &
25230 +
size([
'avg constitutive work ',
'average penalty energy'])
25232 homogstate(h)%sizeState = sizestate
25233 allocate(homogstate(h)%state0 (sizestate,nofmyhomog), source=0.0_preal)
25234 allocate(homogstate(h)%subState0(sizestate,nofmyhomog), source=0.0_preal)
25235 allocate(homogstate(h)%state (sizestate,nofmyhomog), source=0.0_preal)
25237 stt%relaxationVector => homogstate(h)%state(1:nintfacetot,:)
25238 st0%relaxationVector => homogstate(h)%state0(1:nintfacetot,:)
25239 stt%work => homogstate(h)%state(nintfacetot+1,:)
25240 stt%penaltyEnergy => homogstate(h)%state(nintfacetot+2,:)
25242 allocate(dst%volumeDiscrepancy( nofmyhomog))
25243 allocate(dst%relaxationRate_avg( nofmyhomog))
25244 allocate(dst%relaxationRate_max( nofmyhomog))
25245 allocate(dst%mismatch( 3,nofmyhomog))
25249 dependentstate(homogenization_typeinstance(h))%orientation = spread(
eu2om(prm%angles*inrad),3,nofmyhomog)
25256 end subroutine mech_rgc_init
25262 module subroutine mech_rgc_partitiondeformation(f,avgf,instance,of)
25264 real(preal),
dimension (:,:,:),
intent(out) :: f
25266 real(preal),
dimension (3,3),
intent(in) :: avgf
25267 integer,
intent(in) :: &
25271 real(preal),
dimension(3) :: avect,nvect
25272 integer,
dimension(4) :: intface
25273 integer,
dimension(3) :: igrain3
25274 integer :: igrain,iface,i,j
25276 associate(prm => param(instance))
25281 do igrain = 1,product(prm%Nconstituents)
25282 igrain3 =
grain1to3(igrain,prm%Nconstituents)
25287 forall (i=1:3,j=1:3) &
25288 f(i,j,igrain) = f(i,j,igrain) + avect(i)*nvect(j)
25290 f(1:3,1:3,igrain) = f(1:3,1:3,igrain) + avgf
25292 # 234 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25297 end subroutine mech_rgc_partitiondeformation
25304 module procedure mech_rgc_updatestate
25306 integer,
dimension(4) :: intfacen,intfacep,faceid
25307 integer,
dimension(3) :: ngdim,igr3n,igr3p
25308 integer :: instance,inum,i,j,nintfacetot,igrn,igrp,imun,iface,k,l,ipert,igrain,ngrain, of
25309 real(preal),
dimension(3,3,size(P,3)) :: r,pf,pr,d,pd
25310 real(preal),
dimension(3,size(P,3)) :: nn,devnull
25311 real(preal),
dimension(3) :: normp,normn,mornp,mornn
25312 real(preal) :: residmax,stresmax
25314 real(preal),
dimension(:,:),
allocatable :: tract,jmatrix,jnverse,smatrix,pmatrix,rmatrix
25315 real(preal),
dimension(:),
allocatable :: resid,relax,p_relax,p_resid,drelax
25321 zerotimestep:
if(deq0(dt))
then
25322 mech_rgc_updatestate = .true.
25326 instance = homogenization_typeinstance(material_homogenizationat(el))
25327 of = material_homogenizationmemberat(ip,el)
25329 associate(stt => state(instance), st0 => state0(instance), dst => dependentstate(instance), prm => param(instance))
25333 ngdim = prm%Nconstituents
25334 ngrain = product(ngdim)
25335 nintfacetot = (ngdim(1)-1)*ngdim(2)*ngdim(3) &
25336 + ngdim(1)*(ngdim(2)-1)*ngdim(3) &
25337 + ngdim(1)*ngdim(2)*(ngdim(3)-1)
25341 allocate(resid(3*nintfacetot), source=0.0_preal)
25342 allocate(tract(nintfacetot,3), source=0.0_preal)
25343 relax = stt%relaxationVector(:,of)
25344 drelax = stt%relaxationVector(:,of) - st0%relaxationVector(:,of)
25346 # 296 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25354 call volumepenalty(d,dst%volumeDiscrepancy(of),avgf,f,ngrain,instance,of)
25356 # 320 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25360 do inum = 1,nintfacetot
25365 igr3n = faceid(2:4)
25366 igrn =
grain3to1(igr3n,param(instance)%Nconstituents)
25373 igr3p(faceid(1)) = igr3n(faceid(1))+1
25374 igrp =
grain3to1(igr3p,param(instance)%Nconstituents)
25381 tract(inum,i) = sign(num%viscModus*(abs(drelax(i+3*(inum-1)))/(num%refRelaxRate*dt))**num%viscPower, &
25382 drelax(i+3*(inum-1)))
25384 tract(inum,i) = tract(inum,i) + (p(i,j,igrp) + r(i,j,igrp) + d(i,j,igrp))*normp(j) &
25385 + (p(i,j,igrn) + r(i,j,igrn) + d(i,j,igrn))*normn(j)
25386 resid(i+3*(inum-1)) = tract(inum,i)
25401 stresmax = maxval(abs(p))
25402 residmax = maxval(abs(tract))
25404 # 380 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25406 mech_rgc_updatestate = .false.
25410 if (residmax < num%rtol*stresmax .or. residmax < num%atol)
then
25411 mech_rgc_updatestate = .true.
25419 do igrain = 1,product(prm%Nconstituents)
25420 do i = 1,3;
do j = 1,3
25421 stt%work(of) = stt%work(of) &
25422 + p(i,j,igrain)*(f(i,j,igrain) - f0(i,j,igrain))/real(ngrain,preal)
25423 stt%penaltyEnergy(of) = stt%penaltyEnergy(of) &
25424 + r(i,j,igrain)*(f(i,j,igrain) - f0(i,j,igrain))/real(ngrain,preal)
25428 dst%mismatch(1:3,of) = sum(nn,2)/real(ngrain,preal)
25429 dst%relaxationRate_avg(of) = sum(abs(drelax))/dt/real(3*nintfacetot,preal)
25430 dst%relaxationRate_max(of) = maxval(abs(drelax))/dt
25432 # 420 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25438 elseif (residmax > num%relMax*stresmax .or. residmax > num%absMax)
then
25439 mech_rgc_updatestate = [.true.,.false.]
25462 allocate(smatrix(3*nintfacetot,3*nintfacetot), source=0.0_preal)
25463 do inum = 1,nintfacetot
25468 igr3n = faceid(2:4)
25469 igrn =
grain3to1(igr3n,param(instance)%Nconstituents)
25475 imun =
interface4to1(intfacen,param(instance)%Nconstituents)
25477 do i=1,3;
do j=1,3;
do k=1,3;
do l=1,3
25478 smatrix(3*(inum-1)+i,3*(imun-1)+j) = smatrix(3*(inum-1)+i,3*(imun-1)+j) &
25479 + dpdf(i,k,j,l,igrn)*normn(k)*mornn(l)
25480 enddo;enddo;enddo;
enddo
25489 igr3p(faceid(1)) = igr3n(faceid(1))+1
25490 igrp =
grain3to1(igr3p,param(instance)%Nconstituents)
25496 imun =
interface4to1(intfacep,param(instance)%Nconstituents)
25498 do i=1,3;
do j=1,3;
do k=1,3;
do l=1,3
25499 smatrix(3*(inum-1)+i,3*(imun-1)+j) = smatrix(3*(inum-1)+i,3*(imun-1)+j) &
25500 + dpdf(i,k,j,l,igrp)*normp(k)*mornp(l)
25501 enddo;enddo;enddo;
enddo
25506 # 503 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25511 allocate(pmatrix(3*nintfacetot,3*nintfacetot), source=0.0_preal)
25512 allocate(p_relax(3*nintfacetot), source=0.0_preal)
25513 allocate(p_resid(3*nintfacetot), source=0.0_preal)
25515 do ipert = 1,3*nintfacetot
25517 p_relax(ipert) = relax(ipert) + num%pPert
25518 stt%relaxationVector(:,of) = p_relax
25521 call volumepenalty(pd,devnull(1,1), avgf,pf,ngrain,instance,of)
25525 p_resid = 0.0_preal
25526 do inum = 1,nintfacetot
25531 igr3n = faceid(2:4)
25532 igrn =
grain3to1(igr3n,param(instance)%Nconstituents)
25539 igr3p(faceid(1)) = igr3n(faceid(1))+1
25540 igrp =
grain3to1(igr3p,param(instance)%Nconstituents)
25547 do i = 1,3;
do j = 1,3
25548 p_resid(i+3*(inum-1)) = p_resid(i+3*(inum-1)) + (pr(i,j,igrp) - r(i,j,igrp))*normp(j) &
25549 + (pr(i,j,igrn) - r(i,j,igrn))*normn(j) &
25550 + (pd(i,j,igrp) - d(i,j,igrp))*normp(j) &
25551 + (pd(i,j,igrn) - d(i,j,igrn))*normn(j)
25554 pmatrix(:,ipert) = p_resid/num%pPert
25557 # 563 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25561 allocate(rmatrix(3*nintfacetot,3*nintfacetot),source=0.0_preal)
25562 do i=1,3*nintfacetot
25563 rmatrix(i,i) = num%viscModus*num%viscPower/(num%refRelaxRate*dt)* &
25564 (abs(drelax(i))/(num%refRelaxRate*dt))**(num%viscPower - 1.0_preal)
25567 # 582 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25571 allocate(jmatrix(3*nintfacetot,3*nintfacetot)); jmatrix = smatrix + pmatrix + rmatrix
25573 # 597 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25577 allocate(jnverse(3*nintfacetot,3*nintfacetot),source=0.0_preal)
25578 call math_invert(jnverse,error,jmatrix)
25580 # 613 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25585 do i = 1,3*nintfacetot;
do j = 1,3*nintfacetot
25586 drelax(i) = drelax(i) - jnverse(i,j)*resid(j)
25588 stt%relaxationVector(:,of) = relax + drelax
25589 if (any(abs(drelax) > num%maxdRelax))
then
25590 mech_rgc_updatestate = [.true.,.false.]
25592 write(6,
'(1x,a,1x,i3,1x,a,1x,i3,1x,a)')
'RGC_updateState: ip',ip,
'| el',el,
'enforces cutback'
25593 write(6,
'(1x,a,1x,e15.8)')
'due to large relaxation change =',maxval(abs(drelax))
25598 # 640 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25606 subroutine stresspenalty(rPen,nMis,avgF,fDef,ip,el,instance,of)
25608 real(preal),
dimension (:,:,:),
intent(out) :: rpen
25609 real(preal),
dimension (:,:),
intent(out) :: nmis
25611 real(preal),
dimension (:,:,:),
intent(in) :: fdef
25612 real(preal),
dimension (3,3),
intent(in) :: avgf
25613 integer,
intent(in) :: ip,el,instance,of
25615 integer,
dimension (4) :: intFace
25616 integer,
dimension (3) :: iGrain3,iGNghb3,nGDim
25617 real(pReal),
dimension (3,3) :: gDef,nDef
25618 real(pReal),
dimension (3) :: nVect,surfCorr
25619 real(pReal),
dimension (2) :: Gmoduli
25620 integer :: iGrain,iGNghb,iFace,i,j,k,l
25621 real(pReal) :: muGrain,muGNghb,nDefNorm,bgGrain,bgGNghb
25622 real(pReal),
parameter :: nDefToler = 1.0e-10_preal
25627 ngdim = param(instance)%Nconstituents
25637 associate(prm => param(instance))
25639 # 688 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_RGC.f90"
25643 grainloop:
do igrain = 1,product(prm%Nconstituents)
25645 mugrain = gmoduli(1)
25646 bggrain = gmoduli(2)
25647 igrain3 =
grain1to3(igrain,prm%Nconstituents)
25649 interfaceloop:
do iface = 1,6
25653 ignghb3(abs(intface(1))) = ignghb3(abs(intface(1))) &
25654 + int(real(intface(1),preal)/real(abs(intface(1)),preal))
25655 where(ignghb3 < 1) ignghb3 = ngdim
25656 where(ignghb3 >ngdim) ignghb3 = 1
25657 ignghb =
grain3to1(ignghb3,prm%Nconstituents)
25659 mugnghb = gmoduli(1)
25660 bggnghb = gmoduli(2)
25661 gdef = 0.5_preal*(fdef(1:3,1:3,ignghb) - fdef(1:3,1:3,igrain))
25665 ndefnorm = 0.0_preal
25667 do i = 1,3;
do j = 1,3
25668 do k = 1,3;
do l = 1,3
25669 ndef(i,j) = ndef(i,j) - nvect(k)*gdef(i,l)*math_levicivita(j,k,l)
25671 ndefnorm = ndefnorm + ndef(i,j)**2.0_preal
25673 ndefnorm = max(ndeftoler,sqrt(ndefnorm))
25674 nmis(abs(intface(1)),igrain) = nmis(abs(intface(1)),igrain) + ndefnorm
25685 do i = 1,3;
do j = 1,3;
do k = 1,3;
do l = 1,3
25686 rpen(i,j,igrain) = rpen(i,j,igrain) + 0.5_preal*(mugrain*bggrain + mugnghb*bggnghb)*prm%xiAlpha &
25687 *surfcorr(abs(intface(1)))/prm%dAlpha(abs(intface(1))) &
25688 *cosh(prm%ciAlpha*ndefnorm) &
25689 *0.5_preal*nvect(l)*ndef(i,k)/ndefnorm*math_levicivita(k,l,j) &
25690 *tanh(ndefnorm/num%xSmoo)
25691 enddo; enddo;enddo;
enddo
25692 enddo interfaceloop
25710 subroutine volumepenalty(vPen,vDiscrep,fAvg,fDef,nGrain,instance,of)
25712 real(pReal),
dimension (:,:,:),
intent(out) :: vPen
25713 real(pReal),
intent(out) :: vDiscrep
25715 real(pReal),
dimension (:,:,:),
intent(in) :: fDef
25716 real(pReal),
dimension (3,3),
intent(in) :: fAvg
25717 integer,
intent(in) :: &
25722 real(pReal),
dimension(size(vPen,3)) :: gVol
25727 vdiscrep = math_det33(favg)
25729 gvol(i) = math_det33(fdef(1:3,1:3,i))
25730 vdiscrep = vdiscrep - gvol(i)/real(ngrain,preal)
25738 vpen(:,:,i) = -1.0_preal/real(ngrain,preal)*num%volDiscrMod*num%volDiscrPow/num%maxVolDiscr* &
25739 sign((abs(vdiscrep)/num%maxVolDiscr)**(num%volDiscrPow - 1.0),vdiscrep)* &
25740 gvol(i)*transpose(math_inv33(fdef(:,:,i)))
25760 real(pReal),
dimension(3) :: surfaceCorrection
25762 real(pReal),
dimension(3,3),
intent(in) :: avgF
25763 integer,
intent(in) :: &
25766 real(preal),
dimension(3,3) :: invc
25767 real(preal),
dimension(3) :: nvect
25768 real(preal) :: detf
25769 integer :: i,j,ibase
25772 call math_invert33(invc,detf,error,matmul(transpose(avgf),avgf))
25774 surfacecorrection = 0.0_preal
25777 do i = 1,3;
do j = 1,3
25778 surfacecorrection(ibase) = surfacecorrection(ibase) + invc(i,j)*nvect(i)*nvect(j)
25780 surfacecorrection(ibase) = sqrt(surfacecorrection(ibase))*detf
25793 integer,
intent(in) :: &
25795 ip, & !< integration point number
25797 real(preal),
dimension(6,6) :: elastens
25803 elastens = constitutive_homogenizedc(grainid,ip,el)
25807 cequiv_11 = (elastens(1,1) + elastens(2,2) + elastens(3,3))/3.0_preal
25808 cequiv_12 = (elastens(1,2) + elastens(2,3) + elastens(3,1) + &
25809 elastens(1,3) + elastens(2,1) + elastens(3,2))/6.0_preal
25810 cequiv_44 = (elastens(4,4) + elastens(5,5) + elastens(6,6))/3.0_preal
25811 equivalentmoduli(1) = 0.2_preal*(cequiv_11 - cequiv_12) + 0.6_preal*cequiv_44
25826 real(preal),
dimension(:,:,:),
intent(out) :: f
25828 real(preal),
dimension(:,:),
intent(in) :: avgf
25829 integer,
intent(in) :: &
25833 real(pReal),
dimension(3) :: aVect,nVect
25834 integer,
dimension(4) :: intFace
25835 integer,
dimension(3) :: iGrain3
25836 integer :: iGrain,iFace,i,j
25841 associate(prm => param(instance))
25844 do igrain = 1,product(prm%Nconstituents)
25845 igrain3 =
grain1to3(igrain,prm%Nconstituents)
25850 forall (i=1:3,j=1:3) &
25851 f(i,j,igrain) = f(i,j,igrain) + avect(i)*nvect(j)
25853 f(1:3,1:3,igrain) = f(1:3,1:3,igrain) + avgf
25860 end procedure mech_rgc_updatestate
25866 module subroutine mech_rgc_averagestressanditstangent(avgp,davgpdavgf,p,dpdf,instance)
25868 real(pReal),
dimension (3,3),
intent(out) :: avgP
25869 real(pReal),
dimension (3,3,3,3),
intent(out) :: dAvgPdAvgF
25871 real(pReal),
dimension (:,:,:),
intent(in) :: P
25872 real(pReal),
dimension (:,:,:,:,:),
intent(in) :: dPdF
25873 integer,
intent(in) :: instance
25875 avgp = sum(p,3) /real(product(param(instance)%Nconstituents),preal)
25876 davgpdavgf = sum(dpdf,5)/real(product(param(instance)%Nconstituents),preal)
25878 end subroutine mech_rgc_averagestressanditstangent
25884 module subroutine mech_rgc_results(instance,group)
25886 integer,
intent(in) :: instance
25887 character(len=*),
intent(in) :: group
25891 associate(stt => state(instance), dst => dependentstate(instance), prm => param(instance))
25892 outputsloop:
do o = 1,
size(prm%output)
25893 select case(trim(prm%output(o)))
25894 case(
'constitutivework')
25895 call results_writedataset(group,stt%work,
'W',&
25896 'work density',
'J/m³')
25897 case(
'magnitudemismatch')
25898 call results_writedataset(group,dst%mismatch,
'N',&
25899 'average mismatch tensor',
'1')
25900 case(
'penaltyenergy')
25901 call results_writedataset(group,stt%penaltyEnergy,
'R',&
25902 'mismatch penalty density',
'J/m³')
25903 case(
'volumediscrepancy')
25904 call results_writedataset(group,dst%volumeDiscrepancy,
'Delta_V',&
25905 'volume discrepancy',
'm³')
25906 case(
'maximumrelaxrate')
25907 call results_writedataset(group,dst%relaxationrate_max,
'max_alpha_dot',&
25908 'maximum relaxation rate',
'm/s')
25909 case(
'averagerelaxrate')
25910 call results_writedataset(group,dst%relaxationrate_avg,
'avg_alpha_dot',&
25911 'average relaxation rate',
'm/s')
25916 end subroutine mech_rgc_results
25924 real(pReal),
dimension (3) :: relaxationVector
25926 integer,
intent(in) :: instance,of
25927 integer,
dimension(4),
intent(in) :: intFace
25934 inum =
interface4to1(intface,param(instance)%Nconstituents)
25936 relaxationvector = state(instance)%relaxationVector((3*inum-2):(3*inum),of)
25938 relaxationvector = 0.0_preal
25951 integer,
dimension(4),
intent(in) :: intface
25952 integer,
intent(in) :: &
25961 npos = abs(intface(1))
25976 integer,
dimension(3),
intent(in) :: igrain3
25977 integer,
intent(in) :: iface
25981 idir = (int(real(iface-1,preal)/2.0_preal)+1)*(-1)**iface
25999 integer,
intent(in) :: grain1
26000 integer,
dimension(3),
intent(in) :: ngdim
26003 mod((grain1-1)/ ngdim(1),ngdim(2)), &
26004 (grain1-1)/(ngdim(1)*ngdim(2))]
26012 integer pure function
grain3to1(grain3,ngdim)
26014 integer,
dimension(3),
intent(in) :: grain3
26015 integer,
dimension(3),
intent(in) :: ngdim
26018 + ngdim(1)*(grain3(2)-1) &
26019 + ngdim(1)*ngdim(2)*(grain3(3)-1)
26029 integer,
dimension(4),
intent(in) :: iface4d
26030 integer,
dimension(3),
intent(in) :: ngdim
26033 select case(abs(iface4d(1)))
26036 if ((iface4d(2) == 0) .or. (iface4d(2) == ngdim(1)))
then
26040 + ngdim(2)*ngdim(3)*(iface4d(2)-1)
26044 if ((iface4d(3) == 0) .or. (iface4d(3) == ngdim(2)))
then
26048 + ngdim(3)*ngdim(1)*(iface4d(3)-1) &
26049 + (ngdim(1)-1)*ngdim(2)*ngdim(3)
26053 if ((iface4d(4) == 0) .or. (iface4d(4) == ngdim(3)))
then
26057 + ngdim(1)*ngdim(2)*(iface4d(4)-1) &
26058 + (ngdim(1)-1)*ngdim(2)*ngdim(3) &
26059 + ngdim(1)*(ngdim(2)-1)*ngdim(3)
26077 integer,
intent(in) :: iface1d
26078 integer,
dimension(3),
intent(in) :: ngdim
26079 integer,
dimension(3) :: nintface
26083 nintface = [(ngdim(1)-1)*ngdim(2)*ngdim(3), &
26084 ngdim(1)*(ngdim(2)-1)*ngdim(3), &
26085 ngdim(1)*ngdim(2)*(ngdim(3)-1)]
26089 if (iface1d > 0 .and. iface1d <= nintface(1))
then
26092 interface1to4(4) = mod(int(real(iface1d-1,preal)/real(ngdim(2),preal)),ngdim(3))+1
26093 interface1to4(2) = int(real(iface1d-1,preal)/real(ngdim(2),preal)/real(ngdim(3),preal))+1
26094 elseif (iface1d > nintface(1) .and. iface1d <= (nintface(2) + nintface(1)))
then
26097 interface1to4(2) = mod(int(real(iface1d-nintface(1)-1,preal)/real(ngdim(3),preal)),ngdim(1))+1
26098 interface1to4(3) = int(real(iface1d-nintface(1)-1,preal)/real(ngdim(3),preal)/real(ngdim(1),preal))+1
26099 elseif (iface1d > nintface(2) + nintface(1) .and. iface1d <= (nintface(3) + nintface(2) + nintface(1)))
then
26101 interface1to4(2) = mod((iface1d-nintface(2)-nintface(1)-1),ngdim(1))+1
26102 interface1to4(3) = mod(int(real(iface1d-nintface(2)-nintface(1)-1,preal)/real(ngdim(1),preal)),ngdim(2))+1
26103 interface1to4(4) = int(real(iface1d-nintface(2)-nintface(1)-1,preal)/real(ngdim(1),preal)/real(ngdim(2),preal))+1
26109 end submodule homogenization_mech_rgc
26110 # 55 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
26112 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/CPFEM.f90" 1
26142 real(
preal),
dimension (:,:,:),
allocatable,
private :: &
26144 real(
preal),
dimension (:,:,:,:),
allocatable,
private :: &
26146 real(
preal),
dimension (:,:,:,:),
allocatable,
private :: &
26147 cpfem_dcsde_knowngood
26148 integer(pInt),
public :: &
26149 cyclecounter = 0_pint, &
26150 theinc = -1_pint, &
26152 real(
preal),
public :: &
26153 thetime = 0.0_preal, &
26154 thedelta = 0.0_preal
26155 logical,
public :: &
26156 outdatedffn1 = .false., &
26157 lastincconverged = .false., &
26158 outdatedbynewinc = .false.
26160 logical,
public,
protected :: &
26161 cpfem_init_done = .false.
26162 logical,
private :: &
26163 cpfem_calc_done = .false.
26165 integer(pInt),
parameter,
public :: &
26166 cpfem_collect = 2_pint**0_pint, &
26167 cpfem_calcresults = 2_pint**1_pint, &
26168 cpfem_ageresults = 2_pint**2_pint, &
26169 cpfem_backupjacobian = 2_pint**3_pint, &
26170 cpfem_restorejacobian = 2_pint**4_pint
26185 integer(pInt),
intent(in) :: el, & !< FE el number
26189 if (.not. cpfem_init_done)
then
26207 cpfem_init_done = .true.
26219 write(6,
'(/,a)')
' <<<+- CPFEM init -+>>>'
26227 write(6,
'(a32,1x,6(i8,1x))')
'CPFEM_cs: ', shape(cpfem_cs)
26228 write(6,
'(a32,1x,6(i8,1x))')
'CPFEM_dcsdE: ', shape(cpfem_dcsde)
26229 write(6,
'(a32,1x,6(i8,1x),/)')
'CPFEM_dcsdE_knownGood: ', shape(cpfem_dcsde_knowngood)
26239 subroutine cpfem_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyStress, jacobian)
26241 integer(pInt),
intent(in) :: elFE, & !< FE element number
26243 real(pReal),
intent(in) :: dt
26244 real(pReal),
dimension (3,3),
intent(in) :: ffn, & !< deformation gradient for t=t0
26246 integer(pInt),
intent(in) :: mode
26247 real(pReal),
intent(in) :: temperature_inp
26248 logical,
intent(in) :: parallelExecution
26249 real(pReal),
dimension(6),
intent(out) :: cauchyStress
26250 real(pReal),
dimension(6,6),
intent(out) :: jacobian
26252 real(pReal) J_inverse, &
26254 real(pReal),
dimension (3,3) :: Kirchhoff, &
26256 real(pReal),
dimension (3,3,3,3) :: H_sym, &
26260 integer(pInt) elCP, &
26261 i, j, k, l, m, n, ph, homog, mySource
26264 real(pReal),
parameter :: ODD_STRESS = 1e15_preal, &
26265 odd_jacobian = 1e50_preal
26271 write(6,
'(/,a)')
'#############################################'
26272 write(6,
'(a1,a22,1x,i8,a13)')
'#',
'element', elcp,
'#'
26273 write(6,
'(a1,a22,1x,i8,a13)')
'#',
'ip', ip,
'#'
26274 write(6,
'(a1,a22,1x,f15.7,a6)')
'#',
'theTime', thetime,
'#'
26275 write(6,
'(a1,a22,1x,f15.7,a6)')
'#',
'theDelta', thedelta,
'#'
26276 write(6,
'(a1,a22,1x,i8,a13)')
'#',
'theInc', theinc,
'#'
26277 write(6,
'(a1,a22,1x,i8,a13)')
'#',
'cycleCounter', cyclecounter,
'#'
26278 write(6,
'(a1,a22,1x,i8,a13)')
'#',
'computationMode',mode,
'#'
26280 write(6,
'(a,/)')
'# --- terminallyIll --- #'
26281 write(6,
'(a,/)')
'#############################################';
flush (6)
26284 if (iand(mode, cpfem_backupjacobian) /= 0_pint) &
26285 cpfem_dcsde_knowngood = cpfem_dcsde
26286 if (iand(mode, cpfem_restorejacobian) /= 0_pint) &
26287 cpfem_dcsde = cpfem_dcsde_knowngood
26290 if (iand(mode, cpfem_ageresults) /= 0_pint)
call cpfem_forward
26295 if (.not. parallelexecution)
then
26300 end select chosenthermal1
26304 elseif (iand(mode, cpfem_collect) /= 0_pint)
then
26305 call random_number(rnd)
26306 if (rnd < 0.5_preal) rnd = rnd - 1.0_preal
26307 cpfem_cs(1:6,ip,elcp) = rnd * odd_stress
26313 end select chosenthermal2
26316 cpfem_calc_done = .false.
26321 if (iand(mode, cpfem_calcresults) /= 0_pint)
then
26325 .or. outdatedffn1 &
26329 write(6,
'(a,1x,i8,1x,i2)')
'<< CPFEM >> OUTDATED at elFE ip',elfe,ip
26330 write(6,
'(a,/,3(12x,3(f10.6,1x),/))')
'<< CPFEM >> FFN1 old:',&
26332 write(6,
'(a,/,3(12x,3(f10.6,1x),/))')
'<< CPFEM >> FFN1 now:',transpose(ffn1)
26334 outdatedffn1 = .true.
26336 call random_number(rnd)
26337 if (rnd < 0.5_preal) rnd = rnd - 1.0_preal
26338 cpfem_cs(1:6,ip,elcp) = odd_stress * rnd
26342 else validcalculation
26345 if (.not. parallelexecution)
then
26349 write(6,
'(a,i8,1x,i2)')
'<< CPFEM >> calculation for elFE ip ',elfe,ip
26353 elseif (.not. cpfem_calc_done)
then
26355 write(6,
'(a,i8,a,i8)')
'<< CPFEM >> calculation for elements ',
fesolving_execelem(1),&
26358 cpfem_calc_done = .true.
26364 call random_number(rnd)
26365 if (rnd < 0.5_preal) rnd = rnd - 1.0_preal
26366 cpfem_cs(1:6,ip,elcp) = odd_stress * rnd
26369 else terminalillness
26374 cpfem_cs(1:6,ip,elcp) =
math_sym33to6(j_inverse * kirchhoff,weighted=.false.)
26378 do i=1,3;
do j=1,3;
do k=1,3;
do l=1,3;
do m=1,3;
do n=1,3
26379 h(i,j,k,l) = h(i,j,k,l) &
26385 enddo; enddo; enddo; enddo; enddo;
enddo
26387 forall(i=1:3, j=1:3,k=1:3,l=1:3) &
26388 h_sym(i,j,k,l) = 0.25_preal * (h(i,j,k,l) + h(j,i,k,l) + h(i,j,l,k) + h(j,i,l,k))
26390 cpfem_dcsde(1:6,1:6,ip,elcp) =
math_sym3333to66(j_inverse * h_sym,weighted=.false.)
26392 endif terminalillness
26393 endif validcalculation
26399 write(6,
'(a,i8,1x,i2,/,12x,6(f10.3,1x)/)') &
26400 '<< CPFEM >> stress/MPa at elFE ip ', elfe, ip, cpfem_cs(1:6,ip,elcp)*1.0e-6_preal
26401 write(6,
'(a,i8,1x,i2,/,6(12x,6(f10.3,1x)/))') &
26402 '<< CPFEM >> Jacobian/GPa at elFE ip ', elfe, ip, transpose(cpfem_dcsde(1:6,1:6,ip,elcp))*1.0e-9_preal
26409 if (all(abs(cpfem_dcsde(1:6,1:6,ip,elcp)) < 1e-10_preal))
call io_warning(601,elcp,ip)
26412 cauchystress = cpfem_cs(1:6, ip,elcp)
26413 jacobian = cpfem_dcsde(1:6,1:6,ip,elcp)
26417 cauchystress33 =
math_6tosym33(cpfem_cs(1:6,ip,elcp),weighted=.false.)
26427 jacobian3333 =
math_66tosym3333(cpfem_dcsde(1:6,1:6,ip,elcp),weighted=.false.)
26455 integer(pInt),
intent(in) :: inc
26456 real(pReal),
intent(in) :: time
26470 # 56 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/commercialFEM_fileList.f90" 2
26471 # 163 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/DAMASK_marc.f90" 2
26481 subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
26482 dispt,coord,ffn,frotn,strechn,eigvn,ffn1,frotn1, &
26483 strechn1,eigvn1,ncrd,itel,ndeg,ndm,nnode, &
26484 jtype,lclass,ifr,ifu)
26495 integer,
intent(in) :: &
26496 ngens, & !< size of stress-strain law
26497 nn, & !< integration point number
26498 ndi, & !< number of direct components
26499 nshear, & !< number of shear components
26500 ncrd, & !< number of coordinates
26501 itel, & !< dimension of F and R, either 2 or 3
26502 ndeg, & !< number of degrees of freedom
26503 ndm, & !< not specified in MSC.Marc 2012 Manual D
26504 nnode, & !< number of nodes per element
26505 jtype, & !< element type
26506 ifr, & !< set to 1 if R has been calculated
26508 integer,
dimension(2),
intent(in) :: &
26509 m, & !< (1) user element number, (2) internal element number
26510 matus, & !< (1) user material identification number, (2) internal material identification number
26511 kcus, & !< (1) layer number, (2) internal layer number
26513 real(pReal),
dimension(*),
intent(in) :: &
26514 e, & !< total elastic strain
26515 de, & !< increment of strain
26517 real(pReal),
dimension(itel),
intent(in) :: &
26518 strechn, & !< square of principal stretch ratios, lambda(i) at t=n
26520 real(pReal),
dimension(3,3),
intent(in) :: &
26521 ffn, & !< deformation gradient at t=n
26523 real(pReal),
dimension(itel,*),
intent(in) :: &
26524 frotn, & !< rotation tensor at t=n
26525 eigvn, & !< i principal direction components for j eigenvalues at t=n
26526 frotn1, & !< rotation tensor at t=n+1
26528 real(pReal),
dimension(ndeg,*),
intent(in) :: &
26529 disp, & !< incremental displacements
26531 real(pReal),
dimension(ncrd,*),
intent(in) :: &
26533 real(pReal),
dimension(*),
intent(inout) :: &
26535 real(pReal),
dimension(ndi+nshear),
intent(out) :: &
26536 s, & !< stress - should be updated by user
26538 real(pReal),
dimension(ngens,ngens),
intent(out) :: &
26549 real(pReal),
dimension(6) :: stress
26550 real(pReal),
dimension(6,6) :: ddsdde
26551 integer :: computationMode, i, cp_en, node, CPnodeID
26555 write(6,
'(a,/,i8,i8,i2)')
' MSC.MARC information on shape of element(2), IP:', m, nn
26556 write(6,
'(a,2(i1))')
' Jacobian: ', ngens,ngens
26557 write(6,
'(a,i1)')
' Direct stress: ', ndi
26558 write(6,
'(a,i1)')
' Shear stress: ', nshear
26559 write(6,
'(a,i2)')
' DoF: ', ndeg
26560 write(6,
'(a,i2)')
' Coordinates: ', ncrd
26561 write(6,
'(a,i12)')
' Nodes: ', nnode
26562 write(6,
'(a,i1)')
' Deformation gradient: ', itel
26563 write(6,
'(/,a,/,3(3(f12.7,1x)/))',advance=
'no')
' Deformation gradient at t=n:', &
26565 write(6,
'(/,a,/,3(3(f12.7,1x)/))',advance=
'no')
' Deformation gradient at t=n+1:', &
26575 computationmode = 0
26576 if (lovl == 4 )
then
26577 if (timinc < thedelta .and. theinc == inc .and. lastlovl /= lovl) &
26578 computationmode = cpfem_restorejacobian
26579 elseif (lovl == 6)
then
26581 if (cptim > thetime .or. inc /= theinc)
then
26585 lastincconverged = .false.
26586 outdatedbynewinc = .false.
26589 write(6,
'(a,i6,1x,i2)')
'<< HYPELA2 >> start of analysis..! ',m(1),nn
26591 else if (inc - theinc > 1)
then
26592 lastincconverged = .false.
26593 outdatedbynewinc = .false.
26595 write(6,
'(a,i6,1x,i2)')
'<< HYPELA2 >> restart of analysis..! ',m(1),nn
26598 lastincconverged = .true.
26599 outdatedbynewinc = .true.
26601 write(6,
'(a,i6,1x,i2)')
'<< HYPELA2 >> new increment..! ',m(1),nn
26604 else if ( timinc < thedelta )
then
26605 lastincconverged = .false.
26606 outdatedbynewinc = .false.
26610 write(6,
'(a,i6,1x,i2)')
'<< HYPELA2 >> cutback detected..! ',m(1),nn
26618 computationmode = cpfem_calcresults
26619 if (lastlovl /= lovl)
then
26621 outdatedffn1 = .false.
26622 cyclecounter = cyclecounter + 1
26626 if (outdatedbynewinc)
then
26627 computationmode = ior(computationmode,cpfem_ageresults)
26628 outdatedbynewinc = .false.
26631 computationmode = cpfem_collect
26634 if (lastincconverged)
then
26635 computationmode = ior(computationmode,cpfem_backupjacobian)
26636 lastincconverged = .false.
26645 computationmode = cpfem_calcresults
26646 if (lastlovl /= lovl)
then
26650 outdatedffn1 = .false.
26651 cyclecounter = cyclecounter + 1
26655 if (outdatedbynewinc)
then
26656 computationmode = ior(computationmode,cpfem_ageresults)
26657 outdatedbynewinc = .false.
26659 if (lastincconverged)
then
26660 computationmode = ior(computationmode,cpfem_backupjacobian)
26661 lastincconverged = .false.
26674 d = ddsdde(1:ngens,1:ngens)
26675 s = stress(1:ndi+nshear)
26687 subroutine flux(f,ts,n,time)
26693 real(pReal),
dimension(6),
intent(in) :: &
26695 integer,
dimension(10),
intent(in) :: &
26697 real(pReal),
intent(in) :: &
26699 real(pReal),
dimension(2),
intent(out) :: &
26704 end subroutine flux
26713 subroutine uedinc(inc,incsub)
26718 integer,
intent(in) :: inc, incsub
26719 integer,
save :: inc_written
26722 if (inc > inc_written)
then