some fixes to get homogenisation none working with recent changes

This commit is contained in:
Pratheek Shanthraj 2014-09-26 15:16:10 +00:00
parent d3fd4bdf90
commit 5c3f4e3e69
2 changed files with 25 additions and 22 deletions

View File

@ -3805,8 +3805,8 @@ function crystallite_postResults(ipc, ip, el)
#ifdef multiphysicsOut #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 + &
1+damageState( material_phase(ipc,ip,el))%sizePostResults + & damageState( material_phase(ipc,ip,el))%sizePostResults + &
1+thermalState(material_phase(ipc,ip,el))%sizePostResults) :: & thermalState(material_phase(ipc,ip,el))%sizePostResults) :: &
crystallite_postResults crystallite_postResults
#else #else
real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(mesh_element(4,el)))+ & real(pReal), dimension(1+crystallite_sizePostResults(microstructure_crystallite(mesh_element(4,el)))+ &

View File

@ -241,9 +241,11 @@ subroutine homogenization_init()
if (knownHomogenization) then if (knownHomogenization) then
write(FILEUNIT,'(a)') '(type)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(type)'//char(9)//trim(outputName)
write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p) write(FILEUNIT,'(a,i4)') '(ngrains)'//char(9),homogenization_Ngrains(p)
do e = 1,thisNoutput(i) if (homogenization_type(p) /= HOMOGENIZATION_NONE_ID) then
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i) do e = 1,thisNoutput(i)
enddo write(FILEUNIT,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i)
enddo
endif
endif endif
#ifdef multiphysicsOut #ifdef multiphysicsOut
write(FILEUNIT,'(a)') '(field)' write(FILEUNIT,'(a)') '(field)'
@ -291,17 +293,17 @@ subroutine homogenization_init()
field_maxSizePostResults = 0_pInt field_maxSizePostResults = 0_pInt
do p = 1,material_Nhomogenization do p = 1,material_Nhomogenization
homogenization_maxSizePostResults = max(homogenization_maxSizePostResults,homogState(p)%sizePostResults) homogenization_maxSizePostResults = max(homogenization_maxSizePostResults,homogState(p)%sizePostResults)
field_maxSizePostResults = max(field_maxSizePostResults,field_Noutput(p)) field_maxSizePostResults = max(field_maxSizePostResults,field_sizePostResults(p))
enddo enddo
materialpoint_sizeResults = 1 & ! grain count materialpoint_sizeResults = 1 & ! grain count
+ 1 + homogenization_maxSizePostResults & ! homogSize & homogResult + 1 + homogenization_maxSizePostResults & ! homogSize & homogResult
#ifdef multiphysicsOut #ifdef multiphysicsOut
+ 1 + field_maxSizePostResults & ! field size & field result + field_maxSizePostResults & ! field size & field result
#endif #endif
+ homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results + homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results
#ifdef multiphysicsOut #ifdef multiphysicsOut
+ 1 + constitutive_damage_maxSizePostResults & + constitutive_damage_maxSizePostResults &
+ 1 + constitutive_thermal_maxSizePostResults & + constitutive_thermal_maxSizePostResults &
#endif #endif
+ 1 + constitutive_maxSizePostResults) ! constitutive size & constitutive results + 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))
@ -716,10 +718,7 @@ subroutine materialpoint_postResults
endif endif
#ifdef multiphysicsOut #ifdef multiphysicsOut
theSize = field_Noutput(mappingHomogenization(2,i,e)) theSize = field_sizePostResults(mappingHomogenization(2,i,e))
materialpoint_results(thePos+1,i,e) = real(theSize,pReal) ! tell size of field results
thePos = thePos + 1_pInt
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
@ -731,10 +730,10 @@ subroutine materialpoint_postResults
grainLooping :do g = 1,myNgrains grainLooping :do g = 1,myNgrains
#ifdef multiphysicsOut #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
(1 + damageState(material_phase(g,i,e))%sizePostResults) + & damageState(material_phase(g,i,e))%sizePostResults + &
(1 + thermalState(material_phase(g,i,e))%sizePostResults) thermalState(material_phase(g,i,e))%sizePostResults
#else #else
theSize = (1 + crystallite_sizePostResults(myCrystallite)) + & theSize = (1 + crystallite_sizePostResults(myCrystallite)) + &
(1 + plasticState(material_phase(g,i,e))%sizePostResults) (1 + plasticState(material_phase(g,i,e))%sizePostResults)
@ -1290,7 +1289,9 @@ end function homogenization_postResults
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function field_postResults(ip,el) function field_postResults(ip,el)
use material, only: & use material, only: &
mappingHomogenization mappingHomogenization, &
fieldThermal, &
fieldDamage
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -1299,19 +1300,21 @@ function field_postResults(ip,el)
real(pReal), dimension(field_sizePostResults(mappingHomogenization(2,ip,el))) :: & real(pReal), dimension(field_sizePostResults(mappingHomogenization(2,ip,el))) :: &
field_postResults field_postResults
integer(pInt) :: & integer(pInt) :: &
c = 0_pInt, homog, o c, homog, pos, o
field_postResults = 0.0_pReal field_postResults = 0.0_pReal
homog = mappingHomogenization(2,ip,el) homog = mappingHomogenization(2,ip,el)
pos = mappingHomogenization(1,ip,el)
c = 0_pInt
do o = 1_pInt,field_Noutput(homog) do o = 1_pInt,field_Noutput(homog)
select case(field_outputID(o,homog)) select case(field_outputID(o,homog))
case (temperature_ID) case (temperature_ID)
field_postResults(c+1_pInt) = field_getThermal(ip,el) field_postResults(c+1_pInt) = fieldThermal(homog)%field(1,pos)
c = c + 1_pInt c = c + 1_pInt
case (damage_ID) case (damage_ID)
field_postResults(c+1_pInt) = field_getDAMAGE(ip,el) field_postResults(c+1_pInt) = fieldDamage(homog)%field(1,pos)
c = c + 1_pInt c = c + 1_pInt
end select end select
enddo enddo
end function field_postResults end function field_postResults