multi physics output now working for all solvers

This commit is contained in:
Pratheek Shanthraj 2015-03-25 16:02:30 +00:00
parent 8b09d78ed1
commit 37a7364a3e
3 changed files with 203 additions and 228 deletions

View File

@ -242,6 +242,7 @@ subroutine constitutive_init(temperature_init)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! write description file for constitutive phase output ! write description file for constitutive phase output
if (worldrank == 0_pInt) then
call IO_write_jobFile(FILEUNIT,'outputConstitutive') call IO_write_jobFile(FILEUNIT,'outputConstitutive')
do phase = 1_pInt,material_Nphase do phase = 1_pInt,material_Nphase
instance = phase_plasticityInstance(phase) ! which instance of a plasticity is present phase instance = phase_plasticityInstance(phase) ! which instance of a plasticity is present phase
@ -299,7 +300,6 @@ subroutine constitutive_init(temperature_init)
enddo enddo
endif endif
endif endif
#ifdef multiphysicsOut
instance = phase_damageInstance(phase) ! which instance of a plasticity is present phase instance = phase_damageInstance(phase) ! which instance of a plasticity is present phase
knownDamage = .true. knownDamage = .true.
select case(phase_damage(phase)) ! split per constititution select case(phase_damage(phase)) ! split per constititution
@ -397,9 +397,9 @@ subroutine constitutive_init(temperature_init)
enddo enddo
endif endif
endif endif
#endif
enddo enddo
close(FILEUNIT) close(FILEUNIT)
endif
constitutive_maxSizeDotState = 0_pInt constitutive_maxSizeDotState = 0_pInt
constitutive_maxSizePostResults = 0_pInt constitutive_maxSizePostResults = 0_pInt
@ -1739,7 +1739,6 @@ function constitutive_postResults(Tstar_v, FeArray, ipc, ip, el)
plastic_titanmod_postResults plastic_titanmod_postResults
use plastic_nonlocal, only: & use plastic_nonlocal, only: &
plastic_nonlocal_postResults plastic_nonlocal_postResults
#ifdef multiphysicsOut
use damage_isoBrittle, only: & use damage_isoBrittle, only: &
damage_isoBrittle_postResults damage_isoBrittle_postResults
use damage_isoDuctile, only: & use damage_isoDuctile, only: &
@ -1756,23 +1755,17 @@ function constitutive_postResults(Tstar_v, FeArray, ipc, ip, el)
thermal_adiabatic_postResults thermal_adiabatic_postResults
use vacancy_generation, only: & use vacancy_generation, only: &
vacancy_generation_postResults vacancy_generation_postResults
#endif
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
#ifdef multiphysicsOut
real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%sizePostResults + & real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%sizePostResults + &
damageState( material_phase(ipc,ip,el))%sizePostResults + & damageState( material_phase(ipc,ip,el))%sizePostResults + &
thermalState(material_phase(ipc,ip,el))%sizePostResults + & thermalState(material_phase(ipc,ip,el))%sizePostResults + &
vacancyState(material_phase(ipc,ip,el))%sizePostResults) :: & vacancyState(material_phase(ipc,ip,el))%sizePostResults) :: &
constitutive_postResults constitutive_postResults
#else
real(pReal), dimension(plasticState(material_phase(ipc,ip,el))%sizePostResults) :: &
constitutive_postResults
#endif
real(pReal), intent(in), dimension(3,3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems) :: & real(pReal), intent(in), dimension(3,3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems) :: &
FeArray !< elastic deformation gradient FeArray !< elastic deformation gradient
real(pReal), intent(in), dimension(6) :: & real(pReal), intent(in), dimension(6) :: &
@ -1806,7 +1799,6 @@ function constitutive_postResults(Tstar_v, FeArray, ipc, ip, el)
plastic_nonlocal_postResults (Tstar_v,FeArray,ip,el) plastic_nonlocal_postResults (Tstar_v,FeArray,ip,el)
end select end select
#ifdef multiphysicsOut
startPos = endPos + 1_pInt startPos = endPos + 1_pInt
endPos = endPos + damageState(material_phase(ipc,ip,el))%sizePostResults endPos = endPos + damageState(material_phase(ipc,ip,el))%sizePostResults
select case (phase_damage(material_phase(ipc,ip,el))) select case (phase_damage(material_phase(ipc,ip,el)))
@ -1837,7 +1829,6 @@ function constitutive_postResults(Tstar_v, FeArray, ipc, ip, el)
case (LOCAL_VACANCY_generation_ID) case (LOCAL_VACANCY_generation_ID)
constitutive_postResults(startPos:endPos) = vacancy_generation_postResults(ipc, ip, el) constitutive_postResults(startPos:endPos) = vacancy_generation_postResults(ipc, ip, el)
end select end select
#endif
end function constitutive_postResults end function constitutive_postResults

View File

@ -395,6 +395,7 @@ subroutine crystallite_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! write description file for crystallite output ! write description file for crystallite output
if (worldrank == 0_pInt) then
call IO_write_jobFile(FILEUNIT,'outputCrystallite') call IO_write_jobFile(FILEUNIT,'outputCrystallite')
do p = 1_pInt,material_Ncrystallite do p = 1_pInt,material_Ncrystallite
@ -405,6 +406,7 @@ subroutine crystallite_init
enddo enddo
close(FILEUNIT) close(FILEUNIT)
endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! initialize ! initialize
@ -4229,18 +4231,12 @@ function crystallite_postResults(ipc, ip, el)
ip, & !< integration point index ip, & !< integration point index
ipc !< grain index ipc !< grain index
#ifdef multiphysicsOut
real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(mesh_element(4,el))) + & real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(mesh_element(4,el))) + &
1+plasticState(material_phase(ipc,ip,el))%sizePostResults + & 1+plasticState(material_phase(ipc,ip,el))%sizePostResults + &
damageState( material_phase(ipc,ip,el))%sizePostResults + & damageState( material_phase(ipc,ip,el))%sizePostResults + &
thermalState(material_phase(ipc,ip,el))%sizePostResults + & thermalState(material_phase(ipc,ip,el))%sizePostResults + &
vacancyState(material_phase(ipc,ip,el))%sizePostResults) :: & vacancyState(material_phase(ipc,ip,el))%sizePostResults) :: &
crystallite_postResults crystallite_postResults
#else
real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(mesh_element(4,el)))+ &
1+plasticState(material_phase(ipc,ip,el))%sizePostResults) :: &
crystallite_postResults
#endif
real(pReal), dimension(3,3) :: & real(pReal), dimension(3,3) :: &
Ee Ee
real(pReal), dimension(4) :: & real(pReal), dimension(4) :: &

View File

@ -228,6 +228,7 @@ subroutine homogenization_init()
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! write description file for homogenization output ! write description file for homogenization output
if (worldrank == 0_pInt) then
call IO_write_jobFile(FILEUNIT,'outputHomogenization') call IO_write_jobFile(FILEUNIT,'outputHomogenization')
do p = 1,material_Nhomogenization do p = 1,material_Nhomogenization
i = homogenization_typeInstance(p) ! which instance of this homogenization type i = homogenization_typeInstance(p) ! which instance of this homogenization type
@ -261,14 +262,12 @@ subroutine homogenization_init()
enddo enddo
endif endif
endif endif
#ifdef multiphysicsOut
write(FILEUNIT,'(a)') '(field)'
do e = 1_pInt,field_Noutput(p) do e = 1_pInt,field_Noutput(p)
write(FILEUNIT,'(a,i4)') trim(field_output(e,p))//char(9),field_sizePostResult(e,p) write(FILEUNIT,'(a,i4)') trim(field_output(e,p))//char(9),field_sizePostResult(e,p)
enddo enddo
#endif
enddo enddo
close(FILEUNIT) close(FILEUNIT)
endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate and initialize global variables ! allocate and initialize global variables
@ -310,16 +309,12 @@ subroutine homogenization_init()
enddo enddo
materialpoint_sizeResults = 1 & ! grain count materialpoint_sizeResults = 1 & ! grain count
+ 1 + homogenization_maxSizePostResults & ! homogSize & homogResult + 1 + homogenization_maxSizePostResults & ! homogSize & homogResult
#ifdef multiphysicsOut
+ field_maxSizePostResults & ! field size & field result + field_maxSizePostResults & ! field size & field result
#endif
+ homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results + homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results
#ifdef multiphysicsOut + 1 + constitutive_maxSizePostResults & ! constitutive size & constitutive results
+ constitutive_damage_maxSizePostResults & + constitutive_damage_maxSizePostResults &
+ constitutive_thermal_maxSizePostResults & + constitutive_thermal_maxSizePostResults &
+ constitutive_vacancy_maxSizePostResults & + constitutive_vacancy_maxSizePostResults)
#endif
+ 1 + constitutive_maxSizePostResults) ! constitutive size & constitutive results
allocate(materialpoint_results(materialpoint_sizeResults,mesh_maxNips,mesh_NcpElems)) allocate(materialpoint_results(materialpoint_sizeResults,mesh_maxNips,mesh_NcpElems))
mainProcess: if (worldrank == 0) then mainProcess: if (worldrank == 0) then
@ -751,28 +746,21 @@ subroutine materialpoint_postResults
thePos = thePos + theSize thePos = thePos + theSize
endif endif
#ifdef multiphysicsOut
theSize = field_sizePostResults(mappingHomogenization(2,i,e)) theSize = field_sizePostResults(mappingHomogenization(2,i,e))
if (theSize > 0_pInt) then ! any homogenization results to mention? if (theSize > 0_pInt) then ! any homogenization results to mention?
materialpoint_results(thePos+1:thePos+theSize,i,e) = field_postResults(i,e) ! tell field results materialpoint_results(thePos+1:thePos+theSize,i,e) = field_postResults(i,e) ! tell field results
thePos = thePos + theSize thePos = thePos + theSize
endif endif
#endif
materialpoint_results(thePos+1,i,e) = real(myNgrains,pReal) ! tell number of grains at materialpoint materialpoint_results(thePos+1,i,e) = real(myNgrains,pReal) ! tell number of grains at materialpoint
thePos = thePos + 1_pInt thePos = thePos + 1_pInt
grainLooping :do g = 1,myNgrains grainLooping :do g = 1,myNgrains
#ifdef multiphysicsOut
theSize = 1 + crystallite_sizePostResults(myCrystallite) + & theSize = 1 + crystallite_sizePostResults(myCrystallite) + &
1 + plasticState(material_phase(g,i,e))%sizePostResults + & !ToDo 1 + plasticState(material_phase(g,i,e))%sizePostResults + & !ToDo
damageState(material_phase(g,i,e))%sizePostResults + & damageState(material_phase(g,i,e))%sizePostResults + &
thermalState(material_phase(g,i,e))%sizePostResults + & thermalState(material_phase(g,i,e))%sizePostResults + &
vacancyState(material_phase(g,i,e))%sizePostResults vacancyState(material_phase(g,i,e))%sizePostResults
#else
theSize = (1 + crystallite_sizePostResults(myCrystallite)) + &
(1 + plasticState(material_phase(g,i,e))%sizePostResults)
#endif
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
thePos = thePos + theSize thePos = thePos + theSize
enddo grainLooping enddo grainLooping