From 9f0fe873ba5cadb02855a290068433a0e553254d Mon Sep 17 00:00:00 2001 From: Christoph Kords Date: Fri, 2 Aug 2013 16:19:45 +0000 Subject: [PATCH] plain mode (no ping pong) now seems to work for marc, further testing needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit regular sequence of computation modes is inc 0: 1,1,1,… inc 1: 0,0,0,… 7,1,1,… 0,0,0,… 1,1,1,… and so on after a cutback the computation modes follow as inc 5: 8,0,0,… 1,1,1,… 0,0,0,… 1,1,1,… --- code/DAMASK_marc.f90 | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/code/DAMASK_marc.f90 b/code/DAMASK_marc.f90 index c5b9ef107..e94d5e5c7 100644 --- a/code/DAMASK_marc.f90 +++ b/code/DAMASK_marc.f90 @@ -299,8 +299,8 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & computationMode = 0_pInt ! save initialization value, since it does not result in any calculation if (lovl == 4 ) then ! jacobian requested by marc - if (timinc < theDelta .and. theInc == inc .and. lastLovl /= lovl) & - computationMode = CPFEM_RESTOREJACOBIAN ! first after cutback + if (timinc < theDelta .and. theInc == inc .and. lastLovl /= lovl) & ! first after cutback + computationMode = CPFEM_RESTOREJACOBIAN elseif (lovl == 6) then ! stress requested by marc cp_en = mesh_FEasCP('elem',m(1)) if (cptim > theTime .or. inc /= theInc) then ! reached "convergence" @@ -333,6 +333,8 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & !$OMP END CRITICAL (write2out) endif else if ( timinc < theDelta ) then ! >> cutBack << + lastIncConverged = .false. ! no Jacobian backup + outdatedByNewInc = .false. ! no aging of state terminallyIll = .false. cycleCounter = -1 ! first calc step increments this to cycle = 0 calcMode = .true. ! pretend last step was calculation @@ -346,6 +348,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & if (usePingPong) then calcMode(nn,cp_en) = .not. calcMode(nn,cp_en) ! ping pong (calc <--> collect) if (calcMode(nn,cp_en)) then ! now --- CALC --- + computationMode = CPFEM_CALCRESULTS if (lastLovl /= lovl) then ! first after ping pong call debug_reset() ! resets debugging outdatedFFN1 = .false. @@ -354,25 +357,42 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & call mesh_build_ipCoordinates() ! update ip coordinates endif if (outdatedByNewInc) then - computationMode = ior(CPFEM_CALCRESULTS,CPFEM_AGERESULTS) + computationMode = ior(computationMode,CPFEM_AGERESULTS) outdatedByNewInc = .false. ! reset flag - else - computationMode = CPFEM_CALCRESULTS endif else ! now --- COLLECT --- + computationMode = CPFEM_COLLECT ! plain collect if (lastLovl /= lovl .and. & .not. terminallyIll) & call debug_info() ! first after ping pong reports (meaningful) debugging if (lastIncConverged) then - computationMode = ior(CPFEM_COLLECT,CPFEM_BACKUPJACOBIAN) ! collect and backup Jacobian after convergence + computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN) ! collect and backup Jacobian after convergence lastIncConverged = .false. ! reset flag - else - computationMode = CPFEM_COLLECT ! plain collect endif do node = 1,FE_Nnodes(mesh_element(2,cp_en)) CPnodeID = mesh_element(4_pInt+node,cp_en) mesh_node(1:3,CPnodeID) = mesh_node0(1:3,CPnodeID) + numerics_unitlength * dispt(1:3,node) enddo endif + + else ! --- PLAIN MODE --- + computationMode = CPFEM_CALCRESULTS ! always calc + if (lastLovl /= lovl) then + if (.not. terminallyIll) & + call debug_info() ! first reports (meaningful) debugging + call debug_reset() ! and resets debugging + outdatedFFN1 = .false. + cycleCounter = cycleCounter + 1_pInt + mesh_cellnode = mesh_build_cellnodes(mesh_node,mesh_Ncellnodes) ! update cell node coordinates + call mesh_build_ipCoordinates() ! update ip coordinates + endif + if (outdatedByNewInc) then + computationMode = ior(computationMode,CPFEM_AGERESULTS) + outdatedByNewInc = .false. ! reset flag + endif + if (lastIncConverged) then + computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN) ! backup Jacobian after convergence + lastIncConverged = .false. ! reset flag + endif endif theTime = cptim ! record current starting time