more suitable data structure

no need to know (ip,el) at the constitutive level
This commit is contained in:
Martin Diehl 2021-02-14 14:36:56 +01:00
parent 18971d7d8b
commit 5a1ca012f8
2 changed files with 36 additions and 3 deletions

View File

@ -186,7 +186,6 @@ module subroutine phase_LiAndItsTangents(Li, dLi_dS, dLi_dFi, &
active = .true. active = .true.
end select plasticType end select plasticType
KinematicsLoop: do k = 1, Nmodels(ph) KinematicsLoop: do k = 1, Nmodels(ph)
kinematicsType: select case (model(k,ph)) kinematicsType: select case (model(k,ph))
case (KINEMATICS_thermal_expansion_ID) kinematicsType case (KINEMATICS_thermal_expansion_ID) kinematicsType

View File

@ -13,6 +13,12 @@ submodule(phase:plastic) nonlocal
IPareaNormal => geometry_plastic_nonlocal_IPareaNormal0, & IPareaNormal => geometry_plastic_nonlocal_IPareaNormal0, &
geometry_plastic_nonlocal_disable geometry_plastic_nonlocal_disable
type :: tGeometry
real(pReal), dimension(:), allocatable :: V_0
end type tGeometry
type(tGeometry), dimension(:), allocatable :: geom
real(pReal), parameter :: & real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
@ -203,6 +209,10 @@ module function plastic_nonlocal_init() result(myPlasticity)
print*, 'Kords, Dissertation RWTH Aachen, 2014' print*, 'Kords, Dissertation RWTH Aachen, 2014'
print*, 'http://publications.rwth-aachen.de/record/229993' print*, 'http://publications.rwth-aachen.de/record/229993'
phases => config_material%get('phase')
allocate(geom(phases%length))
allocate(param(Ninstances)) allocate(param(Ninstances))
allocate(state(Ninstances)) allocate(state(Ninstances))
allocate(state0(Ninstances)) allocate(state0(Ninstances))
@ -210,7 +220,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
allocate(deltaState(Ninstances)) allocate(deltaState(Ninstances))
allocate(microstructure(Ninstances)) allocate(microstructure(Ninstances))
phases => config_material%get('phase')
i = 0 i = 0
do p = 1, phases%length do p = 1, phases%length
phase => phases%get(p) phase => phases%get(p)
@ -225,7 +235,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
dst => microstructure(i)) dst => microstructure(i))
pl => mech%get('plasticity') pl => mech%get('plasticity')
phase_localPlasticity(p) = .not. pl%contains('nonlocal') phase_localPlasticity(p) = .not. pl%contains('nonlocal')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_asStrings(pl) prm%output = output_asStrings(pl)
@ -409,6 +419,9 @@ module function plastic_nonlocal_init() result(myPlasticity)
call phase_allocateState(plasticState(p),Nconstituents,sizeState,sizeDotState,sizeDeltaState) call phase_allocateState(plasticState(p),Nconstituents,sizeState,sizeDotState,sizeDeltaState)
allocate(geom(p)%V_0(Nconstituents))
call storeGeometry(p)
plasticState(p)%nonlocal = pl%get_asBool('nonlocal') plasticState(p)%nonlocal = pl%get_asBool('nonlocal')
if(plasticState(p)%nonlocal .and. .not. allocated(IPneighborhood)) & if(plasticState(p)%nonlocal .and. .not. allocated(IPneighborhood)) &
call IO_error(212,ext_msg='IPneighborhood does not exist') call IO_error(212,ext_msg='IPneighborhood does not exist')
@ -1831,4 +1844,25 @@ pure function getRho0(instance,me,ip,el)
end function getRho0 end function getRho0
subroutine storeGeometry(ph)
integer, intent(in) :: ph
integer :: ip, el, ce, co
ce = 0
do el = 1, size(material_homogenizationMemberAt,2)
do ip = 1, size(material_homogenizationMemberAt,1)
ce = ce + 1
do co = 1, homogenization_maxNconstituents
if(material_phaseAt2(co,ce) == ph) then
geom(ph)%V_0(material_phaseMemberAt2(co,ce)) = IPvolume(ip,el)
endif
enddo
enddo
enddo
end subroutine
end submodule nonlocal end submodule nonlocal