From c16fdec749a262ddb0335063edd11e88ee0105b6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Nov 2018 20:08:18 +0100 Subject: [PATCH] misplaced debug statement debugging the individual constituents should be done by the constitutive laws --- src/homogenization.f90 | 3 ++- src/homogenization_RGC.f90 | 48 +++++++------------------------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index e664db0cc..708e72fa8 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -1081,12 +1081,13 @@ subroutine homogenization_averageStressAndItsTangent(ip,el) instance) case (HOMOGENIZATION_RGC_ID) chosenHomogenization + instance = homogenization_typeInstance(mesh_element(3,el)) call homogenization_RGC_averageStressAndItsTangent(& materialpoint_P(1:3,1:3,ip,el), & materialpoint_dPdF(1:3,1:3,1:3,1:3,ip,el),& crystallite_P(1:3,1:3,1:homogenization_maxNgrains,ip,el), & crystallite_dPdF(1:3,1:3,1:3,1:3,1:homogenization_maxNgrains,ip,el), & - el) + instance) end select chosenHomogenization end subroutine homogenization_averageStressAndItsTangent diff --git a/src/homogenization_RGC.f90 b/src/homogenization_RGC.f90 index e26b98b26..1b1b5ba66 100644 --- a/src/homogenization_RGC.f90 +++ b/src/homogenization_RGC.f90 @@ -125,11 +125,11 @@ subroutine homogenization_RGC_init() implicit none integer(pInt) :: & NofMyHomog, & - o, h, & + h, & outputSize, & instance, & sizeHState, nIntFaceTot - integer(pInt) :: section=0_pInt, maxNinstance, i,j,e, mySize + integer(pInt) :: maxNinstance, i,j,e, mySize character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::] integer(kind(undefined_ID)) :: & outputID !< ID of each post result output @@ -804,51 +804,19 @@ end function homogenization_RGC_updateState !-------------------------------------------------------------------------------------------------- !> @brief derive average stress and stiffness from constituent quantities !-------------------------------------------------------------------------------------------------- -subroutine homogenization_RGC_averageStressAndItsTangent(avgP,dAvgPdAvgF,P,dPdF,el) - use debug, only: & - debug_level, & - debug_homogenization,& - debug_levelExtensive - use mesh, only: & - mesh_homogenizationAt +subroutine homogenization_RGC_averageStressAndItsTangent(avgP,dAvgPdAvgF,P,dPdF,instance) use material, only: & - homogenization_maxNgrains, & - homogenization_typeInstance - use math, only: math_Plain3333to99 - + homogenization_maxNgrains + implicit none real(pReal), dimension (3,3), intent(out) :: avgP !< average stress at material point real(pReal), dimension (3,3,3,3), intent(out) :: dAvgPdAvgF !< average stiffness at material point real(pReal), dimension (3,3,homogenization_maxNgrains), intent(in) :: P !< array of current grain stresses real(pReal), dimension (3,3,3,3,homogenization_maxNgrains), intent(in) :: dPdF !< array of current grain stiffnesses - integer(pInt), intent(in) :: el !< element number - real(pReal), dimension (9,9) :: dPdF99 + integer(pInt), intent(in) :: instance - integer(pInt) :: instance, i, j, Nconstituents, iGrain - - instance = homogenization_typeInstance(mesh_homogenizationAt(el)) - Nconstituents = product(param(instance)%Nconstituents) - -!-------------------------------------------------------------------------------------------------- -! debugging the grain tangent - if (iand(debug_level(debug_homogenization), debug_levelExtensive) /= 0_pInt) then - !$OMP CRITICAL (write2out) - do iGrain = 1_pInt,Nconstituents - dPdF99 = math_Plain3333to99(dPdF(1:3,1:3,1:3,1:3,iGrain)) - write(6,'(1x,a30,1x,i3)')'Stress tangent of grain: ',iGrain - do i = 1_pInt,9_pInt - write(6,'(1x,(e15.8,1x))') (dPdF99(i,j), j = 1_pInt,9_pInt) - enddo - write(6,*)' ' - enddo - flush(6) - !$OMP END CRITICAL (write2out) - endif - -!-------------------------------------------------------------------------------------------------- -! computing the average first Piola-Kirchhoff stress P and the average tangent dPdF - avgP = sum(P,3)/real(Nconstituents,pReal) - dAvgPdAvgF = sum(dPdF,5)/real(Nconstituents,pReal) + avgP = sum(P,3) /real(product(param(instance)%Nconstituents),pReal) + dAvgPdAvgF = sum(dPdF,5)/real(product(param(instance)%Nconstituents),pReal) end subroutine homogenization_RGC_averageStressAndItsTangent