polishing
This commit is contained in:
parent
e952ab7127
commit
0a9902818c
|
@ -182,7 +182,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
use CPFEM
|
use CPFEM
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
!$ include "omp_lib.h" ! the openMP function library
|
include "omp_lib.h" ! the openMP function library
|
||||||
integer, intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
integer, intent(in) :: & ! according to MSC.Marc 2012 Manual D
|
||||||
ngens, & !< size of stress-strain law
|
ngens, & !< size of stress-strain law
|
||||||
nn, & !< integration point number
|
nn, & !< integration point number
|
||||||
|
@ -240,7 +240,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
real(pReal), dimension(6) :: stress
|
real(pReal), dimension(6) :: stress
|
||||||
real(pReal), dimension(6,6) :: ddsdde
|
real(pReal), dimension(6,6) :: ddsdde
|
||||||
integer :: computationMode, i, cp_en, node, CPnodeID
|
integer :: computationMode, i, cp_en, node, CPnodeID
|
||||||
!$ integer(4) :: defaultNumThreadsInt !< default value set by Marc
|
integer(4) :: defaultNumThreadsInt !< default value set by Marc
|
||||||
|
|
||||||
if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0) then
|
if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0) then
|
||||||
write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn
|
write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn
|
||||||
|
@ -257,8 +257,8 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
transpose(ffn1)
|
transpose(ffn1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
||||||
!$ call omp_set_num_threads(1) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
|
call omp_set_num_threads(1) ! no openMP
|
||||||
|
|
||||||
if (.not. CPFEM_init_done) call CPFEM_initAll
|
if (.not. CPFEM_init_done) call CPFEM_initAll
|
||||||
|
|
||||||
|
@ -267,38 +267,34 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
if (timinc < theDelta .and. theInc == inc .and. lastLovl /= lovl) & ! first after cutback
|
if (timinc < theDelta .and. theInc == inc .and. lastLovl /= lovl) & ! first after cutback
|
||||||
computationMode = CPFEM_RESTOREJACOBIAN
|
computationMode = CPFEM_RESTOREJACOBIAN
|
||||||
elseif (lovl == 6) then ! stress requested by marc
|
elseif (lovl == 6) then ! stress requested by marc
|
||||||
|
computationMode = CPFEM_CALCRESULTS ! always calc
|
||||||
cp_en = mesh_FEM2DAMASK_elem(m(1))
|
cp_en = mesh_FEM2DAMASK_elem(m(1))
|
||||||
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
|
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
|
||||||
terminallyIll = .false.
|
terminallyIll = .false.
|
||||||
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
||||||
if (inc == 0) then ! >> start of analysis <<
|
if (inc == 0) then ! >> start of analysis <<
|
||||||
lastIncConverged = .false. ! no Jacobian backup
|
lastIncConverged = .false.
|
||||||
outdatedByNewInc = .false. ! no aging of state
|
outdatedByNewInc = .false.
|
||||||
lastLovl = lovl ! pretend that this is NOT the first after a lovl change
|
lastLovl = lovl ! pretend that this is NOT the first after a lovl change
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> start of analysis..! ',m(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> start of analysis..! ',m(1),nn
|
||||||
flush(6)
|
|
||||||
else if (inc - theInc > 1) then ! >> restart of broken analysis <<
|
else if (inc - theInc > 1) then ! >> restart of broken analysis <<
|
||||||
lastIncConverged = .false. ! no Jacobian backup
|
lastIncConverged = .false.
|
||||||
outdatedByNewInc = .false. ! no aging of state
|
outdatedByNewInc = .false.
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> restart of analysis..! ',m(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> restart of analysis..! ',m(1),nn
|
||||||
flush(6)
|
|
||||||
else ! >> just the next inc <<
|
else ! >> just the next inc <<
|
||||||
lastIncConverged = .true. ! request Jacobian backup
|
lastIncConverged = .true.
|
||||||
outdatedByNewInc = .true. ! request aging of state
|
outdatedByNewInc = .true.
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> new increment..! ',m(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> new increment..! ',m(1),nn
|
||||||
flush(6)
|
|
||||||
endif
|
endif
|
||||||
else if ( timinc < theDelta ) then ! >> cutBack <<
|
else if ( timinc < theDelta ) then ! >> cutBack <<
|
||||||
lastIncConverged = .false. ! no Jacobian backup
|
lastIncConverged = .false.
|
||||||
outdatedByNewInc = .false. ! no aging of state
|
outdatedByNewInc = .false.
|
||||||
terminallyIll = .false.
|
terminallyIll = .false.
|
||||||
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
||||||
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> cutback detected..! ',m(1),nn
|
write(6,'(a,i6,1x,i2)') '<< HYPELA2 >> cutback detected..! ',m(1),nn
|
||||||
flush(6)
|
|
||||||
endif ! convergence treatment end
|
endif ! convergence treatment end
|
||||||
|
flush(6)
|
||||||
|
|
||||||
|
|
||||||
computationMode = CPFEM_CALCRESULTS ! always calc
|
|
||||||
if (lastLovl /= lovl) then
|
if (lastLovl /= lovl) then
|
||||||
cycleCounter = cycleCounter + 1
|
cycleCounter = cycleCounter + 1
|
||||||
!mesh_cellnode = mesh_build_cellnodes() ! update cell node coordinates
|
!mesh_cellnode = mesh_build_cellnodes() ! update cell node coordinates
|
||||||
|
@ -306,19 +302,19 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
endif
|
endif
|
||||||
if (outdatedByNewInc) then
|
if (outdatedByNewInc) then
|
||||||
computationMode = ior(computationMode,CPFEM_AGERESULTS)
|
computationMode = ior(computationMode,CPFEM_AGERESULTS)
|
||||||
outdatedByNewInc = .false. ! reset flag
|
outdatedByNewInc = .false.
|
||||||
endif
|
endif
|
||||||
if (lastIncConverged) then
|
if (lastIncConverged) then
|
||||||
computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN) ! backup Jacobian after convergence
|
computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN)
|
||||||
lastIncConverged = .false. ! reset flag
|
lastIncConverged = .false.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
theTime = cptim ! record current starting time
|
theTime = cptim
|
||||||
theDelta = timinc ! record current time increment
|
theDelta = timinc
|
||||||
theInc = inc ! record current increment number
|
theInc = inc
|
||||||
|
|
||||||
endif
|
endif
|
||||||
lastLovl = lovl ! record lovl
|
lastLovl = lovl
|
||||||
|
|
||||||
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,m(1),nn,stress,ddsdde)
|
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,m(1),nn,stress,ddsdde)
|
||||||
|
|
||||||
|
@ -327,7 +323,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
|
||||||
g = 0.0_pReal
|
g = 0.0_pReal
|
||||||
if(symmetricSolver) d = 0.5_pReal*(d+transpose(d))
|
if(symmetricSolver) d = 0.5_pReal*(d+transpose(d))
|
||||||
|
|
||||||
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
||||||
|
|
||||||
end subroutine hypela2
|
end subroutine hypela2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue