From 0ca7f01186d588d9402eade73457244a48f5bb8a Mon Sep 17 00:00:00 2001 From: Luv Sharma Date: Wed, 11 Jun 2014 16:52:18 +0000 Subject: [PATCH] fixed previous incomplete commit and few other trivial changes in newstate --- code/constitutive.f90 | 13 ++++++------- code/constitutive_j2.f90 | 4 ++-- code/constitutive_phenopowerlaw.f90 | 15 ++++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/constitutive.f90 b/code/constitutive.f90 index 8a4d4fabd..37804f5d1 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -13,6 +13,9 @@ module constitutive implicit none private + real(pReal), public, dimension(:,:,:), allocatable :: & + constitutive_localDamage, & + constitutive_gradientDamage #ifndef NEWSTATE type(p_vec), public, dimension(:,:,:), allocatable :: & constitutive_state0, & !< pointer array to microstructure at start of BVP inc @@ -29,9 +32,6 @@ module constitutive constitutive_aTolState !< pointer array to absolute state tolerance type(p_vec), public, dimension(:,:,:,:), allocatable :: & constitutive_RKCK45dotState !< pointer array to evolution of microstructure used by Cash-Karp Runge-Kutta method - real(pReal), public, dimension(:,:,:), allocatable :: & - constitutive_localDamage, & - constitutive_gradientDamage integer(pInt), public, dimension(:,:,:), allocatable :: & constitutive_sizeDotState, & !< size of dotState array constitutive_sizeState, & !< size of state array per grain @@ -240,11 +240,11 @@ subroutine constitutive_init eMax = mesh_NcpElems allocate(constitutive_sizePostResults(cMax,iMax,eMax), source=0_pInt) + allocate(constitutive_localDamage(cMax,iMax,eMax)); constitutive_localDamage = 1.0_pReal + allocate(constitutive_gradientDamage(cMax,iMax,eMax)); constitutive_gradientDamage = 1.0_pReal #ifndef NEWSTATE ! lumped into new state - allocate(constitutive_state0(cMax,iMax,eMax)) - allocate(constitutive_localDamage(cMax,iMax,eMax)); constitutive_localDamage = 1.0_pReal - allocate(constitutive_gradientDamage(cMax,iMax,eMax)); constitutive_gradientDamage = 1.0_pReal + allocate(constitutive_state0(cMax,iMax,eMax)) allocate(constitutive_partionedState0(cMax,iMax,eMax)) allocate(constitutive_subState0(cMax,iMax,eMax)) allocate(constitutive_state(cMax,iMax,eMax)) @@ -802,7 +802,6 @@ use math, only : & FeT = math_transpose33(Fe) T = 0.5_pReal*math_mul3333xx33(C,math_mul33x33(FeT,Fe)-MATH_I3)*constitutive_gradientDamage(ipc,ip,el) - dT_dFe = 0.0_pReal forall (i=1_pInt:3_pInt, j=1_pInt:3_pInt, k=1_pInt:3_pInt, l=1_pInt:3_pInt) & dT_dFe(i,j,k,l) = math_mul3x3(C(i,j,l,1:3),Fe(k,1:3)) ! dT*_ij/dFe_kl diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90 index 11002aa22..d20c91788 100644 --- a/code/constitutive_j2.f90 +++ b/code/constitutive_j2.f90 @@ -313,7 +313,8 @@ subroutine constitutive_j2_init(fileUnit) #ifdef NEWSTATE sizeState = 1 plasticState(phase)%sizeState = sizeState - plasticState(phase)%sizeDotState = sizeState + sizeDotState = sizeState + plasticState(phase)%sizeDotState = sizeDotState allocate(plasticState(phase)%state0 (sizeState,NofMyPhase),source=constitutive_j2_tau0(instance)) allocate(plasticState(phase)%partionedState0(sizeState,NofMyPhase),source=constitutive_j2_tau0(instance)) allocate(plasticState(phase)%subState0 (sizeState,NofMyPhase),source=0.0_pReal) @@ -456,7 +457,6 @@ pure subroutine constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,state,ip dLp_dTstar99 = math_Plain3333to99(gamma_dot / constitutive_j2_fTaylor(instance) * & dLp_dTstar_3333 / norm_Tstar_dev) end if - end subroutine constitutive_j2_LpAndItsTangent diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90 index 50791b8d5..4808036ab 100644 --- a/code/constitutive_phenopowerlaw.f90 +++ b/code/constitutive_phenopowerlaw.f90 @@ -506,6 +506,7 @@ allocate(constitutive_phenopowerlaw_sizePostResults(maxNinstance), constitutive_phenopowerlaw_totalNslip(instance)+ & constitutive_phenopowerlaw_totalNtwin(instance) ! s_slip, s_twin, sum(gamma), sum(f), accshear_slip, accshear_twin plasticState(phase)%sizeState = sizeState + sizeDotState = sizeState plasticState(phase)%sizeDotState = sizeState allocate(plasticState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(plasticState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) @@ -514,17 +515,17 @@ allocate(constitutive_phenopowerlaw_sizePostResults(maxNinstance), allocate(plasticState(phase)%state (sizeState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%deltaState (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup(sizeState,NofMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%deltaState (sizeDotState,NofMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%dotState_backup(sizeDotState,NofMyPhase), source=0.0_pReal) if (any(numerics_integrator == 1_pInt)) then - allocate(plasticState(phase)%previousDotState (sizeState,NofMyPhase),source=0.0_pReal) - allocate(plasticState(phase)%previousDotState2 (sizeState,NofMyPhase),source=0.0_pReal) + allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase),source=0.0_pReal) + allocate(plasticState(phase)%previousDotState2 (sizeDotState,NofMyPhase),source=0.0_pReal) endif if (any(numerics_integrator == 4_pInt)) & - allocate(plasticState(phase)%RK4dotState (sizeState,NofMyPhase), source=0.0_pReal) + allocate(plasticState(phase)%RK4dotState (sizeDotState,NofMyPhase), source=0.0_pReal) if (any(numerics_integrator == 5_pInt)) & - allocate(plasticState(phase)%RKCK45dotState (6,sizeState,NofMyPhase),source=0.0_pReal) + allocate(plasticState(phase)%RKCK45dotState (6,sizeDotState,NofMyPhase),source=0.0_pReal) #endif do f = 1_pInt,lattice_maxNslipFamily ! >>> interaction slip -- X index_myFamily = sum(constitutive_phenopowerlaw_Nslip(1:f-1_pInt,instance))