1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/lattice.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/lattice.f90"
25 integer,
dimension(2),
parameter :: &
28 integer,
dimension(1),
parameter :: &
31 integer,
dimension(1),
parameter :: &
34 integer,
dimension(1),
parameter :: &
37 integer,
parameter :: &
50 real(
preal),
dimension(3+3,FCC_NSLIP),
parameter :: &
74 real(
preal),
dimension(3+3,FCC_NTWIN),
parameter :: &
90 integer,
dimension(2,FCC_NTWIN),
parameter,
public :: &
106 real(
preal),
dimension(3+3,FCC_NCLEAVAGE),
parameter :: &
116 integer,
dimension(2),
parameter :: &
119 integer,
dimension(1),
parameter :: &
122 integer,
dimension(1),
parameter :: &
125 integer,
parameter :: &
136 real(
preal),
dimension(3+3,BCC_NSLIP),
parameter :: &
167 real(
preal),
dimension(3+3,BCC_NTWIN),
parameter :: &
184 real(
preal),
dimension(3+3,BCC_NCLEAVAGE),
parameter :: &
194 integer,
dimension(6),
parameter :: &
197 integer,
dimension(4),
parameter :: &
200 integer,
parameter :: &
209 real(
preal),
dimension(4+4,HEX_NSLIP),
parameter :: &
213 2, -1, -1, 0, 0, 0, 0, 1, &
214 -1, 2, -1, 0, 0, 0, 0, 1, &
215 -1, -1, 2, 0, 0, 0, 0, 1, &
217 2, -1, -1, 0, 0, 1, -1, 0, &
218 -1, 2, -1, 0, -1, 0, 1, 0, &
219 -1, -1, 2, 0, 1, -1, 0, 0, &
221 -1, 1, 0, 0, 1, 1, -2, 0, &
222 0, -1, 1, 0, -2, 1, 1, 0, &
223 1, 0, -1, 0, 1, -2, 1, 0, &
225 -1, 2, -1, 0, 1, 0, -1, 1, &
226 -2, 1, 1, 0, 0, 1, -1, 1, &
227 -1, -1, 2, 0, -1, 1, 0, 1, &
228 1, -2, 1, 0, -1, 0, 1, 1, &
229 2, -1, -1, 0, 0, -1, 1, 1, &
230 1, 1, -2, 0, 1, -1, 0, 1, &
232 -2, 1, 1, 3, 1, 0, -1, 1, &
233 -1, -1, 2, 3, 1, 0, -1, 1, &
234 -1, -1, 2, 3, 0, 1, -1, 1, &
235 1, -2, 1, 3, 0, 1, -1, 1, &
236 1, -2, 1, 3, -1, 1, 0, 1, &
237 2, -1, -1, 3, -1, 1, 0, 1, &
238 2, -1, -1, 3, -1, 0, 1, 1, &
239 1, 1, -2, 3, -1, 0, 1, 1, &
240 1, 1, -2, 3, 0, -1, 1, 1, &
241 -1, 2, -1, 3, 0, -1, 1, 1, &
242 -1, 2, -1, 3, 1, -1, 0, 1, &
243 -2, 1, 1, 3, 1, -1, 0, 1, &
245 -1, -1, 2, 3, 1, 1, -2, 2, &
246 1, -2, 1, 3, -1, 2, -1, 2, &
247 2, -1, -1, 3, -2, 1, 1, 2, &
248 1, 1, -2, 3, -1, -1, 2, 2, &
249 -1, 2, -1, 3, 1, -2, 1, 2, &
250 -2, 1, 1, 3, 2, -1, -1, 2 &
253 real(
preal),
dimension(4+4,HEX_NTWIN),
parameter :: &
256 -1, 0, 1, 1, 1, 0, -1, 2, &
257 0, -1, 1, 1, 0, 1, -1, 2, &
258 1, -1, 0, 1, -1, 1, 0, 2, &
259 1, 0, -1, 1, -1, 0, 1, 2, &
260 0, 1, -1, 1, 0, -1, 1, 2, &
261 -1, 1, 0, 1, 1, -1, 0, 2, &
263 -1, -1, 2, 6, 1, 1, -2, 1, &
264 1, -2, 1, 6, -1, 2, -1, 1, &
265 2, -1, -1, 6, -2, 1, 1, 1, &
266 1, 1, -2, 6, -1, -1, 2, 1, &
267 -1, 2, -1, 6, 1, -2, 1, 1, &
268 -2, 1, 1, 6, 2, -1, -1, 1, &
270 1, 0, -1, -2, 1, 0, -1, 1, &
271 0, 1, -1, -2, 0, 1, -1, 1, &
272 -1, 1, 0, -2, -1, 1, 0, 1, &
273 -1, 0, 1, -2, -1, 0, 1, 1, &
274 0, -1, 1, -2, 0, -1, 1, 1, &
275 1, -1, 0, -2, 1, -1, 0, 1, &
277 1, 1, -2, -3, 1, 1, -2, 2, &
278 -1, 2, -1, -3, -1, 2, -1, 2, &
279 -2, 1, 1, -3, -2, 1, 1, 2, &
280 -1, -1, 2, -3, -1, -1, 2, 2, &
281 1, -2, 1, -3, 1, -2, 1, 2, &
282 2, -1, -1, -3, 2, -1, -1, 2 &
287 integer,
dimension(13),
parameter :: &
288 bct_nslipsystem = [2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 4, 8, 8 ]
290 integer,
parameter :: &
297 real(
preal),
dimension(3+3,BCT_NSLIP),
parameter :: &
312 -1,-1,-1, -1, 1, 0, &
313 -1,-1, 1, -1, 1, 0, &
331 -1, 0,-1, -1, 0, 1, &
351 -1, 0,-1, -1, 2, 1, &
354 -1, 0,-1, -1,-2, 1, &
360 -1,-1, 1, -1, 2, 1, &
363 -1, 1, 1, -1,-2, 1, &
369 integer,
dimension(3),
parameter :: &
372 integer,
parameter :: &
379 real(
preal),
dimension(3+3,ORT_NCLEAVAGE),
parameter :: &
388 enum,
bind(c); enumerator :: &
399 real(
preal),
dimension(:),
allocatable,
public,
protected :: &
404 real(
preal),
dimension(:,:,:),
allocatable,
public,
protected :: &
408 integer(kind(lattice_UNDEFINED_ID)),
dimension(:),
allocatable,
public,
protected :: &
458 integer :: nphases, p,i
459 character(len=pStringLen) :: structure =
''
461 write(6,
'(/,a)')
' <<<+- lattice init -+>>>';
flush(6)
466 allocate(
lattice_c66(6,6,nphases), source=0.0_preal)
474 source=[(0.0_preal,i=1,nphases)])
489 structure =
config_phase(p)%getString(
'lattice_structure')
490 select case(trim(structure))
504 call io_error(130,ext_msg=
'lattice_init: '//trim(structure))
515 call io_error(135,el=i,ip=p,ext_msg=
'matrix diagonal "el"ement of phase "ip"')
548 integer,
dimension(:),
intent(in) :: ntwin
549 character(len=*),
intent(in) :: structure
550 real(
preal),
intent(in) :: covera
551 real(
preal),
dimension(sum(Ntwin)) :: characteristicshear
554 a, & !< index of active system
555 p, & !< index in potential system list
556 f, & !< index of my family
559 integer,
dimension(HEX_NTWIN),
parameter :: &
560 hex_sheartwin = reshape( [&
587 if (len_trim(structure) /= 3) &
588 call io_error(137,ext_msg=
'lattice_characteristicShear_Twin: '//trim(structure))
591 myfamilies:
do f = 1,
size(ntwin,1)
592 mysystems:
do s = 1,ntwin(f)
594 select case(structure)
596 characteristicshear(a) = 0.5_preal*sqrt(2.0_preal)
598 if (covera < 1.0_preal .or. covera > 2.0_preal) &
599 call io_error(131,ext_msg=
'lattice_characteristicShear_Twin')
601 select case(hex_sheartwin(p))
603 characteristicshear(a) = (3.0_preal-covera**2.0_preal)/sqrt(3.0_preal)/covera
605 characteristicshear(a) = 1.0_preal/covera
607 characteristicshear(a) = (4.0_preal*covera**2.0_preal-9.0_preal)/sqrt(48.0_preal)/covera
609 characteristicshear(a) = 2.0_preal*(covera**2.0_preal-2.0_preal)/3.0_preal/covera
612 call io_error(137,ext_msg=
'lattice_characteristicShear_Twin: '//trim(structure))
625 integer,
dimension(:),
intent(in) :: ntwin
626 character(len=*),
intent(in) :: structure
627 real(
preal),
dimension(6,6),
intent(in) :: c66
628 real(
preal),
intent(in) :: covera
631 real(
preal),
dimension(3,3,sum(Ntwin)):: coordinatesystem
635 if (len_trim(structure) /= 3) &
636 call io_error(137,ext_msg=
'lattice_C66_twin: '//trim(structure))
638 select case(structure)
641 trim(structure),0.0_preal)
644 trim(structure),0.0_preal)
649 call io_error(137,ext_msg=
'lattice_C66_twin: '//trim(structure))
653 call r%fromAxisAngle([coordinatesystem(1:3,2,i),
pi],p=1)
664 cOverA_trans,a_bcc,a_fcc)
666 integer,
dimension(:),
intent(in) :: ntrans
667 character(len=*),
intent(in) :: structure_target
668 real(
preal),
dimension(6,6),
intent(in) :: c_parent66
671 real(
preal),
dimension(6,6) :: c_bar66, c_target_unrotated66
672 real(
preal),
dimension(3,3,sum(Ntrans)) :: q,s
674 real(
preal) :: a_bcc, a_fcc, covera_trans
677 if (len_trim(structure_target) /= 3) &
678 call io_error(137,ext_msg=
'lattice_C66_trans (target): '//trim(structure_target))
682 if (structure_target(1:3) ==
'hex')
then
683 if (covera_trans < 1.0_preal .or. covera_trans > 2.0_preal) &
684 call io_error(131,ext_msg=
'lattice_C66_trans: '//trim(structure_target))
685 c_bar66(1,1) = (c_parent66(1,1) + c_parent66(1,2) + 2.0_preal*c_parent66(4,4))/2.0_preal
686 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
687 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
688 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
689 c_bar66(4,4) = (c_parent66(1,1) - c_parent66(1,2) + c_parent66(4,4))/3.0_preal
690 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))
692 c_target_unrotated66 = 0.0_preal
693 c_target_unrotated66(1,1) = c_bar66(1,1) - c_bar66(1,4)**2.0_preal/c_bar66(4,4)
694 c_target_unrotated66(1,2) = c_bar66(1,2) + c_bar66(1,4)**2.0_preal/c_bar66(4,4)
695 c_target_unrotated66(1,3) = c_bar66(1,3)
696 c_target_unrotated66(3,3) = c_bar66(3,3)
697 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)))
699 elseif (structure_target(1:3) ==
'bcc')
then
700 if (a_bcc <= 0.0_preal .or. a_fcc <= 0.0_preal) &
701 call io_error(134,ext_msg=
'lattice_C66_trans: '//trim(structure_target))
702 c_target_unrotated66 = c_parent66
704 call io_error(137,ext_msg=
'lattice_C66_trans : '//trim(structure_target))
709 call io_error(135,el=i,ext_msg=
'matrix diagonal "el"ement in transformation')
714 do i = 1, sum(ntrans)
715 call r%fromMatrix(q(1:3,1:3,i))
729 integer,
dimension(:),
intent(in) :: nslip
730 real(
preal),
dimension(:),
intent(in) :: nonschmidcoefficients
731 integer,
intent(in) :: sense
732 real(
preal),
dimension(1:3,1:3,sum(Nslip)) :: nonschmidmatrix
734 real(
preal),
dimension(1:3,1:3,sum(Nslip)) :: coordinatesystem
735 real(
preal),
dimension(3) :: direction, normal, np
739 if (abs(sense) /= 1)
call io_error(0,ext_msg=
'lattice_nonSchmidMatrix')
743 coordinatesystem(1:3,1,1:sum(nslip)) = coordinatesystem(1:3,1,1:sum(nslip))*real(sense,
preal)
747 direction = coordinatesystem(1:3,1,i)
748 normal = coordinatesystem(1:3,2,i)
749 call r%fromAxisAngle([direction,60.0_preal],degrees=.true.,p=1)
750 np = r%rotate(normal)
752 if (
size(nonschmidcoefficients)>0) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
753 + nonschmidcoefficients(1) *
math_outer(direction, np)
754 if (
size(nonschmidcoefficients)>1) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
756 if (
size(nonschmidcoefficients)>2) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
758 if (
size(nonschmidcoefficients)>3) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
759 + nonschmidcoefficients(4) *
math_outer(normal, normal)
760 if (
size(nonschmidcoefficients)>4) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
763 if (
size(nonschmidcoefficients)>5) nonschmidmatrix(1:3,1:3,i) = nonschmidmatrix(1:3,1:3,i) &
764 + nonschmidcoefficients(6) *
math_outer(direction, direction)
776 integer,
dimension(:),
intent(in) :: nslip
777 real(
preal),
dimension(:),
intent(in) :: interactionvalues
778 character(len=*),
intent(in) :: structure
779 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: interactionmatrix
781 integer,
dimension(:),
allocatable :: nslipmax
782 integer,
dimension(:,:),
allocatable :: interactiontypes
784 integer,
dimension(FCC_NSLIP,FCC_NSLIP),
parameter :: &
785 fcc_interactionslipslip = reshape( [&
786 1, 2, 2, 4, 6, 5, 3, 5, 5, 4, 5, 6, 9,10, 9,10,11,12, &
787 2, 1, 2, 6, 4, 5, 5, 4, 6, 5, 3, 5, 9,10,11,12, 9,10, &
788 2, 2, 1, 5, 5, 3, 5, 6, 4, 6, 5, 4, 11,12, 9,10, 9,10, &
789 4, 6, 5, 1, 2, 2, 4, 5, 6, 3, 5, 5, 9,10,10, 9,12,11, &
790 6, 4, 5, 2, 1, 2, 5, 3, 5, 5, 4, 6, 9,10,12,11,10, 9, &
791 5, 5, 3, 2, 2, 1, 6, 5, 4, 5, 6, 4, 11,12,10, 9,10, 9, &
792 3, 5, 5, 4, 5, 6, 1, 2, 2, 4, 6, 5, 10, 9,10, 9,11,12, &
793 5, 4, 6, 5, 3, 5, 2, 1, 2, 6, 4, 5, 10, 9,12,11, 9,10, &
794 5, 6, 4, 6, 5, 4, 2, 2, 1, 5, 5, 3, 12,11,10, 9, 9,10, &
795 4, 5, 6, 3, 5, 5, 4, 6, 5, 1, 2, 2, 10, 9, 9,10,12,11, &
796 5, 3, 5, 5, 4, 6, 6, 4, 5, 2, 1, 2, 10, 9,11,12,10, 9, &
797 6, 5, 4, 5, 6, 4, 5, 5, 3, 2, 2, 1, 12,11, 9,10,10, 9, &
799 9, 9,11, 9, 9,11,10,10,12,10,10,12, 1, 7, 8, 8, 8, 8, &
800 10,10,12,10,10,12, 9, 9,11, 9, 9,11, 7, 1, 8, 8, 8, 8, &
801 9,11, 9,10,12,10,10,12,10, 9,11, 9, 8, 8, 1, 7, 8, 8, &
802 10,12,10, 9,11, 9, 9,11, 9,10,12,10, 8, 8, 7, 1, 8, 8, &
803 11, 9, 9,12,10,10,11, 9, 9,12,10,10, 8, 8, 8, 8, 1, 7, &
804 12,10,10,11, 9, 9,12,10,10,11, 9, 9, 8, 8, 8, 8, 7, 1 &
805 ],shape(fcc_interactionslipslip))
819 integer,
dimension(BCC_NSLIP,BCC_NSLIP),
parameter :: &
820 bcc_interactionslipslip = reshape( [&
821 1,2,6,6,5,4,4,3,4,3,5,4, 6,6,4,3,3,4,6,6,4,3,6,6, &
822 2,1,6,6,4,3,5,4,5,4,4,3, 6,6,3,4,4,3,6,6,3,4,6,6, &
823 6,6,1,2,4,5,3,4,4,5,3,4, 4,3,6,6,6,6,3,4,6,6,4,3, &
824 6,6,2,1,3,4,4,5,3,4,4,5, 3,4,6,6,6,6,4,3,6,6,3,4, &
825 5,4,4,3,1,2,6,6,3,4,5,4, 3,6,4,6,6,4,6,3,4,6,3,6, &
826 4,3,5,4,2,1,6,6,4,5,4,3, 4,6,3,6,6,3,6,4,3,6,4,6, &
827 4,5,3,4,6,6,1,2,5,4,3,4, 6,3,6,4,4,6,3,6,6,4,6,3, &
828 3,4,4,5,6,6,2,1,4,3,4,5, 6,4,6,3,3,6,4,6,6,3,6,4, &
829 4,5,4,3,3,4,5,4,1,2,6,6, 3,6,6,4,4,6,6,3,6,4,3,6, &
830 3,4,5,4,4,5,4,3,2,1,6,6, 4,6,6,3,3,6,6,4,6,3,4,6, &
831 5,4,3,4,5,4,3,4,6,6,1,2, 6,3,4,6,6,4,3,6,4,6,6,3, &
832 4,3,4,5,4,3,4,5,6,6,2,1, 6,4,3,6,6,3,4,6,3,6,6,4, &
834 6,6,4,3,3,4,6,6,3,4,6,6, 1,5,6,6,5,6,6,3,5,6,3,6, &
835 6,6,3,4,6,6,3,4,6,6,3,4, 5,1,6,6,6,5,3,6,6,5,6,3, &
836 4,3,6,6,4,3,6,6,6,6,4,3, 6,6,1,5,6,3,5,6,3,6,5,6, &
837 3,4,6,6,6,6,4,3,4,3,6,6, 6,6,5,1,3,6,6,5,6,3,6,5, &
838 3,4,6,6,6,6,4,3,4,3,6,6, 5,6,6,3,1,6,5,6,5,3,6,6, &
839 4,3,6,6,4,3,6,6,6,6,4,3, 6,5,3,6,6,1,6,5,3,5,6,6, &
840 6,6,3,4,6,6,3,4,6,6,3,4, 6,3,5,6,5,6,1,6,6,6,5,3, &
841 6,6,4,3,3,4,6,6,3,4,6,6, 3,6,6,5,6,5,6,1,6,6,3,5, &
842 4,3,6,6,4,3,6,6,6,6,4,3, 5,6,3,6,5,3,6,6,1,6,6,5, &
843 3,4,6,6,6,6,4,3,4,3,6,6, 6,5,6,3,3,5,6,6,6,1,5,6, &
844 6,6,4,3,3,4,6,6,3,4,6,6, 3,6,5,6,6,6,5,3,6,5,1,6, &
845 6,6,3,4,6,6,3,4,6,6,3,4, 6,3,6,5,6,6,3,5,5,6,6,1 &
846 ],shape(bcc_interactionslipslip))
854 integer,
dimension(HEX_NSLIP,HEX_NSLIP),
parameter :: &
855 hex_interactionslipslip = reshape( [&
856 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, &
857 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, &
858 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, &
860 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, &
861 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, &
862 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, &
864 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, &
865 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, &
866 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, &
868 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, &
869 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, &
870 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, &
871 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, &
872 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, &
873 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, &
875 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, &
876 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, &
877 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, &
878 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, &
879 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, &
880 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, &
881 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, &
882 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, &
883 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, &
884 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, &
885 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, &
886 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, &
888 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, &
889 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, &
890 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, &
891 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, &
892 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, &
893 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 &
894 ],shape(hex_interactionslipslip))
896 integer,
dimension(BCT_NSLIP,BCT_NSLIP),
parameter :: &
897 bct_interactionslipslip = reshape( [&
898 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, &
899 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, &
901 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, &
902 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, &
904 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, &
905 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, &
907 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, &
908 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, &
909 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, &
910 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, &
912 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, &
913 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, &
915 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, &
916 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, &
917 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, &
918 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, &
920 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, &
921 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, &
923 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, &
924 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, &
926 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, &
927 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, &
928 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, &
929 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, &
931 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, &
932 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, &
933 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, &
934 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, &
935 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, &
936 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, &
937 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, &
938 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, &
940 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, &
941 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, &
942 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, &
943 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, &
945 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, &
946 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, &
947 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, &
948 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, &
949 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, &
950 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, &
951 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, &
952 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, &
954 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, &
955 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, &
956 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, &
957 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, &
958 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, &
959 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, &
960 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, &
961 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 &
962 ],shape(bct_interactionslipslip))
965 if (len_trim(structure) /= 3) &
966 call io_error(137,ext_msg=
'lattice_interaction_SlipBySlip: '//trim(structure))
968 select case(structure)
970 interactiontypes = fcc_interactionslipslip
973 interactiontypes = bcc_interactionslipslip
976 interactiontypes = hex_interactionslipslip
979 interactiontypes = bct_interactionslipslip
982 call io_error(137,ext_msg=
'lattice_interaction_SlipBySlip: '//trim(structure))
985 interactionmatrix =
buildinteraction(nslip,nslip,nslipmax,nslipmax,interactionvalues,interactiontypes)
996 integer,
dimension(:),
intent(in) :: ntwin
997 real(
preal),
dimension(:),
intent(in) :: interactionvalues
998 character(len=*),
intent(in) :: structure
999 real(
preal),
dimension(sum(Ntwin),sum(Ntwin)) :: interactionmatrix
1001 integer,
dimension(:),
allocatable :: ntwinmax
1002 integer,
dimension(:,:),
allocatable :: interactiontypes
1004 integer,
dimension(FCC_NTWIN,FCC_NTWIN),
parameter :: &
1005 fcc_interactiontwintwin = reshape( [&
1006 1,1,1,2,2,2,2,2,2,2,2,2, &
1007 1,1,1,2,2,2,2,2,2,2,2,2, &
1008 1,1,1,2,2,2,2,2,2,2,2,2, &
1009 2,2,2,1,1,1,2,2,2,2,2,2, &
1010 2,2,2,1,1,1,2,2,2,2,2,2, &
1011 2,2,2,1,1,1,2,2,2,2,2,2, &
1012 2,2,2,2,2,2,1,1,1,2,2,2, &
1013 2,2,2,2,2,2,1,1,1,2,2,2, &
1014 2,2,2,2,2,2,1,1,1,2,2,2, &
1015 2,2,2,2,2,2,2,2,2,1,1,1, &
1016 2,2,2,2,2,2,2,2,2,1,1,1, &
1017 2,2,2,2,2,2,2,2,2,1,1,1 &
1018 ],shape(fcc_interactiontwintwin))
1020 integer,
dimension(BCC_NTWIN,BCC_NTWIN),
parameter :: &
1021 bcc_interactiontwintwin = reshape( [&
1022 1,3,3,3,3,3,3,2,3,3,2,3, &
1023 3,1,3,3,3,3,2,3,3,3,3,2, &
1024 3,3,1,3,3,2,3,3,2,3,3,3, &
1025 3,3,3,1,2,3,3,3,3,2,3,3, &
1026 3,3,3,2,1,3,3,3,3,2,3,3, &
1027 3,3,2,3,3,1,3,3,2,3,3,3, &
1028 3,2,3,3,3,3,1,3,3,3,3,2, &
1029 2,3,3,3,3,3,3,1,3,3,2,3, &
1030 3,3,2,3,3,2,3,3,1,3,3,3, &
1031 3,3,3,2,2,3,3,3,3,1,3,3, &
1032 2,3,3,3,3,3,3,2,3,3,1,3, &
1033 3,2,3,3,3,3,2,3,3,3,3,1 &
1034 ],shape(bcc_interactiontwintwin))
1038 integer,
dimension(HEX_NTWIN,HEX_NTWIN),
parameter :: &
1039 hex_interactiontwintwin = reshape( [&
1040 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1041 2, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1042 2, 2, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1043 2, 2, 2, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1044 2, 2, 2, 2, 1, 2, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1045 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 13,13,13,13,13,13, &
1047 6, 6, 6, 6, 6, 6, 4, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1048 6, 6, 6, 6, 6, 6, 5, 4, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1049 6, 6, 6, 6, 6, 6, 5, 5, 4, 5, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1050 6, 6, 6, 6, 6, 6, 5, 5, 5, 4, 5, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1051 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 5, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1052 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 8, 8, 8, 8, 8, 8, 14,14,14,14,14,14, &
1054 12,12,12,12,12,12, 11,11,11,11,11,11, 9,10,10,10,10,10, 15,15,15,15,15,15, &
1055 12,12,12,12,12,12, 11,11,11,11,11,11, 10, 9,10,10,10,10, 15,15,15,15,15,15, &
1056 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10, 9,10,10,10, 15,15,15,15,15,15, &
1057 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10, 9,10,10, 15,15,15,15,15,15, &
1058 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10,10, 9,10, 15,15,15,15,15,15, &
1059 12,12,12,12,12,12, 11,11,11,11,11,11, 10,10,10,10,10, 9, 15,15,15,15,15,15, &
1061 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 16,17,17,17,17,17, &
1062 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,16,17,17,17,17, &
1063 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,16,17,17,17, &
1064 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,16,17,17, &
1065 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,17,16,17, &
1066 20,20,20,20,20,20, 19,19,19,19,19,19, 18,18,18,18,18,18, 17,17,17,17,17,16 &
1067 ],shape(hex_interactiontwintwin))
1069 if (len_trim(structure) /= 3) &
1070 call io_error(137,ext_msg=
'lattice_interaction_TwinByTwin: '//trim(structure))
1072 select case(structure)
1074 interactiontypes = fcc_interactiontwintwin
1077 interactiontypes = bcc_interactiontwintwin
1080 interactiontypes = hex_interactiontwintwin
1083 call io_error(137,ext_msg=
'lattice_interaction_TwinByTwin: '//trim(structure))
1086 interactionmatrix =
buildinteraction(ntwin,ntwin,ntwinmax,ntwinmax,interactionvalues,interactiontypes)
1097 integer,
dimension(:),
intent(in) :: ntrans
1098 real(
preal),
dimension(:),
intent(in) :: interactionvalues
1099 character(len=*),
intent(in) :: structure
1100 real(
preal),
dimension(sum(Ntrans),sum(Ntrans)) :: interactionmatrix
1102 integer,
dimension(:),
allocatable :: ntransmax
1103 integer,
dimension(:,:),
allocatable :: interactiontypes
1105 integer,
dimension(FCC_NTRANS,FCC_NTRANS),
parameter :: &
1106 fcc_interactiontranstrans = reshape( [&
1107 1,1,1,2,2,2,2,2,2,2,2,2, &
1108 1,1,1,2,2,2,2,2,2,2,2,2, &
1109 1,1,1,2,2,2,2,2,2,2,2,2, &
1110 2,2,2,1,1,1,2,2,2,2,2,2, &
1111 2,2,2,1,1,1,2,2,2,2,2,2, &
1112 2,2,2,1,1,1,2,2,2,2,2,2, &
1113 2,2,2,2,2,2,1,1,1,2,2,2, &
1114 2,2,2,2,2,2,1,1,1,2,2,2, &
1115 2,2,2,2,2,2,1,1,1,2,2,2, &
1116 2,2,2,2,2,2,2,2,2,1,1,1, &
1117 2,2,2,2,2,2,2,2,2,1,1,1, &
1118 2,2,2,2,2,2,2,2,2,1,1,1 &
1119 ],shape(fcc_interactiontranstrans))
1121 if (len_trim(structure) /= 3) &
1122 call io_error(137,ext_msg=
'lattice_interaction_TransByTrans: '//trim(structure))
1124 if(structure ==
'fcc')
then
1125 interactiontypes = fcc_interactiontranstrans
1128 call io_error(137,ext_msg=
'lattice_interaction_TransByTrans: '//trim(structure))
1131 interactionmatrix =
buildinteraction(ntrans,ntrans,ntransmax,ntransmax,interactionvalues,interactiontypes)
1142 integer,
dimension(:),
intent(in) :: nslip, & !< number of active slip systems per family
1144 real(
preal),
dimension(:),
intent(in) :: interactionvalues
1145 character(len=*),
intent(in) :: structure
1146 real(
preal),
dimension(sum(Nslip),sum(Ntwin)) :: interactionmatrix
1148 integer,
dimension(:),
allocatable :: nslipmax, &
1150 integer,
dimension(:,:),
allocatable :: interactiontypes
1152 integer,
dimension(FCC_NTWIN,FCC_NSLIP),
parameter :: &
1153 fcc_interactionsliptwin = reshape( [&
1154 1,1,1,3,3,3,2,2,2,3,3,3, &
1155 1,1,1,3,3,3,3,3,3,2,2,2, &
1156 1,1,1,2,2,2,3,3,3,3,3,3, &
1157 3,3,3,1,1,1,3,3,3,2,2,2, &
1158 3,3,3,1,1,1,2,2,2,3,3,3, &
1159 2,2,2,1,1,1,3,3,3,3,3,3, &
1160 2,2,2,3,3,3,1,1,1,3,3,3, &
1161 3,3,3,2,2,2,1,1,1,3,3,3, &
1162 3,3,3,3,3,3,1,1,1,2,2,2, &
1163 3,3,3,2,2,2,3,3,3,1,1,1, &
1164 2,2,2,3,3,3,3,3,3,1,1,1, &
1165 3,3,3,3,3,3,2,2,2,1,1,1, &
1167 4,4,4,4,4,4,4,4,4,4,4,4, &
1168 4,4,4,4,4,4,4,4,4,4,4,4, &
1169 4,4,4,4,4,4,4,4,4,4,4,4, &
1170 4,4,4,4,4,4,4,4,4,4,4,4, &
1171 4,4,4,4,4,4,4,4,4,4,4,4, &
1172 4,4,4,4,4,4,4,4,4,4,4,4 &
1173 ],shape(fcc_interactionsliptwin))
1177 integer,
dimension(BCC_NTWIN,BCC_NSLIP),
parameter :: &
1178 bcc_interactionsliptwin = reshape( [&
1179 3,3,3,2,2,3,3,3,3,2,3,3, &
1180 3,3,2,3,3,2,3,3,2,3,3,3, &
1181 3,2,3,3,3,3,2,3,3,3,3,2, &
1182 2,3,3,3,3,3,3,2,3,3,2,3, &
1183 2,3,3,3,3,3,3,2,3,3,2,3, &
1184 3,3,2,3,3,2,3,3,2,3,3,3, &
1185 3,2,3,3,3,3,2,3,3,3,3,2, &
1186 3,3,3,2,2,3,3,3,3,2,3,3, &
1187 2,3,3,3,3,3,3,2,3,3,2,3, &
1188 3,3,3,2,2,3,3,3,3,2,3,3, &
1189 3,2,3,3,3,3,2,3,3,3,3,2, &
1190 3,3,2,3,3,2,3,3,2,3,3,3, &
1192 1,3,3,3,3,3,3,2,3,3,2,3, &
1193 3,1,3,3,3,3,2,3,3,3,3,2, &
1194 3,3,1,3,3,2,3,3,2,3,3,3, &
1195 3,3,3,1,2,3,3,3,3,2,3,3, &
1196 3,3,3,2,1,3,3,3,3,2,3,3, &
1197 3,3,2,3,3,1,3,3,2,3,3,3, &
1198 3,2,3,3,3,3,1,3,3,3,3,2, &
1199 2,3,3,3,3,3,3,1,3,3,2,3, &
1200 3,3,2,3,3,2,3,3,1,3,3,3, &
1201 3,3,3,2,2,3,3,3,3,1,3,3, &
1202 2,3,3,3,3,3,3,2,3,3,1,3, &
1203 3,2,3,3,3,3,2,3,3,3,3,1 &
1204 ],shape(bcc_interactionsliptwin))
1208 integer,
dimension(HEX_NTWIN,HEX_NSLIP),
parameter :: &
1209 hex_interactionsliptwin = reshape( [&
1210 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
1211 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
1212 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, &
1214 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
1215 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
1216 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, &
1218 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
1219 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
1220 9, 9, 9, 9, 9, 9, 10,10,10,10,10,10, 11,11,11,11,11,11, 12,12,12,12,12,12, &
1222 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1223 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1224 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1225 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1226 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1227 13,13,13,13,13,13, 14,14,14,14,14,14, 15,15,15,15,15,15, 16,16,16,16,16,16, &
1229 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1230 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1231 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1232 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1233 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1234 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1235 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1236 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1237 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1238 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1239 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1240 17,17,17,17,17,17, 18,18,18,18,18,18, 19,19,19,19,19,19, 20,20,20,20,20,20, &
1242 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
1243 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
1244 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
1245 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
1246 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24, &
1247 21,21,21,21,21,21, 22,22,22,22,22,22, 23,23,23,23,23,23, 24,24,24,24,24,24 &
1249 ],shape(hex_interactionsliptwin))
1251 if (len_trim(structure) /= 3) &
1252 call io_error(137,ext_msg=
'lattice_interaction_SlipByTwin: '//trim(structure))
1254 select case(structure)
1256 interactiontypes = fcc_interactionsliptwin
1260 interactiontypes = bcc_interactionsliptwin
1264 interactiontypes = hex_interactionsliptwin
1268 call io_error(137,ext_msg=
'lattice_interaction_SlipByTwin: '//trim(structure))
1271 interactionmatrix =
buildinteraction(nslip,ntwin,nslipmax,ntwinmax,interactionvalues,interactiontypes)
1282 integer,
dimension(:),
intent(in) :: nslip, & !< number of active slip systems per family
1284 real(
preal),
dimension(:),
intent(in) :: interactionvalues
1285 character(len=*),
intent(in) :: structure
1286 real(
preal),
dimension(sum(Nslip),sum(Ntrans)) :: interactionmatrix
1288 integer,
dimension(:),
allocatable :: nslipmax, &
1290 integer,
dimension(:,:),
allocatable :: interactiontypes
1292 integer,
dimension(FCC_NTRANS,FCC_NSLIP),
parameter :: &
1293 fcc_interactionsliptrans = reshape( [&
1294 1,1,1,3,3,3,2,2,2,3,3,3, &
1295 1,1,1,3,3,3,3,3,3,2,2,2, &
1296 1,1,1,2,2,2,3,3,3,3,3,3, &
1297 3,3,3,1,1,1,3,3,3,2,2,2, &
1298 3,3,3,1,1,1,2,2,2,3,3,3, &
1299 2,2,2,1,1,1,3,3,3,3,3,3, &
1300 2,2,2,3,3,3,1,1,1,3,3,3, &
1301 3,3,3,2,2,2,1,1,1,3,3,3, &
1302 3,3,3,3,3,3,1,1,1,2,2,2, &
1303 3,3,3,2,2,2,3,3,3,1,1,1, &
1304 2,2,2,3,3,3,3,3,3,1,1,1, &
1305 3,3,3,3,3,3,2,2,2,1,1,1, &
1307 4,4,4,4,4,4,4,4,4,4,4,4, &
1308 4,4,4,4,4,4,4,4,4,4,4,4, &
1309 4,4,4,4,4,4,4,4,4,4,4,4, &
1310 4,4,4,4,4,4,4,4,4,4,4,4, &
1311 4,4,4,4,4,4,4,4,4,4,4,4, &
1312 4,4,4,4,4,4,4,4,4,4,4,4 &
1313 ],shape(fcc_interactionsliptrans))
1315 if (len_trim(structure) /= 3) &
1316 call io_error(137,ext_msg=
'lattice_interaction_SlipByTrans: '//trim(structure))
1318 select case(structure)
1320 interactiontypes = fcc_interactionsliptrans
1324 call io_error(137,ext_msg=
'lattice_interaction_SlipByTrans: '//trim(structure))
1327 interactionmatrix =
buildinteraction(nslip,ntrans,nslipmax,ntransmax,interactionvalues,interactiontypes)
1338 integer,
dimension(:),
intent(in) :: ntwin, & !< number of active twin systems per family
1340 real(
preal),
dimension(:),
intent(in) :: interactionvalues
1341 character(len=*),
intent(in) :: structure
1342 real(
preal),
dimension(sum(Ntwin),sum(Nslip)) :: interactionmatrix
1344 integer,
dimension(:),
allocatable :: ntwinmax, &
1346 integer,
dimension(:,:),
allocatable :: interactiontypes
1348 integer,
dimension(FCC_NSLIP,FCC_NTWIN),
parameter :: &
1349 fcc_interactiontwinslip = 1
1351 integer,
dimension(BCC_NSLIP,BCC_NTWIN),
parameter :: &
1352 bcc_interactiontwinslip = 1
1354 integer,
dimension(HEX_NSLIP,HEX_NTWIN),
parameter :: &
1355 hex_interactiontwinslip = reshape( [&
1356 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, &
1357 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, &
1358 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, &
1359 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, &
1360 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, &
1361 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, &
1363 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, &
1364 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, &
1365 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, &
1366 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, &
1367 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, &
1368 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, &
1370 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, &
1371 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, &
1372 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, &
1373 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, &
1374 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, &
1375 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, &
1377 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, &
1378 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, &
1379 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, &
1380 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, &
1381 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, &
1382 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 &
1383 ],shape(hex_interactiontwinslip))
1385 if (len_trim(structure) /= 3) &
1386 call io_error(137,ext_msg=
'lattice_interaction_TwinBySlip: '//trim(structure))
1388 select case(structure)
1390 interactiontypes = fcc_interactiontwinslip
1394 interactiontypes = bcc_interactiontwinslip
1398 interactiontypes = hex_interactiontwinslip
1402 call io_error(137,ext_msg=
'lattice_interaction_TwinBySlip: '//trim(structure))
1405 interactionmatrix =
buildinteraction(ntwin,nslip,ntwinmax,nslipmax,interactionvalues,interactiontypes)
1416 integer,
dimension(:),
intent(in) :: nslip
1417 character(len=*),
intent(in) :: structure
1418 real(
preal),
intent(in) :: covera
1419 real(
preal),
dimension(3,3,sum(Nslip)) :: schmidmatrix
1421 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
1422 real(
preal),
dimension(:,:),
allocatable :: slipsystems
1423 integer,
dimension(:),
allocatable :: nslipmax
1426 if (len_trim(structure) /= 3) &
1427 call io_error(137,ext_msg=
'lattice_SchmidMatrix_slip: '//trim(structure))
1429 select case(structure)
1443 call io_error(137,ext_msg=
'lattice_SchmidMatrix_slip: '//trim(structure))
1446 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
1447 call io_error(145,ext_msg=
'Nslip '//trim(structure))
1448 if (any(nslip < 0)) &
1449 call io_error(144,ext_msg=
'Nslip '//trim(structure))
1453 do i = 1, sum(nslip)
1454 schmidmatrix(1:3,1:3,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
1456 call io_error(0,i,ext_msg =
'dilatational Schmid matrix for slip')
1468 integer,
dimension(:),
intent(in) :: ntwin
1469 character(len=*),
intent(in) :: structure
1470 real(
preal),
intent(in) :: covera
1471 real(
preal),
dimension(3,3,sum(Ntwin)) :: schmidmatrix
1473 real(
preal),
dimension(3,3,sum(Ntwin)) :: coordinatesystem
1474 real(
preal),
dimension(:,:),
allocatable :: twinsystems
1475 integer,
dimension(:),
allocatable :: ntwinmax
1478 if (len_trim(structure) /= 3) &
1479 call io_error(137,ext_msg=
'lattice_SchmidMatrix_twin: '//trim(structure))
1481 select case(structure)
1492 call io_error(137,ext_msg=
'lattice_SchmidMatrix_twin: '//trim(structure))
1495 if (any(ntwinmax(1:
size(ntwin)) - ntwin < 0)) &
1496 call io_error(145,ext_msg=
'Ntwin '//trim(structure))
1497 if (any(ntwin < 0)) &
1498 call io_error(144,ext_msg=
'Ntwin '//trim(structure))
1502 do i = 1, sum(ntwin)
1503 schmidmatrix(1:3,1:3,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
1505 call io_error(0,i,ext_msg =
'dilatational Schmid matrix for twin')
1517 integer,
dimension(:),
intent(in) :: ntrans
1518 character(len=*),
intent(in) :: structure_target
1519 real(
preal),
intent(in) :: covera
1520 real(
preal),
dimension(3,3,sum(Ntrans)) :: schmidmatrix
1522 real(
preal),
dimension(3,3,sum(Ntrans)) :: devnull
1523 real(
preal) :: a_bcc, a_fcc
1525 if (len_trim(structure_target) /= 3) &
1526 call io_error(137,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
1527 if (structure_target(1:3) /=
'bcc' .and. structure_target(1:3) /=
'hex') &
1528 call io_error(137,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
1530 if (structure_target(1:3) ==
'hex' .and. (covera < 1.0_preal .or. covera > 2.0_preal)) &
1531 call io_error(131,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
1533 if (structure_target(1:3) ==
'bcc' .and. (a_bcc <= 0.0_preal .or. a_fcc <= 0.0_preal)) &
1534 call io_error(134,ext_msg=
'lattice_SchmidMatrix_trans: '//trim(structure_target))
1547 integer,
dimension(:),
intent(in) :: ncleavage
1548 character(len=*),
intent(in) :: structure
1549 real(
preal),
intent(in) :: covera
1550 real(
preal),
dimension(3,3,3,sum(Ncleavage)) :: schmidmatrix
1552 real(
preal),
dimension(3,3,sum(Ncleavage)) :: coordinatesystem
1553 real(
preal),
dimension(:,:),
allocatable :: cleavagesystems
1554 integer,
dimension(:),
allocatable :: ncleavagemax
1557 if (len_trim(structure) /= 3) &
1558 call io_error(137,ext_msg=
'lattice_SchmidMatrix_cleavage: '//trim(structure))
1560 select case(structure)
1571 call io_error(137,ext_msg=
'lattice_SchmidMatrix_cleavage: '//trim(structure))
1574 if (any(ncleavagemax(1:
size(ncleavage)) - ncleavage < 0)) &
1575 call io_error(145,ext_msg=
'Ncleavage '//trim(structure))
1576 if (any(ncleavage < 0)) &
1577 call io_error(144,ext_msg=
'Ncleavage '//trim(structure))
1581 do i = 1, sum(ncleavage)
1582 schmidmatrix(1:3,1:3,1,i) =
math_outer(coordinatesystem(1:3,1,i),coordinatesystem(1:3,2,i))
1583 schmidmatrix(1:3,1:3,2,i) =
math_outer(coordinatesystem(1:3,3,i),coordinatesystem(1:3,2,i))
1584 schmidmatrix(1:3,1:3,3,i) =
math_outer(coordinatesystem(1:3,2,i),coordinatesystem(1:3,2,i))
1595 integer,
dimension(:),
intent(in) :: nslip
1596 character(len=*),
intent(in) :: structure
1597 real(
preal),
intent(in) :: covera
1598 real(
preal),
dimension(3,sum(Nslip)) :: d
1600 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
1603 d = coordinatesystem(1:3,1,1:sum(nslip))
1613 integer,
dimension(:),
intent(in) :: nslip
1614 character(len=*),
intent(in) :: structure
1615 real(
preal),
intent(in) :: covera
1616 real(
preal),
dimension(3,sum(Nslip)) :: n
1618 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
1621 n = coordinatesystem(1:3,2,1:sum(nslip))
1631 integer,
dimension(:),
intent(in) :: nslip
1632 character(len=*),
intent(in) :: structure
1633 real(
preal),
intent(in) :: covera
1634 real(
preal),
dimension(3,sum(Nslip)) :: t
1636 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
1639 t = coordinatesystem(1:3,3,1:sum(nslip))
1650 integer,
dimension(:),
intent(in) :: nslip
1651 character(len=*),
intent(in) :: structure
1653 character(len=:),
dimension(:),
allocatable :: labels
1655 real(
preal),
dimension(:,:),
allocatable :: slipsystems
1656 integer,
dimension(:),
allocatable :: nslipmax
1658 if (len_trim(structure) /= 3) &
1659 call io_error(137,ext_msg=
'lattice_labels_slip: '//trim(structure))
1661 select case(structure)
1675 call io_error(137,ext_msg=
'lattice_labels_slip: '//trim(structure))
1678 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
1679 call io_error(145,ext_msg=
'Nslip '//trim(structure))
1680 if (any(nslip < 0)) &
1681 call io_error(144,ext_msg=
'Nslip '//trim(structure))
1683 labels =
getlabels(nslip,nslipmax,slipsystems)
1693 real(
preal),
dimension(3,3) :: t_sym
1695 real(
preal),
dimension(3,3),
intent(in) :: t
1696 character(len=*),
intent(in) :: structure
1702 if (len_trim(structure) /= 3) &
1703 call io_error(137,ext_msg=
'lattice_applyLatticeSymmetry33: '//trim(structure))
1705 select case(structure)
1706 case(
'iso',
'fcc',
'bcc')
1719 call io_error(137,ext_msg=
'lattice_applyLatticeSymmetry33: '//trim(structure))
1731 real(
preal),
dimension(6,6) :: c66_sym
1733 real(
preal),
dimension(6,6),
intent(in) :: c66
1734 character(len=*),
intent(in) :: structure
1740 if (len_trim(structure) /= 3) &
1741 call io_error(137,ext_msg=
'applyLatticeSymmetryC66: '//trim(structure))
1743 select case(structure)
1747 c66_sym(k,j) = c66(1,2)
1749 c66_sym(k,k) = c66(1,1)
1750 c66_sym(k+3,k+3) = 0.5_preal*(c66(1,1)-c66(1,2))
1755 c66_sym(k,j) = c66(1,2)
1757 c66_sym(k,k) = c66(1,1)
1758 c66_sym(k+3,k+3) = c66(4,4)
1761 c66_sym(1,1) = c66(1,1)
1762 c66_sym(2,2) = c66(1,1)
1763 c66_sym(3,3) = c66(3,3)
1764 c66_sym(1,2) = c66(1,2)
1765 c66_sym(2,1) = c66(1,2)
1766 c66_sym(1,3) = c66(1,3)
1767 c66_sym(3,1) = c66(1,3)
1768 c66_sym(2,3) = c66(1,3)
1769 c66_sym(3,2) = c66(1,3)
1770 c66_sym(4,4) = c66(4,4)
1771 c66_sym(5,5) = c66(4,4)
1772 c66_sym(6,6) = 0.5_preal*(c66(1,1)-c66(1,2))
1774 c66_sym(1,1) = c66(1,1)
1775 c66_sym(2,2) = c66(2,2)
1776 c66_sym(3,3) = c66(3,3)
1777 c66_sym(1,2) = c66(1,2)
1778 c66_sym(2,1) = c66(1,2)
1779 c66_sym(1,3) = c66(1,3)
1780 c66_sym(3,1) = c66(1,3)
1781 c66_sym(2,3) = c66(2,3)
1782 c66_sym(3,2) = c66(2,3)
1783 c66_sym(4,4) = c66(4,4)
1784 c66_sym(5,5) = c66(5,5)
1785 c66_sym(6,6) = c66(6,6)
1787 c66_sym(1,1) = c66(1,1)
1788 c66_sym(2,2) = c66(1,1)
1789 c66_sym(3,3) = c66(3,3)
1790 c66_sym(1,2) = c66(1,2)
1791 c66_sym(2,1) = c66(1,2)
1792 c66_sym(1,3) = c66(1,3)
1793 c66_sym(3,1) = c66(1,3)
1794 c66_sym(2,3) = c66(1,3)
1795 c66_sym(3,2) = c66(1,3)
1796 c66_sym(4,4) = c66(4,4)
1797 c66_sym(5,5) = c66(4,4)
1798 c66_sym(6,6) = c66(6,6)
1800 call io_error(137,ext_msg=
'applyLatticeSymmetryC66: '//trim(structure))
1812 integer,
dimension(:),
intent(in) :: ntwin
1813 character(len=*),
intent(in) :: structure
1815 character(len=:),
dimension(:),
allocatable :: labels
1817 real(
preal),
dimension(:,:),
allocatable :: twinsystems
1818 integer,
dimension(:),
allocatable :: ntwinmax
1820 if (len_trim(structure) /= 3) &
1821 call io_error(137,ext_msg=
'lattice_labels_twin: '//trim(structure))
1823 select case(structure)
1834 call io_error(137,ext_msg=
'lattice_labels_twin: '//trim(structure))
1837 if (any(ntwinmax(1:
size(ntwin)) - ntwin < 0)) &
1838 call io_error(145,ext_msg=
'Ntwin '//trim(structure))
1839 if (any(ntwin < 0)) &
1840 call io_error(144,ext_msg=
'Ntwin '//trim(structure))
1842 labels =
getlabels(ntwin,ntwinmax,twinsystems)
1853 integer,
dimension(:),
intent(in) :: nslip
1854 character(len=*),
intent(in) :: structure
1855 real(
preal),
intent(in) :: covera
1856 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: projection
1858 real(
preal),
dimension(3,sum(Nslip)) :: n, t
1864 do i=1, sum(nslip);
do j=1, sum(nslip)
1865 projection(i,j) = abs(
math_inner(n(:,i),t(:,j)))
1877 integer,
dimension(:),
intent(in) :: nslip
1878 character(len=*),
intent(in) :: structure
1879 real(
preal),
intent(in) :: covera
1880 real(
preal),
dimension(sum(Nslip),sum(Nslip)) :: projection
1882 real(
preal),
dimension(3,sum(Nslip)) :: n, d
1888 do i=1, sum(nslip);
do j=1, sum(nslip)
1889 projection(i,j) = abs(
math_inner(n(:,i),d(:,j)))
1901 integer,
dimension(:),
intent(in) :: nslip
1902 character(len=*),
intent(in) :: structure
1903 real(
preal),
intent(in) :: covera
1904 real(
preal),
dimension(3,3,sum(Nslip)) :: coordinatesystem
1906 real(
preal),
dimension(:,:),
allocatable :: slipsystems
1907 integer,
dimension(:),
allocatable :: nslipmax
1909 if (len_trim(structure) /= 3) &
1910 call io_error(137,ext_msg=
'coordinateSystem_slip: '//trim(structure))
1912 select case(structure)
1926 call io_error(137,ext_msg=
'coordinateSystem_slip: '//trim(structure))
1929 if (any(nslipmax(1:
size(nslip)) - nslip < 0)) &
1930 call io_error(145,ext_msg=
'Nslip '//trim(structure))
1931 if (any(nslip < 0)) &
1932 call io_error(144,ext_msg=
'Nslip '//trim(structure))
1942 function buildinteraction(reacting_used,acting_used,reacting_max,acting_max,values,matrix)
1944 integer,
dimension(:),
intent(in) :: &
1945 reacting_used, & !< # of reacting systems per family as specified in material.config
1946 acting_used, & !< # of acting systems per family as specified in material.config
1947 reacting_max, & !< max # of reacting systems per family for given lattice
1949 real(
preal),
dimension(:),
intent(in) :: values
1950 integer,
dimension(:,:),
intent(in) :: matrix
1954 acting_family_index, acting_family, acting_system, &
1955 reacting_family_index, reacting_family, reacting_system, &
1958 do acting_family = 1,
size(acting_used,1)
1959 acting_family_index = sum(acting_used(1:acting_family-1))
1960 do acting_system = 1,acting_used(acting_family)
1962 do reacting_family = 1,
size(reacting_used,1)
1963 reacting_family_index = sum(reacting_used(1:reacting_family-1))
1964 do reacting_system = 1,reacting_used(reacting_family)
1966 i = sum( acting_max(1: acting_family-1)) + acting_system
1967 j = sum(reacting_max(1:reacting_family-1)) + reacting_system
1969 k = acting_family_index + acting_system
1970 l = reacting_family_index + reacting_system
1972 if (matrix(i,j) >
size(values))
call io_error(138,ext_msg=
'buildInteraction')
1988 integer,
dimension(:),
intent(in) :: &
1989 active, & !< # of active systems per family
1991 real(
preal),
dimension(:,:),
intent(in) :: &
1993 character(len=*),
intent(in) :: &
1995 real(
preal),
intent(in) :: &
1997 real(
preal),
dimension(3,3,sum(active)) :: &
2000 real(
preal),
dimension(3) :: &
2003 a, & !< index of active system
2004 p, & !< index in potential system matrix
2005 f, & !< index of my family
2008 if (len_trim(structure) /= 3) &
2009 call io_error(137,ext_msg=
'buildCoordinateSystem: '//trim(structure))
2010 if (trim(structure) ==
'bct' .and. covera > 2.0_preal) &
2011 call io_error(131,ext_msg=
'buildCoordinateSystem:'//trim(structure))
2012 if (trim(structure) ==
'hex' .and. (covera < 1.0_preal .or. covera > 2.0_preal)) &
2013 call io_error(131,ext_msg=
'buildCoordinateSystem:'//trim(structure))
2016 activefamilies:
do f = 1,
size(active,1)
2017 activesystems:
do s = 1,active(f)
2019 p = sum(potential(1:f-1))+s
2021 select case(trim(structure))
2023 case (
'fcc',
'bcc',
'iso',
'ort',
'bct')
2024 direction = system(1:3,p)
2025 normal = system(4:6,p)
2028 direction = [ system(1,p)*1.5_preal, &
2029 (system(1,p)+2.0_preal*system(2,p))*sqrt(0.75_preal), &
2030 system(4,p)*covera ]
2031 normal = [ system(5,p), &
2032 (system(5,p)+2.0_preal*system(6,p))/sqrt(3.0_preal), &
2033 system(8,p)/covera ]
2036 call io_error(137,ext_msg=
'buildCoordinateSystem: '//trim(structure))
2043 normal /norm2(normal))
2046 enddo activefamilies
2059 integer,
dimension(:),
intent(in) :: &
2061 real(pReal),
dimension(3,3,sum(Ntrans)),
intent(out) :: &
2062 Q, & !< Total rotation: Q = R*B
2064 real(pReal),
intent(in) :: &
2065 cOverA, & !< c/a for target hex structure
2066 a_bcc, & !< lattice parameter a for target bcc structure
2070 R, & !< Pitsch rotation
2072 real(pReal),
dimension(3,3) :: &
2073 U, & !< Bain deformation
2075 real(pReal),
dimension(3) :: &
2079 real(pReal),
dimension(3+3,FCC_NTRANS),
parameter :: &
2080 FCCTOHEX_SYSTEMTRANS = reshape(real( [&
2081 -2, 1, 1, 1, 1, 1, &
2084 2,-1, 1, -1,-1, 1, &
2085 -1, 2, 1, -1,-1, 1, &
2086 -1,-1,-2, -1,-1, 1, &
2087 -2,-1,-1, 1,-1,-1, &
2090 2, 1,-1, -1, 1,-1, &
2091 -1,-2,-1, -1, 1,-1, &
2092 -1, 1, 2, -1, 1,-1 &
2093 ],preal),shape(fcctohex_systemtrans))
2094 real(pReal),
dimension(4,fcc_Ntrans),
parameter :: &
2095 FCCTOBCC_SYSTEMTRANS = reshape([&
2096 0.0, 1.0, 0.0, 10.26, &
2097 0.0,-1.0, 0.0, 10.26, &
2098 0.0, 0.0, 1.0, 10.26, &
2099 0.0, 0.0,-1.0, 10.26, &
2100 1.0, 0.0, 0.0, 10.26, &
2101 -1.0, 0.0, 0.0, 10.26, &
2102 0.0, 0.0, 1.0, 10.26, &
2103 0.0, 0.0,-1.0, 10.26, &
2104 1.0, 0.0, 0.0, 10.26, &
2105 -1.0, 0.0, 0.0, 10.26, &
2106 0.0, 1.0, 0.0, 10.26, &
2107 0.0,-1.0, 0.0, 10.26 &
2108 ],shape(fcctobcc_systemtrans))
2110 integer,
dimension(9,fcc_Ntrans),
parameter :: &
2111 FCCTOBCC_BAINVARIANT = reshape( [&
2112 1, 0, 0, 0, 1, 0, 0, 0, 1, &
2113 1, 0, 0, 0, 1, 0, 0, 0, 1, &
2114 1, 0, 0, 0, 1, 0, 0, 0, 1, &
2115 1, 0, 0, 0, 1, 0, 0, 0, 1, &
2116 0, 1, 0, 1, 0, 0, 0, 0, 1, &
2117 0, 1, 0, 1, 0, 0, 0, 0, 1, &
2118 0, 1, 0, 1, 0, 0, 0, 0, 1, &
2119 0, 1, 0, 1, 0, 0, 0, 0, 1, &
2120 0, 0, 1, 1, 0, 0, 0, 1, 0, &
2121 0, 0, 1, 1, 0, 0, 0, 1, 0, &
2122 0, 0, 1, 1, 0, 0, 0, 1, 0, &
2123 0, 0, 1, 1, 0, 0, 0, 1, 0 &
2124 ],shape(fcctobcc_bainvariant))
2126 real(pReal),
dimension(4,fcc_Ntrans),
parameter :: &
2127 FCCTOBCC_BAINROT = reshape([&
2128 1.0, 0.0, 0.0, 45.0, &
2129 1.0, 0.0, 0.0, 45.0, &
2130 1.0, 0.0, 0.0, 45.0, &
2131 1.0, 0.0, 0.0, 45.0, &
2132 0.0, 1.0, 0.0, 45.0, &
2133 0.0, 1.0, 0.0, 45.0, &
2134 0.0, 1.0, 0.0, 45.0, &
2135 0.0, 1.0, 0.0, 45.0, &
2136 0.0, 0.0, 1.0, 45.0, &
2137 0.0, 0.0, 1.0, 45.0, &
2138 0.0, 0.0, 1.0, 45.0, &
2139 0.0, 0.0, 1.0, 45.0 &
2140 ],shape(fcctobcc_bainrot))
2142 if (a_bcc > 0.0_preal .and. a_fcc > 0.0_preal .and.
deq0(covera))
then
2143 do i = 1,sum(ntrans)
2144 call r%fromAxisAngle(fcctobcc_systemtrans(:,i),degrees=.true.,p=1)
2145 call b%fromAxisAngle(fcctobcc_bainrot(:,i), degrees=.true.,p=1)
2146 x = real(fcctobcc_bainvariant(1:3,i),preal)
2147 y = real(fcctobcc_bainvariant(4:6,i),preal)
2148 z = real(fcctobcc_bainvariant(7:9,i),preal)
2151 + (a_bcc/a_fcc)*
math_outer(y,y) * sqrt(2.0_preal) &
2152 + (a_bcc/a_fcc)*
math_outer(z,z) * sqrt(2.0_preal)
2153 q(1:3,1:3,i) = matmul(r%asMatrix(),b%asMatrix())
2154 s(1:3,1:3,i) = matmul(r%asMatrix(),u) -
math_i3
2156 elseif (covera > 0.0_preal .and.
deq0(a_bcc))
then
2159 ss(1,3) = sqrt(2.0_preal)/4.0_preal
2160 sd(3,3) = covera/sqrt(8.0_preal/3.0_preal)
2162 do i = 1,sum(ntrans)
2163 x = fcctohex_systemtrans(1:3,i)/norm2(fcctohex_systemtrans(1:3,i))
2164 z = fcctohex_systemtrans(4:6,i)/norm2(fcctohex_systemtrans(4:6,i))
2169 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
2172 call io_error(132,ext_msg=
'buildTransformationSystem')
2181 function getlabels(active,potential,system)
result(labels)
2183 integer,
dimension(:),
intent(in) :: &
2184 active, & !< # of active systems per family
2186 real(
preal),
dimension(:,:),
intent(in) :: &
2189 character(len=:),
dimension(:),
allocatable :: labels
2190 character(len=:),
allocatable :: label
2194 a, & !< index of active system
2195 p, & !< index in potential system matrix
2196 f, & !< index of my family
2199 i = 2*
size(system,1) + (
size(system,1) - 2) + 4
2200 allocate(
character(len=i) :: labels(sum(active)), label)
2203 activefamilies:
do f = 1,
size(active,1)
2204 activesystems:
do s = 1,active(f)
2206 p = sum(potential(1:f-1))+s
2210 direction:
do j = 1,
size(system,1)/2
2211 write(label(i+1:i+2),
'(I2.1)') int(system(j,p))
2212 label(i+3:i+3) =
' '
2219 normal:
do j =
size(system,1)/2+1,
size(system,1)
2220 write(label(i+1:i+2),
'(I2.1)') int(system(j,p))
2221 label(i+3:i+3) =
' '
2229 enddo activefamilies
2240 real(
preal),
dimension(6,6),
intent(in) :: c
2241 character(len=*),
intent(in) :: assumption
2243 real(
preal) :: k, mu, nu
2245 real(
preal),
dimension(6,6) :: s
2247 if (
io_lc(assumption) ==
'voigt')
then
2248 k = (c(1,1)+c(2,2)+c(3,3) +2.0_preal*(c(1,2)+c(2,3)+c(1,3))) &
2250 elseif(
io_lc(assumption) ==
'reuss')
then
2254 / (s(1,1)+s(2,2)+s(3,3) +2.0_preal*(s(1,2)+s(2,3)+s(1,3)))
2261 nu = (1.5_preal*k -mu)/(3.0_preal*k+mu)
2272 real(
preal),
dimension(6,6),
intent(in) :: c
2273 character(len=*),
intent(in) :: assumption
2277 real(
preal),
dimension(6,6) :: s
2279 if (
io_lc(assumption) ==
'voigt')
then
2280 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))) &
2282 elseif(
io_lc(assumption) ==
'reuss')
then
2286 / (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)))
2300 real(pReal),
dimension(:,:,:),
allocatable :: CoSy
2301 real(pReal),
dimension(:,:),
allocatable :: system
2303 real(pReal),
dimension(6,6) :: C
2304 real(pReal),
dimension(2) :: r
2305 real(pReal) :: lambda
2307 call random_number(r)
2309 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])
2315 call random_number(c)
2316 c(1,1) = c(1,1) + 1.0_preal
2319 call io_error(0,ext_msg=
'equivalent_mu/voigt')
2321 call io_error(0,ext_msg=
'equivalent_mu/reuss')
2324 call io_error(0,ext_msg=
'equivalent_nu/voigt')
2326 call io_error(0,ext_msg=
'equivalent_nu/reuss')