bugfix release
This commit is contained in:
parent
83ff05c8e8
commit
11c71aae86
|
@ -610,12 +610,12 @@ subroutine material_populateGrains()
|
||||||
real(pReal), dimension (3) :: orientation
|
real(pReal), dimension (3) :: orientation
|
||||||
real(pReal), dimension (3,3) :: symOrientation
|
real(pReal), dimension (3,3) :: symOrientation
|
||||||
integer(pInt), dimension (:), allocatable :: phaseOfGrain, textureOfGrain
|
integer(pInt), dimension (:), allocatable :: phaseOfGrain, textureOfGrain
|
||||||
integer(pInt) t,e,i,g,j,m,homog,micro,sgn,loopStart,loopEnd
|
integer(pInt) t,e,i,g,j,m,homog,micro,sgn,hme
|
||||||
integer(pInt) phaseID,textureID,dGrains,myNgrains,myNorientations, &
|
integer(pInt) phaseID,textureID,dGrains,myNgrains,myNorientations, &
|
||||||
grain,constituentGrain,symExtension, counter_cpElemsindex
|
grain,constituentGrain,symExtension
|
||||||
real(pReal) extreme,rnd
|
real(pReal) extreme,rnd
|
||||||
integer(pInt), dimension (:,:), allocatable :: NcpElemscounter ! counts number of elements in homog, micro array
|
integer(pInt), dimension (:,:), allocatable :: Nelems ! counts number of elements in homog, micro array
|
||||||
integer(pInt), dimension (:,:,:), allocatable :: cpElemsindex ! lists element number in homog, micro array
|
integer(pInt), dimension (:,:,:), allocatable :: elemsOfHomogMicro ! lists element number in homog, micro array
|
||||||
|
|
||||||
|
|
||||||
allocate(material_volume(homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems)) ; material_volume = 0.0_pReal
|
allocate(material_volume(homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems)) ; material_volume = 0.0_pReal
|
||||||
|
@ -624,19 +624,21 @@ subroutine material_populateGrains()
|
||||||
allocate(material_EulerAngles(3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems)) ; material_EulerAngles = 0.0_pReal
|
allocate(material_EulerAngles(3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems)) ; material_EulerAngles = 0.0_pReal
|
||||||
|
|
||||||
allocate(Ngrains(material_Nhomogenization,material_Nmicrostructure)); Ngrains = 0_pInt
|
allocate(Ngrains(material_Nhomogenization,material_Nmicrostructure)); Ngrains = 0_pInt
|
||||||
|
allocate(Nelems(material_Nhomogenization,material_Nmicrostructure)); Nelems = 0_pInt
|
||||||
|
|
||||||
allocate(NcpElemscounter(material_Nhomogenization,material_Nmicrostructure)); NcpElemscounter = &
|
! precounting of elements for each homog/micro pair
|
||||||
0_pInt
|
|
||||||
|
|
||||||
! identify maximum grain count per IP (from element) and find grains per homog/micro pair
|
|
||||||
do e = 1, mesh_NcpElems
|
do e = 1, mesh_NcpElems
|
||||||
NcpElemscounter(homog,micro) = NcpElemscounter(homog,micro) + 1_pInt
|
homog = mesh_element(3,e)
|
||||||
|
micro = mesh_element(4,e)
|
||||||
|
Nelems(homog,micro) = Nelems(homog,micro) + 1_pInt
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
allocate(cpElemsindex(material_Nhomogenization,material_Nmicrostructure,maxval(NcpElemscounter)))
|
allocate(elemsOfHomogMicro(maxval(Nelems),material_Nhomogenization,material_Nmicrostructure))
|
||||||
cpElemsindex = 0_pInt
|
elemsOfHomogMicro = 0_pInt
|
||||||
|
|
||||||
counter_cpElemsindex = 0_pInt
|
Nelems = 0_pInt ! reuse as counter
|
||||||
|
|
||||||
|
! identify maximum grain count per IP (from element) and find grains per homog/micro pair
|
||||||
do e = 1,mesh_NcpElems
|
do e = 1,mesh_NcpElems
|
||||||
homog = mesh_element(3,e)
|
homog = mesh_element(3,e)
|
||||||
micro = mesh_element(4,e)
|
micro = mesh_element(4,e)
|
||||||
|
@ -650,8 +652,8 @@ subroutine material_populateGrains()
|
||||||
dGrains = homogenization_Ngrains(homog) * FE_Nips(mesh_element(2,e))
|
dGrains = homogenization_Ngrains(homog) * FE_Nips(mesh_element(2,e))
|
||||||
endif
|
endif
|
||||||
Ngrains(homog,micro) = Ngrains(homog,micro) + dGrains
|
Ngrains(homog,micro) = Ngrains(homog,micro) + dGrains
|
||||||
counter_cpElemsindex = counter_cpElemsindex + 1_pInt
|
Nelems(homog,micro) = Nelems(homog,micro) + 1_pInt
|
||||||
cpElemsindex(homog,micro,counter_cpElemsindex) = e ! populate arrays
|
elemsOfHomogMicro(Nelems(homog,micro),homog,micro) = e ! remember elements active in this homog/micro pair
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -683,8 +685,8 @@ subroutine material_populateGrains()
|
||||||
! ---------------------------------------------------------------------------- calculate volume of each grain
|
! ---------------------------------------------------------------------------- calculate volume of each grain
|
||||||
volumeOfGrain = 0.0_pReal
|
volumeOfGrain = 0.0_pReal
|
||||||
grain = 0_pInt
|
grain = 0_pInt
|
||||||
do counter_cpElemsindex = 1, NcpElemscounter(homog,micro)
|
do hme = 1_pInt, Nelems(homog,micro)
|
||||||
e = cpElemsindex(homog,micro,counter_cpElemsindex) ! my combination of homog and micro, only perform calculations for elements with homog, micro combinations which is indexed in cpElemsindex
|
e = elemsOfHomogMicro(hme,homog,micro) ! my combination of homog and micro, only perform calculations for elements with homog, micro combinations which is indexed in cpElemsindex
|
||||||
if (microstructure_elemhomo(micro)) then ! homogeneous distribution of grains over each element's IPs
|
if (microstructure_elemhomo(micro)) then ! homogeneous distribution of grains over each element's IPs
|
||||||
volumeOfGrain(grain+1:grain+dGrains) = sum(mesh_ipVolume(1:FE_Nips(mesh_element(2,e)),e))/dGrains
|
volumeOfGrain(grain+1:grain+dGrains) = sum(mesh_ipVolume(1:FE_Nips(mesh_element(2,e)),e))/dGrains
|
||||||
grain = grain + dGrains ! wind forward by NgrainsPerIP
|
grain = grain + dGrains ! wind forward by NgrainsPerIP
|
||||||
|
@ -800,8 +802,8 @@ subroutine material_populateGrains()
|
||||||
|
|
||||||
! ----------------------------------------------------------------------------
|
! ----------------------------------------------------------------------------
|
||||||
grain = 0_pInt
|
grain = 0_pInt
|
||||||
do counter_cpElemsindex = 1, NcpElemscounter(homog,micro)
|
do hme = 1_pInt, Nelems(homog,micro)
|
||||||
e = cpElemsindex(homog,micro,counter_cpElemsindex) ! only perform calculations for elements with homog, micro combinations which is indexed in cpElemsindex
|
e = elemsOfHomogMicro(hme,homog,micro) ! only perform calculations for elements with homog, micro combinations which is indexed in cpElemsindex
|
||||||
if (microstructure_elemhomo(micro)) then ! homogeneous distribution of grains over each element's IPs
|
if (microstructure_elemhomo(micro)) then ! homogeneous distribution of grains over each element's IPs
|
||||||
forall (i = 1:FE_Nips(mesh_element(2,e)), g = 1:dGrains) ! loop over IPs and grains
|
forall (i = 1:FE_Nips(mesh_element(2,e)), g = 1:dGrains) ! loop over IPs and grains
|
||||||
material_volume(g,i,e) = volumeOfGrain(grain+g)
|
material_volume(g,i,e) = volumeOfGrain(grain+g)
|
||||||
|
@ -829,8 +831,8 @@ subroutine material_populateGrains()
|
||||||
deallocate(phaseOfGrain)
|
deallocate(phaseOfGrain)
|
||||||
deallocate(textureOfGrain)
|
deallocate(textureOfGrain)
|
||||||
deallocate(orientationOfGrain)
|
deallocate(orientationOfGrain)
|
||||||
deallocate(cpElemsindex)
|
deallocate(Nelems)
|
||||||
deallocate(NcpElemscounter)
|
deallocate(elemsOfHomogMicro)
|
||||||
|
|
||||||
endsubroutine
|
endsubroutine
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue