2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
! $Id$
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2014-04-02 12:02:43 +05:30
|
|
|
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
|
2013-03-25 19:22:22 +05:30
|
|
|
!> @author Koen Janssens, Paul Scherrer Institut
|
|
|
|
!> @author Arun Prakash, Fraunhofer IWM
|
2013-03-25 23:15:58 +05:30
|
|
|
!> @brief interfaces DAMASK with Abaqus/Explicit
|
|
|
|
!> @details 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
|
|
|
|
!> DAMASK subroutine (see Abaqus documentation for more information on the use of abaqus_v6.env)
|
2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2010-02-18 15:53:42 +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"
|
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
module DAMASK_interface
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
implicit none
|
2013-03-25 19:22:22 +05:30
|
|
|
character(len=4), dimension(2), parameter :: INPUTFILEEXTENSION = ['.pes','.inp']
|
|
|
|
character(len=4), parameter :: LOGFILEEXTENSION = '.log'
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
contains
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief just reporting
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2016-01-27 22:18:27 +05:30
|
|
|
subroutine DAMASK_interface_init
|
2016-02-03 04:04:42 +05:30
|
|
|
integer, dimension(8) :: &
|
|
|
|
dateAndTime ! type default integer
|
|
|
|
call date_and_time(values = dateAndTime)
|
2016-01-27 22:18:27 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- DAMASK_abaqus_exp -+>>>'
|
2016-02-03 04:04:42 +05:30
|
|
|
write(6,'(/,a)') ' Version: '//DAMASKVERSION
|
|
|
|
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',&
|
|
|
|
dateAndTime(2),'/',&
|
|
|
|
dateAndTime(1)
|
|
|
|
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',&
|
|
|
|
dateAndTime(6),':',&
|
|
|
|
dateAndTime(7)
|
2016-01-27 22:18:27 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
|
2016-02-03 04:04:42 +05:30
|
|
|
#include "compilation_info.f90"
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
|
|
end subroutine DAMASK_interface_init
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-25 19:22:22 +05:30
|
|
|
|
2016-02-03 04:04:42 +05:30
|
|
|
|
2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2013-03-25 23:15:58 +05:30
|
|
|
!> @brief using Abaqus/Explicit function to get working directory name
|
2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
character(1024) function getSolverWorkingDirectoryName()
|
2012-06-15 21:40:21 +05:30
|
|
|
|
2010-05-10 20:32:59 +05:30
|
|
|
implicit none
|
2013-03-25 23:15:58 +05:30
|
|
|
integer :: lenOutDir
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
getSolverWorkingDirectoryName=''
|
2013-03-25 23:15:58 +05:30
|
|
|
call vgetOutDir(getSolverWorkingDirectoryName, lenOutDir)
|
2011-03-03 15:59:59 +05:30
|
|
|
getSolverWorkingDirectoryName=trim(getSolverWorkingDirectoryName)//'/'
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
|
|
end function getSolverWorkingDirectoryName
|
2011-02-21 20:07:38 +05:30
|
|
|
|
2013-03-25 19:22:22 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2013-03-25 23:15:58 +05:30
|
|
|
!> @brief using Abaqus/Explicit function to get solver job name
|
2013-03-25 19:22:22 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
character(1024) function getSolverJobName()
|
2013-03-25 23:15:58 +05:30
|
|
|
|
2010-05-10 20:32:59 +05:30
|
|
|
implicit none
|
2013-03-25 23:15:58 +05:30
|
|
|
integer :: lenJobName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2010-05-11 12:27:15 +05:30
|
|
|
getSolverJobName=''
|
2013-03-25 23:15:58 +05:30
|
|
|
call vGetJobName(getSolverJobName, lenJobName)
|
2012-06-15 21:40:21 +05:30
|
|
|
|
|
|
|
end function getSolverJobName
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2012-06-15 21:40:21 +05:30
|
|
|
end module DAMASK_interface
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2014-12-08 22:06:22 +05:30
|
|
|
#include "commercialFEM_fileList.f90"
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-25 23:15:58 +05:30
|
|
|
subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
|
|
|
|
stepTime, totalTime, dt, cmName, coordMp, charLength, &
|
|
|
|
props, density, strainInc, relSpinInc, &
|
|
|
|
tempOld, stretchOld, defgradOld, fieldOld, &
|
|
|
|
stressOld, stateOld, enerInternOld, enerInelasOld, &
|
|
|
|
tempNew, stretchNew, defgradNew, fieldNew, &
|
|
|
|
stressNew, stateNew, enerInternNew, enerInelasNew)
|
|
|
|
use prec, only: &
|
|
|
|
pReal, &
|
|
|
|
pInt
|
2014-04-29 21:41:13 +05:30
|
|
|
!$ use numerics, only: &
|
|
|
|
!$ DAMASK_NumThreadsInt
|
2013-03-21 22:54:58 +05:30
|
|
|
use FEsolving, only: &
|
2016-01-18 22:22:18 +05:30
|
|
|
symmetricSolver, &
|
|
|
|
terminallyIll
|
2013-03-21 22:54:58 +05:30
|
|
|
use math, only: &
|
|
|
|
invnrmMandel
|
|
|
|
use debug, only: &
|
|
|
|
debug_info, &
|
|
|
|
debug_reset, &
|
|
|
|
debug_levelBasic, &
|
|
|
|
debug_level, &
|
|
|
|
debug_abaqus
|
|
|
|
use mesh, only: &
|
2013-05-17 22:22:19 +05:30
|
|
|
mesh_unitlength, &
|
2013-03-21 22:54:58 +05:30
|
|
|
mesh_FEasCP, &
|
|
|
|
mesh_ipCoordinates
|
2013-03-01 17:18:29 +05:30
|
|
|
use CPFEM, only: &
|
|
|
|
CPFEM_general, &
|
|
|
|
CPFEM_init_done, &
|
|
|
|
CPFEM_initAll, &
|
|
|
|
CPFEM_CALCRESULTS, &
|
2016-01-17 18:59:42 +05:30
|
|
|
CPFEM_AGERESULTS, &
|
|
|
|
cycleCounter, &
|
|
|
|
theTime, &
|
|
|
|
outdatedByNewInc, &
|
2016-01-18 22:22:18 +05:30
|
|
|
outdatedFFN1
|
2013-03-21 22:54:58 +05:30
|
|
|
use homogenization, only: &
|
|
|
|
materialpoint_sizeResults, &
|
|
|
|
materialpoint_results
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-21 22:54:58 +05:30
|
|
|
implicit none
|
2013-03-25 23:15:58 +05:30
|
|
|
integer(pInt), intent(in) :: &
|
|
|
|
nDir, & !< number of direct components in a symmetric tensor
|
|
|
|
nshr, & !< number of indirect components in a symmetric tensor
|
|
|
|
nStateV, & !< number of user-defined state variables that are associated with this material type
|
|
|
|
nFieldV, & !< number of user-defined external field variables
|
|
|
|
nprops, & !< user-specified number of user-defined material properties
|
|
|
|
lAnneal !< indicating whether the routine is being called during an annealing process
|
|
|
|
integer(pInt), dimension(*), intent(in) :: &
|
|
|
|
nBlock !< 1: No of Materialpoints in this call, 2: No of Materialpoint (IP)
|
2013-03-26 00:06:21 +05:30
|
|
|
!< 3: No of layer, 4: No of secPoint, 5+: element numbers
|
2013-03-25 23:15:58 +05:30
|
|
|
character(len=80), intent(in) :: &
|
|
|
|
cmname !< uses-specified material name, left justified
|
|
|
|
real(pReal), dimension(nprops), intent(in) :: &
|
|
|
|
props !< user-supplied material properties
|
|
|
|
real(pReal), intent(in) :: &
|
|
|
|
stepTime, & !< value of time since the step began
|
|
|
|
totalTime, & !< value of total time
|
|
|
|
dt !< time increment size
|
|
|
|
real(pReal), dimension(nblock(1)), intent(in) :: &
|
|
|
|
density, & !< current density at material points in the midstep configuration
|
|
|
|
charLength, & !< characteristic element length
|
2014-10-23 14:58:21 +05:30
|
|
|
enerInternOld, & !< internal energy per unit mass at each material point at the beginning of the increment
|
|
|
|
enerInelasOld, & !< dissipated inelastic energy per unit mass at each material point at the beginning of the increment
|
|
|
|
tempOld, & !< temperature at each material point at the beginning of the increment
|
|
|
|
tempNew !< temperature at each material point at the end of the increment (Temperature calculated in ABAQUS boundary conditions)
|
2013-03-25 23:15:58 +05:30
|
|
|
real(pReal), dimension(nblock(1),*), intent(in) :: &
|
|
|
|
coordMp !< material point coordinates
|
|
|
|
real(pReal), dimension(nblock(1),ndir+nshr), intent(in) :: &
|
|
|
|
strainInc, & !< strain increment tensor at each material point
|
|
|
|
stretchOld, & !< stretch tensor U at each material point
|
|
|
|
stretchNew, & !< stretch tensor U at each material point
|
|
|
|
stressOld !< stress tensor at each material point
|
|
|
|
real(pReal), dimension(nblock(1),nshr), intent(in) :: &
|
|
|
|
relSpinInc !< incremental relative rotation vector
|
|
|
|
real(pReal), dimension(nblock(1),nstatev), intent(in) :: &
|
2014-10-23 14:58:21 +05:30
|
|
|
stateOld !< state variables at each material point at the beginning of the increment
|
2013-03-25 23:15:58 +05:30
|
|
|
real(pReal), dimension(nblock(1),nfieldv), intent(in) :: &
|
|
|
|
fieldOld, & !< user-defined field variables
|
|
|
|
fieldNew !< user-defined field variables
|
|
|
|
real(pReal), dimension(nblock(1),ndir+2*nshr), intent(in) :: &
|
|
|
|
defgradOld, &
|
|
|
|
defgradNew
|
|
|
|
real(pReal), dimension(nblock(1)), intent(out) :: &
|
|
|
|
enerInternNew, & !< internal energy per unit mass at each material point at the end of the increment
|
|
|
|
enerInelasNew !< dissipated inelastic energy per unit mass at each material point at the end of the increment
|
|
|
|
real(pReal), dimension(nblock(1),ndir+nshr), intent(out) :: &
|
|
|
|
stressNew !< stress tensor at each material point at the end of the increment
|
|
|
|
real(pReal), dimension(nblock(1),nstatev), intent(out) :: &
|
|
|
|
stateNew !< state variables at each material point at the end of the increment
|
|
|
|
|
2011-09-13 19:45:17 +05:30
|
|
|
real(pReal), dimension(3) :: coordinates
|
2010-02-18 15:53:42 +05:30
|
|
|
real(pReal), dimension(3,3) :: defgrd0,defgrd1
|
|
|
|
real(pReal), dimension(6) :: stress
|
|
|
|
real(pReal), dimension(6,6) :: ddsdde
|
2014-10-23 14:58:21 +05:30
|
|
|
real(pReal) :: temp, timeInc, stresspower
|
2013-03-25 23:15:58 +05:30
|
|
|
integer(pInt) :: computationMode, n, i, cp_en
|
2014-05-16 15:53:10 +05:30
|
|
|
|
2015-04-15 23:40:56 +05:30
|
|
|
#ifdef _OPENMP
|
|
|
|
integer :: defaultNumThreadsInt !< default value set by Abaqus
|
|
|
|
include "omp_lib.h"
|
|
|
|
|
|
|
|
defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
|
|
|
|
call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
|
|
|
|
#endif
|
2014-04-29 21:41:13 +05:30
|
|
|
|
2013-08-02 16:50:11 +05:30
|
|
|
computationMode = CPFEM_CALCRESULTS ! always calculate
|
2013-03-25 23:15:58 +05:30
|
|
|
do n = 1,nblock(1) ! loop over vector of IPs
|
2014-05-16 15:53:10 +05:30
|
|
|
temp = tempOld(n) ! temp is intent(in)
|
2010-02-18 15:53:42 +05:30
|
|
|
if ( .not. CPFEM_init_done ) then
|
2015-07-24 20:27:29 +05:30
|
|
|
call CPFEM_initAll(nBlock(4_pInt+n),nBlock(2))
|
2010-02-18 15:53:42 +05:30
|
|
|
outdatedByNewInc = .false.
|
|
|
|
|
2012-07-05 15:24:50 +05:30
|
|
|
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0) then
|
2014-05-16 15:53:10 +05:30
|
|
|
write(6,'(i8,1x,i2,1x,a)') nBlock(4_pInt+n),nBlock(2),'first call special case..!'; flush(6)
|
2010-03-25 13:57:42 +05:30
|
|
|
endif
|
2013-03-25 23:15:58 +05:30
|
|
|
else if (theTime < totalTime) then ! reached convergence
|
2010-02-18 15:53:42 +05:30
|
|
|
outdatedByNewInc = .true.
|
|
|
|
|
2012-07-05 15:24:50 +05:30
|
|
|
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0) then
|
2014-05-16 15:53:10 +05:30
|
|
|
write (6,'(i8,1x,i2,1x,a)') nBlock(4_pInt+n),nBlock(2),'lastIncConverged + outdated'; flush(6)
|
2010-03-25 13:57:42 +05:30
|
|
|
endif
|
2010-02-18 15:53:42 +05:30
|
|
|
|
|
|
|
endif
|
|
|
|
outdatedFFN1 = .false.
|
|
|
|
terminallyIll = .false.
|
2013-03-21 22:54:58 +05:30
|
|
|
cycleCounter = 1_pInt
|
2010-02-18 15:53:42 +05:30
|
|
|
if ( outdatedByNewInc ) then
|
|
|
|
outdatedByNewInc = .false.
|
2013-03-25 23:15:58 +05:30
|
|
|
call debug_info() ! first after new inc reports debugging
|
|
|
|
call debug_reset() ! resets debugging
|
|
|
|
computationMode = ior(computationMode, CPFEM_AGERESULTS) ! age results
|
2010-02-18 15:53:42 +05:30
|
|
|
endif
|
|
|
|
|
2013-03-25 23:15:58 +05:30
|
|
|
theTime = totalTime ! record current starting time
|
2012-07-05 15:24:50 +05:30
|
|
|
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0) then
|
2014-05-16 15:53:10 +05:30
|
|
|
write(6,'(a,i8,i2,a)') '(',nBlock(4_pInt+n),nBlock(2),')'; flush(6)
|
|
|
|
write(6,'(a,l1)') 'Aging Results: ', iand(computationMode, CPFEM_AGERESULTS) /= 0_pInt
|
2010-03-25 13:57:42 +05:30
|
|
|
endif
|
|
|
|
defgrd0 = 0.0_pReal
|
|
|
|
defgrd1 = 0.0_pReal
|
|
|
|
timeInc = dt
|
2010-02-18 15:53:42 +05:30
|
|
|
|
|
|
|
! ABAQUS explicit: deformation gradient as vector 11, 22, 33, 12, 23, 31, 21, 32, 13
|
|
|
|
! ABAQUS explicit: deformation gradient as vector 11, 22, 33, 12, 21
|
|
|
|
|
|
|
|
forall (i=1:ndir)
|
|
|
|
defgrd0(i,i) = defgradOld(n,i)
|
|
|
|
defgrd1(i,i) = defgradNew(n,i)
|
|
|
|
end forall
|
|
|
|
if (nshr == 1) then
|
|
|
|
defgrd0(1,2) = defgradOld(n,4)
|
|
|
|
defgrd1(1,2) = defgradNew(n,4)
|
|
|
|
defgrd0(2,1) = defgradOld(n,5)
|
|
|
|
defgrd1(2,1) = defgradNew(n,5)
|
|
|
|
else
|
|
|
|
defgrd0(1,2) = defgradOld(n,4)
|
|
|
|
defgrd1(1,2) = defgradNew(n,4)
|
|
|
|
defgrd0(1,3) = defgradOld(n,9)
|
|
|
|
defgrd1(1,3) = defgradNew(n,9)
|
|
|
|
defgrd0(2,1) = defgradOld(n,7)
|
|
|
|
defgrd1(2,1) = defgradNew(n,7)
|
|
|
|
defgrd0(2,3) = defgradOld(n,5)
|
|
|
|
defgrd1(2,3) = defgradNew(n,5)
|
|
|
|
defgrd0(3,1) = defgradOld(n,6)
|
|
|
|
defgrd1(3,1) = defgradNew(n,6)
|
|
|
|
defgrd0(3,2) = defgradOld(n,8)
|
|
|
|
defgrd1(3,2) = defgradNew(n,8)
|
2013-03-25 23:15:58 +05:30
|
|
|
|
2010-02-18 15:53:42 +05:30
|
|
|
endif
|
2013-03-26 00:32:12 +05:30
|
|
|
cp_en = mesh_FEasCP('elem',nBlock(4_pInt+n))
|
2013-05-17 22:22:19 +05:30
|
|
|
mesh_ipCoordinates(1:3,n,cp_en) = mesh_unitlength * coordMp(n,1:3)
|
2012-11-14 20:08:10 +05:30
|
|
|
|
2013-08-02 16:50:11 +05:30
|
|
|
call CPFEM_general(computationMode,.false.,defgrd0,defgrd1,temp,timeInc,cp_en,nBlock(2),stress,ddsdde)
|
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 implicit: 11, 22, 33, 12, 13, 23
|
|
|
|
! ABAQUS explicit: 11, 22, 33, 12, 23, 13
|
|
|
|
! ABAQUS explicit: 11, 22, 33, 12
|
|
|
|
|
|
|
|
stressNew(n,1:ndir+nshr) = stress(1:ndir+nshr)*invnrmMandel(1:ndir+nshr)
|
2014-10-23 14:58:21 +05:30
|
|
|
stateNew(n,1:min(nstatev,materialpoint_sizeResults)) = &
|
|
|
|
materialpoint_results(1:min(nstatev,materialpoint_sizeResults),&
|
|
|
|
nBlock(2),mesh_FEasCP('elem', nBlock(4_pInt+n)))
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2014-10-23 14:58:21 +05:30
|
|
|
stresspower = 0.5_pReal*sum((stressOld(n,1:ndir)+stressNew(n,1:ndir))*straininc(n,1:ndir))+&
|
2014-10-24 13:15:00 +05:30
|
|
|
sum((stressOld(n,ndir+1:ndir+nshr)+stressNew(n,ndir+1:ndir+nshr))*straininc(n,ndir+1:ndir+nshr))
|
2014-10-23 14:58:21 +05:30
|
|
|
enerInternNew(n) = enerInternOld(n) + stresspower / density(n) ! Internal energy per unit mass
|
|
|
|
enerInelasNew(n) = enerInternNew(n) ! Dissipated inelastic energy per unit mass(Temporary output)
|
|
|
|
|
2010-02-18 15:53:42 +05:30
|
|
|
enddo
|
2015-04-15 23:40:56 +05:30
|
|
|
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-25 23:15:58 +05:30
|
|
|
end subroutine vumat
|
2010-02-18 15:53:42 +05:30
|
|
|
|
2013-03-25 23:15:58 +05:30
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief calls the exit function of Abaqus/Explicit
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2013-03-25 19:22:22 +05:30
|
|
|
subroutine quit(mpie_error)
|
2013-03-25 23:15:58 +05:30
|
|
|
use prec, only: &
|
|
|
|
pInt
|
2012-06-15 21:40:21 +05:30
|
|
|
|
2010-02-18 15:53:42 +05:30
|
|
|
implicit none
|
2014-05-16 15:53:10 +05:30
|
|
|
integer(pInt) :: mpie_error
|
2013-03-25 19:22:22 +05:30
|
|
|
|
2012-10-02 18:16:58 +05:30
|
|
|
flush(6)
|
2013-03-25 19:22:22 +05:30
|
|
|
call xplb_exit
|
|
|
|
|
|
|
|
end subroutine quit
|