From c36a5bdfbbb4e6a8c7924cee625f768aa654cc30 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 23:06:28 +0100 Subject: [PATCH 1/2] bugfix: calculation of size of postResults was wrong --- src/crystallite.f90 | 5 ++--- src/homogenization.f90 | 8 ++++---- src/plastic_nonlocal.f90 | 7 ------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index a17213f9e..292241001 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -743,8 +743,7 @@ function crystallite_postResults(ipc, ip, el) ipc !< grain index real(pReal), dimension(1+ & - 1+plasticState(material_phaseAt(ipc,el))%sizePostResults + & - sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & + 1+sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults)) :: & crystallite_postResults integer :: & c @@ -754,7 +753,7 @@ function crystallite_postResults(ipc, ip, el) crystallite_postResults(1) = 0.0_pReal ! header-like information (length) c = 1 - crystallite_postResults(c+1) = real(plasticState(material_phaseAt(ipc,el))%sizePostResults,pReal) ! size of constitutive results + crystallite_postResults(c+1) = real(sum(sourceState(material_phaseAt(ipc,el))%p(:)%sizePostResults),pReal) ! size of constitutive results c = c + 1 if (size(crystallite_postResults)-c > 0) & crystallite_postResults(c+1:size(crystallite_postResults)) = & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 618c2faf8..0112f9cf5 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -255,8 +255,8 @@ subroutine homogenization_init thermal_maxSizePostResults = 0 damage_maxSizePostResults = 0 do p = 1,size(config_homogenization) - thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState (p)%sizePostResults) - damage_maxSizePostResults = max(damage_maxSizePostResults ,damageState (p)%sizePostResults) + thermal_maxSizePostResults = max(thermal_maxSizePostResults, thermalState(p)%sizePostResults) + damage_maxSizePostResults = max(damage_maxSizePostResults, damageState (p)%sizePostResults) enddo materialpoint_sizeResults = 1 & ! grain count @@ -616,8 +616,8 @@ subroutine materialpoint_postResults grainLooping :do g = 1,myNgrains theSize = 1 + & - 1 + plasticState (material_phaseAt(g,e))%sizePostResults + & - sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults) + 1 + & + sum(sourceState(material_phaseAt(g,e))%p(:)%sizePostResults) materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results thePos = thePos + theSize enddo grainLooping diff --git a/src/plastic_nonlocal.f90 b/src/plastic_nonlocal.f90 index 23bfb50aa..2e6734c9d 100644 --- a/src/plastic_nonlocal.f90 +++ b/src/plastic_nonlocal.f90 @@ -26,13 +26,9 @@ module plastic_nonlocal private real(pReal), parameter, private :: & KB = 1.38e-23_pReal !< Physical parameter, Boltzmann constant in J/Kelvin - - integer, dimension(:,:), allocatable, target, public :: & - plastic_nonlocal_sizePostResult !< size of each post result output character(len=64), dimension(:,:), allocatable, target, public :: & plastic_nonlocal_output !< name of each post result output - ! storage order of dislocation types integer, dimension(8), parameter :: & @@ -268,7 +264,6 @@ subroutine plastic_nonlocal_init allocate(deltaState(maxNinstances)) allocate(microstructure(maxNinstances)) - allocate(plastic_nonlocal_sizePostResult(maxval(phase_Noutput), maxNinstances), source=0) allocate(plastic_nonlocal_output(maxval(phase_Noutput), maxNinstances)) plastic_nonlocal_output = '' allocate(plastic_nonlocal_outputID(maxval(phase_Noutput), maxNinstances), source=undefined_ID) @@ -498,7 +493,6 @@ subroutine plastic_nonlocal_init if (outputID /= undefined_ID) then plastic_nonlocal_output(i,phase_plasticityInstance(p)) = outputs(i) - plastic_nonlocal_sizePostResult(i,phase_plasticityInstance(p)) = prm%totalNslip prm%outputID = [prm%outputID , outputID] endif @@ -524,7 +518,6 @@ subroutine plastic_nonlocal_init prm%totalNslip,0,0) plasticState(p)%nonlocal = .true. plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention - plasticState(p)%sizePostResults = sum(plastic_nonlocal_sizePostResult(:,phase_plasticityInstance(p))) totalNslip(phase_plasticityInstance(p)) = prm%totalNslip From 93da6d3f636bb2d31fbe589cd9af2630266a1e6c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Dec 2019 23:07:01 +0100 Subject: [PATCH 2/2] was not used --- src/material.f90 | 3 --- src/prec.f90 | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/material.f90 b/src/material.f90 index 2f70fe97b..8aeab5dec 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -749,9 +749,6 @@ subroutine material_allocatePlasticState(phase,NofMyPhase,& plasticState(phase)%sizeDotState = sizeDotState plasticState(phase)%sizeDeltaState = sizeDeltaState plasticState(phase)%offsetDeltaState = sizeState-sizeDeltaState ! deltaState occupies latter part of state by definition - plasticState(phase)%Nslip = Nslip - plasticState(phase)%Ntwin = Ntwin - plasticState(phase)%Ntrans= Ntrans allocate(plasticState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) diff --git a/src/prec.f90 b/src/prec.f90 index f0475e9b6..b6d5d4fdf 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -62,10 +62,6 @@ module prec end type type, extends(tState), public :: tPlasticState - integer :: & - nSlip = 0, & - nTwin = 0, & - nTrans = 0 logical :: & nonlocal = .false. real(pReal), pointer, dimension(:,:) :: &