From 523a44a9644037ce13095c5664366c8002909dd4 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Mon, 2 Nov 2020 21:39:33 +0100 Subject: [PATCH 01/13] move to different module --- src/constitutive.f90 | 144 ++++++----------------------------- src/constitutive_plastic.f90 | 124 +++++++++++++++++++++++++++++- 2 files changed, 142 insertions(+), 126 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 358937e4b..71a386903 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -19,7 +19,7 @@ module constitutive implicit none private - integer(kind(ELASTICITY_undefined_ID)), dimension(:), allocatable, protected :: & + integer(kind(ELASTICITY_undefined_ID)), dimension(:), allocatable :: & phase_elasticity !< elasticity of each phase integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable :: & !ToDo: old intel compiler complains about protected @@ -52,8 +52,8 @@ module constitutive interface - module subroutine plastic_init - end subroutine plastic_init + module subroutine mech_init + end subroutine mech_init module subroutine damage_init end subroutine damage_init @@ -301,6 +301,21 @@ module constitutive C end subroutine source_damage_isoBrittle_deltaState + module subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) + integer, intent(in) :: & + ipc, & !< component-ID of integration point + ip, & !< integration point + el !< element + real(pReal), intent(in), dimension(3,3) :: & + Fe, & !< elastic deformation gradient + Fi !< intermediate deformation gradient + real(pReal), intent(out), dimension(3,3) :: & + S !< 2nd Piola-Kirchhoff stress tensor + real(pReal), intent(out), dimension(3,3,3,3) :: & + dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient + dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient + end subroutine constitutive_SandItsTangents + module subroutine plastic_results end subroutine plastic_results @@ -385,14 +400,10 @@ subroutine constitutive_init integer :: & p, & !< counter in phase loop - s, & !< counter in source loop - stiffDegradationCtr + s !< counter in source loop class (tNode), pointer :: & debug_constitutive, & - phases, & - phase, & - elastic, & - stiffDegradation + phases debug_constitutive => config_debug%get('constitutive', defaultVal=emptyList) debugConstitutive%basic = debug_constitutive%contains('basic') @@ -402,52 +413,15 @@ subroutine constitutive_init debugConstitutive%ip = config_debug%get_asInt('integrationpoint',defaultVal = 1) debugConstitutive%grain = config_debug%get_asInt('grain',defaultVal = 1) -!------------------------------------------------------------------------------------------------- -! initialize elasticity (hooke) !ToDO: Maybe move to elastic submodule along with function homogenizedC? - phases => config_material%get('phase') - allocate(phase_elasticity(phases%length), source = ELASTICITY_undefined_ID) - allocate(phase_elasticityInstance(phases%length), source = 0) - allocate(phase_NstiffnessDegradations(phases%length),source=0) - - do p = 1, phases%length - phase => phases%get(p) - elastic => phase%get('elasticity') - if(elastic%get_asString('type') == 'hooke') then - phase_elasticity(p) = ELASTICITY_HOOKE_ID - else - call IO_error(200,ext_msg=elastic%get_asString('type')) - endif - stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms - phase_NstiffnessDegradations(p) = stiffDegradation%length - enddo - - allocate(phase_stiffnessDegradation(maxval(phase_NstiffnessDegradations),phases%length), & - source=STIFFNESS_DEGRADATION_undefined_ID) - - if(maxVal(phase_NstiffnessDegradations)/=0) then - do p = 1, phases%length - phase => phases%get(p) - stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) - do stiffDegradationCtr = 1, stiffDegradation%length - if(stiffDegradation%get_asString(stiffDegradationCtr) == 'damage') & - phase_stiffnessDegradation(stiffDegradationCtr,p) = STIFFNESS_DEGRADATION_damage_ID - enddo - enddo - endif - - do p = 1, phases%length - phase_elasticityInstance(p) = count(phase_elasticity(1:p) == phase_elasticity(p)) - enddo - - !-------------------------------------------------------------------------------------------------- ! initialize constitutive laws - call plastic_init + call mech_init call damage_init call thermal_init print'(/,a)', ' <<<+- constitutive init -+>>>'; flush(IO_STDOUT) + phases => config_material%get('phase') constitutive_source_maxSizeDotState = 0 PhaseLoop2:do p = 1,phases%length !-------------------------------------------------------------------------------------------------- @@ -666,80 +640,6 @@ pure function constitutive_initialFi(ipc, ip, el) end function constitutive_initialFi -!-------------------------------------------------------------------------------------------------- -!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to -!> the elastic/intermediate deformation gradients depending on the selected elastic law -!! (so far no case switch because only Hooke is implemented) -!-------------------------------------------------------------------------------------------------- -subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - Fe, & !< elastic deformation gradient - Fi !< intermediate deformation gradient - real(pReal), intent(out), dimension(3,3) :: & - S !< 2nd Piola-Kirchhoff stress tensor - real(pReal), intent(out), dimension(3,3,3,3) :: & - dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient - dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient - - call constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - - -end subroutine constitutive_SandItsTangents - - -!-------------------------------------------------------------------------------------------------- -!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to -!> the elastic and intermediate deformation gradients using Hooke's law -!-------------------------------------------------------------------------------------------------- -subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & - Fe, Fi, ipc, ip, el) - - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - Fe, & !< elastic deformation gradient - Fi !< intermediate deformation gradient - real(pReal), intent(out), dimension(3,3) :: & - S !< 2nd Piola-Kirchhoff stress tensor in lattice configuration - real(pReal), intent(out), dimension(3,3,3,3) :: & - dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient - dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient - real(pReal), dimension(3,3) :: E - real(pReal), dimension(3,3,3,3) :: C - integer :: & - ho, & !< homogenization - d !< counter in degradation loop - integer :: & - i, j - - ho = material_homogenizationAt(el) - C = math_66toSym3333(constitutive_homogenizedC(ipc,ip,el)) - - DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(ipc,el)) - degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(ipc,el))) - case (STIFFNESS_DEGRADATION_damage_ID) degradationType - C = C * damage(ho)%p(damageMapping(ho)%p(ip,el))**2 - end select degradationType - enddo DegradationLoop - - E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration - S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration - - do i =1, 3;do j=1,3 - dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko - dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn - enddo; enddo - -end subroutine constitutive_hooke_SandItsTangents - - !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the rate of change of microstructure !-------------------------------------------------------------------------------------------------- diff --git a/src/constitutive_plastic.f90 b/src/constitutive_plastic.f90 index bf6bc079e..6809443ca 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_plastic.f90 @@ -193,14 +193,56 @@ contains !-------------------------------------------------------------------------------------------------- !> @brief Initialize constitutive models for plasticity !-------------------------------------------------------------------------------------------------- -module subroutine plastic_init +module subroutine mech_init - integer :: p - class(tNode), pointer :: phases + integer :: & + p, & + stiffDegradationCtr + class(tNode), pointer :: & + phases, & + phase, & + elastic, & + stiffDegradation print'(/,a)', ' <<<+- constitutive_plastic init -+>>>' +!------------------------------------------------------------------------------------------------- +! initialize elasticity (hooke) !ToDO: Maybe move to elastic submodule along with function homogenizedC? phases => config_material%get('phase') + allocate(phase_elasticity(phases%length), source = ELASTICITY_undefined_ID) + allocate(phase_elasticityInstance(phases%length), source = 0) + allocate(phase_NstiffnessDegradations(phases%length),source=0) + + do p = 1, phases%length + phase => phases%get(p) + elastic => phase%get('elasticity') + if(elastic%get_asString('type') == 'hooke') then + phase_elasticity(p) = ELASTICITY_HOOKE_ID + else + call IO_error(200,ext_msg=elastic%get_asString('type')) + endif + stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms + phase_NstiffnessDegradations(p) = stiffDegradation%length + enddo + + allocate(phase_stiffnessDegradation(maxval(phase_NstiffnessDegradations),phases%length), & + source=STIFFNESS_DEGRADATION_undefined_ID) + + if(maxVal(phase_NstiffnessDegradations)/=0) then + do p = 1, phases%length + phase => phases%get(p) + stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) + do stiffDegradationCtr = 1, stiffDegradation%length + if(stiffDegradation%get_asString(stiffDegradationCtr) == 'damage') & + phase_stiffnessDegradation(stiffDegradationCtr,p) = STIFFNESS_DEGRADATION_damage_ID + enddo + enddo + endif + + do p = 1, phases%length + phase_elasticityInstance(p) = count(phase_elasticity(1:p) == phase_elasticity(p)) + enddo + allocate(plasticState(phases%length)) allocate(phase_plasticity(phases%length),source = PLASTICITY_undefined_ID) @@ -220,7 +262,7 @@ module subroutine plastic_init enddo -end subroutine plastic_init +end subroutine mech_init !-------------------------------------------------------------------------------------------------- @@ -248,6 +290,80 @@ module function plastic_active(plastic_label) result(active_plastic) end function plastic_active +!-------------------------------------------------------------------------------------------------- +!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to +!> the elastic/intermediate deformation gradients depending on the selected elastic law +!! (so far no case switch because only Hooke is implemented) +!-------------------------------------------------------------------------------------------------- +module subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) + + integer, intent(in) :: & + ipc, & !< component-ID of integration point + ip, & !< integration point + el !< element + real(pReal), intent(in), dimension(3,3) :: & + Fe, & !< elastic deformation gradient + Fi !< intermediate deformation gradient + real(pReal), intent(out), dimension(3,3) :: & + S !< 2nd Piola-Kirchhoff stress tensor + real(pReal), intent(out), dimension(3,3,3,3) :: & + dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient + dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient + + call constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) + + +end subroutine constitutive_SandItsTangents + + +!-------------------------------------------------------------------------------------------------- +!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to +!> the elastic and intermediate deformation gradients using Hooke's law +!-------------------------------------------------------------------------------------------------- +subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & + Fe, Fi, ipc, ip, el) + + integer, intent(in) :: & + ipc, & !< component-ID of integration point + ip, & !< integration point + el !< element + real(pReal), intent(in), dimension(3,3) :: & + Fe, & !< elastic deformation gradient + Fi !< intermediate deformation gradient + real(pReal), intent(out), dimension(3,3) :: & + S !< 2nd Piola-Kirchhoff stress tensor in lattice configuration + real(pReal), intent(out), dimension(3,3,3,3) :: & + dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient + dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient + real(pReal), dimension(3,3) :: E + real(pReal), dimension(3,3,3,3) :: C + integer :: & + ho, & !< homogenization + d !< counter in degradation loop + integer :: & + i, j + + ho = material_homogenizationAt(el) + C = math_66toSym3333(constitutive_homogenizedC(ipc,ip,el)) + + DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(ipc,el)) + degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(ipc,el))) + case (STIFFNESS_DEGRADATION_damage_ID) degradationType + C = C * damage(ho)%p(damageMapping(ho)%p(ip,el))**2 + end select degradationType + enddo DegradationLoop + + E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration + S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration + + do i =1, 3;do j=1,3 + dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko + dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn + enddo; enddo + +end subroutine constitutive_hooke_SandItsTangents + + !-------------------------------------------------------------------------------------------------- !> @brief calls microstructure function of the different plasticity constitutive models !-------------------------------------------------------------------------------------------------- From 7b761476e4afd93c8a530057e473935044df28aa Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Mon, 2 Nov 2020 22:46:46 +0100 Subject: [PATCH 02/13] under mech dictionary --- .../SpectralMethod/Polycrystal/material.yaml | 30 +++++++++---------- src/constitutive_plastic.f90 | 18 ++++++----- src/constitutive_plastic_disloTungsten.f90 | 5 ++-- src/constitutive_plastic_dislotwin.f90 | 5 ++-- src/constitutive_plastic_isotropic.f90 | 5 ++-- src/constitutive_plastic_kinehardening.f90 | 5 ++-- src/constitutive_plastic_none.f90 | 4 ++- src/constitutive_plastic_nonlocal.f90 | 5 ++-- src/constitutive_plastic_phenopowerlaw.f90 | 5 ++-- src/crystallite.f90 | 8 ++--- src/lattice.f90 | 4 ++- 11 files changed, 53 insertions(+), 41 deletions(-) diff --git a/examples/SpectralMethod/Polycrystal/material.yaml b/examples/SpectralMethod/Polycrystal/material.yaml index 04775be4c..9bfc97ca3 100644 --- a/examples/SpectralMethod/Polycrystal/material.yaml +++ b/examples/SpectralMethod/Polycrystal/material.yaml @@ -108,19 +108,19 @@ material: phase: Aluminum: - elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} - generic: - output: [F, P, F_e, F_p, L_p, O] lattice: fcc - plasticity: - N_sl: [12] - a_sl: 2.25 - atol_xi: 1.0 - dot_gamma_0_sl: 0.001 - h_0_sl_sl: 75e6 - h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] - n_sl: 20 - output: [xi_sl] - type: phenopowerlaw - xi_0_sl: [31e6] - xi_inf_sl: [63e6] + mech: + output: [F, P, F_e, F_p, L_p, O] + elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} + plasticity: + N_sl: [12] + a_sl: 2.25 + atol_xi: 1.0 + dot_gamma_0_sl: 0.001 + h_0_sl_sl: 75e6 + h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] + n_sl: 20 + output: [xi_sl] + type: phenopowerlaw + xi_0_sl: [31e6] + xi_inf_sl: [63e6] diff --git a/src/constitutive_plastic.f90 b/src/constitutive_plastic.f90 index 6809443ca..eacd84f09 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_plastic.f90 @@ -201,6 +201,7 @@ module subroutine mech_init class(tNode), pointer :: & phases, & phase, & + mech, & elastic, & stiffDegradation @@ -215,13 +216,14 @@ module subroutine mech_init do p = 1, phases%length phase => phases%get(p) - elastic => phase%get('elasticity') + mech => phase%get('mech') + elastic => mech%get('elasticity') if(elastic%get_asString('type') == 'hooke') then phase_elasticity(p) = ELASTICITY_HOOKE_ID else call IO_error(200,ext_msg=elastic%get_asString('type')) endif - stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms + stiffDegradation => mech%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms phase_NstiffnessDegradations(p) = stiffDegradation%length enddo @@ -231,7 +233,8 @@ module subroutine mech_init if(maxVal(phase_NstiffnessDegradations)/=0) then do p = 1, phases%length phase => phases%get(p) - stiffDegradation => phase%get('stiffness_degradation',defaultVal=emptyList) + mech => phase%get('mech') + stiffDegradation => mech%get('stiffness_degradation',defaultVal=emptyList) do stiffDegradationCtr = 1, stiffDegradation%length if(stiffDegradation%get_asString(stiffDegradationCtr) == 'damage') & phase_stiffnessDegradation(stiffDegradationCtr,p) = STIFFNESS_DEGRADATION_damage_ID @@ -239,10 +242,6 @@ module subroutine mech_init enddo endif - do p = 1, phases%length - phase_elasticityInstance(p) = count(phase_elasticity(1:p) == phase_elasticity(p)) - enddo - allocate(plasticState(phases%length)) allocate(phase_plasticity(phases%length),source = PLASTICITY_undefined_ID) @@ -258,6 +257,7 @@ module subroutine mech_init where(plastic_nonlocal_init()) phase_plasticity = PLASTICITY_NONLOCAL_ID do p = 1, phases%length + phase_elasticityInstance(p) = count(phase_elasticity(1:p) == phase_elasticity(p)) phase_plasticityInstance(p) = count(phase_plasticity(1:p) == phase_plasticity(p)) enddo @@ -276,6 +276,7 @@ module function plastic_active(plastic_label) result(active_plastic) class(tNode), pointer :: & phases, & phase, & + mech, & pl integer :: p @@ -283,7 +284,8 @@ module function plastic_active(plastic_label) result(active_plastic) allocate(active_plastic(phases%length), source = .false. ) do p = 1, phases%length phase => phases%get(p) - pl => phase%get('plasticity') + mech => phase%get('mech') + pl => mech%get('plasticity') if(pl%get_asString('type') == plastic_label) active_plastic(p) = .true. enddo diff --git a/src/constitutive_plastic_disloTungsten.f90 b/src/constitutive_plastic_disloTungsten.f90 index aef3bef89..2a867bc48 100644 --- a/src/constitutive_plastic_disloTungsten.f90 +++ b/src/constitutive_plastic_disloTungsten.f90 @@ -94,6 +94,7 @@ module function plastic_disloTungsten_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_dislotungsten init -+>>>' @@ -115,14 +116,14 @@ module function plastic_disloTungsten_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & dot => dotState(i), & stt => state(i), & dst => dependentState(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') #if defined (__GFORTRAN__) prm%output = output_asStrings(pl) diff --git a/src/constitutive_plastic_dislotwin.f90 b/src/constitutive_plastic_dislotwin.f90 index 30527e301..a94290b4d 100644 --- a/src/constitutive_plastic_dislotwin.f90 +++ b/src/constitutive_plastic_dislotwin.f90 @@ -141,6 +141,7 @@ module function plastic_dislotwin_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_dislotwin init -+>>>' @@ -168,14 +169,14 @@ module function plastic_dislotwin_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & dot => dotState(i), & stt => state(i), & dst => dependentState(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') #if defined (__GFORTRAN__) prm%output = output_asStrings(pl) diff --git a/src/constitutive_plastic_isotropic.f90 b/src/constitutive_plastic_isotropic.f90 index db418663f..b6b395fb2 100644 --- a/src/constitutive_plastic_isotropic.f90 +++ b/src/constitutive_plastic_isotropic.f90 @@ -65,6 +65,7 @@ module function plastic_isotropic_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_isotropic init -+>>>' @@ -85,13 +86,13 @@ module function plastic_isotropic_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & dot => dotState(i), & stt => state(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') #if defined (__GFORTRAN__) diff --git a/src/constitutive_plastic_kinehardening.f90 b/src/constitutive_plastic_kinehardening.f90 index 3faf7dc41..60338d30e 100644 --- a/src/constitutive_plastic_kinehardening.f90 +++ b/src/constitutive_plastic_kinehardening.f90 @@ -77,6 +77,7 @@ module function plastic_kinehardening_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_kinehardening init -+>>>' @@ -95,14 +96,14 @@ module function plastic_kinehardening_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & dot => dotState(i), & dlt => deltaState(i), & stt => state(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') #if defined (__GFORTRAN__) prm%output = output_asStrings(pl) diff --git a/src/constitutive_plastic_none.f90 b/src/constitutive_plastic_none.f90 index 923ae354a..c05446493 100644 --- a/src/constitutive_plastic_none.f90 +++ b/src/constitutive_plastic_none.f90 @@ -22,6 +22,7 @@ module function plastic_none_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_none init -+>>>' @@ -30,7 +31,8 @@ module function plastic_none_init() result(myPlasticity) allocate(myPlasticity(phases%length), source = .false.) do p = 1, phases%length phase => phases%get(p) - pl => phase%get('plasticity') + mech => phase%get('mech') + pl => mech%get ('plasticity') if(pl%get_asString('type') == 'none') myPlasticity(p) = .true. enddo diff --git a/src/constitutive_plastic_nonlocal.f90 b/src/constitutive_plastic_nonlocal.f90 index 472415ba9..459eb60d8 100644 --- a/src/constitutive_plastic_nonlocal.f90 +++ b/src/constitutive_plastic_nonlocal.f90 @@ -183,6 +183,7 @@ module function plastic_nonlocal_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_nonlocal init -+>>>' @@ -212,7 +213,7 @@ module function plastic_nonlocal_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & @@ -221,7 +222,7 @@ module function plastic_nonlocal_init() result(myPlasticity) st0 => state0(i), & del => deltaState(i), & dst => microstructure(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') phase_localPlasticity(p) = .not. pl%contains('nonlocal') diff --git a/src/constitutive_plastic_phenopowerlaw.f90 b/src/constitutive_plastic_phenopowerlaw.f90 index 72fa0e9e6..b1dea0ec2 100644 --- a/src/constitutive_plastic_phenopowerlaw.f90 +++ b/src/constitutive_plastic_phenopowerlaw.f90 @@ -86,6 +86,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity) class(tNode), pointer :: & phases, & phase, & + mech, & pl print'(/,a)', ' <<<+- plastic_phenopowerlaw init -+>>>' @@ -103,13 +104,13 @@ module function plastic_phenopowerlaw_init() result(myPlasticity) i = 0 do p = 1, phases%length phase => phases%get(p) - + mech => phase%get('mech') if(.not. myPlasticity(p)) cycle i = i + 1 associate(prm => param(i), & dot => dotState(i), & stt => state(i)) - pl => phase%get('plasticity') + pl => mech%get('plasticity') !-------------------------------------------------------------------------------------------------- ! slip related parameters diff --git a/src/crystallite.f90 b/src/crystallite.f90 index c9ef97e32..177fe6cc1 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -150,7 +150,7 @@ subroutine crystallite_init debug_crystallite, & ! pointer to debug options for crystallite phases, & phase, & - generic_param + mech print'(/,a)', ' <<<+- crystallite init -+>>>' @@ -240,11 +240,11 @@ subroutine crystallite_init allocate(output_constituent(phases%length)) do c = 1, phases%length phase => phases%get(c) - generic_param => phase%get('generic',defaultVal = emptyDict) + mech => phase%get('mech',defaultVal = emptyDict) #if defined(__GFORTRAN__) - output_constituent(c)%label = output_asStrings(generic_param) + output_constituent(c)%label = output_asStrings(mech) #else - output_constituent(c)%label = generic_param%get_asStrings('output',defaultVal=emptyStringArray) + output_constituent(c)%label = mech%get_asStrings('output',defaultVal=emptyStringArray) #endif enddo diff --git a/src/lattice.f90 b/src/lattice.f90 index 78b3894c0..cc60f04a2 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -455,6 +455,7 @@ subroutine lattice_init class(tNode), pointer :: & phases, & phase, & + mech, & elasticity print'(/,a)', ' <<<+- lattice init -+>>>'; flush(IO_STDOUT) @@ -475,7 +476,8 @@ subroutine lattice_init do p = 1, phases%length phase => phases%get(p) - elasticity => phase%get('elasticity') + mech => phase%get('mech') + elasticity => mech%get('elasticity') lattice_C66(1,1,p) = elasticity%get_asFloat('C_11') lattice_C66(1,2,p) = elasticity%get_asFloat('C_12') From 5e0d7613fefc18c80ee29752306751efe684cc65 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Tue, 3 Nov 2020 00:48:58 +0100 Subject: [PATCH 03/13] tests made compatible --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index e2301f7d1..619041924 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit e2301f7d12ff0ae12218d9b58e33a814eb5431c9 +Subproject commit 619041924df80a335f063db8bc089001a7a0710c From 2b6e09ad81e0ee2305d7a22538a234c4c2627031 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Tue, 3 Nov 2020 00:49:17 +0100 Subject: [PATCH 04/13] WIP: compatible with new names --- src/commercialFEM_fileList.f90 | 2 +- ...{constitutive_plastic.f90 => constitutive_mech.f90} | 10 ++++------ src/constitutive_plastic_disloTungsten.f90 | 2 +- src/constitutive_plastic_dislotwin.f90 | 2 +- src/constitutive_plastic_isotropic.f90 | 2 +- src/constitutive_plastic_kinehardening.f90 | 2 +- src/constitutive_plastic_none.f90 | 2 +- src/constitutive_plastic_nonlocal.f90 | 2 +- src/constitutive_plastic_phenopowerlaw.f90 | 2 +- 9 files changed, 12 insertions(+), 14 deletions(-) rename src/{constitutive_plastic.f90 => constitutive_mech.f90} (99%) diff --git a/src/commercialFEM_fileList.f90 b/src/commercialFEM_fileList.f90 index f4eb5d78c..d161b36eb 100644 --- a/src/commercialFEM_fileList.f90 +++ b/src/commercialFEM_fileList.f90 @@ -25,7 +25,7 @@ #include "material.f90" #include "lattice.f90" #include "constitutive.f90" -#include "constitutive_plastic.f90" +#include "constitutive_mech.f90" #include "constitutive_plastic_none.f90" #include "constitutive_plastic_isotropic.f90" #include "constitutive_plastic_phenopowerlaw.f90" diff --git a/src/constitutive_plastic.f90 b/src/constitutive_mech.f90 similarity index 99% rename from src/constitutive_plastic.f90 rename to src/constitutive_mech.f90 index eacd84f09..71169b0ee 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_mech.f90 @@ -1,7 +1,7 @@ !---------------------------------------------------------------------------------------------------- !> @brief internal microstructure state for all plasticity constitutive models !---------------------------------------------------------------------------------------------------- -submodule(constitutive) constitutive_plastic +submodule(constitutive) constitutive_mech interface @@ -205,7 +205,7 @@ module subroutine mech_init elastic, & stiffDegradation - print'(/,a)', ' <<<+- constitutive_plastic init -+>>>' + print'(/,a)', ' <<<+- constitutive_mech init -+>>>' !------------------------------------------------------------------------------------------------- ! initialize elasticity (hooke) !ToDO: Maybe move to elastic submodule along with function homogenizedC? @@ -243,6 +243,7 @@ module subroutine mech_init endif +! initialize plasticity allocate(plasticState(phases%length)) allocate(phase_plasticity(phases%length),source = PLASTICITY_undefined_ID) allocate(phase_plasticityInstance(phases%length),source = 0) @@ -261,7 +262,6 @@ module subroutine mech_init phase_plasticityInstance(p) = count(phase_plasticity(1:p) == phase_plasticity(p)) enddo - end subroutine mech_init @@ -314,7 +314,6 @@ module subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, i call constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - end subroutine constitutive_SandItsTangents @@ -513,6 +512,5 @@ module subroutine plastic_results end subroutine plastic_results - -end submodule constitutive_plastic +end submodule constitutive_mech diff --git a/src/constitutive_plastic_disloTungsten.f90 b/src/constitutive_plastic_disloTungsten.f90 index 2a867bc48..adaa36ee7 100644 --- a/src/constitutive_plastic_disloTungsten.f90 +++ b/src/constitutive_plastic_disloTungsten.f90 @@ -5,7 +5,7 @@ !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief crystal plasticity model for bcc metals, especially Tungsten !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_disloTungsten +submodule(constitutive:constitutive_mech) plastic_disloTungsten real(pReal), parameter :: & kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin diff --git a/src/constitutive_plastic_dislotwin.f90 b/src/constitutive_plastic_dislotwin.f90 index a94290b4d..2bc2b1176 100644 --- a/src/constitutive_plastic_dislotwin.f90 +++ b/src/constitutive_plastic_dislotwin.f90 @@ -7,7 +7,7 @@ !> @brief material subroutine incoprorating dislocation and twinning physics !> @details to be done !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_dislotwin +submodule(constitutive:constitutive_mech) plastic_dislotwin real(pReal), parameter :: & kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin diff --git a/src/constitutive_plastic_isotropic.f90 b/src/constitutive_plastic_isotropic.f90 index b6b395fb2..4bbd5187e 100644 --- a/src/constitutive_plastic_isotropic.f90 +++ b/src/constitutive_plastic_isotropic.f90 @@ -7,7 +7,7 @@ !! resolving the stress on the slip systems. Will give the response of phenopowerlaw for an !! untextured polycrystal !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_isotropic +submodule(constitutive:constitutive_mech) plastic_isotropic type :: tParameters real(pReal) :: & diff --git a/src/constitutive_plastic_kinehardening.f90 b/src/constitutive_plastic_kinehardening.f90 index 60338d30e..7dbd51597 100644 --- a/src/constitutive_plastic_kinehardening.f90 +++ b/src/constitutive_plastic_kinehardening.f90 @@ -5,7 +5,7 @@ !> @brief Phenomenological crystal plasticity using a power law formulation for the shear rates !! and a Voce-type kinematic hardening rule !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_kinehardening +submodule(constitutive:constitutive_mech) plastic_kinehardening type :: tParameters real(pReal) :: & diff --git a/src/constitutive_plastic_none.f90 b/src/constitutive_plastic_none.f90 index c05446493..6164ab29f 100644 --- a/src/constitutive_plastic_none.f90 +++ b/src/constitutive_plastic_none.f90 @@ -4,7 +4,7 @@ !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief Dummy plasticity for purely elastic material !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_none +submodule(constitutive:constitutive_mech) plastic_none contains diff --git a/src/constitutive_plastic_nonlocal.f90 b/src/constitutive_plastic_nonlocal.f90 index 459eb60d8..8aab40fc8 100644 --- a/src/constitutive_plastic_nonlocal.f90 +++ b/src/constitutive_plastic_nonlocal.f90 @@ -4,7 +4,7 @@ !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief material subroutine for plasticity including dislocation flux !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_nonlocal +submodule(constitutive:constitutive_mech) plastic_nonlocal use geometry_plastic_nonlocal, only: & nIPneighbors => geometry_plastic_nonlocal_nIPneighbors, & IPneighborhood => geometry_plastic_nonlocal_IPneighborhood, & diff --git a/src/constitutive_plastic_phenopowerlaw.f90 b/src/constitutive_plastic_phenopowerlaw.f90 index b1dea0ec2..747dd6615 100644 --- a/src/constitutive_plastic_phenopowerlaw.f90 +++ b/src/constitutive_plastic_phenopowerlaw.f90 @@ -4,7 +4,7 @@ !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief phenomenological crystal plasticity formulation using a powerlaw fitting !-------------------------------------------------------------------------------------------------- -submodule(constitutive:constitutive_plastic) plastic_phenopowerlaw +submodule(constitutive:constitutive_mech) plastic_phenopowerlaw type :: tParameters real(pReal) :: & From 79071512c8832d5b64d8f62d809ea7ae0b6e8fa5 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Tue, 3 Nov 2020 11:51:57 +0100 Subject: [PATCH 05/13] missed out --- src/kinematics_cleavage_opening.f90 | 4 +--- src/kinematics_slipplane_opening.f90 | 6 ++++-- src/kinematics_thermal_expansion.f90 | 2 -- src/source_damage_anisoDuctile.f90 | 6 ++++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/kinematics_cleavage_opening.f90 b/src/kinematics_cleavage_opening.f90 index 44bbcb4f4..66bce6a92 100644 --- a/src/kinematics_cleavage_opening.f90 +++ b/src/kinematics_cleavage_opening.f90 @@ -41,7 +41,6 @@ module function kinematics_cleavage_opening_init(kinematics_length) result(myKin class(tNode), pointer :: & phases, & phase, & - pl, & kinematics, & kinematic_type @@ -58,8 +57,7 @@ module function kinematics_cleavage_opening_init(kinematics_length) result(myKin do p = 1, phases%length if(any(myKinematics(:,p))) kinematics_cleavage_opening_instance(p) = count(myKinematics(:,1:p)) - phase => phases%get(p) - pl => phase%get('plasticity') + phase => phases%get(p) if(count(myKinematics(:,p)) == 0) cycle kinematics => phase%get('kinematics') do k = 1, kinematics%length diff --git a/src/kinematics_slipplane_opening.f90 b/src/kinematics_slipplane_opening.f90 index ea8f51427..7e45a7a05 100644 --- a/src/kinematics_slipplane_opening.f90 +++ b/src/kinematics_slipplane_opening.f90 @@ -44,6 +44,7 @@ module function kinematics_slipplane_opening_init(kinematics_length) result(myKi class(tNode), pointer :: & phases, & phase, & + mech, & pl, & kinematics, & kinematic_type @@ -61,8 +62,9 @@ module function kinematics_slipplane_opening_init(kinematics_length) result(myKi do p = 1, phases%length if(any(myKinematics(:,p))) kinematics_slipplane_opening_instance(p) = count(myKinematics(:,1:p)) - phase => phases%get(p) - pl => phase%get('plasticity') + phase => phases%get(p) + mech => phase%get('mech') + pl => mech%get('plasticity') if(count(myKinematics(:,p)) == 0) cycle kinematics => phase%get('kinematics') do k = 1, kinematics%length diff --git a/src/kinematics_thermal_expansion.f90 b/src/kinematics_thermal_expansion.f90 index 4afde82e3..2b8b04d85 100644 --- a/src/kinematics_thermal_expansion.f90 +++ b/src/kinematics_thermal_expansion.f90 @@ -34,7 +34,6 @@ module function kinematics_thermal_expansion_init(kinematics_length) result(myKi class(tNode), pointer :: & phases, & phase, & - pl, & kinematics, & kinematic_type @@ -52,7 +51,6 @@ module function kinematics_thermal_expansion_init(kinematics_length) result(myKi do p = 1, phases%length if(any(myKinematics(:,p))) kinematics_thermal_expansion_instance(p) = count(myKinematics(:,1:p)) phase => phases%get(p) - pl => phase%get('plasticity') if(count(myKinematics(:,p)) == 0) cycle kinematics => phase%get('kinematics') do k = 1, kinematics%length diff --git a/src/source_damage_anisoDuctile.f90 b/src/source_damage_anisoDuctile.f90 index 2fdd46bb4..ffbb38d2a 100644 --- a/src/source_damage_anisoDuctile.f90 +++ b/src/source_damage_anisoDuctile.f90 @@ -36,6 +36,7 @@ module function source_damage_anisoDuctile_init(source_length) result(mySources) class(tNode), pointer :: & phases, & phase, & + mech, & pl, & sources, & src @@ -56,11 +57,12 @@ module function source_damage_anisoDuctile_init(source_length) result(mySources) allocate(source_damage_anisoDuctile_instance(phases%length), source=0) do p = 1, phases%length - phase => phases%get(p) + phase => phases%get(p) if(any(mySources(:,p))) source_damage_anisoDuctile_instance(p) = count(mySources(:,1:p)) if(count(mySources(:,p)) == 0) cycle + mech => phase%get('mech') + pl => mech%get('plasticity') sources => phase%get('source') - pl => phase%get('plasticity') do sourceOffset = 1, sources%length if(mySources(sourceOffset,p)) then source_damage_anisoDuctile_offset(p) = sourceOffset From 1a01867b9c957c16f484119d7c493d1022273982 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Tue, 3 Nov 2020 13:31:59 +0100 Subject: [PATCH 06/13] indent error fixed in test --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 619041924..3935242a5 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 619041924df80a335f063db8bc089001a7a0710c +Subproject commit 3935242a5da780f55639f62756b6bb6583d89b3d From bbeb031da5f7eaa872e6974045e407e3f77593d0 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 4 Nov 2020 12:43:52 +0100 Subject: [PATCH 07/13] only hooke is implemented one function call is enough for the moment. Should complicate/(have switch cases) when other laws apart from hooke is implemented. --- src/constitutive.f90 | 34 +++++++++++++++++++--------------- src/constitutive_mech.f90 | 27 +-------------------------- 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 71a386903..f207ed884 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -301,21 +301,6 @@ module constitutive C end subroutine source_damage_isoBrittle_deltaState - module subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - Fe, & !< elastic deformation gradient - Fi !< intermediate deformation gradient - real(pReal), intent(out), dimension(3,3) :: & - S !< 2nd Piola-Kirchhoff stress tensor - real(pReal), intent(out), dimension(3,3,3,3) :: & - dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient - dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient - end subroutine constitutive_SandItsTangents - module subroutine plastic_results end subroutine plastic_results @@ -358,6 +343,25 @@ module constitutive end interface constitutive_dependentState + interface constitutive_SandItsTangents + + module subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) + integer, intent(in) :: & + ipc, & !< component-ID of integration point + ip, & !< integration point + el !< element + real(pReal), intent(in), dimension(3,3) :: & + Fe, & !< elastic deformation gradient + Fi !< intermediate deformation gradient + real(pReal), intent(out), dimension(3,3) :: & + S !< 2nd Piola-Kirchhoff stress tensor + real(pReal), intent(out), dimension(3,3,3,3) :: & + dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient + dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient + end subroutine constitutive_hooke_SandItsTangents + + end interface constitutive_SandItsTangents + type :: tDebugOptions logical :: & diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index 71169b0ee..9b3c7e5dc 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -292,36 +292,11 @@ module function plastic_active(plastic_label) result(active_plastic) end function plastic_active -!-------------------------------------------------------------------------------------------------- -!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to -!> the elastic/intermediate deformation gradients depending on the selected elastic law -!! (so far no case switch because only Hooke is implemented) -!-------------------------------------------------------------------------------------------------- -module subroutine constitutive_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - Fe, & !< elastic deformation gradient - Fi !< intermediate deformation gradient - real(pReal), intent(out), dimension(3,3) :: & - S !< 2nd Piola-Kirchhoff stress tensor - real(pReal), intent(out), dimension(3,3,3,3) :: & - dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient - dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient - - call constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, Fe, Fi, ipc, ip, el) - -end subroutine constitutive_SandItsTangents - - !-------------------------------------------------------------------------------------------------- !> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to !> the elastic and intermediate deformation gradients using Hooke's law !-------------------------------------------------------------------------------------------------- -subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & +module subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & Fe, Fi, ipc, ip, el) integer, intent(in) :: & From 921acb97c269722ddf9b73612ac560442c72e4c6 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 5 Nov 2020 00:23:43 +0100 Subject: [PATCH 08/13] important to note --- src/constitutive.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index f207ed884..470ac4dc7 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -19,7 +19,7 @@ module constitutive implicit none private - integer(kind(ELASTICITY_undefined_ID)), dimension(:), allocatable :: & + integer(kind(ELASTICITY_undefined_ID)), dimension(:), allocatable :: & !ToDo: old intel compiler complains about protected phase_elasticity !< elasticity of each phase integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable :: & !ToDo: old intel compiler complains about protected From 086f503e366ce796a83386fdb55fee78ac22b96a Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 5 Nov 2020 00:48:25 +0100 Subject: [PATCH 09/13] updated test repo --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 3935242a5..6f65b05b0 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 3935242a5da780f55639f62756b6bb6583d89b3d +Subproject commit 6f65b05b0bc75d3130d4875bbee1e48dbeea97df From 25e4b63969214cfe8584aa2b790bbf3a0eff042c Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 5 Nov 2020 16:49:59 +0100 Subject: [PATCH 10/13] polishing --- src/constitutive_mech.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index 9b3c7e5dc..074ef88fe 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -191,7 +191,8 @@ contains !-------------------------------------------------------------------------------------------------- -!> @brief Initialize constitutive models for plasticity +!> @brief Initialize mechanical field related constitutive models +!> @details Initialize elasticity, plasticity and stiffness degradation models. !-------------------------------------------------------------------------------------------------- module subroutine mech_init @@ -223,7 +224,7 @@ module subroutine mech_init else call IO_error(200,ext_msg=elastic%get_asString('type')) endif - stiffDegradation => mech%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms + stiffDegradation => mech%get('stiffness_degradation',defaultVal=emptyList) ! check for stiffness degradation mechanisms phase_NstiffnessDegradations(p) = stiffDegradation%length enddo From 21a63041f9a94324adfcde34f12cd57ed5436f08 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Sun, 8 Nov 2020 15:43:17 +0100 Subject: [PATCH 11/13] updated test repo --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 6f65b05b0..624218a2b 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 6f65b05b0bc75d3130d4875bbee1e48dbeea97df +Subproject commit 624218a2b8224b57c3e5d2338517d3a41a3c4f0b From 7d4163e8a9dcb83eb2192594c651b84f84d49f0f Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Sun, 8 Nov 2020 15:57:06 +0100 Subject: [PATCH 12/13] new format of material.yaml --- .../reference/ConfigMaterial/material.yaml | 12 ++-- python/tests/reference/Result/material.yaml | 60 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/python/tests/reference/ConfigMaterial/material.yaml b/python/tests/reference/ConfigMaterial/material.yaml index 97c6504bb..2007b90c3 100644 --- a/python/tests/reference/ConfigMaterial/material.yaml +++ b/python/tests/reference/ConfigMaterial/material.yaml @@ -33,12 +33,12 @@ material: phase: Aluminum: - elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} - generic: - output: [F, P, Fe, Fp, Lp] lattice: fcc - Steel: - elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke} - generic: + mech: output: [F, P, Fe, Fp, Lp] + elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} + Steel: lattice: bcc + mech: + output: [F, P, Fe, Fp, Lp] + elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke} diff --git a/python/tests/reference/Result/material.yaml b/python/tests/reference/Result/material.yaml index 31f16b824..cd9cbad2a 100644 --- a/python/tests/reference/Result/material.yaml +++ b/python/tests/reference/Result/material.yaml @@ -6,39 +6,39 @@ homogenization: phase: pheno_fcc: - elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} - generic: - output: [F, P, F_e, F_p, L_p, O] lattice: fcc - plasticity: - N_sl: [12] - a_sl: 2.25 - atol_xi: 1.0 - dot_gamma_0_sl: 0.001 - h_0_sl_sl: 75e6 - h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] - n_sl: 20 - output: [xi_sl] - type: phenopowerlaw - xi_0_sl: [31e6] - xi_inf_sl: [63e6] - pheno_bcc: - elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} - generic: + mech: output: [F, P, F_e, F_p, L_p, O] + elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} + plasticity: + N_sl: [12] + a_sl: 2.25 + atol_xi: 1.0 + dot_gamma_0_sl: 0.001 + h_0_sl_sl: 75e6 + h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] + n_sl: 20 + output: [xi_sl] + type: phenopowerlaw + xi_0_sl: [31e6] + xi_inf_sl: [63e6] + pheno_bcc: lattice: bcc - plasticity: - N_sl: [12] - a_sl: 2.25 - atol_xi: 1.0 - dot_gamma_0_sl: 0.001 - h_0_sl_sl: 75e6 - h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] - n_sl: 20 - output: [xi_sl] - type: phenopowerlaw - xi_0_sl: [31e6] - xi_inf_sl: [63e6] + mech: + output: [F, P, F_e, F_p, L_p, O] + elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} + plasticity: + N_sl: [12] + a_sl: 2.25 + atol_xi: 1.0 + dot_gamma_0_sl: 0.001 + h_0_sl_sl: 75e6 + h_sl_sl: [1, 1, 1.4, 1.4, 1.4, 1.4] + n_sl: 20 + output: [xi_sl] + type: phenopowerlaw + xi_0_sl: [31e6] + xi_inf_sl: [63e6] material: - constituents: From 287d56fc3d3c85006125b73ceae1ff3f00d87cbb Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Sun, 8 Nov 2020 16:01:11 +0100 Subject: [PATCH 13/13] consistent with new output names --- python/tests/reference/ConfigMaterial/material.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/reference/ConfigMaterial/material.yaml b/python/tests/reference/ConfigMaterial/material.yaml index 2007b90c3..c39629db3 100644 --- a/python/tests/reference/ConfigMaterial/material.yaml +++ b/python/tests/reference/ConfigMaterial/material.yaml @@ -35,10 +35,10 @@ phase: Aluminum: lattice: fcc mech: - output: [F, P, Fe, Fp, Lp] + output: [F, P, F_e, F_p, L_p] elasticity: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: hooke} Steel: lattice: bcc mech: - output: [F, P, Fe, Fp, Lp] + output: [F, P, F_e, F_p, L_p] elasticity: {C_11: 233.3e9, C_12: 135.5e9, C_44: 118.0e9, type: hooke}