associate: clearer code and no performance drawbacks
This commit is contained in:
parent
7ca005d237
commit
edcf97ea59
|
@ -61,7 +61,7 @@ module plastic_phenopowerlaw
|
||||||
tau0_twin, & !< initial critical shear stress for twin
|
tau0_twin, & !< initial critical shear stress for twin
|
||||||
tausat_slip, & !< maximum critical shear stress for slip
|
tausat_slip, & !< maximum critical shear stress for slip
|
||||||
nonSchmidCoeff, &
|
nonSchmidCoeff, &
|
||||||
H_int !< per family hardening activity (optional)
|
H_int !< per family hardening activity (optional)
|
||||||
real(pReal), dimension(:,:), allocatable :: &
|
real(pReal), dimension(:,:), allocatable :: &
|
||||||
interaction_SlipSlip, & !< slip resistance from slip activity
|
interaction_SlipSlip, & !< slip resistance from slip activity
|
||||||
interaction_SlipTwin, & !< slip resistance from twin activity
|
interaction_SlipTwin, & !< slip resistance from twin activity
|
||||||
|
@ -69,10 +69,10 @@ module plastic_phenopowerlaw
|
||||||
interaction_TwinTwin !< twin resistance from twin activity
|
interaction_TwinTwin !< twin resistance from twin activity
|
||||||
|
|
||||||
integer(kind(undefined_ID)), dimension(:), allocatable :: &
|
integer(kind(undefined_ID)), dimension(:), allocatable :: &
|
||||||
outputID !< ID of each post result output
|
outputID !< ID of each post result output
|
||||||
end type
|
end type
|
||||||
|
|
||||||
type(tParameters), dimension(:), allocatable, target, private :: param !< containers of constitutive parameters (len Ninstance)
|
type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance)
|
||||||
|
|
||||||
type, private :: tPhenopowerlawState
|
type, private :: tPhenopowerlawState
|
||||||
real(pReal), pointer, dimension(:,:) :: &
|
real(pReal), pointer, dimension(:,:) :: &
|
||||||
|
@ -154,7 +154,7 @@ subroutine plastic_phenopowerlaw_init
|
||||||
real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::]
|
real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::]
|
||||||
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
|
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
|
||||||
|
|
||||||
type(tParameters), pointer :: prm
|
type(tParameters) :: prm
|
||||||
|
|
||||||
integer(kind(undefined_ID)) :: &
|
integer(kind(undefined_ID)) :: &
|
||||||
outputID !< ID of each post result output
|
outputID !< ID of each post result output
|
||||||
|
@ -182,7 +182,7 @@ subroutine plastic_phenopowerlaw_init
|
||||||
do p = 1_pInt, size(phase_plasticityInstance)
|
do p = 1_pInt, size(phase_plasticityInstance)
|
||||||
if (phase_plasticity(p) /= PLASTICITY_PHENOPOWERLAW_ID) cycle
|
if (phase_plasticity(p) /= PLASTICITY_PHENOPOWERLAW_ID) cycle
|
||||||
instance = phase_plasticityInstance(p)
|
instance = phase_plasticityInstance(p)
|
||||||
prm => param(instance)
|
associate(prm => param(instance))
|
||||||
|
|
||||||
prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray)
|
prm%Nslip = config_phase(p)%getInts('nslip',defaultVal=emptyIntArray)
|
||||||
if (size(prm%Nslip) > count(lattice_NslipSystem(:,p) > 0_pInt)) call IO_error(150_pInt,ext_msg='Nslip')
|
if (size(prm%Nslip) > count(lattice_NslipSystem(:,p) > 0_pInt)) call IO_error(150_pInt,ext_msg='Nslip')
|
||||||
|
@ -457,7 +457,8 @@ subroutine plastic_phenopowerlaw_init
|
||||||
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear
|
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear
|
||||||
|
|
||||||
dotState(instance)%whole =>plasticState(p)%dotState
|
dotState(instance)%whole =>plasticState(p)%dotState
|
||||||
|
|
||||||
|
end associate
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end subroutine plastic_phenopowerlaw_init
|
end subroutine plastic_phenopowerlaw_init
|
||||||
|
@ -511,14 +512,13 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,
|
||||||
dLp_dTstar3333 !< derivative of Lp with respect to Tstar as 4th order tensor
|
dLp_dTstar3333 !< derivative of Lp with respect to Tstar as 4th order tensor
|
||||||
real(pReal), dimension(3,3,2) :: &
|
real(pReal), dimension(3,3,2) :: &
|
||||||
nonSchmid_tensor
|
nonSchmid_tensor
|
||||||
type(tParameters), pointer :: prm
|
type(tParameters) :: prm
|
||||||
type(tPhenopowerlawState), pointer :: stt
|
type(tPhenopowerlawState) :: stt
|
||||||
|
|
||||||
of = phasememberAt(ipc,ip,el)
|
of = phasememberAt(ipc,ip,el)
|
||||||
ph = material_phase(ipc,ip,el)
|
ph = material_phase(ipc,ip,el)
|
||||||
|
|
||||||
prm => param(phase_plasticityInstance(ph))
|
associate(prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)))
|
||||||
stt => state(phase_plasticityInstance(ph))
|
|
||||||
|
|
||||||
Lp = 0.0_pReal
|
Lp = 0.0_pReal
|
||||||
dLp_dTstar3333 = 0.0_pReal
|
dLp_dTstar3333 = 0.0_pReal
|
||||||
|
@ -603,7 +603,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,
|
||||||
|
|
||||||
dLp_dTstar99 = math_Plain3333to99(dLp_dTstar3333)
|
dLp_dTstar99 = math_Plain3333to99(dLp_dTstar3333)
|
||||||
|
|
||||||
|
end associate
|
||||||
end subroutine plastic_phenopowerlaw_LpAndItsTangent
|
end subroutine plastic_phenopowerlaw_LpAndItsTangent
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -644,15 +644,13 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el)
|
||||||
real(pReal), dimension(param(phase_plasticityInstance(material_phase(ipc,ip,el)))%totalNtwin) :: &
|
real(pReal), dimension(param(phase_plasticityInstance(material_phase(ipc,ip,el)))%totalNtwin) :: &
|
||||||
gdot_twin
|
gdot_twin
|
||||||
|
|
||||||
type(tParameters), pointer :: prm
|
type(tParameters) :: prm
|
||||||
type(tPhenopowerlawState), pointer :: dst,stt
|
type(tPhenopowerlawState) :: dst,stt
|
||||||
|
|
||||||
of = phasememberAt(ipc,ip,el)
|
of = phasememberAt(ipc,ip,el)
|
||||||
ph = material_phase(ipc,ip,el)
|
ph = material_phase(ipc,ip,el)
|
||||||
|
associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => &
|
||||||
prm => param(phase_plasticityInstance(ph))
|
dotState(phase_plasticityInstance(ph)))
|
||||||
stt => state(phase_plasticityInstance(ph))
|
|
||||||
dst => dotState(phase_plasticityInstance(ph))
|
|
||||||
|
|
||||||
dst%whole(:,of) = 0.0_pReal
|
dst%whole(:,of) = 0.0_pReal
|
||||||
|
|
||||||
|
@ -729,7 +727,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el)
|
||||||
dst%accshear_twin(j,of) = abs(gdot_twin(j))
|
dst%accshear_twin(j,of) = abs(gdot_twin(j))
|
||||||
enddo twinSystems2
|
enddo twinSystems2
|
||||||
enddo twinFamilies2
|
enddo twinFamilies2
|
||||||
|
end associate
|
||||||
end subroutine plastic_phenopowerlaw_dotState
|
end subroutine plastic_phenopowerlaw_dotState
|
||||||
|
|
||||||
|
|
||||||
|
@ -767,16 +765,14 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el)
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
tau_slip_pos,tau_slip_neg,tau
|
tau_slip_pos,tau_slip_neg,tau
|
||||||
|
|
||||||
type(tParameters), pointer :: prm
|
type(tParameters) :: prm
|
||||||
type(tPhenopowerlawState), pointer :: stt, dst
|
type(tPhenopowerlawState) :: stt, dst
|
||||||
|
|
||||||
of = phasememberAt(ipc,ip,el)
|
of = phasememberAt(ipc,ip,el)
|
||||||
ph = material_phase(ipc,ip,el)
|
ph = material_phase(ipc,ip,el)
|
||||||
|
|
||||||
stt => state(phase_plasticityInstance(ph))
|
associate( prm => param(phase_plasticityInstance(ph)), stt => state(phase_plasticityInstance(ph)), dst => &
|
||||||
dst => dotstate(phase_plasticityInstance(ph))
|
dotState(phase_plasticityInstance(ph)))
|
||||||
prm => param(phase_plasticityInstance(ph))
|
|
||||||
|
|
||||||
|
|
||||||
plastic_phenopowerlaw_postResults = 0.0_pReal
|
plastic_phenopowerlaw_postResults = 0.0_pReal
|
||||||
c = 0_pInt
|
c = 0_pInt
|
||||||
|
@ -872,7 +868,7 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el)
|
||||||
|
|
||||||
end select
|
end select
|
||||||
enddo outputsLoop
|
enddo outputsLoop
|
||||||
|
end associate
|
||||||
end function plastic_phenopowerlaw_postResults
|
end function plastic_phenopowerlaw_postResults
|
||||||
|
|
||||||
end module plastic_phenopowerlaw
|
end module plastic_phenopowerlaw
|
||||||
|
|
Loading…
Reference in New Issue