calculation of slip/twin/trans/damage-coordinate system was wrong

This commit is contained in:
Martin Diehl 2018-10-07 15:44:13 +02:00
parent 032c35a499
commit a53488d666
1 changed files with 49 additions and 46 deletions

View File

@ -2164,11 +2164,11 @@ function lattice_C66_twin(Ntwin,C66,structure,CoverA)
select case(structure) select case(structure)
case('fcc') case('fcc')
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_FCC_SYSTEMTWIN,pInt),structure) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_FCC_NSLIPSYSTEM,int(LATTICE_FCC_SYSTEMTWIN,pInt),structure)
case('bcc') case('bcc')
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_BCC_SYSTEMTWIN,pInt),structure) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_BCC_NSLIPSYSTEM,int(LATTICE_BCC_SYSTEMTWIN,pInt),structure)
case('hex','hexagonal') !ToDo: "No alias policy": long or short? case('hex','hexagonal') !ToDo: "No alias policy": long or short?
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_HEX_SYSTEMTWIN,pInt),'hex',cOverA) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_HEX_NSLIPSYSTEM,int(LATTICE_HEX_SYSTEMTWIN,pInt),'hex',cOverA)
case default case default
call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_C66_twin)') call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_C66_twin)')
end select end select
@ -2320,8 +2320,8 @@ function lattice_nonSchmidMatrix(Nslip,nonSchmidCoefficients,sense) result(nonSc
integer(pInt) :: i integer(pInt) :: i
if (abs(sense) /= 1_pInt) write(6,*) 'mist' if (abs(sense) /= 1_pInt) write(6,*) 'mist'
coordinateSystem = buildCoordinateSystem(Nslip,int(LATTICE_BCC_SYSTEMSLIP,pInt),'bcc') coordinateSystem = buildCoordinateSystem(Nslip,LATTICE_BCC_NSLIPSYSTEM,int(LATTICE_BCC_SYSTEMSLIP,pInt),'bcc')
coordinateSystem(1:3,1,sum(Nslip)) = coordinateSystem(1:3,1,sum(Nslip)) *real(sense,pReal) coordinateSystem(1:3,1,1:sum(Nslip)) = coordinateSystem(1:3,1,1:sum(Nslip)) *real(sense,pReal)
nonSchmidMatrix = lattice_SchmidMatrix_slip(Nslip,'bcc') nonSchmidMatrix = lattice_SchmidMatrix_slip(Nslip,'bcc')
do i = 1_pInt,sum(Nslip) do i = 1_pInt,sum(Nslip)
@ -2577,13 +2577,13 @@ function lattice_SchmidMatrix_slip(Nslip,structure,cOverA) result(SchmidMatrix)
select case(structure) select case(structure)
case('fcc') case('fcc')
coordinateSystem = buildCoordinateSystem(Nslip,int(LATTICE_FCC_SYSTEMSLIP,pInt),structure) coordinateSystem = buildCoordinateSystem(Nslip,LATTICE_BCC_NSLIPSYSTEM,int(LATTICE_FCC_SYSTEMSLIP,pInt),structure)
case('bcc') case('bcc')
coordinateSystem = buildCoordinateSystem(Nslip,int(LATTICE_BCC_SYSTEMSLIP,pInt),structure) coordinateSystem = buildCoordinateSystem(Nslip,LATTICE_FCC_NSLIPSYSTEM,int(LATTICE_BCC_SYSTEMSLIP,pInt),structure)
case('hex','hexagonal') !ToDo: "No alias policy": long or short? case('hex','hexagonal') !ToDo: "No alias policy": long or short?
coordinateSystem = buildCoordinateSystem(Nslip,int(LATTICE_HEX_SYSTEMSLIP,pInt),'hex',cOverA) coordinateSystem = buildCoordinateSystem(Nslip,LATTICE_HEX_NSLIPSYSTEM,int(LATTICE_HEX_SYSTEMSLIP,pInt),'hex',cOverA)
case('bct') case('bct')
coordinateSystem = buildCoordinateSystem(Nslip,int(LATTICE_BCT_SYSTEMSLIP,pInt),structure,cOverA) coordinateSystem = buildCoordinateSystem(Nslip,LATTICE_BCT_NSLIPSYSTEM,int(LATTICE_BCT_SYSTEMSLIP,pInt),structure,cOverA)
case default case default
call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_SchmidMatrix_slip)') call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_SchmidMatrix_slip)')
end select end select
@ -2618,11 +2618,11 @@ function lattice_SchmidMatrix_twin(Ntwin,structure,cOverA)
select case(structure) select case(structure)
case('fcc') case('fcc')
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_FCC_SYSTEMTWIN,pInt),structure) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_FCC_NTWINSYSTEM,int(LATTICE_FCC_SYSTEMTWIN,pInt),structure)
case('bcc') case('bcc')
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_BCC_SYSTEMTWIN,pInt),structure) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_BCC_NTWINSYSTEM,int(LATTICE_BCC_SYSTEMTWIN,pInt),structure)
case('hex','hexagonal') !ToDo: "No alias policy": long or short? case('hex','hexagonal') !ToDo: "No alias policy": long or short?
coordinateSystem = buildCoordinateSystem(Ntwin,int(LATTICE_HEX_SYSTEMTWIN,pInt),'hex',cOverA) coordinateSystem = buildCoordinateSystem(Ntwin,LATTICE_HEX_NTWINSYSTEM,int(LATTICE_HEX_SYSTEMTWIN,pInt),'hex',cOverA)
case default case default
call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_SchmidMatrix_twin)') call IO_error(130_pInt,ext_msg=trim(structure)//' (lattice_SchmidMatrix_twin)')
end select end select
@ -2655,14 +2655,16 @@ pure function buildInteraction(activeA,activeB,maxA,maxB,values,matrix)
mf, ms, of, os mf, ms, of, os
myFamilies: do mf = 1_pInt,size(activeA,1) myFamilies: do mf = 1_pInt,size(activeA,1)
index_myFamily = sum(activeA(1:mf-1_pInt)) index_myFamily = sum(activeA(1:mf-1_pInt))
mySystems: do ms = 1_pInt,activeA(mf) mySystems: do ms = 1_pInt,activeA(mf)
otherFamilies: do of = 1_pInt,size(activeB,1)
index_otherFamily = sum(activeB(1:of-1_pInt)) otherFamilies: do of = 1_pInt,size(activeB,1)
otherSystems: do os = 1_pInt,activeB(of) index_otherFamily = sum(activeB(1:of-1_pInt))
buildInteraction(index_myFamily+ms,index_otherFamily+os) = & otherSystems: do os = 1_pInt,activeB(of)
values(matrix(sum(maxA(1:mf-1))+ms, sum(maxB(1:of-1))+os)) buildInteraction(index_myFamily+ms,index_otherFamily+os) = &
enddo otherSystems; enddo otherFamilies; values(matrix(sum(maxA(1:mf-1))+ms, sum(maxB(1:of-1))+os))
enddo otherSystems; enddo otherFamilies;
enddo mySystems;enddo myFamilies enddo mySystems;enddo myFamilies
end function buildInteraction end function buildInteraction
@ -2672,13 +2674,14 @@ end function buildInteraction
!> @brief build a local coordinate system in a slip, twin, trans, cleavage system !> @brief build a local coordinate system in a slip, twin, trans, cleavage system
!> @details: Order: Direction, plane (normal), and common perpendicular !> @details: Order: Direction, plane (normal), and common perpendicular
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function buildCoordinateSystem(active,system,structure,cOverA) function buildCoordinateSystem(active,maximum,system,structure,cOverA)
use math, only: & use math, only: &
math_crossproduct math_crossproduct
implicit none implicit none
integer(pInt), dimension(:), intent(in) :: & integer(pInt), dimension(:), intent(in) :: &
active active, &
maximum
integer(pInt), dimension(:,:), intent(in) :: & integer(pInt), dimension(:,:), intent(in) :: &
system system
character(len=*), intent(in) :: & character(len=*), intent(in) :: &
@ -2691,46 +2694,46 @@ pure function buildCoordinateSystem(active,system,structure,cOverA)
real(pReal), dimension(3) :: & real(pReal), dimension(3) :: &
direction, normal direction, normal
integer(pInt) :: & integer(pInt) :: &
ir, & !< index in reduced matrix i, & !< index in reduced matrix
ig, & !< index in full matrix j, & !< index in full matrix
mf, & !< index of my family f, & !< index of my family
ms !< index of my system in current family s !< index of my system in current family
ir = 0_pInt i = 0_pInt
myFamilies: do mf = 1_pInt,size(active,1) activeFamilies: do f = 1_pInt,size(active,1)
mySystems: do ms = 1_pInt,active(mf) activeSystems: do s = 1_pInt,active(f)
ir = ir + 1_pInt i = i + 1_pInt
ig = sum(system(:,1:mf-1))+ms j = sum(maximum(1:f-1))+s
select case(trim(structure)) select case(trim(structure))
case ('fcc','bcc') case ('fcc','bcc')
direction = real(system(1:3,ig),pReal) direction = real(system(1:3,j),pReal)
normal = real(system(4:6,ig),pReal) normal = real(system(4:6,j),pReal)
case ('hex') case ('hex')
! direction [uvtw]->[3u/2 (u+2v)*sqrt(3)/2 w*(c/a)]) ! direction [uvtw]->[3u/2 (u+2v)*sqrt(3)/2 w*(c/a)])
direction = [ real(system(1,ig),pReal)*1.5_pReal, & direction = [ real(system(1,j),pReal)*1.5_pReal, &
(real(system(1,ig),pReal)+2.0_pReal*real(system(2,ig),pReal))*sqrt(0.75_pReal), & (real(system(1,j),pReal)+2.0_pReal*real(system(2,j),pReal))*sqrt(0.75_pReal), &
real(system(4,ig),pReal)*CoverA ] real(system(4,j),pReal)*CoverA ]
! plane (hkil)->(h (h+2k)/sqrt(3) l/(c/a)) ! plane (hkil)->(h (h+2k)/sqrt(3) l/(c/a))
normal = [ real(system(5,ig),pReal), & normal = [ real(system(5,j),pReal), &
(real(system(5,ig),pReal)+2.0_pReal*real(system(6,ig),pReal))/ sqrt(3.0_pReal), & (real(system(5,j),pReal)+2.0_pReal*real(system(6,j),pReal))/ sqrt(3.0_pReal), &
real(system(8,ig),pReal)/CoverA ] real(system(8,j),pReal)/CoverA ]
case ('bct') case ('bct')
direction = [real(system(1:2,ig),pReal),real(system(3,ig),pReal)*CoverA] direction = [real(system(1:2,j),pReal),real(system(3,i),pReal)*CoverA]
normal = [real(system(4:5,ig),pReal),real(system(6,ig),pReal)/CoverA] normal = [real(system(4:5,j),pReal),real(system(6,i),pReal)/CoverA]
end select end select
buildCoordinateSystem(1:3,1,ir) = direction/norm2(direction) buildCoordinateSystem(1:3,1,i) = direction/norm2(direction)
buildCoordinateSystem(1:3,2,ir) = normal/norm2(normal) buildCoordinateSystem(1:3,2,i) = normal/norm2(normal)
buildCoordinateSystem(1:3,3,ir) = math_crossproduct(direction,normal) buildCoordinateSystem(1:3,3,i) = math_crossproduct(direction,normal)
enddo mySystems enddo activeSystems
enddo myFamilies enddo activeFamilies
end function buildCoordinateSystem end function buildCoordinateSystem