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

View File

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

View File

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