no crystallite output

This commit is contained in:
Martin Diehl 2019-11-24 09:46:46 +01:00
parent b937ed594b
commit e20477099e
2 changed files with 5 additions and 105 deletions

View File

@ -26,14 +26,6 @@ module crystallite
implicit none implicit none
private private
character(len=64), dimension(:,:), allocatable :: &
crystallite_output !< name of each post result output
integer, public, protected :: &
crystallite_maxSizePostResults !< description not available
integer, dimension(:), allocatable, public, protected :: &
crystallite_sizePostResults !< description not available
integer, dimension(:,:), allocatable :: &
crystallite_sizePostResult !< description not available
real(pReal), dimension(:,:,:), allocatable, public :: & real(pReal), dimension(:,:,:), allocatable, public :: &
crystallite_dt !< requested time increment of each grain crystallite_dt !< requested time increment of each grain
@ -199,13 +191,6 @@ subroutine crystallite_init
allocate(crystallite_requested(cMax,iMax,eMax), source=.false.) allocate(crystallite_requested(cMax,iMax,eMax), source=.false.)
allocate(crystallite_todo(cMax,iMax,eMax), source=.false.) allocate(crystallite_todo(cMax,iMax,eMax), source=.false.)
allocate(crystallite_converged(cMax,iMax,eMax), source=.true.) allocate(crystallite_converged(cMax,iMax,eMax), source=.true.)
allocate(crystallite_output(maxval(crystallite_Noutput), &
size(config_crystallite))) ; crystallite_output = ''
allocate(crystallite_outputID(maxval(crystallite_Noutput), &
size(config_crystallite)), source=undefined_ID)
allocate(crystallite_sizePostResults(size(config_crystallite)),source=0)
allocate(crystallite_sizePostResult(maxval(crystallite_Noutput), &
size(config_crystallite)), source=0)
num%subStepMinCryst = config_numerics%getFloat('substepmincryst', defaultVal=1.0e-3_pReal) num%subStepMinCryst = config_numerics%getFloat('substepmincryst', defaultVal=1.0e-3_pReal)
num%subStepSizeCryst = config_numerics%getFloat('substepsizecryst', defaultVal=0.25_pReal) num%subStepSizeCryst = config_numerics%getFloat('substepsizecryst', defaultVal=0.25_pReal)
@ -252,33 +237,6 @@ subroutine crystallite_init
integrateState => integrateStateRKCK45 integrateState => integrateStateRKCK45
end select end select
do c = 1, size(config_crystallite)
#if defined(__GFORTRAN__)
str = ['GfortranBug86277']
str = config_crystallite(c)%getStrings('(output)',defaultVal=str)
if (str(1) == 'GfortranBug86277') str = [character(len=65536)::]
#else
str = config_crystallite(c)%getStrings('(output)',defaultVal=[character(len=65536)::])
#endif
do o = 1, size(str)
crystallite_output(o,c) = str(o)
outputName: select case(str(o))
case ('orientation') outputName
crystallite_outputID(o,c) = orientation_ID
case ('defgrad','f') outputName ! ToDo: no alias (f only)
crystallite_outputID(o,c) = defgrad_ID
case ('fp') outputName
crystallite_outputID(o,c) = fp_ID
case ('p','firstpiola','1stpiola') outputName ! ToDo: no alias (p only)
crystallite_outputID(o,c) = p_ID
case default outputName
call IO_error(105,ext_msg=trim(str(o))//' (Crystallite)')
end select outputName
enddo
enddo
allocate(output_constituent(size(config_phase))) allocate(output_constituent(size(config_phase)))
do c = 1, size(config_phase) do c = 1, size(config_phase)
#if defined(__GFORTRAN__) #if defined(__GFORTRAN__)
@ -291,43 +249,13 @@ subroutine crystallite_init
#endif #endif
enddo enddo
do r = 1,size(config_crystallite)
do o = 1,crystallite_Noutput(r)
select case(crystallite_outputID(o,r))
case(orientation_ID)
mySize = 4
case(defgrad_ID,fp_ID,p_ID)
mySize = 9
case default
mySize = 0
end select
crystallite_sizePostResult(o,r) = mySize
crystallite_sizePostResults(r) = crystallite_sizePostResults(r) + mySize
enddo
enddo
crystallite_maxSizePostResults = &
maxval(crystallite_sizePostResults(microstructure_crystallite),microstructure_active)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! write description file for crystallite output ! write description file for crystallite output
if (worldrank == 0) then if (worldrank == 0) then
call IO_write_jobFile(FILEUNIT,'outputCrystallite') call IO_write_jobFile(FILEUNIT,'outputCrystallite')
write(FILEUNIT,'(/,a,/)') '[not supported anymore]'
do r = 1,size(config_crystallite)
if (any(microstructure_crystallite(discretization_microstructureAt) == r)) then
write(FILEUNIT,'(/,a,/)') '['//trim(config_name_crystallite(r))//']'
do o = 1,crystallite_Noutput(r)
write(FILEUNIT,'(a,i4)') trim(crystallite_output(o,r))//char(9),crystallite_sizePostResult(o,r)
enddo
endif
enddo
close(FILEUNIT) close(FILEUNIT)
endif endif
call config_deallocate('material.config/phase') call config_deallocate('material.config/phase')
call config_deallocate('material.config/crystallite') call config_deallocate('material.config/crystallite')
@ -831,49 +759,21 @@ function crystallite_postResults(ipc, ip, el)
ip, & !< integration point index ip, & !< integration point index
ipc !< grain index ipc !< grain index
real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(discretization_microstructureAt(el))) + & real(pReal), dimension(1+ &
1+plasticState(material_phaseAt(ipc,el))%sizePostResults + & 1+plasticState(material_phaseAt(ipc,el))%sizePostResults + &
sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: &
crystallite_postResults crystallite_postResults
integer :: & integer :: &
o, & o, &
c, & c, &
crystID, &
mySize, & mySize, &
n n
crystID = microstructure_crystallite(discretization_microstructureAt(el))
crystallite_postResults = 0.0_pReal crystallite_postResults = 0.0_pReal
crystallite_postResults(1) = real(crystallite_sizePostResults(crystID),pReal) ! header-like information (length) crystallite_postResults(1) = 0.0_pReal ! header-like information (length)
c = 1 c = 1
do o = 1,crystallite_Noutput(crystID)
mySize = 0
select case(crystallite_outputID(o,crystID))
case (orientation_ID)
mySize = 4
crystallite_postResults(c+1:c+mySize) = crystallite_orientation(ipc,ip,el)%asQuaternion()
! remark: tensor output is of the form 11,12,13, 21,22,23, 31,32,33
! thus row index i is slow, while column index j is fast. reminder: "row is slow"
case (defgrad_ID)
mySize = 9
crystallite_postResults(c+1:c+mySize) = &
reshape(transpose(crystallite_partionedF(1:3,1:3,ipc,ip,el)),[mySize])
case (fp_ID)
mySize = 9
crystallite_postResults(c+1:c+mySize) = &
reshape(transpose(crystallite_Fp(1:3,1:3,ipc,ip,el)),[mySize])
case (p_ID)
mySize = 9
crystallite_postResults(c+1:c+mySize) = &
reshape(transpose(crystallite_P(1:3,1:3,ipc,ip,el)),[mySize])
end select
c = c + mySize
enddo
crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results
c = c + 1 c = c + 1
if (size(crystallite_postResults)-c > 0) & if (size(crystallite_postResults)-c > 0) &

View File

@ -262,7 +262,7 @@ subroutine homogenization_init
materialpoint_sizeResults = 1 & ! grain count materialpoint_sizeResults = 1 & ! grain count
+ 1 + thermal_maxSizePostResults & + 1 + thermal_maxSizePostResults &
+ damage_maxSizePostResults & + damage_maxSizePostResults &
+ homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results + homogenization_maxNgrains * (1 & ! crystallite size
+ 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results + 1 + constitutive_plasticity_maxSizePostResults & ! constitutive size & constitutive results
+ constitutive_source_maxSizePostResults) + constitutive_source_maxSizePostResults)
allocate(materialpoint_results(materialpoint_sizeResults,discretization_nIP,discretization_nElem)) allocate(materialpoint_results(materialpoint_sizeResults,discretization_nIP,discretization_nElem))
@ -618,7 +618,7 @@ subroutine materialpoint_postResults
thePos = thePos + 1 thePos = thePos + 1
grainLooping :do g = 1,myNgrains grainLooping :do g = 1,myNgrains
theSize = 1 + crystallite_sizePostResults(myCrystallite) + & theSize = 1 + &
1 + plasticState (material_phaseAt(g,e))%sizePostResults + & 1 + plasticState (material_phaseAt(g,e))%sizePostResults + &
sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults) sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults)
materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results