new mappings

This commit is contained in:
Martin Diehl 2021-05-22 11:26:19 +02:00
parent 77d1ed465e
commit d2855913b5
6 changed files with 30 additions and 34 deletions

View File

@ -15,7 +15,7 @@ module discretization
discretization_Nelems discretization_Nelems
integer, public, protected, dimension(:), allocatable :: & integer, public, protected, dimension(:), allocatable :: &
discretization_materialAt discretization_materialAt !ToDo: discretization_materialID
real(pReal), public, protected, dimension(:,:), allocatable :: & real(pReal), public, protected, dimension(:,:), allocatable :: &
discretization_IPcoords0, & discretization_IPcoords0, &

View File

@ -284,7 +284,7 @@ program DAMASK_grid
if (loadCases(l)%f_restart < 1) errorID = 839 if (loadCases(l)%f_restart < 1) errorID = 839
if (dEq(loadCases(l)%r,1.0_pReal,1.e-9_pReal)) then if (dEq(loadCases(l)%r,1.0_pReal,1.e-9_pReal)) then
print'(a)', ' r: 1 (constant step widths)' print'(a)', ' r: 1 (constant step width)'
else else
print'(a,f0.3)', ' r: ', loadCases(l)%r print'(a,f0.3)', ' r: ', loadCases(l)%r
endif endif

View File

@ -220,12 +220,11 @@ module phase
end function thermal_stress end function thermal_stress
module function integrateDamageState(dt,co,ip,el) result(broken) module function integrateDamageState(dt,co,ce) result(broken)
real(pReal), intent(in) :: dt real(pReal), intent(in) :: dt
integer, intent(in) :: & integer, intent(in) :: &
el, & !< element index in element loop ce, &
ip, & !< integration point index in ip loop co
co !< grain index in grain loop
logical :: broken logical :: broken
end function integrateDamageState end function integrateDamageState

View File

@ -171,13 +171,12 @@ end function phase_f_phi
!> @brief integrate stress, state with adaptive 1st order explicit Euler method !> @brief integrate stress, state with adaptive 1st order explicit Euler method
!> using Fixed Point Iteration to adapt the stepsize !> using Fixed Point Iteration to adapt the stepsize
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module function integrateDamageState(dt,co,ip,el) result(broken) module function integrateDamageState(dt,co,ce) result(broken)
real(pReal), intent(in) :: dt real(pReal), intent(in) :: dt
integer, intent(in) :: & integer, intent(in) :: &
el, & !< element index in element loop ce, &
ip, & !< integration point index in ip loop co
co !< grain index in grain loop
logical :: broken logical :: broken
integer :: & integer :: &
@ -193,8 +192,8 @@ module function integrateDamageState(dt,co,ip,el) result(broken)
logical :: & logical :: &
converged_ converged_
ph = material_phaseAt(co,el) ph = material_phaseID(co,ce)
me = material_phaseMemberAt(co,ip,el) me = material_phaseEntry(co,ce)
if (damageState(ph)%sizeState == 0) then if (damageState(ph)%sizeState == 0) then
broken = .false. broken = .false.

View File

@ -192,8 +192,6 @@ module subroutine mechanical_init(materials,phases)
phases phases
integer :: & integer :: &
el, &
ip, &
co, & co, &
ce, & ce, &
ph, & ph, &
@ -257,14 +255,14 @@ module subroutine mechanical_init(materials,phases)
#endif #endif
enddo enddo
do el = 1, size(material_phaseMemberAt,3); do ip = 1, size(material_phaseMemberAt,2) do ce = 1, size(discretization_materialAt,1)
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el)) do co = 1, homogenization_Nconstituents(material_homogenizationID(ce))
material => materials%get(discretization_materialAt(el)) material => materials%get(discretization_materialAt(ce))
constituents => material%get('constituents') constituents => material%get('constituents')
constituent => constituents%get(co) constituent => constituents%get(co)
ph = material_phaseAt(co,el) ph = material_phaseID(co,ce)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,ce)
call material_orientation0(co,ph,en)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4)) call material_orientation0(co,ph,en)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4))
@ -281,7 +279,7 @@ module subroutine mechanical_init(materials,phases)
phase_mechanical_F(ph)%data(1:3,1:3,en) = phase_mechanical_F0(ph)%data(1:3,1:3,en) phase_mechanical_F(ph)%data(1:3,1:3,en) = phase_mechanical_F0(ph)%data(1:3,1:3,en)
enddo enddo
enddo; enddo enddo
! initialize elasticity ! initialize elasticity
@ -427,8 +425,8 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken)
broken = .true. broken = .true.
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
call plastic_dependentState(co,ip,el) call plastic_dependentState(co,ip,el)
@ -603,8 +601,8 @@ function integrateStateFPI(F_0,F,subFp0,subFi0,subState0,Delta_t,co,ip,el) resul
dotState dotState
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
broken = plastic_dotState(Delta_t, co,ip,el,ph,en) broken = plastic_dotState(Delta_t, co,ip,el,ph,en)
if(broken) return if(broken) return
@ -688,8 +686,8 @@ function integrateStateEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,co,ip,el) res
sizeDotState sizeDotState
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
broken = plastic_dotState(Delta_t, co,ip,el,ph,en) broken = plastic_dotState(Delta_t, co,ip,el,ph,en)
if(broken) return if(broken) return
@ -728,8 +726,8 @@ function integrateStateAdaptiveEuler(F_0,F,subFp0,subFi0,subState0,Delta_t,co,ip
real(pReal), dimension(phase_plasticity_maxSizeDotState) :: residuum_plastic real(pReal), dimension(phase_plasticity_maxSizeDotState) :: residuum_plastic
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
broken = plastic_dotState(Delta_t, co,ip,el,ph,en) broken = plastic_dotState(Delta_t, co,ip,el,ph,en)
if(broken) return if(broken) return
@ -846,8 +844,8 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,co,ip,el,A,B,C,D
real(pReal), dimension(phase_plasticity_maxSizeDotState,size(B)) :: plastic_RKdotState real(pReal), dimension(phase_plasticity_maxSizeDotState,size(B)) :: plastic_RKdotState
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phaseMemberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
broken = plastic_dotState(Delta_t,co,ip,el,ph,en) broken = plastic_dotState(Delta_t,co,ip,el,ph,en)
if(broken) return if(broken) return
@ -1105,7 +1103,7 @@ module function crystallite_stress(dt,co,ip,el) result(converged_)
subF = subF0 & subF = subF0 &
+ subStep * (phase_mechanical_F(ph)%data(1:3,1:3,en) - phase_mechanical_F0(ph)%data(1:3,1:3,en)) + subStep * (phase_mechanical_F(ph)%data(1:3,1:3,en) - phase_mechanical_F0(ph)%data(1:3,1:3,en))
converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * dt,co,ip,el) converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * dt,co,ip,el)
converged_ = converged_ .and. .not. integrateDamageState(subStep * dt,co,ip,el) converged_ = converged_ .and. .not. integrateDamageState(subStep * dt,co,(el-1)*discretization_nIPs + ip)
endif endif
enddo cutbackLooping enddo cutbackLooping

View File

@ -360,10 +360,10 @@ module subroutine plastic_dependentState(co, ip, el)
en en
ph = material_phaseAt(co,el) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip)
en = material_phasememberAt(co,ip,el) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip)
plasticType: select case (phase_plasticity(material_phaseAt(co,el))) plasticType: select case (phase_plasticity(ph))
case (PLASTICITY_DISLOTWIN_ID) plasticType case (PLASTICITY_DISLOTWIN_ID) plasticType
call dislotwin_dependentState(thermal_T(ph,en),ph,en) call dislotwin_dependentState(thermal_T(ph,en),ph,en)