From 127a29ab1acae64acb8f1aa014183b5ea6f738af Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Nov 2019 13:42:19 +0100 Subject: [PATCH 01/18] cleaning --- src/plastic_nonlocal.f90 | 41 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index e7e4e713d..155818810 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -81,7 +81,6 @@ module plastic_nonlocal rho_dip_edg_ID, & rho_dip_scr_ID, & rho_forest_ID, & - shearrate_ID, & resolvedstress_back_ID, & resistance_ID, & rho_dot_sgl_ID, & @@ -498,8 +497,6 @@ subroutine plastic_nonlocal_init outputID = merge(rho_dip_scr_ID,undefined_ID,prm%totalNslip>0) case ('rho_forest') outputID = merge(rho_forest_ID,undefined_ID,prm%totalNslip>0) - case ('shearrate') - outputID = merge(shearrate_ID,undefined_ID,prm%totalNslip>0) case ('resolvedstress_back') outputID = merge(resolvedstress_back_ID,undefined_ID,prm%totalNslip>0) case ('resistance') @@ -1515,7 +1512,10 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, & ph = material_phaseAt(1,el) instance = phase_plasticityInstance(ph) - associate(prm => param(instance),dst => microstructure(instance),dot => dotState(instance),stt => state(instance)) + associate(prm => param(instance), & + dst => microstructure(instance), & + dot => dotState(instance), & + stt => state(instance)) ns = totalNslip(instance) tau = 0.0_pReal @@ -1665,11 +1665,11 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, & endif enteringFlux: if (considerEnteringFlux) then - forall (s = 1:ns, t = 1:4) - neighbor_v(s,t) = plasticState(np)%state(iV (s,t,neighbor_instance),no) - neighbor_rhoSgl(s,t) = max(plasticState(np)%state(iRhoU(s,t,neighbor_instance),no), & + forall (s = 1:ns, t = 1:4) + neighbor_v(s,t) = plasticState(np)%state(iV (s,t,neighbor_instance),no) + neighbor_rhoSgl(s,t) = max(plasticState(np)%state(iRhoU(s,t,neighbor_instance),no), & 0.0_pReal) - endforall + endforall where (neighbor_rhoSgl * IPvolume(neighbor_ip,neighbor_el) ** 0.667_pReal < prm%significantN & .or. neighbor_rhoSgl < prm%significantRho) & @@ -1860,12 +1860,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, & #endif plasticState(p)%dotState = IEEE_value(1.0_pReal,IEEE_quiet_NaN) else - forall (s = 1:ns, t = 1:4) - plasticState(p)%dotState(iRhoU(s,t,instance),o) = rhoDot(s,t) - plasticState(p)%dotState(iRhoB(s,t,instance),o) = rhoDot(s,t+4) - endforall - forall (s = 1:ns, c = 1:2) & - plasticState(p)%dotState(iRhoD(s,c,instance),o) = rhoDot(s,c+8) + dot%rho(:,o) = pack(rhoDot,.true.) forall (s = 1:ns) & dot%accumulatedshear(s,o) = sum(gdot(s,1:4)) endif @@ -2045,7 +2040,6 @@ function plastic_nonlocal_postResults(ph,instance,of) result(postResults) rhoSgl, & rhoDotSgl !< evolution rate of single dislocation densities (positive/negative screw and edge without dipoles) real(pReal), dimension(param(instance)%totalNslip,4) :: & - gdot, & !< shear rates v !< velocities real(pReal), dimension(param(instance)%totalNslip,2) :: & rhoDotDip !< evolution rate of dipole dislocation densities (screw and edge dipoles) @@ -2059,22 +2053,13 @@ associate(prm => param(instance),dst => microstructure(instance),stt=>state(inst forall (s = 1:ns, t = 1:4) rhoSgl(s,t+4) = plasticState(ph)%State(iRhoB(s,t,instance),of) - v(s,t) = plasticState(ph)%State(iV(s,t,instance),of) + v(s,t) = plasticState(ph)%State(iV(s,t,instance),of) rhoDotSgl(s,t+4) = plasticState(ph)%dotState(iRhoB(s,t,instance),of) endforall forall (s = 1:ns, c = 1:2) rhoDotDip(s,c) = plasticState(ph)%dotState(iRhoD(s,c,instance),of) endforall -!* Calculate shear rate - -forall (t = 1:4) & - gdot(1:ns,t) = rhoSgl(1:ns,t) * prm%burgers(1:ns) * v(1:ns,t) - - -!* calculate limits for stable dipole height - - outputsLoop: do o = 1,size(param(instance)%outputID) select case(param(instance)%outputID(o)) @@ -2122,10 +2107,6 @@ outputsLoop: do o = 1,size(param(instance)%outputID) postResults(cs+1:cs+ns) = stt%rho_forest(:,of) cs = cs + ns - case (shearrate_ID) - postResults(cs+1:cs+ns) = sum(gdot,2) - cs = cs + ns - case (resolvedstress_back_ID) postResults(cs+1:cs+ns) = dst%tau_back(:,of) cs = cs + ns @@ -2233,7 +2214,7 @@ function getRho(instance,of,ip,el) getRho = reshape(state(instance)%rho(:,of),[prm%totalNslip,10]) - ! ensure mobile densities (not for imm, they have a sign) + ! ensure positive densities (not for imm, they have a sign) getRho(:,mob) = max(getRho(:,mob),0.0_pReal) getRho(:,dip) = max(getRho(:,dip),0.0_pReal) From 5a792ad09d7380a910fec286c8be17abacb99c54 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Nov 2019 14:30:13 +0100 Subject: [PATCH 02/18] updated tests --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 66d562c75..633a2d1ba 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 66d562c755cd9aa4bbb8280c509383014acd52db +Subproject commit 633a2d1ba8c1f96c0362a35af407304228934b0d From d93fb12e8c7e636ba10b47f8d69494fe68f1eef6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Nov 2019 14:36:54 +0100 Subject: [PATCH 03/18] remove extra output current implementation was not very general, no separation of different dislocation types. if output is needed, re-implemenation is straight forward --- src/plastic_nonlocal.f90 | 110 --------------------------------------- 1 file changed, 110 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 155818810..e963ffe3c 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -86,17 +86,6 @@ module plastic_nonlocal rho_dot_sgl_ID, & rho_dot_sgl_mobile_ID, & rho_dot_dip_ID, & - rho_dot_gen_edge_ID, & - rho_dot_gen_screw_ID, & - rho_dot_sgl2dip_edge_ID, & - rho_dot_sgl2dip_screw_ID, & - rho_dot_ann_ath_ID, & - rho_dot_ann_the_edge_ID, & - rho_dot_ann_the_screw_ID, & - rho_dot_edgejogs_ID, & - rho_dot_flux_mobile_ID, & - rho_dot_flux_edge_ID, & - rho_dot_flux_screw_ID, & velocity_edge_pos_ID, & velocity_edge_neg_ID, & velocity_screw_pos_ID, & @@ -181,18 +170,6 @@ module plastic_nonlocal tau_Back end type tNonlocalMicrostructure - type, private :: tOutput !< container type for storage of output results - real(pReal), dimension(:,:), allocatable, private :: & - rhoDotEdgeJogs - real(pReal), dimension(:,:,:), allocatable, private :: & - rhoDotFlux, & - rhoDotMultiplication, & - rhoDotSingle2DipoleGlide, & - rhoDotAthermalAnnihilation, & - rhoDotThermalAnnihilation - end type tOutput - - type, private :: tNonlocalState real(pReal), pointer, dimension(:,:) :: & rho, & ! < all dislocations @@ -222,7 +199,6 @@ module plastic_nonlocal type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance) - type(tOutput), dimension(:), allocatable, private :: results type(tNonlocalMicrostructure), dimension(:), allocatable, private :: microstructure integer(kind(undefined_ID)), dimension(:,:), allocatable, private :: & @@ -288,7 +264,6 @@ subroutine plastic_nonlocal_init allocate(dotState(maxNinstances)) allocate(deltaState(maxNinstances)) allocate(microstructure(maxNinstances)) - allocate(results(maxNinstances)) allocate(plastic_nonlocal_sizePostResult(maxval(phase_Noutput), maxNinstances), source=0) allocate(plastic_nonlocal_output(maxval(phase_Noutput), maxNinstances)) @@ -304,7 +279,6 @@ subroutine plastic_nonlocal_init dot => dotState(phase_plasticityInstance(p)), & stt => state(phase_plasticityInstance(p)), & del => deltaState(phase_plasticityInstance(p)), & - res => results(phase_plasticityInstance(p)), & dst => microstructure(phase_plasticityInstance(p)), & config => config_phase(p)) @@ -507,28 +481,6 @@ subroutine plastic_nonlocal_init outputID = merge(rho_dot_sgl_mobile_ID,undefined_ID,prm%totalNslip>0) case ('rho_dot_dip') outputID = merge(rho_dot_dip_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_gen_edge') - outputID = merge(rho_dot_gen_edge_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_gen_screw') - outputID = merge(rho_dot_gen_screw_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_sgl2dip_edge') - outputID = merge(rho_dot_sgl2dip_edge_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_sgl2dip_screw') - outputID = merge(rho_dot_sgl2dip_screw_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_ann_ath') - outputID = merge(rho_dot_ann_ath_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_ann_the_edge') - outputID = merge(rho_dot_ann_the_edge_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_ann_the_screw') - outputID = merge(rho_dot_ann_the_screw_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_edgejogs') - outputID = merge(rho_dot_edgejogs_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_flux_mobile') - outputID = merge(rho_dot_flux_mobile_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_flux_edge') - outputID = merge(rho_dot_flux_edge_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dot_flux_screw') - outputID = merge(rho_dot_flux_screw_ID,undefined_ID,prm%totalNslip>0) case ('velocity_edge_pos') outputID = merge(velocity_edge_pos_ID,undefined_ID,prm%totalNslip>0) case ('velocity_edge_neg') @@ -646,13 +598,6 @@ subroutine plastic_nonlocal_init allocate(dst%tau_Threshold(prm%totalNslip,NofMyPhase),source=0.0_pReal) allocate(dst%tau_Back(prm%totalNslip,NofMyPhase),source=0.0_pReal) - - allocate(res%rhoDotFlux(prm%totalNslip,8,NofMyPhase),source=0.0_pReal) - allocate(res%rhoDotMultiplication(prm%totalNslip,2,NofMyPhase),source=0.0_pReal) - allocate(res%rhoDotSingle2DipoleGlide(prm%totalNslip,2,NofMyPhase),source=0.0_pReal) - allocate(res%rhoDotAthermalAnnihilation(prm%totalNslip,2,NofMyPhase),source=0.0_pReal) - allocate(res%rhoDotThermalAnnihilation(prm%totalNslip,2,NofMyPhase),source=0.0_pReal) - allocate(res%rhoDotEdgeJogs(prm%totalNslip,NofMyPhase),source=0.0_pReal) end associate @@ -1817,14 +1762,6 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, & + rhoDotSingle2DipoleGlide & + rhoDotAthermalAnnihilation & + rhoDotThermalAnnihilation - - results(instance)%rhoDotFlux(1:ns,1:8,o) = rhoDotFlux(1:ns,1:8) - results(instance)%rhoDotMultiplication(1:ns,1:2,o) = rhoDotMultiplication(1:ns,[1,3]) - results(instance)%rhoDotSingle2DipoleGlide(1:ns,1:2,o) = rhoDotSingle2DipoleGlide(1:ns,9:10) - results(instance)%rhoDotAthermalAnnihilation(1:ns,1:2,o) = rhoDotAthermalAnnihilation(1:ns,9:10) - results(instance)%rhoDotThermalAnnihilation(1:ns,1:2,o) = rhoDotThermalAnnihilation(1:ns,9:10) - results(instance)%rhoDotEdgeJogs(1:ns,o) = 2.0_pReal * rhoDotThermalAnnihilation(1:ns,1) - #ifdef DEBUG if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0 & @@ -2128,53 +2065,6 @@ outputsLoop: do o = 1,size(param(instance)%outputID) postResults(cs+1:cs+ns) = sum(rhoDotDip,2) cs = cs + ns - case (rho_dot_gen_edge_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotMultiplication(1:ns,1,of) - cs = cs + ns - - case (rho_dot_gen_screw_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotMultiplication(1:ns,2,of) - cs = cs + ns - - case (rho_dot_sgl2dip_edge_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotSingle2DipoleGlide(1:ns,1,of) - cs = cs + ns - - case (rho_dot_sgl2dip_screw_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotSingle2DipoleGlide(1:ns,2,of) - cs = cs + ns - - case (rho_dot_ann_ath_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotAthermalAnnihilation(1:ns,1,of) & - + results(instance)%rhoDotAthermalAnnihilation(1:ns,2,of) - cs = cs + ns - - case (rho_dot_ann_the_edge_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotThermalAnnihilation(1:ns,1,of) - cs = cs + ns - - case (rho_dot_ann_the_screw_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotThermalAnnihilation(1:ns,2,of) - cs = cs + ns - - case (rho_dot_edgejogs_ID) - postResults(cs+1:cs+ns) = results(instance)%rhoDotEdgeJogs(1:ns,of) - cs = cs + ns - - case (rho_dot_flux_mobile_ID) - postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,1:4,of),2) - cs = cs + ns - - case (rho_dot_flux_edge_ID) - postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,1:2,of),2) & - + sum(results(instance)%rhoDotFlux(1:ns,5:6,of)*sign(1.0_pReal,rhoSgl(1:ns,5:6)),2) - cs = cs + ns - - case (rho_dot_flux_screw_ID) - postResults(cs+1:cs+ns) = sum(results(instance)%rhoDotFlux(1:ns,3:4,of),2) & - + sum(results(instance)%rhoDotFlux(1:ns,7:8,of)*sign(1.0_pReal,rhoSgl(1:ns,7:8)),2) - cs = cs + ns - case (velocity_edge_pos_ID) postResults(cs+1:cs+ns) = v(1:ns,1) cs = cs + ns From c7d675a1e9345dc6a9243ff7b1f9b2f695726fdb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Nov 2019 16:03:18 +0100 Subject: [PATCH 04/18] not needed anymore --- src/crystallite.f90 | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index 672bd2112..a17213f9e 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -76,17 +76,6 @@ module crystallite crystallite_todo, & !< flag to indicate need for further computation crystallite_localPlasticity !< indicates this grain to have purely local constitutive law - enum, bind(c) - enumerator :: undefined_ID, & - orientation_ID, & - defgrad_ID, & - fp_ID, & - p_ID, & - elasmatrix_ID - end enum - integer(kind(undefined_ID)),dimension(:,:), allocatable :: & - crystallite_outputID !< ID of each post result output - type :: tOutput !< new requested output (per phase) character(len=65536), allocatable, dimension(:) :: & label @@ -136,15 +125,10 @@ subroutine crystallite_init c, & !< counter in integration point component loop i, & !< counter in integration point loop e, & !< counter in element loop - o = 0, & !< counter in output loop - r, & cMax, & !< maximum number of integration point components iMax, & !< maximum number of integration points eMax, & !< maximum number of elements - myNcomponents, & !< number of components at current IP - mySize - - character(len=65536), dimension(:), allocatable :: str + myNcomponents !< number of components at current IP write(6,'(/,a)') ' <<<+- crystallite init -+>>>' @@ -763,10 +747,7 @@ function crystallite_postResults(ipc, ip, el) sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & crystallite_postResults integer :: & - o, & - c, & - mySize, & - n + c crystallite_postResults = 0.0_pReal From 07fb915a7e55125059f4f8f4ffa1b5837d0bba5c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 08:27:56 +0100 Subject: [PATCH 05/18] postResults not needed anymore --- src/CPFEM.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CPFEM.f90 b/src/CPFEM.f90 index e549df30d..9bf8c547c 100644 --- a/src/CPFEM.f90 +++ b/src/CPFEM.f90 @@ -275,7 +275,6 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) & write(6,'(a,i8,1x,i2)') '<< CPFEM >> calculation for elFE ip ',elFE,ip call materialpoint_stressAndItsTangent(updateJaco, dt) ! calculate stress and its tangent - call materialpoint_postResults() !* parallel computation and calulation not yet done @@ -284,7 +283,6 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt write(6,'(a,i8,a,i8)') '<< CPFEM >> calculation for elements ',FEsolving_execElem(1),& ' to ',FEsolving_execElem(2) call materialpoint_stressAndItsTangent(updateJaco, dt) ! calculate stress and its tangent (parallel execution inside) - call materialpoint_postResults() CPFEM_calc_done = .true. endif From df4b642400470b5d81b2be36f203481b8bad6c44 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 08:33:04 +0100 Subject: [PATCH 06/18] polishing --- src/plastic_nonlocal.f90 | 61 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index e963ffe3c..82a2ad122 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -546,60 +546,59 @@ subroutine plastic_nonlocal_init dot%rho_sgl_mob_edg_neg => plasticState(p)%dotState (1*prm%totalNslip+1: 2*prm%totalNslip,:) del%rho_sgl_mob_edg_neg => plasticState(p)%deltaState (1*prm%totalNslip+1: 2*prm%totalNslip,:) - stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%totalNslip+1: 3*prm%totalNslip,:) - dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%totalNslip+1: 3*prm%totalNslip,:) - del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%totalNslip+1: 3*prm%totalNslip,:) + stt%rho_sgl_mob_scr_pos => plasticState(p)%state (2*prm%totalNslip+1: 3*prm%totalNslip,:) + dot%rho_sgl_mob_scr_pos => plasticState(p)%dotState (2*prm%totalNslip+1: 3*prm%totalNslip,:) + del%rho_sgl_mob_scr_pos => plasticState(p)%deltaState (2*prm%totalNslip+1: 3*prm%totalNslip,:) - stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%totalNslip+1: 4*prm%totalNslip,:) - dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%totalNslip+1: 4*prm%totalNslip,:) - del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%totalNslip+1: 4*prm%totalNslip,:) + stt%rho_sgl_mob_scr_neg => plasticState(p)%state (3*prm%totalNslip+1: 4*prm%totalNslip,:) + dot%rho_sgl_mob_scr_neg => plasticState(p)%dotState (3*prm%totalNslip+1: 4*prm%totalNslip,:) + del%rho_sgl_mob_scr_neg => plasticState(p)%deltaState (3*prm%totalNslip+1: 4*prm%totalNslip,:) stt%rhoSglImmobile => plasticState(p)%state (4*prm%totalNslip+1: 8*prm%totalNslip,:) dot%rhoSglImmobile => plasticState(p)%dotState (4*prm%totalNslip+1: 8*prm%totalNslip,:) - del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%totalNslip+1: 8*prm%totalNslip,:) + del%rhoSglImmobile => plasticState(p)%deltaState (4*prm%totalNslip+1: 8*prm%totalNslip,:) - stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%totalNslip+1: 5*prm%totalNslip,:) - dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%totalNslip+1: 5*prm%totalNslip,:) + stt%rho_sgl_imm_edg_pos => plasticState(p)%state (4*prm%totalNslip+1: 5*prm%totalNslip,:) + dot%rho_sgl_imm_edg_pos => plasticState(p)%dotState (4*prm%totalNslip+1: 5*prm%totalNslip,:) del%rho_sgl_imm_edg_pos => plasticState(p)%deltaState (4*prm%totalNslip+1: 5*prm%totalNslip,:) - stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%totalNslip+1: 6*prm%totalNslip,:) - dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%totalNslip+1: 6*prm%totalNslip,:) + stt%rho_sgl_imm_edg_neg => plasticState(p)%state (5*prm%totalNslip+1: 6*prm%totalNslip,:) + dot%rho_sgl_imm_edg_neg => plasticState(p)%dotState (5*prm%totalNslip+1: 6*prm%totalNslip,:) del%rho_sgl_imm_edg_neg => plasticState(p)%deltaState (5*prm%totalNslip+1: 6*prm%totalNslip,:) - stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%totalNslip+1: 7*prm%totalNslip,:) - dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState(6*prm%totalNslip+1: 7*prm%totalNslip,:) - del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState(6*prm%totalNslip+1: 7*prm%totalNslip,:) + stt%rho_sgl_imm_scr_pos => plasticState(p)%state (6*prm%totalNslip+1: 7*prm%totalNslip,:) + dot%rho_sgl_imm_scr_pos => plasticState(p)%dotState (6*prm%totalNslip+1: 7*prm%totalNslip,:) + del%rho_sgl_imm_scr_pos => plasticState(p)%deltaState (6*prm%totalNslip+1: 7*prm%totalNslip,:) - stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%totalNslip+1: 8*prm%totalNslip,:) - dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState(7*prm%totalNslip+1: 8*prm%totalNslip,:) - del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState(7*prm%totalNslip+1: 8*prm%totalNslip,:) + stt%rho_sgl_imm_scr_neg => plasticState(p)%state (7*prm%totalNslip+1: 8*prm%totalNslip,:) + dot%rho_sgl_imm_scr_neg => plasticState(p)%dotState (7*prm%totalNslip+1: 8*prm%totalNslip,:) + del%rho_sgl_imm_scr_neg => plasticState(p)%deltaState (7*prm%totalNslip+1: 8*prm%totalNslip,:) stt%rhoDip => plasticState(p)%state (8*prm%totalNslip+1:10*prm%totalNslip,:) dot%rhoDip => plasticState(p)%dotState (8*prm%totalNslip+1:10*prm%totalNslip,:) - del%rhoDip => plasticState(p)%deltaState (8*prm%totalNslip+1:10*prm%totalNslip,:) + del%rhoDip => plasticState(p)%deltaState (8*prm%totalNslip+1:10*prm%totalNslip,:) - stt%rho_dip_edg => plasticState(p)%state (8*prm%totalNslip+1: 9*prm%totalNslip,:) - dot%rho_dip_edg => plasticState(p)%dotState (8*prm%totalNslip+1: 9*prm%totalNslip,:) - del%rho_dip_edg => plasticState(p)%deltaState (8*prm%totalNslip+1: 9*prm%totalNslip,:) + stt%rho_dip_edg => plasticState(p)%state (8*prm%totalNslip+1: 9*prm%totalNslip,:) + dot%rho_dip_edg => plasticState(p)%dotState (8*prm%totalNslip+1: 9*prm%totalNslip,:) + del%rho_dip_edg => plasticState(p)%deltaState (8*prm%totalNslip+1: 9*prm%totalNslip,:) stt%rho_dip_scr => plasticState(p)%state (9*prm%totalNslip+1:10*prm%totalNslip,:) dot%rho_dip_scr => plasticState(p)%dotState (9*prm%totalNslip+1:10*prm%totalNslip,:) - del%rho_dip_scr => plasticState(p)%deltaState (9*prm%totalNslip+1:10*prm%totalNslip,:) + del%rho_dip_scr => plasticState(p)%deltaState (9*prm%totalNslip+1:10*prm%totalNslip,:) - stt%accumulatedshear => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - dot%accumulatedshear => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - del%accumulatedshear => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + stt%accumulatedshear => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + dot%accumulatedshear => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + del%accumulatedshear => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) plasticState(p)%aTolState(10*prm%totalNslip + 1:11*prm%totalNslip ) = prm%aTolShear - plasticState(p)%slipRate => plasticState(p)%dotState(10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - plasticState(p)%accumulatedSlip => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + plasticState(p)%accumulatedSlip => plasticState(p)%state(10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase) - stt%v => plasticState(p)%state (12*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase) + stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase) + stt%v => plasticState(p)%state (12*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase) allocate(dst%tau_Threshold(prm%totalNslip,NofMyPhase),source=0.0_pReal) - allocate(dst%tau_Back(prm%totalNslip,NofMyPhase),source=0.0_pReal) + allocate(dst%tau_Back(prm%totalNslip,NofMyPhase), source=0.0_pReal) end associate - if (NofMyPhase > 0) call stateInit(p,NofMyPhase) plasticState(p)%state0 = plasticState(p)%state From afad2f2dcee891c3bfa850dbd7a1ce00eb0a1920 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 08:39:30 +0100 Subject: [PATCH 07/18] short and consistent naming --- src/plastic_nonlocal.f90 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 82a2ad122..ae85dfe56 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -86,10 +86,10 @@ module plastic_nonlocal rho_dot_sgl_ID, & rho_dot_sgl_mobile_ID, & rho_dot_dip_ID, & - velocity_edge_pos_ID, & - velocity_edge_neg_ID, & - velocity_screw_pos_ID, & - velocity_screw_neg_ID, & + v_edg_pos_ID, & + v_edg_neg_ID, & + v_scr_pos_ID, & + v_scr_neg_ID, & accumulatedshear_ID end enum @@ -482,13 +482,13 @@ subroutine plastic_nonlocal_init case ('rho_dot_dip') outputID = merge(rho_dot_dip_ID,undefined_ID,prm%totalNslip>0) case ('velocity_edge_pos') - outputID = merge(velocity_edge_pos_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(v_edg_pos_ID,undefined_ID,prm%totalNslip>0) case ('velocity_edge_neg') - outputID = merge(velocity_edge_neg_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(v_edg_neg_ID,undefined_ID,prm%totalNslip>0) case ('velocity_screw_pos') - outputID = merge(velocity_screw_pos_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(v_scr_pos_ID,undefined_ID,prm%totalNslip>0) case ('velocity_screw_neg') - outputID = merge(velocity_screw_neg_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(v_scr_neg_ID,undefined_ID,prm%totalNslip>0) case ('accumulatedshear','accumulated_shear') outputID = merge(accumulatedshear_ID,undefined_ID,prm%totalNslip>0) end select @@ -2064,19 +2064,19 @@ outputsLoop: do o = 1,size(param(instance)%outputID) postResults(cs+1:cs+ns) = sum(rhoDotDip,2) cs = cs + ns - case (velocity_edge_pos_ID) + case (v_edg_pos_ID) postResults(cs+1:cs+ns) = v(1:ns,1) cs = cs + ns - case (velocity_edge_neg_ID) + case (v_edg_neg_ID) postResults(cs+1:cs+ns) = v(1:ns,2) cs = cs + ns - case (velocity_screw_pos_ID) + case (v_scr_pos_ID) postResults(cs+1:cs+ns) = v(1:ns,3) cs = cs + ns - case (velocity_screw_neg_ID) + case (v_scr_neg_ID) postResults(cs+1:cs+ns) = v(1:ns,4) cs = cs + ns From 33c090d2ac50a3ebd8c599ef87fd1d8ddf64fdb5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 08:55:24 +0100 Subject: [PATCH 08/18] pointers for better readability --- src/plastic_nonlocal.f90 | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index ae85dfe56..a5e0e751a 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -189,7 +189,11 @@ module plastic_nonlocal rho_dip_scr, & rho_forest, & accumulatedshear, & - v + v, & + v_edg_pos, & + v_edg_neg, & + v_scr_pos, & + v_scr_neg end type tNonlocalState type(tNonlocalState), allocatable, dimension(:), private :: & @@ -595,6 +599,10 @@ subroutine plastic_nonlocal_init stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase) stt%v => plasticState(p)%state (12*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase) + stt%v_edg_pos => plasticState(p)%state (12*prm%totalNslip + 1:13*prm%totalNslip ,1:NofMyPhase) + stt%v_edg_neg => plasticState(p)%state (13*prm%totalNslip + 1:14*prm%totalNslip ,1:NofMyPhase) + stt%v_scr_pos => plasticState(p)%state (14*prm%totalNslip + 1:15*prm%totalNslip ,1:NofMyPhase) + stt%v_scr_neg => plasticState(p)%state (15*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase) allocate(dst%tau_Threshold(prm%totalNslip,NofMyPhase),source=0.0_pReal) allocate(dst%tau_Back(prm%totalNslip,NofMyPhase), source=0.0_pReal) @@ -1159,7 +1167,7 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, & of = material_phasememberAt(1,ip,el) instance = phase_plasticityInstance(ph) - associate(prm => param(instance),dst=>microstructure(instance)) + associate(prm => param(instance),dst=>microstructure(instance),stt=>state(instance)) ns = prm%totalNslip !*** shortcut to state variables @@ -1210,11 +1218,8 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, & 2 , Temperature, instance, of) enddo endif - - - !*** store velocity in state - forall (t = 1:4) & - plasticState(ph)%state(iV(1:ns,t,instance),of) = v(1:ns,t) + + stt%v(:,of) = pack(v,.true.) !*** Bauschinger effect forall (s = 1:ns, t = 5:8, rhoSgl(s,t) * v(s,t-4) < 0.0_pReal) & @@ -1975,8 +1980,6 @@ function plastic_nonlocal_postResults(ph,instance,of) result(postResults) real(pReal), dimension(param(instance)%totalNslip,8) :: & rhoSgl, & rhoDotSgl !< evolution rate of single dislocation densities (positive/negative screw and edge without dipoles) - real(pReal), dimension(param(instance)%totalNslip,4) :: & - v !< velocities real(pReal), dimension(param(instance)%totalNslip,2) :: & rhoDotDip !< evolution rate of dipole dislocation densities (screw and edge dipoles) @@ -1989,7 +1992,6 @@ associate(prm => param(instance),dst => microstructure(instance),stt=>state(inst forall (s = 1:ns, t = 1:4) rhoSgl(s,t+4) = plasticState(ph)%State(iRhoB(s,t,instance),of) - v(s,t) = plasticState(ph)%State(iV(s,t,instance),of) rhoDotSgl(s,t+4) = plasticState(ph)%dotState(iRhoB(s,t,instance),of) endforall forall (s = 1:ns, c = 1:2) @@ -2065,19 +2067,19 @@ outputsLoop: do o = 1,size(param(instance)%outputID) cs = cs + ns case (v_edg_pos_ID) - postResults(cs+1:cs+ns) = v(1:ns,1) + postResults(cs+1:cs+ns) = stt%v_edg_pos(:,of) cs = cs + ns case (v_edg_neg_ID) - postResults(cs+1:cs+ns) = v(1:ns,2) + postResults(cs+1:cs+ns) = stt%v_edg_neg(:,of) cs = cs + ns case (v_scr_pos_ID) - postResults(cs+1:cs+ns) = v(1:ns,3) + postResults(cs+1:cs+ns) = stt%v_scr_pos(:,of) cs = cs + ns case (v_scr_neg_ID) - postResults(cs+1:cs+ns) = v(1:ns,4) + postResults(cs+1:cs+ns) = stt%v_scr_neg(:,of) cs = cs + ns case(accumulatedshear_ID) @@ -2163,6 +2165,18 @@ subroutine plastic_nonlocal_results(instance,group) case (rho_forest_ID) call results_writeDataset(group,stt%rho_forest, 'rho_forest',& 'forest density','1/m²') + case (v_edg_pos_ID) + call results_writeDataset(group,stt%v_edg_pos, 'v_edg_pos',& + 'positive edge velocity','m/s') + case (v_edg_neg_ID) + call results_writeDataset(group,stt%v_edg_neg, 'v_edg_neg',& + 'negative edge velocity','m/s') + case (v_scr_pos_ID) + call results_writeDataset(group,stt%v_scr_pos, 'v_scr_pos',& + 'positive srew velocity','m/s') + case (v_scr_neg_ID) + call results_writeDataset(group,stt%v_scr_neg, 'v_scr_neg',& + 'negative screw velocity','m/s') end select enddo outputsLoop end associate From 1cf1da5bccc6ae909967dc6ef88897820ab18a29 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 09:35:44 +0100 Subject: [PATCH 09/18] consistent naming --- src/plastic_disloUCLA.f90 | 2 +- src/plastic_nonlocal.f90 | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/plastic_disloUCLA.f90 b/src/plastic_disloUCLA.f90 index 48dc12f15..0a8a3b0ee 100644 --- a/src/plastic_disloUCLA.f90 +++ b/src/plastic_disloUCLA.f90 @@ -480,7 +480,7 @@ subroutine plastic_disloUCLA_results(instance,group) call results_writeDataset(group,stt%rho_dip,'rho_dip',& 'dislocation dipole density''1/m²') case (dot_gamma_sl_ID) - call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',& + call results_writeDataset(group,stt%gamma_sl,'dot_gamma_sl',& ! this is not dot!! 'plastic shear','1') case (Lambda_sl_ID) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',& diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index a5e0e751a..b4665566b 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -90,7 +90,7 @@ module plastic_nonlocal v_edg_neg_ID, & v_scr_pos_ID, & v_scr_neg_ID, & - accumulatedshear_ID + gamma_ID end enum type, private :: tParameters !< container type for internal constitutive parameters @@ -188,7 +188,7 @@ module plastic_nonlocal rho_dip_edg, & rho_dip_scr, & rho_forest, & - accumulatedshear, & + gamma, & v, & v_edg_pos, & v_edg_neg, & @@ -494,7 +494,7 @@ subroutine plastic_nonlocal_init case ('velocity_screw_neg') outputID = merge(v_scr_neg_ID,undefined_ID,prm%totalNslip>0) case ('accumulatedshear','accumulated_shear') - outputID = merge(accumulatedshear_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(gamma_ID,undefined_ID,prm%totalNslip>0) end select if (outputID /= undefined_ID) then @@ -513,7 +513,7 @@ subroutine plastic_nonlocal_init 'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', & 'rhoSglScrewPosImmobile','rhoSglScrewNegImmobile', & 'rhoDipEdge ','rhoDipScrew ', & - 'accumulatedshear ' ]) * prm%totalNslip !< "basic" microstructural state variables that are independent from other state variables + 'gamma ' ]) * prm%totalNslip !< "basic" microstructural state variables that are independent from other state variables sizeDependentState = size([ 'rhoForest ']) * prm%totalNslip !< microstructural state variables that depend on other state variables sizeState = sizeDotState + sizeDependentState & + size([ 'velocityEdgePos ','velocityEdgeNeg ', & @@ -590,9 +590,9 @@ subroutine plastic_nonlocal_init dot%rho_dip_scr => plasticState(p)%dotState (9*prm%totalNslip+1:10*prm%totalNslip,:) del%rho_dip_scr => plasticState(p)%deltaState (9*prm%totalNslip+1:10*prm%totalNslip,:) - stt%accumulatedshear => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - dot%accumulatedshear => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) - del%accumulatedshear => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + stt%gamma => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + dot%gamma => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) + del%gamma => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) plasticState(p)%aTolState(10*prm%totalNslip + 1:11*prm%totalNslip ) = prm%aTolShear plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) plasticState(p)%accumulatedSlip => plasticState(p)%state(10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase) @@ -1803,7 +1803,7 @@ subroutine plastic_nonlocal_dotState(Mp, Fe, Fp, Temperature, & else dot%rho(:,o) = pack(rhoDot,.true.) forall (s = 1:ns) & - dot%accumulatedshear(s,o) = sum(gdot(s,1:4)) + dot%gamma(s,o) = sum(gdot(s,1:4)) endif end associate @@ -2082,8 +2082,8 @@ outputsLoop: do o = 1,size(param(instance)%outputID) postResults(cs+1:cs+ns) = stt%v_scr_neg(:,of) cs = cs + ns - case(accumulatedshear_ID) - postResults(cs+1:cs+ns) = stt%accumulatedshear(:,of) + case(gamma_ID) + postResults(cs+1:cs+ns) = stt%gamma(:,of) cs = cs + ns end select @@ -2177,6 +2177,9 @@ subroutine plastic_nonlocal_results(instance,group) case (v_scr_neg_ID) call results_writeDataset(group,stt%v_scr_neg, 'v_scr_neg',& 'negative screw velocity','m/s') + case(gamma_ID) + call results_writeDataset(group,stt%gamma,'gamma',& + 'plastic shear','1') end select enddo outputsLoop end associate From bb152a171a6a76ce030b76ec304c50601e2712f6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 10:32:45 +0100 Subject: [PATCH 10/18] consistent naming among plasticity laws --- src/plastic_disloUCLA.f90 | 6 +++--- src/plastic_dislotwin.f90 | 6 +++--- src/plastic_nonlocal.f90 | 25 ++++++++++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/plastic_disloUCLA.f90 b/src/plastic_disloUCLA.f90 index 0a8a3b0ee..29ef0fcc9 100644 --- a/src/plastic_disloUCLA.f90 +++ b/src/plastic_disloUCLA.f90 @@ -30,7 +30,7 @@ module plastic_disloUCLA dot_gamma_sl_ID, & gamma_sl_ID, & Lambda_sl_ID, & - thresholdstress_ID + tau_pass_ID end enum type, private :: tParameters @@ -274,7 +274,7 @@ subroutine plastic_disloUCLA_init() case ('mfp','mfp_slip') outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl>0) case ('threshold_stress','threshold_stress_slip') - outputID = merge(thresholdstress_ID,undefined_ID,prm%sum_N_sl>0) + outputID = merge(tau_pass_ID,undefined_ID,prm%sum_N_sl>0) end select @@ -485,7 +485,7 @@ subroutine plastic_disloUCLA_results(instance,group) case (Lambda_sl_ID) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',& 'mean free path for slip','m') - case (thresholdstress_ID) + case (tau_pass_ID) call results_writeDataset(group,dst%threshold_stress,'tau_pass',& 'threshold stress for slip','Pa') end select diff --git a/src/plastic_dislotwin.f90 b/src/plastic_dislotwin.f90 index 6bbf87060..1f731a891 100644 --- a/src/plastic_dislotwin.f90 +++ b/src/plastic_dislotwin.f90 @@ -33,7 +33,7 @@ module plastic_dislotwin gamma_sl_ID, & Lambda_sl_ID, & resolved_stress_slip_ID, & - threshold_stress_slip_ID, & + tau_pass_ID, & edge_dipole_distance_ID, & f_tw_ID, & Lambda_tw_ID, & @@ -477,7 +477,7 @@ subroutine plastic_dislotwin_init outputID = merge(Lambda_sl_ID,undefined_ID,prm%sum_N_sl > 0) outputSize = prm%sum_N_sl case ('tau_pass') - outputID= merge(threshold_stress_slip_ID,undefined_ID,prm%sum_N_sl > 0) + outputID= merge(tau_pass_ID,undefined_ID,prm%sum_N_sl > 0) outputSize = prm%sum_N_sl case ('f_tw') @@ -948,7 +948,7 @@ subroutine plastic_dislotwin_results(instance,group) case (Lambda_sl_ID) call results_writeDataset(group,dst%Lambda_sl,'Lambda_sl',& 'mean free path for slip','m') - case (threshold_stress_slip_ID) + case (tau_pass_ID) call results_writeDataset(group,dst%tau_pass,'tau_pass',& 'passing stress for slip','Pa') diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index b4665566b..63ade72db 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -82,7 +82,7 @@ module plastic_nonlocal rho_dip_scr_ID, & rho_forest_ID, & resolvedstress_back_ID, & - resistance_ID, & + tau_pass_ID, & rho_dot_sgl_ID, & rho_dot_sgl_mobile_ID, & rho_dot_dip_ID, & @@ -166,7 +166,7 @@ module plastic_nonlocal type, private :: tNonlocalMicrostructure real(pReal), allocatable, dimension(:,:) :: & - tau_Threshold, & + tau_pass, & tau_Back end type tNonlocalMicrostructure @@ -478,7 +478,7 @@ subroutine plastic_nonlocal_init case ('resolvedstress_back') outputID = merge(resolvedstress_back_ID,undefined_ID,prm%totalNslip>0) case ('resistance') - outputID = merge(resistance_ID,undefined_ID,prm%totalNslip>0) + outputID = merge(tau_pass_ID,undefined_ID,prm%totalNslip>0) case ('rho_dot_sgl') outputID = merge(rho_dot_sgl_ID,undefined_ID,prm%totalNslip>0) case ('rho_dot_sgl_mobile') @@ -604,7 +604,7 @@ subroutine plastic_nonlocal_init stt%v_scr_pos => plasticState(p)%state (14*prm%totalNslip + 1:15*prm%totalNslip ,1:NofMyPhase) stt%v_scr_neg => plasticState(p)%state (15*prm%totalNslip + 1:16*prm%totalNslip ,1:NofMyPhase) - allocate(dst%tau_Threshold(prm%totalNslip,NofMyPhase),source=0.0_pReal) + allocate(dst%tau_pass(prm%totalNslip,NofMyPhase),source=0.0_pReal) allocate(dst%tau_Back(prm%totalNslip,NofMyPhase), source=0.0_pReal) end associate @@ -851,7 +851,7 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el) endif forall (s = 1:ns) & - dst%tau_threshold(s,of) = prm%mu * prm%burgers(s) & + dst%tau_pass(s,of) = prm%mu * prm%burgers(s) & * sqrt(dot_product(sum(abs(rho),2), myInteractionMatrix(1:ns,s))) @@ -968,7 +968,7 @@ subroutine plastic_nonlocal_dependentState(Fe, Fp, ip, el) .or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then write(6,'(/,a,i8,1x,i2,1x,i1,/)') '<< CONST >> nonlocal_microstructure at el ip ',el,ip write(6,'(a,/,12x,12(e10.3,1x))') '<< CONST >> rhoForest', stt%rho_forest(:,of) - write(6,'(a,/,12x,12(f10.5,1x))') '<< CONST >> tauThreshold / MPa', dst%tau_threshold(:,of)*1e-6 + write(6,'(a,/,12x,12(f10.5,1x))') '<< CONST >> tauThreshold / MPa', dst%tau_pass(:,of)*1e-6 write(6,'(a,/,12x,12(f10.5,1x),/)') '<< CONST >> tauBack / MPa', dst%tau_back(:,of)*1e-6 endif #endif @@ -1198,7 +1198,7 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, & ! edges call plastic_nonlocal_kinetics(v(1:ns,1), dv_dtau(1:ns,1), dv_dtauNS(1:ns,1), & - tau(1:ns), tauNS(1:ns,1), dst%tau_Threshold(1:ns,of), & + tau(1:ns), tauNS(1:ns,1), dst%tau_pass(1:ns,of), & 1, Temperature, instance, of) v(1:ns,2) = v(1:ns,1) dv_dtau(1:ns,2) = dv_dtau(1:ns,1) @@ -1214,7 +1214,7 @@ subroutine plastic_nonlocal_LpAndItsTangent(Lp, dLp_dMp, & else do t = 3,4 call plastic_nonlocal_kinetics(v(1:ns,t), dv_dtau(1:ns,t), dv_dtauNS(1:ns,t), & - tau(1:ns), tauNS(1:ns,t), dst%tau_Threshold(1:ns,of), & + tau(1:ns), tauNS(1:ns,t), dst%tau_pass(1:ns,of), & 2 , Temperature, instance, of) enddo endif @@ -2049,8 +2049,8 @@ outputsLoop: do o = 1,size(param(instance)%outputID) postResults(cs+1:cs+ns) = dst%tau_back(:,of) cs = cs + ns - case (resistance_ID) - postResults(cs+1:cs+ns) = dst%tau_Threshold(:,of) + case (tau_pass_ID) + postResults(cs+1:cs+ns) = dst%tau_pass(:,of) cs = cs + ns case (rho_dot_sgl_ID) @@ -2129,7 +2129,7 @@ subroutine plastic_nonlocal_results(instance,group) character(len=*) :: group integer :: o - associate(prm => param(instance), stt => state(instance)) + associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance)) outputsLoop: do o = 1,size(prm%outputID) select case(prm%outputID(o)) case (rho_sgl_mob_edg_pos_ID) @@ -2180,6 +2180,9 @@ subroutine plastic_nonlocal_results(instance,group) case(gamma_ID) call results_writeDataset(group,stt%gamma,'gamma',& 'plastic shear','1') + case (tau_pass_ID) + call results_writeDataset(group,dst%tau_pass,'tau_pass',& + 'passing stress for slip','Pa') end select enddo outputsLoop end associate From 05aa38cc718d4dc8b462e651975f21fb6dde9471 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 15:05:49 +0100 Subject: [PATCH 11/18] using short names --- src/math.f90 | 4 ++++ src/plastic_nonlocal.f90 | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 5a3a5f467..7eba379d2 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -840,6 +840,7 @@ end function math_Voigt66to3333 !-------------------------------------------------------------------------------------------------- !> @brief action of a quaternion on a vector (rotate vector v with Q) +!> @details deprecated !-------------------------------------------------------------------------------------------------- pure function math_qRot(Q,v) @@ -1329,6 +1330,7 @@ end function math_areaTriangle !-------------------------------------------------------------------------------------------------- !> @brief rotate 33 tensor forward +!> @details deprecated !-------------------------------------------------------------------------------------------------- pure function math_rotate_forward33(tensor,R) @@ -1342,6 +1344,7 @@ end function math_rotate_forward33 !-------------------------------------------------------------------------------------------------- !> @brief rotate 33 tensor backward +!> @details deprecated !-------------------------------------------------------------------------------------------------- pure function math_rotate_backward33(tensor,R) @@ -1355,6 +1358,7 @@ end function math_rotate_backward33 !-------------------------------------------------------------------------------------------------- !> @brief rotate 3333 tensor C'_ijkl=g_im*g_jn*g_ko*g_lp*C_mnop +!> @details deprecated !-------------------------------------------------------------------------------------------------- pure function math_rotate_forward3333(tensor,R) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 63ade72db..0f0e3aa3a 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -453,31 +453,31 @@ subroutine plastic_nonlocal_init do i=1, size(outputs) outputID = undefined_ID select case(trim(outputs(i))) - case ('rho_sgl_edge_pos_mobile') + case ('rho_sgl_edge_pos_mob') outputID = merge(rho_sgl_mob_edg_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_neg_mobile') + case ('rho_sgl_edge_neg_mob') outputID = merge(rho_sgl_mob_edg_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_pos_mobile') + case ('rho_sgl_screw_pos_mob') outputID = merge(rho_sgl_mob_scr_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_neg_mobile') + case ('rho_sgl_screw_neg_mob') outputID = merge(rho_sgl_mob_scr_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_pos_immobile') + case ('rho_sgl_edge_pos_imm') outputID = merge(rho_sgl_imm_edg_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_neg_immobile') + case ('rho_sgl_edge_neg_imm') outputID = merge(rho_sgl_imm_edg_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_pos_immobile') + case ('rho_sgl_screw_pos_imm') outputID = merge(rho_sgl_imm_scr_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_neg_immobile') + case ('rho_sgl_screw_neg_imm') outputID = merge(rho_sgl_imm_scr_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dip_edge') + case ('rho_dip_edg') outputID = merge(rho_dip_edg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_dip_screw') + case ('rho_dip_scr') outputID = merge(rho_dip_scr_ID,undefined_ID,prm%totalNslip>0) case ('rho_forest') outputID = merge(rho_forest_ID,undefined_ID,prm%totalNslip>0) case ('resolvedstress_back') outputID = merge(resolvedstress_back_ID,undefined_ID,prm%totalNslip>0) - case ('resistance') + case ('tau_pass') outputID = merge(tau_pass_ID,undefined_ID,prm%totalNslip>0) case ('rho_dot_sgl') outputID = merge(rho_dot_sgl_ID,undefined_ID,prm%totalNslip>0) @@ -485,15 +485,15 @@ subroutine plastic_nonlocal_init outputID = merge(rho_dot_sgl_mobile_ID,undefined_ID,prm%totalNslip>0) case ('rho_dot_dip') outputID = merge(rho_dot_dip_ID,undefined_ID,prm%totalNslip>0) - case ('velocity_edge_pos') + case ('v_edg_pos') outputID = merge(v_edg_pos_ID,undefined_ID,prm%totalNslip>0) - case ('velocity_edge_neg') + case ('v_edg_neg') outputID = merge(v_edg_neg_ID,undefined_ID,prm%totalNslip>0) - case ('velocity_screw_pos') + case ('v_scr_pos') outputID = merge(v_scr_pos_ID,undefined_ID,prm%totalNslip>0) - case ('velocity_screw_neg') + case ('v_scr_neg') outputID = merge(v_scr_neg_ID,undefined_ID,prm%totalNslip>0) - case ('accumulatedshear','accumulated_shear') + case ('gamma') outputID = merge(gamma_ID,undefined_ID,prm%totalNslip>0) end select From 2b3b26087f795b00f8bda8ec731a1684193bc3cc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Dec 2019 20:07:16 +0100 Subject: [PATCH 12/18] consistent names --- PRIVATE | 2 +- .../Phase_Nonlocal_Aluminum.config | 67 +++++-------------- .../ConfigFiles/Phase_Nonlocal_Nickel.config | 41 +++++------- src/plastic_nonlocal.f90 | 16 ++--- 4 files changed, 42 insertions(+), 84 deletions(-) diff --git a/PRIVATE b/PRIVATE index 633a2d1ba..1d177aa3f 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 633a2d1ba8c1f96c0362a35af407304228934b0d +Subproject commit 1d177aa3f080eacf9fca568070707f04cd7058d6 diff --git a/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config b/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config index 6406a47c0..fd18aa719 100644 --- a/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config +++ b/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config @@ -4,58 +4,23 @@ elasticity hooke plasticity nonlocal /nonlocal/ -(output) rho -(output) rho_edge -(output) rho_screw -(output) rho_sgl -(output) rho_sgl_edge_pos -(output) rho_sgl_edge_neg -(output) rho_sgl_screw_pos -(output) rho_sgl_screw_neg -(output) rho_sgl_edge_pos_mobile -(output) rho_sgl_edge_neg_mobile -(output) rho_sgl_screw_pos_mobile -(output) rho_sgl_screw_neg_mobile -(output) rho_sgl_edge_pos_immobile -(output) rho_sgl_edge_neg_immobile -(output) rho_sgl_screw_pos_immobile -(output) rho_sgl_screw_neg_immobile -(output) rho_dip_edge -(output) rho_dip_screw +(output) rho_sgl_mob_edg_pos +(output) rho_sgl_imm_edg_pos +(output) rho_sgl_mob_edg_neg +(output) rho_sgl_imm_edg_neg +(output) rho_sgl_mob_scr_pos +(output) rho_sgl_imm_scr_pos +(output) rho_sgl_mob_scr_neg +(output) rho_sgl_imm_scr_neg +(output) rho_dip_edg +(output) rho_dip_scr (output) rho_forest -(output) delta -(output) delta_sgl -(output) delta_dip -(output) shearrate -(output) resolvedstress -(output) resolvedstress_back -(output) resolvedstress_external -(output) resistance -(output) rho_dot -(output) rho_dot_sgl -(output) rho_dot_sgl_mobile -(output) rho_dot_dip -(output) rho_dot_gen_edge -(output) rho_dot_gen_screw -(output) rho_dot_sgl2dip_edge -(output) rho_dot_sgl2dip_screw -(output) rho_dot_ann_ath -(output) rho_dot_ann_the -(output) rho_dot_ann_the_edge -(output) rho_dot_ann_the_screw -(output) rho_dot_edgejogs -(output) rho_dot_flux -(output) rho_dot_flux_mobile -(output) rho_dot_flux_edge -(output) rho_dot_flux_screw -(output) velocity_edge_pos -(output) velocity_edge_neg -(output) velocity_screw_pos -(output) velocity_screw_neg -(output) maximumDipoleHeight_edge -(output) maximumDipoleHeight_screw -(output) accumulated_shear -(output) dislocationstress +(output) gamma +(output) tau_pass +(output) v_edg_pos +(output) v_edg_neg +(output) v_scr_pos +(output) v_scr_neg lattice_structure fcc Nslip 12 # number of slip systems diff --git a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config index 3420b4246..3cba4d975 100644 --- a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config +++ b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config @@ -3,31 +3,24 @@ elasticity hooke plasticity nonlocal /nonlocal/ - -(output) rho -(output) rho_sgl_mobile -(output) rho_sgl_immobile -(output) rho_sgl_edge_pos -(output) rho_sgl_edge_neg -(output) rho_sgl_screw_pos -(output) rho_sgl_screw_neg -(output) rho_dip_edge -(output) rho_dip_screw +(output) rho_sgl_mob_edg_pos +(output) rho_sgl_imm_edg_pos +(output) rho_sgl_mob_edg_neg +(output) rho_sgl_imm_edg_neg +(output) rho_sgl_mob_scr_pos +(output) rho_sgl_imm_scr_pos +(output) rho_sgl_mob_scr_neg +(output) rho_sgl_imm_scr_neg +(output) rho_dip_edg +(output) rho_dip_scr (output) rho_forest -(output) accumulatedshear -(output) shearrate -(output) resolvedstress -(output) resistance -(output) velocity_edge_pos -(output) rho_dot_gen -(output) rho_dot_sgl2dip_edge -(output) rho_dot_sgl2dip_screw -(output) rho_dot_ann_ath -(output) rho_dot_ann_the_edge -(output) rho_dot_ann_the_screw -(output) rho_dot_edgejogs -(output) rho_dot_flux_edge -(output) rho_dot_flux_screw +(output) gamma +(output) tau_pass +(output) v_edg_pos +(output) v_edg_neg +(output) v_scr_pos +(output) v_scr_neg + lattice_structure fcc Nslip 12 # number of slip systems per family diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 0f0e3aa3a..c2400494c 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -453,21 +453,21 @@ subroutine plastic_nonlocal_init do i=1, size(outputs) outputID = undefined_ID select case(trim(outputs(i))) - case ('rho_sgl_edge_pos_mob') + case ('rho_sgl_mob_edg_pos') outputID = merge(rho_sgl_mob_edg_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_neg_mob') + case ('rho_sgl_mob_edg_neg') outputID = merge(rho_sgl_mob_edg_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_pos_mob') + case ('rho_sgl_mob_scr_pos') outputID = merge(rho_sgl_mob_scr_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_neg_mob') + case ('rho_sgl_mob_scr_neg') outputID = merge(rho_sgl_mob_scr_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_pos_imm') + case ('rho_sgl_imm_edg_pos') outputID = merge(rho_sgl_imm_edg_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_edge_neg_imm') + case ('rho_sgl_imm_edg_neg') outputID = merge(rho_sgl_imm_edg_neg_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_pos_imm') + case ('rho_sgl_imm_scr_pos') outputID = merge(rho_sgl_imm_scr_pos_ID,undefined_ID,prm%totalNslip>0) - case ('rho_sgl_screw_neg_imm') + case ('rho_sgl_imm_scr_neg') outputID = merge(rho_sgl_imm_scr_neg_ID,undefined_ID,prm%totalNslip>0) case ('rho_dip_edg') outputID = merge(rho_dip_edg_ID,undefined_ID,prm%totalNslip>0) From 5d524e128310f9c2e6ac5a1b02907317ee052184 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 08:55:09 +0100 Subject: [PATCH 13/18] tests for nonlocal updated in PRIVATE --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 1d177aa3f..524e86c11 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 1d177aa3f080eacf9fca568070707f04cd7058d6 +Subproject commit 524e86c117d816e3bd873eed7663e258a6f2e139 From f85ee7d7fb1b454c2920784a955213b9965345f5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 12:39:44 +0100 Subject: [PATCH 14/18] plasticity is postResults-free --- src/constitutive.f90 | 87 ++---------------------------------------- src/homogenization.f90 | 5 +-- 2 files changed, 6 insertions(+), 86 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index a571355a1..4067c026a 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -36,7 +36,6 @@ module constitutive private integer, public, protected :: & - constitutive_plasticity_maxSizePostResults, & constitutive_plasticity_maxSizeDotState, & constitutive_source_maxSizePostResults, & constitutive_source_maxSizeDotState @@ -72,8 +71,7 @@ subroutine constitutive_init integer, dimension(:,:), pointer :: thisSize character(len=64), dimension(:,:), pointer :: thisOutput character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready - logical :: knownPlasticity, knownSource, nonlocalConstitutionPresent - nonlocalConstitutionPresent = .false. + logical :: knownSource !-------------------------------------------------------------------------------------------------- ! initialized plasticity @@ -111,64 +109,11 @@ subroutine constitutive_init call IO_write_jobFile(FILEUNIT,'outputConstitutive') PhaseLoop: do ph = 1,material_Nphase activePhase: if (any(material_phaseAt == ph)) then - ins = phase_plasticityInstance(ph) - knownPlasticity = .true. ! assume valid - plasticityType: select case(phase_plasticity(ph)) - case (PLASTICITY_NONE_ID) plasticityType - outputName = PLASTICITY_NONE_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_ISOTROPIC_ID) plasticityType - outputName = PLASTICITY_ISOTROPIC_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType - outputName = PLASTICITY_PHENOPOWERLAW_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_KINEHARDENING_ID) plasticityType - outputName = PLASTICITY_KINEHARDENING_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_DISLOTWIN_ID) plasticityType - outputName = PLASTICITY_DISLOTWIN_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_DISLOUCLA_ID) plasticityType - outputName = PLASTICITY_DISLOUCLA_label - thisOutput => null() - thisSize => null() - case (PLASTICITY_NONLOCAL_ID) plasticityType - outputName = PLASTICITY_NONLOCAL_label - thisOutput => plastic_nonlocal_output - thisSize => plastic_nonlocal_sizePostResult - case default plasticityType - knownPlasticity = .false. - end select plasticityType write(FILEUNIT,'(/,a,/)') '['//trim(config_name_phase(ph))//']' - if (knownPlasticity) then - write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName) - if (associated(thisOutput)) then - OutputPlasticityLoop: do o = 1,size(thisOutput(:,ins)) - if(len_trim(thisOutput(o,ins)) > 0) & - write(FILEUNIT,'(a,i4)') trim(thisOutput(o,ins))//char(9),thisSize(o,ins) - enddo OutputPlasticityLoop - endif - endif SourceLoop: do s = 1, phase_Nsources(ph) - knownSource = .true. ! assume valid + knownSource = .true. ! assume valid sourceType: select case (phase_source(s,ph)) - case (SOURCE_thermal_dissipation_ID) sourceType - ins = source_thermal_dissipation_instance(ph) - outputName = SOURCE_thermal_dissipation_label - thisOutput => source_thermal_dissipation_output - thisSize => source_thermal_dissipation_sizePostResult - case (SOURCE_thermal_externalheat_ID) sourceType - ins = source_thermal_externalheat_instance(ph) - outputName = SOURCE_thermal_externalheat_label - thisOutput => source_thermal_externalheat_output - thisSize => source_thermal_externalheat_sizePostResult case (SOURCE_damage_isoBrittle_ID) sourceType ins = source_damage_isoBrittle_instance(ph) outputName = SOURCE_damage_isoBrittle_label @@ -206,7 +151,6 @@ subroutine constitutive_init endif mainProcess constitutive_plasticity_maxSizeDotState = 0 - constitutive_plasticity_maxSizePostResults = 0 constitutive_source_maxSizeDotState = 0 constitutive_source_maxSizePostResults = 0 @@ -223,8 +167,6 @@ subroutine constitutive_init ! determine max size of state and output constitutive_plasticity_maxSizeDotState = max(constitutive_plasticity_maxSizeDotState, & plasticState(ph)%sizeDotState) - constitutive_plasticity_maxSizePostResults = max(constitutive_plasticity_maxSizePostResults, & - plasticState(ph)%sizePostResults) constitutive_source_maxSizeDotState = max(constitutive_source_maxSizeDotState, & maxval(sourceState(ph)%p(:)%sizeDotState)) constitutive_source_maxSizePostResults = max(constitutive_source_maxSizePostResults, & @@ -706,42 +648,21 @@ function constitutive_postResults(S, Fi, ipc, ip, el) ipc, & !< component-ID of integration point ip, & !< integration point el !< element - real(pReal), dimension(plasticState(material_phaseAt(ipc,el))%sizePostResults + & - sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & + real(pReal), dimension(sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & constitutive_postResults real(pReal), intent(in), dimension(3,3) :: & Fi !< intermediate deformation gradient real(pReal), intent(in), dimension(3,3) :: & S !< 2nd Piola Kirchhoff stress - real(pReal), dimension(3,3) :: & - Mp !< Mandel stress integer :: & startPos, endPos integer :: & - ho, & !< homogenization - tme, & !< thermal member position i, of, instance !< counter in source loop constitutive_postResults = 0.0_pReal - Mp = matmul(matmul(transpose(Fi),Fi),S) - ho = material_homogenizationAt(el) - tme = thermalMapping(ho)%p(ip,el) - - startPos = 1 - endPos = plasticState(material_phaseAt(ipc,el))%sizePostResults - - of = material_phasememberAt(ipc,ip,el) - instance = phase_plasticityInstance(material_phaseAt(ipc,el)) - - plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el))) - - case (PLASTICITY_NONLOCAL_ID) plasticityType - constitutive_postResults(startPos:endPos) = & - plastic_nonlocal_postResults (material_phaseAt(ipc,el),instance,of) - - end select plasticityType + endPos = 0 SourceLoop: do i = 1, phase_Nsources(material_phaseAt(ipc,el)) startPos = endPos + 1 diff --git a/src/homogenization.f90 b/src/homogenization.f90 index a62f94820..618c2faf8 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -262,9 +262,8 @@ subroutine homogenization_init materialpoint_sizeResults = 1 & ! grain count + 1 + thermal_maxSizePostResults & + damage_maxSizePostResults & - + homogenization_maxNgrains * (1 & ! crystallite size - + 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results - + constitutive_source_maxSizePostResults) + + homogenization_maxNgrains * ( 1 & ! crystallite size + + 1 + constitutive_source_maxSizePostResults) allocate(materialpoint_results(materialpoint_sizeResults,discretization_nIP,discretization_nElem)) write(6,'(/,a)') ' <<<+- homogenization init -+>>>' From 2969a53338d11efec1f026835afc1afdac911172 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 12:54:45 +0100 Subject: [PATCH 15/18] not used/needed anymore --- src/plastic_nonlocal.f90 | 137 --------------------------------------- 1 file changed, 137 deletions(-) diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index c2400494c..23bfb50aa 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -215,7 +215,6 @@ module plastic_nonlocal plastic_nonlocal_dotState, & plastic_nonlocal_deltaState, & plastic_nonlocal_updateCompatibility, & - plastic_nonlocal_postResults, & plastic_nonlocal_results private :: & @@ -1956,142 +1955,6 @@ subroutine plastic_nonlocal_updateCompatibility(orientation,i,e) end subroutine plastic_nonlocal_updateCompatibility -!-------------------------------------------------------------------------------------------------- -!> @brief return array of constitutive results -!-------------------------------------------------------------------------------------------------- -function plastic_nonlocal_postResults(ph,instance,of) result(postResults) - - integer, intent(in) :: & - ph, & - instance, & - of - - real(pReal), dimension(sum(plastic_nonlocal_sizePostResult(:,instance))) :: & - postResults - - integer :: & - ns, & !< short notation for the total number of active slip systems - c, & !< character of dislocation - cs, & !< constitutive result index - o, & !< index of current output - t, & !< type of dislocation - s !< index of my current slip system - - real(pReal), dimension(param(instance)%totalNslip,8) :: & - rhoSgl, & - rhoDotSgl !< evolution rate of single dislocation densities (positive/negative screw and edge without dipoles) - real(pReal), dimension(param(instance)%totalNslip,2) :: & - rhoDotDip !< evolution rate of dipole dislocation densities (screw and edge dipoles) - - -ns = param(instance)%totalNslip - -cs = 0 - -associate(prm => param(instance),dst => microstructure(instance),stt=>state(instance),dot => dotState(instance)) - -forall (s = 1:ns, t = 1:4) - rhoSgl(s,t+4) = plasticState(ph)%State(iRhoB(s,t,instance),of) - rhoDotSgl(s,t+4) = plasticState(ph)%dotState(iRhoB(s,t,instance),of) -endforall -forall (s = 1:ns, c = 1:2) - rhoDotDip(s,c) = plasticState(ph)%dotState(iRhoD(s,c,instance),of) -endforall - -outputsLoop: do o = 1,size(param(instance)%outputID) - select case(param(instance)%outputID(o)) - - case (rho_sgl_mob_edg_pos_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_mob_edg_pos(:,of) - cs = cs + ns - - case (rho_sgl_imm_edg_pos_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_imm_edg_pos(:,of) - cs = cs + ns - - case (rho_sgl_mob_edg_neg_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_mob_edg_neg(:,of) - cs = cs + ns - - case (rho_sgl_imm_edg_neg_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_imm_edg_neg(:,of) - cs = cs + ns - - case (rho_dip_edg_ID) - postResults(cs+1:cs+ns) = stt%rho_dip_edg(:,of) - cs = cs + ns - - case (rho_sgl_mob_scr_pos_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_mob_scr_pos(:,of) - cs = cs + ns - - case (rho_sgl_imm_scr_pos_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_imm_scr_pos(:,of) - cs = cs + ns - - case (rho_sgl_mob_scr_neg_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_mob_scr_neg(:,of) - cs = cs + ns - - case (rho_sgl_imm_scr_neg_ID) - postResults(cs+1:cs+ns) = stt%rho_sgl_imm_scr_neg(:,of) - cs = cs + ns - - case (rho_dip_scr_ID) - postResults(cs+1:cs+ns) = stt%rho_dip_scr(:,of) - cs = cs + ns - - case (rho_forest_ID) - postResults(cs+1:cs+ns) = stt%rho_forest(:,of) - cs = cs + ns - - case (resolvedstress_back_ID) - postResults(cs+1:cs+ns) = dst%tau_back(:,of) - cs = cs + ns - - case (tau_pass_ID) - postResults(cs+1:cs+ns) = dst%tau_pass(:,of) - cs = cs + ns - - case (rho_dot_sgl_ID) - postResults(cs+1:cs+ns) = sum(rhoDotSgl(1:ns,1:4),2) & - + sum(rhoDotSgl(1:ns,5:8)*sign(1.0_pReal,rhoSgl(1:ns,5:8)),2) - cs = cs + ns - - case (rho_dot_sgl_mobile_ID) - postResults(cs+1:cs+ns) = sum(rhoDotSgl(1:ns,1:4),2) - cs = cs + ns - - case (rho_dot_dip_ID) - postResults(cs+1:cs+ns) = sum(rhoDotDip,2) - cs = cs + ns - - case (v_edg_pos_ID) - postResults(cs+1:cs+ns) = stt%v_edg_pos(:,of) - cs = cs + ns - - case (v_edg_neg_ID) - postResults(cs+1:cs+ns) = stt%v_edg_neg(:,of) - cs = cs + ns - - case (v_scr_pos_ID) - postResults(cs+1:cs+ns) = stt%v_scr_pos(:,of) - cs = cs + ns - - case (v_scr_neg_ID) - postResults(cs+1:cs+ns) = stt%v_scr_neg(:,of) - cs = cs + ns - - case(gamma_ID) - postResults(cs+1:cs+ns) = stt%gamma(:,of) - cs = cs + ns - - end select -enddo outputsLoop -end associate -end function plastic_nonlocal_postResults - - !-------------------------------------------------------------------------------------------------- !> @brief returns copy of current dislocation densities from state !> @details raw values is rectified From c36a5bdfbbb4e6a8c7924cee625f768aa654cc30 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 23:06:28 +0100 Subject: [PATCH 16/18] bugfix: calculation of size of postResults was wrong --- src/crystallite.f90 | 5 ++--- src/homogenization.f90 | 8 ++++---- src/plastic_nonlocal.f90 | 7 ------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index a17213f9e..292241001 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -743,8 +743,7 @@ function crystallite_postResults(ipc, ip, el) ipc !< grain index real(pReal), dimension(1+ & - 1+plasticState(material_phaseAt(ipc,el))%sizePostResults + & - sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & + 1+sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & crystallite_postResults integer :: & c @@ -754,7 +753,7 @@ function crystallite_postResults(ipc, ip, el) crystallite_postResults(1) = 0.0_pReal ! header-like information (length) c = 1 - crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results + crystallite_postResults(c+1) = real(sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults),pReal) ! size of constitutive results c = c + 1 if (size(crystallite_postResults)-c > 0) & crystallite_postResults(c+1:size(crystallite_postResults)) = & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 618c2faf8..0112f9cf5 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -255,8 +255,8 @@ subroutine homogenization_init thermal_maxSizePostResults = 0 damage_maxSizePostResults = 0 do p = 1,size(config_homogenization) - thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults) - damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults) + thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState(p)%sizePostResults) + damage_maxSizePostResults = max(damage_maxSizePostResults, damageState (p)%sizePostResults) enddo materialpoint_sizeResults = 1 & ! grain count @@ -616,8 +616,8 @@ subroutine materialpoint_postResults grainLooping :do g = 1,myNgrains theSize = 1 + & - 1 + plasticState (material_phaseAt(g,e))%sizePostResults + & - sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults) + 1 + & + sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults) materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results thePos = thePos + theSize enddo grainLooping diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 23bfb50aa..2e6734c9d 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -26,13 +26,9 @@ module plastic_nonlocal private real(pReal), parameter, private :: & KB = 1.38e-23_pReal !< Physical parameter, Boltzmann constant in J/Kelvin - - integer, dimension(:,:), allocatable, target, public :: & - plastic_nonlocal_sizePostResult !< size of each post result output character(len=64), dimension(:,:), allocatable, target, public :: & plastic_nonlocal_output !< name of each post result output - ! storage order of dislocation types integer, dimension(8), parameter :: & @@ -268,7 +264,6 @@ subroutine plastic_nonlocal_init allocate(deltaState(maxNinstances)) allocate(microstructure(maxNinstances)) - allocate(plastic_nonlocal_sizePostResult(maxval(phase_Noutput), maxNinstances), source=0) allocate(plastic_nonlocal_output(maxval(phase_Noutput), maxNinstances)) plastic_nonlocal_output = '' allocate(plastic_nonlocal_outputID(maxval(phase_Noutput), maxNinstances), source=undefined_ID) @@ -498,7 +493,6 @@ subroutine plastic_nonlocal_init if (outputID /= undefined_ID) then plastic_nonlocal_output(i,phase_plasticityInstance(p)) = outputs(i) - plastic_nonlocal_sizePostResult(i,phase_plasticityInstance(p)) = prm%totalNslip prm%outputID = [prm%outputID , outputID] endif @@ -524,7 +518,6 @@ subroutine plastic_nonlocal_init prm%totalNslip,0,0) plasticState(p)%nonlocal = .true. plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention - plasticState(p)%sizePostResults = sum(plastic_nonlocal_sizePostResult(:,phase_plasticityInstance(p))) totalNslip(phase_plasticityInstance(p)) = prm%totalNslip From 93da6d3f636bb2d31fbe589cd9af2630266a1e6c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 23:07:01 +0100 Subject: [PATCH 17/18] was not used --- src/material.f90 | 3 --- src/prec.f90 | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/material.f90 b/src/material.f90 index 2f70fe97b..8aeab5dec 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -749,9 +749,6 @@ subroutine material_allocatePlasticState(phase,NofMyPhase,& plasticState(phase)%sizeDotState = sizeDotState plasticState(phase)%sizeDeltaState = sizeDeltaState plasticState(phase)%offsetDeltaState = sizeState-sizeDeltaState ! deltaState occupies latter part of state by definition - plasticState(phase)%Nslip = Nslip - plasticState(phase)%Ntwin = Ntwin - plasticState(phase)%Ntrans= Ntrans allocate(plasticState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) diff --git a/src/prec.f90 b/src/prec.f90 index f0475e9b6..b6d5d4fdf 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -62,10 +62,6 @@ module prec end type type, extends(tState), public :: tPlasticState - integer :: & - nSlip = 0, & - nTwin = 0, & - nTrans = 0 logical :: & nonlocal = .false. real(pReal), pointer, dimension(:,:) :: & From f585e1a5535575a4f81d5eef7a8a9c90da969ec4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 5 Dec 2019 11:20:05 +0100 Subject: [PATCH 18/18] not used --- src/source_thermal_dissipation.f90 | 10 ---------- src/source_thermal_externalheat.f90 | 19 +++---------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/source_thermal_dissipation.f90 b/src/source_thermal_dissipation.f90 index 9b18efef5..0d16a9171 100644 --- a/src/source_thermal_dissipation.f90 +++ b/src/source_thermal_dissipation.f90 @@ -18,12 +18,6 @@ module source_thermal_dissipation source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism? source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism - integer, dimension(:,:), allocatable, target, public :: & - source_thermal_dissipation_sizePostResult !< size of each post result output - - character(len=64), dimension(:,:), allocatable, target, public :: & - source_thermal_dissipation_output !< name of each post result output - type :: tParameters !< container type for internal constitutive parameters real(pReal) :: & kappa @@ -68,10 +62,6 @@ subroutine source_thermal_dissipation_init enddo enddo - allocate(source_thermal_dissipation_sizePostResult(maxval(phase_Noutput),Ninstance),source=0) - allocate(source_thermal_dissipation_output (maxval(phase_Noutput),Ninstance)) - source_thermal_dissipation_output = '' - do p=1, size(config_phase) if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle instance = source_thermal_dissipation_instance(p) diff --git a/src/source_thermal_externalheat.f90 b/src/source_thermal_externalheat.f90 index 1b9d03529..00e6da6bf 100644 --- a/src/source_thermal_externalheat.f90 +++ b/src/source_thermal_externalheat.f90 @@ -15,17 +15,8 @@ module source_thermal_externalheat private integer, dimension(:), allocatable, public, protected :: & - source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism? - source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism - - integer, dimension(:,:), allocatable, target, public :: & - source_thermal_externalheat_sizePostResult !< size of each post result output - - character(len=64), dimension(:,:), allocatable, target, public :: & - source_thermal_externalheat_output !< name of each post result output - - integer, dimension(:), allocatable, target, public :: & - source_thermal_externalheat_Noutput !< number of outputs per instance of this source + source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism? + source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism type :: tParameters !< container type for internal constitutive parameters real(pReal), dimension(:), allocatable :: & @@ -73,11 +64,6 @@ subroutine source_thermal_externalheat_init enddo enddo - allocate(source_thermal_externalheat_sizePostResult(maxval(phase_Noutput),maxNinstance),source=0) - allocate(source_thermal_externalheat_output (maxval(phase_Noutput),maxNinstance)) - source_thermal_externalheat_output = '' - allocate(source_thermal_externalheat_Noutput(maxNinstance), source=0) - allocate(param(maxNinstance)) do p=1, size(config_phase) @@ -117,6 +103,7 @@ subroutine source_thermal_externalheat_dotState(phase, of) end subroutine source_thermal_externalheat_dotState + !-------------------------------------------------------------------------------------------------- !> @brief returns local heat generation rate !--------------------------------------------------------------------------------------------------