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_push33ToRef, &
crystallite_restartWrite, & crystallite_restartWrite, &
integrateSourceState, & integrateSourceState, &
constitutive_mech_setF, &
constitutive_mech_getLp, & constitutive_mech_getLp, &
constitutive_mech_getS, & constitutive_mech_getS, &
crystallite_restartRead, & crystallite_restartRead, &
@ -1442,18 +1443,34 @@ function constitutive_mech_getS(co,ip,el) result(S)
integer, intent(in) :: co, ip, el integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: S real(pReal), dimension(3,3) :: S
S = constitutive_mech_S(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el)) S = constitutive_mech_S(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el))
end function constitutive_mech_getS end function constitutive_mech_getS
! getter for non-mech (e.g. thermal) ! getter for non-mech (e.g. thermal)
function constitutive_mech_getLp(co,ip,el) result(Lp) function constitutive_mech_getLp(co,ip,el) result(Lp)
integer, intent(in) :: co, ip, el integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: Lp real(pReal), dimension(3,3) :: Lp
Lp = constitutive_mech_Lp(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el)) Lp = constitutive_mech_Lp(material_phaseAt(co,el))%data(1:3,1:3,material_phaseMemberAt(co,ip,el))
end function constitutive_mech_getLp 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 end module constitutive

View File

@ -113,25 +113,28 @@ module subroutine mech_partition(subF,ip,el)
ip, & !< integration point ip, & !< integration point
el !< element number el !< element number
integer :: co
real(pReal) :: F(3,3,homogenization_Nconstituents(material_homogenizationAt(el)))
chosenHomogenization: select case(homogenization_type(material_homogenizationAt(el))) chosenHomogenization: select case(homogenization_type(material_homogenizationAt(el)))
case (HOMOGENIZATION_NONE_ID) chosenHomogenization 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 case (HOMOGENIZATION_ISOSTRAIN_ID) chosenHomogenization
call mech_isostrain_partitionDeformation(& call mech_isostrain_partitionDeformation(F,subF)
crystallite_F(1:3,1:3,1:homogenization_Nconstituents(material_homogenizationAt(el)),ip,el), &
subF)
case (HOMOGENIZATION_RGC_ID) chosenHomogenization case (HOMOGENIZATION_RGC_ID) chosenHomogenization
call mech_RGC_partitionDeformation(& call mech_RGC_partitionDeformation(F,subF,ip,el)
crystallite_F(1:3,1:3,1:homogenization_Nconstituents(material_homogenizationAt(el)),ip,el), &
subF,&
ip, &
el)
end select chosenHomogenization 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 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 integer, dimension (3) :: iGrain3,iGNghb3,nGDim
real(pReal), dimension (3,3) :: gDef,nDef real(pReal), dimension (3,3) :: gDef,nDef
real(pReal), dimension (3) :: nVect,surfCorr real(pReal), dimension (3) :: nVect,surfCorr
real(pReal), dimension (2) :: Gmoduli
integer :: iGrain,iGNghb,iFace,i,j,k,l integer :: iGrain,iGNghb,iFace,i,j,k,l
real(pReal) :: muGrain,muGNghb,nDefNorm real(pReal) :: muGrain,muGNghb,nDefNorm
real(pReal), parameter :: & real(pReal), parameter :: &