encapsulate data

This commit is contained in:
Martin Diehl 2020-12-29 12:25:03 +01:00
parent e19ced830b
commit 120118695d
3 changed files with 29 additions and 10 deletions

View File

@ -392,6 +392,7 @@ module constitutive
crystallite_push33ToRef, &
crystallite_restartWrite, &
integrateSourceState, &
constitutive_mech_setF, &
constitutive_mech_getLp, &
constitutive_mech_getS, &
crystallite_restartRead, &
@ -1442,18 +1443,34 @@ function constitutive_mech_getS(co,ip,el) result(S)
integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: S
S = constitutive_mech_S(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el))
end function constitutive_mech_getS
! getter for non-mech (e.g. thermal)
function constitutive_mech_getLp(co,ip,el) result(Lp)
integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: Lp
Lp = constitutive_mech_Lp(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el))
end function constitutive_mech_getLp
! setter for homogenization
subroutine constitutive_mech_setF(F,co,ip,el)
real(pReal), dimension(3,3), intent(in) :: F
integer, intent(in) :: co, ip, el
crystallite_F(1:3,1:3,co,ip,el) = F
!constitutive_mech_F(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el)) = F
end subroutine constitutive_mech_setF
end module constitutive

View File

@ -113,25 +113,28 @@ module subroutine mech_partition(subF,ip,el)
ip, & !< integration point
el !< element number
integer :: co
real(pReal) :: F(3,3,homogenization_Nconstituents(material_homogenizationAt(el)))
chosenHomogenization: select case(homogenization_type(material_homogenizationAt(el)))
case (HOMOGENIZATION_NONE_ID) chosenHomogenization
crystallite_F(1:3,1:3,1,ip,el) = subF
F(1:3,1:3,1) = subF
case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
call mech_isostrain_partitionDeformation(&
crystallite_F(1:3,1:3,1:homogenization_Nconstituents(material_homogenizationAt(el)),ip,el), &
subF)
call mech_isostrain_partitionDeformation(F,subF)
case (HOMOGENIZATION_RGC_ID) chosenHomogenization
call mech_RGC_partitionDeformation(&
crystallite_F(1:3,1:3,1:homogenization_Nconstituents(material_homogenizationAt(el)),ip,el), &
subF,&
ip, &
el)
call mech_RGC_partitionDeformation(F,subF,ip,el)
end select chosenHomogenization
do co = 1,homogenization_Nconstituents(material_homogenizationAt(el))
call constitutive_mech_setF(F(1:3,1:3,co),co,ip,el)
enddo
end subroutine mech_partition

View File

@ -523,7 +523,6 @@ module function mech_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) result(doneAndHa
integer, dimension (3) :: iGrain3,iGNghb3,nGDim
real(pReal), dimension (3,3) :: gDef,nDef
real(pReal), dimension (3) :: nVect,surfCorr
real(pReal), dimension (2) :: Gmoduli
integer :: iGrain,iGNghb,iFace,i,j,k,l
real(pReal) :: muGrain,muGNghb,nDefNorm
real(pReal), parameter :: &