most IO related variables not needed any more in material

This commit is contained in:
Martin Diehl 2018-06-10 18:38:31 +02:00
parent 91d9c11612
commit a1fdbd1d5e
3 changed files with 46 additions and 112 deletions

View File

@ -27,6 +27,8 @@ subroutine CPFEM_initAll(el,ip)
numerics_init numerics_init
use debug, only: & use debug, only: &
debug_init debug_init
use config_material, only: &
config_material_init
use FEsolving, only: & use FEsolving, only: &
FE_init FE_init
use math, only: & use math, only: &
@ -64,6 +66,7 @@ subroutine CPFEM_initAll(el,ip)
#endif #endif
call numerics_init call numerics_init
call debug_init call debug_init
call config_material_init
call math_init call math_init
call FE_init call FE_init
call mesh_init(ip, el) ! pass on coordinates to alter calcMode of first ip call mesh_init(ip, el) ! pass on coordinates to alter calcMode of first ip

View File

@ -10,27 +10,32 @@ module config_material
use prec, only: & use prec, only: &
pReal, & pReal, &
pInt pInt
implicit none implicit none
!private private
type(tPartitionedStringList), public, protected, allocatable, dimension(:) :: & type(tPartitionedStringList), public, protected, allocatable, dimension(:) :: &
phaseConfig, & phaseConfig, &
microstructureConfig, & microstructureConfig, &
homogenizationConfig, & homogenizationConfig, &
textureConfig, & textureConfig, &
crystalliteConfig crystalliteConfig
character(len=64), dimension(:), allocatable, public, protected :: & character(len=64), dimension(:), allocatable, public, protected :: &
phase_name, & !< name of each phase phase_name, & !< name of each phase
homogenization_name, & !< name of each homogenization homogenization_name, & !< name of each homogenization
crystallite_name, & !< name of each crystallite setting crystallite_name, & !< name of each crystallite setting
microstructure_name, & !< name of each microstructure microstructure_name, & !< name of each microstructure
texture_name !< name of each texture texture_name !< name of each texture
! ToDo: make private, no one needs to know that
character(len=*), parameter, public :: & character(len=*), parameter, public :: &
MATERIAL_partHomogenization = 'homogenization', & !< keyword for homogenization part MATERIAL_partHomogenization = 'homogenization', & !< keyword for homogenization part
MATERIAL_partCrystallite = 'crystallite', & !< keyword for crystallite part MATERIAL_partCrystallite = 'crystallite', & !< keyword for crystallite part
MATERIAL_partPhase = 'phase',& !< keyword for phase part MATERIAL_partPhase = 'phase', & !< keyword for phase part
MATERIAL_partMicrostructure = 'microstructure', & !< keyword for microstructure part MATERIAL_partMicrostructure = 'microstructure', & !< keyword for microstructure part
MATERIAL_partTexture = 'texture' !< keyword for texture part MATERIAL_partTexture = 'texture' !< keyword for texture part
! ToDo: Remove, use size(phaseConfig) etc
integer(pInt), public, protected :: & integer(pInt), public, protected :: &
material_Ntexture, & !< number of textures material_Ntexture, & !< number of textures
material_Nphase, & !< number of phases material_Nphase, & !< number of phases
@ -38,10 +43,13 @@ module config_material
material_Nmicrostructure, & !< number of microstructures material_Nmicrostructure, & !< number of microstructures
material_Ncrystallite !< number of crystallite settings material_Ncrystallite !< number of crystallite settings
! ToDo: make private, no one needs to know that
character(len=*), parameter, public :: & character(len=*), parameter, public :: &
MATERIAL_configFile = 'material.config', & !< generic name for material configuration file MATERIAL_configFile = 'material.config', & !< generic name for material configuration file
MATERIAL_localFileExt = 'materialConfig' !< extension of solver job name depending material configuration file MATERIAL_localFileExt = 'materialConfig' !< extension of solver job name depending material configuration file
public :: config_material_init
contains contains
subroutine config_material_init() subroutine config_material_init()
@ -66,18 +74,11 @@ subroutine config_material_init()
implicit none implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt), parameter :: FILEUNIT = 200_pInt
integer(pInt) :: m,c,h, myDebug, myPhase, myHomog integer(pInt) :: myDebug
integer(pInt) :: &
g, & !< grain number
i, & !< integration point number
e, & !< element number
phase
integer(pInt), dimension(:), allocatable :: ConstitutivePosition
integer(pInt), dimension(:), allocatable :: CrystallitePosition
integer(pInt), dimension(:), allocatable :: HomogenizationPosition
character(len=65536) :: & character(len=65536) :: &
line,part line, &
part
myDebug = debug_level(debug_material) myDebug = debug_level(debug_material)
@ -158,7 +159,7 @@ subroutine parseFile(sectionNames,part,fileUnit,line)
character(len=65536),intent(out) :: line character(len=65536),intent(out) :: line
integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: Nsections, s integer(pInt) :: s
character(len=65536) :: devNull character(len=65536) :: devNull
character(len=64) :: tag character(len=64) :: tag
logical :: echo logical :: echo
@ -192,6 +193,11 @@ subroutine parseFile(sectionNames,part,fileUnit,line)
endif inSection endif inSection
enddo enddo
if (echo) then
do s = 1, size(sectionNames)
call part(s)%show()
end do
end if
end subroutine parseFile end subroutine parseFile
end module config_material end module config_material

View File

@ -346,13 +346,7 @@ subroutine material_init()
#endif #endif
use IO, only: & use IO, only: &
IO_error, & IO_error, &
IO_open_file, & IO_timeStamp
IO_read, &
IO_lc, &
IO_open_jobFile_stat, &
IO_getTag, &
IO_timeStamp, &
IO_EOF
use debug, only: & use debug, only: &
debug_level, & debug_level, &
debug_material, & debug_material, &
@ -377,9 +371,6 @@ subroutine material_init()
integer(pInt), dimension(:), allocatable :: CrystallitePosition integer(pInt), dimension(:), allocatable :: CrystallitePosition
integer(pInt), dimension(:), allocatable :: HomogenizationPosition integer(pInt), dimension(:), allocatable :: HomogenizationPosition
character(len=65536) :: &
line,part
myDebug = debug_level(debug_material) myDebug = debug_level(debug_material)
write(6,'(/,a)') ' <<<+- material init -+>>>' write(6,'(/,a)') ' <<<+- material init -+>>>'
@ -520,30 +511,16 @@ subroutine material_parseHomogenization
use config_material, only : & use config_material, only : &
homogenizationConfig homogenizationConfig
use IO, only: & use IO, only: &
IO_read, &
IO_globalTagInPart, &
IO_countSections, &
IO_error, & IO_error, &
IO_countTagInPart, &
IO_lc, &
IO_getTag, &
IO_isBlank, &
IO_stringValue, & IO_stringValue, &
IO_intValue, & IO_intValue, &
IO_floatValue, & IO_floatValue
IO_stringPos, &
IO_EOF
use mesh, only: & use mesh, only: &
mesh_element mesh_element
implicit none implicit none
integer(pInt) :: h
character(len=65536) :: tag
integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: Nsections, h
character(len=65536) :: line, tag,devNull
character(len=64) :: tag2
logical :: echo
allocate(homogenization_type(material_Nhomogenization), source=HOMOGENIZATION_undefined_ID) allocate(homogenization_type(material_Nhomogenization), source=HOMOGENIZATION_undefined_ID)
allocate(thermal_type(material_Nhomogenization), source=THERMAL_isothermal_ID) allocate(thermal_type(material_Nhomogenization), source=THERMAL_isothermal_ID)
@ -690,17 +667,13 @@ subroutine material_parseMicrostructure
implicit none implicit none
character(len=256), dimension(:), allocatable :: & character(len=256), dimension(:), allocatable :: &
str str
character(len=64) :: tag2
integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt), allocatable, dimension(:,:) :: chunkPoss integer(pInt), allocatable, dimension(:,:) :: chunkPoss
integer(pInt) :: e, m, constituent, i integer(pInt) :: e, m, constituent, i
character(len=65536) :: & character(len=65536) :: &
tag,line,devNull tag,line
logical :: echo
line = '' ! to have it initialized line = '' ! to have it initialized
m = 0_pInt m = 0_pInt
echo =.false.
allocate(microstructure_crystallite(material_Nmicrostructure), source=0_pInt) allocate(microstructure_crystallite(material_Nmicrostructure), source=0_pInt)
@ -728,7 +701,7 @@ subroutine material_parseMicrostructure
call microstructureConfig(m)%getRaws('(constituent)',str,chunkPoss) call microstructureConfig(m)%getRaws('(constituent)',str,chunkPoss)
do constituent = 1_pInt, size(str) do constituent = 1_pInt, size(str)
do i = 2_pInt,6_pInt,2_pInt do i = 2_pInt,6_pInt,2_pInt
tag = IO_lc(IO_stringValue(str(constituent),chunkPoss(:,constituent),i)) tag = IO_stringValue(str(constituent),chunkPoss(:,constituent),i)
select case (tag) select case (tag)
case('phase') case('phase')
@ -757,25 +730,11 @@ end subroutine material_parseMicrostructure
!> @brief parses the crystallite part in the material configuration file !> @brief parses the crystallite part in the material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseCrystallite subroutine material_parseCrystallite
use IO, only: &
IO_read, &
IO_error, &
IO_getTag, &
IO_lc, &
IO_stringPos, &
IO_stringValue, &
IO_isBlank, &
IO_EOF
implicit none implicit none
integer(pInt), allocatable, dimension(:) :: chunkPos
character(len=64) :: tag2
integer(pInt) :: c integer(pInt) :: c
character(len=65536) :: line, tag,devNull
logical :: echo
allocate(crystallite_Noutput(material_Ncrystallite), source=0_pInt) allocate(crystallite_Noutput(material_Ncrystallite),source=0_pInt)
do c=1_pInt, material_Ncrystallite do c=1_pInt, material_Ncrystallite
crystallite_Noutput(c) = crystalliteConfig(c)%countKeys('(output)') crystallite_Noutput(c) = crystalliteConfig(c)%countKeys('(output)')
enddo enddo
@ -788,34 +747,14 @@ end subroutine material_parseCrystallite
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parsePhase subroutine material_parsePhase
use IO, only: & use IO, only: &
IO_read, &
IO_globalTagInPart, &
IO_countSections, &
IO_error, & IO_error, &
IO_countTagInPart, &
IO_getTag, & IO_getTag, &
IO_spotTagInPart, & IO_stringValue
IO_lc, &
IO_isBlank, &
IO_stringValue, &
IO_stringPos, &
IO_EOF
implicit none implicit none
integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: sourceCtr, kinematicsCtr, stiffDegradationCtr, p integer(pInt) :: sourceCtr, kinematicsCtr, stiffDegradationCtr, p
character(len=65536) :: & character(len=256), dimension(:), allocatable :: str
tag,line,devNull
character(len=64) :: tag2
character(len=64), dimension(:), allocatable :: &
str
logical :: echo
line = '' ! to have it initialized
p = 0_pInt ! - " -
echo =.false.
allocate(phase_elasticity(material_Nphase),source=ELASTICITY_undefined_ID) allocate(phase_elasticity(material_Nphase),source=ELASTICITY_undefined_ID)
allocate(phase_plasticity(material_Nphase),source=PLASTICITY_undefined_ID) allocate(phase_plasticity(material_Nphase),source=PLASTICITY_undefined_ID)
@ -937,19 +876,10 @@ subroutine material_parseTexture
use prec, only: & use prec, only: &
dNeq dNeq
use IO, only: & use IO, only: &
IO_read, &
IO_globalTagInPart, &
IO_countSections, &
IO_error, & IO_error, &
IO_countTagInPart, &
IO_getTag, &
IO_spotTagInPart, &
IO_lc, &
IO_isBlank, &
IO_floatValue, &
IO_stringValue, &
IO_stringPos, & IO_stringPos, &
IO_EOF IO_floatValue, &
IO_stringValue
use math, only: & use math, only: &
inRad, & inRad, &
math_sampleRandomOri, & math_sampleRandomOri, &
@ -958,20 +888,15 @@ subroutine material_parseTexture
math_inv33 math_inv33
implicit none implicit none
integer(pInt) :: section, gauss, fiber, j, t, i
integer(pInt), allocatable, dimension(:) :: chunkPos
integer(pInt) :: Nsections, section, gauss, fiber, j, t, i
character(len=64) :: tag2
character(len=256), dimension(:), allocatable :: bla character(len=256), dimension(:), allocatable :: bla
logical :: echo integer(pInt), dimension(:), allocatable :: chunkPos
character(len=65536) :: line, tag
character(len=65536) :: line, tag,devNull, line2 allocate(texture_ODFfile(material_Ntexture)); texture_ODFfile=''
allocate(texture_symmetry(material_Ntexture), source=1_pInt)
allocate(texture_ODFfile(material_Ntexture)); texture_ODFfile='' allocate(texture_Ngauss(material_Ntexture), source=0_pInt)
allocate(texture_symmetry(material_Ntexture), source=1_pInt) allocate(texture_Nfiber(material_Ntexture), source=0_pInt)
allocate(texture_Ngauss(material_Ntexture), source=0_pInt)
allocate(texture_Nfiber(material_Ntexture), source=0_pInt)
do t=1_pInt, material_Ntexture do t=1_pInt, material_Ntexture
texture_Ngauss(t) = textureConfig(t)%countKeys('(gauss)') & texture_Ngauss(t) = textureConfig(t)%countKeys('(gauss)') &
@ -996,12 +921,12 @@ subroutine material_parseTexture
line = bla(i) line = bla(i)
chunkPos = IO_stringPos(line) chunkPos = IO_stringPos(line)
tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key tag = IO_stringValue(line,chunkPos,1_pInt) ! extract key
textureType: select case(tag) textureType: select case(tag)
case ('axes', 'rotation') textureType 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_lc(IO_stringValue(line,chunkPos,j+1_pInt)) tag = IO_stringValue(line,chunkPos,j+1_pInt)
select case (tag) select case (tag)
case('x', '+x') case('x', '+x')
texture_transformation(j,1:3,section) = [ 1.0_pReal, 0.0_pReal, 0.0_pReal] ! original axis is now +x-axis texture_transformation(j,1:3,section) = [ 1.0_pReal, 0.0_pReal, 0.0_pReal] ! original axis is now +x-axis
@ -1027,7 +952,7 @@ subroutine material_parseTexture
texture_ODFfile(section) = IO_stringValue(line,chunkPos,2_pInt) texture_ODFfile(section) = IO_stringValue(line,chunkPos,2_pInt)
case ('symmetry') textureType case ('symmetry') textureType
tag = IO_lc(IO_stringValue(line,chunkPos,2_pInt)) tag = IO_stringValue(line,chunkPos,2_pInt)
select case (tag) select case (tag)
case('orthotropic') case('orthotropic')
texture_symmetry(section) = 4_pInt texture_symmetry(section) = 4_pInt
@ -1041,7 +966,7 @@ subroutine material_parseTexture
gauss = gauss + 1_pInt gauss = gauss + 1_pInt
texture_Gauss(1:3,gauss,section) = math_sampleRandomOri() texture_Gauss(1:3,gauss,section) = math_sampleRandomOri()
do j = 2_pInt,4_pInt,2_pInt do j = 2_pInt,4_pInt,2_pInt
tag = IO_lc(IO_stringValue(line,chunkPos,j)) tag = IO_stringValue(line,chunkPos,j)
select case (tag) select case (tag)
case('scatter') case('scatter')
texture_Gauss(4,gauss,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad texture_Gauss(4,gauss,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad
@ -1053,7 +978,7 @@ subroutine material_parseTexture
case ('(gauss)') textureType case ('(gauss)') textureType
gauss = gauss + 1_pInt gauss = gauss + 1_pInt
do j = 2_pInt,10_pInt,2_pInt do j = 2_pInt,10_pInt,2_pInt
tag = IO_lc(IO_stringValue(line,chunkPos,j)) tag = IO_stringValue(line,chunkPos,j)
select case (tag) select case (tag)
case('phi1') case('phi1')
texture_Gauss(1,gauss,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad texture_Gauss(1,gauss,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad
@ -1071,7 +996,7 @@ subroutine material_parseTexture
case ('(fiber)') textureType case ('(fiber)') textureType
fiber = fiber + 1_pInt fiber = fiber + 1_pInt
do j = 2_pInt,12_pInt,2_pInt do j = 2_pInt,12_pInt,2_pInt
tag = IO_lc(IO_stringValue(line,chunkPos,j)) tag = IO_stringValue(line,chunkPos,j)
select case (tag) select case (tag)
case('alpha1') case('alpha1')
texture_Fiber(1,fiber,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad texture_Fiber(1,fiber,section) = IO_floatValue(line,chunkPos,j+1_pInt)*inRad