From 54a68014ea9f8e1593d1871fecb8a739563b98f0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 24 Apr 2018 17:31:05 +0200 Subject: [PATCH 01/42] Ntrans not needed/used. Simplified storage of parameters --- PRIVATE | 2 +- src/plastic_phenopowerlaw.f90 | 286 ++++++++++++++-------------------- 2 files changed, 121 insertions(+), 167 deletions(-) diff --git a/PRIVATE b/PRIVATE index af8516892..7c69abfc5 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit af851689285b8c1a633495219abd9dbbd5a11c69 +Subproject commit 7c69abfc5bf54c083b9096511abde7d74b806b7f diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 229d03c26..368ce8bd5 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -24,36 +24,13 @@ module plastic_phenopowerlaw integer(pInt), dimension(:), allocatable, public, protected :: & plastic_phenopowerlaw_totalNslip, & !< no. of slip system used in simulation - plastic_phenopowerlaw_totalNtwin, & !< no. of twin system used in simulation - plastic_phenopowerlaw_totalNtrans !< no. of trans system used in simulation + plastic_phenopowerlaw_totalNtwin !< no. of twin system used in simulation + integer(pInt), dimension(:,:), allocatable, private :: & plastic_phenopowerlaw_Nslip, & !< active number of slip systems per family (input parameter, per family) - plastic_phenopowerlaw_Ntwin, & !< active number of twin systems per family (input parameter, per family) - plastic_phenopowerlaw_Ntrans !< active number of trans systems per family (input parameter, per family) + plastic_phenopowerlaw_Ntwin !< active number of twin systems per family (input parameter, per family) - real(pReal), dimension(:), allocatable, private :: & - plastic_phenopowerlaw_gdot0_slip, & !< reference shear strain rate for slip (input parameter) - plastic_phenopowerlaw_gdot0_twin, & !< reference shear strain rate for twin (input parameter) - plastic_phenopowerlaw_n_slip, & !< stress exponent for slip (input parameter) - plastic_phenopowerlaw_n_twin, & !< stress exponent for twin (input parameter) - plastic_phenopowerlaw_spr, & !< push-up factor for slip saturation due to twinning - plastic_phenopowerlaw_twinB, & - plastic_phenopowerlaw_twinC, & - plastic_phenopowerlaw_twinD, & - plastic_phenopowerlaw_twinE, & - plastic_phenopowerlaw_h0_SlipSlip, & !< reference hardening slip - slip (input parameter) - plastic_phenopowerlaw_h0_TwinSlip, & !< reference hardening twin - slip (input parameter) - plastic_phenopowerlaw_h0_TwinTwin, & !< reference hardening twin - twin (input parameter) - plastic_phenopowerlaw_a_slip, & - plastic_phenopowerlaw_aTolResistance, & - plastic_phenopowerlaw_aTolShear, & - plastic_phenopowerlaw_aTolTwinfrac, & - plastic_phenopowerlaw_aTolTransfrac, & - plastic_phenopowerlaw_Cnuc, & !< coefficient for strain-induced martensite nucleation - plastic_phenopowerlaw_Cdwp, & !< coefficient for double well potential - plastic_phenopowerlaw_Cgro, & !< coefficient for stress-assisted martensite growth - plastic_phenopowerlaw_deltaG !< free energy difference between austensite and martensite [MPa] real(pReal), dimension(:,:), allocatable, private :: & plastic_phenopowerlaw_tau0_slip, & !< initial critical shear stress for slip (input parameter, per family) @@ -89,6 +66,41 @@ module plastic_phenopowerlaw integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: & plastic_phenopowerlaw_outputID !< ID of each post result output + type, private :: tParameters !< container type for internal constitutive parameters + real(pReal) :: & + gdot0_slip, & !< reference shear strain rate for slip + gdot0_twin, & !< reference shear strain rate for twin + n_slip, & !< stress exponent for slip + n_twin, & !< stress exponent for twin + spr, & !< push-up factor for slip saturation due to twinning + twinB, & + twinC, & + twinD, & + twinE, & + h0_SlipSlip, & !< reference hardening slip - slip + h0_TwinSlip, & !< reference hardening twin - slip + h0_TwinTwin, & !< reference hardening twin - twin + a_slip, & + aTolResistance = 1.0_pReal, & ! default absolute tolerance 1 Pa + aTolShear = 1.0e-6_pReal, & ! default absolute tolerance 1e-6 + aTolTwinfrac = 1.0e-6_pReal ! default absolute tolerance 1e-6 + integer(pInt), dimension(:), allocatable :: & + Nslip, & !< active number of slip systems per family + Ntwin !< active number of twin systems per family + real(pReal), dimension(:), allocatable :: & + tau0_slip, & !< initial critical shear stress for slip + tau0_twin, & !< initial critical shear stress for twin + tausat_slip, & !< maximum critical shear stress for slip + nonSchmidCoeff, & + H_int, & !< per family hardening activity (optional) + + interaction_SlipSlip, & !< slip resistance from slip activity + interaction_SlipTwin, & !< slip resistance from twin activity + interaction_TwinSlip, & !< twin resistance from slip activity + interaction_TwinTwin !< twin resistance from twin activity + end type + type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance) + type, private :: tPhenopowerlawState real(pReal), pointer, dimension(:,:) :: & s_slip, & @@ -180,7 +192,8 @@ subroutine plastic_phenopowerlaw_init(fileUnit) startIndex, endIndex character(len=65536) :: & tag = '', & - line = '' + line = '', & + outputtag = '' real(pReal), dimension(:), allocatable :: tempPerSlip write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' @@ -200,29 +213,19 @@ subroutine plastic_phenopowerlaw_init(fileUnit) allocate(plastic_phenopowerlaw_output(maxval(phase_Noutput),maxNinstance)) plastic_phenopowerlaw_output = '' allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) + + allocate(param(maxNinstance)) ! one container of parameters per instance + + allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_Nslip(lattice_maxNslipFamily,maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_Ntwin(lattice_maxNtwinFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Ntrans(lattice_maxNtransFamily,maxNinstance),source=0_pInt) allocate(plastic_phenopowerlaw_totalNslip(maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_totalNtwin(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNtrans(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_gdot0_slip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_n_slip(maxNinstance), source=0.0_pReal) allocate(plastic_phenopowerlaw_tau0_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) allocate(plastic_phenopowerlaw_tausat_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) allocate(plastic_phenopowerlaw_H_int(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) - allocate(plastic_phenopowerlaw_gdot0_twin(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_n_twin(maxNinstance), source=0.0_pReal) allocate(plastic_phenopowerlaw_tau0_twin(lattice_maxNtwinFamily,maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_spr(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinB(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinC(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinD(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinE(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_SlipSlip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_TwinSlip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_TwinTwin(maxNinstance), source=0.0_pReal) allocate(plastic_phenopowerlaw_interaction_SlipSlip(lattice_maxNinteraction,maxNinstance), & source=0.0_pReal) allocate(plastic_phenopowerlaw_interaction_SlipTwin(lattice_maxNinteraction,maxNinstance), & @@ -231,17 +234,8 @@ subroutine plastic_phenopowerlaw_init(fileUnit) source=0.0_pReal) allocate(plastic_phenopowerlaw_interaction_TwinTwin(lattice_maxNinteraction,maxNinstance), & source=0.0_pReal) - allocate(plastic_phenopowerlaw_a_slip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_aTolResistance(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_aTolShear(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_aTolTwinfrac(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_aTolTransfrac(maxNinstance), source=0.0_pReal) allocate(plastic_phenopowerlaw_nonSchmidCoeff(lattice_maxNnonSchmid,maxNinstance), & source=0.0_pReal) - allocate(plastic_phenopowerlaw_Cnuc(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_Cdwp(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_Cgro(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_deltaG(maxNinstance), source=0.0_pReal) rewind(fileUnit) phase = 0_pInt @@ -261,7 +255,6 @@ subroutine plastic_phenopowerlaw_init(fileUnit) if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then Nchunks_SlipFamilies = count(lattice_NslipSystem(:,phase) > 0_pInt) ! maximum number of slip families according to lattice type of current phase Nchunks_TwinFamilies = count(lattice_NtwinSystem(:,phase) > 0_pInt) ! maximum number of twin families according to lattice type of current phase - Nchunks_TransFamilies = count(lattice_NtransSystem(:,phase) > 0_pInt) ! maximum number of trans families according to lattice type of current phase Nchunks_SlipSlip = maxval(lattice_interactionSlipSlip(:,:,phase)) Nchunks_SlipTwin = maxval(lattice_interactionSlipTwin(:,:,phase)) Nchunks_TwinSlip = maxval(lattice_interactionTwinSlip(:,:,phase)) @@ -278,58 +271,43 @@ subroutine plastic_phenopowerlaw_init(fileUnit) tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key select case(tag) case ('(output)') + outputtag = IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt ! assume valid output + plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = outputtag ! assume valid output select case(IO_lc(IO_stringValue(line,chunkPos,2_pInt))) case ('resistance_slip') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resistance_slip_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('accumulatedshear_slip','accumulated_shear_slip') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_slip_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('shearrate_slip') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = shearrate_slip_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('resolvedstress_slip') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resolvedstress_slip_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('totalshear') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = totalshear_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('resistance_twin') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resistance_twin_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('accumulatedshear_twin','accumulated_shear_twin') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_twin_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('shearrate_twin') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = shearrate_twin_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('resolvedstress_twin') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt + plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resolvedstress_twin_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case ('totalvolfrac_twin') - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = totalvolfrac_twin_ID - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = & - IO_lc(IO_stringValue(line,chunkPos,2_pInt)) + case default + plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) - 1_pInt ! correct for invalid end select !-------------------------------------------------------------------------------------------------- @@ -374,17 +352,6 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plastic_phenopowerlaw_tau0_twin(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) enddo !-------------------------------------------------------------------------------------------------- -! parameters depending on number of transformation families - case ('ntrans') - if (chunkPos(1) < Nchunks_TransFamilies + 1_pInt) & - call IO_warning(53_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (chunkPos(1) > Nchunks_TransFamilies + 1_pInt) & - call IO_error(150_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') - Nchunks_TransFamilies = chunkPos(1) - 1_pInt - do j = 1_pInt, Nchunks_TransFamilies - plastic_phenopowerlaw_Ntrans(j,instance) = IO_intValue(line,chunkPos,1_pInt+j) - enddo -!-------------------------------------------------------------------------------------------------- ! parameters depending on number of interactions case ('interaction_slipslip') if (chunkPos(1) < 1_pInt + Nchunks_SlipSlip) & @@ -416,50 +383,41 @@ subroutine plastic_phenopowerlaw_init(fileUnit) do j = 1_pInt,Nchunks_nonSchmid plastic_phenopowerlaw_nonSchmidCoeff(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + !-------------------------------------------------------------------------------------------------- ! parameters independent of number of slip/twin systems case ('gdot0_slip') - plastic_phenopowerlaw_gdot0_slip(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%gdot0_slip = IO_floatValue(line,chunkPos,2_pInt) case ('n_slip') - plastic_phenopowerlaw_n_slip(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%n_slip = IO_floatValue(line,chunkPos,2_pInt) case ('a_slip', 'w0_slip') - plastic_phenopowerlaw_a_slip(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%a_slip = IO_floatValue(line,chunkPos,2_pInt) case ('gdot0_twin') - plastic_phenopowerlaw_gdot0_twin(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%gdot0_twin = IO_floatValue(line,chunkPos,2_pInt) case ('n_twin') - plastic_phenopowerlaw_n_twin(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%n_twin = IO_floatValue(line,chunkPos,2_pInt) case ('s_pr') - plastic_phenopowerlaw_spr(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%spr = IO_floatValue(line,chunkPos,2_pInt) case ('twin_b') - plastic_phenopowerlaw_twinB(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%twinB = IO_floatValue(line,chunkPos,2_pInt) case ('twin_c') - plastic_phenopowerlaw_twinC(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%twinC = IO_floatValue(line,chunkPos,2_pInt) case ('twin_d') - plastic_phenopowerlaw_twinD(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%twinD = IO_floatValue(line,chunkPos,2_pInt) case ('twin_e') - plastic_phenopowerlaw_twinE(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%twinE = IO_floatValue(line,chunkPos,2_pInt) case ('h0_slipslip') - plastic_phenopowerlaw_h0_SlipSlip(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%h0_SlipSlip = IO_floatValue(line,chunkPos,2_pInt) case ('h0_twinslip') - plastic_phenopowerlaw_h0_TwinSlip(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%h0_TwinSlip = IO_floatValue(line,chunkPos,2_pInt) case ('h0_twintwin') - plastic_phenopowerlaw_h0_TwinTwin(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%h0_TwinTwin = IO_floatValue(line,chunkPos,2_pInt) case ('atol_resistance') - plastic_phenopowerlaw_aTolResistance(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%aTolResistance = IO_floatValue(line,chunkPos,2_pInt) case ('atol_shear') - plastic_phenopowerlaw_aTolShear(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%aTolShear = IO_floatValue(line,chunkPos,2_pInt) case ('atol_twinfrac') - plastic_phenopowerlaw_aTolTwinfrac(instance) = IO_floatValue(line,chunkPos,2_pInt) - case ('atol_transfrac') - plastic_phenopowerlaw_aTolTransfrac(instance) = IO_floatValue(line,chunkPos,2_pInt) - case ('cnuc') - plastic_phenopowerlaw_Cnuc(instance) = IO_floatValue(line,chunkPos,2_pInt) - case ('cdwp') - plastic_phenopowerlaw_Cdwp(instance) = IO_floatValue(line,chunkPos,2_pInt) - case ('cgro') - plastic_phenopowerlaw_Cgro(instance) = IO_floatValue(line,chunkPos,2_pInt) - case ('deltag') - plastic_phenopowerlaw_deltaG(instance) = IO_floatValue(line,chunkPos,2_pInt) + param(instance)%aTolTwinfrac = IO_floatValue(line,chunkPos,2_pInt) case default end select @@ -477,37 +435,34 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plastic_phenopowerlaw_Ntwin(:,instance)) plastic_phenopowerlaw_totalNslip(instance) = sum(plastic_phenopowerlaw_Nslip(:,instance)) ! how many slip systems altogether plastic_phenopowerlaw_totalNtwin(instance) = sum(plastic_phenopowerlaw_Ntwin(:,instance)) ! how many twin systems altogether - plastic_phenopowerlaw_totalNtrans(instance) = sum(plastic_phenopowerlaw_Ntrans(:,instance)) ! how many trans systems altogether if (any(plastic_phenopowerlaw_tau0_slip(:,instance) < 0.0_pReal .and. & plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tau0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (plastic_phenopowerlaw_gdot0_slip(instance) <= 0.0_pReal) & + if (param(instance)%gdot0_slip <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='gdot0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (plastic_phenopowerlaw_n_slip(instance) <= 0.0_pReal) & + if (param(instance)%n_slip <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='n_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(plastic_phenopowerlaw_tausat_slip(:,instance) <= 0.0_pReal .and. & plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(dEq0(plastic_phenopowerlaw_a_slip(instance)) .and. plastic_phenopowerlaw_Nslip(:,instance) > 0)) & + if (any(dEq0(param(instance)%a_slip) .and. plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(plastic_phenopowerlaw_tau0_twin(:,instance) < 0.0_pReal .and. & plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - if ( plastic_phenopowerlaw_gdot0_twin(instance) <= 0.0_pReal .and. & + if ( param(instance)%gdot0_twin <= 0.0_pReal .and. & any(plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - if ( plastic_phenopowerlaw_n_twin(instance) <= 0.0_pReal .and. & + if ( param(instance)%n_twin <= 0.0_pReal .and. & any(plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (plastic_phenopowerlaw_aTolResistance(instance) <= 0.0_pReal) & - plastic_phenopowerlaw_aTolResistance(instance) = 1.0_pReal ! default absolute tolerance 1 Pa - if (plastic_phenopowerlaw_aTolShear(instance) <= 0.0_pReal) & - plastic_phenopowerlaw_aTolShear(instance) = 1.0e-6_pReal ! default absolute tolerance 1e-6 - if (plastic_phenopowerlaw_aTolTwinfrac(instance) <= 0.0_pReal) & - plastic_phenopowerlaw_aTolTwinfrac(instance) = 1.0e-6_pReal ! default absolute tolerance 1e-6 - if (plastic_phenopowerlaw_aTolTransfrac(instance) <= 0.0_pReal) & - plastic_phenopowerlaw_aTolTransfrac(instance) = 1.0e-6_pReal ! default absolute tolerance 1e-6 + if (param(instance)%aTolResistance <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolResistance ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (param(instance)%aTolShear <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolShear ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (param(instance)%aTolTwinfrac <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') endif myPhase enddo sanityChecks @@ -578,7 +533,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plasticState(phase)%sizePostResults = plastic_phenopowerlaw_sizePostResults(instance) plasticState(phase)%nSlip =plastic_phenopowerlaw_totalNslip(instance) plasticState(phase)%nTwin =plastic_phenopowerlaw_totalNtwin(instance) - plasticState(phase)%nTrans=plastic_phenopowerlaw_totalNtrans(instance) + plasticState(phase)%nTrans=0_pInt allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) @@ -751,19 +706,18 @@ subroutine plastic_phenopowerlaw_aTolState(ph,instance) plasticState(ph)%aTolState(1:plastic_phenopowerlaw_totalNslip(instance)+ & plastic_phenopowerlaw_totalNtwin(instance)) = & - plastic_phenopowerlaw_aTolResistance(instance) + param(instance)%aTolResistance plasticState(ph)%aTolState(1+plastic_phenopowerlaw_totalNslip(instance)+ & plastic_phenopowerlaw_totalNtwin(instance)) = & - plastic_phenopowerlaw_aTolShear(instance) + param(instance)%aTolShear plasticState(ph)%aTolState(2+plastic_phenopowerlaw_totalNslip(instance)+ & plastic_phenopowerlaw_totalNtwin(instance)) = & - plastic_phenopowerlaw_aTolTwinFrac(instance) + param(instance)%aTolTwinFrac plasticState(ph)%aTolState(3+plastic_phenopowerlaw_totalNslip(instance)+ & plastic_phenopowerlaw_totalNtwin(instance): & 2+2*(plastic_phenopowerlaw_totalNslip(instance)+ & plastic_phenopowerlaw_totalNtwin(instance))) = & - plastic_phenopowerlaw_aTolShear(instance) - + param(instance)%aTolShear end subroutine plastic_phenopowerlaw_aTolState @@ -850,20 +804,20 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)*& lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,ph) enddo - gdot_slip_pos = 0.5_pReal*plastic_phenopowerlaw_gdot0_slip(instance)* & + gdot_slip_pos = 0.5_pReal*param(instance)%gdot0_slip* & ((abs(tau_slip_pos)/(state(instance)%s_slip(j,of))) & - **plastic_phenopowerlaw_n_slip(instance))*sign(1.0_pReal,tau_slip_pos) + **param(instance)%n_slip)*sign(1.0_pReal,tau_slip_pos) - gdot_slip_neg = 0.5_pReal*plastic_phenopowerlaw_gdot0_slip(instance)* & + gdot_slip_neg = 0.5_pReal*param(instance)%gdot0_slip* & ((abs(tau_slip_neg)/(state(instance)%s_slip(j,of))) & - **plastic_phenopowerlaw_n_slip(instance))*sign(1.0_pReal,tau_slip_neg) + **param(instance)%n_slip)*sign(1.0_pReal,tau_slip_neg) Lp = Lp + (1.0_pReal-state(instance)%sumF(of))*& ! 1-F (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp if (dNeq0(gdot_slip_pos)) then - dgdot_dtauslip_pos = gdot_slip_pos*plastic_phenopowerlaw_n_slip(instance)/tau_slip_pos + dgdot_dtauslip_pos = gdot_slip_pos*param(instance)%n_slip/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtauslip_pos*lattice_Sslip(k,l,1,index_myFamily+i,ph)* & @@ -871,7 +825,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, endif if (dNeq0(gdot_slip_neg)) then - dgdot_dtauslip_neg = gdot_slip_neg*plastic_phenopowerlaw_n_slip(instance)/tau_slip_neg + dgdot_dtauslip_neg = gdot_slip_neg*param(instance)%n_slip/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtauslip_neg*lattice_Sslip(k,l,1,index_myFamily+i,ph)* & @@ -891,14 +845,14 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, ! Calculation of Lp tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) gdot_twin = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F - plastic_phenopowerlaw_gdot0_twin(instance)*& + param(instance)%gdot0_twin*& (abs(tau_twin)/state(instance)%s_twin(j,of))**& - plastic_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau_twin)) + param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp if (dNeq0(gdot_twin)) then - dgdot_dtautwin = gdot_twin*plastic_phenopowerlaw_n_twin(instance)/tau_twin + dgdot_dtautwin = gdot_twin*param(instance)%n_twin/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtautwin*lattice_Stwin(k,l,index_myFamily+i,ph)* & @@ -971,17 +925,17 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices - c_SlipSlip = plastic_phenopowerlaw_h0_SlipSlip(instance)*& - (1.0_pReal + plastic_phenopowerlaw_twinC(instance)*plasticState(ph)%state(index_F,of)**& - plastic_phenopowerlaw_twinB(instance)) - c_TwinSlip = plastic_phenopowerlaw_h0_TwinSlip(instance)*& - plasticState(ph)%state(index_Gamma,of)**plastic_phenopowerlaw_twinE(instance) - c_TwinTwin = plastic_phenopowerlaw_h0_TwinTwin(instance)*& - plasticState(ph)%state(index_F,of)**plastic_phenopowerlaw_twinD(instance) + c_SlipSlip = param(instance)%h0_slipslip*& + (1.0_pReal + param(instance)%twinC*plasticState(ph)%state(index_F,of)**& + param(instance)%twinB) + c_TwinSlip = param(instance)%h0_TwinSlip*& + plasticState(ph)%state(index_Gamma,of)**param(instance)%twinE + c_TwinTwin = param(instance)%h0_TwinTwin*& + plasticState(ph)%state(index_F,of)**param(instance)%twinD !-------------------------------------------------------------------------------------------------- ! calculate left and right vectors and calculate dot gammas - ssat_offset = plastic_phenopowerlaw_spr(instance)*sqrt(plasticState(ph)%state(index_F,of)) + ssat_offset = param(instance)%spr*sqrt(plasticState(ph)%state(index_F,of)) j = 0_pInt slipFamilies1: do f = 1_pInt,lattice_maxNslipFamily index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family @@ -991,7 +945,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part right_SlipSlip(j) = abs(1.0_pReal-plasticState(ph)%state(j,of) / & (plastic_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) & - **plastic_phenopowerlaw_a_slip(instance)& + **param(instance)%a_slip& *sign(1.0_pReal,1.0_pReal-plasticState(ph)%state(j,of) / & (plastic_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) right_TwinSlip(j) = 1.0_pReal ! no system-dependent part @@ -1006,10 +960,10 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) tau_slip_neg = tau_slip_neg + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo nonSchmidSystems - gdot_slip(j) = plastic_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* & - ((abs(tau_slip_pos)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & + gdot_slip(j) = param(instance)%gdot0_slip*0.5_pReal* & + ((abs(tau_slip_pos)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & + +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -1030,9 +984,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ! Calculation of dot vol frac tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) gdot_twin(j) = (1.0_pReal-plasticState(ph)%state(index_F,of))*& ! 1-F - plastic_phenopowerlaw_gdot0_twin(instance)*& + param(instance)%gdot0_twin*& (abs(tau_twin)/plasticState(ph)%state(nslip+j,of))**& - plastic_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau_twin)) + param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) enddo twinSystems1 enddo twinFamilies1 @@ -1153,10 +1107,10 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) tau_slip_neg = tau_slip_neg + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo - plastic_phenopowerlaw_postResults(c+j) = plastic_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* & - ((abs(tau_slip_pos)/plasticState(ph)%state(j,of))**plastic_phenopowerlaw_n_slip(instance) & + plastic_phenopowerlaw_postResults(c+j) = param(instance)%gdot0_slip*0.5_pReal* & + ((abs(tau_slip_pos)/plasticState(ph)%state(j,of))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & + +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -1196,9 +1150,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) j = j + 1_pInt tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-plasticState(ph)%state(index_F,of))*& ! 1-F - plastic_phenopowerlaw_gdot0_twin(instance)*& + param(instance)%gdot0_twin*& (abs(tau)/plasticState(ph)%state(j+nSlip,of))**& - plastic_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau)) + param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) enddo twinSystems1 enddo twinFamilies1 c = c + nTwin From 81cab02d7ab98b36fdc43b3c9b339aa25566a7a5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 25 Apr 2018 19:41:18 +0200 Subject: [PATCH 02/42] simplified reading in and initialization init of absolute tolerances and state0 done on the fly reading in array type parameters in the param structure : --- src/math.f90 | 3 +- src/plastic_phenopowerlaw.f90 | 527 ++++++++++++++-------------------- 2 files changed, 225 insertions(+), 305 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 7e35ca390..4354354f7 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -159,7 +159,8 @@ module math math_rotate_forward33, & math_rotate_backward33, & math_rotate_forward3333, & - math_limit + math_limit, & + math_expand private :: & halton, & halton_memory, & diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 368ce8bd5..4b41f9ad2 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -22,33 +22,19 @@ module plastic_phenopowerlaw integer(pInt), dimension(:), allocatable, target, public :: & plastic_phenopowerlaw_Noutput !< number of outputs per instance of this constitution - integer(pInt), dimension(:), allocatable, public, protected :: & - plastic_phenopowerlaw_totalNslip, & !< no. of slip system used in simulation - plastic_phenopowerlaw_totalNtwin !< no. of twin system used in simulation + integer(pInt), dimension(:), allocatable, private :: & + totalNslip, & !< no. of slip system used in simulation + totalNtwin !< no. of twin system used in simulation - integer(pInt), dimension(:,:), allocatable, private :: & - plastic_phenopowerlaw_Nslip, & !< active number of slip systems per family (input parameter, per family) - plastic_phenopowerlaw_Ntwin !< active number of twin systems per family (input parameter, per family) + real(pReal), dimension(:,:,:), allocatable, private :: & + + interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) + interaction_SlipTwin, & !< interaction factors slip - twin (input parameter) + interaction_TwinSlip, & !< interaction factors twin - slip (input parameter) + interaction_TwinTwin !< interaction factors twin - twin (input parameter) - real(pReal), dimension(:,:), allocatable, private :: & - plastic_phenopowerlaw_tau0_slip, & !< initial critical shear stress for slip (input parameter, per family) - plastic_phenopowerlaw_tau0_twin, & !< initial critical shear stress for twin (input parameter, per family) - plastic_phenopowerlaw_tausat_slip, & !< maximum critical shear stress for slip (input parameter, per family) - plastic_phenopowerlaw_H_int, & !< per family hardening activity(input parameter(optional), per family) - plastic_phenopowerlaw_nonSchmidCoeff, & - - plastic_phenopowerlaw_interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) - plastic_phenopowerlaw_interaction_SlipTwin, & !< interaction factors slip - twin (input parameter) - plastic_phenopowerlaw_interaction_TwinSlip, & !< interaction factors twin - slip (input parameter) - plastic_phenopowerlaw_interaction_TwinTwin !< interaction factors twin - twin (input parameter) - - real(pReal), dimension(:,:,:), allocatable, private :: & - plastic_phenopowerlaw_hardeningMatrix_SlipSlip, & - plastic_phenopowerlaw_hardeningMatrix_SlipTwin, & - plastic_phenopowerlaw_hardeningMatrix_TwinSlip, & - plastic_phenopowerlaw_hardeningMatrix_TwinTwin enum, bind(c) enumerator :: undefined_ID, & @@ -114,18 +100,13 @@ module plastic_phenopowerlaw type(tPhenopowerlawState), allocatable, dimension(:), private :: & dotState, & - state, & - state0 + state public :: & plastic_phenopowerlaw_init, & plastic_phenopowerlaw_LpAndItsTangent, & plastic_phenopowerlaw_dotState, & plastic_phenopowerlaw_postResults - private :: & - plastic_phenopowerlaw_aTolState, & - plastic_phenopowerlaw_stateInit - contains @@ -148,7 +129,8 @@ subroutine plastic_phenopowerlaw_init(fileUnit) debug_levelBasic use math, only: & math_Mandel3333to66, & - math_Voigt66to3333 + math_Voigt66to3333, & + math_expand use IO, only: & IO_read, & IO_lc, & @@ -191,8 +173,10 @@ subroutine plastic_phenopowerlaw_init(fileUnit) mySize=0_pInt,sizeState,sizeDotState, sizeDeltaState, & startIndex, endIndex character(len=65536) :: & - tag = '', & - line = '', & + tag = '', & + line = '', & + extmsg = '' + character(len=64) :: & outputtag = '' real(pReal), dimension(:), allocatable :: tempPerSlip @@ -214,28 +198,11 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plastic_phenopowerlaw_output = '' allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) - allocate(param(maxNinstance)) ! one container of parameters per instance - - allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Nslip(lattice_maxNslipFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Ntwin(lattice_maxNtwinFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNslip(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNtwin(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_tau0_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) - allocate(plastic_phenopowerlaw_tausat_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) - allocate(plastic_phenopowerlaw_H_int(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) - allocate(plastic_phenopowerlaw_tau0_twin(lattice_maxNtwinFamily,maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_interaction_SlipSlip(lattice_maxNinteraction,maxNinstance), & - source=0.0_pReal) - allocate(plastic_phenopowerlaw_interaction_SlipTwin(lattice_maxNinteraction,maxNinstance), & - source=0.0_pReal) - allocate(plastic_phenopowerlaw_interaction_TwinSlip(lattice_maxNinteraction,maxNinstance), & - source=0.0_pReal) - allocate(plastic_phenopowerlaw_interaction_TwinTwin(lattice_maxNinteraction,maxNinstance), & - source=0.0_pReal) - allocate(plastic_phenopowerlaw_nonSchmidCoeff(lattice_maxNnonSchmid,maxNinstance), & - source=0.0_pReal) + + allocate(totalNslip(maxNinstance), source=0_pInt) + allocate(totalNtwin(maxNinstance), source=0_pInt) + allocate(param(maxNinstance)) ! one container of parameters per instance rewind(fileUnit) phase = 0_pInt @@ -253,6 +220,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) if (IO_getTag(line,'[',']') /= '') then ! next phase phase = phase + 1_pInt ! advance phase section counter if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then + instance = phase_plasticityInstance(phase) ! which instance of my plasticity is present phase Nchunks_SlipFamilies = count(lattice_NslipSystem(:,phase) > 0_pInt) ! maximum number of slip families according to lattice type of current phase Nchunks_TwinFamilies = count(lattice_NtwinSystem(:,phase) > 0_pInt) ! maximum number of twin families according to lattice type of current phase Nchunks_SlipSlip = maxval(lattice_interactionSlipSlip(:,:,phase)) @@ -261,15 +229,24 @@ subroutine plastic_phenopowerlaw_init(fileUnit) Nchunks_TwinTwin = maxval(lattice_interactionTwinTwin(:,:,phase)) Nchunks_nonSchmid = lattice_NnonSchmid(phase) if(allocated(tempPerSlip)) deallocate(tempPerSlip) + !allocate(param(instance)%H_int,source=tempPerSlip) gfortran 5 does not support this + allocate(param(instance)%H_int(Nchunks_SlipFamilies),source=0.0_pReal) + allocate(param(instance)%interaction_SlipSlip(Nchunks_SlipSlip),source=0.0_pReal) + allocate(param(instance)%interaction_SlipTwin(Nchunks_SlipTwin),source=0.0_pReal) + allocate(param(instance)%interaction_TwinSlip(Nchunks_TwinSlip),source=0.0_pReal) + allocate(param(instance)%interaction_TwinTwin(Nchunks_TwinTwin),source=0.0_pReal) + allocate(param(instance)%nonSchmidCoeff(Nchunks_nonSchmid),source=0.0_pReal) + allocate(tempPerSlip(Nchunks_SlipFamilies)) endif cycle ! skip to next line endif if (phase > 0_pInt ) then; if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my phases. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran - instance = phase_plasticityInstance(phase) ! which instance of my plasticity is present phase + chunkPos = IO_stringPos(line) tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key - select case(tag) + select case(tag) + case ('(output)') outputtag = IO_lc(IO_stringValue(line,chunkPos,2_pInt)) plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt ! assume valid output @@ -310,80 +287,87 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) - 1_pInt ! correct for invalid end select + !-------------------------------------------------------------------------------------------------- ! parameters depending on number of slip families case ('nslip') - if (chunkPos(1) < Nchunks_SlipFamilies + 1_pInt) & - call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (chunkPos(1) > Nchunks_SlipFamilies + 1_pInt) & - call IO_error(150_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') - Nchunks_SlipFamilies = chunkPos(1) - 1_pInt ! user specified number of (possibly) active slip families (e.g. 6 0 6 --> 3) + if (chunkPos(1) < Nchunks_SlipFamilies + 1_pInt) call IO_warning(50_pInt,ext_msg=extmsg) + if (chunkPos(1) > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) + Nchunks_SlipFamilies = chunkPos(1) - 1_pInt ! user specified number of (possibly) active slip families (e.g. 6 0 6 --> 3) + allocate(param(instance)%Nslip(Nchunks_SlipFamilies),source=-1_pInt) do j = 1_pInt, Nchunks_SlipFamilies - plastic_phenopowerlaw_Nslip(j,instance) = IO_intValue(line,chunkPos,1_pInt+j) + param(instance)%Nslip(j) = min(IO_intValue(line,chunkPos,1_pInt+j), & + lattice_NslipSystem(j,phase)) ! limit active slip systems per family to min of available and requested enddo - case ('tausat_slip','tau0_slip','H_int') + totalNslip(instance) = sum(param(instance)%Nslip) ! how many slip systems altogether + + case ('tausat_slip','tau0_slip','h_int') tempPerSlip = 0.0_pReal do j = 1_pInt, Nchunks_SlipFamilies - if (plastic_phenopowerlaw_Nslip(j,instance) > 0_pInt) & + if (param(instance)%Nslip(j) > 0_pInt) & tempPerSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo - select case(tag) + select case(tag) ! here, all arrays are allocated automatically case ('tausat_slip') - plastic_phenopowerlaw_tausat_slip(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) + param(instance)%tausat_slip = tempPerSlip case ('tau0_slip') - plastic_phenopowerlaw_tau0_slip(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) - case ('H_int') - plastic_phenopowerlaw_H_int(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) + param(instance)%tau0_slip = tempPerSlip + case ('h_int') + param(instance)%H_int = tempPerSlip end select + !-------------------------------------------------------------------------------------------------- ! parameters depending on number of twin families case ('ntwin') - if (chunkPos(1) < Nchunks_TwinFamilies + 1_pInt) & - call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (chunkPos(1) > Nchunks_TwinFamilies + 1_pInt) & - call IO_error(150_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < Nchunks_TwinFamilies + 1_pInt) call IO_warning(51_pInt,ext_msg=extmsg) + if (chunkPos(1) > Nchunks_TwinFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) Nchunks_TwinFamilies = chunkPos(1) - 1_pInt + allocate(param(instance)%Ntwin(Nchunks_TwinFamilies),source=-1_pInt) do j = 1_pInt, Nchunks_TwinFamilies - plastic_phenopowerlaw_Ntwin(j,instance) = IO_intValue(line,chunkPos,1_pInt+j) + param(instance)%Ntwin(j) = min(IO_intValue(line,chunkPos,1_pInt+j), & + lattice_NtwinSystem(j,phase)) ! limit active twin systems per family to min of available and requested enddo + totalNtwin(instance) = sum(param(instance)%Ntwin) ! how many twin systems altogether + case ('tau0_twin') + allocate(param(instance)%tau0_twin(Nchunks_TwinFamilies),source=0.0_pReal) do j = 1_pInt, Nchunks_TwinFamilies - if (plastic_phenopowerlaw_Ntwin(j,instance) > 0_pInt) & - plastic_phenopowerlaw_tau0_twin(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + if (param(instance)%Ntwin(j) > 0_pInt) & + param(instance)%tau0_twin(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + !-------------------------------------------------------------------------------------------------- ! parameters depending on number of interactions case ('interaction_slipslip') - if (chunkPos(1) < 1_pInt + Nchunks_SlipSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < 1_pInt + Nchunks_SlipSlip) call IO_warning(52_pInt,ext_msg=extmsg) do j = 1_pInt, Nchunks_SlipSlip - plastic_phenopowerlaw_interaction_SlipSlip(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + param(instance)%interaction_SlipSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + case ('interaction_sliptwin') - if (chunkPos(1) < 1_pInt + Nchunks_SlipTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < 1_pInt + Nchunks_SlipTwin) call IO_warning(52_pInt,ext_msg=extmsg) do j = 1_pInt, Nchunks_SlipTwin - plastic_phenopowerlaw_interaction_SlipTwin(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + param(instance)%interaction_SlipTwin(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + case ('interaction_twinslip') - if (chunkPos(1) < 1_pInt + Nchunks_TwinSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < 1_pInt + Nchunks_TwinSlip) call IO_warning(52_pInt,ext_msg=extmsg) do j = 1_pInt, Nchunks_TwinSlip - plastic_phenopowerlaw_interaction_TwinSlip(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + param(instance)%interaction_TwinSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + case ('interaction_twintwin') - if (chunkPos(1) < 1_pInt + Nchunks_TwinTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < 1_pInt + Nchunks_TwinTwin) call IO_warning(52_pInt,ext_msg=extmsg) do j = 1_pInt, Nchunks_TwinTwin - plastic_phenopowerlaw_interaction_TwinTwin(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + param(instance)%interaction_TwinTwin(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo + case ('nonschmid_coefficients') - if (chunkPos(1) < 1_pInt + Nchunks_nonSchmid) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (chunkPos(1) < 1_pInt + Nchunks_nonSchmid) call IO_warning(52_pInt,ext_msg=extmsg) do j = 1_pInt,Nchunks_nonSchmid - plastic_phenopowerlaw_nonSchmidCoeff(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j) + param(instance)%nonSchmidCoeff(j) = IO_floatValue(line,chunkPos,1_pInt+j) enddo - + !-------------------------------------------------------------------------------------------------- ! parameters independent of number of slip/twin systems case ('gdot0_slip') @@ -427,36 +411,35 @@ subroutine plastic_phenopowerlaw_init(fileUnit) sanityChecks: do phase = 1_pInt, size(phase_plasticity) myPhase: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then instance = phase_plasticityInstance(phase) - plastic_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,instance) = & - min(lattice_NslipSystem(1:lattice_maxNslipFamily,phase),& ! limit active slip systems per family to min of available and requested - plastic_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,instance)) - plastic_phenopowerlaw_Ntwin(1:lattice_maxNtwinFamily,instance) = & - min(lattice_NtwinSystem(1:lattice_maxNtwinFamily,phase),& ! limit active twin systems per family to min of available and requested - plastic_phenopowerlaw_Ntwin(:,instance)) - plastic_phenopowerlaw_totalNslip(instance) = sum(plastic_phenopowerlaw_Nslip(:,instance)) ! how many slip systems altogether - plastic_phenopowerlaw_totalNtwin(instance) = sum(plastic_phenopowerlaw_Ntwin(:,instance)) ! how many twin systems altogether + totalNslip(instance) = sum(param(instance)%Nslip) ! how many slip systems altogether. ToDo: ok for unallocated Nslip + totalNtwin(instance) = sum(param(instance)%Ntwin) ! how many twin systems altogether. ToDo: ok for unallocated Ntwin + slipActive: if (allocated(param(instance)%Nslip)) then + if (any(param(instance)%tau0_slip < 0.0_pReal .and. & + param(instance)%Nslip(:) > 0)) & + call IO_error(211_pInt,el=instance,ext_msg='tau0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (param(instance)%gdot0_slip <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='gdot0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (param(instance)%n_slip <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='n_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (any(param(instance)%tausat_slip <= 0.0_pReal .and. & + param(instance)%Nslip(:) > 0)) & + call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (any(dEq0(param(instance)%a_slip) .and. param(instance)%Nslip(:) > 0)) & + call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + endif slipActive + + twinActive: if (allocated(param(instance)%Ntwin)) then + ! if (any(param(instance)%tau0_twin < 0.0_pReal .and. & + ! param(instance)%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + ! if ( param(instance)%gdot0_twin <= 0.0_pReal .and. & + ! any(param(instance)%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + ! if ( param(instance)%n_twin <= 0.0_pReal .and. & + ! any(param(instance)%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + endif twinActive - if (any(plastic_phenopowerlaw_tau0_slip(:,instance) < 0.0_pReal .and. & - plastic_phenopowerlaw_Nslip(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='tau0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%gdot0_slip <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='gdot0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%n_slip <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='n_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(plastic_phenopowerlaw_tausat_slip(:,instance) <= 0.0_pReal .and. & - plastic_phenopowerlaw_Nslip(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(dEq0(param(instance)%a_slip) .and. plastic_phenopowerlaw_Nslip(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(plastic_phenopowerlaw_tau0_twin(:,instance) < 0.0_pReal .and. & - plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - if ( param(instance)%gdot0_twin <= 0.0_pReal .and. & - any(plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - if ( param(instance)%n_twin <= 0.0_pReal .and. & - any(plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') if (param(instance)%aTolResistance <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='aTolResistance ('//PLASTICITY_PHENOPOWERLAW_label//')') if (param(instance)%aTolShear <= 0.0_pReal) & @@ -465,26 +448,21 @@ subroutine plastic_phenopowerlaw_init(fileUnit) call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') endif myPhase enddo sanityChecks + -!-------------------------------------------------------------------------------------------------- + !-------------------------------------------------------------------------------------------------- ! allocation of variables whose size depends on the total number of active slip systems - allocate(plastic_phenopowerlaw_hardeningMatrix_SlipSlip(maxval(plastic_phenopowerlaw_totalNslip),& ! slip resistance from slip activity - maxval(plastic_phenopowerlaw_totalNslip),& - maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_hardeningMatrix_SlipTwin(maxval(plastic_phenopowerlaw_totalNslip),& ! slip resistance from twin activity - maxval(plastic_phenopowerlaw_totalNtwin),& - maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_hardeningMatrix_TwinSlip(maxval(plastic_phenopowerlaw_totalNtwin),& ! twin resistance from slip activity - maxval(plastic_phenopowerlaw_totalNslip),& - maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_hardeningMatrix_TwinTwin(maxval(plastic_phenopowerlaw_totalNtwin),& ! twin resistance from twin activity - maxval(plastic_phenopowerlaw_totalNtwin),& - maxNinstance), source=0.0_pReal) + allocate(interaction_SlipSlip(maxval(totalNslip),maxval(totalNslip),maxNinstance), source=0.0_pReal) + allocate(interaction_SlipTwin(maxval(totalNslip),maxval(totalNtwin),maxNinstance), source=0.0_pReal) + allocate(interaction_TwinSlip(maxval(totalNtwin),maxval(totalNslip),maxNinstance), source=0.0_pReal) + allocate(interaction_TwinTwin(maxval(totalNtwin),maxval(totalNtwin),maxNinstance), source=0.0_pReal) + + allocate(state(maxNinstance)) - allocate(state0(maxNinstance)) allocate(dotState(maxNinstance)) initializeInstances: do phase = 1_pInt, size(phase_plasticity) ! loop through all phases in material.config + myPhase2: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then ! only consider my phase NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase instance = phase_plasticityInstance(phase) ! which instance of my phase @@ -498,13 +476,13 @@ subroutine plastic_phenopowerlaw_init(fileUnit) accumulatedshear_slip_ID, & resolvedstress_slip_ID & ) - mySize = plastic_phenopowerlaw_totalNslip(instance) + mySize = totalNslip(instance) case(resistance_twin_ID, & shearrate_twin_ID, & accumulatedshear_twin_ID, & resolvedstress_twin_ID & ) - mySize = plastic_phenopowerlaw_totalNtwin(instance) + mySize = totalNtwin(instance) case(totalshear_ID, & totalvolfrac_twin_ID & ) @@ -519,11 +497,11 @@ subroutine plastic_phenopowerlaw_init(fileUnit) enddo outputsLoop !-------------------------------------------------------------------------------------------------- ! allocate state arrays - sizeState = plastic_phenopowerlaw_totalNslip(instance) & ! s_slip - + plastic_phenopowerlaw_totalNtwin(instance) & ! s_twin + sizeState = totalNslip(instance) & ! s_slip + + totalNtwin(instance) & ! s_twin + 2_pInt & ! sum(gamma) + sum(f) - + plastic_phenopowerlaw_totalNslip(instance) & ! accshear_slip - + plastic_phenopowerlaw_totalNtwin(instance) ! accshear_twin + + totalNslip(instance) & ! accshear_slip + + totalNtwin(instance) ! accshear_twin sizeDotState = sizeState sizeDeltaState = 0_pInt @@ -531,8 +509,8 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plasticState(phase)%sizeDotState = sizeDotState plasticState(phase)%sizeDeltaState = sizeDeltaState plasticState(phase)%sizePostResults = plastic_phenopowerlaw_sizePostResults(instance) - plasticState(phase)%nSlip =plastic_phenopowerlaw_totalNslip(instance) - plasticState(phase)%nTwin =plastic_phenopowerlaw_totalNtwin(instance) + plasticState(phase)%nSlip =totalNslip(instance) + plasticState(phase)%nTwin =totalNtwin(instance) plasticState(phase)%nTrans=0_pInt allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) @@ -556,171 +534,112 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plasticState(phase)%accumulatedSlip => & plasticState(phase)%state(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) - do f = 1_pInt,lattice_maxNslipFamily ! >>> interaction slip -- X - index_myFamily = sum(plastic_phenopowerlaw_Nslip(1:f-1_pInt,instance)) - do j = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) ! loop over (active) systems in my family (slip) - do o = 1_pInt,lattice_maxNslipFamily - index_otherFamily = sum(plastic_phenopowerlaw_Nslip(1:o-1_pInt,instance)) - do k = 1_pInt,plastic_phenopowerlaw_Nslip(o,instance) ! loop over (active) systems in other family (slip) - plastic_phenopowerlaw_hardeningMatrix_SlipSlip(index_myFamily+j,index_otherFamily+k,instance) = & - plastic_phenopowerlaw_interaction_SlipSlip(lattice_interactionSlipSlip( & +!-------------------------------------------------------------------------------------------------- +! calculate hardening matrices and extend intitial values (per family -> per system) + mySlipFamilies: do f = 1_pInt,size(param(instance)%Nslip,1) ! >>> interaction slip -- X + index_myFamily = sum(param(instance)%Nslip(1:f-1_pInt)) + + mySlipSystems: do j = 1_pInt,param(instance)%Nslip(f) + otherSlipFamilies: do o = 1_pInt,size(param(instance)%Nslip,1) + index_otherFamily = sum(param(instance)%Nslip(1:o-1_pInt)) + otherSlipSystems: do k = 1_pInt,param(instance)%Nslip(o) + interaction_SlipSlip(index_myFamily+j,index_otherFamily+k,instance) = & + param(instance)%interaction_SlipSlip(lattice_interactionSlipSlip( & sum(lattice_NslipSystem(1:f-1,phase))+j, & sum(lattice_NslipSystem(1:o-1,phase))+k, & - phase), instance ) - enddo; enddo + phase)) + enddo otherSlipSystems; enddo otherSlipFamilies - do o = 1_pInt,lattice_maxNtwinFamily - index_otherFamily = sum(plastic_phenopowerlaw_Ntwin(1:o-1_pInt,instance)) - do k = 1_pInt,plastic_phenopowerlaw_Ntwin(o,instance) ! loop over (active) systems in other family (twin) - plastic_phenopowerlaw_hardeningMatrix_SlipTwin(index_myFamily+j,index_otherFamily+k,instance) = & - plastic_phenopowerlaw_interaction_SlipTwin(lattice_interactionSlipTwin( & + twinFamilies: do o = 1_pInt,size(param(instance)%Ntwin,1) + index_otherFamily = sum(param(instance)%Ntwin(1:o-1_pInt)) + twinSystems: do k = 1_pInt,param(instance)%Ntwin(o) + interaction_SlipTwin(index_myFamily+j,index_otherFamily+k,instance) = & + param(instance)%interaction_SlipTwin(lattice_interactionSlipTwin( & sum(lattice_NslipSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & - phase), instance ) - enddo; enddo + phase)) + enddo twinSystems; enddo twinFamilies + enddo mySlipSystems + enddo mySlipFamilies - enddo; enddo - - do f = 1_pInt,lattice_maxNtwinFamily ! >>> interaction twin -- X - index_myFamily = sum(plastic_phenopowerlaw_Ntwin(1:f-1_pInt,instance)) - do j = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) ! loop over (active) systems in my family (twin) - - do o = 1_pInt,lattice_maxNslipFamily - index_otherFamily = sum(plastic_phenopowerlaw_Nslip(1:o-1_pInt,instance)) - do k = 1_pInt,plastic_phenopowerlaw_Nslip(o,instance) ! loop over (active) systems in other family (slip) - plastic_phenopowerlaw_hardeningMatrix_TwinSlip(index_myFamily+j,index_otherFamily+k,instance) = & - plastic_phenopowerlaw_interaction_TwinSlip(lattice_interactionTwinSlip( & + myTwinFamilies: do f = 1_pInt,size(param(instance)%Ntwin,1) ! >>> interaction twin -- X + index_myFamily = sum(param(instance)%Ntwin(1:f-1_pInt)) + myTwinSystems: do j = 1_pInt,param(instance)%Ntwin(f) + slipFamilies: do o = 1_pInt,size(param(instance)%Nslip,1) + index_otherFamily = sum(param(instance)%Nslip(1:o-1_pInt)) + slipSystems: do k = 1_pInt,param(instance)%Nslip(o) + interaction_TwinSlip(index_myFamily+j,index_otherFamily+k,instance) = & + param(instance)%interaction_TwinSlip(lattice_interactionTwinSlip( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NslipSystem(1:o-1_pInt,phase))+k, & - phase), instance ) - enddo; enddo + phase)) + enddo slipSystems; enddo slipFamilies - do o = 1_pInt,lattice_maxNtwinFamily - index_otherFamily = sum(plastic_phenopowerlaw_Ntwin(1:o-1_pInt,instance)) - do k = 1_pInt,plastic_phenopowerlaw_Ntwin(o,instance) ! loop over (active) systems in other family (twin) - plastic_phenopowerlaw_hardeningMatrix_TwinTwin(index_myFamily+j,index_otherFamily+k,instance) = & - plastic_phenopowerlaw_interaction_TwinTwin(lattice_interactionTwinTwin( & + otherTwinFamilies: do o = 1_pInt,size(param(instance)%Ntwin,1) + index_otherFamily = sum(param(instance)%Ntwin(1:o-1_pInt)) + otherTwinSystems: do k = 1_pInt,param(instance)%Ntwin(o) + interaction_TwinTwin(index_myFamily+j,index_otherFamily+k,instance) = & + param(instance)%interaction_TwinTwin(lattice_interactionTwinTwin( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & - phase), instance ) - enddo; enddo + phase)) + enddo otherTwinSystems; enddo otherTwinFamilies + enddo myTwinSystems + enddo myTwinFamilies - enddo; enddo +!-------------------------------------------------------------------------------------------------- +! locally defined state aliases and initialization of state0 and aTolState startIndex = 1_pInt - endIndex = plastic_phenopowerlaw_totalNslip(instance) + endIndex = totalNslip(instance) state (instance)%s_slip=>plasticState(phase)%state (startIndex:endIndex,:) - state0 (instance)%s_slip=>plasticState(phase)%state0 (startIndex:endIndex,:) dotState(instance)%s_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) + plasticState(phase)%state0(startIndex:endIndex,:) = & + spread(math_expand(param(instance)%tau0_slip, param(instance)%Nslip), 2, NipcMyPhase) + + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolResistance startIndex = endIndex + 1_pInt - endIndex = endIndex + plastic_phenopowerlaw_totalNtwin(instance) + endIndex = endIndex + totalNtwin(instance) state (instance)%s_twin=>plasticState(phase)%state (startIndex:endIndex,:) - state0 (instance)%s_twin=>plasticState(phase)%state0 (startIndex:endIndex,:) dotState(instance)%s_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) + plasticState(phase)%state0(startIndex:endIndex,:) = & + spread(param(instance)%tau0_twin(1:totalNtwin(instance)),2,NipcMyPhase) + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolResistance startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumGamma=>plasticState(phase)%state (startIndex,:) - state0 (instance)%sumGamma=>plasticState(phase)%state0 (startIndex,:) dotState(instance)%sumGamma=>plasticState(phase)%dotState(startIndex,:) + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumF=>plasticState(phase)%state (startIndex,:) - state0 (instance)%sumF=>plasticState(phase)%state0 (startIndex,:) dotState(instance)%sumF=>plasticState(phase)%dotState(startIndex,:) + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolTwinFrac startIndex = endIndex + 1_pInt - endIndex = endIndex +plastic_phenopowerlaw_totalNslip(instance) + endIndex = endIndex + totalNslip(instance) state (instance)%accshear_slip=>plasticState(phase)%state (startIndex:endIndex,:) - state0 (instance)%accshear_slip=>plasticState(phase)%state0 (startIndex:endIndex,:) dotState(instance)%accshear_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear + ! global alias + plasticState(phase)%slipRate =>plasticState(phase)%dotState(startIndex:endIndex,:) + plasticState(phase)%accumulatedSlip =>plasticState(phase)%state(startIndex:endIndex,:) startIndex = endIndex + 1_pInt - endIndex = endIndex +plastic_phenopowerlaw_totalNtwin(instance) + endIndex = endIndex + totalNtwin(instance) state (instance)%accshear_twin=>plasticState(phase)%state (startIndex:endIndex,:) - state0 (instance)%accshear_twin=>plasticState(phase)%state0 (startIndex:endIndex,:) dotState(instance)%accshear_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) + plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear - - call plastic_phenopowerlaw_stateInit(phase,instance) - call plastic_phenopowerlaw_aTolState(phase,instance) endif myPhase2 enddo initializeInstances + end subroutine plastic_phenopowerlaw_init -!-------------------------------------------------------------------------------------------------- -!> @brief sets the initial microstructural state for a given instance of this plasticity -!-------------------------------------------------------------------------------------------------- -subroutine plastic_phenopowerlaw_stateInit(ph,instance) - use lattice, only: & - lattice_maxNslipFamily, & - lattice_maxNtwinFamily - use material, only: & - plasticState - - implicit none - integer(pInt), intent(in) :: & - instance, & !< number specifying the instance of the plasticity - ph - integer(pInt) :: & - i - real(pReal), dimension(plasticState(ph)%sizeState) :: & - tempState - - tempState = 0.0_pReal - do i = 1_pInt,lattice_maxNslipFamily - tempState(1+sum(plastic_phenopowerlaw_Nslip(1:i-1,instance)) : & - sum(plastic_phenopowerlaw_Nslip(1:i ,instance))) = & - plastic_phenopowerlaw_tau0_slip(i,instance) - enddo - - do i = 1_pInt,lattice_maxNtwinFamily - tempState(1+sum(plastic_phenopowerlaw_Nslip(:,instance))+& - sum(plastic_phenopowerlaw_Ntwin(1:i-1,instance)) : & - sum(plastic_phenopowerlaw_Nslip(:,instance))+& - sum(plastic_phenopowerlaw_Ntwin(1:i ,instance))) = & - plastic_phenopowerlaw_tau0_twin(i,instance) - enddo - - plasticState(ph)%state0(:,:) = spread(tempState, & ! spread single tempstate array - 2, & ! along dimension 2 - size(plasticState(ph)%state0(1,:))) ! number of copies (number of IPCs) - -end subroutine plastic_phenopowerlaw_stateInit - - -!-------------------------------------------------------------------------------------------------- -!> @brief sets the relevant state values for a given instance of this plasticity -!-------------------------------------------------------------------------------------------------- -subroutine plastic_phenopowerlaw_aTolState(ph,instance) - use material, only: & - plasticState - - implicit none - integer(pInt), intent(in) :: & - instance, & !< number specifying the instance of the plasticity - ph - - plasticState(ph)%aTolState(1:plastic_phenopowerlaw_totalNslip(instance)+ & - plastic_phenopowerlaw_totalNtwin(instance)) = & - param(instance)%aTolResistance - plasticState(ph)%aTolState(1+plastic_phenopowerlaw_totalNslip(instance)+ & - plastic_phenopowerlaw_totalNtwin(instance)) = & - param(instance)%aTolShear - plasticState(ph)%aTolState(2+plastic_phenopowerlaw_totalNslip(instance)+ & - plastic_phenopowerlaw_totalNtwin(instance)) = & - param(instance)%aTolTwinFrac - plasticState(ph)%aTolState(3+plastic_phenopowerlaw_totalNslip(instance)+ & - plastic_phenopowerlaw_totalNtwin(instance): & - 2+2*(plastic_phenopowerlaw_totalNslip(instance)+ & - plastic_phenopowerlaw_totalNtwin(instance))) = & - param(instance)%aTolShear -end subroutine plastic_phenopowerlaw_aTolState - - !-------------------------------------------------------------------------------------------------- !> @brief calculates plastic velocity gradient and its tangent !-------------------------------------------------------------------------------------------------- @@ -784,9 +703,9 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, !-------------------------------------------------------------------------------------------------- ! Slip part j = 0_pInt - slipFamilies: do f = 1_pInt,lattice_maxNslipFamily + slipFamilies: do f = 1_pInt,size(param(instance)%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) + slipSystems: do i = 1_pInt,param(instance)%Nslip(f) j = j+1_pInt ! Calculation of Lp @@ -795,13 +714,13 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(1:3,1:3,1) = lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,1) do k = 1,lattice_NnonSchmid(ph) - tau_slip_pos = tau_slip_pos + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_neg = tau_slip_neg + param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) - nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)*& + nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + param(instance)%nonSchmidCoeff(k)*& lattice_Sslip(1:3,1:3,2*k,index_myFamily+i,ph) - nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)*& + nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + param(instance)%nonSchmidCoeff(k)*& lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,ph) enddo gdot_slip_pos = 0.5_pReal*param(instance)%gdot0_slip* & @@ -837,9 +756,9 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, !-------------------------------------------------------------------------------------------------- ! Twinning part j = 0_pInt - twinFamilies: do f = 1_pInt,lattice_maxNtwinFamily + twinFamilies: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems: do i = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) + twinSystems: do i = 1_pInt,param(instance)%Ntwin(f) j = j+1_pInt ! Calculation of Lp @@ -905,17 +824,17 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ssat_offset, & tau_slip_pos,tau_slip_neg,tau_twin - real(pReal), dimension(plastic_phenopowerlaw_totalNslip(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & + real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & gdot_slip,left_SlipSlip,left_SlipTwin,right_SlipSlip,right_TwinSlip - real(pReal), dimension(plastic_phenopowerlaw_totalNtwin(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & + real(pReal), dimension(totalNtwin(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & gdot_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin of = phasememberAt(ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - nSlip = plastic_phenopowerlaw_totalNslip(instance) - nTwin = plastic_phenopowerlaw_totalNtwin(instance) + nSlip = totalNslip(instance) + nTwin = totalNtwin(instance) index_Gamma = nSlip + nTwin + 1_pInt index_F = nSlip + nTwin + 2_pInt @@ -937,17 +856,17 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ! calculate left and right vectors and calculate dot gammas ssat_offset = param(instance)%spr*sqrt(plasticState(ph)%state(index_F,of)) j = 0_pInt - slipFamilies1: do f = 1_pInt,lattice_maxNslipFamily + slipFamilies1: do f =1_pInt,size(param(instance)%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems1: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) + slipSystems1: do i = 1_pInt,param(instance)%Nslip(f) j = j+1_pInt - left_SlipSlip(j) = 1.0_pReal + plastic_phenopowerlaw_H_int(f,instance) ! modified no system-dependent left part + left_SlipSlip(j) = 1.0_pReal + param(instance)%H_int(f) ! modified no system-dependent left part left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part right_SlipSlip(j) = abs(1.0_pReal-plasticState(ph)%state(j,of) / & - (plastic_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) & + (param(instance)%tausat_slip(f)+ssat_offset)) & **param(instance)%a_slip& *sign(1.0_pReal,1.0_pReal-plasticState(ph)%state(j,of) / & - (plastic_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) + (param(instance)%tausat_slip(f)+ssat_offset)) right_TwinSlip(j) = 1.0_pReal ! no system-dependent part !-------------------------------------------------------------------------------------------------- @@ -955,9 +874,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) tau_slip_neg = tau_slip_pos nonSchmidSystems: do k = 1,lattice_NnonSchmid(ph) - tau_slip_pos = tau_slip_pos + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k, index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_neg = tau_slip_neg +param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo nonSchmidSystems gdot_slip(j) = param(instance)%gdot0_slip*0.5_pReal* & @@ -971,9 +890,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) j = 0_pInt - twinFamilies1: do f = 1_pInt,lattice_maxNtwinFamily + twinFamilies1: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems1: do i = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) + twinSystems1: do i = 1_pInt,param(instance)%Ntwin(f) j = j+1_pInt left_TwinSlip(j) = 1.0_pReal ! no system-dependent left part left_TwinTwin(j) = 1.0_pReal ! no system-dependent left part @@ -993,14 +912,14 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! calculate the overall hardening based on above j = 0_pInt - slipFamilies2: do f = 1_pInt,lattice_maxNslipFamily - slipSystems2: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) + slipFamilies2: do f = 1_pInt,size(param(instance)%Nslip,1) + slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) j = j+1_pInt plasticState(ph)%dotState(j,of) = & ! evolution of slip resistance j c_SlipSlip * left_SlipSlip(j) * & - dot_product(plastic_phenopowerlaw_hardeningMatrix_SlipSlip(j,1:nSlip,instance), & + dot_product(interaction_SlipSlip(j,1:totalNslip(instance),instance), & right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - dot_product(plastic_phenopowerlaw_hardeningMatrix_SlipTwin(j,1:nTwin,instance), & + dot_product(interaction_SlipTwin(j,1:totalNtwin(instance),instance), & right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor plasticState(ph)%dotState(index_Gamma,of) = plasticState(ph)%dotState(index_Gamma,of) + & abs(gdot_slip(j)) @@ -1009,16 +928,16 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo slipFamilies2 j = 0_pInt - twinFamilies2: do f = 1_pInt,lattice_maxNtwinFamily + twinFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems2: do i = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) + twinSystems2: do i = 1_pInt,param(instance)%Ntwin(f) j = j+1_pInt plasticState(ph)%dotState(j+nSlip,of) = & ! evolution of twin resistance j c_TwinSlip * left_TwinSlip(j) * & - dot_product(plastic_phenopowerlaw_hardeningMatrix_TwinSlip(j,1:nSlip,instance), & + dot_product(interaction_TwinSlip(j,1:totalNslip(instance),instance), & right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * left_TwinTwin(j) * & - dot_product(plastic_phenopowerlaw_hardeningMatrix_TwinTwin(j,1:nTwin,instance), & + dot_product(interaction_TwinTwin(j,1:totalNtwin(instance),instance), & right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor if (plasticState(ph)%state(index_F,of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 plasticState(ph)%dotState(index_F,of) = plasticState(ph)%dotState(index_F,of) + & @@ -1071,8 +990,8 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - nSlip = plastic_phenopowerlaw_totalNslip(instance) - nTwin = plastic_phenopowerlaw_totalNtwin(instance) + nSlip = totalNslip(instance) + nTwin = totalNtwin(instance) index_Gamma = nSlip + nTwin + 1_pInt index_F = nSlip + nTwin + 2_pInt @@ -1095,16 +1014,16 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (shearrate_slip_ID) j = 0_pInt - slipFamilies1: do f = 1_pInt,lattice_maxNslipFamily + slipFamilies1: do f = 1_pInt,size(param(instance)%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems1: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) + slipSystems1: do i = 1_pInt,param(instance)%Nslip(f) j = j + 1_pInt tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) tau_slip_neg = tau_slip_pos do k = 1,lattice_NnonSchmid(ph) - tau_slip_pos = tau_slip_pos + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_pos = tau_slip_pos +param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg + plastic_phenopowerlaw_nonSchmidCoeff(k,instance)* & + tau_slip_neg = tau_slip_neg +param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo plastic_phenopowerlaw_postResults(c+j) = param(instance)%gdot0_slip*0.5_pReal* & @@ -1118,9 +1037,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (resolvedstress_slip_ID) j = 0_pInt - slipFamilies2: do f = 1_pInt,lattice_maxNslipFamily + slipFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems2: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) + slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) j = j + 1_pInt plastic_phenopowerlaw_postResults(c+j) = & dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) @@ -1144,9 +1063,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + nTwin case (shearrate_twin_ID) j = 0_pInt - twinFamilies1: do f = 1_pInt,lattice_maxNtwinFamily + twinFamilies1: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems1: do i = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) + twinSystems1: do i = 1_pInt,param(instance)%Ntwin(f) j = j + 1_pInt tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-plasticState(ph)%state(index_F,of))*& ! 1-F @@ -1159,9 +1078,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (resolvedstress_twin_ID) j = 0_pInt - twinFamilies2: do f = 1_pInt,lattice_maxNtwinFamily + twinFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems2: do i = 1_pInt,plastic_phenopowerlaw_Ntwin(f,instance) + twinSystems2: do i = 1_pInt,param(instance)%Ntwin(f) j = j + 1_pInt plastic_phenopowerlaw_postResults(c+j) = & dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) From e3bd09d8e69a8d0efa9f7c4899e0af4396c14ae3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 26 Apr 2018 18:12:45 +0200 Subject: [PATCH 03/42] wrong initiatilization --- src/plastic_phenopowerlaw.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 4b41f9ad2..bcb87a25d 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -603,7 +603,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) state (instance)%s_twin=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%s_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%state0(startIndex:endIndex,:) = & - spread(param(instance)%tau0_twin(1:totalNtwin(instance)),2,NipcMyPhase) + spread(math_expand(param(instance)%tau0_twin, param(instance)%Ntwin), 2, NipcMyPhase) plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolResistance startIndex = endIndex + 1_pInt From d9548b455ebec08a93903a2b77313dcdcf23f781 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 26 Apr 2018 18:35:49 +0200 Subject: [PATCH 04/42] should loop over slip systems --- src/plastic_phenopowerlaw.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index bcb87a25d..82deea1c3 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -1037,7 +1037,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (resolvedstress_slip_ID) j = 0_pInt - slipFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) + slipFamilies2: do f = 1_pInt,size(param(instance)%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) j = j + 1_pInt From 423fcd6e0dcafa83ba879e6945f42d93759d6773 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Fri, 27 Apr 2018 19:53:54 +0200 Subject: [PATCH 05/42] using state pointer increases readability in dotState --- src/plastic_phenopowerlaw.f90 | 46 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 82deea1c3..042b80be3 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -816,8 +816,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) instance,ph, & nSlip,nTwin, & f,i,j,k, & - index_Gamma,index_F,index_myFamily, & - offset_accshear_slip,offset_accshear_twin, & + index_myfamily, & of real(pReal) :: & c_SlipSlip,c_TwinSlip,c_TwinTwin, & @@ -833,28 +832,21 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - nSlip = totalNslip(instance) - nTwin = totalNtwin(instance) - - index_Gamma = nSlip + nTwin + 1_pInt - index_F = nSlip + nTwin + 2_pInt - offset_accshear_slip = nSlip + nTwin + 2_pInt - offset_accshear_twin = nSlip + nTwin + 2_pInt + nSlip plasticState(ph)%dotState(:,of) = 0.0_pReal !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices c_SlipSlip = param(instance)%h0_slipslip*& - (1.0_pReal + param(instance)%twinC*plasticState(ph)%state(index_F,of)**& + (1.0_pReal + param(instance)%twinC*state(instance)%sumF(of)**& param(instance)%twinB) c_TwinSlip = param(instance)%h0_TwinSlip*& - plasticState(ph)%state(index_Gamma,of)**param(instance)%twinE + state(instance)%sumGamma(of)**param(instance)%twinE c_TwinTwin = param(instance)%h0_TwinTwin*& - plasticState(ph)%state(index_F,of)**param(instance)%twinD + state(instance)%sumF(of)**param(instance)%twinD !-------------------------------------------------------------------------------------------------- ! calculate left and right vectors and calculate dot gammas - ssat_offset = param(instance)%spr*sqrt(plasticState(ph)%state(index_F,of)) + ssat_offset = param(instance)%spr*sqrt(state(instance)%sumF(of)) j = 0_pInt slipFamilies1: do f =1_pInt,size(param(instance)%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family @@ -862,11 +854,11 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) j = j+1_pInt left_SlipSlip(j) = 1.0_pReal + param(instance)%H_int(f) ! modified no system-dependent left part left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part - right_SlipSlip(j) = abs(1.0_pReal-plasticState(ph)%state(j,of) / & + right_SlipSlip(j) = abs(1.0_pReal-state(instance)%s_slip(j,of) / & (param(instance)%tausat_slip(f)+ssat_offset)) & **param(instance)%a_slip& - *sign(1.0_pReal,1.0_pReal-plasticState(ph)%state(j,of) / & - (param(instance)%tausat_slip(f)+ssat_offset)) + *sign(1.0_pReal,1.0_pReal-state(instance)%s_slip(j,of)) / & + (param(instance)%tausat_slip(f)+ssat_offset) right_TwinSlip(j) = 1.0_pReal ! no system-dependent part !-------------------------------------------------------------------------------------------------- @@ -880,9 +872,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo nonSchmidSystems gdot_slip(j) = param(instance)%gdot0_slip*0.5_pReal* & - ((abs(tau_slip_pos)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & + ((abs(tau_slip_pos)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & + +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -902,9 +894,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! Calculation of dot vol frac tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) - gdot_twin(j) = (1.0_pReal-plasticState(ph)%state(index_F,of))*& ! 1-F + gdot_twin(j) = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F param(instance)%gdot0_twin*& - (abs(tau_twin)/plasticState(ph)%state(nslip+j,of))**& + (abs(tau_twin)/state(instance)%s_twin(j,of))**& param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) enddo twinSystems1 enddo twinFamilies1 @@ -915,15 +907,15 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) slipFamilies2: do f = 1_pInt,size(param(instance)%Nslip,1) slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) j = j+1_pInt - plasticState(ph)%dotState(j,of) = & ! evolution of slip resistance j + dotState(instance)%s_slip(j,of) = & ! evolution of slip resistance j c_SlipSlip * left_SlipSlip(j) * & dot_product(interaction_SlipSlip(j,1:totalNslip(instance),instance), & right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor dot_product(interaction_SlipTwin(j,1:totalNtwin(instance),instance), & right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor - plasticState(ph)%dotState(index_Gamma,of) = plasticState(ph)%dotState(index_Gamma,of) + & + dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + & abs(gdot_slip(j)) - plasticState(ph)%dotState(offset_accshear_slip+j,of) = abs(gdot_slip(j)) + dotState(instance)%accshear_slip(j,of) = abs(gdot_slip(j)) enddo slipSystems2 enddo slipFamilies2 @@ -932,17 +924,17 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family twinSystems2: do i = 1_pInt,param(instance)%Ntwin(f) j = j+1_pInt - plasticState(ph)%dotState(j+nSlip,of) = & ! evolution of twin resistance j + dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j c_TwinSlip * left_TwinSlip(j) * & dot_product(interaction_TwinSlip(j,1:totalNslip(instance),instance), & right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * left_TwinTwin(j) * & dot_product(interaction_TwinTwin(j,1:totalNtwin(instance),instance), & right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor - if (plasticState(ph)%state(index_F,of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 - plasticState(ph)%dotState(index_F,of) = plasticState(ph)%dotState(index_F,of) + & + if (state(instance)%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 + dotState(instance)%sumF(of) = dotState(instance)%sumF(of) + & gdot_twin(j)/lattice_shearTwin(index_myFamily+i,ph) - plasticState(ph)%dotState(offset_accshear_twin+j,of) = abs(gdot_twin(j)) + dotState(instance)%accshear_twin(j,of) = abs(gdot_twin(j)) enddo twinSystems2 enddo twinFamilies2 From c3322b589e9360ec67679726d96e8fae09157be7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 30 Apr 2018 13:58:50 +0200 Subject: [PATCH 06/42] not needed anymore --- src/plastic_phenopowerlaw.f90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 042b80be3..c754e3127 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -814,9 +814,8 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) integer(pInt) :: & instance,ph, & - nSlip,nTwin, & f,i,j,k, & - index_myfamily, & + index_myFamily, & of real(pReal) :: & c_SlipSlip,c_TwinSlip,c_TwinTwin, & From 51f56f5bad94de97fef1b214d6b2ddfdc6fed3e6 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Mon, 30 Apr 2018 21:30:53 +0200 Subject: [PATCH 07/42] using state pointers increases readability in constitutive results --- src/plastic_phenopowerlaw.f90 | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) mode change 100644 => 100755 src/plastic_phenopowerlaw.f90 diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 old mode 100644 new mode 100755 index 042b80be3..acf6a4a44 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -832,6 +832,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) + plasticState(ph)%dotState(:,of) = 0.0_pReal !-------------------------------------------------------------------------------------------------- @@ -974,7 +975,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) instance,ph, of, & nSlip,nTwin, & o,f,i,c,j,k, & - index_Gamma,index_F,index_accshear_slip,index_accshear_twin,index_myFamily + index_myFamily real(pReal) :: & tau_slip_pos,tau_slip_neg,tau @@ -982,26 +983,19 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - nSlip = totalNslip(instance) - nTwin = totalNtwin(instance) - - index_Gamma = nSlip + nTwin + 1_pInt - index_F = nSlip + nTwin + 2_pInt - index_accshear_slip = nSlip + nTwin + 3_pInt - index_accshear_twin = nSlip + nTwin + 3_pInt + nSlip + plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt outputsLoop: do o = 1_pInt,plastic_phenopowerlaw_Noutput(instance) select case(plastic_phenopowerlaw_outputID(o,instance)) case (resistance_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = plasticState(ph)%state(1:nSlip,of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%s_slip(of) c = c + nSlip case (accumulatedshear_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = plasticState(ph)%state(index_accshear_slip:& - index_accshear_slip+nSlip-1_pInt,of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%accshear_slip(of) c = c + nSlip case (shearrate_slip_ID) @@ -1019,9 +1013,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo plastic_phenopowerlaw_postResults(c+j) = param(instance)%gdot0_slip*0.5_pReal* & - ((abs(tau_slip_pos)/plasticState(ph)%state(j,of))**param(instance)%n_slip & + ((abs(tau_slip_pos)/state(instance)%s_slip(j,of))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**param(instance)%n_slip & + +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -1041,17 +1035,17 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (totalshear_ID) plastic_phenopowerlaw_postResults(c+1_pInt) = & - plasticState(ph)%state(index_Gamma,of) + state(instance)%sumGamma(of) c = c + 1_pInt case (resistance_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - plasticState(ph)%state(1_pInt+nSlip:1_pInt+nSlip+nTwin-1_pInt,of) + state(instance)%s_twin(of) c = c + nTwin case (accumulatedshear_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - plasticState(ph)%state(index_accshear_twin:index_accshear_twin+nTwin-1_pInt,of) + state(instance)%accshear_twin(of) c = c + nTwin case (shearrate_twin_ID) j = 0_pInt @@ -1060,9 +1054,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) twinSystems1: do i = 1_pInt,param(instance)%Ntwin(f) j = j + 1_pInt tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) - plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-plasticState(ph)%state(index_F,of))*& ! 1-F + plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F param(instance)%gdot0_twin*& - (abs(tau)/plasticState(ph)%state(j+nSlip,of))**& + (abs(tau)/state(instance)%s_twin(j,of))**& param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) enddo twinSystems1 enddo twinFamilies1 @@ -1081,7 +1075,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + nTwin case (totalvolfrac_twin_ID) - plastic_phenopowerlaw_postResults(c+1_pInt) = plasticState(ph)%state(index_F,of) + plastic_phenopowerlaw_postResults(c+1_pInt) = state(instance)%sumF(of) c = c + 1_pInt end select From 74956de9bd4f658ffd954f6d57ded22e7f32d4b5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 2 May 2018 16:06:30 +0200 Subject: [PATCH 08/42] misplaced bracket caused wrong results introduced in commit e3bd09d8 --- src/plastic_phenopowerlaw.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index c754e3127..f1d419c14 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -856,8 +856,8 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) right_SlipSlip(j) = abs(1.0_pReal-state(instance)%s_slip(j,of) / & (param(instance)%tausat_slip(f)+ssat_offset)) & **param(instance)%a_slip& - *sign(1.0_pReal,1.0_pReal-state(instance)%s_slip(j,of)) / & - (param(instance)%tausat_slip(f)+ssat_offset) + *sign(1.0_pReal,1.0_pReal-state(instance)%s_slip(j,of) / & + (param(instance)%tausat_slip(f)+ssat_offset)) right_TwinSlip(j) = 1.0_pReal ! no system-dependent part !-------------------------------------------------------------------------------------------------- From 235b2fe3c89ead13ecfac6f45240716d6d9d7dfd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 2 May 2018 16:44:27 +0200 Subject: [PATCH 09/42] ntwin = [0] cause problems math_expand now works for sum(how) == 0 --- src/math.f90 | 3 +++ src/plastic_phenopowerlaw.f90 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/math.f90 b/src/math.f90 index 4354354f7..82945a822 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -386,6 +386,9 @@ pure function math_expand(what,how) real(pReal), dimension(sum(how)) :: math_expand integer(pInt) :: i + if (sum(how) == 0_pInt) & + return + do i = 1_pInt, size(how) math_expand(sum(how(1:i-1))+1:sum(how(1:i))) = what(mod(i-1_pInt,size(what))+1_pInt) enddo diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index f1d419c14..ab65490d1 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -202,7 +202,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) allocate(totalNslip(maxNinstance), source=0_pInt) allocate(totalNtwin(maxNinstance), source=0_pInt) - allocate(param(maxNinstance)) ! one container of parameters per instance + allocate(param(maxNinstance)) ! one container of parameters per instance rewind(fileUnit) phase = 0_pInt From ccde78799ed638f6e10096f1034607549f8c5456 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 2 May 2018 17:33:42 +0200 Subject: [PATCH 10/42] using state pointers increases readability in postResults --- src/plastic_phenopowerlaw.f90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) mode change 100755 => 100644 src/plastic_phenopowerlaw.f90 diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 old mode 100755 new mode 100644 index d0452c04c..52fcf3ad3 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -982,7 +982,8 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - + nSlip= totalNslip(instance) + nTwin= totalNtwin(instance) plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt @@ -990,11 +991,11 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) outputsLoop: do o = 1_pInt,plastic_phenopowerlaw_Noutput(instance) select case(plastic_phenopowerlaw_outputID(o,instance)) case (resistance_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%s_slip(of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%s_slip(1:nSlip,of) c = c + nSlip case (accumulatedshear_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%accshear_slip(of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%accshear_slip(1:nSlip,of) c = c + nSlip case (shearrate_slip_ID) @@ -1039,12 +1040,12 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (resistance_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - state(instance)%s_twin(of) + state(instance)%s_twin(1:nTwin,of) c = c + nTwin case (accumulatedshear_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - state(instance)%accshear_twin(of) + state(instance)%accshear_twin(1:nTwin,of) c = c + nTwin case (shearrate_twin_ID) j = 0_pInt From 804febe7f9ea954c2c66ddeec9f56331faab2007 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 31 May 2018 18:31:44 +0200 Subject: [PATCH 11/42] WIP: separate reading in and parsing --- src/math.f90 | 3 +- src/plastic_phenopowerlaw.f90 | 113 +++++++++++++++++++++------------- 2 files changed, 71 insertions(+), 45 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index f253a1b28..d53d80b40 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -160,8 +160,7 @@ module math math_rotate_forward33, & math_rotate_backward33, & math_rotate_forward3333, & - math_limit, & - math_expand + math_limit private :: & math_check, & halton diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 52fcf3ad3..c70d7220d 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -26,14 +26,11 @@ module plastic_phenopowerlaw totalNslip, & !< no. of slip system used in simulation totalNtwin !< no. of twin system used in simulation - - real(pReal), dimension(:,:,:), allocatable, private :: & - - interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) + interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) interaction_SlipTwin, & !< interaction factors slip - twin (input parameter) interaction_TwinSlip, & !< interaction factors twin - slip (input parameter) - interaction_TwinTwin !< interaction factors twin - twin (input parameter) + interaction_TwinTwin !< interaction factors twin - twin (input parameter) enum, bind(c) @@ -52,7 +49,16 @@ module plastic_phenopowerlaw integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: & plastic_phenopowerlaw_outputID !< ID of each post result output + type :: tKeyValues + character(len=64) :: & + key = '' + character(len=65536) :: & + rawValues = '' + end type + type, private :: tParameters !< container type for internal constitutive parameters + type(tKeyValues) :: & + keyValues real(pReal) :: & gdot0_slip, & !< reference shear strain rate for slip gdot0_twin, & !< reference shear strain rate for twin @@ -172,6 +178,9 @@ subroutine plastic_phenopowerlaw_init(fileUnit) offset_slip, index_myFamily, index_otherFamily, & mySize=0_pInt,sizeState,sizeDotState, sizeDeltaState, & startIndex, endIndex + + type(tKeyValues) :: keyValuesTemp + character(len=65536) :: & tag = '', & line = '', & @@ -184,67 +193,85 @@ subroutine plastic_phenopowerlaw_init(fileUnit) write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) ! ToDo: this does not happen if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & write(6,'(a16,1x,i5,/)') '# instances:',maxNinstance - allocate(plastic_phenopowerlaw_sizePostResults(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_sizePostResult(maxval(phase_Noutput),maxNinstance), & - source=0_pInt) + allocate(plastic_phenopowerlaw_sizePostResults(maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_sizePostResult(maxval(phase_Noutput),maxNinstance),source=0_pInt) + allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_output(maxval(phase_Noutput),maxNinstance)) - plastic_phenopowerlaw_output = '' - allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) - - allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) + plastic_phenopowerlaw_output = '' + allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) allocate(totalNslip(maxNinstance), source=0_pInt) allocate(totalNtwin(maxNinstance), source=0_pInt) allocate(param(maxNinstance)) ! one container of parameters per instance rewind(fileUnit) phase = 0_pInt - do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) ! wind forward to + windForward: do while (IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) line = IO_read(fileUnit) - enddo - - parsingFile: do while (trim(line) /= IO_EOF) ! read through sections of phase part + enddo windForward + getKeys: do while (trim(line) /= IO_EOF) ! read through sections of phase part line = IO_read(fileUnit) - if (IO_isBlank(line)) cycle ! skip empty lines + if (IO_isBlank(line) .or. phase == 0_pInt) cycle ! skip empty lines + if (IO_getTag(line,'[',']') /= '') phase = phase + 1_pInt ! next phase + phase = phase + 1_pInt ! advance phase section counter + instance = phase_plasticityInstance(phase) ! instance of present phase + cycle + endif + if (phase_plasticity(phase) /= PLASTICITY_PHENOPOWERLAW_ID) cycle if (IO_getTag(line,'<','>') /= '') then ! stop at next part line = IO_read(fileUnit, .true.) ! reset IO_read exit endif - if (IO_getTag(line,'[',']') /= '') then ! next phase - phase = phase + 1_pInt ! advance phase section counter - if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then - instance = phase_plasticityInstance(phase) ! which instance of my plasticity is present phase - Nchunks_SlipFamilies = count(lattice_NslipSystem(:,phase) > 0_pInt) ! maximum number of slip families according to lattice type of current phase - Nchunks_TwinFamilies = count(lattice_NtwinSystem(:,phase) > 0_pInt) ! maximum number of twin families according to lattice type of current phase - Nchunks_SlipSlip = maxval(lattice_interactionSlipSlip(:,:,phase)) - Nchunks_SlipTwin = maxval(lattice_interactionSlipTwin(:,:,phase)) - Nchunks_TwinSlip = maxval(lattice_interactionTwinSlip(:,:,phase)) - Nchunks_TwinTwin = maxval(lattice_interactionTwinTwin(:,:,phase)) - Nchunks_nonSchmid = lattice_NnonSchmid(phase) - if(allocated(tempPerSlip)) deallocate(tempPerSlip) - !allocate(param(instance)%H_int,source=tempPerSlip) gfortran 5 does not support this - allocate(param(instance)%H_int(Nchunks_SlipFamilies),source=0.0_pReal) - allocate(param(instance)%interaction_SlipSlip(Nchunks_SlipSlip),source=0.0_pReal) - allocate(param(instance)%interaction_SlipTwin(Nchunks_SlipTwin),source=0.0_pReal) - allocate(param(instance)%interaction_TwinSlip(Nchunks_TwinSlip),source=0.0_pReal) - allocate(param(instance)%interaction_TwinTwin(Nchunks_TwinTwin),source=0.0_pReal) - allocate(param(instance)%nonSchmidCoeff(Nchunks_nonSchmid),source=0.0_pReal) + chunkPos = IO_stringPos(line) + keyValuesTemp%key = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key + if(chunkPos(1) > 1) keyValuesTemp%rawValues = IO_lc(line(chunkPos(4),:)) + param(instance)%keyValues = [(instance)%keyValues,keyValuesTemp] + enddo getKeys - allocate(tempPerSlip(Nchunks_SlipFamilies)) - endif - cycle ! skip to next line + parseString: do instance = 1_pInt, maxNinstance + do i = 1_pInt, size(param(instance)%keyValues); key = param(instance)%keyValues(i) + enddo + enddo parseStrings + + myPhase: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then + instance = phase_plasticityInstance(phase) + + ! if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then + ! instance = phase_plasticityInstance(phase) ! which instance of my plasticity is present phase + ! chunkPos = IO_stringPos(line) + ! configTemp%key = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key + ! if(chunkPos(1) > 1) configTemp%rawValues = IO_lc(line(chunkPos(4),:)) + ! config = [config,configTemp] + + ! Nchunks_SlipFamilies = count(lattice_NslipSystem(:,phase) > 0_pInt) ! maximum number of slip families according to lattice type of current phase + ! Nchunks_TwinFamilies = count(lattice_NtwinSystem(:,phase) > 0_pInt) ! maximum number of twin families according to lattice type of current phase + ! Nchunks_SlipSlip = maxval(lattice_interactionSlipSlip(:,:,phase)) + ! Nchunks_SlipTwin = maxval(lattice_interactionSlipTwin(:,:,phase)) + ! Nchunks_TwinSlip = maxval(lattice_interactionTwinSlip(:,:,phase)) + ! Nchunks_TwinTwin = maxval(lattice_interactionTwinTwin(:,:,phase)) + ! Nchunks_nonSchmid = lattice_NnonSchmid(phase) + ! if(allocated(tempPerSlip)) deallocate(tempPerSlip) + ! !allocate(param(instance)%H_int,source=tempPerSlip) gfortran 5 does not support this + ! allocate(param(instance)%H_int(Nchunks_SlipFamilies),source=0.0_pReal) + ! allocate(param(instance)%interaction_SlipSlip(Nchunks_SlipSlip),source=0.0_pReal) + ! allocate(param(instance)%interaction_SlipTwin(Nchunks_SlipTwin),source=0.0_pReal) + ! allocate(param(instance)%interaction_TwinSlip(Nchunks_TwinSlip),source=0.0_pReal) + ! allocate(param(instance)%interaction_TwinTwin(Nchunks_TwinTwin),source=0.0_pReal) + ! allocate(param(instance)%nonSchmidCoeff(Nchunks_nonSchmid),source=0.0_pReal) + + ! allocate(tempPerSlip(Nchunks_SlipFamilies)) + ! endif + ! cycle ! skip to next line endif if (phase > 0_pInt ) then; if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my phases. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran - - chunkPos = IO_stringPos(line) - tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key + tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key select case(tag) case ('(output)') From 7db08f0a76b310e4328aca190a0160e71c3517cb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 1 Jun 2018 22:56:20 +0200 Subject: [PATCH 12/42] using material.config values from main memory --- src/constitutive.f90 | 2 +- src/plastic_phenopowerlaw.f90 | 683 ++++++++++++---------------------- 2 files changed, 241 insertions(+), 444 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index e2a3f0260..a7ca64506 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -157,7 +157,7 @@ subroutine constitutive_init() ! parse plasticities from config file if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init if (any(phase_plasticity == PLASTICITY_ISOTROPIC_ID)) call plastic_isotropic_init - if (any(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)) call plastic_phenopowerlaw_init(FILEUNIT) + if (any(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)) call plastic_phenopowerlaw_init if (any(phase_plasticity == PLASTICITY_KINEHARDENING_ID)) call plastic_kinehardening_init(FILEUNIT) if (any(phase_plasticity == PLASTICITY_DISLOTWIN_ID)) call plastic_dislotwin_init(FILEUNIT) if (any(phase_plasticity == PLASTICITY_DISLOUCLA_ID)) call plastic_disloucla_init(FILEUNIT) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index c70d7220d..3cc03ef1e 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -10,55 +10,27 @@ module plastic_phenopowerlaw implicit none private - integer(pInt), dimension(:), allocatable, public, protected :: & - plastic_phenopowerlaw_sizePostResults !< cumulative size of post results - integer(pInt), dimension(:,:), allocatable, target, public :: & - plastic_phenopowerlaw_sizePostResult !< size of each post result output - + plastic_phenopowerlaw_sizePostResult !< size of each post result output character(len=64), dimension(:,:), allocatable, target, public :: & - plastic_phenopowerlaw_output !< name of each post result output - - integer(pInt), dimension(:), allocatable, target, public :: & - plastic_phenopowerlaw_Noutput !< number of outputs per instance of this constitution - - integer(pInt), dimension(:), allocatable, private :: & - totalNslip, & !< no. of slip system used in simulation - totalNtwin !< no. of twin system used in simulation - - real(pReal), dimension(:,:,:), allocatable, private :: & - interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) - interaction_SlipTwin, & !< interaction factors slip - twin (input parameter) - interaction_TwinSlip, & !< interaction factors twin - slip (input parameter) - interaction_TwinTwin !< interaction factors twin - twin (input parameter) - + plastic_phenopowerlaw_output !< name of each post result output enum, bind(c) - enumerator :: undefined_ID, & - resistance_slip_ID, & - accumulatedshear_slip_ID, & - shearrate_slip_ID, & - resolvedstress_slip_ID, & - totalshear_ID, & - resistance_twin_ID, & - accumulatedshear_twin_ID, & - shearrate_twin_ID, & - resolvedstress_twin_ID, & - totalvolfrac_twin_ID + enumerator :: & + undefined_ID, & + resistance_slip_ID, & + accumulatedshear_slip_ID, & + shearrate_slip_ID, & + resolvedstress_slip_ID, & + totalshear_ID, & + resistance_twin_ID, & + accumulatedshear_twin_ID, & + shearrate_twin_ID, & + resolvedstress_twin_ID, & + totalvolfrac_twin_ID end enum - integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: & - plastic_phenopowerlaw_outputID !< ID of each post result output - - type :: tKeyValues - character(len=64) :: & - key = '' - character(len=65536) :: & - rawValues = '' - end type type, private :: tParameters !< container type for internal constitutive parameters - type(tKeyValues) :: & - keyValues real(pReal) :: & gdot0_slip, & !< reference shear strain rate for slip gdot0_twin, & !< reference shear strain rate for twin @@ -73,9 +45,9 @@ module plastic_phenopowerlaw h0_TwinSlip, & !< reference hardening twin - slip h0_TwinTwin, & !< reference hardening twin - twin a_slip, & - aTolResistance = 1.0_pReal, & ! default absolute tolerance 1 Pa - aTolShear = 1.0e-6_pReal, & ! default absolute tolerance 1e-6 - aTolTwinfrac = 1.0e-6_pReal ! default absolute tolerance 1e-6 + aTolResistance, & ! default absolute tolerance 1 Pa + aTolShear, & ! default absolute tolerance 1e-6 + aTolTwinfrac ! default absolute tolerance 1e-6 integer(pInt), dimension(:), allocatable :: & Nslip, & !< active number of slip systems per family Ntwin !< active number of twin systems per family @@ -85,13 +57,21 @@ module plastic_phenopowerlaw tausat_slip, & !< maximum critical shear stress for slip nonSchmidCoeff, & H_int, & !< per family hardening activity (optional) - interaction_SlipSlip, & !< slip resistance from slip activity interaction_SlipTwin, & !< slip resistance from twin activity interaction_TwinSlip, & !< twin resistance from slip activity interaction_TwinTwin !< twin resistance from twin activity + real(pReal), dimension(:,:), allocatable :: & + matrix_SlipSlip, & !< slip resistance from slip activity + matrix_SlipTwin, & !< slip resistance from twin activity + matrix_TwinSlip, & !< twin resistance from slip activity + matrix_TwinTwin !< twin resistance from twin activity + + integer(kind(undefined_ID)), dimension(:), allocatable :: & + outputID !< ID of each post result output end type - type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance) + + type(tParameters), dimension(:), allocatable, target, private :: param !< containers of constitutive parameters (len Ninstance) type, private :: tPhenopowerlawState real(pReal), pointer, dimension(:,:) :: & @@ -121,7 +101,7 @@ contains !> @brief module initialization !> @details reads in material parameters, allocates arrays, and does sanity checks !-------------------------------------------------------------------------------------------------- -subroutine plastic_phenopowerlaw_init(fileUnit) +subroutine plastic_phenopowerlaw_init #if defined(__GFORTRAN__) || __INTEL_COMPILER >= 1800 use, intrinsic :: iso_fortran_env, only: & compiler_version, & @@ -158,387 +138,202 @@ subroutine plastic_phenopowerlaw_init(fileUnit) PLASTICITY_PHENOPOWERLAW_ID, & material_phase, & plasticState, & - MATERIAL_partPhase + MATERIAL_partPhase, & + phaseConfig + use lattice use numerics,only: & numerics_integrator implicit none - integer(pInt), intent(in) :: fileUnit - integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt) :: & maxNinstance, & - instance,phase,j,k, f,o, & - Nchunks_SlipSlip = 0_pInt, Nchunks_SlipTwin = 0_pInt, & - Nchunks_TwinSlip = 0_pInt, Nchunks_TwinTwin = 0_pInt, & - Nchunks_SlipFamilies = 0_pInt, Nchunks_TwinFamilies = 0_pInt, & - Nchunks_TransFamilies = 0_pInt, Nchunks_nonSchmid = 0_pInt, & - NipcMyPhase, & + instance,phase,j,k, f,o, i,& + NipcMyPhase, outputSize, & offset_slip, index_myFamily, index_otherFamily, & - mySize=0_pInt,sizeState,sizeDotState, sizeDeltaState, & + sizeState,sizeDotState, sizeDeltaState, & startIndex, endIndex + integer(pInt), dimension(0), parameter :: emptyInt = [integer(pInt)::] + real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] - type(tKeyValues) :: keyValuesTemp + type(tParameters), pointer :: p + + integer(kind(undefined_ID)) :: & + outputID !< ID of each post result output character(len=65536) :: & - tag = '', & - line = '', & extmsg = '' - character(len=64) :: & - outputtag = '' - real(pReal), dimension(:), allocatable :: tempPerSlip + character(len=64), dimension(:), allocatable :: outputs write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) ! ToDo: this does not happen - if (maxNinstance == 0_pInt) return - + maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & write(6,'(a16,1x,i5,/)') '# instances:',maxNinstance - - allocate(plastic_phenopowerlaw_sizePostResults(maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_sizePostResult(maxval(phase_Noutput),maxNinstance),source=0_pInt) - allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) allocate(plastic_phenopowerlaw_output(maxval(phase_Noutput),maxNinstance)) plastic_phenopowerlaw_output = '' - allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) - allocate(totalNslip(maxNinstance), source=0_pInt) - allocate(totalNtwin(maxNinstance), source=0_pInt) allocate(param(maxNinstance)) ! one container of parameters per instance - - rewind(fileUnit) - phase = 0_pInt - windForward: do while (IO_lc(IO_getTag(line,'<','>')) /= material_partPhase) - line = IO_read(fileUnit) - enddo windForward - getKeys: do while (trim(line) /= IO_EOF) ! read through sections of phase part - line = IO_read(fileUnit) - if (IO_isBlank(line) .or. phase == 0_pInt) cycle ! skip empty lines - if (IO_getTag(line,'[',']') /= '') phase = phase + 1_pInt ! next phase - phase = phase + 1_pInt ! advance phase section counter - instance = phase_plasticityInstance(phase) ! instance of present phase - cycle - endif - if (phase_plasticity(phase) /= PLASTICITY_PHENOPOWERLAW_ID) cycle - if (IO_getTag(line,'<','>') /= '') then ! stop at next part - line = IO_read(fileUnit, .true.) ! reset IO_read - exit - endif - chunkPos = IO_stringPos(line) - keyValuesTemp%key = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key - if(chunkPos(1) > 1) keyValuesTemp%rawValues = IO_lc(line(chunkPos(4),:)) - param(instance)%keyValues = [(instance)%keyValues,keyValuesTemp] - enddo getKeys - - parseString: do instance = 1_pInt, maxNinstance - do i = 1_pInt, size(param(instance)%keyValues); key = param(instance)%keyValues(i) - enddo - enddo parseStrings - - myPhase: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then - instance = phase_plasticityInstance(phase) - - ! if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then - ! instance = phase_plasticityInstance(phase) ! which instance of my plasticity is present phase - ! chunkPos = IO_stringPos(line) - ! configTemp%key = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key - ! if(chunkPos(1) > 1) configTemp%rawValues = IO_lc(line(chunkPos(4),:)) - ! config = [config,configTemp] - - ! Nchunks_SlipFamilies = count(lattice_NslipSystem(:,phase) > 0_pInt) ! maximum number of slip families according to lattice type of current phase - ! Nchunks_TwinFamilies = count(lattice_NtwinSystem(:,phase) > 0_pInt) ! maximum number of twin families according to lattice type of current phase - ! Nchunks_SlipSlip = maxval(lattice_interactionSlipSlip(:,:,phase)) - ! Nchunks_SlipTwin = maxval(lattice_interactionSlipTwin(:,:,phase)) - ! Nchunks_TwinSlip = maxval(lattice_interactionTwinSlip(:,:,phase)) - ! Nchunks_TwinTwin = maxval(lattice_interactionTwinTwin(:,:,phase)) - ! Nchunks_nonSchmid = lattice_NnonSchmid(phase) - ! if(allocated(tempPerSlip)) deallocate(tempPerSlip) - ! !allocate(param(instance)%H_int,source=tempPerSlip) gfortran 5 does not support this - ! allocate(param(instance)%H_int(Nchunks_SlipFamilies),source=0.0_pReal) - ! allocate(param(instance)%interaction_SlipSlip(Nchunks_SlipSlip),source=0.0_pReal) - ! allocate(param(instance)%interaction_SlipTwin(Nchunks_SlipTwin),source=0.0_pReal) - ! allocate(param(instance)%interaction_TwinSlip(Nchunks_TwinSlip),source=0.0_pReal) - ! allocate(param(instance)%interaction_TwinTwin(Nchunks_TwinTwin),source=0.0_pReal) - ! allocate(param(instance)%nonSchmidCoeff(Nchunks_nonSchmid),source=0.0_pReal) - - ! allocate(tempPerSlip(Nchunks_SlipFamilies)) - ! endif - ! cycle ! skip to next line - endif - if (phase > 0_pInt ) then; if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my phases. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran - tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key - select case(tag) - - case ('(output)') - outputtag = IO_lc(IO_stringValue(line,chunkPos,2_pInt)) - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) + 1_pInt ! assume valid output - plastic_phenopowerlaw_output(plastic_phenopowerlaw_Noutput(instance),instance) = outputtag ! assume valid output - select case(IO_lc(IO_stringValue(line,chunkPos,2_pInt))) - case ('resistance_slip') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resistance_slip_ID - - case ('accumulatedshear_slip','accumulated_shear_slip') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_slip_ID - - case ('shearrate_slip') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = shearrate_slip_ID - - case ('resolvedstress_slip') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resolvedstress_slip_ID - - case ('totalshear') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = totalshear_ID - - case ('resistance_twin') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resistance_twin_ID - - case ('accumulatedshear_twin','accumulated_shear_twin') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_twin_ID - - case ('shearrate_twin') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = shearrate_twin_ID - - case ('resolvedstress_twin') - - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = resolvedstress_twin_ID - - case ('totalvolfrac_twin') - plastic_phenopowerlaw_outputID(plastic_phenopowerlaw_Noutput(instance),instance) = totalvolfrac_twin_ID - - case default - plastic_phenopowerlaw_Noutput(instance) = plastic_phenopowerlaw_Noutput(instance) - 1_pInt ! correct for invalid - - end select - -!-------------------------------------------------------------------------------------------------- -! parameters depending on number of slip families - case ('nslip') - if (chunkPos(1) < Nchunks_SlipFamilies + 1_pInt) call IO_warning(50_pInt,ext_msg=extmsg) - if (chunkPos(1) > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - Nchunks_SlipFamilies = chunkPos(1) - 1_pInt ! user specified number of (possibly) active slip families (e.g. 6 0 6 --> 3) - allocate(param(instance)%Nslip(Nchunks_SlipFamilies),source=-1_pInt) - do j = 1_pInt, Nchunks_SlipFamilies - param(instance)%Nslip(j) = min(IO_intValue(line,chunkPos,1_pInt+j), & - lattice_NslipSystem(j,phase)) ! limit active slip systems per family to min of available and requested - enddo - totalNslip(instance) = sum(param(instance)%Nslip) ! how many slip systems altogether - - case ('tausat_slip','tau0_slip','h_int') - tempPerSlip = 0.0_pReal - do j = 1_pInt, Nchunks_SlipFamilies - if (param(instance)%Nslip(j) > 0_pInt) & - tempPerSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - select case(tag) ! here, all arrays are allocated automatically - case ('tausat_slip') - param(instance)%tausat_slip = tempPerSlip - case ('tau0_slip') - param(instance)%tau0_slip = tempPerSlip - case ('h_int') - param(instance)%H_int = tempPerSlip - end select - -!-------------------------------------------------------------------------------------------------- -! parameters depending on number of twin families - case ('ntwin') - if (chunkPos(1) < Nchunks_TwinFamilies + 1_pInt) call IO_warning(51_pInt,ext_msg=extmsg) - if (chunkPos(1) > Nchunks_TwinFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - Nchunks_TwinFamilies = chunkPos(1) - 1_pInt - allocate(param(instance)%Ntwin(Nchunks_TwinFamilies),source=-1_pInt) - do j = 1_pInt, Nchunks_TwinFamilies - param(instance)%Ntwin(j) = min(IO_intValue(line,chunkPos,1_pInt+j), & - lattice_NtwinSystem(j,phase)) ! limit active twin systems per family to min of available and requested - enddo - totalNtwin(instance) = sum(param(instance)%Ntwin) ! how many twin systems altogether - - case ('tau0_twin') - allocate(param(instance)%tau0_twin(Nchunks_TwinFamilies),source=0.0_pReal) - do j = 1_pInt, Nchunks_TwinFamilies - if (param(instance)%Ntwin(j) > 0_pInt) & - param(instance)%tau0_twin(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - -!-------------------------------------------------------------------------------------------------- -! parameters depending on number of interactions - case ('interaction_slipslip') - if (chunkPos(1) < 1_pInt + Nchunks_SlipSlip) call IO_warning(52_pInt,ext_msg=extmsg) - do j = 1_pInt, Nchunks_SlipSlip - param(instance)%interaction_SlipSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - - case ('interaction_sliptwin') - if (chunkPos(1) < 1_pInt + Nchunks_SlipTwin) call IO_warning(52_pInt,ext_msg=extmsg) - do j = 1_pInt, Nchunks_SlipTwin - param(instance)%interaction_SlipTwin(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - - case ('interaction_twinslip') - if (chunkPos(1) < 1_pInt + Nchunks_TwinSlip) call IO_warning(52_pInt,ext_msg=extmsg) - do j = 1_pInt, Nchunks_TwinSlip - param(instance)%interaction_TwinSlip(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - - case ('interaction_twintwin') - if (chunkPos(1) < 1_pInt + Nchunks_TwinTwin) call IO_warning(52_pInt,ext_msg=extmsg) - do j = 1_pInt, Nchunks_TwinTwin - param(instance)%interaction_TwinTwin(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - - case ('nonschmid_coefficients') - if (chunkPos(1) < 1_pInt + Nchunks_nonSchmid) call IO_warning(52_pInt,ext_msg=extmsg) - do j = 1_pInt,Nchunks_nonSchmid - param(instance)%nonSchmidCoeff(j) = IO_floatValue(line,chunkPos,1_pInt+j) - enddo - -!-------------------------------------------------------------------------------------------------- -! parameters independent of number of slip/twin systems - case ('gdot0_slip') - param(instance)%gdot0_slip = IO_floatValue(line,chunkPos,2_pInt) - case ('n_slip') - param(instance)%n_slip = IO_floatValue(line,chunkPos,2_pInt) - case ('a_slip', 'w0_slip') - param(instance)%a_slip = IO_floatValue(line,chunkPos,2_pInt) - case ('gdot0_twin') - param(instance)%gdot0_twin = IO_floatValue(line,chunkPos,2_pInt) - case ('n_twin') - param(instance)%n_twin = IO_floatValue(line,chunkPos,2_pInt) - case ('s_pr') - param(instance)%spr = IO_floatValue(line,chunkPos,2_pInt) - case ('twin_b') - param(instance)%twinB = IO_floatValue(line,chunkPos,2_pInt) - case ('twin_c') - param(instance)%twinC = IO_floatValue(line,chunkPos,2_pInt) - case ('twin_d') - param(instance)%twinD = IO_floatValue(line,chunkPos,2_pInt) - case ('twin_e') - param(instance)%twinE = IO_floatValue(line,chunkPos,2_pInt) - case ('h0_slipslip') - param(instance)%h0_SlipSlip = IO_floatValue(line,chunkPos,2_pInt) - case ('h0_twinslip') - param(instance)%h0_TwinSlip = IO_floatValue(line,chunkPos,2_pInt) - case ('h0_twintwin') - param(instance)%h0_TwinTwin = IO_floatValue(line,chunkPos,2_pInt) - case ('atol_resistance') - param(instance)%aTolResistance = IO_floatValue(line,chunkPos,2_pInt) - case ('atol_shear') - param(instance)%aTolShear = IO_floatValue(line,chunkPos,2_pInt) - case ('atol_twinfrac') - param(instance)%aTolTwinfrac = IO_floatValue(line,chunkPos,2_pInt) - case default - - end select - endif; endif - enddo parsingFile - - sanityChecks: do phase = 1_pInt, size(phase_plasticity) - myPhase: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then - instance = phase_plasticityInstance(phase) - totalNslip(instance) = sum(param(instance)%Nslip) ! how many slip systems altogether. ToDo: ok for unallocated Nslip - totalNtwin(instance) = sum(param(instance)%Ntwin) ! how many twin systems altogether. ToDo: ok for unallocated Ntwin - slipActive: if (allocated(param(instance)%Nslip)) then - if (any(param(instance)%tau0_slip < 0.0_pReal .and. & - param(instance)%Nslip(:) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='tau0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%gdot0_slip <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='gdot0_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%n_slip <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='n_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(param(instance)%tausat_slip <= 0.0_pReal .and. & - param(instance)%Nslip(:) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(dEq0(param(instance)%a_slip) .and. param(instance)%Nslip(:) > 0)) & - call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - endif slipActive - - twinActive: if (allocated(param(instance)%Ntwin)) then - ! if (any(param(instance)%tau0_twin < 0.0_pReal .and. & - ! param(instance)%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - ! if ( param(instance)%gdot0_twin <= 0.0_pReal .and. & - ! any(param(instance)%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - ! if ( param(instance)%n_twin <= 0.0_pReal .and. & - ! any(param(instance)%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - endif twinActive - - if (param(instance)%aTolResistance <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolResistance ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%aTolShear <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolShear ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (param(instance)%aTolTwinfrac <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') - endif myPhase - enddo sanityChecks - - - !-------------------------------------------------------------------------------------------------- -! allocation of variables whose size depends on the total number of active slip systems - allocate(interaction_SlipSlip(maxval(totalNslip),maxval(totalNslip),maxNinstance), source=0.0_pReal) - allocate(interaction_SlipTwin(maxval(totalNslip),maxval(totalNtwin),maxNinstance), source=0.0_pReal) - allocate(interaction_TwinSlip(maxval(totalNtwin),maxval(totalNslip),maxNinstance), source=0.0_pReal) - allocate(interaction_TwinTwin(maxval(totalNtwin),maxval(totalNtwin),maxNinstance), source=0.0_pReal) - - allocate(state(maxNinstance)) allocate(dotState(maxNinstance)) - initializeInstances: do phase = 1_pInt, size(phase_plasticity) ! loop through all phases in material.config + do phase = 1_pInt, size(phase_plasticityInstance) + if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then + instance = phase_plasticityInstance(phase) + p => param(instance) - myPhase2: if (phase_plasticity(phase) == PLASTICITY_phenopowerlaw_ID) then ! only consider my phase - NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase - instance = phase_plasticityInstance(phase) ! which instance of my phase + p%Nslip = phaseConfig(phase)%getIntArray('nslip',defaultVal=emptyInt) + !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) + if (sum(p%Nslip) > 0_pInt) then + p%tau0_slip = phaseConfig(phase)%getFloatArray('tau0_slip') + p%tausat_slip = phaseConfig(phase)%getFloatArray('tausat_slip') + p%H_int = phaseConfig(phase)%getFloatArray('h_int',defaultVal=[(0.0_pReal,i=1_pInt,size(p%Nslip))]) + print*, (shape(p%H_int)) + print*, (shape(p%Nslip)) + p%interaction_SlipSlip = phaseConfig(phase)%getFloatArray('interaction_slipslip') + p%nonSchmidCoeff = phaseConfig(phase)%getFloatArray('nonschmid_coefficients',& + defaultVal = [real(pReal)::1] ) + p%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') + p%n_slip = phaseConfig(phase)%getFloat('n_slip') + p%a_slip = phaseConfig(phase)%getFloat('a_slip') + p%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') + endif + + p%Ntwin = phaseConfig(phase)%getIntArray('ntwin', defaultVal=emptyInt) + !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) + if (sum(p%Ntwin) > 0_pInt) then + p%tau0_twin = phaseConfig(phase)%getFloatArray('tau0_twin') + p%interaction_TwinTwin = phaseConfig(phase)%getFloatArray('interaction_twintwin') + p%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') + p%n_twin = phaseConfig(phase)%getFloat('n_twin') + p%spr = phaseConfig(phase)%getFloat('s_pr') + p%twinB = phaseConfig(phase)%getFloat('twin_b') + p%twinC = phaseConfig(phase)%getFloat('twin_c') + p%twinD = phaseConfig(phase)%getFloat('twin_d') + p%twinE = phaseConfig(phase)%getFloat('twin_e') + p%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') + endif + if (sum(p%Nslip) > 0_pInt .and. sum(p%Ntwin) > 0_pInt) then + p%interaction_SlipTwin = phaseConfig(phase)%getFloatArray('interaction_sliptwin') + p%interaction_TwinSlip = phaseConfig(phase)%getFloatArray('interaction_twinslip') + p%h0_TwinSlip = phaseConfig(phase)%getFloat('h0_twinslip') + endif + + allocate(p%matrix_SlipSlip(sum(p%Nslip),sum(p%Nslip)),source =0.0_pReal) + allocate(p%matrix_SlipTwin(sum(p%Nslip),sum(p%Ntwin)),source =0.0_pReal) + allocate(p%matrix_TwinSlip(sum(p%Ntwin),sum(p%Nslip)),source =0.0_pReal) + allocate(p%matrix_TwinTwin(sum(p%Ntwin),sum(p%Ntwin)),source =0.0_pReal) + p%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) + p%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + p%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + outputs = phaseConfig(phase)%getStrings('(output)') + allocate(p%outputID(0)) + do i=1_pInt, size(outputs) + outputID = undefined_ID + select case(outputs(i)) + case ('resistance_slip') + outputID = resistance_slip_ID + outputSize = sum(p%Nslip) + case ('acumulatedshear_slip','accumulated_shear_slip') + outputID = accumulatedshear_slip_ID + outputSize = sum(p%Nslip) + case ('shearrate_slip') + outputID = shearrate_slip_ID + outputSize = sum(p%Nslip) + case ('resolvedstress_slip') + outputID = resolvedstress_slip_ID + outputSize = sum(p%Nslip) + + case ('resistance_twin') + outputID = resistance_twin_ID + outputSize = sum(p%Ntwin) + case ('accumulatedshear_twin','accumulated_shear_twin') + outputID = accumulatedshear_twin_ID + outputSize = sum(p%Ntwin) + case ('shearrate_twin') + outputID = shearrate_twin_ID + outputSize = sum(p%Ntwin) + case ('resolvedstress_twin') + outputID = resolvedstress_twin_ID + outputSize = sum(p%Ntwin) + + case ('totalvolfrac_twin') + outputID = totalvolfrac_twin_ID + outputSize = 1_pInt + case ('totalshear') + outputID = totalshear_ID + outputSize = 1_pInt + end select + + if (outputID /= undefined_ID) then + plastic_phenopowerlaw_output(i,instance) = outputs(i) + plastic_phenopowerlaw_sizePostResult(i,instance) = outputSize + p%outputID = [p%outputID , outputID] + endif + + end do !-------------------------------------------------------------------------------------------------- -! Determine size of postResults array - outputsLoop: do o = 1_pInt,plastic_phenopowerlaw_Noutput(instance) - select case(plastic_phenopowerlaw_outputID(o,instance)) - case(resistance_slip_ID, & - shearrate_slip_ID, & - accumulatedshear_slip_ID, & - resolvedstress_slip_ID & - ) - mySize = totalNslip(instance) - case(resistance_twin_ID, & - shearrate_twin_ID, & - accumulatedshear_twin_ID, & - resolvedstress_twin_ID & - ) - mySize = totalNtwin(instance) - case(totalshear_ID, & - totalvolfrac_twin_ID & - ) - mySize = 1_pInt - case default - end select +! parameters independent of number of slip/twin systems +extmsg = '' +if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " +if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " +if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " +if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " + if (extmsg /= '') call IO_error(211_pInt,ip=instance,& + ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') + +if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tau0_slip' " +if (any(p%tau0_slip < p%tausat_slip .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tausat_slip' " +if (any(p%gdot0_slip <= 0.0_pReal .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tausat_slip' " +if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " + + !if (any(dEq0(p%a_slip) .and. sum(p%Nslip) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + + ! if (any(p%tau0_twin < 0.0_pReal .and. & + ! p%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + ! if ( p%gdot0_twin <= 0.0_pReal .and. & + ! any(p%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + ! if ( p%n_twin <= 0.0_pReal .and. & + ! any(p%Ntwin(:) > 0)) & + ! call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + + if (p%aTolResistance <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolResistance ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (p%aTolShear <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolShear ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (p%aTolTwinfrac <= 0.0_pReal) & + call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') + + + + + NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase - outputFound: if (mySize > 0_pInt) then - plastic_phenopowerlaw_sizePostResult(o,instance) = mySize - plastic_phenopowerlaw_sizePostResults(instance) = plastic_phenopowerlaw_sizePostResults(instance) + mySize - endif outputFound - enddo outputsLoop !-------------------------------------------------------------------------------------------------- ! allocate state arrays - sizeState = totalNslip(instance) & ! s_slip - + totalNtwin(instance) & ! s_twin - + 2_pInt & ! sum(gamma) + sum(f) - + totalNslip(instance) & ! accshear_slip - + totalNtwin(instance) ! accshear_twin + sizeState = size(['tau_slip ','accshear_slip']) * sum(p%nslip) & + + size(['tau_twin ','accshear_twin']) * sum(p%ntwin) & + + size(['sum(gamma)', 'sum(f) ']) sizeDotState = sizeState sizeDeltaState = 0_pInt plasticState(phase)%sizeState = sizeState plasticState(phase)%sizeDotState = sizeDotState plasticState(phase)%sizeDeltaState = sizeDeltaState - plasticState(phase)%sizePostResults = plastic_phenopowerlaw_sizePostResults(instance) - plasticState(phase)%nSlip =totalNslip(instance) - plasticState(phase)%nTwin =totalNtwin(instance) - plasticState(phase)%nTrans=0_pInt + plasticState(phase)%nSlip = sum(p%Nslip) + plasticState(phase)%nTwin = sum(p%Ntwin) allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) @@ -562,26 +357,26 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plasticState(phase)%state(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) !-------------------------------------------------------------------------------------------------- -! calculate hardening matrices and extend intitial values (per family -> per system) - mySlipFamilies: do f = 1_pInt,size(param(instance)%Nslip,1) ! >>> interaction slip -- X - index_myFamily = sum(param(instance)%Nslip(1:f-1_pInt)) - - mySlipSystems: do j = 1_pInt,param(instance)%Nslip(f) - otherSlipFamilies: do o = 1_pInt,size(param(instance)%Nslip,1) - index_otherFamily = sum(param(instance)%Nslip(1:o-1_pInt)) - otherSlipSystems: do k = 1_pInt,param(instance)%Nslip(o) - interaction_SlipSlip(index_myFamily+j,index_otherFamily+k,instance) = & - param(instance)%interaction_SlipSlip(lattice_interactionSlipSlip( & +! calculate hardening matrices + mySlipFamilies: do f = 1_pInt,size(p%Nslip,1) ! >>> interaction slip -- X + index_myFamily = sum(p%Nslip(1:f-1_pInt)) + + mySlipSystems: do j = 1_pInt,p%Nslip(f) + otherSlipFamilies: do o = 1_pInt,size(p%Nslip,1) + index_otherFamily = sum(p%Nslip(1:o-1_pInt)) + otherSlipSystems: do k = 1_pInt,p%Nslip(o) + p%matrix_SlipSlip(index_myFamily+j,index_otherFamily+k) = & + p%interaction_SlipSlip(lattice_interactionSlipSlip( & sum(lattice_NslipSystem(1:f-1,phase))+j, & sum(lattice_NslipSystem(1:o-1,phase))+k, & phase)) enddo otherSlipSystems; enddo otherSlipFamilies - twinFamilies: do o = 1_pInt,size(param(instance)%Ntwin,1) - index_otherFamily = sum(param(instance)%Ntwin(1:o-1_pInt)) - twinSystems: do k = 1_pInt,param(instance)%Ntwin(o) - interaction_SlipTwin(index_myFamily+j,index_otherFamily+k,instance) = & - param(instance)%interaction_SlipTwin(lattice_interactionSlipTwin( & + twinFamilies: do o = 1_pInt,size(p%Ntwin,1) + index_otherFamily = sum(p%Ntwin(1:o-1_pInt)) + twinSystems: do k = 1_pInt,p%Ntwin(o) + p%matrix_SlipTwin(index_myFamily+j,index_otherFamily+k) = & + p%interaction_SlipTwin(lattice_interactionSlipTwin( & sum(lattice_NslipSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & phase)) @@ -589,24 +384,24 @@ subroutine plastic_phenopowerlaw_init(fileUnit) enddo mySlipSystems enddo mySlipFamilies - myTwinFamilies: do f = 1_pInt,size(param(instance)%Ntwin,1) ! >>> interaction twin -- X - index_myFamily = sum(param(instance)%Ntwin(1:f-1_pInt)) - myTwinSystems: do j = 1_pInt,param(instance)%Ntwin(f) - slipFamilies: do o = 1_pInt,size(param(instance)%Nslip,1) - index_otherFamily = sum(param(instance)%Nslip(1:o-1_pInt)) - slipSystems: do k = 1_pInt,param(instance)%Nslip(o) - interaction_TwinSlip(index_myFamily+j,index_otherFamily+k,instance) = & - param(instance)%interaction_TwinSlip(lattice_interactionTwinSlip( & + myTwinFamilies: do f = 1_pInt,size(p%Ntwin,1) ! >>> interaction twin -- X + index_myFamily = sum(p%Ntwin(1:f-1_pInt)) + myTwinSystems: do j = 1_pInt,p%Ntwin(f) + slipFamilies: do o = 1_pInt,size(p%Nslip,1) + index_otherFamily = sum(p%Nslip(1:o-1_pInt)) + slipSystems: do k = 1_pInt,p%Nslip(o) + p%matrix_TwinSlip(index_myFamily+j,index_otherFamily+k) = & + p%interaction_TwinSlip(lattice_interactionTwinSlip( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NslipSystem(1:o-1_pInt,phase))+k, & phase)) enddo slipSystems; enddo slipFamilies - otherTwinFamilies: do o = 1_pInt,size(param(instance)%Ntwin,1) - index_otherFamily = sum(param(instance)%Ntwin(1:o-1_pInt)) - otherTwinSystems: do k = 1_pInt,param(instance)%Ntwin(o) - interaction_TwinTwin(index_myFamily+j,index_otherFamily+k,instance) = & - param(instance)%interaction_TwinTwin(lattice_interactionTwinTwin( & + otherTwinFamilies: do o = 1_pInt,size(p%Ntwin,1) + index_otherFamily = sum(p%Ntwin(1:o-1_pInt)) + otherTwinSystems: do k = 1_pInt,p%Ntwin(o) + p%matrix_TwinTwin(index_myFamily+j,index_otherFamily+k) = & + p%interaction_TwinTwin(lattice_interactionTwinTwin( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & phase)) @@ -617,51 +412,51 @@ subroutine plastic_phenopowerlaw_init(fileUnit) !-------------------------------------------------------------------------------------------------- ! locally defined state aliases and initialization of state0 and aTolState startIndex = 1_pInt - endIndex = totalNslip(instance) + endIndex = plasticState(phase)%nSlip state (instance)%s_slip=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%s_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%state0(startIndex:endIndex,:) = & - spread(math_expand(param(instance)%tau0_slip, param(instance)%Nslip), 2, NipcMyPhase) + spread(math_expand(p%tau0_slip, p%Nslip), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolResistance + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolResistance startIndex = endIndex + 1_pInt - endIndex = endIndex + totalNtwin(instance) + endIndex = endIndex + plasticState(phase)%nTwin state (instance)%s_twin=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%s_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%state0(startIndex:endIndex,:) = & - spread(math_expand(param(instance)%tau0_twin, param(instance)%Ntwin), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolResistance + spread(math_expand(p%tau0_twin, p%Ntwin), 2, NipcMyPhase) + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolResistance startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumGamma=>plasticState(phase)%state (startIndex,:) dotState(instance)%sumGamma=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumF=>plasticState(phase)%state (startIndex,:) dotState(instance)%sumF=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolTwinFrac + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolTwinFrac startIndex = endIndex + 1_pInt - endIndex = endIndex + totalNslip(instance) + endIndex = endIndex + plasticState(phase)%nSlip state (instance)%accshear_slip=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%accshear_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear ! global alias plasticState(phase)%slipRate =>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%accumulatedSlip =>plasticState(phase)%state(startIndex:endIndex,:) startIndex = endIndex + 1_pInt - endIndex = endIndex + totalNtwin(instance) + endIndex = endIndex + plasticState(phase)%nTwin state (instance)%accshear_twin=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%accshear_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = param(instance)%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear - endif myPhase2 - enddo initializeInstances + endif + enddo end subroutine plastic_phenopowerlaw_init @@ -740,7 +535,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, tau_slip_neg = tau_slip_pos nonSchmid_tensor(1:3,1:3,1) = lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,1) - do k = 1,lattice_NnonSchmid(ph) + do k = 1,size(param(instance)%nonSchmidCoeff) tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,ph)) tau_slip_neg = tau_slip_neg + param(instance)%nonSchmidCoeff(k)* & @@ -842,22 +637,24 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) integer(pInt) :: & instance,ph, & f,i,j,k, & - index_myFamily, & + index_myFamily, nslip,ntwin,& of real(pReal) :: & c_SlipSlip,c_TwinSlip,c_TwinTwin, & ssat_offset, & tau_slip_pos,tau_slip_neg,tau_twin - real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & + real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Nslip) :: & gdot_slip,left_SlipSlip,left_SlipTwin,right_SlipSlip,right_TwinSlip - real(pReal), dimension(totalNtwin(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & + real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Ntwin) :: & gdot_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin of = phasememberAt(ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) + nSlip= sum(param(instance)%nslip) + nTwin= sum(param(instance)%nTwin) plasticState(ph)%dotState(:,of) = 0.0_pReal @@ -936,9 +733,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) j = j+1_pInt dotState(instance)%s_slip(j,of) = & ! evolution of slip resistance j c_SlipSlip * left_SlipSlip(j) * & - dot_product(interaction_SlipSlip(j,1:totalNslip(instance),instance), & + dot_product(param(instance)%matrix_SlipSlip(j,1:nslip), & right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - dot_product(interaction_SlipTwin(j,1:totalNtwin(instance),instance), & + dot_product(param(instance)%matrix_SlipTwin(j,1:ntwin), & right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + & abs(gdot_slip(j)) @@ -953,10 +750,10 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) j = j+1_pInt dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j c_TwinSlip * left_TwinSlip(j) * & - dot_product(interaction_TwinSlip(j,1:totalNslip(instance),instance), & + dot_product(param(instance)%matrix_TwinSlip(j,1:nslip), & right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * left_TwinTwin(j) * & - dot_product(interaction_TwinTwin(j,1:totalNtwin(instance),instance), & + dot_product(param(instance)%matrix_TwinTwin(j,1:ntwin), & right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor if (state(instance)%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 dotState(instance)%sumF(of) = dotState(instance)%sumF(of) + & @@ -994,7 +791,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) ip, & !< integration point el !< element !< microstructure state - real(pReal), dimension(plastic_phenopowerlaw_sizePostResults(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & + real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%sizePostResults) :: & plastic_phenopowerlaw_postResults integer(pInt) :: & @@ -1009,14 +806,14 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) - nSlip= totalNslip(instance) - nTwin= totalNtwin(instance) - + nSlip= sum(param(instance)%nslip) + nTwin= sum(param(instance)%nTwin) + plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt - outputsLoop: do o = 1_pInt,plastic_phenopowerlaw_Noutput(instance) - select case(plastic_phenopowerlaw_outputID(o,instance)) + outputsLoop: do o = 1_pInt,size(param(instance)%outputID) + select case(param(instance)%outputID(o)) case (resistance_slip_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%s_slip(1:nSlip,of) c = c + nSlip From a0a5d4c549e9a348f3b62e4a10506527bc282618 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 2 Jun 2018 05:38:45 +0200 Subject: [PATCH 13/42] only doing things that are required rely on default values where applicable --- src/plastic_none.f90 | 50 +++++++++++++------------------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/src/plastic_none.f90 b/src/plastic_none.f90 index 140754556..5470c4a43 100644 --- a/src/plastic_none.f90 +++ b/src/plastic_none.f90 @@ -4,16 +4,9 @@ !> @brief material subroutine for purely elastic material !-------------------------------------------------------------------------------------------------- module plastic_none - use prec, only: & - pInt implicit none private - integer(pInt), dimension(:), allocatable, public, protected :: & - plastic_none_sizePostResults - - integer(pInt), dimension(:,:), allocatable, target, public :: & - plastic_none_sizePostResult !< size of each post result output public :: & plastic_none_init @@ -31,6 +24,8 @@ subroutine plastic_none_init compiler_version, & compiler_options #endif + use prec, only: & + pInt use debug, only: & debug_level, & debug_constitutive, & @@ -51,18 +46,13 @@ subroutine plastic_none_init integer(pInt) :: & maxNinstance, & phase, & - NofMyPhase, & - sizeState, & - sizeDotState, & - sizeDeltaState + NofMyPhase write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONE_label//' init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" maxNinstance = int(count(phase_plasticity == PLASTICITY_none_ID),pInt) - if (maxNinstance == 0_pInt) return - if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & write(6,'(a16,1x,i5,/)') '# instances:',maxNinstance @@ -70,37 +60,25 @@ subroutine plastic_none_init if (phase_plasticity(phase) == PLASTICITY_none_ID) then NofMyPhase=count(material_phase==phase) - sizeState = 0_pInt - plasticState(phase)%sizeState = sizeState - sizeDotState = sizeState - plasticState(phase)%sizeDotState = sizeDotState - sizeDeltaState = 0_pInt - plasticState(phase)%sizeDeltaState = sizeDeltaState - plasticState(phase)%sizePostResults = 0_pInt - plasticState(phase)%nSlip = 0_pInt - plasticState(phase)%nTwin = 0_pInt - plasticState(phase)%nTrans = 0_pInt - allocate(plasticState(phase)%aTolState (sizeState)) - allocate(plasticState(phase)%state0 (sizeState,NofMyPhase)) - allocate(plasticState(phase)%partionedState0 (sizeState,NofMyPhase)) - allocate(plasticState(phase)%subState0 (sizeState,NofMyPhase)) - allocate(plasticState(phase)%state (sizeState,NofMyPhase)) + allocate(plasticState(phase)%aTolState (0_pInt)) + allocate(plasticState(phase)%state0 (0_pInt,NofMyPhase)) + allocate(plasticState(phase)%partionedState0 (0_pInt,NofMyPhase)) + allocate(plasticState(phase)%subState0 (0_pInt,NofMyPhase)) + allocate(plasticState(phase)%state (0_pInt,NofMyPhase)) - allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase)) - allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase)) + allocate(plasticState(phase)%dotState (0_pInt,NofMyPhase)) + allocate(plasticState(phase)%deltaState (0_pInt,NofMyPhase)) if (any(numerics_integrator == 1_pInt)) then - allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase)) - allocate(plasticState(phase)%previousDotState2(sizeDotState,NofMyPhase)) + allocate(plasticState(phase)%previousDotState (0_pInt,NofMyPhase)) + allocate(plasticState(phase)%previousDotState2(0_pInt,NofMyPhase)) endif if (any(numerics_integrator == 4_pInt)) & - allocate(plasticState(phase)%RK4dotState (sizeDotState,NofMyPhase)) + allocate(plasticState(phase)%RK4dotState (0_pInt,NofMyPhase)) if (any(numerics_integrator == 5_pInt)) & - allocate(plasticState(phase)%RKCK45dotState (6,sizeDotState,NofMyPhase)) + allocate(plasticState(phase)%RKCK45dotState (6,0_pInt,NofMyPhase)) endif enddo initializeInstances - allocate(plastic_none_sizePostResults(maxNinstance), source=0_pInt) - end subroutine plastic_none_init end module plastic_none From 29a0ec280083e8eb4fe6f97bf38631be301108cf Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 2 Jun 2018 05:39:40 +0200 Subject: [PATCH 14/42] polishing --- src/plastic_phenopowerlaw.f90 | 118 ++++++++++++++++------------------ 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 3cc03ef1e..a06a31a88 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -118,18 +118,9 @@ subroutine plastic_phenopowerlaw_init math_Voigt66to3333, & math_expand use IO, only: & - IO_read, & - IO_lc, & - IO_getTag, & - IO_isBlank, & - IO_stringPos, & - IO_stringValue, & - IO_floatValue, & - IO_intValue, & IO_warning, & IO_error, & - IO_timeStamp, & - IO_EOF + IO_timeStamp use material, only: & phase_plasticity, & phase_plasticityInstance, & @@ -152,17 +143,18 @@ subroutine plastic_phenopowerlaw_init instance,phase,j,k, f,o, i,& NipcMyPhase, outputSize, & offset_slip, index_myFamily, index_otherFamily, & - sizeState,sizeDotState, sizeDeltaState, & + sizeState,sizeDotState, & startIndex, endIndex + integer(pInt), dimension(0), parameter :: emptyInt = [integer(pInt)::] - real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] + real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] type(tParameters), pointer :: p integer(kind(undefined_ID)) :: & outputID !< ID of each post result output - character(len=65536) :: & + character(len=512) :: & extmsg = '' character(len=64), dimension(:), allocatable :: outputs @@ -190,18 +182,18 @@ subroutine plastic_phenopowerlaw_init p%Nslip = phaseConfig(phase)%getIntArray('nslip',defaultVal=emptyInt) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) if (sum(p%Nslip) > 0_pInt) then - p%tau0_slip = phaseConfig(phase)%getFloatArray('tau0_slip') - p%tausat_slip = phaseConfig(phase)%getFloatArray('tausat_slip') - p%H_int = phaseConfig(phase)%getFloatArray('h_int',defaultVal=[(0.0_pReal,i=1_pInt,size(p%Nslip))]) - print*, (shape(p%H_int)) - print*, (shape(p%Nslip)) + p%tau0_slip = phaseConfig(phase)%getFloatArray('tau0_slip') + p%tausat_slip = phaseConfig(phase)%getFloatArray('tausat_slip') p%interaction_SlipSlip = phaseConfig(phase)%getFloatArray('interaction_slipslip') + p%H_int = phaseConfig(phase)%getFloatArray('h_int',& + defaultVal=[(0.0_pReal,i=1_pInt,size(p%Nslip))]) p%nonSchmidCoeff = phaseConfig(phase)%getFloatArray('nonschmid_coefficients',& - defaultVal = [real(pReal)::1] ) - p%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') - p%n_slip = phaseConfig(phase)%getFloat('n_slip') - p%a_slip = phaseConfig(phase)%getFloat('a_slip') - p%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') + defaultVal = [real(pReal)::1] ) + + p%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') + p%n_slip = phaseConfig(phase)%getFloat('n_slip') + p%a_slip = phaseConfig(phase)%getFloat('a_slip') + p%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') endif p%Ntwin = phaseConfig(phase)%getIntArray('ntwin', defaultVal=emptyInt) @@ -209,15 +201,17 @@ subroutine plastic_phenopowerlaw_init if (sum(p%Ntwin) > 0_pInt) then p%tau0_twin = phaseConfig(phase)%getFloatArray('tau0_twin') p%interaction_TwinTwin = phaseConfig(phase)%getFloatArray('interaction_twintwin') - p%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') - p%n_twin = phaseConfig(phase)%getFloat('n_twin') - p%spr = phaseConfig(phase)%getFloat('s_pr') - p%twinB = phaseConfig(phase)%getFloat('twin_b') - p%twinC = phaseConfig(phase)%getFloat('twin_c') - p%twinD = phaseConfig(phase)%getFloat('twin_d') - p%twinE = phaseConfig(phase)%getFloat('twin_e') - p%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') - endif + + p%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') + p%n_twin = phaseConfig(phase)%getFloat('n_twin') + p%spr = phaseConfig(phase)%getFloat('s_pr') + p%twinB = phaseConfig(phase)%getFloat('twin_b') + p%twinC = phaseConfig(phase)%getFloat('twin_c') + p%twinD = phaseConfig(phase)%getFloat('twin_d') + p%twinE = phaseConfig(phase)%getFloat('twin_e') + p%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') + endif + if (sum(p%Nslip) > 0_pInt .and. sum(p%Ntwin) > 0_pInt) then p%interaction_SlipTwin = phaseConfig(phase)%getFloatArray('interaction_sliptwin') p%interaction_TwinSlip = phaseConfig(phase)%getFloatArray('interaction_twinslip') @@ -228,9 +222,11 @@ subroutine plastic_phenopowerlaw_init allocate(p%matrix_SlipTwin(sum(p%Nslip),sum(p%Ntwin)),source =0.0_pReal) allocate(p%matrix_TwinSlip(sum(p%Ntwin),sum(p%Nslip)),source =0.0_pReal) allocate(p%matrix_TwinTwin(sum(p%Ntwin),sum(p%Ntwin)),source =0.0_pReal) - p%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) - p%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) - p%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + + p%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) + p%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + p%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + outputs = phaseConfig(phase)%getStrings('(output)') allocate(p%outputID(0)) do i=1_pInt, size(outputs) @@ -280,21 +276,21 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! parameters independent of number of slip/twin systems -extmsg = '' -if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " -if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " -if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " -if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " - if (extmsg /= '') call IO_error(211_pInt,ip=instance,& - ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') - -if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tau0_slip' " -if (any(p%tau0_slip < p%tausat_slip .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tausat_slip' " -if (any(p%gdot0_slip <= 0.0_pReal .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tausat_slip' " -if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " + extmsg = '' + if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " + if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " + if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " + if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " + if (extmsg /= '') call IO_error(211_pInt,ip=instance,& + ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') + + if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tau0_slip' " + if (any(p%tau0_slip < p%tausat_slip .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tausat_slip' " + if (any(p%gdot0_slip <= 0.0_pReal .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tausat_slip' " + if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " !if (any(dEq0(p%a_slip) .and. sum(p%Nslip) > 0)) & ! call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') @@ -317,21 +313,16 @@ if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') - - - NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase - !-------------------------------------------------------------------------------------------------- ! allocate state arrays + NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase sizeState = size(['tau_slip ','accshear_slip']) * sum(p%nslip) & + size(['tau_twin ','accshear_twin']) * sum(p%ntwin) & + size(['sum(gamma)', 'sum(f) ']) sizeDotState = sizeState - sizeDeltaState = 0_pInt plasticState(phase)%sizeState = sizeState plasticState(phase)%sizeDotState = sizeDotState - plasticState(phase)%sizeDeltaState = sizeDeltaState plasticState(phase)%nSlip = sum(p%Nslip) plasticState(phase)%nTwin = sum(p%Ntwin) allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) @@ -339,8 +330,9 @@ if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " allocate(plasticState(phase)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%subState0 ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%state ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%deltaState (sizeDeltaState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%deltaState (0_pInt,NipcMyPhase), source=0.0_pReal) if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) @@ -350,12 +342,6 @@ if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " if (any(numerics_integrator == 5_pInt)) & allocate(plasticState(phase)%RKCK45dotState (6,sizeDotState,NipcMyPhase), source=0.0_pReal) - offset_slip = plasticState(phase)%nSlip+plasticState(phase)%nTwin+2_pInt - plasticState(phase)%slipRate => & - plasticState(phase)%dotState(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) - plasticState(phase)%accumulatedSlip => & - plasticState(phase)%state(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) - !-------------------------------------------------------------------------------------------------- ! calculate hardening matrices mySlipFamilies: do f = 1_pInt,size(p%Nslip,1) ! >>> interaction slip -- X @@ -455,6 +441,12 @@ if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " dotState(instance)%accshear_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear + offset_slip = plasticState(phase)%nSlip+plasticState(phase)%nTwin+2_pInt + plasticState(phase)%slipRate => & + plasticState(phase)%dotState(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) + plasticState(phase)%accumulatedSlip => & + plasticState(phase)%state(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) + endif enddo From 11383a2aca5005e082287a52d420835f91e8602c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 2 Jun 2018 10:19:22 +0200 Subject: [PATCH 15/42] proper error checks --- src/plastic_phenopowerlaw.f90 | 67 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index a06a31a88..156fe29d0 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -272,46 +272,40 @@ subroutine plastic_phenopowerlaw_init p%outputID = [p%outputID , outputID] endif - end do + end do -!-------------------------------------------------------------------------------------------------- -! parameters independent of number of slip/twin systems - extmsg = '' - if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " - if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " - if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " - if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " - if (extmsg /= '') call IO_error(211_pInt,ip=instance,& - ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') - - if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tau0_slip' " - if (any(p%tau0_slip < p%tausat_slip .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tausat_slip' " - if (any(p%gdot0_slip <= 0.0_pReal .and. p%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tausat_slip' " - if (p%n_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'n_slip' " + extmsg = '' + if (sum(p%Nslip) > 0_pInt) then + if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " + if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " + if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " - !if (any(dEq0(p%a_slip) .and. sum(p%Nslip) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tau0_slip' " + if (any(p%tausat_slip < p%tau0_slip .and. p%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//" 'tausat_slip' " - ! if (any(p%tau0_twin < 0.0_pReal .and. & - ! p%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='tau0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - ! if ( p%gdot0_twin <= 0.0_pReal .and. & - ! any(p%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') - ! if ( p%n_twin <= 0.0_pReal .and. & - ! any(p%Ntwin(:) > 0)) & - ! call IO_error(211_pInt,el=instance,ext_msg='n_twin ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (p%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_slip' " + if (dEq0(p%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? + if (dEq0(p%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? + endif - if (p%aTolResistance <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolResistance ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (p%aTolShear <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolShear ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (p%aTolTwinfrac <= 0.0_pReal) & - call IO_error(211_pInt,el=instance,ext_msg='aTolTwinfrac ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (sum(p%Ntwin) > 0_pInt) then + if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " + if (any(p%tau0_twin < 0.0_pReal .and. p%Ntwin > 0_pInt)) & + extmsg = trim(extmsg)//" 'tau0_twin' " + + if (p%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_twin' " + if (dEq0(p%n_twin)) extmsg = trim(extmsg)//" n_twin " ! ToDo: negative values ok? + endif + + if (p%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolresistance' " + if (p%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolShear' " + if (p%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//" 'atoltwinfrac' " + + if (extmsg /= '') call IO_error(211_pInt,ip=instance,& + ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') !-------------------------------------------------------------------------------------------------- ! allocate state arrays @@ -471,8 +465,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, lattice_maxNslipFamily, & lattice_maxNtwinFamily, & lattice_NslipSystem, & - lattice_NtwinSystem, & - lattice_NnonSchmid + lattice_NtwinSystem use material, only: & phaseAt, phasememberAt, & phase_plasticityInstance From 13f280367e65027ef6fce4058741132a0b4b39d8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 19 Jun 2018 19:43:41 +0200 Subject: [PATCH 16/42] using config module --- src/linked_list.f90 | 2 +- src/plastic_phenopowerlaw.f90 | 207 +++++++++++++++++----------------- 2 files changed, 105 insertions(+), 104 deletions(-) diff --git a/src/linked_list.f90 b/src/linked_list.f90 index 6826a26da..142528fa1 100644 --- a/src/linked_list.f90 +++ b/src/linked_list.f90 @@ -431,7 +431,7 @@ function getFloats(this,key,defaultVal) real(pReal), dimension(:), allocatable :: getFloats class(tPartitionedStringList), intent(in) :: this character(len=*), intent(in) :: key - integer(pInt), dimension(:), intent(in), optional :: defaultVal + real(pReal), dimension(:), intent(in), optional :: defaultVal type(tPartitionedStringList), pointer :: item integer(pInt) :: i logical :: found, & diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 7800feb22..b5ddcc187 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -130,7 +130,8 @@ subroutine plastic_phenopowerlaw_init material_phase, & plasticState use config, only: & - MATERIAL_partPhase + MATERIAL_partPhase, & + phaseConfig use lattice use numerics,only: & numerics_integrator @@ -148,7 +149,7 @@ subroutine plastic_phenopowerlaw_init integer(pInt), dimension(0), parameter :: emptyInt = [integer(pInt)::] real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] - type(tParameters), pointer :: p + type(tParameters), pointer :: prm integer(kind(undefined_ID)) :: & outputID !< ID of each post result output @@ -176,86 +177,86 @@ subroutine plastic_phenopowerlaw_init do phase = 1_pInt, size(phase_plasticityInstance) if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then instance = phase_plasticityInstance(phase) - p => param(instance) + prm => param(instance) - p%Nslip = phaseConfig(phase)%getIntArray('nslip',defaultVal=emptyInt) + prm%Nslip = phaseConfig(phase)%getInts('nslip',defaultVal=emptyInt) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - if (sum(p%Nslip) > 0_pInt) then - p%tau0_slip = phaseConfig(phase)%getFloatArray('tau0_slip') - p%tausat_slip = phaseConfig(phase)%getFloatArray('tausat_slip') - p%interaction_SlipSlip = phaseConfig(phase)%getFloatArray('interaction_slipslip') - p%H_int = phaseConfig(phase)%getFloatArray('h_int',& - defaultVal=[(0.0_pReal,i=1_pInt,size(p%Nslip))]) - p%nonSchmidCoeff = phaseConfig(phase)%getFloatArray('nonschmid_coefficients',& + if (sum(prm%Nslip) > 0_pInt) then + prm%tau0_slip = phaseConfig(phase)%getFloats('tau0_slip') + prm%tausat_slip = phaseConfig(phase)%getFloats('tausat_slip') + prm%interaction_SlipSlip = phaseConfig(phase)%getFloats('interaction_slipslip') + prm%H_int = phaseConfig(phase)%getFloats('h_int',& + defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) + prm%nonSchmidCoeff = phaseConfig(phase)%getFloats('nonschmid_coefficients',& defaultVal = [real(pReal)::1] ) - p%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') - p%n_slip = phaseConfig(phase)%getFloat('n_slip') - p%a_slip = phaseConfig(phase)%getFloat('a_slip') - p%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') + prm%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') + prm%n_slip = phaseConfig(phase)%getFloat('n_slip') + prm%a_slip = phaseConfig(phase)%getFloat('a_slip') + prm%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') endif - p%Ntwin = phaseConfig(phase)%getIntArray('ntwin', defaultVal=emptyInt) + prm%Ntwin = phaseConfig(phase)%getInts('ntwin', defaultVal=emptyInt) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - if (sum(p%Ntwin) > 0_pInt) then - p%tau0_twin = phaseConfig(phase)%getFloatArray('tau0_twin') - p%interaction_TwinTwin = phaseConfig(phase)%getFloatArray('interaction_twintwin') + if (sum(prm%Ntwin) > 0_pInt) then + prm%tau0_twin = phaseConfig(phase)%getFloats('tau0_twin') + prm%interaction_TwinTwin = phaseConfig(phase)%getFloats('interaction_twintwin') - p%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') - p%n_twin = phaseConfig(phase)%getFloat('n_twin') - p%spr = phaseConfig(phase)%getFloat('s_pr') - p%twinB = phaseConfig(phase)%getFloat('twin_b') - p%twinC = phaseConfig(phase)%getFloat('twin_c') - p%twinD = phaseConfig(phase)%getFloat('twin_d') - p%twinE = phaseConfig(phase)%getFloat('twin_e') - p%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') + prm%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') + prm%n_twin = phaseConfig(phase)%getFloat('n_twin') + prm%spr = phaseConfig(phase)%getFloat('s_pr') + prm%twinB = phaseConfig(phase)%getFloat('twin_b') + prm%twinC = phaseConfig(phase)%getFloat('twin_c') + prm%twinD = phaseConfig(phase)%getFloat('twin_d') + prm%twinE = phaseConfig(phase)%getFloat('twin_e') + prm%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') endif - if (sum(p%Nslip) > 0_pInt .and. sum(p%Ntwin) > 0_pInt) then - p%interaction_SlipTwin = phaseConfig(phase)%getFloatArray('interaction_sliptwin') - p%interaction_TwinSlip = phaseConfig(phase)%getFloatArray('interaction_twinslip') - p%h0_TwinSlip = phaseConfig(phase)%getFloat('h0_twinslip') + if (sum(prm%Nslip) > 0_pInt .and. sum(prm%Ntwin) > 0_pInt) then + prm%interaction_SlipTwin = phaseConfig(phase)%getFloats('interaction_sliptwin') + prm%interaction_TwinSlip = phaseConfig(phase)%getFloats('interaction_twinslip') + prm%h0_TwinSlip = phaseConfig(phase)%getFloat('h0_twinslip') endif - allocate(p%matrix_SlipSlip(sum(p%Nslip),sum(p%Nslip)),source =0.0_pReal) - allocate(p%matrix_SlipTwin(sum(p%Nslip),sum(p%Ntwin)),source =0.0_pReal) - allocate(p%matrix_TwinSlip(sum(p%Ntwin),sum(p%Nslip)),source =0.0_pReal) - allocate(p%matrix_TwinTwin(sum(p%Ntwin),sum(p%Ntwin)),source =0.0_pReal) + allocate(prm%matrix_SlipSlip(sum(prm%Nslip),sum(prm%Nslip)),source =0.0_pReal) + allocate(prm%matrix_SlipTwin(sum(prm%Nslip),sum(prm%Ntwin)),source =0.0_pReal) + allocate(prm%matrix_TwinSlip(sum(prm%Ntwin),sum(prm%Nslip)),source =0.0_pReal) + allocate(prm%matrix_TwinTwin(sum(prm%Ntwin),sum(prm%Ntwin)),source =0.0_pReal) - p%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) - p%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) - p%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + prm%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) + prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + prm%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) outputs = phaseConfig(phase)%getStrings('(output)') - allocate(p%outputID(0)) + allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID select case(outputs(i)) case ('resistance_slip') outputID = resistance_slip_ID - outputSize = sum(p%Nslip) + outputSize = sum(prm%Nslip) case ('acumulatedshear_slip','accumulated_shear_slip') outputID = accumulatedshear_slip_ID - outputSize = sum(p%Nslip) + outputSize = sum(prm%Nslip) case ('shearrate_slip') outputID = shearrate_slip_ID - outputSize = sum(p%Nslip) + outputSize = sum(prm%Nslip) case ('resolvedstress_slip') outputID = resolvedstress_slip_ID - outputSize = sum(p%Nslip) + outputSize = sum(prm%Nslip) case ('resistance_twin') outputID = resistance_twin_ID - outputSize = sum(p%Ntwin) + outputSize = sum(prm%Ntwin) case ('accumulatedshear_twin','accumulated_shear_twin') outputID = accumulatedshear_twin_ID - outputSize = sum(p%Ntwin) + outputSize = sum(prm%Ntwin) case ('shearrate_twin') outputID = shearrate_twin_ID - outputSize = sum(p%Ntwin) + outputSize = sum(prm%Ntwin) case ('resolvedstress_twin') outputID = resolvedstress_twin_ID - outputSize = sum(p%Ntwin) + outputSize = sum(prm%Ntwin) case ('totalvolfrac_twin') outputID = totalvolfrac_twin_ID @@ -268,40 +269,40 @@ subroutine plastic_phenopowerlaw_init if (outputID /= undefined_ID) then plastic_phenopowerlaw_output(i,instance) = outputs(i) plastic_phenopowerlaw_sizePostResult(i,instance) = outputSize - p%outputID = [p%outputID , outputID] + prm%outputID = [prm%outputID , outputID] endif end do extmsg = '' - if (sum(p%Nslip) > 0_pInt) then - if (size(p%tau0_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " - if (size(p%tausat_slip) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " - if (size(p%H_int) /= size(p%nslip)) extmsg = trim(extmsg)//" shape(h_int) " + if (sum(prm%Nslip) > 0_pInt) then + if (size(prm%tau0_slip) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " + if (size(prm%tausat_slip) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " + if (size(prm%H_int) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(h_int) " - if (any(p%tau0_slip < 0.0_pReal .and. p%Nslip > 0_pInt)) & + if (any(prm%tau0_slip < 0.0_pReal .and. prm%Nslip > 0_pInt)) & extmsg = trim(extmsg)//" 'tau0_slip' " - if (any(p%tausat_slip < p%tau0_slip .and. p%Nslip > 0_pInt)) & + if (any(prm%tausat_slip < prm%tau0_slip .and. prm%Nslip > 0_pInt)) & extmsg = trim(extmsg)//" 'tausat_slip' " - if (p%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_slip' " - if (dEq0(p%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? - if (dEq0(p%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? + if (prm%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_slip' " + if (dEq0(prm%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? + if (dEq0(prm%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? endif - if (sum(p%Ntwin) > 0_pInt) then - if (size(p%tau0_twin) /= size(p%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " + if (sum(prm%Ntwin) > 0_pInt) then + if (size(prm%tau0_twin) /= size(prm%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " - if (any(p%tau0_twin < 0.0_pReal .and. p%Ntwin > 0_pInt)) & + if (any(prm%tau0_twin < 0.0_pReal .and. prm%Ntwin > 0_pInt)) & extmsg = trim(extmsg)//" 'tau0_twin' " - if (p%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_twin' " - if (dEq0(p%n_twin)) extmsg = trim(extmsg)//" n_twin " ! ToDo: negative values ok? + if (prm%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_twin' " + if (dEq0(prm%n_twin)) extmsg = trim(extmsg)//" n_twin " ! ToDo: negative values ok? endif - if (p%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolresistance' " - if (p%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolShear' " - if (p%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//" 'atoltwinfrac' " + if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolresistance' " + if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolShear' " + if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//" 'atoltwinfrac' " if (extmsg /= '') call IO_error(211_pInt,ip=instance,& ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') @@ -309,15 +310,15 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase - sizeState = size(['tau_slip ','accshear_slip']) * sum(p%nslip) & - + size(['tau_twin ','accshear_twin']) * sum(p%ntwin) & + sizeState = size(['tau_slip ','accshear_slip']) * sum(prm%nslip) & + + size(['tau_twin ','accshear_twin']) * sum(prm%ntwin) & + size(['sum(gamma)', 'sum(f) ']) sizeDotState = sizeState plasticState(phase)%sizeState = sizeState plasticState(phase)%sizeDotState = sizeDotState - plasticState(phase)%nSlip = sum(p%Nslip) - plasticState(phase)%nTwin = sum(p%Ntwin) + plasticState(phase)%nSlip = sum(prm%Nslip) + plasticState(phase)%nTwin = sum(prm%Ntwin) allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) @@ -337,25 +338,25 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! calculate hardening matrices - mySlipFamilies: do f = 1_pInt,size(p%Nslip,1) ! >>> interaction slip -- X - index_myFamily = sum(p%Nslip(1:f-1_pInt)) + mySlipFamilies: do f = 1_pInt,size(prm%Nslip,1) ! >>> interaction slip -- X + index_myFamily = sum(prm%Nslip(1:f-1_pInt)) - mySlipSystems: do j = 1_pInt,p%Nslip(f) - otherSlipFamilies: do o = 1_pInt,size(p%Nslip,1) - index_otherFamily = sum(p%Nslip(1:o-1_pInt)) - otherSlipSystems: do k = 1_pInt,p%Nslip(o) - p%matrix_SlipSlip(index_myFamily+j,index_otherFamily+k) = & - p%interaction_SlipSlip(lattice_interactionSlipSlip( & + mySlipSystems: do j = 1_pInt,prm%Nslip(f) + otherSlipFamilies: do o = 1_pInt,size(prm%Nslip,1) + index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) + otherSlipSystems: do k = 1_pInt,prm%Nslip(o) + prm%matrix_SlipSlip(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_SlipSlip(lattice_interactionSlipSlip( & sum(lattice_NslipSystem(1:f-1,phase))+j, & sum(lattice_NslipSystem(1:o-1,phase))+k, & phase)) enddo otherSlipSystems; enddo otherSlipFamilies - twinFamilies: do o = 1_pInt,size(p%Ntwin,1) - index_otherFamily = sum(p%Ntwin(1:o-1_pInt)) - twinSystems: do k = 1_pInt,p%Ntwin(o) - p%matrix_SlipTwin(index_myFamily+j,index_otherFamily+k) = & - p%interaction_SlipTwin(lattice_interactionSlipTwin( & + twinFamilies: do o = 1_pInt,size(prm%Ntwin,1) + index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) + twinSystems: do k = 1_pInt,prm%Ntwin(o) + prm%matrix_SlipTwin(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_SlipTwin(lattice_interactionSlipTwin( & sum(lattice_NslipSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & phase)) @@ -363,24 +364,24 @@ subroutine plastic_phenopowerlaw_init enddo mySlipSystems enddo mySlipFamilies - myTwinFamilies: do f = 1_pInt,size(p%Ntwin,1) ! >>> interaction twin -- X - index_myFamily = sum(p%Ntwin(1:f-1_pInt)) - myTwinSystems: do j = 1_pInt,p%Ntwin(f) - slipFamilies: do o = 1_pInt,size(p%Nslip,1) - index_otherFamily = sum(p%Nslip(1:o-1_pInt)) - slipSystems: do k = 1_pInt,p%Nslip(o) - p%matrix_TwinSlip(index_myFamily+j,index_otherFamily+k) = & - p%interaction_TwinSlip(lattice_interactionTwinSlip( & + myTwinFamilies: do f = 1_pInt,size(prm%Ntwin,1) ! >>> interaction twin -- X + index_myFamily = sum(prm%Ntwin(1:f-1_pInt)) + myTwinSystems: do j = 1_pInt,prm%Ntwin(f) + slipFamilies: do o = 1_pInt,size(prm%Nslip,1) + index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) + slipSystems: do k = 1_pInt,prm%Nslip(o) + prm%matrix_TwinSlip(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_TwinSlip(lattice_interactionTwinSlip( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NslipSystem(1:o-1_pInt,phase))+k, & phase)) enddo slipSystems; enddo slipFamilies - otherTwinFamilies: do o = 1_pInt,size(p%Ntwin,1) - index_otherFamily = sum(p%Ntwin(1:o-1_pInt)) - otherTwinSystems: do k = 1_pInt,p%Ntwin(o) - p%matrix_TwinTwin(index_myFamily+j,index_otherFamily+k) = & - p%interaction_TwinTwin(lattice_interactionTwinTwin( & + otherTwinFamilies: do o = 1_pInt,size(prm%Ntwin,1) + index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) + otherTwinSystems: do k = 1_pInt,prm%Ntwin(o) + prm%matrix_TwinTwin(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_TwinTwin(lattice_interactionTwinTwin( & sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & phase)) @@ -395,35 +396,35 @@ subroutine plastic_phenopowerlaw_init state (instance)%s_slip=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%s_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%state0(startIndex:endIndex,:) = & - spread(math_expand(p%tau0_slip, p%Nslip), 2, NipcMyPhase) + spread(math_expand(prm%tau0_slip, prm%Nslip), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolResistance + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolResistance startIndex = endIndex + 1_pInt endIndex = endIndex + plasticState(phase)%nTwin state (instance)%s_twin=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%s_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%state0(startIndex:endIndex,:) = & - spread(math_expand(p%tau0_twin, p%Ntwin), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolResistance + spread(math_expand(prm%tau0_twin, prm%Ntwin), 2, NipcMyPhase) + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolResistance startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumGamma=>plasticState(phase)%state (startIndex,:) dotState(instance)%sumGamma=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt state (instance)%sumF=>plasticState(phase)%state (startIndex,:) dotState(instance)%sumF=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolTwinFrac + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolTwinFrac startIndex = endIndex + 1_pInt endIndex = endIndex + plasticState(phase)%nSlip state (instance)%accshear_slip=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%accshear_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear ! global alias plasticState(phase)%slipRate =>plasticState(phase)%dotState(startIndex:endIndex,:) plasticState(phase)%accumulatedSlip =>plasticState(phase)%state(startIndex:endIndex,:) @@ -432,7 +433,7 @@ subroutine plastic_phenopowerlaw_init endIndex = endIndex + plasticState(phase)%nTwin state (instance)%accshear_twin=>plasticState(phase)%state (startIndex:endIndex,:) dotState(instance)%accshear_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = p%aTolShear + plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear offset_slip = plasticState(phase)%nSlip+plasticState(phase)%nTwin+2_pInt plasticState(phase)%slipRate => & From 7ccca899c6ad4813fc8062e5675de5f71d8d5eb9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 19 Jun 2018 23:36:46 +0200 Subject: [PATCH 17/42] using branch 19 counterpart in PRIVATE to adjust parameter names --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index aead92902..89246b5ee 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit aead92902b3a0cf3404be9c552bfec918d7aaffb +Subproject commit 89246b5ee30a850a52df020c4770b685568ccbc2 From 0f3485c4a124e34ad3c869770f2214f0deeceae6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 21 Jun 2018 23:14:30 +0200 Subject: [PATCH 18/42] using default value for when getting strings, setting correct size for post results --- src/plastic_phenopowerlaw.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index b5ddcc187..79aac355e 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -1,5 +1,6 @@ !> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH +!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief material subroutine for phenomenological crystal plasticity formulation using a powerlaw !! fitting !-------------------------------------------------------------------------------------------------- @@ -227,7 +228,7 @@ subroutine plastic_phenopowerlaw_init prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) prm%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) - outputs = phaseConfig(phase)%getStrings('(output)') + outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=[character(len=65536)::]) allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID @@ -317,6 +318,7 @@ subroutine plastic_phenopowerlaw_init sizeDotState = sizeState plasticState(phase)%sizeState = sizeState plasticState(phase)%sizeDotState = sizeDotState + plasticState(phase)%sizePostResults = sum(plastic_phenopowerlaw_sizePostResult(:,instance)) plasticState(phase)%nSlip = sum(prm%Nslip) plasticState(phase)%nTwin = sum(prm%Ntwin) allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) From 74aec7bb71ec831ab02d3074376ac4369b4ab242 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 22 Jun 2018 18:14:14 +0200 Subject: [PATCH 19/42] circumventing bug in Gfortran, tests use correct label (a_slip) --- PRIVATE | 2 +- src/plastic_phenopowerlaw.f90 | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PRIVATE b/PRIVATE index 89246b5ee..99433c5ca 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 89246b5ee30a850a52df020c4770b685568ccbc2 +Subproject commit 99433c5cadc8d568b94282834ce80ffc960fbed8 diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 79aac355e..4ee6cb3c9 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -157,7 +157,7 @@ subroutine plastic_phenopowerlaw_init character(len=512) :: & extmsg = '' - character(len=64), dimension(:), allocatable :: outputs + character(len=65536), dimension(:), allocatable :: outputs write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() @@ -228,7 +228,13 @@ subroutine plastic_phenopowerlaw_init prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) prm%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) +#if defined(__GFORTRAN__) + outputs = ['GfortranBug86277'] + outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=outputs) + if (outputs(1) == 'GfortranBug86277') outputs = [character(len=65536)::] +#else outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=[character(len=65536)::]) +#endif allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID From bd09bd91f911b1df3485b4dc4804db2b5e2f4049 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 23 Jun 2018 14:48:32 +0200 Subject: [PATCH 20/42] exit immediately if array size does not match Nslip/Ntwin otherwise, array acces out of bounds might happen for subsequent sanity checks --- src/plastic_phenopowerlaw.f90 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 4ee6cb3c9..6979187ed 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -283,33 +283,37 @@ subroutine plastic_phenopowerlaw_init extmsg = '' if (sum(prm%Nslip) > 0_pInt) then - if (size(prm%tau0_slip) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(tau0_slip) " - if (size(prm%tausat_slip) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(tausat_slip) " - if (size(prm%H_int) /= size(prm%nslip)) extmsg = trim(extmsg)//" shape(h_int) " + if (size(prm%tau0_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(tau0_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (size(prm%tausat_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(tausat_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (size(prm%H_int) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(H_int) ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(prm%tau0_slip < 0.0_pReal .and. prm%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tau0_slip' " + extmsg = trim(extmsg)//"tau0_slip " if (any(prm%tausat_slip < prm%tau0_slip .and. prm%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//" 'tausat_slip' " + extmsg = trim(extmsg)//"tausat_slip " - if (prm%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_slip' " + if (prm%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" gdot0_slip " if (dEq0(prm%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? if (dEq0(prm%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? endif if (sum(prm%Ntwin) > 0_pInt) then - if (size(prm%tau0_twin) /= size(prm%ntwin)) extmsg = trim(extmsg)//" shape(tau0_twin) " + if (size(prm%tau0_twin) /= size(prm%ntwin)) call IO_error(211_pInt,ip=instance,& + ext_msg='shape(tau0_twin) ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(prm%tau0_twin < 0.0_pReal .and. prm%Ntwin > 0_pInt)) & - extmsg = trim(extmsg)//" 'tau0_twin' " + extmsg = trim(extmsg)//"tau0_twin " - if (prm%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//" 'gdot0_twin' " - if (dEq0(prm%n_twin)) extmsg = trim(extmsg)//" n_twin " ! ToDo: negative values ok? + if (prm%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//"gdot0_twin " + if (dEq0(prm%n_twin)) extmsg = trim(extmsg)//"n_twin " ! ToDo: negative values ok? endif - if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolresistance' " - if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//" 'aTolShear' " - if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//" 'atoltwinfrac' " + if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//"aTolresistance " + if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//"aTolShear " + if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//"atoltwinfrac " if (extmsg /= '') call IO_error(211_pInt,ip=instance,& ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') From d484d1b5bb919f8d58ec300f1c82e9398b7f439f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jun 2018 10:33:22 +0200 Subject: [PATCH 21/42] fixed typo and removed alias --- src/plastic_phenopowerlaw.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 6979187ed..d888e6c09 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -242,7 +242,7 @@ subroutine plastic_phenopowerlaw_init case ('resistance_slip') outputID = resistance_slip_ID outputSize = sum(prm%Nslip) - case ('acumulatedshear_slip','accumulated_shear_slip') + case ('accumulatedshear_slip') outputID = accumulatedshear_slip_ID outputSize = sum(prm%Nslip) case ('shearrate_slip') @@ -255,7 +255,7 @@ subroutine plastic_phenopowerlaw_init case ('resistance_twin') outputID = resistance_twin_ID outputSize = sum(prm%Ntwin) - case ('accumulatedshear_twin','accumulated_shear_twin') + case ('accumulatedshear_twin') outputID = accumulatedshear_twin_ID outputSize = sum(prm%Ntwin) case ('shearrate_twin') From feb69782556b8e963445fdd05dfb5a94e8ec07bd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jun 2018 10:33:36 +0200 Subject: [PATCH 22/42] test was broken --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 99433c5ca..c9eed7180 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 99433c5cadc8d568b94282834ce80ffc960fbed8 +Subproject commit c9eed718041d098d7695871c1b123eae950b141d From f63e8fe34ecd88c72c9bc2d1b3e7d6cb258cf6e5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jun 2018 13:43:34 +0200 Subject: [PATCH 23/42] avoid specifying per-family-values for inactive families --- PRIVATE | 2 +- lib/damask/config/material.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index c9eed7180..d8ab8056d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit c9eed718041d098d7695871c1b123eae950b141d +Subproject commit d8ab8056d6245ce42bec8953de9af1d7754867cf diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index a56c5d976..b070e986f 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -267,3 +267,14 @@ class Material(): if newlen is not oldlen: print('Length of value was changed from %i to %i!'%(oldlen,newlen)) + def add_value(self, part=None, + section=None, + key=None, + value=None): + if not isinstance(value,list): + if not isinstance(value,str): + value = '%s'%value + value = [value] + print('adding %s:%s:%s with value %s '%(part.lower(),section.lower(),key.lower(),value)) + self.data[part.lower()][section.lower()][key.lower()] = value + self.data[part.lower()][section.lower()]['__order__'] += [key.lower()] From 6cd08a38b17c7e660fd4aeec24ed4a7796d3ba7d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jun 2018 14:06:13 +0200 Subject: [PATCH 24/42] pre-defined variables seem to work for gfortran --- src/plastic_phenopowerlaw.f90 | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index d888e6c09..fe79f9ae8 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -149,6 +149,7 @@ subroutine plastic_phenopowerlaw_init integer(pInt), dimension(0), parameter :: emptyInt = [integer(pInt)::] real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] + character(len=65536), dimension(0), parameter :: emptyString = [character(len=65536)::] type(tParameters), pointer :: prm @@ -189,7 +190,7 @@ subroutine plastic_phenopowerlaw_init prm%H_int = phaseConfig(phase)%getFloats('h_int',& defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) prm%nonSchmidCoeff = phaseConfig(phase)%getFloats('nonschmid_coefficients',& - defaultVal = [real(pReal)::1] ) + defaultVal = emptyReal ) prm%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') prm%n_slip = phaseConfig(phase)%getFloat('n_slip') @@ -228,13 +229,7 @@ subroutine plastic_phenopowerlaw_init prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) prm%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) -#if defined(__GFORTRAN__) - outputs = ['GfortranBug86277'] - outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=outputs) - if (outputs(1) == 'GfortranBug86277') outputs = [character(len=65536)::] -#else - outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=[character(len=65536)::]) -#endif + outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=emptyString) allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID @@ -615,8 +610,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) lattice_maxNtwinFamily, & lattice_NslipSystem, & lattice_NtwinSystem, & - lattice_shearTwin, & - lattice_NnonSchmid + lattice_shearTwin use material, only: & material_phase, & phaseAt, phasememberAt, & @@ -686,7 +680,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ! Calculation of dot gamma tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) tau_slip_neg = tau_slip_pos - nonSchmidSystems: do k = 1,lattice_NnonSchmid(ph) + nonSchmidSystems: do k = 1,size(param(instance)%nonSchmidCoeff) tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k, index_myFamily+i,ph)) tau_slip_neg = tau_slip_neg +param(instance)%nonSchmidCoeff(k)* & From 96e5175f41a28d81bb836a45a1cf0b168dbb5327 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 Jun 2018 21:08:13 +0200 Subject: [PATCH 25/42] updated rename --- src/plastic_phenopowerlaw.f90 | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index fe79f9ae8..9e03d8737 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -132,7 +132,7 @@ subroutine plastic_phenopowerlaw_init plasticState use config, only: & MATERIAL_partPhase, & - phaseConfig + config_phase use lattice use numerics,only: & numerics_integrator @@ -181,43 +181,43 @@ subroutine plastic_phenopowerlaw_init instance = phase_plasticityInstance(phase) prm => param(instance) - prm%Nslip = phaseConfig(phase)%getInts('nslip',defaultVal=emptyInt) + prm%Nslip = config_phase(phase)%getInts('nslip',defaultVal=emptyInt) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) if (sum(prm%Nslip) > 0_pInt) then - prm%tau0_slip = phaseConfig(phase)%getFloats('tau0_slip') - prm%tausat_slip = phaseConfig(phase)%getFloats('tausat_slip') - prm%interaction_SlipSlip = phaseConfig(phase)%getFloats('interaction_slipslip') - prm%H_int = phaseConfig(phase)%getFloats('h_int',& + prm%tau0_slip = config_phase(phase)%getFloats('tau0_slip') + prm%tausat_slip = config_phase(phase)%getFloats('tausat_slip') + prm%interaction_SlipSlip = config_phase(phase)%getFloats('interaction_slipslip') + prm%H_int = config_phase(phase)%getFloats('h_int',& defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) - prm%nonSchmidCoeff = phaseConfig(phase)%getFloats('nonschmid_coefficients',& + prm%nonSchmidCoeff = config_phase(phase)%getFloats('nonschmid_coefficients',& defaultVal = emptyReal ) - prm%gdot0_slip = phaseConfig(phase)%getFloat('gdot0_slip') - prm%n_slip = phaseConfig(phase)%getFloat('n_slip') - prm%a_slip = phaseConfig(phase)%getFloat('a_slip') - prm%h0_SlipSlip = phaseConfig(phase)%getFloat('h0_slipslip') + prm%gdot0_slip = config_phase(phase)%getFloat('gdot0_slip') + prm%n_slip = config_phase(phase)%getFloat('n_slip') + prm%a_slip = config_phase(phase)%getFloat('a_slip') + prm%h0_SlipSlip = config_phase(phase)%getFloat('h0_slipslip') endif - prm%Ntwin = phaseConfig(phase)%getInts('ntwin', defaultVal=emptyInt) + prm%Ntwin = config_phase(phase)%getInts('ntwin', defaultVal=emptyInt) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) if (sum(prm%Ntwin) > 0_pInt) then - prm%tau0_twin = phaseConfig(phase)%getFloats('tau0_twin') - prm%interaction_TwinTwin = phaseConfig(phase)%getFloats('interaction_twintwin') + prm%tau0_twin = config_phase(phase)%getFloats('tau0_twin') + prm%interaction_TwinTwin = config_phase(phase)%getFloats('interaction_twintwin') - prm%gdot0_twin = phaseConfig(phase)%getFloat('gdot0_twin') - prm%n_twin = phaseConfig(phase)%getFloat('n_twin') - prm%spr = phaseConfig(phase)%getFloat('s_pr') - prm%twinB = phaseConfig(phase)%getFloat('twin_b') - prm%twinC = phaseConfig(phase)%getFloat('twin_c') - prm%twinD = phaseConfig(phase)%getFloat('twin_d') - prm%twinE = phaseConfig(phase)%getFloat('twin_e') - prm%h0_TwinTwin = phaseConfig(phase)%getFloat('h0_twintwin') + prm%gdot0_twin = config_phase(phase)%getFloat('gdot0_twin') + prm%n_twin = config_phase(phase)%getFloat('n_twin') + prm%spr = config_phase(phase)%getFloat('s_pr') + prm%twinB = config_phase(phase)%getFloat('twin_b') + prm%twinC = config_phase(phase)%getFloat('twin_c') + prm%twinD = config_phase(phase)%getFloat('twin_d') + prm%twinE = config_phase(phase)%getFloat('twin_e') + prm%h0_TwinTwin = config_phase(phase)%getFloat('h0_twintwin') endif if (sum(prm%Nslip) > 0_pInt .and. sum(prm%Ntwin) > 0_pInt) then - prm%interaction_SlipTwin = phaseConfig(phase)%getFloats('interaction_sliptwin') - prm%interaction_TwinSlip = phaseConfig(phase)%getFloats('interaction_twinslip') - prm%h0_TwinSlip = phaseConfig(phase)%getFloat('h0_twinslip') + prm%interaction_SlipTwin = config_phase(phase)%getFloats('interaction_sliptwin') + prm%interaction_TwinSlip = config_phase(phase)%getFloats('interaction_twinslip') + prm%h0_TwinSlip = config_phase(phase)%getFloat('h0_twinslip') endif allocate(prm%matrix_SlipSlip(sum(prm%Nslip),sum(prm%Nslip)),source =0.0_pReal) @@ -225,11 +225,11 @@ subroutine plastic_phenopowerlaw_init allocate(prm%matrix_TwinSlip(sum(prm%Ntwin),sum(prm%Nslip)),source =0.0_pReal) allocate(prm%matrix_TwinTwin(sum(prm%Ntwin),sum(prm%Ntwin)),source =0.0_pReal) - prm%aTolResistance = phaseConfig(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) - prm%aTolShear = phaseConfig(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) - prm%aTolTwinfrac = phaseConfig(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + prm%aTolResistance = config_phase(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) + prm%aTolShear = config_phase(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + prm%aTolTwinfrac = config_phase(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) - outputs = phaseConfig(phase)%getStrings('(output)',defaultVal=emptyString) + outputs = config_phase(phase)%getStrings('(output)',defaultVal=emptyString) allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID From 00f34363dc4c3707b22bae24b756f6ab5771fc71 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jun 2018 09:12:33 +0200 Subject: [PATCH 26/42] adjusted naming convention --- src/plastic_phenopowerlaw.f90 | 192 +++++++++++++++++----------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 9e03d8737..0b7efd472 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -141,15 +141,15 @@ subroutine plastic_phenopowerlaw_init integer(pInt) :: & maxNinstance, & - instance,phase,j,k, f,o, i,& + instance,p,j,k, f,o, i,& NipcMyPhase, outputSize, & offset_slip, index_myFamily, index_otherFamily, & sizeState,sizeDotState, & startIndex, endIndex - integer(pInt), dimension(0), parameter :: emptyInt = [integer(pInt)::] - real(pReal), dimension(0), parameter :: emptyReal = [real(pReal)::] - character(len=65536), dimension(0), parameter :: emptyString = [character(len=65536)::] + integer(pInt), dimension(0), parameter :: emptyIntArray = [integer(pInt)::] + real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::] + character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] type(tParameters), pointer :: prm @@ -176,48 +176,48 @@ subroutine plastic_phenopowerlaw_init allocate(state(maxNinstance)) allocate(dotState(maxNinstance)) - do phase = 1_pInt, size(phase_plasticityInstance) - if (phase_plasticity(phase) == PLASTICITY_PHENOPOWERLAW_ID) then - instance = phase_plasticityInstance(phase) + do p = 1_pInt, size(phase_plasticityInstance) + if (phase_plasticity(p) == PLASTICITY_PHENOPOWERLAW_ID) then + instance = phase_plasticityInstance(p) prm => param(instance) - prm%Nslip = config_phase(phase)%getInts('nslip',defaultVal=emptyInt) + prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) if (sum(prm%Nslip) > 0_pInt) then - prm%tau0_slip = config_phase(phase)%getFloats('tau0_slip') - prm%tausat_slip = config_phase(phase)%getFloats('tausat_slip') - prm%interaction_SlipSlip = config_phase(phase)%getFloats('interaction_slipslip') - prm%H_int = config_phase(phase)%getFloats('h_int',& + prm%tau0_slip = config_phase(p)%getFloats('tau0_slip') + prm%tausat_slip = config_phase(p)%getFloats('tausat_slip') + prm%interaction_SlipSlip = config_phase(p)%getFloats('interaction_slipslip') + prm%H_int = config_phase(p)%getFloats('h_int',& defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) - prm%nonSchmidCoeff = config_phase(phase)%getFloats('nonschmid_coefficients',& - defaultVal = emptyReal ) + prm%nonSchmidCoeff = config_phase(p)%getFloats('nonschmid_coefficients',& + defaultVal = emptyRealArray ) - prm%gdot0_slip = config_phase(phase)%getFloat('gdot0_slip') - prm%n_slip = config_phase(phase)%getFloat('n_slip') - prm%a_slip = config_phase(phase)%getFloat('a_slip') - prm%h0_SlipSlip = config_phase(phase)%getFloat('h0_slipslip') + prm%gdot0_slip = config_phase(p)%getFloat('gdot0_slip') + prm%n_slip = config_phase(p)%getFloat('n_slip') + prm%a_slip = config_phase(p)%getFloat('a_slip') + prm%h0_SlipSlip = config_phase(p)%getFloat('h0_slipslip') endif - prm%Ntwin = config_phase(phase)%getInts('ntwin', defaultVal=emptyInt) + prm%Ntwin = config_phase(p)%getInts('ntwin', defaultVal=emptyIntArray) !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) if (sum(prm%Ntwin) > 0_pInt) then - prm%tau0_twin = config_phase(phase)%getFloats('tau0_twin') - prm%interaction_TwinTwin = config_phase(phase)%getFloats('interaction_twintwin') + prm%tau0_twin = config_phase(p)%getFloats('tau0_twin') + prm%interaction_TwinTwin = config_phase(p)%getFloats('interaction_twintwin') - prm%gdot0_twin = config_phase(phase)%getFloat('gdot0_twin') - prm%n_twin = config_phase(phase)%getFloat('n_twin') - prm%spr = config_phase(phase)%getFloat('s_pr') - prm%twinB = config_phase(phase)%getFloat('twin_b') - prm%twinC = config_phase(phase)%getFloat('twin_c') - prm%twinD = config_phase(phase)%getFloat('twin_d') - prm%twinE = config_phase(phase)%getFloat('twin_e') - prm%h0_TwinTwin = config_phase(phase)%getFloat('h0_twintwin') + prm%gdot0_twin = config_phase(p)%getFloat('gdot0_twin') + prm%n_twin = config_phase(p)%getFloat('n_twin') + prm%spr = config_phase(p)%getFloat('s_pr') + prm%twinB = config_phase(p)%getFloat('twin_b') + prm%twinC = config_phase(p)%getFloat('twin_c') + prm%twinD = config_phase(p)%getFloat('twin_d') + prm%twinE = config_phase(p)%getFloat('twin_e') + prm%h0_TwinTwin = config_phase(p)%getFloat('h0_twintwin') endif if (sum(prm%Nslip) > 0_pInt .and. sum(prm%Ntwin) > 0_pInt) then - prm%interaction_SlipTwin = config_phase(phase)%getFloats('interaction_sliptwin') - prm%interaction_TwinSlip = config_phase(phase)%getFloats('interaction_twinslip') - prm%h0_TwinSlip = config_phase(phase)%getFloat('h0_twinslip') + prm%interaction_SlipTwin = config_phase(p)%getFloats('interaction_sliptwin') + prm%interaction_TwinSlip = config_phase(p)%getFloats('interaction_twinslip') + prm%h0_TwinSlip = config_phase(p)%getFloat('h0_twinslip') endif allocate(prm%matrix_SlipSlip(sum(prm%Nslip),sum(prm%Nslip)),source =0.0_pReal) @@ -225,11 +225,11 @@ subroutine plastic_phenopowerlaw_init allocate(prm%matrix_TwinSlip(sum(prm%Ntwin),sum(prm%Nslip)),source =0.0_pReal) allocate(prm%matrix_TwinTwin(sum(prm%Ntwin),sum(prm%Ntwin)),source =0.0_pReal) - prm%aTolResistance = config_phase(phase)%getFloat('atol_resistance',defaultVal=1.0_pReal) - prm%aTolShear = config_phase(phase)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) - prm%aTolTwinfrac = config_phase(phase)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + prm%aTolResistance = config_phase(p)%getFloat('atol_resistance',defaultVal=1.0_pReal) + prm%aTolShear = config_phase(p)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + prm%aTolTwinfrac = config_phase(p)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) - outputs = config_phase(phase)%getStrings('(output)',defaultVal=emptyString) + outputs = config_phase(p)%getStrings('(output)',defaultVal=emptyStringArray) allocate(prm%outputID(0)) do i=1_pInt, size(outputs) outputID = undefined_ID @@ -315,33 +315,33 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NipcMyPhase = count(material_phase == phase) ! number of IPCs containing my phase + NipcMyPhase = count(material_phase == p) ! number of IPCs containing my phase sizeState = size(['tau_slip ','accshear_slip']) * sum(prm%nslip) & + size(['tau_twin ','accshear_twin']) * sum(prm%ntwin) & + size(['sum(gamma)', 'sum(f) ']) sizeDotState = sizeState - plasticState(phase)%sizeState = sizeState - plasticState(phase)%sizeDotState = sizeDotState - plasticState(phase)%sizePostResults = sum(plastic_phenopowerlaw_sizePostResult(:,instance)) - plasticState(phase)%nSlip = sum(prm%Nslip) - plasticState(phase)%nTwin = sum(prm%Ntwin) - allocate(plasticState(phase)%aTolState ( sizeState), source=0.0_pReal) - allocate(plasticState(phase)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%subState0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%state ( sizeState,NipcMyPhase), source=0.0_pReal) + plasticState(p)%sizeState = sizeState + plasticState(p)%sizeDotState = sizeDotState + plasticState(p)%sizePostResults = sum(plastic_phenopowerlaw_sizePostResult(:,instance)) + plasticState(p)%nSlip = sum(prm%Nslip) + plasticState(p)%nTwin = sum(prm%Ntwin) + allocate(plasticState(p)%aTolState ( sizeState), source=0.0_pReal) + allocate(plasticState(p)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%subState0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%state ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%deltaState (0_pInt,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%deltaState (0_pInt,NipcMyPhase), source=0.0_pReal) if (any(numerics_integrator == 1_pInt)) then - allocate(plasticState(phase)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) - allocate(plasticState(phase)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) + allocate(plasticState(p)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) + allocate(plasticState(p)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) endif if (any(numerics_integrator == 4_pInt)) & - allocate(plasticState(phase)%RK4dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%RK4dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) if (any(numerics_integrator == 5_pInt)) & - allocate(plasticState(phase)%RKCK45dotState (6,sizeDotState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%RKCK45dotState (6,sizeDotState,NipcMyPhase), source=0.0_pReal) !-------------------------------------------------------------------------------------------------- ! calculate hardening matrices @@ -354,9 +354,9 @@ subroutine plastic_phenopowerlaw_init otherSlipSystems: do k = 1_pInt,prm%Nslip(o) prm%matrix_SlipSlip(index_myFamily+j,index_otherFamily+k) = & prm%interaction_SlipSlip(lattice_interactionSlipSlip( & - sum(lattice_NslipSystem(1:f-1,phase))+j, & - sum(lattice_NslipSystem(1:o-1,phase))+k, & - phase)) + sum(lattice_NslipSystem(1:f-1,p))+j, & + sum(lattice_NslipSystem(1:o-1,p))+k, & + p)) enddo otherSlipSystems; enddo otherSlipFamilies twinFamilies: do o = 1_pInt,size(prm%Ntwin,1) @@ -364,9 +364,9 @@ subroutine plastic_phenopowerlaw_init twinSystems: do k = 1_pInt,prm%Ntwin(o) prm%matrix_SlipTwin(index_myFamily+j,index_otherFamily+k) = & prm%interaction_SlipTwin(lattice_interactionSlipTwin( & - sum(lattice_NslipSystem(1:f-1_pInt,phase))+j, & - sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & - phase)) + sum(lattice_NslipSystem(1:f-1_pInt,p))+j, & + sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & + p)) enddo twinSystems; enddo twinFamilies enddo mySlipSystems enddo mySlipFamilies @@ -379,9 +379,9 @@ subroutine plastic_phenopowerlaw_init slipSystems: do k = 1_pInt,prm%Nslip(o) prm%matrix_TwinSlip(index_myFamily+j,index_otherFamily+k) = & prm%interaction_TwinSlip(lattice_interactionTwinSlip( & - sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & - sum(lattice_NslipSystem(1:o-1_pInt,phase))+k, & - phase)) + sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & + sum(lattice_NslipSystem(1:o-1_pInt,p))+k, & + p)) enddo slipSystems; enddo slipFamilies otherTwinFamilies: do o = 1_pInt,size(prm%Ntwin,1) @@ -389,9 +389,9 @@ subroutine plastic_phenopowerlaw_init otherTwinSystems: do k = 1_pInt,prm%Ntwin(o) prm%matrix_TwinTwin(index_myFamily+j,index_otherFamily+k) = & prm%interaction_TwinTwin(lattice_interactionTwinTwin( & - sum(lattice_NtwinSystem(1:f-1_pInt,phase))+j, & - sum(lattice_NtwinSystem(1:o-1_pInt,phase))+k, & - phase)) + sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & + sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & + p)) enddo otherTwinSystems; enddo otherTwinFamilies enddo myTwinSystems enddo myTwinFamilies @@ -399,54 +399,54 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! locally defined state aliases and initialization of state0 and aTolState startIndex = 1_pInt - endIndex = plasticState(phase)%nSlip - state (instance)%s_slip=>plasticState(phase)%state (startIndex:endIndex,:) - dotState(instance)%s_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%state0(startIndex:endIndex,:) = & + endIndex = plasticState(p)%nSlip + state (instance)%s_slip=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%s_slip=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%state0(startIndex:endIndex,:) = & spread(math_expand(prm%tau0_slip, prm%Nslip), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolResistance + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(phase)%nTwin - state (instance)%s_twin=>plasticState(phase)%state (startIndex:endIndex,:) - dotState(instance)%s_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%state0(startIndex:endIndex,:) = & + endIndex = endIndex + plasticState(p)%nTwin + state (instance)%s_twin=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%s_twin=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%state0(startIndex:endIndex,:) = & spread(math_expand(prm%tau0_twin, prm%Ntwin), 2, NipcMyPhase) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolResistance + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt - state (instance)%sumGamma=>plasticState(phase)%state (startIndex,:) - dotState(instance)%sumGamma=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear + state (instance)%sumGamma=>plasticState(p)%state (startIndex,:) + dotState(instance)%sumGamma=>plasticState(p)%dotState(startIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear startIndex = endIndex + 1_pInt endIndex = endIndex + 1_pInt - state (instance)%sumF=>plasticState(phase)%state (startIndex,:) - dotState(instance)%sumF=>plasticState(phase)%dotState(startIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolTwinFrac + state (instance)%sumF=>plasticState(p)%state (startIndex,:) + dotState(instance)%sumF=>plasticState(p)%dotState(startIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolTwinFrac startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(phase)%nSlip - state (instance)%accshear_slip=>plasticState(phase)%state (startIndex:endIndex,:) - dotState(instance)%accshear_slip=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear + endIndex = endIndex + plasticState(p)%nSlip + state (instance)%accshear_slip=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%accshear_slip=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear ! global alias - plasticState(phase)%slipRate =>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%accumulatedSlip =>plasticState(phase)%state(startIndex:endIndex,:) + plasticState(p)%slipRate =>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%accumulatedSlip =>plasticState(p)%state(startIndex:endIndex,:) startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(phase)%nTwin - state (instance)%accshear_twin=>plasticState(phase)%state (startIndex:endIndex,:) - dotState(instance)%accshear_twin=>plasticState(phase)%dotState(startIndex:endIndex,:) - plasticState(phase)%aTolState(startIndex:endIndex) = prm%aTolShear + endIndex = endIndex + plasticState(p)%nTwin + state (instance)%accshear_twin=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%accshear_twin=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - offset_slip = plasticState(phase)%nSlip+plasticState(phase)%nTwin+2_pInt - plasticState(phase)%slipRate => & - plasticState(phase)%dotState(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) - plasticState(phase)%accumulatedSlip => & - plasticState(phase)%state(offset_slip+1:offset_slip+plasticState(phase)%nSlip,1:NipcMyPhase) + offset_slip = plasticState(p)%nSlip+plasticState(p)%nTwin+2_pInt + plasticState(p)%slipRate => & + plasticState(p)%dotState(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) + plasticState(p)%accumulatedSlip => & + plasticState(p)%state(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) endif enddo From ddf7584f4d58b5368b462a1f3663209884131d4c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jun 2018 10:01:36 +0200 Subject: [PATCH 27/42] following ideas implemented by Philip in disloUCLA prm and stt are pointers to instance of parameter and state interaction_xxYY is a matrix, gets shape assigned during calculation totalNslip and totalNslip are defined as derived parameter --- src/plastic_phenopowerlaw.f90 | 634 +++++++++++++++++----------------- 1 file changed, 322 insertions(+), 312 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 0b7efd472..e8e092807 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -32,6 +32,9 @@ module plastic_phenopowerlaw end enum type, private :: tParameters !< container type for internal constitutive parameters + integer(pInt) :: & + totalNslip, & + totalNtwin real(pReal) :: & gdot0_slip, & !< reference shear strain rate for slip gdot0_twin, & !< reference shear strain rate for twin @@ -57,16 +60,12 @@ module plastic_phenopowerlaw tau0_twin, & !< initial critical shear stress for twin tausat_slip, & !< maximum critical shear stress for slip nonSchmidCoeff, & - H_int, & !< per family hardening activity (optional) + H_int !< per family hardening activity (optional) + real(pReal), dimension(:,:), allocatable :: & interaction_SlipSlip, & !< slip resistance from slip activity interaction_SlipTwin, & !< slip resistance from twin activity interaction_TwinSlip, & !< twin resistance from slip activity interaction_TwinTwin !< twin resistance from twin activity - real(pReal), dimension(:,:), allocatable :: & - matrix_SlipSlip, & !< slip resistance from slip activity - matrix_SlipTwin, & !< slip resistance from twin activity - matrix_TwinSlip, & !< twin resistance from slip activity - matrix_TwinTwin !< twin resistance from twin activity integer(kind(undefined_ID)), dimension(:), allocatable :: & outputID !< ID of each post result output @@ -85,7 +84,7 @@ module plastic_phenopowerlaw sumF end type - type(tPhenopowerlawState), allocatable, dimension(:), private :: & + type(tPhenopowerlawState), allocatable, dimension(:), target, private :: & dotState, & state @@ -147,6 +146,8 @@ subroutine plastic_phenopowerlaw_init sizeState,sizeDotState, & startIndex, endIndex + real(pReal), dimension(:,:), allocatable :: temp1, temp2 + integer(pInt), dimension(0), parameter :: emptyIntArray = [integer(pInt)::] real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::] character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] @@ -177,278 +178,289 @@ subroutine plastic_phenopowerlaw_init allocate(dotState(maxNinstance)) do p = 1_pInt, size(phase_plasticityInstance) - if (phase_plasticity(p) == PLASTICITY_PHENOPOWERLAW_ID) then - instance = phase_plasticityInstance(p) - prm => param(instance) + if (phase_plasticity(p) /= PLASTICITY_PHENOPOWERLAW_ID) cycle + instance = phase_plasticityInstance(p) + prm => param(instance) - prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray) - !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - if (sum(prm%Nslip) > 0_pInt) then - prm%tau0_slip = config_phase(p)%getFloats('tau0_slip') - prm%tausat_slip = config_phase(p)%getFloats('tausat_slip') - prm%interaction_SlipSlip = config_phase(p)%getFloats('interaction_slipslip') - prm%H_int = config_phase(p)%getFloats('h_int',& - defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) - prm%nonSchmidCoeff = config_phase(p)%getFloats('nonschmid_coefficients',& - defaultVal = emptyRealArray ) + prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray) + if (size(prm%Nslip) > count(lattice_NslipSystem(:,p) > 0_pInt)) call IO_error(150_pInt,ext_msg='Nslip') + if (any(lattice_NslipSystem(1:size(prm%Nslip),p)-prm%Nslip < 0_pInt)) call IO_error(150_pInt,ext_msg='Nslip') + prm%totalNslip = sum(prm%Nslip) - prm%gdot0_slip = config_phase(p)%getFloat('gdot0_slip') - prm%n_slip = config_phase(p)%getFloat('n_slip') - prm%a_slip = config_phase(p)%getFloat('a_slip') - prm%h0_SlipSlip = config_phase(p)%getFloat('h0_slipslip') - endif + if (prm%totalNslip > 0_pInt) then + prm%tau0_slip = config_phase(p)%getFloats('tau0_slip') + prm%tausat_slip = config_phase(p)%getFloats('tausat_slip') + prm%interaction_SlipSlip = spread(config_phase(p)%getFloats('interaction_slipslip'),2,1) + prm%H_int = config_phase(p)%getFloats('h_int',& + defaultVal=[(0.0_pReal,i=1_pInt,size(prm%Nslip))]) + prm%nonSchmidCoeff = config_phase(p)%getFloats('nonschmid_coefficients',& + defaultVal = emptyRealArray ) - prm%Ntwin = config_phase(p)%getInts('ntwin', defaultVal=emptyIntArray) - !if (size > Nchunks_SlipFamilies + 1_pInt) call IO_error(150_pInt,ext_msg=extmsg) - if (sum(prm%Ntwin) > 0_pInt) then - prm%tau0_twin = config_phase(p)%getFloats('tau0_twin') - prm%interaction_TwinTwin = config_phase(p)%getFloats('interaction_twintwin') + prm%gdot0_slip = config_phase(p)%getFloat('gdot0_slip') + prm%n_slip = config_phase(p)%getFloat('n_slip') + prm%a_slip = config_phase(p)%getFloat('a_slip') + prm%h0_SlipSlip = config_phase(p)%getFloat('h0_slipslip') + endif - prm%gdot0_twin = config_phase(p)%getFloat('gdot0_twin') - prm%n_twin = config_phase(p)%getFloat('n_twin') - prm%spr = config_phase(p)%getFloat('s_pr') - prm%twinB = config_phase(p)%getFloat('twin_b') - prm%twinC = config_phase(p)%getFloat('twin_c') - prm%twinD = config_phase(p)%getFloat('twin_d') - prm%twinE = config_phase(p)%getFloat('twin_e') - prm%h0_TwinTwin = config_phase(p)%getFloat('h0_twintwin') - endif + prm%Ntwin = config_phase(p)%getInts('ntwin', defaultVal=emptyIntArray) + if (size(prm%Ntwin) > count(lattice_NtwinSystem(:,p) > 0_pInt)) call IO_error(150_pInt,ext_msg='Ntwin') + if (any(lattice_NtwinSystem(1:size(prm%Ntwin),p)-prm%Ntwin < 0_pInt)) call IO_error(150_pInt,ext_msg='Ntwin') + prm%totalNtwin = sum(prm%Ntwin) - if (sum(prm%Nslip) > 0_pInt .and. sum(prm%Ntwin) > 0_pInt) then - prm%interaction_SlipTwin = config_phase(p)%getFloats('interaction_sliptwin') - prm%interaction_TwinSlip = config_phase(p)%getFloats('interaction_twinslip') - prm%h0_TwinSlip = config_phase(p)%getFloat('h0_twinslip') - endif + if (prm%totalNtwin > 0_pInt) then + prm%tau0_twin = config_phase(p)%getFloats('tau0_twin') + prm%interaction_TwinTwin = spread(config_phase(p)%getFloats('interaction_twintwin'),2,1) - allocate(prm%matrix_SlipSlip(sum(prm%Nslip),sum(prm%Nslip)),source =0.0_pReal) - allocate(prm%matrix_SlipTwin(sum(prm%Nslip),sum(prm%Ntwin)),source =0.0_pReal) - allocate(prm%matrix_TwinSlip(sum(prm%Ntwin),sum(prm%Nslip)),source =0.0_pReal) - allocate(prm%matrix_TwinTwin(sum(prm%Ntwin),sum(prm%Ntwin)),source =0.0_pReal) + prm%gdot0_twin = config_phase(p)%getFloat('gdot0_twin') + prm%n_twin = config_phase(p)%getFloat('n_twin') + prm%spr = config_phase(p)%getFloat('s_pr') + prm%twinB = config_phase(p)%getFloat('twin_b') + prm%twinC = config_phase(p)%getFloat('twin_c') + prm%twinD = config_phase(p)%getFloat('twin_d') + prm%twinE = config_phase(p)%getFloat('twin_e') + prm%h0_TwinTwin = config_phase(p)%getFloat('h0_twintwin') + endif - prm%aTolResistance = config_phase(p)%getFloat('atol_resistance',defaultVal=1.0_pReal) - prm%aTolShear = config_phase(p)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) - prm%aTolTwinfrac = config_phase(p)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) + if (prm%totalNslip > 0_pInt .and. prm%totalNtwin > 0_pInt) then + prm%interaction_SlipTwin = spread(config_phase(p)%getFloats('interaction_sliptwin'),2,1) + prm%interaction_TwinSlip = spread(config_phase(p)%getFloats('interaction_twinslip'),2,1) + prm%h0_TwinSlip = config_phase(p)%getFloat('h0_twinslip') + endif - outputs = config_phase(p)%getStrings('(output)',defaultVal=emptyStringArray) - allocate(prm%outputID(0)) - do i=1_pInt, size(outputs) - outputID = undefined_ID - select case(outputs(i)) - case ('resistance_slip') - outputID = resistance_slip_ID - outputSize = sum(prm%Nslip) - case ('accumulatedshear_slip') - outputID = accumulatedshear_slip_ID - outputSize = sum(prm%Nslip) - case ('shearrate_slip') - outputID = shearrate_slip_ID - outputSize = sum(prm%Nslip) - case ('resolvedstress_slip') - outputID = resolvedstress_slip_ID - outputSize = sum(prm%Nslip) - case ('resistance_twin') - outputID = resistance_twin_ID - outputSize = sum(prm%Ntwin) - case ('accumulatedshear_twin') - outputID = accumulatedshear_twin_ID - outputSize = sum(prm%Ntwin) - case ('shearrate_twin') - outputID = shearrate_twin_ID - outputSize = sum(prm%Ntwin) - case ('resolvedstress_twin') - outputID = resolvedstress_twin_ID - outputSize = sum(prm%Ntwin) + prm%aTolResistance = config_phase(p)%getFloat('atol_resistance',defaultVal=1.0_pReal) + prm%aTolShear = config_phase(p)%getFloat('atol_shear',defaultVal=1.0e-6_pReal) + prm%aTolTwinfrac = config_phase(p)%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal) - case ('totalvolfrac_twin') - outputID = totalvolfrac_twin_ID - outputSize = 1_pInt - case ('totalshear') - outputID = totalshear_ID - outputSize = 1_pInt - end select + outputs = config_phase(p)%getStrings('(output)',defaultVal=emptyStringArray) + allocate(prm%outputID(0)) + do i=1_pInt, size(outputs) + outputID = undefined_ID + select case(outputs(i)) + case ('resistance_slip') + outputID = resistance_slip_ID + outputSize = sum(prm%Nslip) + case ('accumulatedshear_slip') + outputID = accumulatedshear_slip_ID + outputSize = sum(prm%Nslip) + case ('shearrate_slip') + outputID = shearrate_slip_ID + outputSize = sum(prm%Nslip) + case ('resolvedstress_slip') + outputID = resolvedstress_slip_ID + outputSize = sum(prm%Nslip) - if (outputID /= undefined_ID) then - plastic_phenopowerlaw_output(i,instance) = outputs(i) - plastic_phenopowerlaw_sizePostResult(i,instance) = outputSize - prm%outputID = [prm%outputID , outputID] - endif + case ('resistance_twin') + outputID = resistance_twin_ID + outputSize = sum(prm%Ntwin) + case ('accumulatedshear_twin') + outputID = accumulatedshear_twin_ID + outputSize = sum(prm%Ntwin) + case ('shearrate_twin') + outputID = shearrate_twin_ID + outputSize = sum(prm%Ntwin) + case ('resolvedstress_twin') + outputID = resolvedstress_twin_ID + outputSize = sum(prm%Ntwin) - end do + case ('totalvolfrac_twin') + outputID = totalvolfrac_twin_ID + outputSize = 1_pInt + case ('totalshear') + outputID = totalshear_ID + outputSize = 1_pInt + end select - extmsg = '' - if (sum(prm%Nslip) > 0_pInt) then - if (size(prm%tau0_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & - ext_msg='shape(tau0_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (size(prm%tausat_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & - ext_msg='shape(tausat_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (size(prm%H_int) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & - ext_msg='shape(H_int) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (outputID /= undefined_ID) then + plastic_phenopowerlaw_output(i,instance) = outputs(i) + plastic_phenopowerlaw_sizePostResult(i,instance) = outputSize + prm%outputID = [prm%outputID , outputID] + endif - if (any(prm%tau0_slip < 0.0_pReal .and. prm%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//"tau0_slip " - if (any(prm%tausat_slip < prm%tau0_slip .and. prm%Nslip > 0_pInt)) & - extmsg = trim(extmsg)//"tausat_slip " + end do - if (prm%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" gdot0_slip " - if (dEq0(prm%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? - if (dEq0(prm%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? - endif + extmsg = '' + if (sum(prm%Nslip) > 0_pInt) then + if (size(prm%tau0_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(tau0_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (size(prm%tausat_slip) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(tausat_slip) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (size(prm%H_int) /= size(prm%Nslip)) call IO_error(211_pInt,ip=instance, & + ext_msg='shape(H_int) ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (sum(prm%Ntwin) > 0_pInt) then - if (size(prm%tau0_twin) /= size(prm%ntwin)) call IO_error(211_pInt,ip=instance,& - ext_msg='shape(tau0_twin) ('//PLASTICITY_PHENOPOWERLAW_label//')') + if (any(prm%tau0_slip < 0.0_pReal .and. prm%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//"tau0_slip " + if (any(prm%tausat_slip < prm%tau0_slip .and. prm%Nslip > 0_pInt)) & + extmsg = trim(extmsg)//"tausat_slip " - if (any(prm%tau0_twin < 0.0_pReal .and. prm%Ntwin > 0_pInt)) & - extmsg = trim(extmsg)//"tau0_twin " + if (prm%gdot0_slip <= 0.0_pReal) extmsg = trim(extmsg)//" gdot0_slip " + if (dEq0(prm%a_slip)) extmsg = trim(extmsg)//" a_slip " ! ToDo: negative values ok? + if (dEq0(prm%n_slip)) extmsg = trim(extmsg)//" n_slip " ! ToDo: negative values ok? + endif - if (prm%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//"gdot0_twin " - if (dEq0(prm%n_twin)) extmsg = trim(extmsg)//"n_twin " ! ToDo: negative values ok? - endif + if (sum(prm%Ntwin) > 0_pInt) then + if (size(prm%tau0_twin) /= size(prm%ntwin)) call IO_error(211_pInt,ip=instance,& + ext_msg='shape(tau0_twin) ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//"aTolresistance " - if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//"aTolShear " - if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//"atoltwinfrac " + if (any(prm%tau0_twin < 0.0_pReal .and. prm%Ntwin > 0_pInt)) & + extmsg = trim(extmsg)//"tau0_twin " - if (extmsg /= '') call IO_error(211_pInt,ip=instance,& - ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') + if (prm%gdot0_twin <= 0.0_pReal) extmsg = trim(extmsg)//"gdot0_twin " + if (dEq0(prm%n_twin)) extmsg = trim(extmsg)//"n_twin " ! ToDo: negative values ok? + endif + + if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//"aTolresistance " + if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//"aTolShear " + if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//"atoltwinfrac " + + if (extmsg /= '') call IO_error(211_pInt,ip=instance,& + ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')') !-------------------------------------------------------------------------------------------------- ! allocate state arrays - NipcMyPhase = count(material_phase == p) ! number of IPCs containing my phase - sizeState = size(['tau_slip ','accshear_slip']) * sum(prm%nslip) & - + size(['tau_twin ','accshear_twin']) * sum(prm%ntwin) & - + size(['sum(gamma)', 'sum(f) ']) + NipcMyPhase = count(material_phase == p) ! number of IPCs containing my phase + sizeState = size(['tau_slip ','accshear_slip']) * sum(prm%nslip) & + + size(['tau_twin ','accshear_twin']) * sum(prm%ntwin) & + + size(['sum(gamma)', 'sum(f) ']) - sizeDotState = sizeState - plasticState(p)%sizeState = sizeState - plasticState(p)%sizeDotState = sizeDotState - plasticState(p)%sizePostResults = sum(plastic_phenopowerlaw_sizePostResult(:,instance)) - plasticState(p)%nSlip = sum(prm%Nslip) - plasticState(p)%nTwin = sum(prm%Ntwin) - allocate(plasticState(p)%aTolState ( sizeState), source=0.0_pReal) - allocate(plasticState(p)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(p)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(p)%subState0 ( sizeState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(p)%state ( sizeState,NipcMyPhase), source=0.0_pReal) + sizeDotState = sizeState + plasticState(p)%sizeState = sizeState + plasticState(p)%sizeDotState = sizeDotState + plasticState(p)%sizePostResults = sum(plastic_phenopowerlaw_sizePostResult(:,instance)) + plasticState(p)%nSlip = sum(prm%Nslip) + plasticState(p)%nTwin = sum(prm%Ntwin) + allocate(plasticState(p)%aTolState ( sizeState), source=0.0_pReal) + allocate(plasticState(p)%state0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%partionedState0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%subState0 ( sizeState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%state ( sizeState,NipcMyPhase), source=0.0_pReal) + + allocate(plasticState(p)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) + allocate(plasticState(p)%deltaState (0_pInt,NipcMyPhase), source=0.0_pReal) + if (any(numerics_integrator == 1_pInt)) then + allocate(plasticState(p)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) + allocate(plasticState(p)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) + endif + if (any(numerics_integrator == 4_pInt)) & + allocate(plasticState(p)%RK4dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) + if (any(numerics_integrator == 5_pInt)) & + allocate(plasticState(p)%RKCK45dotState (6,sizeDotState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(p)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) - allocate(plasticState(p)%deltaState (0_pInt,NipcMyPhase), source=0.0_pReal) - if (any(numerics_integrator == 1_pInt)) then - allocate(plasticState(p)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) - allocate(plasticState(p)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) - endif - if (any(numerics_integrator == 4_pInt)) & - allocate(plasticState(p)%RK4dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) - if (any(numerics_integrator == 5_pInt)) & - allocate(plasticState(p)%RKCK45dotState (6,sizeDotState,NipcMyPhase), source=0.0_pReal) !-------------------------------------------------------------------------------------------------- ! calculate hardening matrices - mySlipFamilies: do f = 1_pInt,size(prm%Nslip,1) ! >>> interaction slip -- X - index_myFamily = sum(prm%Nslip(1:f-1_pInt)) + allocate(temp1(sum(prm%Nslip),sum(prm%Nslip)),source =0.0_pReal) + allocate(temp2(sum(prm%Nslip),sum(prm%Ntwin)),source =0.0_pReal) + mySlipFamilies: do f = 1_pInt,size(prm%Nslip,1) ! >>> interaction slip -- X + index_myFamily = sum(prm%Nslip(1:f-1_pInt)) - mySlipSystems: do j = 1_pInt,prm%Nslip(f) - otherSlipFamilies: do o = 1_pInt,size(prm%Nslip,1) - index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) - otherSlipSystems: do k = 1_pInt,prm%Nslip(o) - prm%matrix_SlipSlip(index_myFamily+j,index_otherFamily+k) = & - prm%interaction_SlipSlip(lattice_interactionSlipSlip( & - sum(lattice_NslipSystem(1:f-1,p))+j, & - sum(lattice_NslipSystem(1:o-1,p))+k, & - p)) - enddo otherSlipSystems; enddo otherSlipFamilies + mySlipSystems: do j = 1_pInt,prm%Nslip(f) + otherSlipFamilies: do o = 1_pInt,size(prm%Nslip,1) + index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) + otherSlipSystems: do k = 1_pInt,prm%Nslip(o) + temp1(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_SlipSlip(lattice_interactionSlipSlip( & + sum(lattice_NslipSystem(1:f-1,p))+j, & + sum(lattice_NslipSystem(1:o-1,p))+k, & + p),1) + enddo otherSlipSystems; enddo otherSlipFamilies - twinFamilies: do o = 1_pInt,size(prm%Ntwin,1) - index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) - twinSystems: do k = 1_pInt,prm%Ntwin(o) - prm%matrix_SlipTwin(index_myFamily+j,index_otherFamily+k) = & - prm%interaction_SlipTwin(lattice_interactionSlipTwin( & - sum(lattice_NslipSystem(1:f-1_pInt,p))+j, & - sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & - p)) - enddo twinSystems; enddo twinFamilies - enddo mySlipSystems - enddo mySlipFamilies + twinFamilies: do o = 1_pInt,size(prm%Ntwin,1) + index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) + twinSystems: do k = 1_pInt,prm%Ntwin(o) + temp2(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_SlipTwin(lattice_interactionSlipTwin( & + sum(lattice_NslipSystem(1:f-1_pInt,p))+j, & + sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & + p),1) + enddo twinSystems; enddo twinFamilies + enddo mySlipSystems + enddo mySlipFamilies + prm%interaction_SlipSlip = temp1; deallocate(temp1) + prm%interaction_SlipTwin = temp2; deallocate(temp2) + - myTwinFamilies: do f = 1_pInt,size(prm%Ntwin,1) ! >>> interaction twin -- X - index_myFamily = sum(prm%Ntwin(1:f-1_pInt)) - myTwinSystems: do j = 1_pInt,prm%Ntwin(f) - slipFamilies: do o = 1_pInt,size(prm%Nslip,1) - index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) - slipSystems: do k = 1_pInt,prm%Nslip(o) - prm%matrix_TwinSlip(index_myFamily+j,index_otherFamily+k) = & - prm%interaction_TwinSlip(lattice_interactionTwinSlip( & - sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & - sum(lattice_NslipSystem(1:o-1_pInt,p))+k, & - p)) - enddo slipSystems; enddo slipFamilies + allocate(temp1(sum(prm%Ntwin),sum(prm%Nslip)),source =0.0_pReal) + allocate(temp2(sum(prm%Ntwin),sum(prm%Ntwin)),source =0.0_pReal) + myTwinFamilies: do f = 1_pInt,size(prm%Ntwin,1) ! >>> interaction twin -- X + index_myFamily = sum(prm%Ntwin(1:f-1_pInt)) + myTwinSystems: do j = 1_pInt,prm%Ntwin(f) + slipFamilies: do o = 1_pInt,size(prm%Nslip,1) + index_otherFamily = sum(prm%Nslip(1:o-1_pInt)) + slipSystems: do k = 1_pInt,prm%Nslip(o) + temp1(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_TwinSlip(lattice_interactionTwinSlip( & + sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & + sum(lattice_NslipSystem(1:o-1_pInt,p))+k, & + p),1) + enddo slipSystems; enddo slipFamilies - otherTwinFamilies: do o = 1_pInt,size(prm%Ntwin,1) - index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) - otherTwinSystems: do k = 1_pInt,prm%Ntwin(o) - prm%matrix_TwinTwin(index_myFamily+j,index_otherFamily+k) = & - prm%interaction_TwinTwin(lattice_interactionTwinTwin( & - sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & - sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & - p)) - enddo otherTwinSystems; enddo otherTwinFamilies - enddo myTwinSystems - enddo myTwinFamilies + otherTwinFamilies: do o = 1_pInt,size(prm%Ntwin,1) + index_otherFamily = sum(prm%Ntwin(1:o-1_pInt)) + otherTwinSystems: do k = 1_pInt,prm%Ntwin(o) + temp2(index_myFamily+j,index_otherFamily+k) = & + prm%interaction_TwinTwin(lattice_interactionTwinTwin( & + sum(lattice_NtwinSystem(1:f-1_pInt,p))+j, & + sum(lattice_NtwinSystem(1:o-1_pInt,p))+k, & + p),1) + enddo otherTwinSystems; enddo otherTwinFamilies + enddo myTwinSystems + enddo myTwinFamilies + prm%interaction_TwinSlip = temp1; deallocate(temp1) + prm%interaction_TwinTwin = temp2; deallocate(temp2) !-------------------------------------------------------------------------------------------------- ! locally defined state aliases and initialization of state0 and aTolState - startIndex = 1_pInt - endIndex = plasticState(p)%nSlip - state (instance)%s_slip=>plasticState(p)%state (startIndex:endIndex,:) - dotState(instance)%s_slip=>plasticState(p)%dotState(startIndex:endIndex,:) - plasticState(p)%state0(startIndex:endIndex,:) = & - spread(math_expand(prm%tau0_slip, prm%Nslip), 2, NipcMyPhase) + startIndex = 1_pInt + endIndex = plasticState(p)%nSlip + state (instance)%s_slip=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%s_slip=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%state0(startIndex:endIndex,:) = & + spread(math_expand(prm%tau0_slip, prm%Nslip), 2, NipcMyPhase) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance - startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(p)%nTwin - state (instance)%s_twin=>plasticState(p)%state (startIndex:endIndex,:) - dotState(instance)%s_twin=>plasticState(p)%dotState(startIndex:endIndex,:) - plasticState(p)%state0(startIndex:endIndex,:) = & - spread(math_expand(prm%tau0_twin, prm%Ntwin), 2, NipcMyPhase) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance + startIndex = endIndex + 1_pInt + endIndex = endIndex + plasticState(p)%nTwin + state (instance)%s_twin=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%s_twin=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%state0(startIndex:endIndex,:) = & + spread(math_expand(prm%tau0_twin, prm%Ntwin), 2, NipcMyPhase) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance - startIndex = endIndex + 1_pInt - endIndex = endIndex + 1_pInt - state (instance)%sumGamma=>plasticState(p)%state (startIndex,:) - dotState(instance)%sumGamma=>plasticState(p)%dotState(startIndex,:) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear + startIndex = endIndex + 1_pInt + endIndex = endIndex + 1_pInt + state (instance)%sumGamma=>plasticState(p)%state (startIndex,:) + dotState(instance)%sumGamma=>plasticState(p)%dotState(startIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - startIndex = endIndex + 1_pInt - endIndex = endIndex + 1_pInt - state (instance)%sumF=>plasticState(p)%state (startIndex,:) - dotState(instance)%sumF=>plasticState(p)%dotState(startIndex,:) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolTwinFrac + startIndex = endIndex + 1_pInt + endIndex = endIndex + 1_pInt + state (instance)%sumF=>plasticState(p)%state (startIndex,:) + dotState(instance)%sumF=>plasticState(p)%dotState(startIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolTwinFrac - startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(p)%nSlip - state (instance)%accshear_slip=>plasticState(p)%state (startIndex:endIndex,:) - dotState(instance)%accshear_slip=>plasticState(p)%dotState(startIndex:endIndex,:) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - ! global alias - plasticState(p)%slipRate =>plasticState(p)%dotState(startIndex:endIndex,:) - plasticState(p)%accumulatedSlip =>plasticState(p)%state(startIndex:endIndex,:) + startIndex = endIndex + 1_pInt + endIndex = endIndex + plasticState(p)%nSlip + state (instance)%accshear_slip=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%accshear_slip=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear + ! global alias + plasticState(p)%slipRate =>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%accumulatedSlip =>plasticState(p)%state(startIndex:endIndex,:) - startIndex = endIndex + 1_pInt - endIndex = endIndex + plasticState(p)%nTwin - state (instance)%accshear_twin=>plasticState(p)%state (startIndex:endIndex,:) - dotState(instance)%accshear_twin=>plasticState(p)%dotState(startIndex:endIndex,:) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear + startIndex = endIndex + 1_pInt + endIndex = endIndex + plasticState(p)%nTwin + state (instance)%accshear_twin=>plasticState(p)%state (startIndex:endIndex,:) + dotState(instance)%accshear_twin=>plasticState(p)%dotState(startIndex:endIndex,:) + plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - offset_slip = plasticState(p)%nSlip+plasticState(p)%nTwin+2_pInt - plasticState(p)%slipRate => & - plasticState(p)%dotState(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) - plasticState(p)%accumulatedSlip => & - plasticState(p)%state(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) + offset_slip = plasticState(p)%nSlip+plasticState(p)%nTwin+2_pInt + plasticState(p)%slipRate => & + plasticState(p)%dotState(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) + plasticState(p)%accumulatedSlip => & + plasticState(p)%state(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) - endif enddo @@ -505,11 +517,14 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, dLp_dTstar3333 !< derivative of Lp with respect to Tstar as 4th order tensor real(pReal), dimension(3,3,2) :: & nonSchmid_tensor + type(tParameters), pointer :: prm of = phasememberAt(ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) + prm => param(instance) + Lp = 0.0_pReal dLp_dTstar3333 = 0.0_pReal dLp_dTstar99 = 0.0_pReal @@ -517,9 +532,9 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, !-------------------------------------------------------------------------------------------------- ! Slip part j = 0_pInt - slipFamilies: do f = 1_pInt,size(param(instance)%Nslip,1) + slipFamilies: do f = 1_pInt,size(prm%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems: do i = 1_pInt,param(instance)%Nslip(f) + slipSystems: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt ! Calculation of Lp @@ -527,30 +542,30 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, tau_slip_neg = tau_slip_pos nonSchmid_tensor(1:3,1:3,1) = lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,1) - do k = 1,size(param(instance)%nonSchmidCoeff) - tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & + do k = 1,size(prm%nonSchmidCoeff) + tau_slip_pos = tau_slip_pos + prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg + param(instance)%nonSchmidCoeff(k)* & + tau_slip_neg = tau_slip_neg + prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) - nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + param(instance)%nonSchmidCoeff(k)*& + nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + prm%nonSchmidCoeff(k)*& lattice_Sslip(1:3,1:3,2*k,index_myFamily+i,ph) - nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + param(instance)%nonSchmidCoeff(k)*& + nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + prm%nonSchmidCoeff(k)*& lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,ph) enddo - gdot_slip_pos = 0.5_pReal*param(instance)%gdot0_slip* & + gdot_slip_pos = 0.5_pReal*prm%gdot0_slip* & ((abs(tau_slip_pos)/(state(instance)%s_slip(j,of))) & - **param(instance)%n_slip)*sign(1.0_pReal,tau_slip_pos) + **prm%n_slip)*sign(1.0_pReal,tau_slip_pos) - gdot_slip_neg = 0.5_pReal*param(instance)%gdot0_slip* & + gdot_slip_neg = 0.5_pReal*prm%gdot0_slip* & ((abs(tau_slip_neg)/(state(instance)%s_slip(j,of))) & - **param(instance)%n_slip)*sign(1.0_pReal,tau_slip_neg) + **prm%n_slip)*sign(1.0_pReal,tau_slip_neg) Lp = Lp + (1.0_pReal-state(instance)%sumF(of))*& ! 1-F (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp if (dNeq0(gdot_slip_pos)) then - dgdot_dtauslip_pos = gdot_slip_pos*param(instance)%n_slip/tau_slip_pos + dgdot_dtauslip_pos = gdot_slip_pos*prm%n_slip/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtauslip_pos*lattice_Sslip(k,l,1,index_myFamily+i,ph)* & @@ -558,7 +573,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, endif if (dNeq0(gdot_slip_neg)) then - dgdot_dtauslip_neg = gdot_slip_neg*param(instance)%n_slip/tau_slip_neg + dgdot_dtauslip_neg = gdot_slip_neg*prm%n_slip/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtauslip_neg*lattice_Sslip(k,l,1,index_myFamily+i,ph)* & @@ -570,22 +585,22 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, !-------------------------------------------------------------------------------------------------- ! Twinning part j = 0_pInt - twinFamilies: do f = 1_pInt,size(param(instance)%Ntwin,1) + twinFamilies: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems: do i = 1_pInt,param(instance)%Ntwin(f) + twinSystems: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt ! Calculation of Lp tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) gdot_twin = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F - param(instance)%gdot0_twin*& + prm%gdot0_twin*& (abs(tau_twin)/state(instance)%s_twin(j,of))**& - param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) + prm%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp if (dNeq0(gdot_twin)) then - dgdot_dtautwin = gdot_twin*param(instance)%n_twin/tau_twin + dgdot_dtautwin = gdot_twin*prm%n_twin/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dgdot_dtautwin*lattice_Stwin(k,l,index_myFamily+i,ph)* & @@ -628,7 +643,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) integer(pInt) :: & instance,ph, & f,i,j,k, & - index_myFamily, nslip,ntwin,& + index_myFamily, & of real(pReal) :: & c_SlipSlip,c_TwinSlip,c_TwinTwin, & @@ -639,67 +654,63 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) gdot_slip,left_SlipSlip,left_SlipTwin,right_SlipSlip,right_TwinSlip real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Ntwin) :: & gdot_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin + type(tParameters), pointer :: prm + type(tPhenopowerlawState), pointer :: stt of = phasememberAt(ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) + prm => param(instance) + stt => state(instance) - nSlip= sum(param(instance)%nslip) - nTwin= sum(param(instance)%nTwin) plasticState(ph)%dotState(:,of) = 0.0_pReal !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices - c_SlipSlip = param(instance)%h0_slipslip*& - (1.0_pReal + param(instance)%twinC*state(instance)%sumF(of)**& - param(instance)%twinB) - c_TwinSlip = param(instance)%h0_TwinSlip*& - state(instance)%sumGamma(of)**param(instance)%twinE - c_TwinTwin = param(instance)%h0_TwinTwin*& - state(instance)%sumF(of)**param(instance)%twinD + c_SlipSlip = prm%h0_slipslip*(1.0_pReal + prm%twinC*stt%sumF(of)** prm%twinB) + c_TwinSlip = prm%h0_TwinSlip*stt%sumGamma(of)**prm%twinE + c_TwinTwin = prm%h0_TwinTwin*stt%sumF(of)**prm%twinD !-------------------------------------------------------------------------------------------------- ! calculate left and right vectors and calculate dot gammas - ssat_offset = param(instance)%spr*sqrt(state(instance)%sumF(of)) + ssat_offset = prm%spr*sqrt(stt%sumF(of)) j = 0_pInt - slipFamilies1: do f =1_pInt,size(param(instance)%Nslip,1) + slipFamilies1: do f =1_pInt,size(prm%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems1: do i = 1_pInt,param(instance)%Nslip(f) + slipSystems1: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt - left_SlipSlip(j) = 1.0_pReal + param(instance)%H_int(f) ! modified no system-dependent left part + left_SlipSlip(j) = 1.0_pReal + prm%H_int(f) ! modified no system-dependent left part left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part - right_SlipSlip(j) = abs(1.0_pReal-state(instance)%s_slip(j,of) / & - (param(instance)%tausat_slip(f)+ssat_offset)) & - **param(instance)%a_slip& - *sign(1.0_pReal,1.0_pReal-state(instance)%s_slip(j,of) / & - (param(instance)%tausat_slip(f)+ssat_offset)) + right_SlipSlip(j) = abs(1.0_pReal-stt%s_slip(j,of) / & + (prm%tausat_slip(f)+ssat_offset)) & + **prm%a_slip& + *sign(1.0_pReal,1.0_pReal-stt%s_slip(j,of) / & + (prm%tausat_slip(f)+ssat_offset)) right_TwinSlip(j) = 1.0_pReal ! no system-dependent part !-------------------------------------------------------------------------------------------------- ! Calculation of dot gamma tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) tau_slip_neg = tau_slip_pos - nonSchmidSystems: do k = 1,size(param(instance)%nonSchmidCoeff) - tau_slip_pos = tau_slip_pos + param(instance)%nonSchmidCoeff(k)* & + nonSchmidSystems: do k = 1,size(prm%nonSchmidCoeff) + tau_slip_pos = tau_slip_pos + prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k, index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg +param(instance)%nonSchmidCoeff(k)* & + tau_slip_neg = tau_slip_neg +prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo nonSchmidSystems - gdot_slip(j) = param(instance)%gdot0_slip*0.5_pReal* & - ((abs(tau_slip_pos)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & - *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & - *sign(1.0_pReal,tau_slip_neg)) + gdot_slip(j) = prm%gdot0_slip*0.5_pReal* & + ( (abs(tau_slip_pos)/(stt%s_slip(j,of)))**prm%n_slip*sign(1.0_pReal,tau_slip_pos) & + +(abs(tau_slip_neg)/(stt%s_slip(j,of)))**prm%n_slip*sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 j = 0_pInt - twinFamilies1: do f = 1_pInt,size(param(instance)%Ntwin,1) + twinFamilies1: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems1: do i = 1_pInt,param(instance)%Ntwin(f) + twinSystems1: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt left_TwinSlip(j) = 1.0_pReal ! no system-dependent left part left_TwinTwin(j) = 1.0_pReal ! no system-dependent left part @@ -709,24 +720,24 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! Calculation of dot vol frac tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) - gdot_twin(j) = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F - param(instance)%gdot0_twin*& - (abs(tau_twin)/state(instance)%s_twin(j,of))**& - param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) + gdot_twin(j) = (1.0_pReal-stt%sumF(of))*& ! 1-F + prm%gdot0_twin*& + (abs(tau_twin)/stt%s_twin(j,of))**& + prm%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) enddo twinSystems1 enddo twinFamilies1 !-------------------------------------------------------------------------------------------------- ! calculate the overall hardening based on above j = 0_pInt - slipFamilies2: do f = 1_pInt,size(param(instance)%Nslip,1) - slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) + slipFamilies2: do f = 1_pInt,size(prm%Nslip,1) + slipSystems2: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt dotState(instance)%s_slip(j,of) = & ! evolution of slip resistance j c_SlipSlip * left_SlipSlip(j) * & - dot_product(param(instance)%matrix_SlipSlip(j,1:nslip), & + dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip), & right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - dot_product(param(instance)%matrix_SlipTwin(j,1:ntwin), & + dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin), & right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + & abs(gdot_slip(j)) @@ -735,16 +746,16 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo slipFamilies2 j = 0_pInt - twinFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) + twinFamilies2: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems2: do i = 1_pInt,param(instance)%Ntwin(f) + twinSystems2: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j c_TwinSlip * left_TwinSlip(j) * & - dot_product(param(instance)%matrix_TwinSlip(j,1:nslip), & + dot_product(prm%interaction_TwinSlip(j,1:prm%totalNslip), & right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * left_TwinTwin(j) * & - dot_product(param(instance)%matrix_TwinTwin(j,1:ntwin), & + dot_product(prm%interaction_TwinTwin(j,1:prm%totalNtwin), & right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor if (state(instance)%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 dotState(instance)%sumF(of) = dotState(instance)%sumF(of) + & @@ -787,18 +798,17 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) integer(pInt) :: & instance,ph, of, & - nSlip,nTwin, & o,f,i,c,j,k, & index_myFamily real(pReal) :: & tau_slip_pos,tau_slip_neg,tau + type(tParameters), pointer :: prm of = phasememberAt(ipc,ip,el) ph = phaseAt(ipc,ip,el) instance = phase_plasticityInstance(ph) + prm => param(instance) - nSlip= sum(param(instance)%nslip) - nTwin= sum(param(instance)%nTwin) plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt @@ -806,12 +816,12 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) outputsLoop: do o = 1_pInt,size(param(instance)%outputID) select case(param(instance)%outputID(o)) case (resistance_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%s_slip(1:nSlip,of) - c = c + nSlip + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = state(instance)%s_slip(1:prm%totalNslip,of) + c = c + prm%totalNslip case (accumulatedshear_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(instance)%accshear_slip(1:nSlip,of) - c = c + nSlip + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = state(instance)%accshear_slip(1:prm%totalNslip,of) + c = c + prm%totalNslip case (shearrate_slip_ID) j = 0_pInt @@ -834,7 +844,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 - c = c + nSlip + c = c + prm%totalNslip case (resolvedstress_slip_ID) j = 0_pInt @@ -846,7 +856,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) enddo slipSystems2 enddo slipFamilies2 - c = c + nSlip + c = c + prm%totalNslip case (totalshear_ID) plastic_phenopowerlaw_postResults(c+1_pInt) = & @@ -854,14 +864,14 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + 1_pInt case (resistance_twin_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - state(instance)%s_twin(1:nTwin,of) - c = c + nTwin + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & + state(instance)%s_twin(1:prm%totalNtwin,of) + c = c + prm%totalNtwin case (accumulatedshear_twin_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+nTwin) = & - state(instance)%accshear_twin(1:nTwin,of) - c = c + nTwin + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & + state(instance)%accshear_twin(1:prm%totalNtwin,of) + c = c + prm%totalNtwin case (shearrate_twin_ID) j = 0_pInt twinFamilies1: do f = 1_pInt,size(param(instance)%Ntwin,1) @@ -875,7 +885,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) enddo twinSystems1 enddo twinFamilies1 - c = c + nTwin + c = c + prm%totalNtwin case (resolvedstress_twin_ID) j = 0_pInt @@ -887,7 +897,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) enddo twinSystems2 enddo twinFamilies2 - c = c + nTwin + c = c + prm%totalNtwin case (totalvolfrac_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt) = state(instance)%sumF(of) From 0f05565fd53ede29009b448f54debb27b23ce078 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jun 2018 10:09:19 +0200 Subject: [PATCH 28/42] don't complicate code with potential enhancements --- src/plastic_phenopowerlaw.f90 | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index e8e092807..3eba30606 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -319,8 +319,8 @@ subroutine plastic_phenopowerlaw_init !-------------------------------------------------------------------------------------------------- ! allocate state arrays NipcMyPhase = count(material_phase == p) ! number of IPCs containing my phase - sizeState = size(['tau_slip ','accshear_slip']) * sum(prm%nslip) & - + size(['tau_twin ','accshear_twin']) * sum(prm%ntwin) & + sizeState = size(['tau_slip ','accshear_slip']) * prm%TotalNslip & + + size(['tau_twin ','accshear_twin']) * prm%TotalNtwin & + size(['sum(gamma)', 'sum(f) ']) sizeDotState = sizeState @@ -651,9 +651,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) tau_slip_pos,tau_slip_neg,tau_twin real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Nslip) :: & - gdot_slip,left_SlipSlip,left_SlipTwin,right_SlipSlip,right_TwinSlip + gdot_slip,left_SlipSlip,right_SlipSlip real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Ntwin) :: & - gdot_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin + gdot_twin type(tParameters), pointer :: prm type(tPhenopowerlawState), pointer :: stt @@ -681,13 +681,11 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) slipSystems1: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt left_SlipSlip(j) = 1.0_pReal + prm%H_int(f) ! modified no system-dependent left part - left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part right_SlipSlip(j) = abs(1.0_pReal-stt%s_slip(j,of) / & (prm%tausat_slip(f)+ssat_offset)) & **prm%a_slip& *sign(1.0_pReal,1.0_pReal-stt%s_slip(j,of) / & (prm%tausat_slip(f)+ssat_offset)) - right_TwinSlip(j) = 1.0_pReal ! no system-dependent part !-------------------------------------------------------------------------------------------------- ! Calculation of dot gamma @@ -712,10 +710,6 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family twinSystems1: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt - left_TwinSlip(j) = 1.0_pReal ! no system-dependent left part - left_TwinTwin(j) = 1.0_pReal ! no system-dependent left part - right_SlipTwin(j) = 1.0_pReal ! no system-dependent right part - right_TwinTwin(j) = 1.0_pReal ! no system-dependent right part !-------------------------------------------------------------------------------------------------- ! Calculation of dot vol frac @@ -735,10 +729,8 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) j = j+1_pInt dotState(instance)%s_slip(j,of) = & ! evolution of slip resistance j c_SlipSlip * left_SlipSlip(j) * & - dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip), & - right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin), & - right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor + dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip),right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor + dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + & abs(gdot_slip(j)) dotState(instance)%accshear_slip(j,of) = abs(gdot_slip(j)) @@ -750,13 +742,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family twinSystems2: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt - dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j - c_TwinSlip * left_TwinSlip(j) * & - dot_product(prm%interaction_TwinSlip(j,1:prm%totalNslip), & - right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - c_TwinTwin * left_TwinTwin(j) * & - dot_product(prm%interaction_TwinTwin(j,1:prm%totalNtwin), & - right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor + dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j + c_TwinSlip * dot_product(prm%interaction_TwinSlip(j,1:prm%totalNslip),abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor + c_TwinTwin * dot_product(prm%interaction_TwinTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor if (state(instance)%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 dotState(instance)%sumF(of) = dotState(instance)%sumF(of) + & gdot_twin(j)/lattice_shearTwin(index_myFamily+i,ph) From 49126d2f6f378ab3cd0b0c07e004ed8b324ca678 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jun 2018 10:19:50 +0200 Subject: [PATCH 29/42] further simplified --- src/plastic_phenopowerlaw.f90 | 60 ++++++++++++++++------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 3eba30606..ee0702215 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -668,9 +668,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices - c_SlipSlip = prm%h0_slipslip*(1.0_pReal + prm%twinC*stt%sumF(of)** prm%twinB) - c_TwinSlip = prm%h0_TwinSlip*stt%sumGamma(of)**prm%twinE - c_TwinTwin = prm%h0_TwinTwin*stt%sumF(of)**prm%twinD + c_SlipSlip = prm%h0_slipslip * (1.0_pReal + prm%twinC*stt%sumF(of)** prm%twinB) + c_TwinSlip = prm%h0_TwinSlip * stt%sumGamma(of)**prm%twinE + c_TwinTwin = prm%h0_TwinTwin * stt%sumF(of)**prm%twinD !-------------------------------------------------------------------------------------------------- ! calculate left and right vectors and calculate dot gammas @@ -723,19 +723,13 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! calculate the overall hardening based on above - j = 0_pInt - slipFamilies2: do f = 1_pInt,size(prm%Nslip,1) - slipSystems2: do i = 1_pInt,prm%Nslip(f) - j = j+1_pInt - dotState(instance)%s_slip(j,of) = & ! evolution of slip resistance j - c_SlipSlip * left_SlipSlip(j) * & - dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip),right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor - dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor - dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + & - abs(gdot_slip(j)) - dotState(instance)%accshear_slip(j,of) = abs(gdot_slip(j)) - enddo slipSystems2 - enddo slipFamilies2 + do j = 1_pInt,prm%totalNslip + dotState(instance)%s_slip(j,of) = c_SlipSlip * left_SlipSlip(j) * & ! evolution of slip resistance j + dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip),right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor + dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor + enddo + dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + sum(abs(gdot_slip)) + dotState(instance)%accshear_slip(1:prm%totalNslip,of) = abs(gdot_slip) j = 0_pInt twinFamilies2: do f = 1_pInt,size(prm%Ntwin,1) @@ -801,8 +795,8 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt - outputsLoop: do o = 1_pInt,size(param(instance)%outputID) - select case(param(instance)%outputID(o)) + outputsLoop: do o = 1_pInt,size(prm%outputID) + select case(prm%outputID(o)) case (resistance_slip_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = state(instance)%s_slip(1:prm%totalNslip,of) c = c + prm%totalNslip @@ -813,22 +807,22 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (shearrate_slip_ID) j = 0_pInt - slipFamilies1: do f = 1_pInt,size(param(instance)%Nslip,1) + slipFamilies1: do f = 1_pInt,size(prm%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems1: do i = 1_pInt,param(instance)%Nslip(f) + slipSystems1: do i = 1_pInt,prm%Nslip(f) j = j + 1_pInt tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) tau_slip_neg = tau_slip_pos do k = 1,lattice_NnonSchmid(ph) - tau_slip_pos = tau_slip_pos +param(instance)%nonSchmidCoeff(k)* & + tau_slip_pos = tau_slip_pos +prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,ph)) - tau_slip_neg = tau_slip_neg +param(instance)%nonSchmidCoeff(k)* & + tau_slip_neg = tau_slip_neg +prm%nonSchmidCoeff(k)* & dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo - plastic_phenopowerlaw_postResults(c+j) = param(instance)%gdot0_slip*0.5_pReal* & - ((abs(tau_slip_pos)/state(instance)%s_slip(j,of))**param(instance)%n_slip & + plastic_phenopowerlaw_postResults(c+j) = prm%gdot0_slip*0.5_pReal* & + ((abs(tau_slip_pos)/state(instance)%s_slip(j,of))**prm%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**param(instance)%n_slip & + +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**prm%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -836,9 +830,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) case (resolvedstress_slip_ID) j = 0_pInt - slipFamilies2: do f = 1_pInt,size(param(instance)%Nslip,1) + slipFamilies2: do f = 1_pInt,size(prm%Nslip,1) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family - slipSystems2: do i = 1_pInt,param(instance)%Nslip(f) + slipSystems2: do i = 1_pInt,prm%Nslip(f) j = j + 1_pInt plastic_phenopowerlaw_postResults(c+j) = & dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,ph)) @@ -862,24 +856,24 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + prm%totalNtwin case (shearrate_twin_ID) j = 0_pInt - twinFamilies1: do f = 1_pInt,size(param(instance)%Ntwin,1) + twinFamilies1: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems1: do i = 1_pInt,param(instance)%Ntwin(f) + twinSystems1: do i = 1_pInt,prm%Ntwin(f) j = j + 1_pInt tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F - param(instance)%gdot0_twin*& + prm%gdot0_twin*& (abs(tau)/state(instance)%s_twin(j,of))**& - param(instance)%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) + prm%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) enddo twinSystems1 enddo twinFamilies1 c = c + prm%totalNtwin case (resolvedstress_twin_ID) j = 0_pInt - twinFamilies2: do f = 1_pInt,size(param(instance)%Ntwin,1) + twinFamilies2: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family - twinSystems2: do i = 1_pInt,param(instance)%Ntwin(f) + twinSystems2: do i = 1_pInt,prm%Ntwin(f) j = j + 1_pInt plastic_phenopowerlaw_postResults(c+j) = & dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) From 94d4f271864f16f92017924e145502ddf6c2cfdd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Jun 2018 15:15:48 +0200 Subject: [PATCH 30/42] incorporating changes from master branch of PRIVATE update of sns changed synta --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index d8ab8056d..43db3725c 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit d8ab8056d6245ce42bec8953de9af1d7754867cf +Subproject commit 43db3725cfe635806444a90f7f2c555537bbc801 From 8c727eb4ff243ef56a25b8e699cbacc4a8802194 Mon Sep 17 00:00:00 2001 From: Yang Su Date: Fri, 29 Jun 2018 18:07:32 -0400 Subject: [PATCH 31/42] removed obsolete second assignment of slipRate and accSlip pointers --- src/plastic_phenopowerlaw.f90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index ee0702215..4f95bf292 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -455,11 +455,6 @@ subroutine plastic_phenopowerlaw_init dotState(instance)%accshear_twin=>plasticState(p)%dotState(startIndex:endIndex,:) plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - offset_slip = plasticState(p)%nSlip+plasticState(p)%nTwin+2_pInt - plasticState(p)%slipRate => & - plasticState(p)%dotState(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) - plasticState(p)%accumulatedSlip => & - plasticState(p)%state(offset_slip+1:offset_slip+plasticState(p)%nSlip,1:NipcMyPhase) enddo From 980e34f7285ffa74d4b3ae5b6ecac03ff495f416 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jun 2018 13:37:13 +0200 Subject: [PATCH 32/42] state pointer as shortcut, variables not used --- src/plastic_phenopowerlaw.f90 | 45 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 4f95bf292..a387bad6d 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -1,3 +1,4 @@ +!-------------------------------------------------------------------------------------------------- !> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH @@ -78,7 +79,8 @@ module plastic_phenopowerlaw s_slip, & s_twin, & accshear_slip, & - accshear_twin + accshear_twin, & + whole real(pReal), pointer, dimension(:) :: & sumGamma, & sumF @@ -142,7 +144,7 @@ subroutine plastic_phenopowerlaw_init maxNinstance, & instance,p,j,k, f,o, i,& NipcMyPhase, outputSize, & - offset_slip, index_myFamily, index_otherFamily, & + index_myFamily, index_otherFamily, & sizeState,sizeDotState, & startIndex, endIndex @@ -417,7 +419,6 @@ subroutine plastic_phenopowerlaw_init dotState(instance)%s_slip=>plasticState(p)%dotState(startIndex:endIndex,:) plasticState(p)%state0(startIndex:endIndex,:) = & spread(math_expand(prm%tau0_slip, prm%Nslip), 2, NipcMyPhase) - plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance startIndex = endIndex + 1_pInt @@ -454,11 +455,11 @@ subroutine plastic_phenopowerlaw_init state (instance)%accshear_twin=>plasticState(p)%state (startIndex:endIndex,:) dotState(instance)%accshear_twin=>plasticState(p)%dotState(startIndex:endIndex,:) plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear - + + dotState(instance)%whole =>plasticState(p)%dotState enddo - end subroutine plastic_phenopowerlaw_init @@ -476,12 +477,11 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, lattice_Sslip_v, & lattice_Stwin, & lattice_Stwin_v, & - lattice_maxNslipFamily, & - lattice_maxNtwinFamily, & lattice_NslipSystem, & lattice_NtwinSystem use material, only: & - phaseAt, phasememberAt, & + phasememberAt, & + material_phase, & phase_plasticityInstance implicit none @@ -498,7 +498,6 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, Tstar_v !< 2nd Piola Kirchhoff stress tensor in Mandel notation integer(pInt) :: & - instance, & index_myFamily, & f,i,j,k,l,m,n, & of, & @@ -512,13 +511,14 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, dLp_dTstar3333 !< derivative of Lp with respect to Tstar as 4th order tensor real(pReal), dimension(3,3,2) :: & nonSchmid_tensor - type(tParameters), pointer :: prm + type(tParameters), pointer :: prm + type(tPhenopowerlawState), pointer :: stt of = phasememberAt(ipc,ip,el) - ph = phaseAt(ipc,ip,el) - instance = phase_plasticityInstance(ph) + ph = material_phase(ipc,ip,el) - prm => param(instance) + prm => param(phase_plasticityInstance(ph)) + stt => state(phase_plasticityInstance(ph)) Lp = 0.0_pReal dLp_dTstar3333 = 0.0_pReal @@ -548,18 +548,16 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,ph) enddo gdot_slip_pos = 0.5_pReal*prm%gdot0_slip* & - ((abs(tau_slip_pos)/(state(instance)%s_slip(j,of))) & - **prm%n_slip)*sign(1.0_pReal,tau_slip_pos) + ((abs(tau_slip_pos)/(stt%s_slip(j,of)))**prm%n_slip)*sign(1.0_pReal,tau_slip_pos) gdot_slip_neg = 0.5_pReal*prm%gdot0_slip* & - ((abs(tau_slip_neg)/(state(instance)%s_slip(j,of))) & - **prm%n_slip)*sign(1.0_pReal,tau_slip_neg) + ((abs(tau_slip_neg)/(stt%s_slip(j,of)))**prm%n_slip)*sign(1.0_pReal,tau_slip_neg) - Lp = Lp + (1.0_pReal-state(instance)%sumF(of))*& ! 1-F + Lp = Lp + (1.0_pReal-stt%sumF(of))*& (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq0(gdot_slip_pos)) then + if (dNeq0(gdot_slip_pos)) then !@ Philip: Needed? No division dgdot_dtauslip_pos = gdot_slip_pos*prm%n_slip/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -567,7 +565,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(m,n,1) endif - if (dNeq0(gdot_slip_neg)) then + if (dNeq0(gdot_slip_neg)) then !@ Philip: Needed? No division dgdot_dtauslip_neg = gdot_slip_neg*prm%n_slip/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -587,14 +585,13 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, ! Calculation of Lp tau_twin = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) - gdot_twin = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F - prm%gdot0_twin*& - (abs(tau_twin)/state(instance)%s_twin(j,of))**& + gdot_twin = (1.0_pReal-stt%sumF(of))*prm%gdot0_twin*& + (abs(tau_twin)/stt%s_twin(j,of))**& prm%n_twin*max(0.0_pReal,sign(1.0_pReal,tau_twin)) Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq0(gdot_twin)) then + if (dNeq0(gdot_twin)) then !@ Philip: Needed? No division dgdot_dtautwin = gdot_twin*prm%n_twin/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & From c50f32b0d82f419a5de4200e5da26dd41b33278e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jun 2018 14:11:05 +0200 Subject: [PATCH 33/42] shorthand names improve readability for dotstate and LpAnd... --- src/plastic_phenopowerlaw.f90 | 52 +++++++++++++++-------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index a387bad6d..858e09564 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -613,15 +613,12 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) use lattice, only: & lattice_Sslip_v, & lattice_Stwin_v, & - lattice_maxNslipFamily, & - lattice_maxNtwinFamily, & lattice_NslipSystem, & lattice_NtwinSystem, & lattice_shearTwin use material, only: & material_phase, & - phaseAt, phasememberAt, & - plasticState, & + phasememberAt, & phase_plasticityInstance implicit none @@ -633,7 +630,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) el !< element !< microstructure state integer(pInt) :: & - instance,ph, & + ph, & f,i,j,k, & index_myFamily, & of @@ -642,21 +639,22 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) ssat_offset, & tau_slip_pos,tau_slip_neg,tau_twin - real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Nslip) :: & + real(pReal), dimension(param(phase_plasticityInstance(material_phase(ipc,ip,el)))%totalNslip) :: & gdot_slip,left_SlipSlip,right_SlipSlip - real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%Ntwin) :: & + real(pReal), dimension(param(phase_plasticityInstance(material_phase(ipc,ip,el)))%totalNtwin) :: & gdot_twin - type(tParameters), pointer :: prm - type(tPhenopowerlawState), pointer :: stt + + type(tParameters), pointer :: prm + type(tPhenopowerlawState), pointer :: dst,stt of = phasememberAt(ipc,ip,el) - ph = phaseAt(ipc,ip,el) - instance = phase_plasticityInstance(ph) - prm => param(instance) - stt => state(instance) + ph = material_phase(ipc,ip,el) + prm => param(phase_plasticityInstance(ph)) + stt => state(phase_plasticityInstance(ph)) + dst => dotState(phase_plasticityInstance(ph)) - plasticState(ph)%dotState(:,of) = 0.0_pReal + dst%whole(:,of) = 0.0_pReal !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices @@ -673,11 +671,8 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) slipSystems1: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt left_SlipSlip(j) = 1.0_pReal + prm%H_int(f) ! modified no system-dependent left part - right_SlipSlip(j) = abs(1.0_pReal-stt%s_slip(j,of) / & - (prm%tausat_slip(f)+ssat_offset)) & - **prm%a_slip& - *sign(1.0_pReal,1.0_pReal-stt%s_slip(j,of) / & - (prm%tausat_slip(f)+ssat_offset)) + right_SlipSlip(j) = abs(1.0_pReal-stt%s_slip(j,of) / (prm%tausat_slip(f)+ssat_offset)) **prm%a_slip & + * sign(1.0_pReal,1.0_pReal-stt%s_slip(j,of) / (prm%tausat_slip(f)+ssat_offset)) !-------------------------------------------------------------------------------------------------- ! Calculation of dot gamma @@ -695,8 +690,6 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo slipSystems1 enddo slipFamilies1 - - j = 0_pInt twinFamilies1: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family @@ -716,31 +709,30 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! calculate the overall hardening based on above do j = 1_pInt,prm%totalNslip - dotState(instance)%s_slip(j,of) = c_SlipSlip * left_SlipSlip(j) * & ! evolution of slip resistance j + dst%s_slip(j,of) = c_SlipSlip * left_SlipSlip(j) * & ! evolution of slip resistance j dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip),right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor enddo - dotState(instance)%sumGamma(of) = dotState(instance)%sumGamma(of) + sum(abs(gdot_slip)) - dotState(instance)%accshear_slip(1:prm%totalNslip,of) = abs(gdot_slip) + dst%sumGamma(of) = dst%sumGamma(of) + sum(abs(gdot_slip)) + dst%accshear_slip(1:prm%totalNslip,of) = abs(gdot_slip) j = 0_pInt twinFamilies2: do f = 1_pInt,size(prm%Ntwin,1) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family twinSystems2: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt - dotState(instance)%s_twin(j,of) = & ! evolution of twin resistance j + dst%s_twin(j,of) = & ! evolution of twin resistance j c_TwinSlip * dot_product(prm%interaction_TwinSlip(j,1:prm%totalNslip),abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * dot_product(prm%interaction_TwinTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor - if (state(instance)%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 - dotState(instance)%sumF(of) = dotState(instance)%sumF(of) + & - gdot_twin(j)/lattice_shearTwin(index_myFamily+i,ph) - dotState(instance)%accshear_twin(j,of) = abs(gdot_twin(j)) + if (stt%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 + dst%sumF(of) = dst%sumF(of) + gdot_twin(j)/lattice_shearTwin(index_myFamily+i,ph) + dst%accshear_twin(j,of) = abs(gdot_twin(j)) enddo twinSystems2 enddo twinFamilies2 - end subroutine plastic_phenopowerlaw_dotState + !-------------------------------------------------------------------------------------------------- !> @brief return array of constitutive results !-------------------------------------------------------------------------------------------------- From b1c37996d349a11b6f7cf32cc6515b36771f0cf0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jun 2018 14:35:58 +0200 Subject: [PATCH 34/42] also using short names for state and dotstate in postResults --- src/plastic_phenopowerlaw.f90 | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index 858e09564..e7981c6d1 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -740,13 +740,11 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) use material, only: & material_phase, & plasticState, & - phaseAt, phasememberAt, & + phasememberAt, & phase_plasticityInstance use lattice, only: & lattice_Sslip_v, & lattice_Stwin_v, & - lattice_maxNslipFamily, & - lattice_maxNtwinFamily, & lattice_NslipSystem, & lattice_NtwinSystem, & lattice_NnonSchmid @@ -763,17 +761,21 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) plastic_phenopowerlaw_postResults integer(pInt) :: & - instance,ph, of, & + ph, of, & o,f,i,c,j,k, & index_myFamily real(pReal) :: & tau_slip_pos,tau_slip_neg,tau - type(tParameters), pointer :: prm + + type(tParameters), pointer :: prm + type(tPhenopowerlawState), pointer :: stt, dst of = phasememberAt(ipc,ip,el) - ph = phaseAt(ipc,ip,el) - instance = phase_plasticityInstance(ph) - prm => param(instance) + ph = material_phase(ipc,ip,el) + + stt => state(phase_plasticityInstance(ph)) + dst => dotstate(phase_plasticityInstance(ph)) + prm => param(phase_plasticityInstance(ph)) plastic_phenopowerlaw_postResults = 0.0_pReal @@ -782,11 +784,11 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) outputsLoop: do o = 1_pInt,size(prm%outputID) select case(prm%outputID(o)) case (resistance_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = state(instance)%s_slip(1:prm%totalNslip,of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = stt%s_slip(1:prm%totalNslip,of) c = c + prm%totalNslip case (accumulatedshear_slip_ID) - plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = state(instance)%accshear_slip(1:prm%totalNslip,of) + plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNslip) = stt%accshear_slip(1:prm%totalNslip,of) c = c + prm%totalNslip case (shearrate_slip_ID) @@ -804,9 +806,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,ph)) enddo plastic_phenopowerlaw_postResults(c+j) = prm%gdot0_slip*0.5_pReal* & - ((abs(tau_slip_pos)/state(instance)%s_slip(j,of))**prm%n_slip & + ((abs(tau_slip_pos)/stt%s_slip(j,of))**prm%n_slip & *sign(1.0_pReal,tau_slip_pos) & - +(abs(tau_slip_neg)/(state(instance)%s_slip(j,of)))**prm%n_slip & + +(abs(tau_slip_neg)/(stt%s_slip(j,of)))**prm%n_slip & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 @@ -825,18 +827,17 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + prm%totalNslip case (totalshear_ID) - plastic_phenopowerlaw_postResults(c+1_pInt) = & - state(instance)%sumGamma(of) + plastic_phenopowerlaw_postResults(c+1_pInt) = stt%sumGamma(of) c = c + 1_pInt case (resistance_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & - state(instance)%s_twin(1:prm%totalNtwin,of) + stt%s_twin(1:prm%totalNtwin,of) c = c + prm%totalNtwin case (accumulatedshear_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & - state(instance)%accshear_twin(1:prm%totalNtwin,of) + stt%accshear_twin(1:prm%totalNtwin,of) c = c + prm%totalNtwin case (shearrate_twin_ID) j = 0_pInt @@ -845,9 +846,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) twinSystems1: do i = 1_pInt,prm%Ntwin(f) j = j + 1_pInt tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,ph)) - plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-state(instance)%sumF(of))*& ! 1-F + plastic_phenopowerlaw_postResults(c+j) = (1.0_pReal-stt%sumF(of))*& ! 1-F prm%gdot0_twin*& - (abs(tau)/state(instance)%s_twin(j,of))**& + (abs(tau)/stt%s_twin(j,of))**& prm%n_twin*max(0.0_pReal,sign(1.0_pReal,tau)) enddo twinSystems1 enddo twinFamilies1 @@ -866,7 +867,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) c = c + prm%totalNtwin case (totalvolfrac_twin_ID) - plastic_phenopowerlaw_postResults(c+1_pInt) = state(instance)%sumF(of) + plastic_phenopowerlaw_postResults(c+1_pInt) = stt%sumF(of) c = c + 1_pInt end select From 7ca005d237684a378a5973a68353ad5d9df7fe98 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 5 Jul 2018 15:44:25 +0200 Subject: [PATCH 35/42] avoiding division by zero --- src/plastic_phenopowerlaw.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index e7981c6d1..d7be6a44b 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -557,7 +557,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq0(gdot_slip_pos)) then !@ Philip: Needed? No division + if (dNeq0(tau_slip_pos)) then dgdot_dtauslip_pos = gdot_slip_pos*prm%n_slip/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -565,7 +565,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(m,n,1) endif - if (dNeq0(gdot_slip_neg)) then !@ Philip: Needed? No division + if (dNeq0(tau_slip_neg)) then dgdot_dtauslip_neg = gdot_slip_neg*prm%n_slip/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & From edcf97ea59204cdde9a35eeb495b4d7bd5b44ffa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 16 Jul 2018 22:02:31 +0200 Subject: [PATCH 36/42] associate: clearer code and no performance drawbacks --- src/plastic_phenopowerlaw.f90 | 46 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index d7be6a44b..f854e7b00 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -61,7 +61,7 @@ module plastic_phenopowerlaw tau0_twin, & !< initial critical shear stress for twin tausat_slip, & !< maximum critical shear stress for slip nonSchmidCoeff, & - H_int !< per family hardening activity (optional) + H_int !< per family hardening activity (optional) real(pReal), dimension(:,:), allocatable :: & interaction_SlipSlip, & !< slip resistance from slip activity interaction_SlipTwin, & !< slip resistance from twin activity @@ -69,10 +69,10 @@ module plastic_phenopowerlaw interaction_TwinTwin !< twin resistance from twin activity integer(kind(undefined_ID)), dimension(:), allocatable :: & - outputID !< ID of each post result output + outputID !< ID of each post result output end type - type(tParameters), dimension(:), allocatable, target, private :: param !< containers of constitutive parameters (len Ninstance) + type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance) type, private :: tPhenopowerlawState real(pReal), pointer, dimension(:,:) :: & @@ -154,7 +154,7 @@ subroutine plastic_phenopowerlaw_init real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::] character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] - type(tParameters), pointer :: prm + type(tParameters) :: prm integer(kind(undefined_ID)) :: & outputID !< ID of each post result output @@ -182,7 +182,7 @@ subroutine plastic_phenopowerlaw_init do p = 1_pInt, size(phase_plasticityInstance) if (phase_plasticity(p) /= PLASTICITY_PHENOPOWERLAW_ID) cycle instance = phase_plasticityInstance(p) - prm => param(instance) + associate(prm => param(instance)) prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray) if (size(prm%Nslip) > count(lattice_NslipSystem(:,p) > 0_pInt)) call IO_error(150_pInt,ext_msg='Nslip') @@ -457,7 +457,8 @@ subroutine plastic_phenopowerlaw_init plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear dotState(instance)%whole =>plasticState(p)%dotState - + + end associate enddo end subroutine plastic_phenopowerlaw_init @@ -511,14 +512,13 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, dLp_dTstar3333 !< derivative of Lp with respect to Tstar as 4th order tensor real(pReal), dimension(3,3,2) :: & nonSchmid_tensor - type(tParameters), pointer :: prm - type(tPhenopowerlawState), pointer :: stt + type(tParameters) :: prm + type(tPhenopowerlawState) :: stt of = phasememberAt(ipc,ip,el) ph = material_phase(ipc,ip,el) - prm => param(phase_plasticityInstance(ph)) - stt => state(phase_plasticityInstance(ph)) + associate(prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph))) Lp = 0.0_pReal dLp_dTstar3333 = 0.0_pReal @@ -603,7 +603,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, dLp_dTstar99 = math_Plain3333to99(dLp_dTstar3333) - + end associate end subroutine plastic_phenopowerlaw_LpAndItsTangent !-------------------------------------------------------------------------------------------------- @@ -644,15 +644,13 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) real(pReal), dimension(param(phase_plasticityInstance(material_phase(ipc,ip,el)))%totalNtwin) :: & gdot_twin - type(tParameters), pointer :: prm - type(tPhenopowerlawState), pointer :: dst,stt + type(tParameters) :: prm + type(tPhenopowerlawState) :: dst,stt of = phasememberAt(ipc,ip,el) ph = material_phase(ipc,ip,el) - - prm => param(phase_plasticityInstance(ph)) - stt => state(phase_plasticityInstance(ph)) - dst => dotState(phase_plasticityInstance(ph)) + associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => & +dotState(phase_plasticityInstance(ph))) dst%whole(:,of) = 0.0_pReal @@ -729,7 +727,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) dst%accshear_twin(j,of) = abs(gdot_twin(j)) enddo twinSystems2 enddo twinFamilies2 - + end associate end subroutine plastic_phenopowerlaw_dotState @@ -767,16 +765,14 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) real(pReal) :: & tau_slip_pos,tau_slip_neg,tau - type(tParameters), pointer :: prm - type(tPhenopowerlawState), pointer :: stt, dst + type(tParameters) :: prm + type(tPhenopowerlawState) :: stt, dst of = phasememberAt(ipc,ip,el) ph = material_phase(ipc,ip,el) - stt => state(phase_plasticityInstance(ph)) - dst => dotstate(phase_plasticityInstance(ph)) - prm => param(phase_plasticityInstance(ph)) - + associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => & +dotState(phase_plasticityInstance(ph))) plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt @@ -872,7 +868,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) end select enddo outputsLoop - + end associate end function plastic_phenopowerlaw_postResults end module plastic_phenopowerlaw From 5d09e98e02366417ceb57b9cdd6ca705e1b1a8f9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Aug 2018 01:14:18 +0200 Subject: [PATCH 37/42] checking with Philip --- src/plastic_phenopowerlaw.f90 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index f854e7b00..f91ba28ae 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -591,7 +591,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq0(gdot_twin)) then !@ Philip: Needed? No division + if (dNeq0(gdot_twin)) then dgdot_dtautwin = gdot_twin*prm%n_twin/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -606,6 +606,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, end associate end subroutine plastic_phenopowerlaw_LpAndItsTangent + !-------------------------------------------------------------------------------------------------- !> @brief calculates the rate of change of microstructure !-------------------------------------------------------------------------------------------------- @@ -649,8 +650,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) of = phasememberAt(ipc,ip,el) ph = material_phase(ipc,ip,el) - associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => & -dotState(phase_plasticityInstance(ph))) + associate( prm => param(phase_plasticityInstance(ph)), & + stt => state(phase_plasticityInstance(ph)), & + dst => dotState(phase_plasticityInstance(ph))) dst%whole(:,of) = 0.0_pReal @@ -668,7 +670,7 @@ dotState(phase_plasticityInstance(ph))) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family slipSystems1: do i = 1_pInt,prm%Nslip(f) j = j+1_pInt - left_SlipSlip(j) = 1.0_pReal + prm%H_int(f) ! modified no system-dependent left part + left_SlipSlip(j) = 1.0_pReal + prm%H_int(f) ! modified no system-dependent left part right_SlipSlip(j) = abs(1.0_pReal-stt%s_slip(j,of) / (prm%tausat_slip(f)+ssat_offset)) **prm%a_slip & * sign(1.0_pReal,1.0_pReal-stt%s_slip(j,of) / (prm%tausat_slip(f)+ssat_offset)) @@ -707,7 +709,7 @@ dotState(phase_plasticityInstance(ph))) !-------------------------------------------------------------------------------------------------- ! calculate the overall hardening based on above do j = 1_pInt,prm%totalNslip - dst%s_slip(j,of) = c_SlipSlip * left_SlipSlip(j) * & ! evolution of slip resistance j + dst%s_slip(j,of) = c_SlipSlip * left_SlipSlip(j) * & ! evolution of slip resistance j dot_product(prm%interaction_SlipSlip(j,1:prm%totalNslip),right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor dot_product(prm%interaction_SlipTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor enddo @@ -719,12 +721,12 @@ dotState(phase_plasticityInstance(ph))) index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family twinSystems2: do i = 1_pInt,prm%Ntwin(f) j = j+1_pInt - dst%s_twin(j,of) = & ! evolution of twin resistance j + dst%s_twin(j,of) = & ! evolution of twin resistance j c_TwinSlip * dot_product(prm%interaction_TwinSlip(j,1:prm%totalNslip),abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor c_TwinTwin * dot_product(prm%interaction_TwinTwin(j,1:prm%totalNtwin),gdot_twin) ! dot gamma_twin modulated by right-side twin factor if (stt%sumF(of) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 dst%sumF(of) = dst%sumF(of) + gdot_twin(j)/lattice_shearTwin(index_myFamily+i,ph) - dst%accshear_twin(j,of) = abs(gdot_twin(j)) + dst%accshear_twin(j,of) = abs(gdot_twin(j)) enddo twinSystems2 enddo twinFamilies2 end associate @@ -771,8 +773,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) of = phasememberAt(ipc,ip,el) ph = material_phase(ipc,ip,el) - associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => & -dotState(phase_plasticityInstance(ph))) + associate( prm => param(phase_plasticityInstance(ph)), & + stt => state(phase_plasticityInstance(ph)), & + dst => dotState(phase_plasticityInstance(ph))) plastic_phenopowerlaw_postResults = 0.0_pReal c = 0_pInt @@ -828,13 +831,14 @@ dotState(phase_plasticityInstance(ph))) case (resistance_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & - stt%s_twin(1:prm%totalNtwin,of) + stt%s_twin(1:prm%totalNtwin,of) c = c + prm%totalNtwin case (accumulatedshear_twin_ID) plastic_phenopowerlaw_postResults(c+1_pInt:c+prm%totalNtwin) = & stt%accshear_twin(1:prm%totalNtwin,of) c = c + prm%totalNtwin + case (shearrate_twin_ID) j = 0_pInt twinFamilies1: do f = 1_pInt,size(prm%Ntwin,1) From f0645d84f597d8cf97ebf94f59b4ea8f331f04c1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 16 Jul 2018 22:22:21 +0200 Subject: [PATCH 38/42] not a target anymore --- src/plastic_phenopowerlaw.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plastic_phenopowerlaw.f90 b/src/plastic_phenopowerlaw.f90 index f91ba28ae..bdc6e12a6 100644 --- a/src/plastic_phenopowerlaw.f90 +++ b/src/plastic_phenopowerlaw.f90 @@ -86,7 +86,7 @@ module plastic_phenopowerlaw sumF end type - type(tPhenopowerlawState), allocatable, dimension(:), target, private :: & + type(tPhenopowerlawState), allocatable, dimension(:), private :: & dotState, & state From c8aa9ff3efe0b1ebd09fd61e85000be030d4c0b1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Aug 2018 19:30:36 +0200 Subject: [PATCH 39/42] merge-related fixes --- PRIVATE | 2 +- lib/damask/config/material.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 9d3b6c858..ae79bc96d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 9d3b6c858243ec6d7c1f8425e78be59bfdd6e110 +Subproject commit ae79bc96d9dd1fd5ea06b916b0be098169f34a1e diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index af635dd92..02658019d 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -277,3 +277,16 @@ class Material(): self.data[part.lower()][section.lower()][key.lower()] = value if newlen is not oldlen: print('Length of value was changed from %i to %i!'%(oldlen,newlen)) + + + def add_value(self, part=None, + section=None, + key=None, + value=None): + if not isinstance(value,list): + if not isinstance(value,str): + value = '%s'%value + value = [value] + print('adding %s:%s:%s with value %s '%(part.lower(),section.lower(),key.lower(),value)) + self.data[part.lower()][section.lower()][key.lower()] = value + self.data[part.lower()][section.lower()]['__order__'] += [key.lower()] From fa0dff7ac8796256e5d1ead0f121391994209093 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 4 Aug 2018 21:51:25 +0200 Subject: [PATCH 40/42] [skip ci] updated version information after successful test of v2.0.2-282-gc05337a2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8ef11d745..6ab575d5c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.2-263-gb305d913 +v2.0.2-282-gc05337a2 From d623d0379be398f79c3d9e6b861022233a8b0804 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 4 Aug 2018 22:38:38 +0200 Subject: [PATCH 41/42] resolved confusion of different branches in PRIVATE --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 58fcddbe6..67fcdfd00 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 58fcddbe62a071d027c0e2a876f07483b2d1e20e +Subproject commit 67fcdfd001a9e4f3da56d72ebeb0ea16d6d613e6 From 2be13b0047366f4160516e70c596399b620351a8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 5 Aug 2018 06:02:33 +0200 Subject: [PATCH 42/42] test that also works for new nonlocal --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 67fcdfd00..3d5f71743 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 67fcdfd001a9e4f3da56d72ebeb0ea16d6d613e6 +Subproject commit 3d5f71743d97eadb4b7ec3d110fe86bf1d6d83d6