2011-04-04 19:39:54 +05:30
|
|
|
|
! Copyright 2011 Max-Planck-Institut f<>r Eisenforschung GmbH
|
|
|
|
|
!
|
|
|
|
|
! This file is part of DAMASK,
|
|
|
|
|
! the D<>sseldorf Advanced MAterial Simulation Kit.
|
|
|
|
|
!
|
|
|
|
|
! DAMASK is free software: you can redistribute it and/or modify
|
|
|
|
|
! it under the terms of the GNU General Public License as published by
|
|
|
|
|
! the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
! (at your option) any later version.
|
|
|
|
|
!
|
|
|
|
|
! DAMASK is distributed in the hope that it will be useful,
|
|
|
|
|
! but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
! GNU General Public License for more details.
|
|
|
|
|
!
|
|
|
|
|
! You should have received a copy of the GNU General Public License
|
|
|
|
|
! along with DAMASK. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
!
|
|
|
|
|
!##############################################################
|
2009-10-12 21:31:49 +05:30
|
|
|
|
!* $Id$
|
|
|
|
|
!********************************************************************
|
|
|
|
|
! Material subroutine for Abaqus
|
|
|
|
|
!
|
|
|
|
|
! written by P. Eisenlohr,
|
|
|
|
|
! F. Roters,
|
2011-03-30 20:09:28 +05:30
|
|
|
|
! K. Janssens 2,
|
|
|
|
|
! A. Prakash 3
|
2009-10-12 21:31:49 +05:30
|
|
|
|
!
|
2011-03-30 20:09:28 +05:30
|
|
|
|
! MPI fuer Eisenforschung, Duesseldorf
|
|
|
|
|
! 2 PSI, Switzerland
|
|
|
|
|
! 3 Fraunhofer IWM, Freiburg
|
2009-10-12 22:02:57 +05:30
|
|
|
|
!
|
2011-03-29 19:19:50 +05:30
|
|
|
|
! REMARK: put the included file abaqus_v6.env in either your home
|
|
|
|
|
! or model directory, it is a minimum Abaqus environment file
|
|
|
|
|
! containing all changes necessary to use the MPIE subroutine
|
|
|
|
|
! (see Abaqus documentation for more information on the use of abaqus_v6.env)
|
2009-10-12 22:02:57 +05:30
|
|
|
|
!
|
2009-10-12 21:31:49 +05:30
|
|
|
|
!********************************************************************
|
|
|
|
|
|
2012-08-28 21:38:17 +05:30
|
|
|
|
#ifndef INT
|
|
|
|
|
#define INT 4
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef FLOAT
|
|
|
|
|
#define FLOAT 8
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
#define Abaqus
|
2010-05-10 20:32:59 +05:30
|
|
|
|
|
2012-08-28 21:38:17 +05:30
|
|
|
|
#include "prec.f90"
|
2010-05-10 20:32:59 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
module DAMASK_interface
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
implicit none
|
2013-02-13 16:26:50 +05:30
|
|
|
|
character(len=4), dimension(2), parameter :: InputFileExtension = ['.pes','.inp']
|
|
|
|
|
character(len=4), parameter :: LogFileExtension = '.log'
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
contains
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2011-02-21 20:07:38 +05:30
|
|
|
|
!--------------------
|
2011-05-11 22:31:03 +05:30
|
|
|
|
subroutine DAMASK_interface_init()
|
2011-02-21 20:07:38 +05:30
|
|
|
|
!--------------------
|
2009-10-12 21:31:49 +05:30
|
|
|
|
write(6,*)
|
2011-05-11 22:08:45 +05:30
|
|
|
|
write(6,*) '<<<+- DAMASK_abaqus init -+>>>'
|
2009-10-12 21:55:48 +05:30
|
|
|
|
write(6,*) '$Id$'
|
2013-02-25 22:04:59 +05:30
|
|
|
|
#include "compilation_info.f90"
|
2009-10-12 21:31:49 +05:30
|
|
|
|
write(6,*)
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
|
|
|
|
end subroutine DAMASK_interface_init
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2011-02-21 20:07:38 +05:30
|
|
|
|
!--------------------
|
2010-06-08 15:05:13 +05:30
|
|
|
|
function getSolverWorkingDirectoryName()
|
2011-02-21 20:07:38 +05:30
|
|
|
|
!--------------------
|
2010-05-10 20:32:59 +05:30
|
|
|
|
use prec
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
2010-05-10 20:32:59 +05:30
|
|
|
|
implicit none
|
2010-05-11 12:27:15 +05:30
|
|
|
|
character(1024) getSolverWorkingDirectoryName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
integer(pInt) LENOUTDIR
|
|
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
|
getSolverWorkingDirectoryName=''
|
|
|
|
|
CALL GETOUTDIR( getSolverWorkingDirectoryName, LENOUTDIR )
|
2011-03-03 15:59:59 +05:30
|
|
|
|
getSolverWorkingDirectoryName=trim(getSolverWorkingDirectoryName)//'/'
|
2010-05-11 12:27:15 +05:30
|
|
|
|
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
end function getSolverWorkingDirectoryName
|
2011-02-21 20:07:38 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!--------------------
|
2010-06-08 15:05:13 +05:30
|
|
|
|
function getSolverJobName()
|
2011-02-21 20:07:38 +05:30
|
|
|
|
!--------------------
|
2010-05-10 20:32:59 +05:30
|
|
|
|
use prec
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
2010-05-10 20:32:59 +05:30
|
|
|
|
implicit none
|
2010-05-11 12:27:15 +05:30
|
|
|
|
character(1024) getSolverJobName, JOBNAME
|
2010-05-10 20:32:59 +05:30
|
|
|
|
integer(pInt) LENJOBNAME
|
|
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
|
getSolverJobName=''
|
|
|
|
|
CALL GETJOBNAME(getSolverJobName , LENJOBNAME )
|
|
|
|
|
! write(6,*) 'getSolverJobName', getSolverJobName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
end function getSolverJobName
|
|
|
|
|
|
|
|
|
|
end module DAMASK_interface
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2011-03-29 12:57:19 +05:30
|
|
|
|
#include "IO.f90"
|
|
|
|
|
#include "numerics.f90"
|
|
|
|
|
#include "debug.f90"
|
|
|
|
|
#include "math.f90"
|
|
|
|
|
#include "FEsolving.f90"
|
|
|
|
|
#include "mesh.f90"
|
|
|
|
|
#include "material.f90"
|
|
|
|
|
#include "lattice.f90"
|
2012-08-25 00:51:39 +05:30
|
|
|
|
#include "constitutive_none.f90"
|
2011-03-29 12:57:19 +05:30
|
|
|
|
#include "constitutive_j2.f90"
|
|
|
|
|
#include "constitutive_phenopowerlaw.f90"
|
|
|
|
|
#include "constitutive_titanmod.f90"
|
|
|
|
|
#include "constitutive_dislotwin.f90"
|
|
|
|
|
#include "constitutive_nonlocal.f90"
|
|
|
|
|
#include "constitutive.f90"
|
|
|
|
|
#include "crystallite.f90"
|
|
|
|
|
#include "homogenization_isostrain.f90"
|
|
|
|
|
#include "homogenization_RGC.f90"
|
|
|
|
|
#include "homogenization.f90"
|
|
|
|
|
#include "CPFEM.f90"
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
|
|
subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
|
|
|
|
|
RPL,DDSDDT,DRPLDE,DRPLDT,STRAN,DSTRAN,&
|
|
|
|
|
TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CMNAME,NDI,NSHR,NTENS,&
|
|
|
|
|
NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,CELENT,&
|
|
|
|
|
DFGRD0,DFGRD1,NOEL,NPT,KSLAY,KSPT,KSTEP,KINC)
|
|
|
|
|
|
|
|
|
|
use prec, only: pReal, &
|
|
|
|
|
pInt
|
2012-11-14 20:08:10 +05:30
|
|
|
|
use numerics, only: numerics_unitlength
|
2009-10-12 21:31:49 +05:30
|
|
|
|
use FEsolving, only: cycleCounter, &
|
|
|
|
|
theInc, &
|
|
|
|
|
calcMode, &
|
|
|
|
|
lastMode, &
|
|
|
|
|
theTime, &
|
|
|
|
|
theDelta, &
|
|
|
|
|
lastIncConverged, &
|
|
|
|
|
outdatedByNewInc, &
|
|
|
|
|
outdatedFFN1, &
|
|
|
|
|
terminallyIll, &
|
|
|
|
|
symmetricSolver
|
|
|
|
|
use math, only: invnrmMandel
|
|
|
|
|
use debug, only: debug_info, &
|
2010-03-25 13:57:42 +05:30
|
|
|
|
debug_reset, &
|
2012-03-20 23:31:31 +05:30
|
|
|
|
debug_levelBasic, &
|
2012-07-05 15:24:50 +05:30
|
|
|
|
debug_level, &
|
2012-03-20 23:31:31 +05:30
|
|
|
|
debug_abaqus
|
2012-11-14 20:08:10 +05:30
|
|
|
|
use mesh, only: mesh_FEasCP, &
|
|
|
|
|
mesh_ipCoordinates
|
2013-03-01 17:18:29 +05:30
|
|
|
|
use CPFEM, only: &
|
|
|
|
|
CPFEM_general, &
|
|
|
|
|
CPFEM_init_done, &
|
|
|
|
|
CPFEM_initAll, &
|
|
|
|
|
CPFEM_CALCRESULTS, &
|
|
|
|
|
CPFEM_AGERESULTS, &
|
|
|
|
|
CPFEM_COLLECT, &
|
|
|
|
|
CPFEM_RESTOREJACOBIAN, &
|
|
|
|
|
CPFEM_BACKUPJACOBIAN
|
|
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
|
use homogenization, only: materialpoint_sizeResults, materialpoint_results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
2012-08-28 21:38:17 +05:30
|
|
|
|
CHARACTER(80) CMNAME
|
2009-10-12 21:31:49 +05:30
|
|
|
|
integer(pInt) ndi, nshr, ntens, nstatv, nprops, noel, npt,&
|
|
|
|
|
kslay, kspt, kstep, kinc
|
|
|
|
|
real(pReal) STRESS(NTENS),STATEV(NSTATV),&
|
|
|
|
|
DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),&
|
|
|
|
|
STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),&
|
|
|
|
|
PROPS(NPROPS),COORDS(3),DROT(3,3),&
|
|
|
|
|
DFGRD0(3,3),DFGRD1(3,3)
|
|
|
|
|
real(pReal) SSE, SPD, SCD, RPL, DRPLDT, DTIME, TEMP,&
|
|
|
|
|
DTEMP, PNEWDT, CELENT
|
2010-07-07 15:28:18 +05:30
|
|
|
|
real(pReal), dimension (3,3) :: pstress ! not used, but needed for call of cpfem_general
|
|
|
|
|
real(pReal), dimension (3,3,3,3) :: dPdF ! not used, but needed for call of cpfem_general
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
|
|
! local variables
|
|
|
|
|
real(pReal), dimension(6) :: stress_h
|
|
|
|
|
real(pReal), dimension(6,6) :: ddsdde_h
|
|
|
|
|
integer(pInt) computationMode, i, cp_en
|
|
|
|
|
|
2012-07-05 15:24:50 +05:30
|
|
|
|
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0 .and. noel == 1 .and. npt == 1) then
|
2010-03-25 13:57:42 +05:30
|
|
|
|
!$OMP CRITICAL (write2out)
|
|
|
|
|
write(6,*) 'el',noel,'ip',npt
|
|
|
|
|
write(6,*) 'got kinc as',kinc
|
|
|
|
|
write(6,*) 'got dStran',dstran
|
|
|
|
|
call flush(6)
|
|
|
|
|
!$OMP END CRITICAL (write2out)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
endif
|
|
|
|
|
|
2011-03-07 18:19:27 +05:30
|
|
|
|
if (.not. CPFEM_init_done) call CPFEM_initAll(temp,noel,npt)
|
|
|
|
|
|
|
|
|
|
cp_en = mesh_FEasCP('elem',noel)
|
|
|
|
|
if (time(2) > theTime .or. kinc /= theInc) then ! reached convergence
|
|
|
|
|
terminallyIll = .false.
|
|
|
|
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
2011-03-23 21:50:12 +05:30
|
|
|
|
if (kinc == 1) then ! >> start of analysis <<
|
2011-03-07 18:19:27 +05:30
|
|
|
|
lastIncConverged = .false. ! no Jacobian backup
|
|
|
|
|
outdatedByNewInc = .false. ! no aging of state
|
|
|
|
|
lastMode = .false. ! pretend last step was collection
|
|
|
|
|
calcMode = .false. ! pretend last step was collection
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-08-28 21:38:17 +05:30
|
|
|
|
write (6,'(i8,1x,i2,1x,a)') noel,npt,'<< UMAT >> start of analysis..!'; call flush(6)
|
2011-03-07 18:19:27 +05:30
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
else if (kinc - theInc > 1) then ! >> restart of broken analysis <<
|
|
|
|
|
lastIncConverged = .false. ! no Jacobian backup
|
|
|
|
|
outdatedByNewInc = .false. ! no aging of state
|
|
|
|
|
lastMode = .true. ! pretend last step was calculation
|
|
|
|
|
calcMode = .true. ! pretend last step was calculation
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-08-28 21:38:17 +05:30
|
|
|
|
write (6,'(i8,1x,i2,1x,a)') noel,npt,'<< UMAT >> restart of analysis..!'; call flush(6)
|
2011-03-07 18:19:27 +05:30
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
else ! >> just the next inc <<
|
|
|
|
|
lastIncConverged = .true. ! request Jacobian backup
|
|
|
|
|
outdatedByNewInc = .true. ! request aging of state
|
|
|
|
|
lastMode = .true. ! assure last step was calculation
|
|
|
|
|
calcMode = .true. ! assure last step was calculation
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-08-28 21:38:17 +05:30
|
|
|
|
write (6,'(i8,1x,i2,1x,a)') noel,npt,'<< UMAT >> new increment..!'; call flush(6)
|
2011-03-07 18:19:27 +05:30
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
endif
|
|
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
|
else if ( dtime < theDelta ) then ! >> cutBack <<
|
2011-03-07 18:19:27 +05:30
|
|
|
|
terminallyIll = .false.
|
|
|
|
|
cycleCounter = -1 ! first calc step increments this to cycle = 0
|
|
|
|
|
calcMode = .true. ! pretend last step was calculation
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-08-28 21:38:17 +05:30
|
|
|
|
write(6,'(i8,1x,i2,1x,a)') noel,npt,'<< UMAT >> cutback detected..!'; call flush(6)
|
2011-03-07 18:19:27 +05:30
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
|
|
|
|
|
endif ! convergence treatment end
|
|
|
|
|
|
|
|
|
|
calcMode(npt,cp_en) = .not. calcMode(npt,cp_en) ! ping pong (calc <--> collect)
|
|
|
|
|
|
2013-03-01 17:18:29 +05:30
|
|
|
|
if (calcMode(npt,cp_en)) then ! now calc
|
|
|
|
|
computationMode = CPFEM_CALCRESULTS
|
|
|
|
|
if ( lastMode .neqv. calcMode(npt,cp_en) ) then ! first after ping pong
|
|
|
|
|
call debug_reset() ! resets debugging
|
|
|
|
|
outdatedFFN1 = .false.
|
|
|
|
|
cycleCounter = cycleCounter + 1
|
|
|
|
|
endif
|
|
|
|
|
if(outdatedByNewInc) then
|
|
|
|
|
outdatedByNewInc = .false.
|
|
|
|
|
computationMode = ior(computationMode,CPFEM_AGERESULTS) ! calc and age results
|
|
|
|
|
endif
|
2011-03-07 18:19:27 +05:30
|
|
|
|
else ! now collect
|
2013-03-01 17:18:29 +05:30
|
|
|
|
computationMode = CPFEM_COLLECT
|
|
|
|
|
if(lastMode .neqv. calcMode(npt,cp_en) .and. .not. terminallyIll) then
|
|
|
|
|
call debug_info() ! first after ping pong reports debugging
|
|
|
|
|
endif
|
|
|
|
|
if (lastIncConverged) then
|
|
|
|
|
lastIncConverged = .false.
|
|
|
|
|
computationMode = ior(computationMode,CPFEM_BACKUPJACOBIAN) ! backup Jacobian after convergence
|
|
|
|
|
endif
|
|
|
|
|
mesh_ipCoordinates(1:3,npt,cp_en) = numerics_unitlength * COORDS
|
2009-10-12 21:31:49 +05:30
|
|
|
|
endif
|
2011-03-07 18:19:27 +05:30
|
|
|
|
|
|
|
|
|
theTime = time(2) ! record current starting time
|
|
|
|
|
theDelta = dtime ! record current time increment
|
|
|
|
|
theInc = kinc ! record current increment number
|
|
|
|
|
lastMode = calcMode(npt,cp_en) ! record calculationMode
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2012-07-05 15:24:50 +05:30
|
|
|
|
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0) then
|
2010-03-25 13:57:42 +05:30
|
|
|
|
!$OMP CRITICAL (write2out)
|
2012-08-28 21:38:17 +05:30
|
|
|
|
write(6,'(a16,1x,i2,1x,a,i8,a,i8,1x,i5,a)') 'computationMode',computationMode,'(',cp_en,':',noel,npt,')'; call flush(6)
|
2010-03-25 13:57:42 +05:30
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
endif
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2012-11-14 20:08:10 +05:30
|
|
|
|
call CPFEM_general(computationMode,dfgrd0,dfgrd1,temp,dtime,noel,npt,stress_h,ddsdde_h, pstress, dPdF)
|
2010-02-18 15:53:42 +05:30
|
|
|
|
|
|
|
|
|
! Mandel: 11, 22, 33, SQRT(2)*12, SQRT(2)*23, SQRT(2)*13
|
|
|
|
|
! straight: 11, 22, 33, 12, 23, 13
|
|
|
|
|
! ABAQUS explicit: 11, 22, 33, 12, 23, 13
|
|
|
|
|
! ABAQUS implicit: 11, 22, 33, 12, 13, 23
|
|
|
|
|
! ABAQUS implicit: 11, 22, 33, 12
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2010-02-18 15:53:42 +05:30
|
|
|
|
forall(i=1:ntens) ddsdde(1:ntens,i) = invnrmMandel(i)*ddsdde_h(1:ntens,i)*invnrmMandel(1:ntens)
|
|
|
|
|
stress(1:ntens) = stress_h(1:ntens)*invnrmMandel(1:ntens)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
if(symmetricSolver) ddsdde(1:ntens,1:ntens) = 0.5_pReal*(ddsdde(1:ntens,1:ntens) + transpose(ddsdde(1:ntens,1:ntens)))
|
|
|
|
|
if(ntens == 6) then
|
2010-02-18 15:53:42 +05:30
|
|
|
|
stress_h = stress
|
|
|
|
|
stress(5) = stress_h(6)
|
|
|
|
|
stress(6) = stress_h(5)
|
|
|
|
|
ddsdde_h = ddsdde
|
|
|
|
|
ddsdde(:,5) = ddsdde_h(:,6)
|
|
|
|
|
ddsdde(:,6) = ddsdde_h(:,5)
|
|
|
|
|
ddsdde_h = ddsdde
|
|
|
|
|
ddsdde(5,:) = ddsdde_h(6,:)
|
|
|
|
|
ddsdde(6,:) = ddsdde_h(5,:)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
statev = materialpoint_results(1:min(nstatv,materialpoint_sizeResults),npt,mesh_FEasCP('elem', noel))
|
|
|
|
|
|
2011-03-07 18:19:27 +05:30
|
|
|
|
if ( terminallyIll ) pnewdt = 0.5_pReal ! force cutback directly ?
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
end subroutine UMAT
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
|
! This subroutine replaces the corresponding Marc subroutine
|
|
|
|
|
!********************************************************************
|
|
|
|
|
subroutine quit(mpie_error)
|
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
|
use prec, only: pInt
|
|
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
|
implicit none
|
|
|
|
|
integer(pInt) mpie_error
|
2012-10-02 18:16:58 +05:30
|
|
|
|
flush(6)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
call xit
|
2012-06-15 21:40:21 +05:30
|
|
|
|
end subroutine quit
|