2009-08-31 20:39:15 +05:30
|
|
|
!* $Id$
|
2007-03-22 17:39:37 +05:30
|
|
|
!********************************************************************
|
2009-03-23 21:38:17 +05:30
|
|
|
! Material subroutine for MSC.Marc
|
|
|
|
!
|
|
|
|
! written by P. Eisenlohr,
|
|
|
|
! F. Roters,
|
|
|
|
! L. Hantcherli,
|
|
|
|
! W.A. Counts
|
|
|
|
! D.D. Tjahjanto
|
2009-08-31 20:39:15 +05:30
|
|
|
! C. Kords
|
2007-03-22 17:39:37 +05:30
|
|
|
!
|
|
|
|
! MPI fuer Eisenforschung, Duesseldorf
|
|
|
|
!
|
|
|
|
!********************************************************************
|
|
|
|
! Usage:
|
|
|
|
! - choose material as hypela2
|
2009-03-04 17:18:54 +05:30
|
|
|
! - set statevariable 2 to index of homogenization
|
|
|
|
! - set statevariable 3 to index of microstructure
|
|
|
|
! - make sure the file "material.config" exists in the working
|
2007-03-22 17:39:37 +05:30
|
|
|
! directory
|
2009-06-15 18:41:21 +05:30
|
|
|
! - make sure the file "numerics.config" exists in the working
|
|
|
|
! directory
|
2007-04-11 18:51:22 +05:30
|
|
|
! - use nonsymmetric option for solver (e.g. direct
|
|
|
|
! profile or multifrontal sparse, the latter seems
|
|
|
|
! to be faster!)
|
2009-03-23 21:38:17 +05:30
|
|
|
! - in case of ddm (domain decomposition)a SYMMETRIC
|
|
|
|
! solver has to be used, i.e uncheck "non-symmetric"
|
2007-03-22 17:39:37 +05:30
|
|
|
!********************************************************************
|
|
|
|
! Marc subroutines used:
|
|
|
|
! - hypela2
|
|
|
|
! - plotv
|
|
|
|
! - quit
|
|
|
|
!********************************************************************
|
|
|
|
! Marc common blocks included:
|
2007-03-26 15:57:34 +05:30
|
|
|
! - concom: lovl, ncycle, inc, incsub
|
2007-03-22 17:39:37 +05:30
|
|
|
! - creeps: timinc
|
|
|
|
!********************************************************************
|
|
|
|
!
|
2009-08-31 20:39:15 +05:30
|
|
|
subroutine mpie_cpfem_init
|
|
|
|
write(6,*)
|
|
|
|
write(6,*) '<<<+- mpie_cpfem init -+>>>'
|
|
|
|
write(6,*) '$Id$'
|
|
|
|
write(6,*)
|
|
|
|
return
|
|
|
|
end subroutine
|
|
|
|
|
2008-09-22 14:06:51 +05:30
|
|
|
include "prec.f90" ! uses nothing else
|
2009-08-27 21:00:40 +05:30
|
|
|
include "IO.f90" ! uses prec
|
2009-06-15 18:41:21 +05:30
|
|
|
include "numerics.f90" ! uses prec, IO
|
2009-08-27 21:00:40 +05:30
|
|
|
include "math.f90" ! uses prec, numerics
|
2009-06-15 18:41:21 +05:30
|
|
|
include "debug.f90" ! uses prec, numerics
|
2009-01-20 00:40:58 +05:30
|
|
|
include "FEsolving.f90" ! uses prec, IO
|
2009-05-07 21:57:36 +05:30
|
|
|
include "mesh.f90" ! uses prec, math, IO, FEsolving
|
2009-03-04 17:18:54 +05:30
|
|
|
include "material.f90" ! uses prec, math, IO, mesh
|
2009-05-07 21:57:36 +05:30
|
|
|
include "lattice.f90" ! uses prec, math, IO, material
|
2009-08-11 22:01:57 +05:30
|
|
|
include "constitutive_phenopowerlaw.f90" ! uses prec, math, IO, lattice, material, debug
|
|
|
|
include "constitutive_j2.f90" ! uses prec, math, IO, lattice, material, debug
|
|
|
|
include "constitutive_dislobased.f90" ! uses prec, math, IO, lattice, material, debug
|
|
|
|
include "constitutive_nonlocal.f90" ! uses prec, math, IO, lattice, material, debug
|
2008-09-22 14:06:51 +05:30
|
|
|
include "constitutive.f90" ! uses prec, IO, math, lattice, mesh, debug
|
2009-06-15 18:41:21 +05:30
|
|
|
include "crystallite.f90" ! uses prec, math, IO, numerics
|
2009-08-11 22:01:57 +05:30
|
|
|
include "homogenization_isostrain.f90" ! uses prec, math, IO,
|
|
|
|
include "homogenization_RGC.f90" ! uses prec, math, IO, numerics, mesh: added <<<updated 31.07.2009>>>
|
2009-06-15 18:41:21 +05:30
|
|
|
include "homogenization.f90" ! uses prec, math, IO, numerics
|
|
|
|
include "CPFEM.f90" ! uses prec, math, IO, numerics, debug, FEsolving, mesh, lattice, constitutive, crystallite
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2007-03-22 17:39:37 +05:30
|
|
|
!********************************************************************
|
|
|
|
! This is the Marc material routine
|
|
|
|
!********************************************************************
|
|
|
|
!
|
2007-10-16 18:52:39 +05:30
|
|
|
! ************* user subroutine for defining material behavior **************
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! CAUTION : Due to calculation of the Deformation gradients, Stretch Tensors and
|
|
|
|
! Rotation tensors at previous and current states, the analysis can be
|
|
|
|
! computationally expensive. Please use the user subroutine -> hypela
|
|
|
|
! if these kinematic quantities are not needed in the constitutive model
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! IMPORTANT NOTES :
|
|
|
|
!
|
|
|
|
! (1) F,R,U are only available for continuum and membrane elements (not for
|
|
|
|
! shells and beams).
|
|
|
|
!
|
|
|
|
! (2) For total Lagrangian formulation use the -> 'Elasticity,1' card(=
|
|
|
|
! total Lagrange with large disp) in the parameter section of input deck.
|
|
|
|
! For updated Lagrangian formulation use the -> 'Plasticity,3' card(=
|
|
|
|
! update+finite+large disp+constant d) in the parameter section of
|
|
|
|
! input deck.
|
|
|
|
!
|
|
|
|
! The following operation obtains U (stretch tensor) at t=n+1 :
|
|
|
|
!
|
|
|
|
! call scla(un1,0.d0,itel,itel,1)
|
|
|
|
! do 3 k=1,3
|
|
|
|
! do 2 i=1,3
|
|
|
|
! do 1 j=1,3
|
|
|
|
! un1(i,j)=un1(i,j)+dsqrt(strechn1(k))*eigvn1(i,k)*eigvn1(j,k)
|
|
|
|
!1 continue
|
|
|
|
!2 continue
|
|
|
|
!3 continue
|
|
|
|
!
|
2009-05-07 21:57:36 +05:30
|
|
|
!********************************************************************
|
|
|
|
subroutine hypela2(&
|
|
|
|
d,& ! stress strain law to be formed
|
|
|
|
g,& ! change in stress due to temperature effects
|
|
|
|
e,& ! total elastic strain
|
|
|
|
de,& ! increment of strain
|
|
|
|
s,& ! stress - should be updated by user
|
|
|
|
t,& ! state variables (comes in at t=n, must be updated to have state variables at t=n+1)
|
|
|
|
dt,& ! increment of state variables
|
|
|
|
ngens,& ! size of stress - strain law
|
|
|
|
n,& ! element number
|
|
|
|
nn,& ! integration point number
|
|
|
|
kcus,& ! (1) layer number, (2) internal layer number
|
|
|
|
matus,& ! (1) user material identification number, (2) internal material identification number
|
|
|
|
ndi,& ! number of direct components
|
|
|
|
nshear,& ! number of shear components
|
|
|
|
disp,& ! incremental displacements
|
|
|
|
dispt,& ! displacements at t=n (at assembly, lovl=4) and displacements at t=n+1 (at stress recovery, lovl=6)
|
|
|
|
coord,& ! coordinates
|
|
|
|
ffn,& ! deformation gradient
|
|
|
|
frotn,& ! rotation tensor
|
|
|
|
strechn,& ! square of principal stretch ratios, lambda(i)
|
|
|
|
eigvn,& ! i principal direction components for j eigenvalues
|
|
|
|
ffn1,& ! deformation gradient
|
|
|
|
frotn1,& ! rotation tensor
|
|
|
|
strechn1,& ! square of principal stretch ratios, lambda(i)
|
|
|
|
eigvn1,& ! i principal direction components for j eigenvalues
|
|
|
|
ncrd,& ! number of coordinates
|
|
|
|
itel,& ! dimension of F and R, either 2 or 3
|
|
|
|
ndeg,& ! number of degrees of freedom ==> is this at correct list position ?!?
|
|
|
|
ndm,& !
|
|
|
|
nnode,& ! number of nodes per element
|
|
|
|
jtype,& ! element type
|
|
|
|
lclass,& ! element class
|
|
|
|
ifr,& ! set to 1 if R has been calculated
|
|
|
|
ifu & ! set to 1 if stretch has been calculated
|
|
|
|
)
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
use prec, only: pReal, &
|
|
|
|
pInt
|
|
|
|
use FEsolving, only: cycleCounter, &
|
|
|
|
theInc, &
|
|
|
|
theCycle, &
|
|
|
|
theLovl, &
|
|
|
|
theTime, &
|
|
|
|
lastIncConverged, &
|
|
|
|
outdatedByNewInc, &
|
|
|
|
outdatedFFN1, &
|
2009-08-12 13:40:28 +05:30
|
|
|
terminallyIll, &
|
2009-06-15 18:41:21 +05:30
|
|
|
symmetricSolver
|
|
|
|
use CPFEM, only: CPFEM_general
|
|
|
|
use math, only: invnrmMandel
|
|
|
|
use debug, only: debug_info, &
|
|
|
|
debug_reset
|
2009-03-04 17:18:54 +05:30
|
|
|
implicit none
|
|
|
|
|
|
|
|
! ** Start of generated type statements **
|
|
|
|
real(pReal) coord, d, de, disp, dispt, dt, e, eigvn, eigvn1, ffn, ffn1
|
|
|
|
real(pReal) frotn, frotn1, g
|
|
|
|
integer(pInt) ifr, ifu, itel, jtype, kcus, lclass, matus, n, ncrd, ndeg
|
|
|
|
integer(pInt) ndi, ndm, ngens, nn, nnode, nshear
|
|
|
|
real(pReal) s, strechn, strechn1, t
|
|
|
|
! ** End of generated type statements **
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2008-03-15 03:02:57 +05:30
|
|
|
dimension e(*),de(*),t(*),dt(*),g(*),d(ngens,*),s(*), n(2),coord(ncrd,*),disp(ndeg,*),matus(2),dispt(ndeg,*),ffn(itel,*),&
|
2009-04-22 19:51:18 +05:30
|
|
|
frotn(itel,*),strechn(itel),eigvn(itel,*),ffn1(itel,*),frotn1(itel,*),strechn1(itel),eigvn1(itel,*),kcus(2), lclass(2)
|
2008-03-15 03:02:57 +05:30
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
! Marc common blocks are in fixed format so they have to be reformated to free format (f90)
|
|
|
|
! Beware of changes in newer Marc versions
|
|
|
|
|
2009-03-23 21:38:17 +05:30
|
|
|
include "concom%%MARCVERSION%%" ! concom is needed for inc, subinc, ncycle, lovl
|
|
|
|
include "creeps%%MARCVERSION%%" ! creeps is needed for timinc (time increment)
|
2007-10-16 18:52:39 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
integer(pInt) computationMode, i
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2008-03-15 03:02:57 +05:30
|
|
|
if (inc == 0) then
|
2008-07-14 20:08:19 +05:30
|
|
|
cycleCounter = 4
|
2008-03-15 03:02:57 +05:30
|
|
|
else
|
2009-08-11 22:01:57 +05:30
|
|
|
if (theCycle > ncycle .or. theInc /= inc) then
|
|
|
|
cycleCounter = 0 ! reset counter for each cutback or new inc
|
|
|
|
terminallyIll = .false.
|
|
|
|
endif
|
2009-01-20 00:40:58 +05:30
|
|
|
if (theCycle /= ncycle .or. theLovl /= lovl) then
|
|
|
|
cycleCounter = cycleCounter+1 ! ping pong
|
|
|
|
outdatedFFN1 = .false.
|
2009-03-04 17:18:54 +05:30
|
|
|
write (6,*) n(1),nn,'cycleCounter',cycleCounter
|
|
|
|
call debug_info() ! output of debugging/performance statistics of former
|
2009-05-07 21:57:36 +05:30
|
|
|
call debug_reset()
|
2008-07-14 20:08:19 +05:30
|
|
|
endif
|
2008-04-07 20:24:29 +05:30
|
|
|
endif
|
|
|
|
if (cptim > theTime .or. theInc /= inc) then ! reached convergence
|
|
|
|
lastIncConverged = .true.
|
|
|
|
outdatedByNewInc = .true.
|
2009-03-04 17:18:54 +05:30
|
|
|
write (6,*) n(1),nn,'lastIncConverged + outdated'
|
2008-03-15 03:02:57 +05:30
|
|
|
endif
|
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
if (mod(cycleCounter,2) /= 0) computationMode = 4 ! recycle in odd cycles
|
|
|
|
if (mod(cycleCounter,4) == 2) computationMode = 3 ! collect in 2,6,10,...
|
|
|
|
if (mod(cycleCounter,4) == 0) computationMode = 2 ! compute in 0,4,8,...
|
2008-04-07 20:24:29 +05:30
|
|
|
if (computationMode == 4 .and. ncycle == 0 .and. .not. lastIncConverged) &
|
|
|
|
computationMode = 6 ! recycle but restore known good consistent tangent
|
|
|
|
if (computationMode == 4 .and. lastIncConverged) then
|
|
|
|
computationMode = 5 ! recycle and record former consistent tangent
|
|
|
|
lastIncConverged = .false.
|
|
|
|
endif
|
2008-03-15 03:02:57 +05:30
|
|
|
if (computationMode == 2 .and. outdatedByNewInc) then
|
2008-04-07 20:24:29 +05:30
|
|
|
computationMode = 1 ! compute and age former results
|
2008-03-15 03:02:57 +05:30
|
|
|
outdatedByNewInc = .false.
|
2009-01-20 00:40:58 +05:30
|
|
|
endif
|
|
|
|
|
2008-04-07 20:24:29 +05:30
|
|
|
theTime = cptim ! record current starting time
|
|
|
|
theInc = inc ! record current increment number
|
|
|
|
theCycle = ncycle ! record current cycle count
|
|
|
|
theLovl = lovl ! record current lovl
|
2008-02-19 00:19:06 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
call CPFEM_general(computationMode,ffn,ffn1,t(1),timinc,n(1),nn,s,d,ngens)
|
2008-02-19 00:19:06 +05:30
|
|
|
|
|
|
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
|
|
|
! Marc: 11, 22, 33, 12, 23, 13
|
|
|
|
forall(i=1:ngens) d(1:ngens,i) = invnrmMandel(i)*d(1:ngens,i)*invnrmMandel(1:ngens)
|
|
|
|
s(1:ngens) = s(1:ngens)*invnrmMandel(1:ngens)
|
2008-09-22 14:06:51 +05:30
|
|
|
if(symmetricSolver) d(1:ngens,1:ngens) = 0.5_pReal*(d(1:ngens,1:ngens)+transpose(d(1:ngens,1:ngens)))
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2007-03-22 17:39:37 +05:30
|
|
|
return
|
2007-04-11 18:51:22 +05:30
|
|
|
|
2009-05-07 21:57:36 +05:30
|
|
|
end subroutine
|
|
|
|
|
2008-04-07 20:24:29 +05:30
|
|
|
|
2007-03-22 17:39:37 +05:30
|
|
|
!********************************************************************
|
|
|
|
! This routine sets user defined output variables for Marc
|
|
|
|
!********************************************************************
|
|
|
|
!
|
|
|
|
! select a variable contour plotting (user subroutine).
|
|
|
|
!
|
2007-10-16 18:52:39 +05:30
|
|
|
!********************************************************************
|
2009-05-07 21:57:36 +05:30
|
|
|
subroutine plotv(&
|
|
|
|
v,& ! variable
|
|
|
|
s,& ! stress array
|
|
|
|
sp,& ! stresses in preferred direction
|
|
|
|
etot,& ! total strain (generalized)
|
|
|
|
eplas,& ! total plastic strain
|
|
|
|
ecreep,& ! total creep strain
|
|
|
|
t,& ! current temperature
|
|
|
|
m,& ! element number
|
|
|
|
nn,& ! integration point number
|
|
|
|
layer,& ! layer number
|
|
|
|
ndi,& ! number of direct stress components
|
|
|
|
nshear,& ! number of shear stress components
|
|
|
|
jpltcd & ! user variable index
|
|
|
|
)
|
2007-10-16 18:52:39 +05:30
|
|
|
use prec, only: pReal,pInt
|
|
|
|
use mesh, only: mesh_FEasCP
|
2009-05-07 21:57:36 +05:30
|
|
|
use homogenization, only: materialpoint_results
|
2007-03-22 17:39:37 +05:30
|
|
|
implicit none
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2007-03-22 17:39:37 +05:30
|
|
|
real(pReal) s(*),etot(*),eplas(*),ecreep(*),sp(*)
|
|
|
|
real(pReal) v, t(*)
|
2007-10-16 18:52:39 +05:30
|
|
|
integer(pInt) m, nn, layer, ndi, nshear, jpltcd
|
2009-05-07 21:57:36 +05:30
|
|
|
|
|
|
|
v = materialpoint_results(jpltcd,nn,mesh_FEasCP('elem', m))
|
2007-03-22 17:39:37 +05:30
|
|
|
return
|
2009-05-07 21:57:36 +05:30
|
|
|
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-28 13:42:48 +05:30
|
|
|
! subroutine utimestep(timestep,timestepold,icall,time,timeloadcase)
|
2007-03-22 17:39:37 +05:30
|
|
|
!********************************************************************
|
|
|
|
! This routine modifies the addaptive time step of Marc
|
|
|
|
!********************************************************************
|
2007-03-28 13:42:48 +05:30
|
|
|
! use prec, only: pReal,pInt
|
|
|
|
! use CPFEM, only : CPFEM_timefactor_max
|
|
|
|
! implicit none
|
2007-03-22 17:39:37 +05:30
|
|
|
!
|
2007-03-28 13:42:48 +05:30
|
|
|
! real(pReal) timestep, timestepold, time,timeloadcase
|
|
|
|
! integer(pInt) icall
|
2007-03-22 17:39:37 +05:30
|
|
|
!
|
|
|
|
! user subroutine for modifying the time step in auto step
|
|
|
|
!
|
|
|
|
! timestep : the current time step as suggested by marc
|
|
|
|
! to be modified in this routine
|
|
|
|
! timestepold : the current time step before it was modified by marc
|
|
|
|
! icall : =1 for setting the initial time step
|
|
|
|
! =2 if this routine is called during an increment
|
|
|
|
! =3 if this routine is called at the beginning
|
|
|
|
! of the increment
|
|
|
|
! time : time at the start of the current increment
|
|
|
|
! timeloadcase: time period of the current load case
|
|
|
|
!
|
|
|
|
! it is in general not recommended to increase the time step
|
|
|
|
! during the increment.
|
|
|
|
! this routine is called right after the time step has (possibly)
|
|
|
|
! been updated by marc.
|
|
|
|
!
|
|
|
|
! user coding
|
|
|
|
! reduce timestep during increment in case mpie_timefactor is too large
|
2007-03-28 13:42:48 +05:30
|
|
|
! if(icall==2_pInt) then
|
|
|
|
! if(mpie_timefactor_max>1.25_pReal) then
|
|
|
|
! timestep=min(timestep,timestepold*0.8_pReal)
|
|
|
|
! end if
|
|
|
|
! return
|
2007-03-22 17:39:37 +05:30
|
|
|
! modify timestep at beginning of new increment
|
2007-03-28 13:42:48 +05:30
|
|
|
! else if(icall==3_pInt) then
|
|
|
|
! if(mpie_timefactor_max<=0.8_pReal) then
|
|
|
|
! timestep=min(timestep,timestepold*1.25_pReal)
|
|
|
|
! else if (mpie_timefactor_max<=1.0_pReal) then
|
|
|
|
! timestep=min(timestep,timestepold/mpie_timefactor_max)
|
|
|
|
! else if (mpie_timefactor_max<=1.25_pReal) then
|
|
|
|
! timestep=min(timestep,timestepold*1.01_pReal)
|
|
|
|
! else
|
|
|
|
! timestep=min(timestep,timestepold*0.8_pReal)
|
|
|
|
! end if
|
|
|
|
! end if
|
|
|
|
! return
|
2009-03-04 17:18:54 +05:30
|
|
|
! end
|