User Material subroutines

In case you want to use user material subroutines in Abaqus you can follow the following guide: (original source: https://gist.github.com/franaudo/72362784ded685e4cb381e57020c9ec7)

Procedure to enable user subroutines in Abaqus

Procedure for Windows

Install Micorosoft Visual Studio

  • Download Micorosoft Visual Studio Community Edition 2019 (also professional or enterprise editions will work)
  • Install it on your machine
  • During the installation select 'Development C/C++'

Install Intel Fortran Compiler

Add environmental Variables

add the following environmental variables to your path:

  • C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\bin
  • C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\bin\intel64
  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build

Note for compas users: to be able to use compas_fea in Rhino, the same environmental variables must also be included in Rhino through the python IDE.

Link abaqus to the fortran compiler

  • navigate to: C:\abaqus installation folder\Commands
  • edit the abq2019.bat file as follows:
@echo off
setlocal
set ABA_COMMAND=%~nx0
set ABA_COMMAND_FULL=%~f0
rem @call ifortvars.bat intel64 vs2019
IF NOT DEFINED VS_VARS_SET call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set VS_VARS_SET=1
IF NOT DEFINED VC_VARS_SET call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\bin\ifortvars.bat" intel64 vs2019
set VC_VARS_SET=1
"C:\SIMULIA\CAE\2019\win_b64\code\bin\ABQLauncher.exe" %*
endlocal

(notes: don't change your ABQLauncher path; check if the paths to your ifortvars.bat and vcvars64.bat are the same as in the snippet above or change them to match yours)

Procedure for Ubuntu 20.04

Install gfortran package:

sudo apt-get install gfortran

Find ABAQUS setting file abaqus_v6.env at (Abaqus path)/6.14-5/SMA/site/ and make a backup.

Find and change the following parameters(fortCmd, compile_fortran, link_sl) to:

fortCmd = "gfortran"
compile_fortran = (fortCmd + ' -c -fPIC -I%I')
link_sl = (fortCmd +
	         " -gcc-version=%i -fPIC -shared " +
	         "%E -Wl,-soname,%U -o %U %F %A %L %B -Wl,-Bdynamic " +
	         " -lifport -lifcoremt")

Verify installation

open the teminal and run abaqus verify -user or abaqus verify -all