DPF in Mechanical doesn't run on Linux machine in 2022R1?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 454
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭
edited June 2023 in Structures

DPF code doesn't run on Linux machine in 2022R1?

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 454
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    Answer ✓

    For 2022R1 Ansys’ Linux installation is not shipped with the CS_DataProcessing.dll which the C:\Program Files\ANSYS Inc\v221\aisol\DesignSpace\DSPages\Python mech_dpf.py script adds a reference to, that is the error shown above.

    As a workaround you can copy C:\Program Files\ANSYS Inc\v221\aisol\bin\winx64\ CS_DataProcessing.dll from Windows Ansys installation on the Linux machine and add the reference to the dll in the new path, using the code below. Please make sure to add these lines at the top of your existing code:

    import clr
    clr.AddReferenceToFileAndPath("/Path/to/CS_DataProcessing.dll")
    
    import mech_dpf
    mech_dpf.setExtAPI(ExtAPI)
    import Ans.DataProcessing as dpf
    
    ds = mech_dpf.GetDataSources(1)
    ...
    

    NOTE: Currently for Linux, DPF’s IronPython API is not supported in Mechanical. If you have written some of your code using the IronPython API you will need to convert that to C++ Syntax (but still Python code). Please refer to mech_dpf.help()