From 2f7efa20552804872da6876fbc26bb152e76af38 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Nov 2013 08:04:05 +0000 Subject: [PATCH] introduced named constants for homogenization_type, phase_plasticitiy, and phase_elasticity to replace expensive string comparison. Labels for different schemes need to be stored in material.f90 because they are needed when parsing the config file --- code/IO.f90 | 2 +- code/constitutive.f90 | 348 ++++++++++++++-------------- code/constitutive_dislotwin.f90 | 137 ++++------- code/constitutive_j2.f90 | 27 +-- code/constitutive_none.f90 | 11 +- code/constitutive_nonlocal.f90 | 164 ++++++------- code/constitutive_phenopowerlaw.f90 | 63 +++-- code/constitutive_titanmod.f90 | 67 +++--- code/crystallite.f90 | 16 +- code/homogenization.f90 | 63 ++--- code/homogenization_RGC.f90 | 18 +- code/homogenization_isostrain.f90 | 14 +- 12 files changed, 424 insertions(+), 506 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index 4f293b045..9cf63009c 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -1474,7 +1474,7 @@ subroutine IO_error(error_ID,el,ip,g,ext_msg) case (200_pInt) msg = 'unknown elasticity specified:' case (201_pInt) - msg = 'unknown plasticity specified:' + msg = 'unknown plasticity specified:' case (205_pInt) msg = 'unknown lattice structure encountered' case (206_pInt) diff --git a/code/constitutive.f90 b/code/constitutive.f90 index 242587a35..6d1471ce6 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -55,8 +55,6 @@ module constitutive constitutive_maxSizePostResults integer(pInt), private :: & constitutive_maxSizeState - - character (len=*), parameter, public :: constitutive_hooke_label = 'hooke' public :: & constitutive_init, & @@ -109,7 +107,21 @@ subroutine constitutive_init phase_plasticityInstance, & phase_Noutput, & homogenization_Ngrains, & - homogenization_maxNgrains + homogenization_maxNgrains, & + ELASTICITY_HOOKE_ID, & + PLASTICITY_NONE_ID, & + PLASTICITY_J2_ID, & + PLASTICITY_PHENOPOWERLAW_ID, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID ,& + ELASTICITY_HOOKE_label, & + PLASTICITY_NONE_label, & + PLASTICITY_J2_label, & + PLASTICITY_PHENOPOWERLAW_label, & + PLASTICITY_DISLOTWIN_label, & + PLASTICITY_TITANMOD_label, & + PLASTICITY_NONLOCAL_label use constitutive_none use constitutive_j2 use constitutive_phenopowerlaw @@ -132,15 +144,16 @@ subroutine constitutive_init myNgrains integer(pInt), 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, nonlocalConstitutionPresent + nonlocalConstitutionPresent = .false. !-------------------------------------------------------------------------------------------------- ! parse plasticities from config file - if (.not. IO_open_jobFile_stat(fileunit,material_localFileExt)) then ! no local material configuration present... + if (.not. IO_open_jobFile_stat(fileunit,material_localFileExt)) & ! no local material configuration present... call IO_open_file(fileunit,material_configFile) ! ... open material.config file - endif call constitutive_none_init(fileunit) call constitutive_j2_init(fileunit) call constitutive_phenopowerlaw_init(fileunit) @@ -160,23 +173,29 @@ subroutine constitutive_init do p = 1_pInt,material_Nphase i = phase_plasticityInstance(p) ! which instance of a plasticity is present phase knownPlasticity = .true. ! assume valid - select case(phase_plasticity(p)) ! split per constitiution - case (constitutive_none_label) + select case(phase_plasticity(p)) ! split per constititution + case (PLASTICITY_NONE_ID) + outputName = PLASTICITY_NONE_label thisOutput => NULL() ! constitutive_none_output thisSize => NULL() ! constitutive_none_sizePostResult - case (constitutive_j2_label) + case (PLASTICITY_J2_ID) + outputName = PLASTICITY_J2_label thisOutput => constitutive_j2_output thisSize => constitutive_j2_sizePostResult - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) + outputName = 'phenopowerlaw' thisOutput => constitutive_phenopowerlaw_output thisSize => constitutive_phenopowerlaw_sizePostResult - case (constitutive_titanmod_label) - thisOutput => constitutive_titanmod_output - thisSize => constitutive_titanmod_sizePostResult - case (constitutive_dislotwin_label) + case (PLASTICITY_DISLOTWIN_ID) + outputName = PLASTICITY_DISLOTWIN_label thisOutput => constitutive_dislotwin_output thisSize => constitutive_dislotwin_sizePostResult - case (constitutive_nonlocal_label) + case (PLASTICITY_TITANMOD_ID) + outputName = PLASTICITY_TITANMOD_label + thisOutput => constitutive_titanmod_output + thisSize => constitutive_titanmod_sizePostResult + case (PLASTICITY_NONLOCAL_ID) + outputName = PLASTICITY_NONLOCAL_label thisOutput => constitutive_nonlocal_output thisSize => constitutive_nonlocal_sizePostResult case default @@ -184,7 +203,7 @@ subroutine constitutive_init end select write(fileunit,'(/,a,/)') '['//trim(phase_name(p))//']' if (knownPlasticity) then - write(fileunit,'(a)') '(plasticity)'//char(9)//trim(phase_plasticity(p)) + write(fileunit,'(a)') '(plasticity)'//char(9)//trim(outputName) do e = 1_pInt,phase_Noutput(p) write(fileunit,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i) enddo @@ -225,18 +244,12 @@ subroutine constitutive_init myNgrains = homogenization_Ngrains(mesh_element(3,e)) do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) ! loop over IPs do g = 1_pInt,myNgrains ! loop over grains - select case(phase_elasticity(material_phase(g,i,e))) - - case (constitutive_hooke_label) - ! valid elasticity but nothing to do - case default - call IO_error(200_pInt,ext_msg=trim(phase_elasticity(material_phase(g,i,e)))) ! unknown elasticity - + select case(phase_elasticity(material_phase(g,i,e))) + case default ! so far no output for elasticity end select matID = phase_plasticityInstance(material_phase(g,i,e)) - select case(phase_plasticity(material_phase(g,i,e))) - - case (constitutive_none_label) + select case(phase_plasticity(material_phase(g,i,e))) + case (PLASTICITY_NONE_ID) allocate(constitutive_state0(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_none_sizeState(matID))) @@ -260,11 +273,10 @@ subroutine constitutive_init endif constitutive_state0(g,i,e)%p = 0.0_pReal constitutive_aTolState(g,i,e)%p = 1.0_pReal - constitutive_sizeState(g,i,e) = 0.0_pReal - constitutive_sizeDotState(g,i,e) = 0.0_pReal - constitutive_sizePostResults(g,i,e) = 0.0_pReal - - case (constitutive_j2_label) + constitutive_sizeState(g,i,e) = 0_pInt + constitutive_sizeDotState(g,i,e) = 0_pInt + constitutive_sizePostResults(g,i,e) = 0_pInt + case (PLASTICITY_J2_ID) allocate(constitutive_state0(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_j2_sizeState(matID))) @@ -291,8 +303,7 @@ subroutine constitutive_init constitutive_sizeState(g,i,e) = constitutive_j2_sizeState(matID) constitutive_sizeDotState(g,i,e) = constitutive_j2_sizeDotState(matID) constitutive_sizePostResults(g,i,e) = constitutive_j2_sizePostResults(matID) - - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) allocate(constitutive_state0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) @@ -319,36 +330,7 @@ subroutine constitutive_init constitutive_sizeState(g,i,e) = constitutive_phenopowerlaw_sizeState(matID) constitutive_sizeDotState(g,i,e) = constitutive_phenopowerlaw_sizeDotState(matID) constitutive_sizePostResults(g,i,e) = constitutive_phenopowerlaw_sizePostResults(matID) - - case (constitutive_titanmod_label) - allocate(constitutive_state0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_partionedState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_subState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_state(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_state_backup(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_aTolState(g,i,e)%p(constitutive_titanmod_sizeState(matID))) - allocate(constitutive_dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - allocate(constitutive_deltaState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - if (any(numerics_integrator == 1_pInt)) then - allocate(constitutive_previousDotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - endif - if (any(numerics_integrator == 4_pInt)) then - allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - endif - if (any(numerics_integrator == 5_pInt)) then - do s = 1_pInt,6_pInt - allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) - enddo - endif - constitutive_state0(g,i,e)%p = constitutive_titanmod_stateInit(matID) - constitutive_aTolState(g,i,e)%p = constitutive_titanmod_aTolState(matID) - constitutive_sizeState(g,i,e) = constitutive_titanmod_sizeState(matID) - constitutive_sizeDotState(g,i,e) = constitutive_titanmod_sizeDotState(matID) - constitutive_sizePostResults(g,i,e) = constitutive_titanmod_sizePostResults(matID) - - case (constitutive_dislotwin_label) + case (PLASTICITY_DISLOTWIN_ID) allocate(constitutive_state0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) @@ -375,8 +357,34 @@ subroutine constitutive_init constitutive_sizeState(g,i,e) = constitutive_dislotwin_sizeState(matID) constitutive_sizeDotState(g,i,e) = constitutive_dislotwin_sizeDotState(matID) constitutive_sizePostResults(g,i,e) = constitutive_dislotwin_sizePostResults(matID) - - case (constitutive_nonlocal_label) + case (PLASTICITY_TITANMOD_ID) + allocate(constitutive_state0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_partionedState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_subState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_state(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_state_backup(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_aTolState(g,i,e)%p(constitutive_titanmod_sizeState(matID))) + allocate(constitutive_dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + allocate(constitutive_deltaState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + if (any(numerics_integrator == 1_pInt)) then + allocate(constitutive_previousDotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + endif + if (any(numerics_integrator == 4_pInt)) then + allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + endif + if (any(numerics_integrator == 5_pInt)) then + do s = 1_pInt,6_pInt + allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) + enddo + endif + constitutive_state0(g,i,e)%p = constitutive_titanmod_stateInit(matID) + constitutive_aTolState(g,i,e)%p = constitutive_titanmod_aTolState(matID) + constitutive_sizeState(g,i,e) = constitutive_titanmod_sizeState(matID) + constitutive_sizeDotState(g,i,e) = constitutive_titanmod_sizeDotState(matID) + constitutive_sizePostResults(g,i,e) = constitutive_titanmod_sizePostResults(matID) + case (PLASTICITY_NONLOCAL_ID) nonlocalConstitutionPresent = .true. if(myNgrains/=1_pInt) call IO_error(252_pInt, e,i,g) allocate(constitutive_state0(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) @@ -404,10 +412,6 @@ subroutine constitutive_init constitutive_sizeState(g,i,e) = constitutive_nonlocal_sizeState(matID) constitutive_sizeDotState(g,i,e) = constitutive_nonlocal_sizeDotState(matID) constitutive_sizePostResults(g,i,e) = constitutive_nonlocal_sizePostResults(matID) - - case default - call IO_error(201_pInt,ext_msg=trim(phase_plasticity(material_phase(g,i,e)))) ! unknown plasticity - end select enddo enddo @@ -435,20 +439,19 @@ subroutine constitutive_init constitutive_maxSizePostResults = maxval(constitutive_sizePostResults) if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) then - write(6,'(a32,1x,7(i8,1x))') 'constitutive_state0: ', shape(constitutive_state0) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_partionedState0: ', shape(constitutive_partionedState0) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_subState0: ', shape(constitutive_subState0) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_state: ', shape(constitutive_state) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_aTolState: ', shape(constitutive_aTolState) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_dotState: ', shape(constitutive_dotState) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_deltaState: ', shape(constitutive_deltaState) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_sizeState: ', shape(constitutive_sizeState) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_sizeDotState: ', shape(constitutive_sizeDotState) - write(6,'(a32,1x,7(i8,1x))') 'constitutive_sizePostResults: ', shape(constitutive_sizePostResults) - write(6,*) - write(6,'(a32,1x,7(i8,1x))') 'maxSizeState: ', constitutive_maxSizeState - write(6,'(a32,1x,7(i8,1x))') 'maxSizeDotState: ', constitutive_maxSizeDotState - write(6,'(a32,1x,7(i8,1x))') 'maxSizePostResults: ', constitutive_maxSizePostResults + write(6,'(a32,1x,7(i8,1x))') 'constitutive_state0: ', shape(constitutive_state0) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_partionedState0: ', shape(constitutive_partionedState0) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_subState0: ', shape(constitutive_subState0) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_state: ', shape(constitutive_state) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_aTolState: ', shape(constitutive_aTolState) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_dotState: ', shape(constitutive_dotState) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_deltaState: ', shape(constitutive_deltaState) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_sizeState: ', shape(constitutive_sizeState) + write(6,'(a32,1x,7(i8,1x))') 'constitutive_sizeDotState: ', shape(constitutive_sizeDotState) + write(6,'(a32,1x,7(i8,1x),/)') 'constitutive_sizePostResults: ', shape(constitutive_sizePostResults) + write(6,'(a32,1x,7(i8,1x))') 'maxSizeState: ', constitutive_maxSizeState + write(6,'(a32,1x,7(i8,1x))') 'maxSizeDotState: ', constitutive_maxSizeDotState + write(6,'(a32,1x,7(i8,1x))') 'maxSizePostResults: ', constitutive_maxSizePostResults endif flush(6) @@ -461,24 +464,24 @@ end subroutine constitutive_init pure function constitutive_homogenizedC(ipc,ip,el) use material, only: & phase_plasticity, & - material_phase + material_phase, & + PLASTICITY_NONE_ID, & + PLASTICITY_J2_ID, & + PLASTICITY_PHENOPOWERLAW_ID, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID use constitutive_none, only: & - CONSTITUTIVE_NONE_label, & constitutive_none_homogenizedC use constitutive_j2, only: & - CONSTITUTIVE_J2_label, & constitutive_j2_homogenizedC use constitutive_phenopowerlaw, only: & - CONSTITUTIVE_PHENOPOWERLAW_label, & constitutive_phenopowerlaw_homogenizedC - use constitutive_titanmod, only: & - CONSTITUTIVE_TITANMOD_label, & - constitutive_titanmod_homogenizedC use constitutive_dislotwin, only: & - CONSTITUTIVE_DISLOTWIN_label, & constitutive_dislotwin_homogenizedC + use constitutive_titanmod, only: & + constitutive_titanmod_homogenizedC use constitutive_nonlocal, only: & - CONSTITUTIVE_NONLOCAL_label, & constitutive_nonlocal_homogenizedC implicit none @@ -490,23 +493,23 @@ pure function constitutive_homogenizedC(ipc,ip,el) select case (phase_plasticity(material_phase(ipc,ip,el))) - case (constitutive_none_label) + case (PLASTICITY_NONE_ID) constitutive_homogenizedC = constitutive_none_homogenizedC(ipc,ip,el) - case (constitutive_j2_label) + case (PLASTICITY_J2_ID) constitutive_homogenizedC = constitutive_j2_homogenizedC(ipc,ip,el) - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) constitutive_homogenizedC = constitutive_phenopowerlaw_homogenizedC(ipc,ip,el) - case (constitutive_nonlocal_label) - constitutive_homogenizedC = constitutive_nonlocal_homogenizedC(ipc,ip,el) - - case (constitutive_titanmod_label) + case (PLASTICITY_DISLOTWIN_ID) + constitutive_homogenizedC = constitutive_dislotwin_homogenizedC(constitutive_state,ipc,ip,el) + + case (PLASTICITY_TITANMOD_ID) constitutive_homogenizedC = constitutive_titanmod_homogenizedC(constitutive_state,ipc,ip,el) - case (constitutive_dislotwin_label) - constitutive_homogenizedC = constitutive_dislotwin_homogenizedC(constitutive_state,ipc,ip,el) + case (PLASTICITY_NONLOCAL_ID) + constitutive_homogenizedC = constitutive_nonlocal_homogenizedC(ipc,ip,el) end select @@ -519,15 +522,15 @@ end function constitutive_homogenizedC subroutine constitutive_microstructure(temperature, Fe, Fp, ipc, ip, el) use material, only: & phase_plasticity, & - material_phase + material_phase, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID use constitutive_titanmod, only: & - constitutive_titanmod_label, & constitutive_titanmod_microstructure use constitutive_dislotwin, only: & - constitutive_dislotwin_label, & constitutive_dislotwin_microstructure use constitutive_nonlocal, only: & - constitutive_nonlocal_label, & constitutive_nonlocal_microstructure implicit none @@ -542,14 +545,14 @@ subroutine constitutive_microstructure(temperature, Fe, Fp, ipc, ip, el) Fp !< plastic deformation gradient select case (phase_plasticity(material_phase(ipc,ip,el))) - - case (constitutive_titanmod_label) - call constitutive_titanmod_microstructure(temperature,constitutive_state,ipc,ip,el) - - case (constitutive_dislotwin_label) + + case (PLASTICITY_DISLOTWIN_ID) call constitutive_dislotwin_microstructure(temperature,constitutive_state,ipc,ip,el) - case (constitutive_nonlocal_label) + case (PLASTICITY_TITANMOD_ID) + call constitutive_titanmod_microstructure(temperature,constitutive_state,ipc,ip,el) + + case (PLASTICITY_NONLOCAL_ID) call constitutive_nonlocal_microstructure(constitutive_state,Fe,Fp,ipc,ip,el) end select @@ -565,23 +568,22 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip math_identity2nd use material, only: & phase_plasticity, & - material_phase - use constitutive_none, only: & - constitutive_none_label + material_phase, & + PLASTICITY_NONE_ID, & + PLASTICITY_J2_ID, & + PLASTICITY_PHENOPOWERLAW_ID, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID use constitutive_j2, only: & - constitutive_j2_label, & constitutive_j2_LpAndItsTangent use constitutive_phenopowerlaw, only: & - constitutive_phenopowerlaw_label, & - constitutive_phenopowerlaw_LpAndItsTangent - use constitutive_titanmod, only: & - constitutive_titanmod_label, & - constitutive_titanmod_LpAndItsTangent + constitutive_phenopowerlaw_LpAndItsTangent use constitutive_dislotwin, only: & - constitutive_dislotwin_label, & constitutive_dislotwin_LpAndItsTangent + use constitutive_titanmod, only: & + constitutive_titanmod_LpAndItsTangent use constitutive_nonlocal, only: & - constitutive_nonlocal_label, & constitutive_nonlocal_LpAndItsTangent implicit none @@ -600,23 +602,23 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip select case (phase_plasticity(material_phase(ipc,ip,el))) - case (constitutive_none_label) + case (PLASTICITY_NONE_ID) Lp = 0.0_pReal dLp_dTstar = math_identity2nd(9) - case (constitutive_j2_label) + case (PLASTICITY_J2_ID) call constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,constitutive_state,ipc,ip,el) - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) call constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,constitutive_state,ipc,ip,el) + + case (PLASTICITY_DISLOTWIN_ID) + call constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,temperature,constitutive_state,ipc,ip,el) - case (constitutive_titanmod_label) + case (PLASTICITY_TITANMOD_ID) call constitutive_titanmod_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,temperature,constitutive_state,ipc,ip,el) - case (constitutive_dislotwin_label) - call constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,temperature,constitutive_state,ipc,ip,el) - - case (constitutive_nonlocal_label) + case (PLASTICITY_NONLOCAL_ID) call constitutive_nonlocal_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, constitutive_state(ipc,ip,el), ipc,ip,el) end select @@ -631,8 +633,6 @@ end subroutine constitutive_LpAndItsTangent !! because only hooke is implemented !-------------------------------------------------------------------------------------------------- pure subroutine constitutive_TandItsTangent(T, dT_dFe, Fe, ipc, ip, el) - use material, only: & - phase_elasticity,material_phase implicit none integer(pInt), intent(in) :: & @@ -709,24 +709,23 @@ subroutine constitutive_collectDotState(Tstar_v, Fe, Fp, Temperature, subdt, sub use material, only: & phase_plasticity, & material_phase, & - homogenization_maxNgrains - use constitutive_none, only: & - constitutive_none_label + homogenization_maxNgrains, & + PLASTICITY_NONE_ID, & + PLASTICITY_J2_ID, & + PLASTICITY_PHENOPOWERLAW_ID, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID use constitutive_j2, only: & - constitutive_j2_dotState, & - constitutive_j2_label + constitutive_j2_dotState use constitutive_phenopowerlaw, only: & - constitutive_phenopowerlaw_dotState, & - constitutive_phenopowerlaw_label - use constitutive_titanmod, only: & - constitutive_titanmod_dotState, & - constitutive_titanmod_label + constitutive_phenopowerlaw_dotState use constitutive_dislotwin, only: & - constitutive_dislotwin_dotState, & - constitutive_dislotwin_label + constitutive_dislotwin_dotState + use constitutive_titanmod, only: & + constitutive_titanmod_dotState use constitutive_nonlocal, only: & - constitutive_nonlocal_dotState, & - constitutive_nonlocal_label + constitutive_nonlocal_dotState implicit none integer(pInt), intent(in) :: & @@ -753,22 +752,22 @@ subroutine constitutive_collectDotState(Tstar_v, Fe, Fp, Temperature, subdt, sub select case (phase_plasticity(material_phase(ipc,ip,el))) - case (constitutive_none_label) + case (PLASTICITY_NONE_ID) constitutive_dotState(ipc,ip,el)%p = 0.0_pReal !ToDo: needed or will it remain zero anyway? - case (constitutive_j2_label) + case (PLASTICITY_J2_ID) constitutive_dotState(ipc,ip,el)%p = constitutive_j2_dotState(Tstar_v,constitutive_state,ipc,ip,el) - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) constitutive_dotState(ipc,ip,el)%p = constitutive_phenopowerlaw_dotState(Tstar_v,constitutive_state,ipc,ip,el) - case (constitutive_titanmod_label) + case (PLASTICITY_TITANMOD_ID) constitutive_dotState(ipc,ip,el)%p = constitutive_titanmod_dotState(Tstar_v,Temperature,constitutive_state,ipc,ip,el) - case (constitutive_dislotwin_label) + case (PLASTICITY_DISLOTWIN_ID) constitutive_dotState(ipc,ip,el)%p = constitutive_dislotwin_dotState(Tstar_v,Temperature,constitutive_state,ipc,ip,el) - case (constitutive_nonlocal_label) + case (PLASTICITY_NONLOCAL_ID) constitutive_dotState(ipc,ip,el)%p = constitutive_nonlocal_dotState(Tstar_v, Fe, Fp, Temperature, constitutive_state, & constitutive_state0, subdt, subfrac, ipc, ip, el) @@ -802,10 +801,10 @@ subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el) debug_levelBasic use material, only: & phase_plasticity, & - material_phase + material_phase, & + PLASTICITY_NONLOCAL_ID use constitutive_nonlocal, only: & - constitutive_nonlocal_deltaState, & - constitutive_nonlocal_label + constitutive_nonlocal_deltaState implicit none integer(pInt), intent(in) :: & @@ -824,7 +823,7 @@ subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el) select case (phase_plasticity(material_phase(ipc,ip,el))) - case (constitutive_nonlocal_label) + case (PLASTICITY_NONLOCAL_ID) call constitutive_nonlocal_deltaState(constitutive_deltaState(ipc,ip,el),constitutive_state, Tstar_v,ipc,ip,el) case default @@ -855,24 +854,23 @@ function constitutive_postResults(Tstar_v, Fe, temperature, ipc, ip, el) use material, only: & phase_plasticity, & material_phase, & - homogenization_maxNgrains - use constitutive_none, only: & - constitutive_none_label + homogenization_maxNgrains, & + PLASTICITY_NONE_ID, & + PLASTICITY_J2_ID, & + PLASTICITY_PHENOPOWERLAW_ID, & + PLASTICITY_DISLOTWIN_ID, & + PLASTICITY_TITANMOD_ID, & + PLASTICITY_NONLOCAL_ID use constitutive_j2, only: & - constitutive_j2_postResults, & - constitutive_j2_label + constitutive_j2_postResults use constitutive_phenopowerlaw, only: & - constitutive_phenopowerlaw_postResults, & - constitutive_phenopowerlaw_label - use constitutive_titanmod, only: & - constitutive_titanmod_postResults, & - constitutive_titanmod_label + constitutive_phenopowerlaw_postResults use constitutive_dislotwin, only: & - constitutive_dislotwin_postResults, & - constitutive_dislotwin_label + constitutive_dislotwin_postResults + use constitutive_titanmod, only: & + constitutive_titanmod_postResults use constitutive_nonlocal, only: & - constitutive_nonlocal_postResults, & - constitutive_nonlocal_label + constitutive_nonlocal_postResults implicit none integer(pInt), intent(in) :: & @@ -892,22 +890,22 @@ function constitutive_postResults(Tstar_v, Fe, temperature, ipc, ip, el) select case (phase_plasticity(material_phase(ipc,ip,el))) - case (constitutive_none_label) + case (PLASTICITY_NONE_ID) constitutive_postResults = 0.0_pReal - case (constitutive_titanmod_label) + case (PLASTICITY_TITANMOD_ID) constitutive_postResults = constitutive_titanmod_postResults(constitutive_state,ipc,ip,el) - case (constitutive_j2_label) + case (PLASTICITY_J2_ID) constitutive_postResults = constitutive_j2_postResults(Tstar_v,constitutive_state,ipc,ip,el) - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) constitutive_postResults = constitutive_phenopowerlaw_postResults(Tstar_v,constitutive_state,ipc,ip,el) - case (constitutive_dislotwin_label) + case (PLASTICITY_DISLOTWIN_ID) constitutive_postResults = constitutive_dislotwin_postResults(Tstar_v,Temperature,constitutive_state,ipc,ip,el) - case (constitutive_nonlocal_label) + case (PLASTICITY_NONLOCAL_ID) constitutive_postResults = constitutive_nonlocal_postResults(Tstar_v, Fe, constitutive_state, & constitutive_dotstate(ipc,ip,el), ipc, ip, el) end select diff --git a/code/constitutive_dislotwin.f90 b/code/constitutive_dislotwin.f90 index 0d6a129bb..2ee745076 100644 --- a/code/constitutive_dislotwin.f90 +++ b/code/constitutive_dislotwin.f90 @@ -25,15 +25,12 @@ !> @details to be done !-------------------------------------------------------------------------------------------------- module constitutive_dislotwin -use prec, only: & + use prec, only: & pReal, & pInt implicit none private - character(len=*), parameter, public :: & - CONSTITUTIVE_DISLOTWIN_label = 'dislotwin' - integer(pInt), dimension(:), allocatable, public, protected :: & constitutive_dislotwin_sizeDotState, & !< number of dotStates constitutive_dislotwin_sizeState, & !< total number of microstructural state variables @@ -198,12 +195,12 @@ subroutine constitutive_dislotwin_init(file) character(len=65536) :: tag character(len=65536) :: line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_DISLOTWIN_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == CONSTITUTIVE_DISLOTWIN_label),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_DISLOTWIN_ID),pInt) if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -325,26 +322,25 @@ subroutine constitutive_dislotwin_init(file) allocate(constitutive_dislotwin_sbSv(6,6,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems)) constitutive_dislotwin_sbSv = 0.0_pReal - !* Readout data from material.config file + rewind(file) - do while (trim(line) /= '#EOF#' .and. IO_lc(IO_getTag(line,'<','>')) /= 'phase') ! wind forward to line = IO_read(file) enddo - do while (trim(line) /= '#EOF#') ! read thru sections of phase part + do while (trim(line) /= '#EOF#') ! read thru sections of phase part line = IO_read(file) - if (IO_isBlank(line)) cycle ! skip empty lines - if (IO_getTag(line,'<','>') /= '') exit ! stop at next part - if (IO_getTag(line,'[',']') /= '') then ! next section - section = section + 1_pInt ! advance section counter + if (IO_isBlank(line)) cycle ! skip empty lines + if (IO_getTag(line,'<','>') /= '') exit ! stop at next part + if (IO_getTag(line,'[',']') /= '') then ! next section + section = section + 1_pInt ! advance section counter cycle endif - if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_DISLOTWIN_label) then ! one of my sections - i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase + if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran + if (phase_plasticity(section) == PLASTICITY_DISLOTWIN_ID) then ! one of my sections + i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) - tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key + tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key select case(tag) case ('plasticity', 'elasticity') cycle @@ -382,14 +378,14 @@ subroutine constitutive_dislotwin_init(file) constitutive_dislotwin_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt) case ('nslip') if (positions(1) < 1_pInt + Nchunks_SlipFamilies) & - call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') Nchunks_SlipFamilies = positions(1) - 1_pInt do j = 1_pInt, Nchunks_SlipFamilies constitutive_dislotwin_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j) enddo case ('ntwin') if (positions(1) < 1_pInt + Nchunks_TwinFamilies) & - call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') Nchunks_TwinFamilies = positions(1) - 1_pInt do j = 1_pInt, Nchunks_TwinFamilies constitutive_dislotwin_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j) @@ -466,25 +462,25 @@ subroutine constitutive_dislotwin_init(file) constitutive_dislotwin_CAtomicVolume(i) = IO_floatValue(line,positions,2_pInt) case ('interaction_slipslip','interactionslipslip') if (positions(1) < 1_pInt + Nchunks_SlipSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') do j = 1_pInt, Nchunks_SlipSlip constitutive_dislotwin_interaction_SlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_sliptwin','interactionsliptwin') if (positions(1) < 1_pInt + Nchunks_SlipTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') do j = 1_pInt, Nchunks_SlipTwin constitutive_dislotwin_interaction_SlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twinslip','interactiontwinslip') if (positions(1) < 1_pInt + Nchunks_TwinSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') do j = 1_pInt, Nchunks_TwinSlip constitutive_dislotwin_interaction_TwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twintwin','interactiontwintwin') if (positions(1) < 1_pInt + Nchunks_TwinTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') do j = 1_pInt, Nchunks_TwinTwin constitutive_dislotwin_interaction_TwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo @@ -499,7 +495,7 @@ subroutine constitutive_dislotwin_init(file) case ('qedgepersbsystem') constitutive_dislotwin_sbQedge(i) = IO_floatValue(line,positions,2_pInt) case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_DISLOTWIN_label//')') end select endif endif @@ -512,46 +508,46 @@ subroutine constitutive_dislotwin_init(file) if (structID < 1_pInt) call IO_error(205_pInt,el=i) if (sum(constitutive_dislotwin_Nslip(:,i)) < 0_pInt) call IO_error(211_pInt,el=i,ext_msg='Nslip (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (sum(constitutive_dislotwin_Ntwin(:,i)) < 0_pInt) call IO_error(211_pInt,el=i,ext_msg='Ntwin (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') do f = 1_pInt,lattice_maxNslipFamily if (constitutive_dislotwin_Nslip(f,i) > 0_pInt) then if (constitutive_dislotwin_rhoEdge0(f,i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='rhoEdge0 (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_rhoEdgeDip0(f,i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='rhoEdgeDip0 (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_burgersPerSlipFamily(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='slipBurgers (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_v0PerSlipFamily(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='v0 (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') endif enddo do f = 1_pInt,lattice_maxNtwinFamily if (constitutive_dislotwin_Ntwin(f,i) > 0_pInt) then if (constitutive_dislotwin_burgersPerTwinFamily(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='twinburgers (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_Ndot0PerTwinFamily(f,i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='ndot0 (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') endif enddo if (constitutive_dislotwin_CAtomicVolume(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='cAtomicVolume (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_D0(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='D0 (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_Qsd(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='Qsd (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_SFE_0K(i) == 0.0_pReal .and. & constitutive_dislotwin_dSFE_dT(i) == 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='SFE (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_aTolRho(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='aTolRho (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_aTolTwinFrac(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='aTolTwinFrac (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_sbResistance(i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='sbResistance (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') if (constitutive_dislotwin_sbVelocity(i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='sbVelocity (' & - //CONSTITUTIVE_DISLOTWIN_label//')') + //PLASTICITY_DISLOTWIN_label//')') !* Determine total number of active slip or twin systems constitutive_dislotwin_Nslip(:,i) = min(lattice_NslipSystem(:,structID),constitutive_dislotwin_Nslip(:,i)) @@ -606,7 +602,6 @@ subroutine constitutive_dislotwin_init(file) ns = constitutive_dislotwin_totalNslip(i) nt = constitutive_dislotwin_totalNtwin(i) - ! write(6,*) 'instance',i,'has nslip and ntwin',ns,nt !* Determine size of state array constitutive_dislotwin_sizeDotState(i) = int(size(CONSTITUTIVE_DISLOTWIN_listBasicSlipStates),pInt) * ns & @@ -646,7 +641,7 @@ subroutine constitutive_dislotwin_init(file) case('sb_eigenvectors') mySize = 9_pInt case default - call IO_error(212_pInt,ext_msg=constitutive_dislotwin_output(o,i)//' ('//CONSTITUTIVE_DISLOTWIN_label//')') + call IO_error(212_pInt,ext_msg=constitutive_dislotwin_output(o,i)//' ('//PLASTICITY_DISLOTWIN_label//')') end select if (mySize > 0_pInt) then ! any meaningful output found @@ -808,9 +803,9 @@ function constitutive_dislotwin_stateInit(matID) ns = constitutive_dislotwin_totalNslip(matID) nt = constitutive_dislotwin_totalNtwin(matID) constitutive_dislotwin_stateInit = 0.0_pReal - - !* Initialize basic slip state variables - + +!-------------------------------------------------------------------------------------------------- +! initialize basic slip state variables do f = 1_pInt,lattice_maxNslipFamily index_myFamily = sum(constitutive_dislotwin_Nslip(1:f-1_pInt,matID)) ! index in truncated slip system list rhoEdge0(index_myFamily+1_pInt: & @@ -824,7 +819,8 @@ function constitutive_dislotwin_stateInit(matID) constitutive_dislotwin_stateInit(1_pInt:ns) = rhoEdge0 constitutive_dislotwin_stateInit(ns+1_pInt:2_pInt*ns) = rhoEdgeDip0 - !* Initialize dependent slip microstructural variables +!-------------------------------------------------------------------------------------------------- +! initialize dependent slip microstructural variables forall (i = 1_pInt:ns) & invLambdaSlip0(i) = sqrt(dot_product((rhoEdge0+rhoEdgeDip0),constitutive_dislotwin_forestProjectionEdge(1:ns,i,matID)))/ & constitutive_dislotwin_CLambdaSlipPerSlipSystem(i,matID) @@ -841,7 +837,8 @@ function constitutive_dislotwin_stateInit(matID) sqrt(dot_product((rhoEdge0+rhoEdgeDip0),constitutive_dislotwin_interactionMatrix_SlipSlip(i,1:ns,matID))) constitutive_dislotwin_stateInit(6_pInt*ns+4_pInt*nt+1:7_pInt*ns+4_pInt*nt) = tauSlipThreshold0 - !* Initialize dependent twin microstructural variables +!-------------------------------------------------------------------------------------------------- +! initialize dependent twin microstructural variables forall (j = 1_pInt:nt) & MeanFreePathTwin0(j) = constitutive_dislotwin_GrainSize(matID) constitutive_dislotwin_stateInit(6_pInt*ns+3_pInt*nt+1_pInt:6_pInt*ns+4_pInt*nt) = MeanFreePathTwin0 @@ -851,16 +848,6 @@ function constitutive_dislotwin_stateInit(matID) (pi/4.0_pReal)*constitutive_dislotwin_twinsizePerTwinSystem(j,matID)*MeanFreePathTwin0(j)**(2.0_pReal) constitutive_dislotwin_stateInit(7_pInt*ns+5_pInt*nt+1_pInt:7_pInt*ns+6_pInt*nt) = TwinVolume0 - !write(6,*) '#STATEINIT#' - !write(6,*) - !write(6,'(a,/,4(3(f30.20,1x)/))') 'RhoEdge',rhoEdge0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'RhoEdgedip',rhoEdgeDip0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'invLambdaSlip',invLambdaSlip0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'MeanFreePathSlip',MeanFreePathSlip0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'tauSlipThreshold', tauSlipThreshold0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'MeanFreePathTwin', MeanFreePathTwin0 - !write(6,'(a,/,4(3(f30.20,1x)/))') 'TwinVolume', TwinVolume0 - end function constitutive_dislotwin_stateInit @@ -1076,14 +1063,6 @@ subroutine constitutive_dislotwin_microstructure(temperature,state,ipc,ip,el) (1/(x0+constitutive_dislotwin_xc(matID))+cos(pi/3.0_pReal)/x0) enddo - !if ((ip==1).and.(el==1)) then - ! write(6,*) '#MICROSTRUCTURE#' - ! write(6,*) - ! write(6,'(a,/,4(3(f10.4,1x)/))') 'rhoEdge',state(ipc,ip,el)%p(1:ns)/1e9 - ! write(6,'(a,/,4(3(f10.4,1x)/))') 'rhoEdgeDip',state(ipc,ip,el)%p(ns+1:2*ns)/1e9 - ! write(6,'(a,/,4(3(f10.4,1x)/))') 'Fraction',state(ipc,ip,el)%p(2*ns+1:2*ns+nt) - !endif - end subroutine constitutive_dislotwin_microstructure @@ -1233,10 +1212,6 @@ subroutine constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,Temperat !* Resolved shear stress on shear banding system tau_sb(j) = dot_product(Tstar_v,constitutive_dislotwin_sbSv(1:6,j,ipc,ip,el)) - ! if (debug_selectiveDebugger .and. ipc==debug_ipc .and. ip==debug_i .and. el==debug_e) then - ! write(6,'(a,3(i3,1x),a,i1,a,e10.3)') '### TAU SHEARBAND at ipc ip el ',ipc,ip,el,' on family ',j,' : ',tau - ! endif - !* Stress ratios StressRatio_p = (abs(tau_sb(j))/constitutive_dislotwin_sbResistance(matID))**constitutive_dislotwin_p(matID) StressRatio_pminus1 = (abs(tau_sb(j))/constitutive_dislotwin_sbResistance(matID))& @@ -1322,16 +1297,6 @@ subroutine constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v,Temperat dLp_dTstar = math_Plain3333to99(dLp_dTstar3333) - !if ((ip==1).and.(el==1)) then - ! write(6,*) '#LP/TANGENT#' - ! write(6,*) - ! write(6,*) 'Tstar_v', Tstar_v - ! write(6,*) 'tau_slip', tau_slip - ! write(6,'(a10,/,4(3(e20.8,1x),/))') 'state',state(1,1,1)%p - ! write(6,'(a,/,3(3(f10.4,1x)/))') 'Lp',Lp - ! write(6,'(a,/,9(9(f10.4,1x)/))') 'dLp_dTstar',dLp_dTstar - !endif - end subroutine constitutive_dislotwin_LpAndItsTangent @@ -1511,18 +1476,6 @@ pure function constitutive_dislotwin_dotState(Tstar_v,Temperature,state,ipc,ip,e enddo enddo - !write(6,*) '#DOTSTATE#' - !write(6,*) - !write(6,'(a,/,4(3(f30.20,1x)/))') 'tau slip',tau_slip - !write(6,'(a,/,4(3(f30.20,1x)/))') 'gamma slip',gdot_slip - !write(6,'(a,/,4(3(f30.20,1x)/))') 'RhoEdge',state(ipc,ip,el)%p(1:ns) - !write(6,'(a,/,4(3(f30.20,1x)/))') 'Threshold Slip', state(ipc,ip,el)%p(5*ns+3*nt+1:6*ns+3*nt) - !write(6,'(a,/,4(3(f30.20,1x)/))') 'Multiplication',DotRhoMultiplication - !write(6,'(a,/,4(3(f30.20,1x)/))') 'DipFormation',DotRhoDipFormation - !write(6,'(a,/,4(3(f30.20,1x)/))') 'SingleSingle',DotRhoEdgeEdgeAnnihilation - !write(6,'(a,/,4(3(f30.20,1x)/))') 'SingleDipole',DotRhoEdgeDipAnnihilation - !write(6,'(a,/,4(3(f30.20,1x)/))') 'DipClimb',DotRhoEdgeDipClimb - end function constitutive_dislotwin_dotState @@ -1824,7 +1777,7 @@ function constitutive_dislotwin_postResults(Tstar_v,Temperature,state,ipc,ip,el) constitutive_dislotwin_postResults(c+j) = eigValues(j) c = c + 3_pInt case ('sb_eigenvectors') - constitutive_dislotwin_postResults(c+1_pInt:c+9_pInt) = reshape(eigVectors,(/9/)) + constitutive_dislotwin_postResults(c+1_pInt:c+9_pInt) = reshape(eigVectors,[9]) c = c + 9_pInt end select enddo diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index 0cd0e7d43..bd2f8efa3 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -33,9 +33,6 @@ module constitutive_j2 implicit none private - character (len=*), parameter, public :: & - CONSTITUTIVE_J2_label = 'j2' !< label for this constitutive model - integer(pInt), dimension(:), allocatable, public, protected :: & constitutive_j2_sizeDotState, & !< number of dotStates constitutive_j2_sizeState, & !< total number of microstructural variables @@ -125,12 +122,12 @@ subroutine constitutive_j2_init(myFile) tag = '', & line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_J2_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_J2_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == CONSTITUTIVE_J2_label),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_J2_ID),pInt) if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -193,7 +190,7 @@ subroutine constitutive_j2_init(myFile) cycle ! skip to next line endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_J2_label) then ! one of my sections + if (phase_plasticity(section) == PLASTICITY_J2_ID) then ! one of my sections i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -251,7 +248,7 @@ subroutine constitutive_j2_init(myFile) case ('atol_resistance') constitutive_j2_aTolResistance(i) = IO_floatValue(line,positions,2_pInt) case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_J2_label//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') end select endif endif @@ -260,19 +257,19 @@ subroutine constitutive_j2_init(myFile) sanityChecks: do i = 1_pInt,maxNinstance if (constitutive_j2_structureName(i) == '') call IO_error(205_pInt,el=i) if (constitutive_j2_tau0(i) < 0.0_pReal) call IO_error(211_pInt,ext_msg='tau0 (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_gdot0(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='gdot0 (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_n(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='n (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_tausat(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='tausat (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_a(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='a (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_fTaylor(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='taylorfactor (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') if (constitutive_j2_aTolResistance(i) <= 0.0_pReal) call IO_error(211_pInt,ext_msg='aTol_resistance (' & - //CONSTITUTIVE_J2_label//')') + //PLASTICITY_J2_label//')') enddo sanityChecks instancesLoop: do i = 1_pInt,maxNinstance @@ -283,7 +280,7 @@ subroutine constitutive_j2_init(myFile) case('strainrate') mySize = 1_pInt case default - call IO_error(212_pInt,ext_msg=constitutive_j2_output(o,i)//' ('//CONSTITUTIVE_J2_label//')') + call IO_error(212_pInt,ext_msg=constitutive_j2_output(o,i)//' ('//PLASTICITY_J2_label//')') end select if (mySize > 0_pInt) then ! any meaningful output found diff --git a/code/constitutive_none.f90 b/code/constitutive_none.f90 index afb07f948..3f3dcb531 100644 --- a/code/constitutive_none.f90 +++ b/code/constitutive_none.f90 @@ -30,9 +30,6 @@ module constitutive_none implicit none private - character (len=*), parameter, public :: & - CONSTITUTIVE_NONE_label = 'none' !< label for this constitutive model - integer(pInt), dimension(:), allocatable, public, protected :: & constitutive_none_sizeDotState, & constitutive_none_sizeState, & @@ -92,12 +89,12 @@ subroutine constitutive_none_init(myFile) tag = '', & line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_NONE_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONE_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == CONSTITUTIVE_NONE_label),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_NONE_ID),pInt) if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -129,7 +126,7 @@ subroutine constitutive_none_init(myFile) cycle endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_NONE_label) then ! one of my sections + if (phase_plasticity(section) == PLASTICITY_NONE_ID) then ! one of my sections i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -157,7 +154,7 @@ subroutine constitutive_none_init(myFile) case ('c66') constitutive_none_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt) case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_NONE_label//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONE_label//')') end select endif endif diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90 index 1d7728e51..bf67d786b 100644 --- a/code/constitutive_nonlocal.f90 +++ b/code/constitutive_nonlocal.f90 @@ -16,20 +16,15 @@ ! You should have received a copy of the GNU General Public License ! along with DAMASK. If not, see . ! -!############################################################## -!* $Id$ -!************************************ -!* Module: CONSTITUTIVE_NONLOCAL * -!************************************ -!* contains: * -!* - constitutive equations * -!* - parameters definition * -!************************************ - - -MODULE constitutive_nonlocal - -!* Include other modules +!-------------------------------------------------------------------------------------------------- +! $Id$ +!-------------------------------------------------------------------------------------------------- +!> @author Christoph Kords, Max-Planck-Institut für Eisenforschung GmbH +!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH +!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH +!> @brief material subroutine for plasticity including dislocation flux +!-------------------------------------------------------------------------------------------------- +module constitutive_nonlocal use prec, only: & pReal, & pInt, & @@ -37,13 +32,6 @@ use prec, only: & implicit none private - - -!* Definition of parameters - -character (len=*), parameter, public :: & -CONSTITUTIVE_NONLOCAL_LABEL = 'nonlocal' - character(len=22), dimension(11), parameter, private :: & BASICSTATES = ['rhoSglEdgePosMobile ', & 'rhoSglEdgeNegMobile ', & @@ -213,14 +201,13 @@ constitutive_nonlocal_kinetics, & constitutive_nonlocal_dislocationstress -CONTAINS +contains !-------------------------------------------------------------------------------------------------- !> @brief module initialization !> @details reads in material parameters, allocates arrays, and does sanity checks !-------------------------------------------------------------------------------------------------- subroutine constitutive_nonlocal_init(myFile) - use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use math, only: math_Mandel3333to66, & math_Voigt66to3333, & @@ -246,11 +233,11 @@ use mesh, only: mesh_NcpElems, & use material, only: homogenization_maxNgrains, & phase_plasticity, & phase_plasticityInstance, & - phase_Noutput + phase_Noutput, & + PLASTICITY_NONLOCAL_label, & + PLASTICITY_NONLOCAL_ID use lattice -!*** output variables - !*** input variables integer(pInt), intent(in) :: myFile @@ -278,15 +265,15 @@ integer(pInt) :: section = 0_pInt, & Nchunks_SlipFamilies = 0_pInt, & Nchunks_nonSchmid = 0_pInt, & mySize = 0_pInt ! to suppress warnings, safe as init is called only once -character(len=65536) tag -character(len=65536) :: line = '' ! to start initialized +character(len=65536) :: tag, & + line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_NONLOCAL_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNmatIDs = int(count(phase_plasticity == CONSTITUTIVE_NONLOCAL_LABEL),pInt) + maxNmatIDs = int(count(phase_plasticity == PLASTICITY_NONLOCAL_ID),pInt) if (maxNmatIDs == 0) return ! we don't have to do anything if there's no instance for this constitutive law if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -429,8 +416,8 @@ do while (trim(line) /= '#EOF#') section = section + 1_pInt ! advance section counter cycle endif - if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_NONLOCAL_LABEL) then ! one of my sections + if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if statement). It's not safe in Fortran + if (phase_plasticity(section) == PLASTICITY_NONLOCAL_ID) then ! one of my sections i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -468,7 +455,7 @@ do while (trim(line) /= '#EOF#') Cslip66(6,6,i) = IO_floatValue(line,positions,2_pInt) case ('nslip') if (positions(1) < 1_pInt + Nchunks_SlipFamilies) & - call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONLOCAL_LABEL//')') Nchunks_SlipFamilies = positions(1) - 1_pInt do f = 1_pInt, Nchunks_SlipFamilies Nslip(f,i) = IO_intValue(line,positions,1_pInt+f) @@ -531,7 +518,7 @@ do while (trim(line) /= '#EOF#') significantN(i) = IO_floatValue(line,positions,2_pInt) case ('interaction_slipslip') if (positions(1) < 1_pInt + Nchunks_SlipSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONLOCAL_LABEL//')') do it = 1_pInt,Nchunks_SlipSlip interactionSlipSlip(it,i) = IO_floatValue(line,positions,1_pInt+it) enddo @@ -581,14 +568,14 @@ do while (trim(line) /= '#EOF#') shortRangeStressCorrection(i) = IO_floatValue(line,positions,2_pInt) > 0.0_pReal case ('nonschmid_coefficients') if (positions(1) < 1_pInt + Nchunks_nonSchmid) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONLOCAL_label//')') do f = 1_pInt,Nchunks_nonSchmid nonSchmidCoeff(f,i) = IO_floatValue(line,positions,1_pInt+f) enddo case('probabilisticmultiplication','randomsources','randommultiplication','discretesources') probabilisticMultiplication(i) = IO_floatValue(line,positions,2_pInt) > 0.0_pReal case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONLOCAL_label//')') end select endif endif @@ -607,7 +594,7 @@ do i = 1_pInt,maxNmatIDs if (structID < 1_pInt) & call IO_error(205_pInt,el=i) if (sum(Nslip(:,i)) <= 0_pInt) & - call IO_error(211_pInt,ext_msg='Nslip ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='Nslip ('//PLASTICITY_NONLOCAL_label//')') do o = 1_pInt,maxval(phase_Noutput) if(len(constitutive_nonlocal_output(o,i)) > 64_pInt) & call IO_error(666_pInt) @@ -615,83 +602,83 @@ do i = 1_pInt,maxNmatIDs do f = 1_pInt,lattice_maxNslipFamily if (Nslip(f,i) > 0_pInt) then if (rhoSglEdgePos0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglEdgePos0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglEdgePos0 ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglEdgeNeg0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglEdgeNeg0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglEdgeNeg0 ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglScrewPos0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglScrewPos0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglScrewPos0 ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglScrewNeg0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglScrewNeg0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglScrewNeg0 ('//PLASTICITY_NONLOCAL_label//')') if (rhoDipEdge0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoDipEdge0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoDipEdge0 ('//PLASTICITY_NONLOCAL_label//')') if (rhoDipScrew0(f,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoDipScrew0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoDipScrew0 ('//PLASTICITY_NONLOCAL_label//')') if (burgersPerSlipFamily(f,i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='Burgers ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='Burgers ('//PLASTICITY_NONLOCAL_label//')') if (lambda0PerSlipFamily(f,i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='lambda0 ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='lambda0 ('//PLASTICITY_NONLOCAL_label//')') if (minDipoleHeightPerSlipFamily(f,1,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='minimumDipoleHeightEdge ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='minimumDipoleHeightEdge ('//PLASTICITY_NONLOCAL_label//')') if (minDipoleHeightPerSlipFamily(f,2,i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='minimumDipoleHeightScrew ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='minimumDipoleHeightScrew ('//PLASTICITY_NONLOCAL_label//')') if (peierlsStressPerSlipFamily(f,1,i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='peierlsStressEdge ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='peierlsStressEdge ('//PLASTICITY_NONLOCAL_label//')') if (peierlsStressPerSlipFamily(f,2,i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='peierlsStressScrew ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='peierlsStressScrew ('//PLASTICITY_NONLOCAL_label//')') endif enddo if (any(interactionSlipSlip(1:maxval(lattice_interactionSlipSlip(:,:,structID)),i) < 0.0_pReal)) & - call IO_error(211_pInt,ext_msg='interaction_SlipSlip ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='interaction_SlipSlip ('//PLASTICITY_NONLOCAL_label//')') if (linetensionEffect(i) < 0.0_pReal .or. linetensionEffect(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='linetension ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='linetension ('//PLASTICITY_NONLOCAL_label//')') if (edgeJogFactor(i) < 0.0_pReal .or. edgeJogFactor(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='edgejog ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='edgejog ('//PLASTICITY_NONLOCAL_label//')') if (cutoffRadius(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='r ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='r ('//PLASTICITY_NONLOCAL_label//')') if (atomicVolume(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='atomicVolume ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='atomicVolume ('//PLASTICITY_NONLOCAL_label//')') if (Dsd0(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='selfDiffusionPrefactor ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='selfDiffusionPrefactor ('//PLASTICITY_NONLOCAL_label//')') if (selfDiffusionEnergy(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='selfDiffusionEnergy ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='selfDiffusionEnergy ('//PLASTICITY_NONLOCAL_label//')') if (aTolRho(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='aTol_rho ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='aTol_rho ('//PLASTICITY_NONLOCAL_label//')') if (aTolShear(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='aTol_shear ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='aTol_shear ('//PLASTICITY_NONLOCAL_label//')') if (significantRho(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='significantRho ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='significantRho ('//PLASTICITY_NONLOCAL_label//')') if (significantN(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='significantN ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='significantN ('//PLASTICITY_NONLOCAL_label//')') if (doublekinkwidth(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='doublekinkwidth ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='doublekinkwidth ('//PLASTICITY_NONLOCAL_label//')') if (solidSolutionEnergy(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='solidSolutionEnergy ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='solidSolutionEnergy ('//PLASTICITY_NONLOCAL_label//')') if (solidSolutionSize(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='solidSolutionSize ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='solidSolutionSize ('//PLASTICITY_NONLOCAL_label//')') if (solidSolutionConcentration(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='solidSolutionConcentration ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='solidSolutionConcentration ('//PLASTICITY_NONLOCAL_label//')') if (pParam(i) <= 0.0_pReal .or. pParam(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='p ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='p ('//PLASTICITY_NONLOCAL_label//')') if (qParam(i) < 1.0_pReal .or. qParam(i) > 2.0_pReal) & - call IO_error(211_pInt,ext_msg='q ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='q ('//PLASTICITY_NONLOCAL_label//')') if (viscosity(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='viscosity ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='viscosity ('//PLASTICITY_NONLOCAL_label//')') if (fattack(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='attackFrequency ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='attackFrequency ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglScatter(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglScatter ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglScatter ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglRandom(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglRandom ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglRandom ('//PLASTICITY_NONLOCAL_label//')') if (rhoSglRandomBinning(i) <= 0.0_pReal) & - call IO_error(211_pInt,ext_msg='rhoSglRandomBinning ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='rhoSglRandomBinning ('//PLASTICITY_NONLOCAL_label//')') if (surfaceTransmissivity(i) < 0.0_pReal .or. surfaceTransmissivity(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='surfaceTransmissivity ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='surfaceTransmissivity ('//PLASTICITY_NONLOCAL_label//')') if (grainboundaryTransmissivity(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='grainboundaryTransmissivity ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='grainboundaryTransmissivity ('//PLASTICITY_NONLOCAL_label//')') if (CFLfactor(i) < 0.0_pReal) & - call IO_error(211_pInt,ext_msg='CFLfactor ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='CFLfactor ('//PLASTICITY_NONLOCAL_label//')') if (fEdgeMultiplication(i) < 0.0_pReal .or. fEdgeMultiplication(i) > 1.0_pReal) & - call IO_error(211_pInt,ext_msg='edgemultiplicationfactor ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(211_pInt,ext_msg='edgemultiplicationfactor ('//PLASTICITY_NONLOCAL_label//')') !*** determine total number of active slip systems @@ -851,7 +838,7 @@ do i = 1,maxNmatIDs enddo enddo if (iD(ns,2,i) /= constitutive_nonlocal_sizeState(i)) & ! check if last index is equal to size of state - call IO_error(0_pInt, ext_msg = 'state indices not properly set ('//CONSTITUTIVE_NONLOCAL_LABEL//')') + call IO_error(0_pInt, ext_msg = 'state indices not properly set ('//PLASTICITY_NONLOCAL_label//')') !*** determine size of postResults array @@ -945,7 +932,7 @@ do i = 1,maxNmatIDs mySize = 6_pInt case default call IO_error(212_pInt,ext_msg=constitutive_nonlocal_output(o,i)//& - '('//CONSTITUTIVE_NONLOCAL_LABEL//')') + '('//PLASTICITY_NONLOCAL_label//')') end select if (mySize > 0_pInt) then ! any meaningful output found @@ -1043,7 +1030,6 @@ end subroutine constitutive_nonlocal_init !> @brief sets the initial microstructural state for a given instance of this plasticity !-------------------------------------------------------------------------------------------------- subroutine constitutive_nonlocal_stateInit(state) - use IO, only: IO_error use lattice, only: lattice_maxNslipFamily use math, only: math_sampleGaussVar @@ -1055,7 +1041,8 @@ use mesh, only: mesh_ipVolume, & FE_geomtype use material, only: material_phase, & phase_plasticityInstance, & - phase_plasticity + phase_plasticity ,& + PLASTICITY_NONLOCAL_ID implicit none @@ -1085,14 +1072,14 @@ real(pReal) meanDensity, & minimumIpVolume -maxNmatIDs = int(count(phase_plasticity == CONSTITUTIVE_NONLOCAL_LABEL),pInt) +maxNmatIDs = int(count(phase_plasticity == PLASTICITY_NONLOCAL_ID),pInt) ! ititalize all states to zero do e = 1_pInt,mesh_NcpElems do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) - if (CONSTITUTIVE_NONLOCAL_LABEL == phase_plasticity(material_phase(1,i,e))) & + if (PLASTICITY_NONLOCAL_ID == phase_plasticity(material_phase(1,i,e))) & state(1,i,e)%p = 0.0_pReal enddo enddo @@ -1110,7 +1097,7 @@ do matID = 1_pInt,maxNmatIDs totalVolume = 0.0_pReal do e = 1_pInt,mesh_NcpElems do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) - if (CONSTITUTIVE_NONLOCAL_LABEL == phase_plasticity(material_phase(1,i,e)) & + if (PLASTICITY_NONLOCAL_ID == phase_plasticity(material_phase(1,i,e)) & .and. matID == phase_plasticityInstance(material_phase(1,i,e))) then totalVolume = totalVolume + mesh_ipVolume(i,e) minimumIpVolume = min(minimumIpVolume, mesh_ipVolume(i,e)) @@ -1126,7 +1113,7 @@ do matID = 1_pInt,maxNmatIDs call random_number(rnd) el = nint(rnd(1)*real(mesh_NcpElems,pReal)+0.5_pReal,pInt) ip = nint(rnd(2)*real(FE_Nips(FE_geomtype(mesh_element(2,el))),pReal)+0.5_pReal,pInt) - if (CONSTITUTIVE_NONLOCAL_LABEL == phase_plasticity(material_phase(1,ip,el)) & + if (PLASTICITY_NONLOCAL_ID == phase_plasticity(material_phase(1,ip,el)) & .and. matID == phase_plasticityInstance(material_phase(1,ip,el))) then s = nint(rnd(3)*real(ns,pReal)+0.5_pReal,pInt) t = nint(rnd(4)*4.0_pReal+0.5_pReal,pInt) @@ -1139,7 +1126,7 @@ do matID = 1_pInt,maxNmatIDs else do e = 1_pInt,mesh_NcpElems do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) - if (CONSTITUTIVE_NONLOCAL_LABEL == phase_plasticity(material_phase(1,i,e)) & + if (PLASTICITY_NONLOCAL_ID == phase_plasticity(material_phase(1,i,e)) & .and. matID == phase_plasticityInstance(material_phase(1,i,e))) then do f = 1_pInt,lattice_maxNslipFamily from = 1_pInt + sum(Nslip(1:f-1_pInt,matID)) @@ -2129,7 +2116,8 @@ use material, only: homogenization_maxNgrains, & material_phase, & phase_plasticityInstance, & phase_localPlasticity, & - phase_plasticity + phase_plasticity ,& + PLASTICITY_NONLOCAL_ID use lattice, only: lattice_Sslip_v, & lattice_sd, & lattice_st @@ -2152,8 +2140,6 @@ type(p_vec), dimension(homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), in state, & !< current microstructural state state0 !< microstructural state at beginning of crystallite increment -!*** input/output variables - !*** output variables real(pReal), dimension(constitutive_nonlocal_sizeDotState(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & constitutive_nonlocal_dotState !< evolution of state variables / microstructure @@ -2458,7 +2444,7 @@ if (.not. phase_localPlasticity(material_phase(ipc,ip,el))) then neighbor_v = 0.0_pReal ! needed for check of sign change in flux density below neighbor_rhoSgl = 0.0_pReal if (neighbor_n > 0_pInt) then - if (phase_plasticity(material_phase(1,neighbor_ip,neighbor_el)) == CONSTITUTIVE_NONLOCAL_LABEL & + if (phase_plasticity(material_phase(1,neighbor_ip,neighbor_el)) == PLASTICITY_NONLOCAL_ID & .and. any(compatibility(:,:,:,n,ip,el) > 0.0_pReal)) & considerEnteringFlux = .true. endif @@ -2521,7 +2507,7 @@ if (.not. phase_localPlasticity(material_phase(ipc,ip,el))) then considerLeavingFlux = .true. if (opposite_n > 0_pInt) then - if (phase_plasticity(material_phase(1,opposite_ip,opposite_el)) /= CONSTITUTIVE_NONLOCAL_LABEL) & + if (phase_plasticity(material_phase(1,opposite_ip,opposite_el)) /= PLASTICITY_NONLOCAL_ID) & considerLeavingFlux = .false. endif diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90 index 588fba5c9..529b218db 100644 --- a/code/constitutive_phenopowerlaw.f90 +++ b/code/constitutive_phenopowerlaw.f90 @@ -31,9 +31,6 @@ module constitutive_phenopowerlaw implicit none private - character (len=*), parameter, public :: & - CONSTITUTIVE_PHENOPOWERLAW_label = 'phenopowerlaw' - integer(pInt), dimension(:), allocatable, public, protected :: & constitutive_phenopowerlaw_sizeDotState, & constitutive_phenopowerlaw_sizeState, & @@ -145,12 +142,12 @@ subroutine constitutive_phenopowerlaw_init(myFile) tag = '', & line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_PHENOPOWERLAW_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == CONSTITUTIVE_PHENOPOWERLAW_label),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -256,7 +253,7 @@ subroutine constitutive_phenopowerlaw_init(myFile) cycle ! skip to next line endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_PHENOPOWERLAW_label) then ! one of my sections + if (phase_plasticity(section) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my sections i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -282,42 +279,42 @@ subroutine constitutive_phenopowerlaw_init(myFile) case ('c11') constitutive_phenopowerlaw_Cslip_66(1,1,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(1,1,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c12') constitutive_phenopowerlaw_Cslip_66(1,2,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(1,2,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c13') constitutive_phenopowerlaw_Cslip_66(1,3,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(1,3,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c22') constitutive_phenopowerlaw_Cslip_66(2,2,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(2,2,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c23') constitutive_phenopowerlaw_Cslip_66(2,3,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(2,3,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c33') constitutive_phenopowerlaw_Cslip_66(3,3,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(3,3,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c44') constitutive_phenopowerlaw_Cslip_66(4,4,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(4,4,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c55') constitutive_phenopowerlaw_Cslip_66(5,5,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(5,5,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('c66') constitutive_phenopowerlaw_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt) if (abs(constitutive_phenopowerlaw_Cslip_66(6,6,i)) < tol_math_check) & - call IO_error(214_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(214_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('nslip') if (positions(1) < 1_pInt + Nchunks_SlipFamilies) & - call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') Nchunks_SlipFamilies = positions(1) - 1_pInt do j = 1_pInt, Nchunks_SlipFamilies constitutive_phenopowerlaw_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j) @@ -338,7 +335,7 @@ subroutine constitutive_phenopowerlaw_init(myFile) constitutive_phenopowerlaw_a_slip(i) = IO_floatValue(line,positions,2_pInt) case ('ntwin') if (positions(1) < 1_pInt + Nchunks_TwinFamilies) & - call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') Nchunks_TwinFamilies = positions(1) - 1_pInt do j = 1_pInt, Nchunks_TwinFamilies constitutive_phenopowerlaw_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j) @@ -365,7 +362,7 @@ subroutine constitutive_phenopowerlaw_init(myFile) constitutive_phenopowerlaw_h0_SlipSlip(i) = IO_floatValue(line,positions,2_pInt) case ('h0_sliptwin') constitutive_phenopowerlaw_h0_SlipTwin(i) = IO_floatValue(line,positions,2_pInt) - call IO_warning(42_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(42_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') case ('h0_twinslip') constitutive_phenopowerlaw_h0_TwinSlip(i) = IO_floatValue(line,positions,2_pInt) case ('h0_twintwin') @@ -378,36 +375,36 @@ subroutine constitutive_phenopowerlaw_init(myFile) constitutive_phenopowerlaw_aTolTwinfrac(i) = IO_floatValue(line,positions,2_pInt) case ('interaction_slipslip') if (positions(1) < 1_pInt + Nchunks_SlipSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') do j = 1_pInt, Nchunks_SlipSlip constitutive_phenopowerlaw_interaction_SlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_sliptwin') if (positions(1) < 1_pInt + Nchunks_SlipTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') do j = 1_pInt, Nchunks_SlipTwin constitutive_phenopowerlaw_interaction_SlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twinslip') if (positions(1) < 1_pInt + Nchunks_TwinSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') do j = 1_pInt, Nchunks_TwinSlip constitutive_phenopowerlaw_interaction_TwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twintwin') if (positions(1) < 1_pInt + Nchunks_TwinTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') do j = 1_pInt, Nchunks_TwinTwin constitutive_phenopowerlaw_interaction_TwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('nonschmid_coefficients') if (positions(1) < 1_pInt + Nchunks_nonSchmid) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') do j = 1_pInt,Nchunks_nonSchmid constitutive_phenopowerlaw_nonSchmidCoeff(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') end select endif endif @@ -429,26 +426,26 @@ subroutine constitutive_phenopowerlaw_init(myFile) if (constitutive_phenopowerlaw_structure(i) < 1 ) call IO_error(205_pInt,el=i) if (any(constitutive_phenopowerlaw_tau0_slip(:,i) < 0.0_pReal .and. & constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tau0_slip (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (constitutive_phenopowerlaw_gdot0_slip(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='gdot0_slip (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (constitutive_phenopowerlaw_n_slip(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='n_slip (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (any(constitutive_phenopowerlaw_tausat_slip(:,i) <= 0.0_pReal .and. & constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tausat_slip (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (any(constitutive_phenopowerlaw_a_slip(i) == 0.0_pReal .and. & constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='a_slip (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (any(constitutive_phenopowerlaw_tau0_twin(:,i) < 0.0_pReal .and. & constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tau0_twin (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if ( constitutive_phenopowerlaw_gdot0_twin(i) <= 0.0_pReal .and. & any(constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='gdot0_twin (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if ( constitutive_phenopowerlaw_n_twin(i) <= 0.0_pReal .and. & any(constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='n_twin (' & - //CONSTITUTIVE_PHENOPOWERLAW_label//')') + //PLASTICITY_PHENOPOWERLAW_label//')') if (constitutive_phenopowerlaw_aTolResistance(i) <= 0.0_pReal) & constitutive_phenopowerlaw_aTolResistance(i) = 1.0_pReal ! default absolute tolerance 1 Pa if (constitutive_phenopowerlaw_aTolShear(i) <= 0.0_pReal) & @@ -497,7 +494,7 @@ subroutine constitutive_phenopowerlaw_init(myFile) ) mySize = 1_pInt case default - call IO_error(212_pInt,ext_msg=constitutive_phenopowerlaw_output(o,i)//' ('//CONSTITUTIVE_PHENOPOWERLAW_label//')') + call IO_error(212_pInt,ext_msg=constitutive_phenopowerlaw_output(o,i)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') end select outputFound: if (mySize > 0_pInt) then diff --git a/code/constitutive_titanmod.f90 b/code/constitutive_titanmod.f90 index 86790d37d..bffb08eee 100644 --- a/code/constitutive_titanmod.f90 +++ b/code/constitutive_titanmod.f90 @@ -31,8 +31,6 @@ module constitutive_titanmod implicit none private - character(len=*), parameter, public :: & - CONSTITUTIVE_TITANMOD_label = 'titanmod' character(len=18), dimension(3), parameter, private :: & CONSTITUTIVE_TITANMOD_listBasicSlipStates = & ['rho_edge ', 'rho_screw ', 'shear_system'] @@ -212,7 +210,6 @@ subroutine constitutive_titanmod_init(myFile) debug_level,& debug_constitutive,& debug_levelBasic - use lattice implicit none @@ -236,12 +233,12 @@ subroutine constitutive_titanmod_init(myFile) tag = '', & line = '' ! to start initialized - write(6,'(/,a)') ' <<<+- constitutive_'//CONSTITUTIVE_TITANMOD_label//' init -+>>>' + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_TITANMOD_label//' init -+>>>' write(6,'(a)') ' $Id$' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(phase_plasticity == CONSTITUTIVE_TITANMOD_label),pInt) + maxNinstance = int(count(phase_plasticity == PLASTICITY_TITANMOD_ID),pInt) if (maxNinstance == 0_pInt) return if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & @@ -405,7 +402,7 @@ subroutine constitutive_titanmod_init(myFile) cycle ! skip to next line endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(phase_plasticity(section)) == CONSTITUTIVE_TITANMOD_label) then ! one of my sections + if (phase_plasticity(section) == PLASTICITY_TITANMOD_ID) then ! one of my sections i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -450,13 +447,13 @@ subroutine constitutive_titanmod_init(myFile) constitutive_titanmod_kinkf0(i) = IO_floatValue(line,positions,2_pInt) case ('nslip') if (positions(1) < 1_pInt + Nchunks_SlipFamilies) & - call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_SlipFamilies constitutive_titanmod_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j) enddo case ('ntwin') if (positions(1) < 1_pInt + Nchunks_TwinFamilies) & - call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_TwinFamilies constitutive_titanmod_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j) enddo @@ -588,30 +585,30 @@ subroutine constitutive_titanmod_init(myFile) enddo case ('interaction_slipslip','interactionslipslip') if (positions(1) < 1_pInt + Nchunks_SlipSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_SlipSlip constitutive_titanmod_interactionSlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_sliptwin','interactionsliptwin') if (positions(1) < 1_pInt + Nchunks_SlipTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_SlipTwin constitutive_titanmod_interactionSlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twinslip','interactiontwinslip') if (positions(1) < 1_pInt + Nchunks_TwinSlip) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_TwinSlip constitutive_titanmod_interactionTwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case ('interaction_twintwin','interactiontwintwin') if (positions(1) < 1_pInt + Nchunks_TwinTwin) & - call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') do j = 1_pInt, Nchunks_TwinTwin constitutive_titanmod_interactionTwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) enddo case default - call IO_error(210_pInt,ext_msg=trim(tag)//' ('//CONSTITUTIVE_TITANMOD_label//')') + call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_TITANMOD_label//')') end select endif endif @@ -624,58 +621,58 @@ subroutine constitutive_titanmod_init(myFile) if (structID < 1_pInt) call IO_error(205_pInt,el=i) if (sum(constitutive_titanmod_Nslip(:,i)) <= 0_pInt) call IO_error(211_pInt,el=i,ext_msg='nslip (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (sum(constitutive_titanmod_Ntwin(:,i)) < 0_pInt) call IO_error(211_pInt,el=i,ext_msg='ntwin (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') do f = 1_pInt,lattice_maxNslipFamily if (constitutive_titanmod_Nslip(f,i) > 0_pInt) then if (constitutive_titanmod_rho_edge0(f,i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='rho_edge0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_rho_screw0(f,i) < 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='rho_screw0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_burgersPerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='slipburgers (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_f0_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='f0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_tau0e_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='tau0e (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_tau0s_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='tau0s (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_capre_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='capre (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_caprs_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='caprs (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_v0e_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='v0e (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_v0s_PerSlipFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='v0s (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_kinkcriticallength_PerSlipFam(f,i) <= 0.0_pReal) & call IO_error(211_pInt,el=i,ext_msg='kinkCriticalLength (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') endif enddo do f = 1_pInt,lattice_maxNtwinFamily if (constitutive_titanmod_Ntwin(f,i) > 0_pInt) then if (constitutive_titanmod_burgersPerTwinFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='twinburgers (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_twinf0_PerTwinFam(f,i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='twinf0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_twinshearconstant_PerTwinFam(f,i) <= 0.0_pReal) & call IO_error(211_pInt,el=i,ext_msg='twinshearconstant (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_twintau0_PerTwinFam(f,i) <= 0.0_pReal)call IO_error(211_pInt,el=i,ext_msg='twintau0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_twingamma0_PerTwinFam(f,i) <= 0.0_pReal) & call IO_error(211_pInt,el=i,ext_msg='twingamma0 (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') endif enddo if (constitutive_titanmod_dc(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='dc (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_twinhpconstant(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='twinhpconstant (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') if (constitutive_titanmod_aTolRho(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='aTolRho (' & - //CONSTITUTIVE_TITANMOD_label//')') + //PLASTICITY_TITANMOD_label//')') !-------------------------------------------------------------------------------------------------- ! determine total number of active slip or twin systems @@ -831,7 +828,7 @@ subroutine constitutive_titanmod_init(myFile) mySize = 1_pInt case default call IO_error(212_pInt,ext_msg=constitutive_titanmod_output(o,i)// & - ' ('//CONSTITUTIVE_TITANMOD_label//')') + ' ('//PLASTICITY_TITANMOD_label//')') end select outputFound: if (mySize > 0_pInt) then diff --git a/code/crystallite.f90 b/code/crystallite.f90 index efcb39d33..291bed133 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -165,16 +165,12 @@ subroutine crystallite_init(temperature) use constitutive, only: & constitutive_microstructure use constitutive_phenopowerlaw, only: & - constitutive_phenopowerlaw_label, & constitutive_phenopowerlaw_structureName - use constitutive_titanmod, only: & - constitutive_titanmod_label, & - constitutive_titanmod_structureName use constitutive_dislotwin, only: & - constitutive_dislotwin_label, & constitutive_dislotwin_structureName + use constitutive_titanmod, only: & + constitutive_titanmod_structureName use constitutive_nonlocal, only: & - constitutive_nonlocal_label, & constitutive_nonlocal_structureName implicit none @@ -370,16 +366,16 @@ subroutine crystallite_init(temperature) myPhase = material_phase(g,i,e) myMat = phase_plasticityInstance(myPhase) select case (phase_plasticity(myPhase)) - case (constitutive_phenopowerlaw_label) + case (PLASTICITY_PHENOPOWERLAW_ID) crystallite_symmetryID(g,i,e) = & lattice_symmetryType(constitutive_phenopowerlaw_structureName(myMat)) - case (constitutive_titanmod_label) + case (PLASTICITY_TITANMOD_ID) crystallite_symmetryID(g,i,e) = & lattice_symmetryType(constitutive_titanmod_structureName(myMat)) - case (constitutive_dislotwin_label) + case (PLASTICITY_DISLOTWIN_ID) crystallite_symmetryID(g,i,e) = & lattice_symmetryType(constitutive_dislotwin_structureName(myMat)) - case (constitutive_nonlocal_label) + case (PLASTICITY_NONLOCAL_ID) crystallite_symmetryID(g,i,e) = & lattice_symmetryType(constitutive_nonlocal_structureName(myMat)) case default diff --git a/code/homogenization.f90 b/code/homogenization.f90 index 4fc99c05a..de0075a28 100644 --- a/code/homogenization.f90 +++ b/code/homogenization.f90 @@ -127,6 +127,7 @@ subroutine homogenization_init() integer(pInt) :: e,i,p,myInstance integer(pInt), dimension(:,:), pointer :: thisSize character(len=64), dimension(:,:), pointer :: thisOutput + character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready logical :: knownHomogenization !-------------------------------------------------------------------------------------------------- @@ -144,10 +145,12 @@ subroutine homogenization_init() i = homogenization_typeInstance(p) ! which instance of this homogenization type knownHomogenization = .true. ! assume valid select case(homogenization_type(p)) ! split per homogenization type - case (homogenization_isostrain_label) + case (HOMOGENIZATION_ISOSTRAIN_ID) + outputName = HOMOGENIZATION_ISOSTRAIN_label thisOutput => homogenization_isostrain_output thisSize => homogenization_isostrain_sizePostResult - case (homogenization_RGC_label) + case (HOMOGENIZATION_RGC_ID) + outputName = HOMOGENIZATION_RGC_label thisOutput => homogenization_RGC_output thisSize => homogenization_RGC_sizePostResult case default @@ -155,7 +158,7 @@ subroutine homogenization_init() end select write(fileunit,'(/,a,/)') '['//trim(homogenization_name(p))//']' if (knownHomogenization) then - write(fileunit,'(a)') '(type)'//char(9)//trim(homogenization_type(p)) + write(fileunit,'(a)') '(type)'//char(9)//trim(outputName) write(fileunit,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p) do e = 1,homogenization_Noutput(p) write(fileunit,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i) @@ -208,7 +211,7 @@ subroutine homogenization_init() myInstance = homogenization_typeInstance(mesh_element(3,e)) IpLooping: do i = 1,FE_Nips(FE_geomtype(mesh_element(2,e))) select case(homogenization_type(mesh_element(3,e))) - case (homogenization_isostrain_label) + case (HOMOGENIZATION_ISOSTRAIN_ID) if (homogenization_isostrain_sizeState(myInstance) > 0_pInt) then allocate(homogenization_state0(i,e)%p(homogenization_isostrain_sizeState(myInstance))) allocate(homogenization_subState0(i,e)%p(homogenization_isostrain_sizeState(myInstance))) @@ -217,7 +220,7 @@ subroutine homogenization_init() homogenization_sizeState(i,e) = homogenization_isostrain_sizeState(myInstance) endif homogenization_sizePostResults(i,e) = homogenization_isostrain_sizePostResults(myInstance) - case (homogenization_RGC_label) + case (HOMOGENIZATION_RGC_ID) if (homogenization_RGC_sizeState(myInstance) > 0_pInt) then allocate(homogenization_state0(i,e)%p(homogenization_RGC_sizeState(myInstance))) allocate(homogenization_subState0(i,e)%p(homogenization_RGC_sizeState(myInstance))) @@ -226,8 +229,6 @@ subroutine homogenization_init() homogenization_sizeState(i,e) = homogenization_RGC_sizeState(myInstance) endif homogenization_sizePostResults(i,e) = homogenization_RGC_sizePostResults(myInstance) - case default - call IO_error(500_pInt,ext_msg=homogenization_type(mesh_element(3,e))) ! unknown homogenization end select enddo IpLooping enddo elementLooping @@ -647,15 +648,15 @@ subroutine homogenization_partitionDeformation(ip,el) mesh_element use material, only: & homogenization_type, & - homogenization_maxNgrains + homogenization_maxNgrains, & + HOMOGENIZATION_ISOSTRAIN_ID, & + HOMOGENIZATION_RGC_ID use crystallite, only: & crystallite_partionedF0, & crystallite_partionedF use homogenization_isostrain, only: & - homogenization_isostrain_label, & homogenization_isostrain_partitionDeformation use homogenization_RGC, only: & - homogenization_RGC_label, & homogenization_RGC_partitionDeformation implicit none @@ -664,12 +665,12 @@ subroutine homogenization_partitionDeformation(ip,el) el !< element number chosenHomogenization: select case(homogenization_type(mesh_element(3,el))) - case (homogenization_isostrain_label) chosenHomogenization + case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization call homogenization_isostrain_partitionDeformation(& crystallite_partionedF(1:3,1:3,1:homogenization_maxNgrains,ip,el), & materialpoint_subF(1:3,1:3,ip,el),& el) - case (homogenization_RGC_label) chosenHomogenization + case (HOMOGENIZATION_RGC_ID) chosenHomogenization call homogenization_RGC_partitionDeformation(& crystallite_partionedF(1:3,1:3,1:homogenization_maxNgrains,ip,el), & materialpoint_subF(1:3,1:3,ip,el),& @@ -690,16 +691,16 @@ function homogenization_updateState(ip,el) mesh_element use material, only: & homogenization_type, & - homogenization_maxNgrains + homogenization_maxNgrains, & + HOMOGENIZATION_RGC_ID use crystallite, only: & crystallite_P, & crystallite_dPdF, & crystallite_partionedF,& crystallite_partionedF0 use homogenization_RGC, only: & - homogenization_RGC_updateState, & - homogenization_RGC_label - + homogenization_RGC_updateState + implicit none integer(pInt), intent(in) :: & ip, & !< integration point @@ -708,7 +709,7 @@ function homogenization_updateState(ip,el) chosenHomogenization: select case(homogenization_type(mesh_element(3,el))) - case (homogenization_RGC_label) chosenHomogenization + case (HOMOGENIZATION_RGC_ID) chosenHomogenization homogenization_updateState = & homogenization_RGC_updateState( homogenization_state(ip,el), & homogenization_subState0(ip,el), & @@ -735,15 +736,15 @@ subroutine homogenization_averageStressAndItsTangent(ip,el) mesh_element use material, only: & homogenization_type, & - homogenization_maxNgrains + homogenization_maxNgrains, & + HOMOGENIZATION_ISOSTRAIN_ID, & + HOMOGENIZATION_RGC_ID use crystallite, only: & crystallite_P,crystallite_dPdF use homogenization_isostrain, only: & - homogenization_isostrain_averageStressAndItsTangent, & - homogenization_isostrain_label + homogenization_isostrain_averageStressAndItsTangent use homogenization_RGC, only: & - homogenization_RGC_averageStressAndItsTangent, & - homogenization_RGC_label + homogenization_RGC_averageStressAndItsTangent implicit none integer(pInt), intent(in) :: & @@ -751,14 +752,14 @@ subroutine homogenization_averageStressAndItsTangent(ip,el) el !< element number chosenHomogenization: select case(homogenization_type(mesh_element(3,el))) - case (homogenization_isostrain_label) chosenHomogenization + case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization call homogenization_isostrain_averageStressAndItsTangent(& materialpoint_P(1:3,1:3,ip,el), & materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el),& crystallite_P(1:3,1:3,1:homogenization_maxNgrains,ip,el), & crystallite_dPdF(1:3,1:3,1:3,1:3,1:homogenization_maxNgrains,ip,el), & el) - case (homogenization_RGC_label) chosenHomogenization + case (HOMOGENIZATION_RGC_ID) chosenHomogenization call homogenization_RGC_averageStressAndItsTangent(& materialpoint_P(1:3,1:3,ip,el), & materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el),& @@ -805,13 +806,13 @@ function homogenization_postResults(ip,el) use mesh, only: & mesh_element use material, only: & - homogenization_type + homogenization_type, & + HOMOGENIZATION_ISOSTRAIN_ID, & + HOMOGENIZATION_RGC_ID use homogenization_isostrain, only: & - homogenization_isostrain_postResults, & - homogenization_isostrain_label + homogenization_isostrain_postResults use homogenization_RGC, only: & - homogenization_RGC_postResults, & - homogenization_RGC_label + homogenization_RGC_postResults implicit none integer(pInt), intent(in) :: & @@ -821,13 +822,13 @@ function homogenization_postResults(ip,el) homogenization_postResults = 0.0_pReal chosenHomogenization: select case (homogenization_type(mesh_element(3,el))) - case (homogenization_isostrain_label) chosenHomogenization + case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization homogenization_postResults = homogenization_isostrain_postResults(& ip, & el, & materialpoint_P(1:3,1:3,ip,el), & materialpoint_F(1:3,1:3,ip,el)) - case (homogenization_RGC_label) chosenHomogenization + case (HOMOGENIZATION_RGC_ID) chosenHomogenization homogenization_postResults = homogenization_RGC_postResults(& homogenization_state(ip,el),& ip, & diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 587d52123..e462cd593 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -32,8 +32,6 @@ module homogenization_RGC implicit none private - character (len=*), parameter, public :: & - HOMOGENIZATION_RGC_label = 'rgc' integer(pInt), dimension(:), allocatable, public :: & homogenization_RGC_sizeState, & homogenization_RGC_sizePostResults @@ -113,7 +111,7 @@ subroutine homogenization_RGC_init(myUnit) write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = int(count(homogenization_type == HOMOGENIZATION_RGC_label),pInt) + maxNinstance = int(count(homogenization_type == HOMOGENIZATION_RGC_ID),pInt) if (maxNinstance == 0_pInt) return allocate(homogenization_RGC_sizeState(maxNinstance)); homogenization_RGC_sizeState = 0_pInt @@ -124,11 +122,11 @@ subroutine homogenization_RGC_init(myUnit) allocate(homogenization_RGC_dAlpha(3,maxNinstance)); homogenization_RGC_dAlpha = 0.0_pReal allocate(homogenization_RGC_angles(3,maxNinstance)); homogenization_RGC_angles = 400.0_pReal allocate(homogenization_RGC_output(maxval(homogenization_Noutput),maxNinstance)) - homogenization_RGC_output = '' + homogenization_RGC_output = '' allocate(homogenization_RGC_sizePostResult(maxval(homogenization_Noutput),maxNinstance)) - homogenization_RGC_sizePostResult = 0_pInt + homogenization_RGC_sizePostResult = 0_pInt allocate(homogenization_RGC_orientation(3,3,mesh_maxNips,mesh_NcpElems)) - homogenization_RGC_orientation = spread(spread(math_I3,3,mesh_maxNips),4,mesh_NcpElems) ! initialize to identity + homogenization_RGC_orientation = spread(spread(math_I3,3,mesh_maxNips),4,mesh_NcpElems) ! initialize to identity rewind(myUnit) @@ -145,7 +143,7 @@ subroutine homogenization_RGC_init(myUnit) output = 0_pInt ! reset output counter endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(homogenization_type(section)) == HOMOGENIZATION_RGC_label) then ! one of my sections + if (homogenization_type(section) == HOMOGENIZATION_RGC_ID) then ! one of my sections i = homogenization_typeInstance(section) ! which instance of my type is present homogenization positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key @@ -177,7 +175,7 @@ subroutine homogenization_RGC_init(myUnit) !-------------------------------------------------------------------------------------------------- ! assigning cluster orientations elementLooping: do e = 1_pInt,mesh_NcpElems - if (homogenization_type(mesh_element(3,e)) == HOMOGENIZATION_RGC_label) then + if (homogenization_type(mesh_element(3,e)) == HOMOGENIZATION_RGC_ID) then myInstance = homogenization_typeInstance(mesh_element(3,e)) if (all (homogenization_RGC_angles(:,myInstance) >= 399.9_pReal)) then homogenization_RGC_orientation(1:3,1:3,1,e) = math_EulerToR(math_sampleRandomOri()) @@ -199,7 +197,7 @@ subroutine homogenization_RGC_init(myUnit) if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0_pInt) then do i = 1_pInt,maxNinstance - write(6,'(a15,1x,i4,/)') 'instance: ', i + write(6,'(a15,1x,i4,/)') 'instance: ', i write(6,'(a25,3(1x,i8))') 'cluster size: ',(homogenization_RGC_Ngrains(j,i),j=1_pInt,3_pInt) write(6,'(a25,1x,e10.3)') 'scaling parameter: ', homogenization_RGC_xiAlpha(i) write(6,'(a25,1x,e10.3)') 'over-proportionality: ', homogenization_RGC_ciAlpha(i) @@ -896,7 +894,7 @@ pure function homogenization_RGC_postResults(state,ip,el,avgP,avgF) homogenization_RGC_postResults(c+1_pInt:c+9_pInt) = reshape(avgP,[9]) c = c + 9_pInt case ('ipcoords') - homogenization_RGC_postResults(c+1_pInt:c+3_pInt) = mesh_ipCoordinates(1:3,ip,el) ! current ip coordinates + homogenization_RGC_postResults(c+1_pInt:c+3_pInt) = mesh_ipCoordinates(1:3,ip,el) ! current ip coordinates c = c + 3_pInt case('constitutivework') homogenization_RGC_postResults(c+1) = state%p(3*nIntFaceTot+1) diff --git a/code/homogenization_isostrain.f90 b/code/homogenization_isostrain.f90 index 5e11fe348..ce008631c 100644 --- a/code/homogenization_isostrain.f90 +++ b/code/homogenization_isostrain.f90 @@ -29,19 +29,17 @@ module homogenization_isostrain implicit none private - character (len=*), parameter, public :: & - HOMOGENIZATION_ISOSTRAIN_label = 'isostrain' - - integer(pInt), dimension(:), allocatable, public, protected :: & + integer(pInt), dimension(:), allocatable, public, protected :: & homogenization_isostrain_sizeState, & homogenization_isostrain_sizePostResults - integer(pInt), dimension(:,:), allocatable, target, public :: & + integer(pInt), dimension(:,:), allocatable, target, public :: & homogenization_isostrain_sizePostResult + character(len=64), dimension(:,:), allocatable, target, public :: & homogenization_isostrain_output !< name of each post result output character(len=64), dimension(:), allocatable, private :: & homogenization_isostrain_mapping - integer(pInt), dimension(:), allocatable, private :: & + integer(pInt), dimension(:), allocatable, private :: & homogenization_isostrain_Ngrains public :: & @@ -80,7 +78,7 @@ subroutine homogenization_isostrain_init(myUnit) write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - maxNinstance = count(homogenization_type == HOMOGENIZATION_ISOSTRAIN_label) + maxNinstance = count(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID) if (maxNinstance == 0) return allocate(homogenization_isostrain_sizeState(maxNinstance)) @@ -112,7 +110,7 @@ subroutine homogenization_isostrain_init(myUnit) output = 0_pInt ! reset output counter endif if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran - if (trim(homogenization_type(section)) == HOMOGENIZATION_ISOSTRAIN_label) then ! one of my sections + if (homogenization_type(section) == HOMOGENIZATION_ISOSTRAIN_ID) then ! one of my sections i = homogenization_typeInstance(section) ! which instance of my type is present homogenization positions = IO_stringPos(line,MAXNCHUNKS) tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key