Nguyen Lab Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
abaqus [2024/04/18 10:34] – [Linking Intel oneMKL to ABAQUS (optional)] bdatta1abaqus [2024/04/18 11:10] (current) – [Linking Intel oneMKL to ABAQUS (optional)] bdatta1
Line 9: Line 9:
 ==== Abaqus Licensing ==== ==== Abaqus Licensing ====
  
-Unlike Tahoe and FEniCSx, Abaqus is a commercial finite element software. Johns Hopkins has 350 Abaqus licensing tokens for Abaqus/ Standard, Abaqus/ Explicit, and other SIMULIA products. Running a simulation on a single CPU on Abaqus/ Standard or Explicit takes up 5 licensing tokens and it increases with the number of CPUs being used (see below).+Unlike Tahoe and FEniCSx, Abaqus is a commercial finite element software. Johns Hopkins has 350 Abaqus licensing tokens for Abaqus/Standard, Abaqus/Explicit, and other SIMULIA products. Running a simulation on a single CPU on Abaqus/Standard or Explicit takes up 5 licensing tokens and it increases with the number of CPUs being used (see below).
  
 {{:abaqus_token.png?900}} {{:abaqus_token.png?900}}
  
-There exists a computational bottleneck; your simulations will not run any faster if you keep using more and more CPUs beyond a limit. So find that limit and use the resources carefully. **It is very important to ensure not to reserve all or most of the licenses available campus-wide as a single user.** Please be considerate of others and if you notice any user is taking advantage of the licensing system, please let the system administrator at the Rockfish know about it. Similarly, for Abaqus/ CAE try using more Viewports to open multiple ODB files in a single instance rather than opening multiple instances of it.+There exists a computational bottleneck; your simulations will not run any faster if you keep using more and more CPUs beyond a limit. So find that limit and use the resources carefully. **It is very important to ensure not to reserve all or most of the licenses available campus-wide as a single user.** Please be considerate of others and if you notice any user is taking advantage of the licensing system, please let the system administrator at the Rockfish know about it. Similarly, for Abaqus/CAE try using more Viewports to open multiple ODB files in a single instance rather than opening multiple instances of it.
  
 ==== Installing Abaqus on Windows ==== ==== Installing Abaqus on Windows ====
  
-**It does not matter what order is followed for installing ABAQUS but Visual Studio and Intel oneAPI have to be installed in that particular order.** 
  
-ABAQUS is not forward compatible means ABAQUS 2021 won't be able to open the .CAE and .ODB files generated by ABAQUS 2022 or later versions. But the newer version can open files from an older version. So decide on an appropriate version that you can use for a long time (check what version Rockfish offers as well in case you have to run simulations there and transfer your files to local computer). You can download the software from [[https://software.wse.jhu.edu/]] and install it by yourself by obtaining the license information from WSE IT (or ask one of your labmates who uses ABAQUS for licensing information). Please make sure to select ABAQUS/ Standard and Explicit solver with CAE package and CAA API components during installation.+ABAQUS is not forward compatible means ABAQUS 2021 won't be able to open the .CAE and .ODB files generated by ABAQUS 2022 or later versions. But the newer version can open files from an older version. So decide on an appropriate version that you can use for a long time (check what version Rockfish offers as well in case you have to run simulations there and transfer your files to local computer). You can download the software from [[https://software.wse.jhu.edu/]] and install it by yourself by obtaining the license information from WSE IT (or ask one of your labmates who uses ABAQUS for licensing information). Please make sure to select ABAQUS/Standard and Abaqus/Explicit solver with CAE package and CAA API components during installation.
  
-**Make sure to obtain the research license for Abaqus. Academic license have limited functionalities.**+**Make sure to obtain the research license for Abaqus from WSE IT. Academic license have limited functionalities.**
  
-==== Microsoft Visual Studio and Intel oneAPI ====+==== Installing Microsoft Visual Studio and Intel oneAPI ====
  
-To be able to leverage user-defined features of Abaqus, **Microsoft Visual Studio** and **Intel Fortran Compiler** are required to be installed **in that order**. Installing in different order will not work. Intel Fortran (and C++) compiler is a part of Intel oneAPI Toolkit which is available for free. Download the latest stable version of Intel oneAPI, both Base Toolkit and HPC Toolkit. The Base Toolkit has the compiler and oneMKL package and HPC Toolkit has the parallel computing packages. Please make sure to check which version of Microsoft Visual Studio is compatible with that particular Intel oneAPI version. Download the compatible version of the community edition of Visual Studio. Both these software are freely available.+**Visual Studio and Intel oneAPI have to be installed in that order while Abaqus can be installed at any time.** 
 + 
 +To be able to leverage user-defined features of Abaqus, **Microsoft Visual Studio** and **Intel Fortran Compiler** are required to be installed. Intel Fortran (and C++) compiler is a part of Intel oneAPI Toolkit which is available for free. Download the latest stable version of Intel oneAPI, both Base Toolkit and HPC Toolkit. The Base Toolkit has the compiler and oneMKL package and HPC Toolkit has the parallel computing packages. Please make sure to check which version of Microsoft Visual Studio is compatible with that particular version of Intel oneAPI. Download the compatible version of the community edition of Visual Studio. Both these software are freely available.
  
   - Start the installation procedure with Visual Studio. Make sure to select ''Desktop development with C++'' on the installation page while other settings could be default. The installation process is trivial. \\ \\    - Start the installation procedure with Visual Studio. Make sure to select ''Desktop development with C++'' on the installation page while other settings could be default. The installation process is trivial. \\ \\ 
-  - Then install the Intel oneAPI Base Toolkit and Intel oneAPI HPC Toolkit, respectively. Default installation should work and both of these software will recognize existing Visual Studio and link itself. This process might take 30-40 minutes. \\ \\ +  - Then install the Intel oneAPI Base Toolkit and Intel oneAPI HPC Toolkit, respectively. Default installation should work and both of these software will recognize existing Visual Studio and link itself. \\ \\ 
   - Upon successful installation, Intel oneAPI packages will be installed in C:\Program Files (x86)\Intel\oneAPI directory on Windows. Navigate further into the directory and check the folder ''C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64'' (version could be different) for the ''ifort'' executable. Copy the path to a text editor for later use. \\ \\    - Upon successful installation, Intel oneAPI packages will be installed in C:\Program Files (x86)\Intel\oneAPI directory on Windows. Navigate further into the directory and check the folder ''C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64'' (version could be different) for the ''ifort'' executable. Copy the path to a text editor for later use. \\ \\ 
   - Now navigate to the ''C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\env'' directory (again, the version could be different) and locate the ''vars.bat'' file. If your directory names are arranged differently for Intel oneAPI, you can search for the ''vars.bat'' through Windows Explorer and locate the one under the compiler directory. There will be other ''vars.bat'' files for different oneAPI packages, so, please make sure you find the right one. Copy the path to a text editor for later use. \\ \\    - Now navigate to the ''C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\env'' directory (again, the version could be different) and locate the ''vars.bat'' file. If your directory names are arranged differently for Intel oneAPI, you can search for the ''vars.bat'' through Windows Explorer and locate the one under the compiler directory. There will be other ''vars.bat'' files for different oneAPI packages, so, please make sure you find the right one. Copy the path to a text editor for later use. \\ \\ 
Line 34: Line 35:
 SET PATH=%PATH%;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64; SET PATH=%PATH%;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64;
 call “C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\env\vars.bat” intel64 call “C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\env\vars.bat” intel64
-</code> The first line here is the path directory for the ''ifort'' compiler and the second line calls the batch file (or script) to initialize the environment variable for the ''ifort'' compiler when the ABAQUS command is invoked. \\ +</code> The first line here is the path directory for the ''ifort'' compiler and the second line calls the batch file (or script) to initialize the environment variable for the ''ifort'' compiler when the ABAQUS command is invoked. \\ \\
   - Now, open either Abaqus Commands, cmd, or Powershell from the Windows start menu and type the following to check and verify the installation. This should return all the system information, including the linker and compiler on the terminal. <code>   - Now, open either Abaqus Commands, cmd, or Powershell from the Windows start menu and type the following to check and verify the installation. This should return all the system information, including the linker and compiler on the terminal. <code>
 abaqus info=system </code>  abaqus info=system </code> 
Line 44: Line 45:
 ==== Linking Intel oneMKL to ABAQUS (optional) ==== ==== Linking Intel oneMKL to ABAQUS (optional) ====
  
-  - Intel oneMKL (Math Kernel Library) is also part of the Intel oneAPI distribution. Intel oneMKL has Intel's implementation of BLAS, LAPACK, FFTW, and other math libraries which can be used in the user subroutine feature of ABAQUS. Navigate back to ''C:\SIMULIA\Commands'' directory, and open the ''abqXXX.bat'' file again. Add the following line below the previously added lines for the ifort compiler. This will initialize the environment variables for oneMKL when ABAQUS is called. <code> call "C:\Program Files (x86)\Intel\oneAPI\mkl\2021.1.1\env\vars.bat" intel64 </code>+Intel oneMKL (Math Kernel Library) is also part of the Intel oneAPI distribution. Intel oneMKL has Intel's implementation of BLAS, LAPACK, FFTW, and other math libraries which can be used in the user subroutine feature of ABAQUS. Learn a little bit about these libraries. 
 + 
 +  - Navigate back to ''C:\SIMULIA\Commands'' directory, and open the ''abqXXX.bat'' file again. Add the following line below the previously added lines for the ifort compiler. This will initialize the environment variables for oneMKL when ABAQUS is called. <code> call "C:\Program Files (x86)\Intel\oneAPI\mkl\2021.1.1\env\vars.bat" intel64 </code>
   - Now navigate to ''C:\SIMULIA\EstProducts\2020\win_b64\SMA\site'' (or similar directory) based on your ABAQUS installation and locate ''win86_64.env'' file and open it as an administrator (same as before). Find the following line and add ''/Qmkl:sequential'' in between other compiler flag options. The file should now look as below for that line. <code>   - Now navigate to ''C:\SIMULIA\EstProducts\2020\win_b64\SMA\site'' (or similar directory) based on your ABAQUS installation and locate ''win86_64.env'' file and open it as an administrator (same as before). Find the following line and add ''/Qmkl:sequential'' in between other compiler flag options. The file should now look as below for that line. <code>
 compile_fortran=['ifort','/Qmkl:sequential', ... ... compile_fortran=['ifort','/Qmkl:sequential', ... ...
-</code> You should be able to use the Intel oneMKL library now with ABAQUS. Apparently, by using ''/Qmkl:parallel'', you may be able to use the parallel version of oneMKL, however, it has never been tested nor found to be necessary for the ABAQUS user subroutine feature so far.+</code> You should be able to use the Intel oneMKL library now with ABAQUS. Apparently, by using ''/Qmkl:parallel'', you may be able to use the parallel version of oneMKL, however, it has never been tested we do not think is is necessary either for the ABAQUS user subroutine feature so far.
  
 ==== Programming Abaqus user subroutines ==== ==== Programming Abaqus user subroutines ====
  
-User-defined subroutines available via Abaqus/ Standard and Abaqus/ Explicit allows the users to include new constitutive model for materials, new element technologies, novel multiphysics coupling, and extend the built-in features. While Abaqus allows programming user subroutines in C, C++, and Fortran. However, because of the legacy reason, it is more popular to write Abaqus subroutines in Fortran instead of C and C++. Before you start programming Abaqus user subroutine, make yourself familiar with the fundamentals of the programming language of your choice (Fortran or C/C++; most likely Fortran).+User-defined subroutines available via Abaqus/Standard and Abaqus/Explicit allows the users to include new constitutive model for materials, new element technologies, novel multiphysics coupling, and extend the built-in features. While Abaqus allows programming user subroutines in C, C++, and Fortran. However, because of the legacy reason, it is more popular to write Abaqus subroutines in Fortran instead of C and C++. Before you start programming Abaqus user subroutine, make yourself familiar with the fundamentals of the programming language of your choice (Fortran or C/C++).
  
-Don't underestimate the power of Fortran for being a old language. It's still one of the fastest programming language for numerical computing. Under the hood, MATLAB and NumPy uses Fortran libraries.Learn about [[Fortran history | https://en.wikipedia.org/wiki/Fortran]] to understand F77 coding styles and how they are different now (comparison between F77 vs. F90). For legacy reasons, subroutine templates of Abaqus/ Standard follow F77 standard (Abaqus/ Explicit templates are different). But you are not limited by F77 standard, as long as the compiler supports (most likely it does) you can use latest features in your subroutine, but be consistent about it.+Don't underestimate the power of Fortran for being a old language. It's still one of the fastest programming language for numerical computing. Under the hood, MATLAB and NumPy uses Fortran libraries. Learn about [[https://en.wikipedia.org/wiki/Fortran| Fortran history]] to understand F77 coding styles and how they are different now (comparison between F77 vs. F90). For legacy reasons, subroutine templates provided by Abaqus/Standard follow F77 standard (Abaqus/Explicit templates are different). We recommend coding the subroutine in a fixed form (save the Fortran files with ''.for'' extensions) but you are not limited by F77 features. As long as the compiler supports you can use features from latest Fortran version in your Abaqus subroutine.
  
   * A good place to start is going through the [[https://fortran-lang.org/learn/ | resources on fortran-lang.org ]].   * A good place to start is going through the [[https://fortran-lang.org/learn/ | resources on fortran-lang.org ]].
   * Check [[https://stevelionel.com/drfortran/allposts/ | blog posts from Doctor Fortran ]]   * Check [[https://stevelionel.com/drfortran/allposts/ | blog posts from Doctor Fortran ]]
-  * [[https://www.fortran90.org | Fortran 90 ]] +  * [[https://www.fortran90.org | Fortran 90 website ]] 
-  * [[https://fortranwiki.org/fortran/show/HomePage | Fortran Wiki]]+  * [[https://fortranwiki.org/fortran/show/HomePage | Fortran Wiki webpage ]]
  
-A list of user subroutines available from Abaqus can be found here: https://docs.software.vt.edu/abaqusv2022/English/SIMACAESUBRefMap/simasub-c-gen-idxusubroutinelist.htm. For most updated list, you should check Abaqus documentation from Dassault Systemes website (you will need to create an user account login). Among those user subroutines, user material subroutine (UMAT) and user defined element (UEL) in Abaqus/ Standard are highly used in academic research to implement new constitutive model and new element technology, respectively. VUMAT and VUEL are Abaqus/ Explicit counterparts of the  You should read the documentation very thoroughly and understand how these subroutines work before start working on them. Please remember, Abaqus can recognize one Fortran file at the time of execution. If you would like to use multiple user subroutines, you will have to put them in a single Fortran file or arrange it in a way that your main Fortran file can have call other files.+A list of user subroutines available from Abaqus can be found here: https://docs.software.vt.edu/abaqusv2022/English/SIMACAESUBRefMap/simasub-c-gen-idxusubroutinelist.htm. For most updated list, you should check Abaqus documentation from Dassault Systemes website at https://help.3ds.com (you will need to create an user account login). Among those user subroutines, user material subroutine (UMAT) and user defined element (UEL) in Abaqus/Standard are readily used in academic research to implement new constitutive model and new element technology, respectively. VUMAT and VUEL are Abaqus/Explicit counterparts of the  You should read the documentation very thoroughly and understand how these subroutines work before start working on them. Please remember, Abaqus can recognize one Fortran file at the time of execution. If you would like to use multiple user subroutines, you will have to put them in a single Fortran file or arrange it in a way that your main Fortran file can have call other files.
  
-  * **UMAT:** If you can express your constitutive model and spatial tangent in terms of Cauchy stress, you perhaps need UMAT. In this case you can take advantage of the element formulation available via Abaqus such as hybrid element, incompatible model element, elements with hourglass stabilization, etc. +  * **UMAT:** If you can express your constitutive model and spatial tangent in terms of Cauchy stress, you perhaps need UMAT. In this case you can take advantage of the element formulation available via Abaqus such as hybrid element, incompatible model element, elements with hourglass stabilization, etc. UMAT subroutines are called at each integration point and the subroutine needs to return (at least) the stress and spatial tangent of the material which are later used to form the tangent (stiffness) matrix and residual vector. 
-  * **UEL:** If it is inconvenient to express your constitutive model in terms of Cauchy stress, or you need different element technology beyond what Abaqus offers such as F-bar or B-bar type element to alleviate volumetric locking or want to implment multiphysics model which are not available in Abaqus, you will need to program UEL subroutine. +      * For incompressible hyperelastic material, use **UHYPER** subroutine. \\ \\ 
 +  * **UEL:** If you need a total Lagrangian element formulation, or you need different element technology beyond what Abaqus offers such as F-bar or B-bar type element to alleviate volumetric locking of incompressible or nearly-incompressible materials or if you want to analyze multifield models which are not available in Abaqus such as chemo-mechanical model for hydrogels or phase-field model for fracture, you will need to program UEL subroutine. When programming UEL subroutine, you will have to program the constitutive response as well, i.e., a UMAT-like behavior also needed to be programmed. 
 +      * In case you want to use built-in material models provided by Abaqus with your own element formulation, consider using **UELMAT**.
  
-Our lab'template code-base for Abaqus/ Standard user element subroutine (UEL) implementation:+Both UEL and UMAT requires substantial amount of programming by the user and needless to say lots of debugging as well. For UEL subroutine, pre- and post-processing are also tricky using Abaqus/CAE and Abaqus/Viewer. So, our lab created some template code-base and tutorial for Abaqus/Standard user element subroutine (UEL) implementation which are available in the following GitHub repositories:
  
   * Abaqus UEL for isotropic linear elasticiity on GitHub: [[https://github.com/NguyenLabJHU/Abaqus-UEL-Elasticity]]   * Abaqus UEL for isotropic linear elasticiity on GitHub: [[https://github.com/NguyenLabJHU/Abaqus-UEL-Elasticity]]
   * Abaqus UEL for hyperelasticity on GitHub: [[https://github.com/NguyenLabJHU/Abaqus-UEL-Hyperelasticity]]   * Abaqus UEL for hyperelasticity on GitHub: [[https://github.com/NguyenLabJHU/Abaqus-UEL-Hyperelasticity]]
  
-Documentation for these repositories are available at this [[https://livejohnshopkins-my.sharepoint.com/:f:/r/personal/tnguy108_jh_edu/Documents/Nguyen%20Lab/Abaqus%20Tutorials?csf=1&web=1&e=IzeXD7 | OneDrive folder of our lab]] (you will need access granted by Vicky)+Documentation for these repositories are available at this [[https://livejohnshopkins-my.sharepoint.com/:f:/r/personal/tnguy108_jh_edu/Documents/Nguyen%20Lab/Abaqus%20Tutorials?csf=1&web=1&e=IzeXD7 | OneDrive folder of our lab]] (you will need access granted by Vicky).
  
  
Line 77: Line 82:
   - Notes on [[https://imechanica.org/files/Writing%20User%20Subroutines%20with%20ABAQUS_0.pdf| Abaqus user subroutine on iMechanica]]: This document is based on a very old version of Abaqus. You should consult the Abaqus manual for additional subroutine-related documentation.   - Notes on [[https://imechanica.org/files/Writing%20User%20Subroutines%20with%20ABAQUS_0.pdf| Abaqus user subroutine on iMechanica]]: This document is based on a very old version of Abaqus. You should consult the Abaqus manual for additional subroutine-related documentation.
   - Prof. Allan F. Bower's class on [[https://www.brown.edu/Departments/Engineering/Courses/En2340/| Computational Methods in Solid Mechanics at Brown University]]: This class covers different finite element formulation (mechanical to multiphysics) and their implementation in a custom Fortran based FEA code which shares the same user subroutine format as Abaqus.   - Prof. Allan F. Bower's class on [[https://www.brown.edu/Departments/Engineering/Courses/En2340/| Computational Methods in Solid Mechanics at Brown University]]: This class covers different finite element formulation (mechanical to multiphysics) and their implementation in a custom Fortran based FEA code which shares the same user subroutine format as Abaqus.
-  - Prof. Allan F. Bower's [[https://github.com/albower/EN234_FEA| FEA Code on GitHub]]: You can use this code. +  - Prof. Allan F. Bower's [[https://github.com/albower/EN234_FEA| FEA Code on GitHub]]. This is an extended version of the FEACHEAP code (http://solidmechanics.org/FEA.php) which supports Abaqus-style user subroutine programming. This code can give you an idea of the orgranization and programming style as well, but be careful about the bugs if you use the code (there is no license available for this code on GitHub so we do not recommend using it).
  
  
Line 97: Line 102:
 As of 2023, Rockfish has replaced MARCC as JHU's HPC. Verify the lines in the header to make sure your email, HPC partition, runtime, etc. are configured correctly. Additionally, make sure the correct Abaqus module is loaded for your use case. As of 2023, Rockfish has replaced MARCC as JHU's HPC. Verify the lines in the header to make sure your email, HPC partition, runtime, etc. are configured correctly. Additionally, make sure the correct Abaqus module is loaded for your use case.
  
-[[https://github.com/NguyenLabJHU/Rockfish-HPC-Scripts| Go to this GitHub repository]] and find the batch scripts to run Abaqus on Rockfish and MARCC. They are almost identical and you can create your own from these. +[[https://github.com/NguyenLabJHU/Rockfish-HPC-Scripts| This GitHub repository]] contains batch scripts to run Abaqus on Rockfish and MARCC (this is a private GitHub repository, and you will have to have an account added to the Nguyen Lab account to access this.). Scripts for Rockfish and MARCC are almost identical, and you can create your own from these if you need to.
- +
-This is a private GitHub repository, and you will have to have an account added to the Nguyen Lab account to access this.+
  
  
  
  
DokuWiki CC Attribution-Share Alike 4.0 International