fixed bug caused by the inconsistent sequence of slip and twin systems

This commit is contained in:
Nan Jia 2012-06-19 16:06:25 +00:00
parent 925759000c
commit f5eb8fcb25
1 changed files with 23 additions and 16 deletions

View File

@ -456,6 +456,9 @@ enddo
maxTotalNslip = maxval(constitutive_dislotwin_totalNslip) maxTotalNslip = maxval(constitutive_dislotwin_totalNslip)
maxTotalNtwin = maxval(constitutive_dislotwin_totalNtwin) maxTotalNtwin = maxval(constitutive_dislotwin_totalNtwin)
!write(6,*) 'nslip',i,constitutive_dislotwin_totalNslip(i),maxTotalNslip
!write(6,*) 'ntwin',i,constitutive_dislotwin_totalNtwin(i),maxTotalNtwin
allocate(constitutive_dislotwin_burgersPerSlipSystem(maxTotalNslip, maxNinstance)) allocate(constitutive_dislotwin_burgersPerSlipSystem(maxTotalNslip, maxNinstance))
constitutive_dislotwin_burgersPerSlipSystem = 0.0_pReal constitutive_dislotwin_burgersPerSlipSystem = 0.0_pReal
allocate(constitutive_dislotwin_burgersPerTwinSystem(maxTotalNtwin, maxNinstance)) allocate(constitutive_dislotwin_burgersPerTwinSystem(maxTotalNtwin, maxNinstance))
@ -497,6 +500,7 @@ do i = 1_pInt,maxNinstance
l = l + 1_pInt l = l + 1_pInt
constitutive_dislotwin_slipFamily(l,i) = f constitutive_dislotwin_slipFamily(l,i) = f
constitutive_dislotwin_slipSystemLattice(l,i) = sum(lattice_NslipSystem(1:f-1_pInt,myStructure)) + k constitutive_dislotwin_slipSystemLattice(l,i) = sum(lattice_NslipSystem(1:f-1_pInt,myStructure)) + k
! write(6,*) 'slip system',l,'has family',f,'and is actually',constitutive_dislotwin_slipSystemLattice(l,i)
enddo; enddo enddo; enddo
!* Inverse lookup of my twin system family !* Inverse lookup of my twin system family
@ -506,13 +510,15 @@ do i = 1_pInt,maxNinstance
l = l + 1_pInt l = l + 1_pInt
constitutive_dislotwin_twinFamily(l,i) = f constitutive_dislotwin_twinFamily(l,i) = f
constitutive_dislotwin_twinSystemLattice(l,i) = sum(lattice_NtwinSystem(1:f-1_pInt,myStructure)) + k constitutive_dislotwin_twinSystemLattice(l,i) = sum(lattice_NtwinSystem(1:f-1_pInt,myStructure)) + k
! write(6,*) 'twin system',l,'has family',f,'and is actually',constitutive_dislotwin_twinSystemLattice(l,i)
enddo; enddo enddo; enddo
!* Determine size of state array !* Determine size of state array
ns = constitutive_dislotwin_totalNslip(i) ns = constitutive_dislotwin_totalNslip(i)
nt = constitutive_dislotwin_totalNtwin(i) nt = constitutive_dislotwin_totalNtwin(i)
constitutive_dislotwin_sizeDotState(i) =int(size(constitutive_dislotwin_listBasicSlipStates),pInt)*ns& ! write(6,*) 'instance',i,'has nslip and ntwin',ns,nt
+int(size(constitutive_dislotwin_listBasicTwinStates),pInt)*nt constitutive_dislotwin_sizeDotState(i) = int(size(constitutive_dislotwin_listBasicSlipStates),pInt)*ns&
+ int(size(constitutive_dislotwin_listBasicTwinStates),pInt)*nt
constitutive_dislotwin_sizeState(i) = constitutive_dislotwin_sizeDotState(i)& constitutive_dislotwin_sizeState(i) = constitutive_dislotwin_sizeDotState(i)&
+ int(size(constitutive_dislotwin_listDependentSlipStates),pInt)*ns& + int(size(constitutive_dislotwin_listDependentSlipStates),pInt)*ns&
+ int(size(constitutive_dislotwin_listDependentTwinStates),pInt)*nt + int(size(constitutive_dislotwin_listDependentTwinStates),pInt)*nt
@ -529,14 +535,14 @@ do i = 1_pInt,maxNinstance
'edge_dipole_distance', & 'edge_dipole_distance', &
'stress_exponent' & 'stress_exponent' &
) )
mySize = constitutive_dislotwin_totalNslip(i) mySize = ns
case('twin_fraction', & case('twin_fraction', &
'shear_rate_twin', & 'shear_rate_twin', &
'mfp_twin', & 'mfp_twin', &
'resolved_stress_twin', & 'resolved_stress_twin', &
'threshold_stress_twin' & 'threshold_stress_twin' &
) )
mySize = constitutive_dislotwin_totalNtwin(i) mySize = nt
case('resolved_stress_shearband', & case('resolved_stress_shearband', &
'shear_rate_shearband' & 'shear_rate_shearband' &
) )
@ -557,6 +563,7 @@ do i = 1_pInt,maxNinstance
endif endif
enddo enddo
!* Elasticity matrix and shear modulus according to material.config !* Elasticity matrix and shear modulus according to material.config
select case (myStructure) select case (myStructure)
case(1_pInt:2_pInt) ! cubic(s) case(1_pInt:2_pInt) ! cubic(s)
@ -628,20 +635,20 @@ do i = 1_pInt,maxNinstance
myStructure),i) myStructure),i)
enddo; enddo enddo; enddo
do s1 = 1_pInt,constitutive_dislotwin_totalNslip(i)
do t2 = 1_pInt,constitutive_dislotwin_totalNtwin(i) do t2 = 1_pInt,constitutive_dislotwin_totalNtwin(i)
do s1 = 1_pInt,constitutive_dislotwin_totalNslip(i)
constitutive_dislotwin_interactionMatrixSlipTwin(s1,t2,i) = & constitutive_dislotwin_interactionMatrixSlipTwin(s1,t2,i) = &
constitutive_dislotwin_interactionSlipTwin(& constitutive_dislotwin_interactionSlipTwin(&
lattice_interactionSlipTwin(constitutive_dislotwin_slipSystemLattice(s1,i), & lattice_interactionSlipTwin(constitutive_dislotwin_twinSystemLattice(t2,i), &
constitutive_dislotwin_twinSystemLattice(t2,i),myStructure),i) constitutive_dislotwin_slipSystemLattice(s1,i),myStructure),i)
enddo; enddo enddo; enddo
do t1 = 1_pInt,constitutive_dislotwin_totalNtwin(i)
do s2 = 1_pInt,constitutive_dislotwin_totalNslip(i) do s2 = 1_pInt,constitutive_dislotwin_totalNslip(i)
do t1 = 1_pInt,constitutive_dislotwin_totalNtwin(i)
constitutive_dislotwin_interactionMatrixTwinSlip(t1,s2,i) = & constitutive_dislotwin_interactionMatrixTwinSlip(t1,s2,i) = &
constitutive_dislotwin_interactionTwinSlip(lattice_interactionTwinSlip(& constitutive_dislotwin_interactionTwinSlip(lattice_interactionTwinSlip(&
constitutive_dislotwin_twinSystemLattice(t1,i), & constitutive_dislotwin_slipSystemLattice(s2,i), &
constitutive_dislotwin_slipSystemLattice(s2,i), myStructure),i) constitutive_dislotwin_twinSystemLattice(t1,i), myStructure),i)
enddo; enddo enddo; enddo
do t1 = 1_pInt,constitutive_dislotwin_totalNtwin(i) do t1 = 1_pInt,constitutive_dislotwin_totalNtwin(i)