fixed array out of bounds during initialization
happened for inactive homogenization
This commit is contained in:
parent
3c11905f63
commit
f471911e01
|
@ -242,7 +242,7 @@ subroutine homogenization_RGC_init()
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! * assigning cluster orientations
|
! * assigning cluster orientations
|
||||||
elementLooping: do e = 1_pInt,mesh_NcpElems
|
elementLooping: do e = 1_pInt,mesh_NcpElems
|
||||||
if (homogenization_typeInstance(mesh_homogenizationAt(e)) == instance) then
|
if (homogenization_typeInstance(mesh_homogenizationAt(e)) == instance .and. NofMyHomog > 0_pInt) then
|
||||||
noOrientationGiven: if (all (prm%angles >= 399.9_pReal)) then
|
noOrientationGiven: if (all (prm%angles >= 399.9_pReal)) then
|
||||||
of = mappingHomogenization(1,1,e)
|
of = mappingHomogenization(1,1,e)
|
||||||
dependentState(instance)%orientation(1:3,1:3,of) = math_EulerToR(math_sampleRandomOri())
|
dependentState(instance)%orientation(1:3,1:3,of) = math_EulerToR(math_sampleRandomOri())
|
||||||
|
@ -653,7 +653,7 @@ function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el)
|
||||||
p_relax = relax
|
p_relax = relax
|
||||||
p_relax(ipert) = relax(ipert) + pPert_RGC ! perturb the relaxation vector
|
p_relax(ipert) = relax(ipert) + pPert_RGC ! perturb the relaxation vector
|
||||||
homogState(mappingHomogenization(2,ip,el))%state(1:3*nIntFaceTot,of) = p_relax
|
homogState(mappingHomogenization(2,ip,el))%state(1:3*nIntFaceTot,of) = p_relax
|
||||||
call grainDeformation(pF,avgF,ip,el) ! compute the grains deformation from perturbed state
|
call grainDeformation(pF,avgF,instance,of) ! compute the grains deformation from perturbed state
|
||||||
call stressPenalty(pR,pNN,avgF,pF,ip,el,instance) ! compute stress penalty due to interface mismatch from perturbed state
|
call stressPenalty(pR,pNN,avgF,pF,ip,el,instance) ! compute stress penalty due to interface mismatch from perturbed state
|
||||||
call volumePenalty(pD,volDiscrep,pF,avgF,ip,el) ! compute stress penalty due to volume discrepancy from perturbed state
|
call volumePenalty(pD,volDiscrep,pF,avgF,ip,el) ! compute stress penalty due to volume discrepancy from perturbed state
|
||||||
|
|
||||||
|
@ -1057,40 +1057,35 @@ function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el)
|
||||||
!> @brief calculating the grain deformation gradient (the same with
|
!> @brief calculating the grain deformation gradient (the same with
|
||||||
! homogenization_RGC_partionDeformation, but used only for perturbation scheme)
|
! homogenization_RGC_partionDeformation, but used only for perturbation scheme)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine grainDeformation(F, avgF, ip, el)
|
subroutine grainDeformation(F, avgF, instance, of)
|
||||||
use mesh, only: &
|
|
||||||
mesh_homogenizationAt
|
|
||||||
use material, only: &
|
use material, only: &
|
||||||
homogenization_maxNgrains,&
|
homogenization_maxNgrains
|
||||||
homogenization_typeInstance
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
real(pReal), dimension (3,3,homogenization_maxNgrains), intent(out) :: F !< partioned F per grain
|
real(pReal), dimension (3,3,homogenization_maxNgrains), intent(out) :: F !< partioned F per grain
|
||||||
real(pReal), dimension (3,3), intent(in) :: avgF !<
|
real(pReal), dimension (3,3), intent(in) :: avgF !<
|
||||||
integer(pInt), intent(in) :: &
|
integer(pInt), intent(in) :: &
|
||||||
el, & !< element number
|
instance, &
|
||||||
ip !< integration point number
|
of
|
||||||
real(pReal), dimension (3) :: aVect,nVect
|
real(pReal), dimension (3) :: aVect,nVect
|
||||||
integer(pInt), dimension (4) :: intFace
|
integer(pInt), dimension (4) :: intFace
|
||||||
integer(pInt), dimension (3) :: iGrain3
|
integer(pInt), dimension (3) :: iGrain3
|
||||||
integer(pInt) :: instance, iGrain,iFace,i,j,of
|
integer(pInt) :: iGrain,iFace,i,j
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! compute the deformation gradient of individual grains due to relaxations
|
! compute the deformation gradient of individual grains due to relaxations
|
||||||
instance = homogenization_typeInstance(mesh_homogenizationAt(el))
|
F = 0.0_pReal
|
||||||
of = mappingHomogenization(1,ip,el)
|
do iGrain = 1_pInt,product(param(instance)%Nconstituents)
|
||||||
F = 0.0_pReal
|
iGrain3 = grain1to3(iGrain,instance)
|
||||||
do iGrain = 1_pInt,product(param(instance)%Nconstituents)
|
do iFace = 1_pInt,6_pInt
|
||||||
iGrain3 = grain1to3(iGrain,instance)
|
intFace = getInterface(iFace,iGrain3)
|
||||||
do iFace = 1_pInt,6_pInt
|
aVect = relaxationVector(intFace,instance,of)
|
||||||
intFace = getInterface(iFace,iGrain3)
|
nVect = interfaceNormal(intFace,instance,of)
|
||||||
aVect = relaxationVector(intFace,instance,of)
|
forall (i=1_pInt:3_pInt,j=1_pInt:3_pInt) &
|
||||||
nVect = interfaceNormal(intFace,ip,el)
|
F(i,j,iGrain) = F(i,j,iGrain) + aVect(i)*nVect(j) ! effective relaxations
|
||||||
forall (i=1_pInt:3_pInt,j=1_pInt:3_pInt) &
|
enddo
|
||||||
F(i,j,iGrain) = F(i,j,iGrain) + aVect(i)*nVect(j) ! effective relaxations
|
F(1:3,1:3,iGrain) = F(1:3,1:3,iGrain) + avgF ! relaxed deformation gradient
|
||||||
enddo
|
enddo
|
||||||
F(1:3,1:3,iGrain) = F(1:3,1:3,iGrain) + avgF ! relaxed deformation gradient
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine grainDeformation
|
end subroutine grainDeformation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue