From 3d2187cc07d5963d37d6ab2b4899de3f0ce92233 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 17 Jan 2016 13:29:42 +0000 Subject: [PATCH] moved some variables from FEsolving to more appropriate CPFEM module --- code/CPFEM.f90 | 32 ++++++++++++++++++++------------ code/DAMASK_abaqus_exp.f | 12 ++++++------ code/DAMASK_abaqus_std.f | 24 ++++++++++++------------ code/DAMASK_marc.f90 | 24 ++++++++++++------------ code/FEsolving.f90 | 19 ++++--------------- code/homogenization_RGC.f90 | 17 ----------------- 6 files changed, 54 insertions(+), 74 deletions(-) diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index 2b0af880a..66b8d0d22 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -14,18 +14,31 @@ module CPFEM private #if defined(Marc4DAMASK) || defined(Abaqus) real(pReal), parameter, private :: & - CPFEM_odd_stress = 1e15_pReal, & !< return value for stress in case of ping pong dummy cycle - CPFEM_odd_jacobian = 1e50_pReal !< return value for jacobian in case of ping pong dummy cycle + CPFEM_odd_stress = 1e15_pReal, & !< return value for stress in case of ping pong dummy cycle + CPFEM_odd_jacobian = 1e50_pReal !< return value for jacobian in case of ping pong dummy cycle real(pReal), dimension (:,:,:), allocatable, private :: & - CPFEM_cs !< Cauchy stress + CPFEM_cs !< Cauchy stress real(pReal), dimension (:,:,:,:), allocatable, private :: & - CPFEM_dcsdE !< Cauchy stress tangent + CPFEM_dcsdE !< Cauchy stress tangent real(pReal), dimension (:,:,:,:), allocatable, private :: & - CPFEM_dcsdE_knownGood !< known good tangent + CPFEM_dcsdE_knownGood !< known good tangent #endif + integer(pInt), public :: & + cycleCounter = 0_pInt, & !< needs description + theInc = -1_pInt, & !< needs description + lastLovl = 0_pInt, & !< lovl in previous call to marc hypela2 + lastStep = 0_pInt !< kstep in previous call to abaqus umat + real(pReal), public :: & + theTime = 0.0_pReal, & !< needs description + theDelta = 0.0_pReal + logical, public :: & + outdatedFFN1 = .false., & !< needs description + lastIncConverged = .false., & !< needs description + outdatedByNewInc = .false. !< needs description + logical, public, protected :: & - CPFEM_init_done = .false., & !< remember whether init has been done already - CPFEM_calc_done = .false. !< remember whether first ip has already calced the results + CPFEM_init_done = .false., & !< remember whether init has been done already + CPFEM_calc_done = .false. !< remember whether first ip has already calced the results integer(pInt), parameter, public :: & CPFEM_COLLECT = 2_pInt**0_pInt, & @@ -288,12 +301,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) debug_e, & debug_i use FEsolving, only: & - outdatedFFN1, & terminallyIll, & - cycleCounter, & - theInc, & - theTime, & - theDelta, & FEsolving_execElem, & FEsolving_execIP, & restartWrite diff --git a/code/DAMASK_abaqus_exp.f b/code/DAMASK_abaqus_exp.f index 9b3fe1d5f..d6d99a470 100644 --- a/code/DAMASK_abaqus_exp.f +++ b/code/DAMASK_abaqus_exp.f @@ -88,11 +88,6 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, & !$ use numerics, only: & !$ DAMASK_NumThreadsInt use FEsolving, only: & - cycleCounter, & - theTime, & - outdatedByNewInc, & - outdatedFFN1, & - terminallyIll, & symmetricSolver use math, only: & invnrmMandel @@ -111,7 +106,12 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, & CPFEM_init_done, & CPFEM_initAll, & CPFEM_CALCRESULTS, & - CPFEM_AGERESULTS + CPFEM_AGERESULTS, & + cycleCounter, & + theTime, & + outdatedByNewInc, & + outdatedFFN1, & + terminallyIll use homogenization, only: & materialpoint_sizeResults, & materialpoint_results diff --git a/code/DAMASK_abaqus_std.f b/code/DAMASK_abaqus_std.f index 48bebeb79..274d7a04e 100644 --- a/code/DAMASK_abaqus_std.f +++ b/code/DAMASK_abaqus_std.f @@ -87,17 +87,7 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,& !$ DAMASK_NumThreadsInt, & usePingPong use FEsolving, only: & - cycleCounter, & - theInc, & - calcMode, & - theTime, & - theDelta, & - lastIncConverged, & - outdatedByNewInc, & - outdatedFFN1, & - terminallyIll, & - symmetricSolver, & - lastStep + symmetricSolver use math, only: & invnrmMandel use debug, only: & @@ -118,7 +108,17 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,& CPFEM_AGERESULTS, & CPFEM_COLLECT, & CPFEM_RESTOREJACOBIAN, & - CPFEM_BACKUPJACOBIAN + CPFEM_BACKUPJACOBIAN, & + cycleCounter, & + theInc, & + calcMode, & + theTime, & + theDelta, & + lastIncConverged, & + outdatedByNewInc, & + outdatedFFN1, & + terminallyIll, & + lastStep use homogenization, only: & materialpoint_sizeResults, & materialpoint_results diff --git a/code/DAMASK_marc.f90 b/code/DAMASK_marc.f90 index 3d531dcf8..4d0935ec3 100644 --- a/code/DAMASK_marc.f90 +++ b/code/DAMASK_marc.f90 @@ -135,17 +135,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & numerics_unitlength, & usePingPong use FEsolving, only: & - cycleCounter, & - theInc, & - calcMode, & - theTime, & - theDelta, & - lastIncConverged, & - outdatedByNewInc, & - outdatedFFN1, & - terminallyIll, & - symmetricSolver, & - lastLovl + symmetricSolver use math, only: & math_transpose33,& invnrmMandel @@ -173,7 +163,17 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & CPFEM_AGERESULTS, & CPFEM_COLLECT, & CPFEM_RESTOREJACOBIAN, & - CPFEM_BACKUPJACOBIAN + CPFEM_BACKUPJACOBIAN, & + cycleCounter, & + theInc, & + calcMode, & + theTime, & + theDelta, & + lastIncConverged, & + outdatedByNewInc, & + outdatedFFN1, & + terminallyIll, & + lastLovl implicit none !$ include "omp_lib.h" ! the openMP function library diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 413c87f72..5e951da52 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -13,25 +13,14 @@ module FEsolving implicit none private - integer(pInt), public :: & !< needs description - cycleCounter = 0_pInt, & !< needs description - theInc = -1_pInt, & !< needs description - restartInc = 1_pInt, & !< needs description - lastLovl = 0_pInt, & !< lovl in previous call to marc hypela2 - lastStep = 0_pInt !< kstep in previous call to abaqus umat - - real(pReal), public :: & - theTime = 0.0_pReal, & !< needs description - theDelta = 0.0_pReal !< needs description + integer(pInt), public :: & + restartInc = 1_pInt !< needs description logical, public :: & - outdatedFFN1 = .false., & !< needs description - symmetricSolver = .false., & !< use a symmetric solver (FEM) + symmetricSolver = .false., & !< use a symmetric FEM solver restartWrite = .false., & !< write current state to enable restart restartRead = .false., & !< restart information to continue calculation from saved state - terminallyIll = .false., & !< at least one material point is terminally ill - lastIncConverged = .false., & !< needs description - outdatedByNewInc = .false. !< needs description + terminallyIll = .false. !< at least one material point is terminally ill integer(pInt), dimension(:,:), allocatable, public :: & FEsolving_execIP !< for ping-pong scheme always range to max IP, otherwise one specific IP diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 2170ce7a3..0229d4f67 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -336,9 +336,6 @@ subroutine homogenization_RGC_partitionDeformation(F,avgF,ip,el) homogenization_maxNgrains, & homogenization_Ngrains,& homogenization_typeInstance - use FEsolving, only: & - theInc,& - cycleCounter implicit none real(pReal), dimension (3,3,homogenization_maxNgrains), intent(out) :: F !< partioned F per grain @@ -351,20 +348,6 @@ subroutine homogenization_RGC_partitionDeformation(F,avgF,ip,el) integer(pInt), dimension (3) :: iGrain3 integer(pInt) :: homID, iGrain,iFace,i,j integer(pInt), parameter :: nFace = 6_pInt - -!-------------------------------------------------------------------------------------------------- -! debugging the overall deformation gradient - if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0_pInt) then - !$OMP CRITICAL (write2out) - write(6,'(1x,a,i3,a,i3,a)')'========== Increment: ',theInc,' Cycle: ',cycleCounter,' ==========' - write(6,'(1x,a32)')'Overall deformation gradient: ' - do i = 1_pInt,3_pInt - write(6,'(1x,3(e15.8,1x))')(avgF(i,j), j = 1_pInt,3_pInt) - enddo - write(6,*)' ' - flush(6) - !$OMP END CRITICAL (write2out) - endif !-------------------------------------------------------------------------------------------------- ! compute the deformation gradient of individual grains due to relaxations