Can PyFlux doing For Loop?

Jerome Teoh
Jerome Teoh Altair Community Member
edited December 2022 in Community Q&A

Hi, I am thinking to code a post postcessing pyFlux code.

It need to be extrating 3D surface plot data and write into individual excel file with different time step.

Wondering if this is possible?

image

 

Tagged:

Best Answer

  • Letizia_Ferrara
    Letizia_Ferrara
    Altair Employee
    edited December 2022 Answer ✓

    Hello Jerome,

    Yes you can use the for cycle.

    From what I see from the image you shared, the problem could be the the syntax; indentation is required for the code lines in the loop.

    You can find two very useful documents and more info in the Flux help, available from the supervisor, clicking on the question mark button at the top right (see image attached).

    Regards,

    Letizia

Answers

  • Jerome Teoh
    Jerome Teoh Altair Community Member
    edited June 2022

    For example, I have try to introduce a term to sequentially change the time step.

    I got this error.

     

    image

  • Letizia_Ferrara
    Letizia_Ferrara
    Altair Employee
    edited December 2022 Answer ✓

    Hello Jerome,

    Yes you can use the for cycle.

    From what I see from the image you shared, the problem could be the the syntax; indentation is required for the code lines in the loop.

    You can find two very useful documents and more info in the Flux help, available from the supervisor, clicking on the question mark button at the top right (see image attached).

    Regards,

    Letizia