From 7b761476e4afd93c8a530057e473935044df28aa Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Mon, 2 Nov 2020 22:46:46 +0100 Subject: [PATCH] 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')