now with functionality to output a "JOB.outputHomogenization". This contains size descriptions of all requested output variables to be parsed by a further script to generate meaningful names for user defined vars... (watch out!)
This commit is contained in:
parent
aab5598d96
commit
7526a24a1b
|
@ -55,7 +55,7 @@ CONTAINS
|
|||
subroutine homogenization_init(Temperature)
|
||||
use prec, only: pReal,pInt
|
||||
use math, only: math_I3
|
||||
use IO, only: IO_error, IO_open_file
|
||||
use IO, only: IO_error, IO_open_file, IO_open_jobFile
|
||||
use mesh, only: mesh_maxNips,mesh_NcpElems,mesh_element,FE_Nips
|
||||
use material
|
||||
use constitutive, only: constitutive_maxSizePostResults
|
||||
|
@ -65,7 +65,10 @@ subroutine homogenization_init(Temperature)
|
|||
|
||||
real(pReal) Temperature
|
||||
integer(pInt), parameter :: fileunit = 200
|
||||
integer(pInt) e,i,g,myInstance,j
|
||||
integer(pInt) e,i,g,p,myInstance,j
|
||||
integer(pInt), dimension(:,:), pointer :: thisSize
|
||||
character(len=64), dimension(:,:), pointer :: thisOutput
|
||||
logical knownHomogenization
|
||||
|
||||
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file
|
||||
|
||||
|
@ -74,6 +77,38 @@ subroutine homogenization_init(Temperature)
|
|||
|
||||
close(fileunit)
|
||||
|
||||
! write description file for homogenization output
|
||||
|
||||
if(.not. IO_open_jobFile(fileunit,'outputHomogenization')) call IO_error (50) ! problems in writing file
|
||||
|
||||
do p = 1,material_Nhomogenization
|
||||
i = homogenization_typeInstance(p) ! which instance of this homogenization type
|
||||
knownHomogenization = .true. ! assume valid
|
||||
select case(homogenization_type(p)) ! split per homogenization type
|
||||
case (homogenization_isostrain_label)
|
||||
thisOutput => homogenization_isostrain_output
|
||||
thisSize => homogenization_isostrain_sizePostResult
|
||||
case (homogenization_RGC_label)
|
||||
thisOutput => homogenization_RGC_output
|
||||
thisSize => homogenization_RGC_sizePostResult
|
||||
case default
|
||||
knownHomogenization = .false.
|
||||
end select
|
||||
|
||||
write(fileunit,*)
|
||||
write(fileunit,'(a)') '['//trim(homogenization_name(p))//']'
|
||||
write(fileunit,*)
|
||||
if (knownHomogenization) then
|
||||
write(fileunit,'(a)') '#'//char(9)//'homogenization'//char(9)//trim(homogenization_type(p))
|
||||
do e = 1,homogenization_Noutput(p)
|
||||
write(fileunit,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i)
|
||||
enddo
|
||||
endif
|
||||
enddo
|
||||
|
||||
close(fileunit)
|
||||
|
||||
|
||||
allocate(homogenization_state0(mesh_maxNips,mesh_NcpElems))
|
||||
allocate(homogenization_subState0(mesh_maxNips,mesh_NcpElems))
|
||||
allocate(homogenization_state(mesh_maxNips,mesh_NcpElems))
|
||||
|
|
|
@ -20,12 +20,13 @@ MODULE homogenization_RGC
|
|||
|
||||
integer(pInt), dimension(:), allocatable :: homogenization_RGC_sizeState, &
|
||||
homogenization_RGC_sizePostResults
|
||||
integer(pInt), dimension(:,:), allocatable,target :: homogenization_RGC_sizePostResult
|
||||
integer(pInt), dimension(:,:), allocatable :: homogenization_RGC_Ngrains
|
||||
real(pReal), dimension(:,:), allocatable :: homogenization_RGC_xiAlpha, &
|
||||
homogenization_RGC_ciAlpha
|
||||
real(pReal), dimension(:), allocatable :: homogenization_RGC_maxVol0, &
|
||||
homogenization_RGC_vPower0
|
||||
character(len=64), dimension(:,:), allocatable :: homogenization_RGC_output
|
||||
character(len=64), dimension(:,:), allocatable,target :: homogenization_RGC_output ! name of each post result output
|
||||
|
||||
CONTAINS
|
||||
!****************************************
|
||||
|
@ -53,7 +54,7 @@ subroutine homogenization_RGC_init(&
|
|||
integer(pInt), intent(in) :: file
|
||||
integer(pInt), parameter :: maxNchunks = 4
|
||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||
integer(pInt) section, maxNinstance, i,j,k,l, output
|
||||
integer(pInt) section, maxNinstance, i,j,k,l, output, mySize
|
||||
character(len=64) tag
|
||||
character(len=1024) line
|
||||
|
||||
|
@ -67,6 +68,8 @@ subroutine homogenization_RGC_init(&
|
|||
|
||||
allocate(homogenization_RGC_sizeState(maxNinstance)); homogenization_RGC_sizeState = 0_pInt
|
||||
allocate(homogenization_RGC_sizePostResults(maxNinstance)); homogenization_RGC_sizePostResults = 0_pInt
|
||||
allocate(homogenization_RGC_sizePostResult(maxval(homogenization_Noutput), &
|
||||
maxNinstance)); homogenization_RGC_sizePostResult = 0_pInt
|
||||
allocate(homogenization_RGC_Ngrains(3,maxNinstance)); homogenization_RGC_Ngrains = 0_pInt
|
||||
allocate(homogenization_RGC_ciAlpha(3,maxNinstance)); homogenization_RGC_ciAlpha = 0.0_pReal
|
||||
allocate(homogenization_RGC_xiAlpha(3,maxNinstance)); homogenization_RGC_xiAlpha = 0.0_pReal
|
||||
|
@ -125,20 +128,25 @@ subroutine homogenization_RGC_init(&
|
|||
do j = 1,maxval(homogenization_Noutput)
|
||||
select case(homogenization_RGC_output(j,i))
|
||||
case('constitutivework')
|
||||
homogenization_RGC_sizePostResults(i) = &
|
||||
homogenization_RGC_sizePostResults(i) + 1
|
||||
mySize = 1
|
||||
case('magnitudemismatch')
|
||||
homogenization_RGC_sizePostResults(i) = &
|
||||
homogenization_RGC_sizePostResults(i) + 1
|
||||
mySize = 1
|
||||
case('penaltyenergy')
|
||||
homogenization_RGC_sizePostResults(i) = &
|
||||
homogenization_RGC_sizePostResults(i) + 1
|
||||
mySize = 1
|
||||
case('volumediscrepancy')
|
||||
homogenization_RGC_sizePostResults(i) = &
|
||||
homogenization_RGC_sizePostResults(i) + 1
|
||||
mySize = 1
|
||||
case default
|
||||
mySize = 0
|
||||
end select
|
||||
|
||||
if (mySize > 0_pInt) then ! any meaningful output found
|
||||
homogenization_RGC_sizePostResult(j,i) = mySize
|
||||
homogenization_RGC_sizePostResults(i) = &
|
||||
homogenization_RGC_sizePostResults(i) + mySize
|
||||
endif
|
||||
enddo
|
||||
|
||||
|
||||
homogenization_RGC_sizeState(i) &
|
||||
= 3*(homogenization_RGC_Ngrains(1,i)-1)*homogenization_RGC_Ngrains(2,i)*homogenization_RGC_Ngrains(3,i) &
|
||||
+ 3*homogenization_RGC_Ngrains(1,i)*(homogenization_RGC_Ngrains(2,i)-1)*homogenization_RGC_Ngrains(3,i) &
|
||||
|
|
|
@ -19,9 +19,10 @@ MODULE homogenization_isostrain
|
|||
character (len=*), parameter :: homogenization_isostrain_label = 'isostrain'
|
||||
|
||||
integer(pInt), dimension(:), allocatable :: homogenization_isostrain_sizeState, &
|
||||
homogenization_isostrain_sizePostResults, &
|
||||
homogenization_isostrain_Ngrains
|
||||
character(len=64), dimension(:,:), allocatable :: homogenization_isostrain_output
|
||||
integer(pInt), dimension(:), allocatable :: homogenization_isostrain_sizePostResults
|
||||
integer(pInt), dimension(:,:), allocatable,target :: homogenization_isostrain_sizePostResult
|
||||
character(len=64), dimension(:,:), allocatable,target :: homogenization_isostrain_output ! name of each post result output
|
||||
|
||||
|
||||
CONTAINS
|
||||
|
@ -49,7 +50,7 @@ subroutine homogenization_isostrain_init(&
|
|||
integer(pInt), intent(in) :: file
|
||||
integer(pInt), parameter :: maxNchunks = 2
|
||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||
integer(pInt) section, maxNinstance, i,j,k,l, output
|
||||
integer(pInt) section, maxNinstance, i,j,k,l, output, mySize
|
||||
character(len=64) tag
|
||||
character(len=1024) line
|
||||
|
||||
|
@ -63,6 +64,8 @@ subroutine homogenization_isostrain_init(&
|
|||
|
||||
allocate(homogenization_isostrain_sizeState(maxNinstance)) ; homogenization_isostrain_sizeState = 0_pInt
|
||||
allocate(homogenization_isostrain_sizePostResults(maxNinstance)); homogenization_isostrain_sizePostResults = 0_pInt
|
||||
allocate(homogenization_isostrain_sizePostResult(maxval(homogenization_Noutput), &
|
||||
maxNinstance)); homogenization_isostrain_sizePostResult = 0_pInt
|
||||
allocate(homogenization_isostrain_Ngrains(maxNinstance)); homogenization_isostrain_Ngrains = 0_pInt
|
||||
allocate(homogenization_isostrain_output(maxval(homogenization_Noutput), &
|
||||
maxNinstance)) ; homogenization_isostrain_output = ''
|
||||
|
@ -106,9 +109,16 @@ subroutine homogenization_isostrain_init(&
|
|||
do j = 1,maxval(homogenization_Noutput)
|
||||
select case(homogenization_isostrain_output(j,i))
|
||||
case('ngrains')
|
||||
homogenization_isostrain_sizePostResults(i) = &
|
||||
homogenization_isostrain_sizePostResults(i) + 1
|
||||
mySize = 1
|
||||
case default
|
||||
mySize = 0
|
||||
end select
|
||||
|
||||
if (mySize > 0_pInt) then ! any meaningful output found
|
||||
homogenization_isostrain_sizePostResult(j,i) = mySize
|
||||
homogenization_isostrain_sizePostResults(i) = &
|
||||
homogenization_isostrain_sizePostResults(i) + mySize
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
||||
|
|
Loading…
Reference in New Issue