parsing of material.config file now expects adequate number of (slip/twin) family entries according to given lattice type.

used to read up to maxN, but that caused unnecessary IO_warnings...
This commit is contained in:
Philip Eisenlohr 2013-02-14 22:24:55 +00:00
parent 30024af6c2
commit c1cf446774
6 changed files with 415 additions and 403 deletions

View File

@ -129,6 +129,9 @@ subroutine constitutive_dislotwin_init(file)
!**************************************
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
use prec, only: pInt,pReal
use debug, only: debug_level,&
debug_constitutive,&
debug_levelBasic
use math, only: math_Mandel3333to66,math_Voigt66to3333,math_mul3x3
use mesh, only: mesh_maxNips, mesh_NcpElems
use IO
@ -140,8 +143,11 @@ integer(pInt), intent(in) :: file
!* Local variables
integer(pInt), parameter :: maxNchunks = 21_pInt
integer(pInt), dimension(1+2*maxNchunks) :: positions
integer(pInt), dimension(6) :: configNchunks
integer(pInt) :: section, maxNinstance,mySize=0_pInt,myStructure,maxTotalNslip,maxTotalNtwin,&
f,i,j,k,l,m,n,o,p,q,r,s,ns,nt, &
Nchunks_SlipSlip, Nchunks_SlipTwin, Nchunks_TwinSlip, Nchunks_TwinTwin, &
Nchunks_SlipFamilies, Nchunks_TwinFamilies, &
index_myFamily, index_otherFamily
character(len=64) tag
character(len=1024) :: line = '' ! to start initialized
@ -154,6 +160,18 @@ write(6,*) '$Id$'
maxNinstance = int(count(phase_plasticity == constitutive_dislotwin_label),pInt)
if (maxNinstance == 0_pInt) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) then
write(6,'(a16,1x,i5)') '# instances:',maxNinstance
write(6,*)
endif
Nchunks_SlipFamilies = lattice_maxNslipFamily
Nchunks_TwinFamilies = lattice_maxNtwinFamily
Nchunks_SlipSlip = lattice_maxNinteraction
Nchunks_SlipTwin = lattice_maxNinteraction
Nchunks_TwinSlip = lattice_maxNinteraction
Nchunks_TwinTwin = lattice_maxNinteraction
!* Space allocation for global variables
allocate(constitutive_dislotwin_sizeDotState(maxNinstance))
constitutive_dislotwin_sizeDotState = 0_pInt
@ -286,6 +304,13 @@ do ! read thru sections of
constitutive_dislotwin_output(constitutive_dislotwin_Noutput(i),i) = IO_lc(IO_stringValue(line,positions,2_pInt))
case ('lattice_structure')
constitutive_dislotwin_structureName(i) = IO_lc(IO_stringValue(line,positions,2_pInt))
configNchunks = lattice_configNchunks(constitutive_dislotwin_structureName(i))
Nchunks_SlipFamilies = configNchunks(1)
Nchunks_TwinFamilies = configNchunks(2)
Nchunks_SlipSlip = configNchunks(3)
Nchunks_SlipTwin = configNchunks(4)
Nchunks_TwinSlip = configNchunks(5)
Nchunks_TwinTwin = configNchunks(6)
case ('covera_ratio')
constitutive_dislotwin_CoverA(i) = IO_floatValue(line,positions,2_pInt)
case ('c11')
@ -307,47 +332,47 @@ do ! read thru sections of
case ('c66')
constitutive_dislotwin_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt)
case ('nslip')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j)
enddo
case ('ntwin')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_dislotwin_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j)
enddo
case ('rhoedge0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_rhoEdge0(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('rhoedgedip0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_rhoEdgeDip0(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('slipburgers')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_burgersPerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('twinburgers')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_dislotwin_burgersPerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('qedge')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_QedgePerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('v0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_v0PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('ndot0')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_dislotwin_Ndot0PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('twinsize')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_dislotwin_twinsizePerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('clambdaslip')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_dislotwin_CLambdaSlipPerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('grainsize')
@ -381,19 +406,19 @@ do ! read thru sections of
case ('catomicvolume')
constitutive_dislotwin_CAtomicVolume(i) = IO_floatValue(line,positions,2_pInt)
case ('interaction_slipslip','interactionslipslip')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_SlipSlip
constitutive_dislotwin_interaction_SlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('interaction_sliptwin','interactionsliptwin')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_SlipTwin
constitutive_dislotwin_interaction_SlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('interaction_twinslip','interactiontwinslip')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_TwinSlip
constitutive_dislotwin_interaction_TwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('interaction_twintwin','interactiontwintwin')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_TwinTwin
constitutive_dislotwin_interaction_TwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
case ('sfe_0k')

View File

@ -242,17 +242,17 @@ subroutine constitutive_j2_init(myFile)
case ('h0')
constitutive_j2_h0(i) = IO_floatValue(line,positions,2_pInt)
case ('h0_slope','slopelnrate')
constitutive_j2_h0_slopeLnRate(i) = IO_floatValue(line,positions,2)
constitutive_j2_h0_slopeLnRate(i) = IO_floatValue(line,positions,2_pInt)
case ('tausat')
constitutive_j2_tausat(i) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfita')
constitutive_j2_tausat_SinhFitA(i) = IO_floatValue(line,positions,2)
constitutive_j2_tausat_SinhFitA(i) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitb')
constitutive_j2_tausat_SinhFitB(i) = IO_floatValue(line,positions,2)
constitutive_j2_tausat_SinhFitB(i) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitc')
constitutive_j2_tausat_SinhFitC(i) = IO_floatValue(line,positions,2)
constitutive_j2_tausat_SinhFitC(i) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitd')
constitutive_j2_tausat_SinhFitD(i) = IO_floatValue(line,positions,2)
constitutive_j2_tausat_SinhFitD(i) = IO_floatValue(line,positions,2_pInt)
case ('a', 'w0')
constitutive_j2_a(i) = IO_floatValue(line,positions,2_pInt)
case ('taylorfactor')

View File

@ -228,17 +228,7 @@ use material, only: homogenization_maxNgrains, &
phase_plasticity, &
phase_plasticityInstance, &
phase_Noutput
use lattice, only: lattice_maxNslipFamily, &
lattice_maxNslip, &
lattice_maxNinteraction, &
lattice_NslipSystem, &
lattice_initializeStructure, &
lattice_symmetrizeC66, &
lattice_sd, &
lattice_sn, &
lattice_st, &
lattice_interactionSlipSlip, &
lattice_maxNonSchmid
use lattice
!*** output variables
@ -249,6 +239,7 @@ integer(pInt), intent(in) :: myFile
integer(pInt), parameter :: maxNchunks = 21_pInt
integer(pInt), &
dimension(1_pInt+2_pInt*maxNchunks) :: positions
integer(pInt), dimension(6) :: configNchunks
integer(pInt) :: section, &
maxNinstance, &
maxTotalNslip, &
@ -262,6 +253,8 @@ integer(pInt) :: section, &
s1, & ! index of my slip system
s2, & ! index of my slip system
it, & ! index of my interaction type
Nchunks_SlipSlip, &
Nchunks_SlipFamilies, &
mySize = 0_pInt ! to suppress warnings, safe as init is called only once
character(len=64) tag
character(len=1024) :: line = '' ! to start initialized
@ -276,10 +269,10 @@ if (maxNinstance == 0) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) then
write(6,'(a16,1x,i5)') '# instances:',maxNinstance
write(6,*)
endif
!*** space allocation for global variables
!*** memory allocation for global variables
allocate(constitutive_nonlocal_sizeDotState(maxNinstance))
allocate(constitutive_nonlocal_sizeDependentState(maxNinstance))
@ -433,6 +426,9 @@ do
constitutive_nonlocal_output(constitutive_nonlocal_Noutput(i),i) = IO_lc(IO_stringValue(line,positions,2_pInt))
case ('lattice_structure')
constitutive_nonlocal_structureName(i) = IO_lc(IO_stringValue(line,positions,2_pInt))
configNchunks = lattice_configNchunks(constitutive_nonlocal_structureName(i))
Nchunks_SlipFamilies = configNchunks(1)
Nchunks_SlipSlip = configNchunks(3)
case ('c/a_ratio','covera_ratio')
constitutive_nonlocal_CoverA(i) = IO_floatValue(line,positions,2_pInt)
case ('c11')
@ -454,49 +450,49 @@ do
case ('c66')
constitutive_nonlocal_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt)
case ('nslip')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_Nslip(f,i) = IO_intValue(line,positions,1_pInt+f)
enddo
case ('rhosgledgepos0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoSglEdgePos0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('rhosgledgeneg0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoSglEdgeNeg0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('rhosglscrewpos0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoSglScrewPos0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('rhosglscrewneg0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoSglScrewNeg0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('rhodipedge0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoDipEdge0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('rhodipscrew0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_rhoDipScrew0(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('lambda0')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_lambda0PerSlipFamily(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case ('burgers')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_burgersPerSlipFamily(f,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case('cutoffradius','r')
constitutive_nonlocal_R(i) = IO_floatValue(line,positions,2_pInt)
case('minimumdipoleheightedge','ddipminedge')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_minimumDipoleHeightPerSlipFamily(f,1_pInt,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case('minimumdipoleheightscrew','ddipminscrew')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_minimumDipoleHeightPerSlipFamily(f,2_pInt,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case('atomicvolume')
@ -512,7 +508,7 @@ do
case('significantn','significant_n','significantdislocations','significant_dislcations')
constitutive_nonlocal_significantN(i) = IO_floatValue(line,positions,2_pInt)
case ('interaction_slipslip')
do it = 1_pInt, lattice_maxNinteraction
do it = 1_pInt, Nchunks_SlipSlip
constitutive_nonlocal_interactionSlipSlip(it,i) = IO_floatValue(line,positions,1_pInt+it)
enddo
case('linetension','linetensioneffect','linetension_effect')
@ -520,11 +516,11 @@ do
case('edgejog','edgejogs','edgejogeffect','edgejog_effect')
constitutive_nonlocal_edgeJogFactor(i) = IO_floatValue(line,positions,2_pInt)
case('peierlsstressedge','peierlsstress_edge')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_peierlsStressPerSlipFamily(f,1_pInt,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case('peierlsstressscrew','peierlsstress_screw')
do f = 1_pInt, lattice_maxNslipFamily
do f = 1_pInt, Nchunks_SlipFamilies
constitutive_nonlocal_peierlsStressPerSlipFamily(f,2_pInt,i) = IO_floatValue(line,positions,1_pInt+f)
enddo
case('doublekinkwidth')

View File

@ -131,6 +131,7 @@ subroutine constitutive_phenopowerlaw_init(myFile)
integer(pInt), intent(in) :: myFile
integer(pInt), parameter :: maxNchunks = lattice_maxNinteraction + 1_pInt
integer(pInt), dimension(1+2*maxNchunks) :: positions
integer(pInt), dimension(6) :: configNchunks
integer(pInt) :: section, maxNinstance, i,j,k, f,o, &
Nchunks_SlipSlip, Nchunks_SlipTwin, Nchunks_TwinSlip, Nchunks_TwinTwin, &
Nchunks_SlipFamilies, Nchunks_TwinFamilies, &
@ -146,17 +147,18 @@ subroutine constitutive_phenopowerlaw_init(myFile)
maxNinstance = int(count(phase_plasticity == constitutive_phenopowerlaw_label),pInt)
if (maxNinstance == 0) return
Nchunks_SlipSlip = lattice_maxNinteraction
Nchunks_SlipTwin = lattice_maxNinteraction
Nchunks_TwinSlip = lattice_maxNinteraction
Nchunks_TwinTwin = lattice_maxNinteraction
Nchunks_SlipFamilies = lattice_maxNslipFamily
Nchunks_TwinFamilies = lattice_maxNtwinFamily
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) then
write(6,'(a16,1x,i5)') '# instances:',maxNinstance
write(6,*)
endif
Nchunks_SlipFamilies = lattice_maxNslipFamily
Nchunks_TwinFamilies = lattice_maxNtwinFamily
Nchunks_SlipSlip = lattice_maxNinteraction
Nchunks_SlipTwin = lattice_maxNinteraction
Nchunks_TwinSlip = lattice_maxNinteraction
Nchunks_TwinTwin = lattice_maxNinteraction
allocate(constitutive_phenopowerlaw_sizeDotState(maxNinstance))
constitutive_phenopowerlaw_sizeDotState = 0_pInt
allocate(constitutive_phenopowerlaw_sizeState(maxNinstance))
@ -264,29 +266,13 @@ subroutine constitutive_phenopowerlaw_init(myFile)
IO_lc(IO_stringValue(line,positions,2_pInt))
case ('lattice_structure')
constitutive_phenopowerlaw_structureName(i) = IO_lc(IO_stringValue(line,positions,2_pInt))
select case (constitutive_phenopowerlaw_structureName(i))
case ('fcc')
Nchunks_SlipSlip = maxval(lattice_fcc_interactionSlipSlip)
Nchunks_SlipTwin = maxval(lattice_fcc_interactionSlipTwin)
Nchunks_TwinSlip = maxval(lattice_fcc_interactionTwinSlip)
Nchunks_TwinTwin = maxval(lattice_fcc_interactionTwinTwin)
Nchunks_SlipFamilies = count(lattice_fcc_NslipSystem > 0_pInt)
Nchunks_TwinFamilies = count(lattice_fcc_NtwinSystem > 0_pInt)
case ('bcc')
Nchunks_SlipSlip = maxval(lattice_bcc_interactionSlipSlip)
Nchunks_SlipTwin = maxval(lattice_bcc_interactionSlipTwin)
Nchunks_TwinSlip = maxval(lattice_bcc_interactionTwinSlip)
Nchunks_TwinTwin = maxval(lattice_bcc_interactionTwinTwin)
Nchunks_SlipFamilies = count(lattice_bcc_NslipSystem > 0_pInt)
Nchunks_TwinFamilies = count(lattice_bcc_NtwinSystem > 0_pInt)
case ('hex')
Nchunks_SlipSlip = maxval(lattice_hex_interactionSlipSlip)
Nchunks_SlipTwin = maxval(lattice_hex_interactionSlipTwin)
Nchunks_TwinSlip = maxval(lattice_hex_interactionTwinSlip)
Nchunks_TwinTwin = maxval(lattice_hex_interactionTwinTwin)
Nchunks_SlipFamilies = count(lattice_hex_NslipSystem > 0_pInt)
Nchunks_TwinFamilies = count(lattice_hex_NtwinSystem > 0_pInt)
end select
configNchunks = lattice_configNchunks(constitutive_phenopowerlaw_structureName(i))
Nchunks_SlipFamilies = configNchunks(1)
Nchunks_TwinFamilies = configNchunks(2)
Nchunks_SlipSlip = configNchunks(3)
Nchunks_SlipTwin = configNchunks(4)
Nchunks_TwinSlip = configNchunks(5)
Nchunks_TwinTwin = configNchunks(6)
case ('covera_ratio')
constitutive_phenopowerlaw_CoverA(i) = IO_floatValue(line,positions,2_pInt)
case ('c11')

View File

@ -233,6 +233,9 @@ subroutine constitutive_titanmod_init(file)
!**************************************
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
use prec, only: pInt,pReal
use debug, only: debug_level,&
debug_constitutive,&
debug_levelBasic
use math, only: math_Mandel3333to66,math_Voigt66to3333,math_mul3x3
use IO
use material
@ -243,8 +246,11 @@ integer(pInt), intent(in) :: file
!* Local variables
integer(pInt), parameter :: maxNchunks = 21_pInt
integer(pInt), dimension(1_pInt+2_pInt*maxNchunks) :: positions
integer(pInt), dimension(6) :: configNchunks
integer(pInt) :: section,f,i,j,k,l,m,n,o,p,q,r,s,s1,s2,t,t1,t2,ns,nt,&
mySize = 0_pInt,myStructure,maxTotalNslip,maxTotalNtwin
Nchunks_SlipSlip, Nchunks_SlipTwin, Nchunks_TwinSlip, Nchunks_TwinTwin, &
Nchunks_SlipFamilies, Nchunks_TwinFamilies, &
mySize,myStructure,maxTotalNslip,maxTotalNtwin
integer :: maxNinstance !no pInt
character(len=64) :: tag
character(len=1024) :: line = '' ! to start initialized
@ -257,7 +263,19 @@ write(6,*) '$Id$'
maxNinstance = count(phase_plasticity == constitutive_titanmod_label)
if (maxNinstance == 0) return
!* Space allocation for global variables
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) then
write(6,'(a16,1x,i5)') '# instances:',maxNinstance
write(6,*)
endif
Nchunks_SlipFamilies = lattice_maxNslipFamily
Nchunks_TwinFamilies = lattice_maxNtwinFamily
Nchunks_SlipSlip = lattice_maxNinteraction
Nchunks_SlipTwin = lattice_maxNinteraction
Nchunks_TwinSlip = lattice_maxNinteraction
Nchunks_TwinTwin = lattice_maxNinteraction
!* memory allocation for global variables
allocate(constitutive_titanmod_sizeDotState(maxNinstance))
constitutive_titanmod_sizeDotState = 0_pInt
allocate(constitutive_titanmod_sizeState(maxNinstance))
@ -394,13 +412,11 @@ allocate(constitutive_titanmod_interactionTwinSlip(lattice_maxNinteraction,maxNi
allocate(constitutive_titanmod_interactionTwinTwin(lattice_maxNinteraction,maxNinstance))
constitutive_titanmod_interactionTwinTwin = 0.0_pReal
!* Readout data from material.config file
!* Read data from material.config file
rewind(file)
line = ''
section = 0_pInt
write(6,*) 'titanmod: Reading material parameters from material config file'
do while (IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to <phase>
read(file,'(a1024)',END=100) line
enddo
@ -423,244 +439,195 @@ enddo
case ('(output)')
constitutive_titanmod_Noutput(i) = constitutive_titanmod_Noutput(i) + 1_pInt
constitutive_titanmod_output(constitutive_titanmod_Noutput(i),i) = IO_lc(IO_stringValue(line,positions,2_pInt))
write(6,*) tag,constitutive_titanmod_output(constitutive_titanmod_Noutput(i),i)
case ('lattice_structure')
constitutive_titanmod_structureName(i) = IO_lc(IO_stringValue(line,positions,2_pInt))
write(6,*) tag,constitutive_titanmod_structureName(i)
configNchunks = lattice_configNchunks(constitutive_titanmod_structureName(i))
Nchunks_SlipFamilies = configNchunks(1)
Nchunks_TwinFamilies = configNchunks(2)
Nchunks_SlipSlip = configNchunks(3)
Nchunks_SlipTwin = configNchunks(4)
Nchunks_TwinSlip = configNchunks(5)
Nchunks_TwinTwin = configNchunks(6)
case ('covera_ratio')
constitutive_titanmod_CoverA(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_CoverA(i)
case ('c11')
constitutive_titanmod_Cslip_66(1,1,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(1,1,i)
case ('c12')
constitutive_titanmod_Cslip_66(1,2,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(1,1,i)
case ('c13')
constitutive_titanmod_Cslip_66(1,3,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(1,1,i)
case ('c22')
constitutive_titanmod_Cslip_66(2,2,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(2,2,i)
case ('c23')
constitutive_titanmod_Cslip_66(2,3,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(2,3,i)
case ('c33')
constitutive_titanmod_Cslip_66(3,3,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(3,3,i)
case ('c44')
constitutive_titanmod_Cslip_66(4,4,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(4,4,i)
case ('c55')
constitutive_titanmod_Cslip_66(5,5,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(5,5,i)
case ('c66')
constitutive_titanmod_Cslip_66(1,3,i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_Cslip_66(6,6,i)
case ('debyefrequency')
constitutive_titanmod_debyefrequency(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_debyefrequency(i)
case ('kinkf0')
constitutive_titanmod_kinkf0(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag,constitutive_titanmod_kinkf0(i)
case ('nslip')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_Nslip(1:4,i)
case ('ntwin')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_Ntwin(1:4,i)
case ('rho_edge0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_rho_edge0(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_rho_edge0(1:4,i)
case ('rho_screw0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_rho_screw0(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_rho_screw0(1:4,i)
case ('slipburgers')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_burgersPerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_burgersPerSlipFamily(1:4,i)
case ('twinburgers')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_burgersPerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_burgersPerTwinFamily(1:4,i)
case ('f0')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_f0_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_f0_PerSlipFamily(1:4,i)
case ('twinf0')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinf0_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twinf0_PerTwinFamily(1:4,i)
case ('tau0e')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_tau0e_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_tau0e_PerSlipFamily(1:4,i)
case ('twintau0')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twintau0_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twintau0_PerTwinFamily(1:4,i)
case ('tau0s')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_tau0s_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_tau0s_PerSlipFamily(1:4,i)
case ('capre')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_capre_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_capre_PerSlipFamily(1:4,i)
case ('caprs')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_caprs_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_caprs_PerSlipFamily(1:4,i)
case ('v0e')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_v0e_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_v0e_PerSlipFamily(1:4,i)
case ('twingamma0')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twingamma0_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twingamma0_PerTwinFamily(1:4,i)
case ('v0s')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_v0s_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_v0s_PerSlipFamily(1:4,i)
case ('kinkcriticallength')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_kinkcriticallength_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_kinkcriticallength_PerSlipFamily(1:4,i)
case ('twinsize')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinsizePerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('celambdaslip')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_CeLambdaSlipPerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('twinlambdaslip')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinlambdaslipPerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twinlambdaslipPerTwinFamily(1:4,i)
case ('cslambdaslip')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_CsLambdaSlipPerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('grainsize')
constitutive_titanmod_GrainSize(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag
case ('maxtwinfraction')
constitutive_titanmod_MaxTwinFraction(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag
case ('pe')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_pe_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_pe_PerSlipFamily(1:4,i)
case ('twinp')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinp_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twinp_PerTwinFamily(1:4,i)
case ('ps')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_ps_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_ps_PerSlipFamily(1:4,i)
case ('qe')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_qe_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_qe_PerSlipFamily(1:4,i)
case ('twinq')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinq_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twinq_PerTwinFamily(1:4,i)
case ('qs')
do j = 1_pInt, lattice_maxNslipFamily
do j = 1_pInt, Nchunks_SlipFamilies
constitutive_titanmod_qs_PerSlipFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_qs_PerSlipFamily(1:4,i)
case ('twinshearconstant')
do j = 1_pInt, lattice_maxNtwinFamily
do j = 1_pInt, Nchunks_TwinFamilies
constitutive_titanmod_twinshearconstant_PerTwinFamily(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag,constitutive_titanmod_twinshearconstant_PerTwinFamily(1:4,i)
case ('dc')
constitutive_titanmod_dc(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag
case ('twinhpconstant')
constitutive_titanmod_twinhpconstant(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag
case ('atol_rho')
constitutive_titanmod_aTolRho(i) = IO_floatValue(line,positions,2_pInt)
write(6,*) tag
case ('interactionslipslip')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_SlipSlip
constitutive_titanmod_interactionSlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactionee')
do j = 1_pInt, lattice_maxNinteraction
constitutive_titanmod_interaction_ee(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactionss')
do j = 1_pInt, lattice_maxNinteraction
constitutive_titanmod_interaction_ss(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactiones')
do j = 1_pInt, lattice_maxNinteraction
constitutive_titanmod_interaction_es(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactionsliptwin')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_SlipTwin
constitutive_titanmod_interactionSlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactiontwinslip')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_TwinSlip
constitutive_titanmod_interactionTwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case ('interactiontwintwin')
do j = 1_pInt, lattice_maxNinteraction
do j = 1_pInt, Nchunks_TwinTwin
constitutive_titanmod_interactionTwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j)
enddo
write(6,*) tag
case default
call IO_error(210_pInt,ext_msg=tag//' ('//constitutive_titanmod_label//')')
end select
endif
enddo
write(6,*) 'Material Property reading done'
100 do i = 1_pInt,maxNinstance
constitutive_titanmod_structure(i) = &
lattice_initializeStructure(constitutive_titanmod_structureName(i),constitutive_titanmod_CoverA(i))
@ -726,14 +693,12 @@ write(6,*) 'Material Property reading done'
constitutive_titanmod_Ntwin(:,i) = min(lattice_NtwinSystem(:,myStructure),constitutive_titanmod_Ntwin(:,i))
constitutive_titanmod_totalNslip(i) = sum(constitutive_titanmod_Nslip(:,i))
constitutive_titanmod_totalNtwin(i) = sum(constitutive_titanmod_Ntwin(:,i))
write(6,*) 'Sanity Checks done !'
enddo
!* Allocation of variables whose size depends on the total number of active slip systems
maxTotalNslip = maxval(constitutive_titanmod_totalNslip)
maxTotalNtwin = maxval(constitutive_titanmod_totalNtwin)
write(6,*) 'maxTotalNslip',maxTotalNslip
write(6,*) 'maxTotalNtwin',maxTotalNtwin
allocate(constitutive_titanmod_burgersPerSlipSystem(maxTotalNslip, maxNinstance))
allocate(constitutive_titanmod_burgersPerTwinSystem(maxTotalNtwin, maxNinstance))
@ -817,7 +782,6 @@ allocate(constitutive_titanmod_Ctwin_3333(3,3,3,3,maxTotalNtwin,maxNinstance))
constitutive_titanmod_Ctwin_66 = 0.0_pReal
constitutive_titanmod_Ctwin_3333 = 0.0_pReal
write(6,*) 'Allocated slip system variables'
do i = 1_pInt,maxNinstance
myStructure = constitutive_titanmod_structure(i)
@ -847,10 +811,11 @@ do i = 1_pInt,maxNinstance
constitutive_titanmod_sizeState(i) = &
constitutive_titanmod_sizeDotState(i)+ &
size(constitutive_titanmod_listDependentSlipStates)*ns+size(constitutive_titanmod_listDependentTwinStates)*nt
write(6,*) 'Determined size of state and dot state'
!* Determine size of postResults array
do o = 1_pInt,constitutive_titanmod_Noutput(i)
mySize = 0_pInt
select case(constitutive_titanmod_output(o,i))
case('rhoedge', &
'rhoscrew', &
@ -874,10 +839,10 @@ do i = 1_pInt,maxNinstance
'tau_twin' &
)
mySize = constitutive_titanmod_totalNtwin(i)
case('shear_basal', & ! use only if all 4 slip familiies in hex are considered
'shear_prism', & ! use only if all 4 slip familiies in hex are considered
'shear_pyra', & ! use only if all 4 slip familiies in hex are considered
'shear_pyrca', & ! use only if all 4 slip familiies in hex are considered
case('shear_basal', & ! use only if all 4 slip families in hex are considered
'shear_prism', & ! use only if all 4 slip families in hex are considered
'shear_pyra', & ! use only if all 4 slip families in hex are considered
'shear_pyrca', & ! use only if all 4 slip families in hex are considered
'rhoedge_basal', &
'rhoedge_prism', &
'rhoedge_pyra', &
@ -899,8 +864,6 @@ do i = 1_pInt,maxNinstance
endif
enddo
write(6,*) 'Determining elasticity matrix'
!* Elasticity matrix and shear modulus according to material.config
constitutive_titanmod_Cslip_66(:,:,i) = lattice_symmetrizeC66(constitutive_titanmod_structureName(i),&
constitutive_titanmod_Cslip_66(:,:,i))
@ -1036,7 +999,6 @@ do i = 1_pInt,maxNinstance
enddo; enddo
enddo
write(6,*) 'Init All done'
end subroutine

View File

@ -707,7 +707,8 @@ module lattice
lattice_init, &
lattice_initializeStructure, &
lattice_symmetryType, &
lattice_symmetrizeC66
lattice_symmetrizeC66, &
lattice_configNchunks
contains
@ -1054,4 +1055,46 @@ integer(pInt) function lattice_initializeStructure(struct,CoverA)
end function lattice_initializeStructure
!--------------------------------------------------------------------------------------------------
!> @brief Number of parameters to expect in material.config section
! NslipFamilies
! NtwinFamilies
! SlipSlipInteraction
! SlipTwinInteraction
! TwinSlipInteraction
! TwinTwinInteraction
!--------------------------------------------------------------------------------------------------
function lattice_configNchunks(struct)
use prec, only: pReal,pInt
implicit none
integer(pInt), dimension(6) :: lattice_configNchunks
character(len=*), intent(in) :: struct
select case(struct(1:3)) ! check first three chars of structure name
case ('fcc')
lattice_configNchunks(1) = count(lattice_fcc_NslipSystem > 0_pInt)
lattice_configNchunks(2) = count(lattice_fcc_NtwinSystem > 0_pInt)
lattice_configNchunks(3) = maxval(lattice_fcc_interactionSlipSlip)
lattice_configNchunks(4) = maxval(lattice_fcc_interactionSlipTwin)
lattice_configNchunks(5) = maxval(lattice_fcc_interactionTwinSlip)
lattice_configNchunks(6) = maxval(lattice_fcc_interactionTwinTwin)
case ('bcc')
lattice_configNchunks(1) = count(lattice_bcc_NslipSystem > 0_pInt)
lattice_configNchunks(2) = count(lattice_bcc_NtwinSystem > 0_pInt)
lattice_configNchunks(3) = maxval(lattice_bcc_interactionSlipSlip)
lattice_configNchunks(4) = maxval(lattice_bcc_interactionSlipTwin)
lattice_configNchunks(5) = maxval(lattice_bcc_interactionTwinSlip)
lattice_configNchunks(6) = maxval(lattice_bcc_interactionTwinTwin)
case ('hex')
lattice_configNchunks(1) = count(lattice_hex_NslipSystem > 0_pInt)
lattice_configNchunks(2) = count(lattice_hex_NtwinSystem > 0_pInt)
lattice_configNchunks(3) = maxval(lattice_hex_interactionSlipSlip)
lattice_configNchunks(4) = maxval(lattice_hex_interactionSlipTwin)
lattice_configNchunks(5) = maxval(lattice_hex_interactionTwinSlip)
lattice_configNchunks(6) = maxval(lattice_hex_interactionTwinTwin)
end select
end function lattice_configNchunks
end module lattice