diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index b461d3a90..f26a821b4 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -295,6 +295,9 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el use material, only: & homogenization_maxNgrains, & microstructure_elemhomo, & +#ifdef NEWSTATE + plasticState,& +#endif material_phase use constitutive, only: & constitutive_state0,constitutive_state @@ -390,6 +393,10 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el j = 1:mesh_maxNips, & k = 1:mesh_NcpElems ) & constitutive_state0(i,j,k)%p = constitutive_state(i,j,k)%p ! microstructure of crystallites +#ifdef NEWSTATE +!(:) needed? +plasticState(:)%state0=plasticState(:)%state +#endif if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) then !$OMP CRITICAL (write2out) write(6,'(a)') '<< CPFEM >> aging states' diff --git a/code/constitutive.f90 b/code/constitutive.f90 index 83c4929fd..5460be53d 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -140,11 +140,11 @@ subroutine constitutive_init character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready logical :: knownPlasticity, nonlocalConstitutionPresent #if defined(HDF) || defined(NEWSTATE) - integer(pInt), dimension(:,:,:), allocatable :: mappingConstitutive - integer(pInt), dimension(:,:,:), allocatable :: mappingCrystallite + integer(pInt), dimension(:,:,:,:), allocatable, public, protected :: mappingConstitutive + integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingCrystallite integer(pInt), dimension(:), allocatable :: ConstitutivePosition integer(pInt), dimension(:), allocatable :: CrystallitePosition - allocate(mappingConstitutive(homogenization_maxngrains,mesh_ncpelems,2),source=0_pInt) + allocate(mappingConstitutive(homogenization_maxngrains,mesh_maxNips,mesh_ncpelems,2),source=0_pInt) allocate(mappingCrystallite (homogenization_maxngrains,mesh_ncpelems,2),source=0_pInt) allocate(ConstitutivePosition(material_nphase),source=0_pInt) allocate(CrystallitePosition(material_nphase),source=0_pInt) @@ -256,7 +256,7 @@ subroutine constitutive_init instance = phase_plasticityInstance(phase) #if defined(HDF) || defined(NEWSTATE) ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt - mappingConstitutive(g,e,1:2) = [ConstitutivePosition(phase),phase] + mappingConstitutive(g,e,i,1:2) = [ConstitutivePosition(phase),phase] #endif select case(phase_plasticity(material_phase(g,i,e))) case (PLASTICITY_NONE_ID) diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index b1dcae24d..0f0ea086b 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -543,10 +543,10 @@ subroutine constitutive_j2_postResults2(Tstar_v,state,ipc,ip,el,offset) ipc, & !< component-ID of integration point ip, & !< integration point el, & - offset !< element + offset !< element type(p_vec), intent(in) :: & state - !< microstructure state + !< microstructure state real(pReal), dimension(6) :: & Tstar_dev_v ! deviatoric part of the 2nd Piola Kirchhoff stress tensor in Mandel notation diff --git a/code/homogenization.f90 b/code/homogenization.f90 index 188fa25fe..a5d5059fa 100644 --- a/code/homogenization.f90 +++ b/code/homogenization.f90 @@ -378,6 +378,14 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) forall(i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), homogenization_sizeState(i,e) > 0_pInt) & homogenization_subState0(i,e)%p = homogenization_state0(i,e)%p ! ...internal homogenization state enddo +#ifdef NEWSTATE + do e = FEsolving_execElem(1),FEsolving_execElem(2) + myNgrains = homogenization_Ngrains(mesh_element(3,e)) + do i = FEsolving_execIP(1,e), FEsolving_execIP(2,e) + do g = 1, myNgrains + plasticSate(mappingConstitutive(g,i,e,1))%partionedState0(mappingConstitutive(g,i,e,2)) = & + plasticSate(mappingConstitutive(g,i,e,1))%state0(mappingConstitutive(g,i,e,2)) +#endif NiterationHomog = 0_pInt @@ -417,6 +425,11 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e)! ...stiffness crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) = crystallite_Tstar_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress forall (g = 1:myNgrains) constitutive_partionedState0(g,i,e)%p = constitutive_state(g,i,e)%p ! ...microstructures +#ifdef NEWSTATE + do g = 1, myNgrains + plasticSate(mappingConstitutive(g,i,e,1))%partionedState0(mappingConstitutive(g,i,e,2)) = & + plasticSate(mappingConstitutive(g,i,e,1))%state(mappingConstitutive(g,i,e,2)) +#endif if (homogenization_sizeState(i,e) > 0_pInt) & homogenization_subState0(i,e)%p = homogenization_state(i,e)%p ! ...internal state of homog scheme materialpoint_subF0(1:3,1:3,i,e) = materialpoint_subF(1:3,1:3,i,e) ! ...def grad @@ -464,6 +477,11 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt) crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) ! ...stiffness crystallite_Tstar_v(1:6,1:myNgrains,i,e) = crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress forall (g = 1:myNgrains) constitutive_state(g,i,e)%p = constitutive_partionedState0(g,i,e)%p ! ...microstructures +#ifdef NEWSTATE + do g = 1, myNgrains + plasticSate(mappingConstitutive(g,i,e,1))%state(mappingConstitutive(g,i,e,2)) = & + plasticSate(mappingConstitutive(g,i,e,1))%partionedState0(mappingConstitutive(g,i,e,2)) +#endif if (homogenization_sizeState(i,e) > 0_pInt) & homogenization_state(i,e)%p = homogenization_subState0(i,e)%p ! ...internal state of homog scheme endif