General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

UPF dynamic library ansys terminates abnormally

    • janot.lubritz

      Hey guys!

      I am trying to include USERMAT files in my Ansys code via the dynamic library linking option. I did everything as described in the manual (ANS_USER_PATH is set, USERMAT.F and ANSUSERSHARED.bat are in the folder and did compile, the output window shows that ANSYS is linked by licensee) but everytime I run my APDL code (which works without the USERMAT) the run terminates abnormally and the window closes without any message. When I restart APDL it says:

      *** ERROR ***
       Another ANSYS job with the same job name (dll_UPF_Check_20072023) is already running in this
       directory or the dll_UPF_Check_20072023.lock file has not been deleted from an abnormally
       terminated ANSYS run.  To disable this check, set the ANSYS_LOCK environment
       variable to OFF.

       Do you wish to override this lock and continue (y or n)?


      I checked the .lock file but it's empty and I have no idea what could be the problem. I know that the USERMAT works since I linked it via the new .exe linking option but I want to switch to the .dll linking option.


      Does anybody have an idea on what could be the problem? I run Mechanical APDL 2022R1 on Windows 10.


      Thanks a lot in advance!


    • mjmiddle
      Ansys Employee


      I’m just adding my two cents since I don’t work with the UPF, but I can tell you that the .lock file is always an empty file. It’s presence is just used to indicate whether the previous Ansys session ended abnormally, in which case it would produce the error you pasted. You can just type “y” to override the previous lock and continue launching Ansys. Or just delete the .lock file before launching Ansys, and it will launch normally, without any recognition of the previous abrupt exit.

      Is there anything relevant to the crash left in the .err file?


    • janot.lubritz


      Thanks for the response. There are some warnings in the .err file but they’re all related to the model and not the “solver” itself. I cannot find anything that would lead to a total crash and not just an error prompt during the solving provess.

      I know that I can override or delete the lock file but when I try to run it again APDL crashes again...

      The same model does run with the USERMAT linked via the .exe file so I know that it does run through. I just have no clue why the linking with the dll library does not work. When I compile files beforehand with ansusershared.bat it does create dll and other files but the linking to APDL with the system variable ANS_USER_PATH somehow does not work (even though it says in the command prompt: This version is linked by licensee).




      • janot.lubritz

        Update: I figured that it does not crash when I use the original Ansys folder for the compilation (C:\Program Files\ANSYS Inc\v221\ansys\custom\user\winx64) and switch my ANS_USER_PATH variabel to the same folder. It says everywhere that any folder can be used for the compilation as long as the ansusershared.bat and the usermat.f are existant. Looks like that is not the case but everything is working now.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.