one loop is enough
This commit is contained in:
parent
2429eee079
commit
07ab7a4d57
|
@ -56,13 +56,11 @@ subroutine kinematics_cleavage_opening_init
|
||||||
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
|
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
|
||||||
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
||||||
|
|
||||||
|
allocate(kinematics_cleavage_opening_instance(size(config_phase)), source=0)
|
||||||
allocate(param(Ninstance))
|
allocate(param(Ninstance))
|
||||||
|
|
||||||
allocate(kinematics_cleavage_opening_instance(size(config_phase)), source=0)
|
|
||||||
|
|
||||||
|
|
||||||
do p = 1, size(config_phase)
|
do p = 1, size(config_phase)
|
||||||
kinematics_cleavage_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_cleavage_opening_ID) ! ToDo: count correct?
|
kinematics_cleavage_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_cleavage_opening_ID)
|
||||||
if (all(phase_kinematics(:,p) /= KINEMATICS_cleavage_opening_ID)) cycle
|
if (all(phase_kinematics(:,p) /= KINEMATICS_cleavage_opening_ID)) cycle
|
||||||
|
|
||||||
associate(prm => param(kinematics_cleavage_opening_instance(p)), &
|
associate(prm => param(kinematics_cleavage_opening_instance(p)), &
|
||||||
|
|
|
@ -58,13 +58,10 @@ subroutine kinematics_slipplane_opening_init
|
||||||
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
||||||
|
|
||||||
allocate(kinematics_slipplane_opening_instance(size(config_phase)), source=0)
|
allocate(kinematics_slipplane_opening_instance(size(config_phase)), source=0)
|
||||||
do p = 1, size(config_phase)
|
|
||||||
kinematics_slipplane_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_slipplane_opening_ID) ! ToDo: count correct?
|
|
||||||
enddo
|
|
||||||
|
|
||||||
allocate(param(Ninstance))
|
allocate(param(Ninstance))
|
||||||
|
|
||||||
do p = 1, size(config_phase)
|
do p = 1, size(config_phase)
|
||||||
|
kinematics_slipplane_opening_instance(p) = count(phase_kinematics(:,1:p) == kinematics_slipplane_opening_ID)
|
||||||
if (all(phase_kinematics(:,p) /= KINEMATICS_slipplane_opening_ID)) cycle
|
if (all(phase_kinematics(:,p) /= KINEMATICS_slipplane_opening_ID)) cycle
|
||||||
associate(prm => param(kinematics_slipplane_opening_instance(p)), &
|
associate(prm => param(kinematics_slipplane_opening_instance(p)), &
|
||||||
config => config_phase(p))
|
config => config_phase(p))
|
||||||
|
|
|
@ -15,6 +15,8 @@ module kinematics_thermal_expansion
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
|
||||||
|
integer, dimension(:), allocatable :: kinematics_thermal_expansion_instance
|
||||||
|
|
||||||
type :: tParameters
|
type :: tParameters
|
||||||
real(pReal), allocatable, dimension(:,:,:) :: &
|
real(pReal), allocatable, dimension(:,:,:) :: &
|
||||||
expansion
|
expansion
|
||||||
|
@ -46,15 +48,14 @@ subroutine kinematics_thermal_expansion_init
|
||||||
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
|
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
|
||||||
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
||||||
|
|
||||||
|
allocate(kinematics_thermal_expansion_instance(size(config_phase)), source=0)
|
||||||
allocate(param(Ninstance))
|
allocate(param(Ninstance))
|
||||||
|
|
||||||
do p = 1, size(config_phase)
|
do p = 1, size(config_phase)
|
||||||
|
kinematics_thermal_expansion_instance(p) = count(phase_kinematics(:,1:p) == KINEMATICS_thermal_expansion_ID)
|
||||||
if (all(phase_kinematics(:,p) /= KINEMATICS_thermal_expansion_ID)) cycle
|
if (all(phase_kinematics(:,p) /= KINEMATICS_thermal_expansion_ID)) cycle
|
||||||
associate(config => config_phase(p))
|
associate(config => config_phase(p))
|
||||||
|
|
||||||
! ToDo: Here we need to decide how to extend the concept of instances to
|
|
||||||
! kinetics and sources. I would suggest that the same mechanism exists at maximum once per phase
|
|
||||||
|
|
||||||
! read up to three parameters (constant, linear, quadratic with T)
|
! read up to three parameters (constant, linear, quadratic with T)
|
||||||
temp = config%getFloats('thermal_expansion11')
|
temp = config%getFloats('thermal_expansion11')
|
||||||
!lattice_thermalExpansion33(1,1,1:size(temp),p) = temp
|
!lattice_thermalExpansion33(1,1,1:size(temp),p) = temp
|
||||||
|
@ -76,9 +77,10 @@ pure function kinematics_thermal_expansion_initialStrain(homog,phase,offset)
|
||||||
|
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
phase, &
|
phase, &
|
||||||
homog, offset
|
homog, &
|
||||||
|
offset
|
||||||
real(pReal), dimension(3,3) :: &
|
real(pReal), dimension(3,3) :: &
|
||||||
kinematics_thermal_expansion_initialStrain !< initial thermal strain (should be small strain, though)
|
kinematics_thermal_expansion_initialStrain !< initial thermal strain (should be small strain, though)
|
||||||
|
|
||||||
kinematics_thermal_expansion_initialStrain = &
|
kinematics_thermal_expansion_initialStrain = &
|
||||||
(temperature(homog)%p(offset) - lattice_referenceTemperature(phase))**1 / 1. * &
|
(temperature(homog)%p(offset) - lattice_referenceTemperature(phase))**1 / 1. * &
|
||||||
|
@ -104,17 +106,17 @@ subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, ipc, ip,
|
||||||
Li !< thermal velocity gradient
|
Li !< thermal velocity gradient
|
||||||
real(pReal), intent(out), dimension(3,3,3,3) :: &
|
real(pReal), intent(out), dimension(3,3,3,3) :: &
|
||||||
dLi_dTstar !< derivative of Li with respect to Tstar (4th-order tensor defined to be zero)
|
dLi_dTstar !< derivative of Li with respect to Tstar (4th-order tensor defined to be zero)
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
phase, &
|
phase, &
|
||||||
homog, offset
|
homog
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
T, TRef, TDot
|
T, TRef, TDot
|
||||||
|
|
||||||
phase = material_phaseAt(ipc,el)
|
phase = material_phaseAt(ipc,el)
|
||||||
homog = material_homogenizationAt(el)
|
homog = material_homogenizationAt(el)
|
||||||
offset = thermalMapping(homog)%p(ip,el)
|
T = temperature(homog)%p(thermalMapping(homog)%p(ip,el))
|
||||||
T = temperature(homog)%p(offset)
|
TDot = temperatureRate(homog)%p(thermalMapping(homog)%p(ip,el))
|
||||||
TDot = temperatureRate(homog)%p(offset)
|
|
||||||
TRef = lattice_referenceTemperature(phase)
|
TRef = lattice_referenceTemperature(phase)
|
||||||
|
|
||||||
Li = TDot * ( &
|
Li = TDot * ( &
|
||||||
|
|
Loading…
Reference in New Issue