using new functions

This commit is contained in:
Martin Diehl 2020-12-20 09:27:37 +01:00
parent 9f2c150944
commit 9425184b52
5 changed files with 44 additions and 13 deletions

View File

@ -262,6 +262,7 @@ end subroutine CPFEM_general
subroutine CPFEM_forward
call crystallite_forward
call constitutive_forward
end subroutine CPFEM_forward

View File

@ -99,6 +99,7 @@ end subroutine CPFEM_restartWrite
subroutine CPFEM_forward
call crystallite_forward
call constitutive_forward
end subroutine CPFEM_forward

View File

@ -378,6 +378,8 @@ module constitutive
constitutive_thermal_getRateAndItsTangents, &
constitutive_results, &
constitutive_allocateState, &
constitutive_forward, &
constitutive_restore, &
plastic_nonlocal_updateCompatibility, &
plastic_active, &
source_active, &
@ -864,6 +866,44 @@ subroutine constitutive_allocateState(state, &
end subroutine constitutive_allocateState
!--------------------------------------------------------------------------------------------------
!> @brief Restore data after homog cutback.
!--------------------------------------------------------------------------------------------------
subroutine constitutive_restore(i,e)
integer, intent(in) :: &
i, & !< integration point number
e !< element number
integer :: &
c, & !< constituent number
s
do c = 1,homogenization_Nconstituents(material_homogenizationAt(e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState(material_phaseAt(c,e))%p(s)%state( :,material_phasememberAt(c,i,e)) = &
sourceState(material_phaseAt(c,e))%p(s)%partitionedState0(:,material_phasememberAt(c,i,e))
enddo
enddo
end subroutine constitutive_restore
!--------------------------------------------------------------------------------------------------
!> @brief Forward data after successful increment.
! ToDo: Any guessing for the current states possible?
!--------------------------------------------------------------------------------------------------
subroutine constitutive_forward
integer :: i, j
do i = 1, size(sourceState)
do j = 1,phase_Nsources(i)
sourceState(i)%p(j)%state0 = sourceState(i)%p(j)%state
enddo; enddo
end subroutine constitutive_forward
!--------------------------------------------------------------------------------------------------
!> @brief writes constitutive results to HDF5 output file
!--------------------------------------------------------------------------------------------------

View File

@ -515,8 +515,7 @@ subroutine crystallite_restore(i,e,includeL)
logical, intent(in) :: &
includeL !< protect agains fake cutback
integer :: &
c, & !< constituent number
s
c !< constituent number
do c = 1,homogenization_Nconstituents(material_homogenizationAt(e))
if (includeL) then
@ -529,10 +528,6 @@ subroutine crystallite_restore(i,e,includeL)
plasticState (material_phaseAt(c,e))%state( :,material_phasememberAt(c,i,e)) = &
plasticState (material_phaseAt(c,e))%partitionedState0(:,material_phasememberAt(c,i,e))
do s = 1, phase_Nsources(material_phaseAt(c,e))
sourceState(material_phaseAt(c,e))%p(s)%state( :,material_phasememberAt(c,i,e)) = &
sourceState(material_phaseAt(c,e))%p(s)%partitionedState0(:,material_phasememberAt(c,i,e))
enddo
enddo
end subroutine crystallite_restore
@ -1198,8 +1193,6 @@ subroutine integrateSourceState(g,i,e)
zeta
real(pReal), dimension(max(constitutive_plasticity_maxSizeDotState,constitutive_source_maxSizeDotState)) :: &
r ! state residuum
real(pReal), dimension(constitutive_plasticity_maxSizeDotState,2) :: &
plastic_dotState
real(pReal), dimension(constitutive_source_maxSizeDotState,2,maxval(phase_Nsources)) :: source_dotState
logical :: &
broken
@ -1224,7 +1217,6 @@ subroutine integrateSourceState(g,i,e)
iteration: do NiterationState = 1, num%nState
if(nIterationState > 1) plastic_dotState(1:size_pl,2) = plastic_dotState(1:size_pl,1)
do s = 1, phase_Nsources(p)
if(nIterationState > 1) source_dotState(1:size_so(s),2,s) = source_dotState(1:size_so(s),1,s)
source_dotState(1:size_so(s),1,s) = sourceState(p)%p(s)%dotState(:,c)
@ -1651,10 +1643,6 @@ subroutine crystallite_forward
do i = 1, size(plasticState)
plasticState(i)%state0 = plasticState(i)%state
enddo
do i = 1, size(sourceState)
do j = 1,phase_Nsources(i)
sourceState(i)%p(j)%state0 = sourceState(i)%p(j)%state
enddo; enddo
do i = 1,size(material_name_homogenization)
homogState (i)%state0 = homogState (i)%state
damageState (i)%state0 = damageState (i)%state

View File

@ -255,6 +255,7 @@ subroutine materialpoint_stressAndItsTangent(dt)
subStep(i,e) = num%subStepSizeHomog * subStep(i,e) ! crystallite had severe trouble, so do a significant cutback
call crystallite_restore(i,e,subStep(i,e) < 1.0_pReal)
call constitutive_restore(i,e)
if(homogState(material_homogenizationAt(e))%sizeState > 0) &
homogState(material_homogenizationAt(e))%State( :,material_homogenizationMemberAt(i,e)) = &