Skip to content

Tubakabura/ABAQUS-cpp-User-Subroutines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

ABAQUS cpp User Subroutines

ABAQUS is widely used in the finite element analysis of large deformation of solids, which provides Fortran and C++ api for user-defined material constitutive behaviour by developing user subroutines. Due to historical reasons, most user subroutines are written in Fortran instead of C++. This is a repositry of severial ABAQUS subroutines of user-defined material model written in C++, which offers a more modern coding style and library management.

How can I use cpp UMAT or VUMAT in ABAQUS?

It is recommended to use cpp subroutines on linux platforms instead of Windows, since the management of the compilation environment is much simpler. One can use g++ as the compiler of cpp subroutines and set environment variables to invoke external libraries. One shall notice that Debian-based linux distributions are not officially supported by ABAQUS, it is recommended to use Red Hat-based linux distributions such as CentOS, Rocky and SUSE.

Assuming that we are using a linux where ABAQUS is installed properly. One can invoke cpp UMAT or VUMAT in ABAQUS by following steps:

  1. Prepare basic build tools if not installed, e.g.,
    sudo dnf install gcc-c++ make gfortran
    as well as external libraries if used in cpp UMAT or VUMAT, e.g.,
    sudo dnf install eigen3-devel
  2. For ABAQUS versions 2024 and later, set the environment variable to specify gfortran as the Fortran compiler for linking, e.g.,
    export ABQ_USUB_GFORTRAN=1
  3. Prepare files including:
    • ABAQUS input file, e.g., test.inp
    • cpp UMAT or VUMAT file, e.g., umat.cpp or vumat.cpp
  4. Set environment variables to include external libraries if used in c++ subroutine, e.g.,
    export CPLUS_INCLUDE_PATH=/path/to/eigen:$CPLUS_INCLUDE_PATH
  5. Run ABAQUS with the cpp UMAT or VUMAT, e.g.,
    abaqus Job=job_name input=input_file.inp user=vumat.cpp cpus=8 interactive

It is recommended to modify the environment-management python script of ABAQUS to invoke optimization flags of g++, e.g., -O3 -march=native, for better performance of cpp UMAT or VUMAT.

  1. Locate the environment-management script of ABAQUS by executing:
    abq_env_path=$(abaqus information=environment | grep "linux_a64/SMA" | head -n 1 | awk '{print $NF}' | sed 's#\(.*linux_a64/SMA\).*#\1#' | awk '{print $0 "/site/lnx86_64.env"}')
    echo $abq_env_path
  2. Append the following lines at the end of the script by excecuting:
    cp $abq_env_path ${abq_env_path}.bak
    echo "compile_cpp += ['-O3', '-march=native']" >> $abq_env_path
    This will add optimization flags for g++ compilation.

About

C++ ABAQUS user subroutines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors