Save Maxwell tabular data report from within Workbench

Options
Igor Savin
Igor Savin Member Posts: 2
Name Dropper First Comment

Hello. I am doing coupled electromagnetic - transient-thermal simulations in Workbench. For electromagnetic simulatinon I use Maxwell. I got a python script (or workbench journal) that runs the whole simulation process. In this script I use command that saves tabular data report in a file on disc (please, find this line of code below in the message). When I run this script on my office computer everything works fine, but when I run this command on a HPC Cluster in a Batch mode I get and error (please find the error message below). How can I overcome this problem (basically I want to be able from withing Workbench to send to Maxwell command to save table report on disc when running in a Batch mode)?

Command: system1.SendAnsoftCommand(PyCommand='oDesktop.SetActiveProject("MaxwellProject").SetActiveDesign("Maxwell3DDesign1").GetModule("ReportSetup").ExportToFile("Winding Table 1", "FILENAME", False)'.replace("FILENAME", z))

Error:

Fatal error: An unexpected error has occurred: CommandFailedException: Error in running the 'SendAnsoftCommand' command: Edits are not allowed when ANSYS Workbench is started without a graphical display.


Tagged:

Answers

  • Kelly M
    Kelly M Member, Employee Posts: 3
    Ansys Employee Solution Developer Community of Practice Member Name Dropper First Comment
    Options

    Hi @Igor Savin

    Thank you for your question. I wanted to personally update you in stating that we are trying to find the right person with this experience to answer your question.

  • Samuel Lopez
    Samuel Lopez Member, Employee Posts: 21
    First Anniversary Ansys Employee 5 Likes First Answer
    Options

    Hi @Igor Savin ,

    When you are running the script locally (on your office computer) is WB in graphical or non-graphical mode?

    If I am not wrong this command can not work in Non-graphical mode, so you will need to launch the WB project in batch mode and once it is solved, open the project in Graphical mode and launch the script.

  • Igor Savin
    Igor Savin Member Posts: 2
    Name Dropper First Comment
    Options

    Hi @Samuel Lopez ,

    When I run the script on my office computer in graphical mode everything works well. But when I run it in non-graphical mode (BATCH mode) I get an error.

    And I think you are right, that this command can not work in graphical mode. But my question is "how can I replace or change this command so it could work in BATCH mode and deliver required functionality (save tabular data report from Maxwell on a disc?"

  • Samuel Lopez
    Samuel Lopez Member, Employee Posts: 21
    First Anniversary Ansys Employee 5 Likes First Answer
    Options

    Hi @Igor Savin ,


    I think this is a question that could be asked directly to the Ansys Technical team, please submit a ticket.


    But the only workaround I suggest is to split the solver and post-processing into different tasks, your script should:


    1. Launch WB in batch mode to the cluster
    2. Wait until it is finished
    3. Open WB in Graphical Mode
    4. Call the SendAnsoftCommand

    I know this workflow is tricky, and you probably don't know how to launch WB from a python script. I did it in the past but it needs some classes. I am contributing to the PyAEDT initiative, and we are trying to integrate one method for at least importing one Maxwell/HFSS design into WB automatically. But we could also think about adding the option to open an existing WB project and control it with Python. Please give me more details about your project (how you are submitting in batch mode, etc) to cover your case.

    This will not happen until next year


    Thanks