simplifying

This commit is contained in:
Martin Diehl 2019-06-07 13:47:38 +02:00
parent c8f3808dab
commit a6c0f500ff
1 changed files with 56 additions and 60 deletions

View File

@ -172,10 +172,10 @@ module material
microstructure_texture !< texture IDs of each microstructure
real(pReal), dimension(:,:), allocatable, private :: &
texture_Gauss, & !< data of each Gauss component
microstructure_fraction !< vol fraction of each constituent in microstructure
real(pReal), dimension(:,:,:), allocatable, private :: &
texture_Gauss, & !< data of each Gauss component
texture_transformation !< transformation for each texture
logical, dimension(:), allocatable, private :: &
@ -707,7 +707,7 @@ end subroutine material_parsePhase
!--------------------------------------------------------------------------------------------------
subroutine material_parseTexture
integer :: section, gauss, j, t, i
integer :: section, j, t, i
character(len=65536), dimension(:), allocatable :: strings ! Values for given key in material config
integer, dimension(:), allocatable :: chunkPos
@ -719,13 +719,12 @@ subroutine material_parseTexture
if (config_texture(t)%keyExists('(fiber)')) call IO_error(147,ext_msg='(fiber)')
enddo
allocate(texture_Gauss (5,1,size(config_texture)), source=0.0_pReal)
allocate(texture_Gauss (5,size(config_texture)), source=0.0_pReal)
allocate(texture_transformation(3,3,size(config_texture)), source=0.0_pReal)
texture_transformation = spread(math_I3,3,size(config_texture))
do t=1, size(config_texture)
section = t
gauss = 0
if (config_texture(t)%keyExists('axes')) then
strings = config_texture(t)%getStrings('axes')
@ -750,23 +749,20 @@ subroutine material_parseTexture
if(dNeq(math_det33(texture_transformation(1:3,1:3,t)),1.0_pReal)) call IO_error(157,t)
endif
if (config_texture(t)%keyExists('(gauss)')) then
gauss = gauss + 1
strings = config_texture(t)%getStrings('(gauss)',raw= .true.)
do i = 1 , size(strings)
chunkPos = IO_stringPos(strings(i))
do j = 1,9,2
select case (IO_stringValue(strings(i),chunkPos,j))
case('phi1')
texture_Gauss(1,gauss,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
texture_Gauss(1,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
case('phi')
texture_Gauss(2,gauss,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
texture_Gauss(2,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
case('phi2')
texture_Gauss(3,gauss,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
texture_Gauss(3,t) = IO_floatValue(strings(i),chunkPos,j+1)*inRad
end select
enddo
enddo
endif
enddo
call config_deallocate('material.config/texture')
@ -878,7 +874,7 @@ subroutine material_populateGrains
do c = 1, homogenization_Ngrains(homog)
material_phase(c,i,e) = microstructure_phase(c,micro)
material_texture(c,i,e) = microstructure_texture(c,micro)
material_EulerAngles(1:3,c,i,e) = texture_Gauss(1:3,1,material_texture(c,i,e))
material_EulerAngles(1:3,c,i,e) = texture_Gauss(1:3,material_texture(c,i,e))
material_EulerAngles(1:3,c,i,e) = math_RtoEuler( & ! translate back to Euler angles
matmul( & ! pre-multiply
math_EulertoR(material_EulerAngles(1:3,c,i,e)), & ! face-value orientation