Initial hpc batch submission script and clean whitespace in umat.

This commit is contained in:
jgrogan 2024-06-04 12:32:16 +01:00
parent e19f869a1e
commit 684f81980d
3 changed files with 1032 additions and 1005 deletions

View file

@ -1,3 +1,4 @@
Journal Article: https://zenodo.org/records/11184080
Journal Article: https://doi.org/10.1016/j.jmbbm.2014.01.007
Supporting Data - including original software versions: https://zenodo.org/records/11184080
Supporting Data - including original software versions: https://doi.org/10.1016/j.jmbbm.2014.01.007

View file

@ -4,7 +4,7 @@
3 nstatv,props,nprops,coords,drot,pnewdt,celent,
4 dfgrd0,dfgrd1,noel,npt,layer,kspt,kstep,kinc)
c
include 'aba_param.inc'
c include 'aba_param.inc'
c modified from huang umat- jg:20/07/12
c *******************************************************************
c - only suitable for finite deformation isotropic elasticity
@ -29,7 +29,8 @@ c *******************************************************************
2 dgamod(18),dtauod(18),dgspod(18),dspnro(3,18),
3 dspdro(3,18),dhdgdg(18,18),rwkdir(3,24),rwknor(3,24),
3 indxL(3),termd(3),termn(3),gamma(18),tauslpL(18)
C----- Elastic matrix in GLOBAL system
c
c----- Elastic matrix in GLOBAL system
gshear = props(1)/(2.*(1.+props(2)))
e11 = 2.*gshear*(one-props(2))/(1.-2.*props(2))
e12 = 2.*gshear*props(2)/(1.-2.*props(2))
@ -41,7 +42,7 @@ C----- Elastic matrix in GLOBAL system
end do
d(j+3,j+3) = gshear
end do
c------ Crystal Type:
c------Crystal Type:
ictype=nint(props(9))
if(ictype == 1)then
c FCC
@ -86,7 +87,7 @@ C----- Increment of spin associated with the material element: DSPIN
dspin(1) = trm0(2,1)-trm0(1,2)
dspin(2) = trm0(1,3)-trm0(3,1)
dspin(3) = trm0(3,2)-trm0(2,3)
C----- Increment of dilatational strain: DEV
C-----Increment of dilatational strain: DEV
dev = zero
do i = 1,ndi
dev = dev+dstran(i)
@ -107,14 +108,14 @@ c----- generating all possible slip directions for fcc
rwkdir(1,6) = -rwkdir(1,6)
rwkdir(2,4) = -rwkdir(2,4)
rwkdir(3,5) = -rwkdir(3,5)
c----- generating all possible slip planes for fcc
c-----generating all possible slip planes for fcc
rwknor = 1./sqrt(3.)
do i = 1,3
do j = 1,4
if (j.eq.i+1)rwknor(i,j) = -rwknor(i,j)
end do
end do
c------ Generating all slip systems for FCC
c------Generating all slip systems for FCC
nslip = 0
do j = 1,4
do i = 1,6
@ -132,7 +133,7 @@ c------ Generating all slip systems for FCC
end do
end do
else
c----- generating slip directions and normals for hcp-basal
c-----generating slip directions and normals for hcp-basal
rwkdir = 0.
rwknor = 0.
angle = acos(-1.)/3.
@ -153,7 +154,7 @@ c----- generating slip directions and normals for hcp-basal
slpnor(k,i) = rwknor(k,i)
enddo
enddo
c----- generating slip directions and normals for hcp-prismatic
c-----generating slip directions and normals for hcp-prismatic
rwknor = 0.
rwknor(1,1) = 0.
rwknor(2,1) = -1.
@ -205,7 +206,7 @@ c slip normals
rwknor(1,j) = -rwknor(1,j-3)
rwknor(2,j) = -rwknor(2,j-3)
enddo
rlength=sqrt(3.*(1.+aspect*aspect))
rlength=sqrt(3.*(1.+aspect*aspect)
do j = 1,6
do i = 1,3
rwknor(i,j) = rwknor(i,j)/rlength
@ -269,8 +270,8 @@ c slip normals
enddo
endif
endif
C----- Unit vectors in slip dirs and unit norms-Global system
c----- Generate rotation matrix
C-----Unit vectors in slip dirs and unit norms-Global system
c-----Generate rotation matrix
do i = 1,3
term(i,1) = props(i+2)
term(i,2) = props(i+5)
@ -303,7 +304,7 @@ c--- Rotate slip normals and directions to global system
slpnor(i,j) = termn(i)
end do
end do
C----- Get Slip deformation tensor: SLPDEF (Schmid factors)
C-----Get Slip deformation tensor: SLPDEF (Schmid factors)
do j=1,nslptl
slpdef(1,j)=slpdir(1,j)*slpnor(1,j)
slpdef(2,j)=slpdir(2,j)*slpnor(2,j)
@ -315,7 +316,7 @@ C----- Get Slip deformation tensor: SLPDEF (Schmid factors)
slpdef(6,j)=slpdir(2,j)*slpnor(3,j)
1 +slpdir(3,j)*slpnor(2,j)
end do
C----- Store normals and directions
C-----Store normals and directions
statev(nstatv)=nslptl
idnor=3*nslptl
iddir=6*nslptl
@ -327,7 +328,7 @@ C----- Store normals and directions
statev(iddir)=slpdir(i,j)
end do
end do
C----- Initial value of the current strength for all slip systems
C-----Initial value of the current strength for all slip systems
do j=1,nslptl
if(ictype == 1)then
statev(j)=props(10)
@ -343,12 +344,12 @@ C----- Initial value of the current strength for all slip systems
endif
endif
enddo
C----- Initial value of shear strain in slip systems
C-----Initial value of shear strain in slip systems
do i=1,nslptl
statev(nslptl+i)=0.
end do
statev(9*nslptl+1)=0.
C----- Initial value of the resolved shear stress in slip systems
C-----Initial value of the resolved shear stress in slip systems
do i=1,nslptl
term1=0.
do j=1,ntens
@ -361,7 +362,7 @@ C----- Initial value of the resolved shear stress in slip systems
statev(2*nslptl+i)=term1
end do
else
C----- Current stress state
C-----Current stress state
idnor=3*nslptl
iddir=6*nslptl
do j=1,nslptl
@ -372,7 +373,7 @@ C----- Current stress state
slpdir(i,j)=statev(iddir)
end do
end do
C----- Slip deformation tensor: SLPDEF (Schmid factors)
C-----Slip deformation tensor: SLPDEF (Schmid factors)
do j=1,nslptl
slpdef(1,j)=slpdir(1,j)*slpnor(1,j)
slpdef(2,j)=slpdir(2,j)*slpnor(2,j)
@ -385,7 +386,7 @@ C----- Slip deformation tensor: SLPDEF (Schmid factors)
1 +slpdir(3,j)*slpnor(2,j)
end do
end if
C----- Slip spin tensor: SLPSPN
C-----Slip spin tensor: SLPSPN
do j=1,nslptl
slpspn(1,j)=0.5*(slpdir(1,j)*slpnor(2,j)-
2 slpdir(2,j)*slpnor(1,j))
@ -394,7 +395,7 @@ C----- Slip spin tensor: SLPSPN
slpspn(3,j)=0.5*(slpdir(2,j)*slpnor(3,j)-
2 slpdir(3,j)*slpnor(2,j))
end do
C----- Double dot product of elastic moduli tensor with the slip
C-----Double dot product of elastic moduli tensor with the slip
C deformation tensor
do j=1,nslptl
do i=1,6
@ -434,7 +435,7 @@ C deformation tensor
ddemsd(5,j)=ddemsd(5,j)+slpspn(1,j)*stress(ndi+3)
end if
end do
C----- Shear strain-rate in a slip system at the start of increment:
C-----Shear strain-rate in a slip system at the start of increment:
do i=1,nslptl
tauslp=statev(2*nslptl+i)
if(i>=13.and.tauslp<=0)then
@ -536,7 +537,7 @@ C----- Solve the increment of shear strain in a slip system
workst(i,i)=workst(i,i)+1.
end do
call ludcmp (workst, nslptl, 18, indx, ddcmp)
c----- increment of shear strain in a slip system: dgamma
c-----increment of shear strain in a slip system: dgamma
term1=theta*dtime
do i=1,nslptl
if (nitrtn.eq.0) then
@ -568,11 +569,11 @@ c----- increment of shear strain in a slip system: dgamma
do i=1,nslptl
dgamma(i)=dgamma(i)+dgamod(i)
end do
c----- update the shear strain in a slip system:
c-----update the shear strain in a slip system:
do i=1,nslptl
statev(nslptl+i)=statev(nslptl+i)+dgamma(i)-dgamod(i)
end do
C----- Increment of current strength in a slip system: DGSLIP
C-----Increment of current strength in a slip system: DGSLIP
do i=1,nslptl
dgslip(i)=0.
do j=1,nslptl
@ -583,7 +584,7 @@ C----- Update the current strength in a slip system:
do i=1,nslptl
statev(i)=statev(i)+dgslip(i)-dgspod(i)
end do
C----- Increment of strain associated with lattice stretching: DELATS
C-----Increment of strain associated with lattice stretching: DELATS
do j=1,6
delats(j)=0.
end do
@ -599,7 +600,7 @@ C----- Increment of strain associated with lattice stretching: DELATS
delats(j+3)=delats(j+3)-slpdef(j+3,i)*dgamma(i)
end do
end do
C----- Increment of deformation gradient associated with lattice stretching
C-----Increment of deformation gradient associated with lattice stretching
do j=1,3
do i=1,3
if (i.eq.j) then
@ -629,18 +630,18 @@ C----- Increment of deformation gradient associated with lattice stretching
end if
end do
end do
C----- Increment of resolved shear stress in a slip system: DTAUSP
C-----Increment of resolved shear stress in a slip system: DTAUSP
do i=1,nslptl
dtausp(i)=0.
do j=1,6
dtausp(i)=dtausp(i)+ddemsd(j,i)*delats(j)
end do
end do
C----- Update the resolved shear stress in a slip system:
C-----Update the resolved shear stress in a slip system:
do i=1,nslptl
statev(2*nslptl+i)=statev(2*nslptl+i)+dtausp(i)-dtauod(i)
end do
C----- Increment of stress: DSTRES
C-----Increment of stress: DSTRES
do i=1,ntens
dstres(i)=-stress(i)*dev
end do
@ -670,11 +671,11 @@ C----- Increment of stress: DSTRES
end do
end do
end if
C----- Update the stress: STRESS
C-----Update the stress: STRESS
do i=1,ntens
stress(i)=stress(i)+dstres(i)-dsold(i)
end do
C----- Increment of normal to a slip plane and a slip direction
C-----Increment of normal to a slip plane and a slip direction
do j=1,nslptl
do i=1,3
dspnor(i,j)=0.
@ -685,7 +686,7 @@ C----- Increment of normal to a slip plane and a slip direction
end do
end do
end do
C----- Update the normal to a slip plane and a slip direction
C-----Update the normal to a slip plane and a slip direction
idnor=3*nslptl
iddir=6*nslptl
do j=1,nslptl
@ -696,7 +697,7 @@ C----- Update the normal to a slip plane and a slip direction
statev(iddir)=statev(iddir)+dspdir(i,j)-dspdro(i,j)
end do
end do
C----- Derivative of shear strain increment in a slip system w.r.t.
C-----Derivative of shear strain increment in a slip system w.r.t.
C strain increment: DDGDDE
term1=theta*dtime
do i=1,ntens
@ -718,8 +719,8 @@ C strain increment: DDGDDE
end do
call lubksb (workst, nslptl, 18, indx, ddgdde(1,i))
end do
C----- Derivative of stress increment w.r.t. strain increment
C----- Jacobian matrix: elastic part
C-----Derivative of stress increment w.r.t. strain increment
C-----Jacobian matrix: elastic part
do j=1,ntens
do i=1,ntens
ddsdde(i,j)=0.
@ -743,7 +744,7 @@ C----- Jacobian matrix: elastic part
end do
end do
end if
C----- Jacobian matrix: plastic part (slip)
C-----Jacobian matrix: plastic part (slip)
do j=1,ndi
do i=1,ndi
do k=1,nslptl
@ -774,7 +775,7 @@ C----- Jacobian matrix: plastic part (slip)
ddsdde(i,j)=ddsdde(i,j)/(1.+dev)
end do
end do
C----- Save solutions (without iteration):
C-----Save solutions (without iteration):
if (nitrtn.eq.0) then
idnor=3*nslptl
iddir=6*nslptl
@ -803,7 +804,7 @@ C----- Save solutions (without iteration):
end do
end do
end if
C----- Increments of stress DSOLD, and solution dependent state
C-----Increments of stress DSOLD, and solution dependent state
C variables DGAMOD, DTAUOD, DGSPOD, DSPNRO, DSPDRO (for the next
C iteration)
do i=1,ntens
@ -818,7 +819,7 @@ C iteration)
dspdro(i,j)=dspdir(i,j)
end do
end do
C----- Check if the iteration solution converges
C-----Check if the iteration solution converges
idback=0
do j=1,nslptl
tauslp=statev(2*nslptl+j)
@ -910,7 +911,7 @@ C TWIN
end do
go to 1000
elseif (nitrtn.ge.itrmax) then
C----- Solution not converge within maximum number of iteration (the
C-----Solution not converge within maximum number of iteration (the
C solution without iteration will be used)
do j=1,ntens
stress(j)=stres1(j)
@ -932,7 +933,7 @@ C solution without iteration will be used)
end do
end do
end if
C----- Total cumulative shear strains on all slip systems (sum of the
C-----Total cumulative shear strains on all slip systems (sum of the
C absolute values of shear strains in all slip systems)
do i=1,nslptl
statev(9*nslptl+1)=statev(9*nslptl+1)+abs(dgamma(i))
@ -941,7 +942,7 @@ C absolute values of shear strains in all slip systems)
end
c----------------------------------------------------------------------
subroutine ludcmp (a, n, np, indx, d)
include 'aba_param.inc'
c include 'aba_param.inc'
parameter (nmax=200, tiny=1.0e-20)
dimension a(np,np), indx(n), vv(nmax)
d = 1.d0
@ -996,7 +997,7 @@ c----------------------------------------------------------------------
end
C----------------------------------------------------------------------
subroutine lubksb (a, n, np, indx, b)
include 'aba_param.inc'
c include 'aba_param.inc'
dimension a(np,np), indx(n), b(n)
ii = 0
do i = 1,n

View file

@ -0,0 +1,25 @@
#!/bin/bash -l
#SBATCH -J AbaqusUMatCheck
#SBATCH -A myaccount
#SBATCH --nodes=1
#SBATCH --time=00:05:00
#SBATCH -p cpu
#SBATCH --qos test
# disable multithreading. Please check both cases to see which gives better performance
#SBATCH --hint=nomultithread
#SBATCH --ntasks-per-node=128
#SBATCH --cpus-per-task=1
#SBATCH -o %x-%j.log
### Load ABAQUS module
module load abaqus/2023
module load intel-compilers
### Configure environment variables, need to unset SLURM's Global Task ID for ABAQUS's PlatformMPI to work
unset SLURM_GTIDS
### Set input file and job (file prefix) name here
job_name=${SLURM_JOB_NAME}
abaqus job=${job_name} input=CDIE_1E.inp user=UCrys_HCP_Only double=both interactive