Added keyword to specify transformed lattice structure

This commit is contained in:
Su Leen Wong 2015-06-11 08:23:27 +00:00
parent 140638b911
commit b3241411f5
2 changed files with 38 additions and 17 deletions

View File

@ -1546,6 +1546,10 @@ subroutine IO_error(error_ID,el,ip,g,ext_msg)
msg = 'unknown lattice structure encountered' msg = 'unknown lattice structure encountered'
case (131_pInt) case (131_pInt)
msg = 'hex lattice structure with invalid c/a ratio' msg = 'hex lattice structure with invalid c/a ratio'
case (132_pInt)
msg = 'trans_lattice_structure not possible'
case (133_pInt)
msg = 'transformed hex lattice structure with invalid c/a ratio'
case (135_pInt) case (135_pInt)
msg = 'zero entry on stiffness diagonal' msg = 'zero entry on stiffness diagonal'

View File

@ -853,7 +853,7 @@ module lattice
LATTICE_ort_ID LATTICE_ort_ID
end enum end enum
integer(kind(LATTICE_undefined_ID)), dimension(:), allocatable, public, protected :: & integer(kind(LATTICE_undefined_ID)), dimension(:), allocatable, public, protected :: &
lattice_structure lattice_structure, trans_lattice_structure
integer(pInt), dimension(2), parameter, private :: & integer(pInt), dimension(2), parameter, private :: &
@ -1101,6 +1101,7 @@ subroutine lattice_init
endif endif
allocate(lattice_structure(Nphases),source = LATTICE_undefined_ID) allocate(lattice_structure(Nphases),source = LATTICE_undefined_ID)
allocate(trans_lattice_structure(Nphases),source = LATTICE_undefined_ID)
allocate(lattice_C66(6,6,Nphases), source=0.0_pReal) allocate(lattice_C66(6,6,Nphases), source=0.0_pReal)
allocate(lattice_C3333(3,3,3,3,Nphases), source=0.0_pReal) allocate(lattice_C3333(3,3,3,3,Nphases), source=0.0_pReal)
allocate(lattice_thermalConductivity33 (3,3,Nphases), source=0.0_pReal) allocate(lattice_thermalConductivity33 (3,3,Nphases), source=0.0_pReal)
@ -1196,6 +1197,15 @@ subroutine lattice_init
case default case default
call IO_error(130_pInt,ext_msg=trim(IO_lc(IO_stringValue(line,positions,2_pInt)))) call IO_error(130_pInt,ext_msg=trim(IO_lc(IO_stringValue(line,positions,2_pInt))))
end select end select
case('trans_lattice_structure')
select case(trim(IO_lc(IO_stringValue(line,positions,2_pInt))))
case('bcc')
trans_lattice_structure(section) = LATTICE_bcc_ID
case('hex','hexagonal','hcp')
trans_lattice_structure(section) = LATTICE_hex_ID
case default
call IO_error(132_pInt,ext_msg=trim(IO_lc(IO_stringValue(line,positions,2_pInt))))
end select
case ('c11') case ('c11')
lattice_C66(1,1,section) = IO_floatValue(line,positions,2_pInt) lattice_C66(1,1,section) = IO_floatValue(line,positions,2_pInt)
case ('c12') case ('c12')
@ -1402,8 +1412,17 @@ subroutine lattice_initializeStructure(myPhase,CoverA,a_fcc,a_bcc)
tn(1:3,i) = lattice_fcc_systemTwin(4:6,i) tn(1:3,i) = lattice_fcc_systemTwin(4:6,i)
ts(i) = lattice_fcc_shearTwin(i) ts(i) = lattice_fcc_shearTwin(i)
enddo enddo
do i = 1_pInt, myNcleavage ! assign cleavage system vectors
cd(1:3,i) = lattice_fcc_systemCleavage(1:3,i)/math_norm3(lattice_fcc_systemCleavage(1:3,i))
cn(1:3,i) = lattice_fcc_systemCleavage(4:6,i)/math_norm3(lattice_fcc_systemCleavage(4:6,i))
ct(1:3,i) = math_vectorproduct(cd(1:3,i),cn(1:3,i))
enddo
! Phase transformation
select case(trans_lattice_structure(myPhase))
case (LATTICE_bcc_ID) ! fcc to bcc transformation
do i = 1_pInt,myNtrans do i = 1_pInt,myNtrans
Rtr(1:3,1:3,i) = math_axisAngleToR(lattice_fcc_systemTrans(1:3,i), & ! Pitsch rotation (fcc to bcc transformation) Rtr(1:3,1:3,i) = math_axisAngleToR(lattice_fcc_systemTrans(1:3,i), & ! Pitsch rotation
lattice_fcc_systemTrans(4,i)*INRAD) lattice_fcc_systemTrans(4,i)*INRAD)
Btr(1:3,1:3,i) = math_axisAngleToR(lattice_fcc_bainRot(1:3,i), & ! Rotation of fcc to Bain coordinate system Btr(1:3,1:3,i) = math_axisAngleToR(lattice_fcc_bainRot(1:3,i), & ! Rotation of fcc to Bain coordinate system
lattice_fcc_bainRot(4,i)*INRAD) lattice_fcc_bainRot(4,i)*INRAD)
@ -1418,11 +1437,9 @@ subroutine lattice_initializeStructure(myPhase,CoverA,a_fcc,a_bcc)
sqrt(2.0_pReal)*(a_bcc/a_fcc)*math_tensorproduct(zb(1:3,i), zb(1:3,i)) sqrt(2.0_pReal)*(a_bcc/a_fcc)*math_tensorproduct(zb(1:3,i), zb(1:3,i))
endif endif
enddo enddo
do i = 1_pInt, myNcleavage ! assign cleavage system vectors case default
cd(1:3,i) = lattice_fcc_systemCleavage(1:3,i)/math_norm3(lattice_fcc_systemCleavage(1:3,i)) call IO_error(132_pInt,ext_msg='lattice_initializeStructure')
cn(1:3,i) = lattice_fcc_systemCleavage(4:6,i)/math_norm3(lattice_fcc_systemCleavage(4:6,i)) end select
ct(1:3,i) = math_vectorproduct(cd(1:3,i),cn(1:3,i))
enddo
lattice_NslipSystem(1:lattice_maxNslipFamily,myPhase) = lattice_fcc_NslipSystem lattice_NslipSystem(1:lattice_maxNslipFamily,myPhase) = lattice_fcc_NslipSystem
lattice_NtwinSystem(1:lattice_maxNtwinFamily,myPhase) = lattice_fcc_NtwinSystem lattice_NtwinSystem(1:lattice_maxNtwinFamily,myPhase) = lattice_fcc_NtwinSystem