Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Abaqus VUMAT stand-alone testing/debugging

Bas_T_
Beginner
4,980 Views

Hi Guys,

I'm new to these forums and I'm looking for some help/advice on fortran subroutines in combination with Abaqus. I noticed there were several posts related to fortran and Abaqus in the past.

In one of the posts it was mentioned to setup a main program to interface with an abaqus subroutine for easy debugging/testing. 

(https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/506878)

I was wondering if there are people having experience in setting up such a program and if there are any examples. 

My plan would be to create a single element model and run it with abaqus to write the information that abaqus is passing to the subroutine to a file. I would then feed this input to the stand-alone program to "simulate" abaqus calling it after which I can test/debug the subroutine.

I'm interested in VUMAT examples but any other subroutine would probably be similar.

Thanks,

Bas

0 Kudos
1 Solution
Greg_T_
Valued Contributor I
4,980 Views

Hi Bas,

I have attached an example of an Abaqus DLOAD user subroutine and a main program to test it.  Abaqus passes some element and coordinate information to the DLOAD subroutine where a pressure value (traction load) is computed and returned (described in the DLOAD.for comments).  The main program varies the y-coordinate to call DLOAD several times in a loop.  Will this be adequate for a starting example?

I have attached the two Fortran files and a zip file with the whole Visual Studio 2013 project.  I used Intel Fortran XE2016 in VS2013 for the project.  Or if you open a new console project in the version of Visual Studio you're using, just add the two source files to your project (Project menu -> Add Existing Item) then compile and run.  I use the Debug menu -> Start without debugging option to run the program so that the console window says open to view the output.  Or put a breakpoint at the end of the main program to pause if running as Debug -> Start debugging.

I've used this DLOAD subroutine to compute the pressure on a crack face for different loading distributions, but the DLOAD routine does not know anything about a crack mesh but only has the available information passed in to do some calculation to return a pressure value.  You'll notice I had to set a few local values in DLOAD for the pressure calculation.  Once you get the VS project running, you could also try modifying this DLOAD routine to apply a load to a small FEA mesh and run in Abaqus.  A good test using DLOAD is to apply a uniform traction using the usual *DLOAD command in the Abaqus input file, and then reproduce the same loading using the DLOAD subroutine to confirm the same result.  It can also help to use the Abaqus file unit numbers to write information from the user subroutine to the Abaqus *.msg message or *.dat output file to help debugging when running an Abaqus analysis.  The Abaqus file unit numbers are listed in the "Abaqus Analysis User's Guide", section 3.7.1 "Fortran unit number used by Abaqus".  The *.msg file is assigned to file unit 7, the *.dat output file is assigned to file unit 6 (interesting they chose to modify the default output unit).

Since you are interested in the UMAT/VUMAT routine, I think this DLOAD example is a good starting point since running and testing a user subroutine for Abaqus would use the same approach.  For example, a simple UMAT subroutine could reproduce the isotropic elastic material behavior as given by the *ELASTIC command to confirm the same result before going to more complicated material models.

Regards,
Greg

View solution in original post

0 Kudos
13 Replies
Greg_T_
Valued Contributor I
4,981 Views

Hi Bas,

I have attached an example of an Abaqus DLOAD user subroutine and a main program to test it.  Abaqus passes some element and coordinate information to the DLOAD subroutine where a pressure value (traction load) is computed and returned (described in the DLOAD.for comments).  The main program varies the y-coordinate to call DLOAD several times in a loop.  Will this be adequate for a starting example?

I have attached the two Fortran files and a zip file with the whole Visual Studio 2013 project.  I used Intel Fortran XE2016 in VS2013 for the project.  Or if you open a new console project in the version of Visual Studio you're using, just add the two source files to your project (Project menu -> Add Existing Item) then compile and run.  I use the Debug menu -> Start without debugging option to run the program so that the console window says open to view the output.  Or put a breakpoint at the end of the main program to pause if running as Debug -> Start debugging.

I've used this DLOAD subroutine to compute the pressure on a crack face for different loading distributions, but the DLOAD routine does not know anything about a crack mesh but only has the available information passed in to do some calculation to return a pressure value.  You'll notice I had to set a few local values in DLOAD for the pressure calculation.  Once you get the VS project running, you could also try modifying this DLOAD routine to apply a load to a small FEA mesh and run in Abaqus.  A good test using DLOAD is to apply a uniform traction using the usual *DLOAD command in the Abaqus input file, and then reproduce the same loading using the DLOAD subroutine to confirm the same result.  It can also help to use the Abaqus file unit numbers to write information from the user subroutine to the Abaqus *.msg message or *.dat output file to help debugging when running an Abaqus analysis.  The Abaqus file unit numbers are listed in the "Abaqus Analysis User's Guide", section 3.7.1 "Fortran unit number used by Abaqus".  The *.msg file is assigned to file unit 7, the *.dat output file is assigned to file unit 6 (interesting they chose to modify the default output unit).

Since you are interested in the UMAT/VUMAT routine, I think this DLOAD example is a good starting point since running and testing a user subroutine for Abaqus would use the same approach.  For example, a simple UMAT subroutine could reproduce the isotropic elastic material behavior as given by the *ELASTIC command to confirm the same result before going to more complicated material models.

Regards,
Greg

0 Kudos
Bas_T_
Beginner
4,979 Views

Thanks Greg, I will give it a try!

I will most likely have to use command line for making the project as we only have the compiler installed with Abaqus, no VS. Any special methods required for compiling from command line when working with abaqus?

0 Kudos
mecej4
Honored Contributor III
4,979 Views

To build the DLL and the import library:

ifort /LD DLOAD.for /link /export:DLOAD

To build the test program:

ifort Driver_Abaqus614_DLOAD.f90 DLOAD.lib

 

0 Kudos
Greg_T_
Valued Contributor I
4,979 Views

When running Abaqus with a user subroutine add the "user" key word and the name of the subroutine.  The Abaqus Analysis User's Guide, section 3.2.2, lists the available command line key words, such as "user".  If the analysis is using more than one user subroutine, put them all into a single *.for file.  I usually put the user subroutine in the same directory as the input file so that I don't need to enter the full directory path.

>abaqus job=jobname input=inputname user=subroutinename.for

Command line compiling would work well for this small test project.  I believe that the Intel Fortran install can provide a Visual Studio shell that you can use for editing and building Fortran projects.  Another alternative may be to the get the Microsoft Visual Studio Community edition, which I think is free if you qualify.

Regards,

Greg

 

0 Kudos
Bas_T_
Beginner
4,979 Views

Cool, thanks that works! Sorry for the newb questions.

Now I'm gonna try to setup the vumat version.

mecej4 wrote:

To build the DLL and the import library:

ifort /LD DLOAD.for /link /export:DLOAD

To build the test program:

ifort Driver_Abaqus614_DLOAD.f90 DLOAD.lib

 

0 Kudos
Bas_T_
Beginner
4,979 Views

Interfacing with the vumat is already working, next step will be to make some test runs on abaqus and compare input/output.

0 Kudos
Bas_T_
Beginner
4,979 Views

How do I export other functions/subroutines that are in the same fortran file as my VUMAT (or DLOAD).? So that I call them in my main routine.

0 Kudos
mecej4
Honored Contributor III
4,979 Views

Whether the functions/subroutines are in the same source file or not does not matter as far as the link command is concerned. Simply add /export:<sub/func_name> clauses at the end of the link command in #6.

If you have many names, use a module definition file, use LIB.exe to build an .EXP file from that, and specify the name of the .EXP file when building the DLL instead of the /export: clauses. An example DEF file:

   LIBRARY DLOAD.DLL
   EXPORTS
   DLOAD
   SUB1
   FUNC1

Use this to make the .EXP file:

lib /def:dload.def /machine:i386

 

0 Kudos
Bas_T_
Beginner
4,979 Views

Thanks, I was trying commas and spaces but indeed multiple /export: did the trick

0 Kudos
Greg_T_
Valued Contributor I
4,979 Views

Hi Bas,

Are you able to access several Abaqus user subroutines from a single *.for file when including the "user=" Abaqus key word?  Using the export file and creating a DLL would be very useful for the stand-alone testing.  I think that Abaqus should run the Intel Fortran compiler and link to the Abaqus analysis without needing the export file, as far as I know.

Regards,
Greg

0 Kudos
Bas_T_
Beginner
4,979 Views

Hi Greg,

No not for abaqus, but I want to test seperate parts of my code (in seperate subroutines) without having to go through the whole VUMAT.

Several subroutines could be done by detecting a material name and have it jump to the correct subroutine depending on the name.

Bas

0 Kudos
Adam_C_2
Beginner
4,979 Views

Hello All, 

I am sorry for jumping into this thread with an additional question. This thread relates, however to the issues I am having trying to run a user-defined VUMAT material in Abaqus. I am interested to know if you must have a Fortran Compiler in order to successfully run a job? I have tried to take the VUMAT example given at the end of the "Abaqus User Subroutines Reference Guide" and run a simple test. However, I get back the following error:

'ifort' is not recognized as an internal or external command,
operable program or batch file.

Thank you for any help that you can provide me! Have a good one!

Kind Regards

Adam

0 Kudos
Bas_T_
Beginner
4,979 Views

You need the fortran file + compiler and user "user=" in the command line or you need to have the compiled subroutine (obj+dll) in a directory and set "usub_lib_dir=path_to_dir" in your environment file. You can also use other (free) compilers but that requires modifications of the environment file.

Bas

0 Kudos
Reply