leaner interface

This commit is contained in:
Martin Diehl 2019-02-21 21:32:22 +01:00
parent 6938864c4b
commit da8a1d5973
1 changed files with 16 additions and 25 deletions

View File

@ -20,7 +20,6 @@ module plastic_nonlocal
character(len=64), dimension(:,:), allocatable, target, public :: & character(len=64), dimension(:,:), allocatable, target, public :: &
plastic_nonlocal_output !< name of each post result output plastic_nonlocal_output !< name of each post result output
integer(pInt), dimension(:,:), allocatable, private :: & integer(pInt), dimension(:,:), allocatable, private :: &
iGamma, & !< state indices for accumulated shear iGamma, & !< state indices for accumulated shear
iRhoF !< state indices for forest density iRhoF !< state indices for forest density
@ -325,6 +324,7 @@ subroutine plastic_nonlocal_init
stt => state(phase_plasticityInstance(p)), & stt => state(phase_plasticityInstance(p)), &
del => deltaState(phase_plasticityInstance(p)), & del => deltaState(phase_plasticityInstance(p)), &
res => results(phase_plasticityInstance(p)), & res => results(phase_plasticityInstance(p)), &
dst => microstructure(phase_plasticityInstance(p)), &
config => config_phase(p)) config => config_phase(p))
prm%aTolRho = config%getFloat('atol_rho', defaultVal=0.0_pReal) prm%aTolRho = config%getFloat('atol_rho', defaultVal=0.0_pReal)
@ -597,10 +597,12 @@ extmsg = trim(extmsg)//' fEdgeMultiplication'
'velocityScrewPos ','velocityScrewNeg ', & 'velocityScrewPos ','velocityScrewNeg ', &
'maxDipoleHeightEdge ','maxDipoleHeightScrew' ]),pInt) * prm%totalNslip !< other dependent state variables that are not updated by microstructure 'maxDipoleHeightEdge ','maxDipoleHeightScrew' ]),pInt) * prm%totalNslip !< other dependent state variables that are not updated by microstructure
sizeDeltaState = sizeDotState sizeDeltaState = sizeDotState
call material_allocatePlasticState(p,NofMyPhase,sizeState,sizeDotState,sizeDeltaState, & call material_allocatePlasticState(p,NofMyPhase,sizeState,sizeDotState,sizeDeltaState, &
prm%totalNslip,0_pInt,0_pInt) prm%totalNslip,0_pInt,0_pInt)
plasticState(p)%nonlocal = .true. plasticState(p)%nonlocal = .true.
plasticState(p)%offsetDeltaState = 0_pInt ! ToDo: state structure does not follow convention plasticState(p)%offsetDeltaState = 0_pInt ! ToDo: state structure does not follow convention
plasticState(p)%sizePostResults = sum(plastic_nonlocal_sizePostResult(:,phase_plasticityInstance(p)))
Nslip(1:size(prm%Nslip),phase_plasticityInstance(p)) = prm%Nslip ! ToDo: DEPRECATED Nslip(1:size(prm%Nslip),phase_plasticityInstance(p)) = prm%Nslip ! ToDo: DEPRECATED
totalNslip(phase_plasticityInstance(p)) = sum(Nslip(1:size(prm%Nslip),phase_plasticityInstance(p))) ! ToDo: DEPRECATED totalNslip(phase_plasticityInstance(p)) = sum(Nslip(1:size(prm%Nslip),phase_plasticityInstance(p))) ! ToDo: DEPRECATED
@ -675,12 +677,6 @@ ns = param(instance)%totalNslip
call IO_error(0_pInt, ext_msg = 'state indices not properly set ('//PLASTICITY_NONLOCAL_label//')') call IO_error(0_pInt, ext_msg = 'state indices not properly set ('//PLASTICITY_NONLOCAL_label//')')
plasticState(phase)%slipRate => &
plasticState(phase)%dotState(iGamma(1,instance):iGamma(ns,instance),1:NofMyPhase)
plasticState(phase)%accumulatedSlip => &
plasticState(phase)%state (iGamma(1,instance):iGamma(ns,instance),1:NofMyPhase)
endif myPhase2 endif myPhase2
enddo initializeInstances enddo initializeInstances
@ -699,8 +695,7 @@ ns = param(instance)%totalNslip
NofMyPhase=count(material_phase==p) NofMyPhase=count(material_phase==p)
plasticState(p)%sizePostResults = sum(plastic_nonlocal_sizePostResult(:,instance)) stt%rho => plasticState(p)%state (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:)
stt%rho => plasticState(p)%state (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:)
dot%rho => plasticState(p)%dotState (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:) dot%rho => plasticState(p)%dotState (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:)
del%rho => plasticState(p)%deltaState (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:) del%rho => plasticState(p)%deltaState (0_pInt*prm%totalNslip+1_pInt:10_pInt*prm%totalNslip,:)
plasticState(p)%aTolState(1:10_pInt*prm%totalNslip) = prm%aTolRho plasticState(p)%aTolState(1:10_pInt*prm%totalNslip) = prm%aTolRho
@ -1184,29 +1179,28 @@ end subroutine plastic_nonlocal_dependentState
!> @brief calculates kinetics !> @brief calculates kinetics
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine plastic_nonlocal_kinetics(v, dv_dtau, dv_dtauNS, tau, tauNS, & subroutine plastic_nonlocal_kinetics(v, dv_dtau, dv_dtauNS, tau, tauNS, &
tauThreshold, c, Temperature, ip, el) tauThreshold, c, Temperature, instance, of)
use material, only: material_phase, & use material, only: material_phase, &
phase_plasticityInstance phase_plasticityInstance
implicit none implicit none
integer(pInt), intent(in) :: ip, & !< current integration point integer(pInt), intent(in) :: c, & !< dislocation character (1:edge, 2:screw)
el, & !< current element number instance, of
c !< dislocation character (1:edge, 2:screw)
real(pReal), intent(in) :: Temperature !< temperature real(pReal), intent(in) :: Temperature !< temperature
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1_pInt,ip,el)))), & real(pReal), dimension(param(instance)%totalNslip), &
intent(in) :: tau, & !< resolved external shear stress (without non Schmid effects) intent(in) :: tau, & !< resolved external shear stress (without non Schmid effects)
tauNS, & !< resolved external shear stress (including non Schmid effects) tauNS, & !< resolved external shear stress (including non Schmid effects)
tauThreshold !< threshold shear stress tauThreshold !< threshold shear stress
real(pReal), dimension(totalNslip(phase_plasticityInstance(material_phase(1_pInt,ip,el)))), & real(pReal), dimension(param(instance)%totalNslip), &
intent(out) :: v, & !< velocity intent(out) :: v, & !< velocity
dv_dtau, & !< velocity derivative with respect to resolved shear stress (without non Schmid contributions) dv_dtau, & !< velocity derivative with respect to resolved shear stress (without non Schmid contributions)
dv_dtauNS !< velocity derivative with respect to resolved shear stress (including non Schmid contributions) dv_dtauNS !< velocity derivative with respect to resolved shear stress (including non Schmid contributions)
integer(pInt) :: instance, & !< current instance of this plasticity integer(pInt) :: ns, & !< short notation for the total number of active slip systems
ns, & !< short notation for the total number of active slip systems
s !< index of my current slip system s !< index of my current slip system
real(pReal) tauRel_P, & real(pReal) tauRel_P, &
tauRel_S, & tauRel_S, &
@ -1230,11 +1224,8 @@ real(pReal) tauRel_P, &
criticalStress_S, & !< maximum obstacle strength criticalStress_S, & !< maximum obstacle strength
mobility !< dislocation mobility mobility !< dislocation mobility
instance = phase_plasticityInstance(material_phase(1_pInt,ip,el))
ns = totalNslip(instance)
associate(prm => param(instance)) associate(prm => param(instance))
ns = prm%totalNslip
v = 0.0_pReal v = 0.0_pReal
dv_dtau = 0.0_pReal dv_dtau = 0.0_pReal
dv_dtauNS = 0.0_pReal dv_dtauNS = 0.0_pReal
@ -1418,7 +1409,7 @@ tau = tau + dst%tau_back(:,of)
! edges ! edges
call plastic_nonlocal_kinetics(v(1:ns,1), dv_dtau(1:ns,1), dv_dtauNS(1:ns,1), & call plastic_nonlocal_kinetics(v(1:ns,1), dv_dtau(1:ns,1), dv_dtauNS(1:ns,1), &
tau(1:ns), tauNS(1:ns,1), dst%tau_Threshold(1:ns,of), & tau(1:ns), tauNS(1:ns,1), dst%tau_Threshold(1:ns,of), &
1_pInt, Temperature, ip, el) 1_pInt, Temperature, instance, of)
v(1:ns,2) = v(1:ns,1) v(1:ns,2) = v(1:ns,1)
dv_dtau(1:ns,2) = dv_dtau(1:ns,1) dv_dtau(1:ns,2) = dv_dtau(1:ns,1)
dv_dtauNS(1:ns,2) = dv_dtauNS(1:ns,1) dv_dtauNS(1:ns,2) = dv_dtauNS(1:ns,1)
@ -1434,7 +1425,7 @@ else
do t = 3_pInt,4_pInt do t = 3_pInt,4_pInt
call plastic_nonlocal_kinetics(v(1:ns,t), dv_dtau(1:ns,t), dv_dtauNS(1:ns,t), & call plastic_nonlocal_kinetics(v(1:ns,t), dv_dtau(1:ns,t), dv_dtauNS(1:ns,t), &
tau(1:ns), tauNS(1:ns,t), dst%tau_Threshold(1:ns,of), & tau(1:ns), tauNS(1:ns,t), dst%tau_Threshold(1:ns,of), &
2_pInt , Temperature, ip, el) 2_pInt , Temperature, instance, of)
enddo enddo
endif endif
@ -1795,7 +1786,7 @@ endif
ph = material_phase(1_pInt,ip,el) ph = material_phase(1_pInt,ip,el)
instance = phase_plasticityInstance(ph) instance = phase_plasticityInstance(ph)
associate(prm => param(instance),dst => microstructure(instance)) associate(prm => param(instance),dst => microstructure(instance),dot => dotState(instance))
ns = totalNslip(instance) ns = totalNslip(instance)
tau = 0.0_pReal tau = 0.0_pReal