1 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_isostrain.f90"
4 # 1 "/home/damask_user/GitLabCI_Pipeline_4301/DAMASK/src/homogenization_mech_isostrain.f90"
13 enum,
bind(c); enumerator :: &
21 integer(kind(average_ID)) :: &
25 type(tParameters),
dimension(:),
allocatable :: param
33 module subroutine mech_isostrain_init
39 character(len=pStringLen) :: &
42 write(6,
'(/,a)')
' <<<+- homogenization_'//homogenization_isostrain_label//
' init -+>>>'
44 ninstance = count(homogenization_type == homogenization_isostrain_id)
45 if (iand(debug_level(debug_homogenization),debug_levelbasic) /= 0) &
46 write(6,
'(a16,1x,i5,/)')
'# instances:',ninstance
48 allocate(param(ninstance))
50 do h = 1,
size(homogenization_type)
51 if (homogenization_type(h) /= homogenization_isostrain_id) cycle
53 associate(prm => param(homogenization_typeinstance(h)),&
54 config => config_homogenization(h))
56 prm%Nconstituents = config_homogenization(h)%getInt(
'nconstituents')
58 select case(trim(
config%getString(
'mapping',defaultval = tag)))
60 prm%mapping = parallel_id
62 prm%mapping = average_id
64 call io_error(211,ext_msg=trim(tag)//
' ('//homogenization_isostrain_label//
')')
67 nofmyhomog = count(material_homogenizationat == h)
68 homogstate(h)%sizeState = 0
69 allocate(homogstate(h)%state0 (0,nofmyhomog))
70 allocate(homogstate(h)%subState0(0,nofmyhomog))
71 allocate(homogstate(h)%state (0,nofmyhomog))
77 end subroutine mech_isostrain_init
83 module subroutine mech_isostrain_partitiondeformation(f,avgf)
85 real(pReal),
dimension (:,:,:),
intent(out) :: F
87 real(pReal),
dimension (3,3),
intent(in) :: avgF
89 f = spread(avgf,3,
size(f,3))
91 end subroutine mech_isostrain_partitiondeformation
97 module subroutine mech_isostrain_averagestressanditstangent(avgp,davgpdavgf,p,dpdf,instance)
99 real(pReal),
dimension (3,3),
intent(out) :: avgP
100 real(pReal),
dimension (3,3,3,3),
intent(out) :: dAvgPdAvgF
102 real(pReal),
dimension (:,:,:),
intent(in) :: P
103 real(pReal),
dimension (:,:,:,:,:),
intent(in) :: dPdF
104 integer,
intent(in) :: instance
106 associate(prm => param(instance))
108 select case (prm%mapping)
111 davgpdavgf = sum(dpdf,5)
113 avgp = sum(p,3) /real(prm%Nconstituents,preal)
114 davgpdavgf = sum(dpdf,5)/real(prm%Nconstituents,preal)
119 end subroutine mech_isostrain_averagestressanditstangent
121 end submodule homogenization_mech_isostrain