first step to get rid off getStringsRaw

This commit is contained in:
Martin Diehl 2018-06-19 19:16:03 +02:00
parent fc54104599
commit efd2eae63e
1 changed files with 55 additions and 51 deletions

View File

@ -922,18 +922,11 @@ subroutine material_parseTexture
section = t section = t
gauss = 0_pInt gauss = 0_pInt
fiber = 0_pInt fiber = 0_pInt
lines = textureConfig(t)%getStringsRaw()
do i=1_pInt, size(lines) if (textureConfig(t)%keyExists('axes')) then
lines = textureConfig(t)%getStrings('axes')
chunkPos = IO_stringPos(lines(i))
tag = IO_stringValue(lines(i),chunkPos,1_pInt) ! extract key
textureType: select case(tag)
case ('axes', 'rotation') textureType
do j = 1_pInt, 3_pInt ! look for "x", "y", and "z" entries do j = 1_pInt, 3_pInt ! look for "x", "y", and "z" entries
tag = IO_stringValue(lines(i),chunkPos,j+1_pInt) select case (lines(j))
select case (tag)
case('x', '+x') case('x', '+x')
texture_transformation(j,1:3,t) = [ 1.0_pReal, 0.0_pReal, 0.0_pReal] ! original axis is now +x-axis texture_transformation(j,1:3,t) = [ 1.0_pReal, 0.0_pReal, 0.0_pReal] ! original axis is now +x-axis
case('-x') case('-x')
@ -950,16 +943,14 @@ subroutine material_parseTexture
call IO_error(157_pInt,t) call IO_error(157_pInt,t)
end select end select
enddo enddo
if(dNeq(math_det33(texture_transformation(1:3,1:3,t)),1.0_pReal)) call IO_error(157_pInt,t)
endif
if(dNeq(math_det33(texture_transformation(1:3,1:3,t)),1.0_pReal)) & tag=''
call IO_error(157_pInt,t) texture_ODFfile(t) = textureConfig(t)%getString('hybridia',defaultVal=tag)
case ('hybridia') textureType if (textureConfig(t)%keyExists('symmetry')) then
texture_ODFfile(t) = IO_stringValue(lines(i),chunkPos,2_pInt) select case (textureConfig(t)%getString('symmetry'))
case ('symmetry') textureType
tag = IO_stringValue(lines(i),chunkPos,2_pInt)
select case (tag)
case('orthotropic') case('orthotropic')
texture_symmetry(t) = 4_pInt texture_symmetry(t) = 4_pInt
case('monoclinic') case('monoclinic')
@ -967,19 +958,32 @@ subroutine material_parseTexture
case default case default
texture_symmetry(t) = 1_pInt texture_symmetry(t) = 1_pInt
end select end select
endif
case ('(random)') textureType if (textureConfig(t)%keyExists('(random)')) then
lines = textureConfig(t)%getStrings('(random)',raw=.true.)
do i = 1_pInt, size(lines)
gauss = gauss + 1_pInt gauss = gauss + 1_pInt
texture_Gauss(1:3,gauss,t) = math_sampleRandomOri() texture_Gauss(1:3,gauss,t) = math_sampleRandomOri()
do j = 2_pInt,4_pInt,2_pInt chunkPos = IO_stringPos(lines(i))
tag = IO_stringValue(lines(i),chunkPos,j) do j = 1_pInt,3_pInt,2_pInt
select case (tag) select case (IO_stringValue(lines(i),chunkPos,j))
case('scatter') case('scatter')
texture_Gauss(4,gauss,t) = IO_floatValue(lines(i),chunkPos,j+1_pInt)*inRad texture_Gauss(4,gauss,t) = IO_floatValue(lines(i),chunkPos,j+1_pInt)*inRad
case('fraction') case('fraction')
texture_Gauss(5,gauss,t) = IO_floatValue(lines(i),chunkPos,j+1_pInt) texture_Gauss(5,gauss,t) = IO_floatValue(lines(i),chunkPos,j+1_pInt)
end select end select
enddo enddo
enddo
endif
lines = textureConfig(t)%getStringsRaw()
do i=1_pInt, size(lines)
chunkPos = IO_stringPos(lines(i))
tag = IO_stringValue(lines(i),chunkPos,1_pInt) ! extract key
textureType: select case(tag)
case ('(gauss)') textureType case ('(gauss)') textureType
gauss = gauss + 1_pInt gauss = gauss + 1_pInt