30.1. Using a Compiled Dynamic Library

This is done by calling the routine user_force, which is stored in a compiled file. You can write and compile your own routine as long as it follows the requirements in this section.

On Windows, the name of the .DLL file must be user_force64.dll, and the file must be located in the same directory as the Aqwa executables (typically C:\Program Files\ANSYS Inc\v242\aqwa\bin\winx64).

On Linux, the name of the file must be libuser_force.so. You can define the location of the file using the LD_LIBRARY_PATH environment variable (defaults to /<installation_directory>/ansys_inc/v242/aqwa/bin/linx64) .

The standard Windows Aqwa installation includes the following example files in the directory C:\Program Files\ANSYS Inc\v242\aqwa\doc, and it is recommended that you copy and modify these as appropriate:

  • user_force.f90 - example Fortran subroutine

  • user_force.c - example C routine

Example of Fortran Subroutine user_force is a copy of the Fortran subroutine user_force.f90.

This capability is activated by using the FDLL option.

Up to 100 integer and 100 real control parameters can optionally be input in Data Category 10. These are passed to user_force at each call and can be used to define variables such as control constants or calculation options. The input format is shown in The IUFC/RUFC Data Records - External Forces.