How to write POSTFEKO lua code to generate combined configurations of scattered near and far field

Hamsalekha
Hamsalekha Altair Community Member
edited October 2020 in Community Q&A

Hi,

I wish to write a postfeko code where it can generate only near field results (Electric field magnitude and phase for theta and phi) and far field results (Electric field magnitude and phase for theta and phi and backscattering cross section value) for 256 configurations in one single text file. (Combinations of all 256 configurations in a single text file and also 2D Cartesian graph)

I wrote this code (only for near field) but it is not working. The arrangement of the configurations are not in order and the results cannot be displayed in the Cartesian graph.

My code

-- To get started try the following script:
names = pf.NearField.GetNames()
printlist(names)
for i = 1,256,1 do
nearfieldi = pf.NearField.GetDataSet(names)

print(nearfieldi)


end
return nearfield

 

The output file has all the results of 256 configurations but there are other informations as well. So, it is impossible for me to extract the mentioned data one by one for 256 configurations and paste it in text file since its time consuming. The configurations are based on the theta and phi of incident and scattered field. I will attach the output file so that you can take a look on how the initializations are done and you can also refer to my previous forum discussion to understand the flow of the simulation. 

https://community.altair.com/community?id=community_question&sys_id=0d76443a1b2bd0908017dc61ec4bcb74

 

I hope anyone can assist me in this problem since it is an essential part of the investigation. 

 

Thank you

Unable to find an attachment - read this blog

Tagged:

Answers

  • Mel
    Mel Altair Community Member
    edited April 2020

    The out file contains all sorts of data. It might be easier to use the far field output files (*.ffe) and near field output files (*.efe/*.hfe) as these will contain only the relevant data.

    Then just read / combine the appropriate lines of data from these files.

     

    But if you want to write an automation script for POSTFEKO, it would be better to first start with a smaller data set: 

    Create a smaller version of the model with say 5 configurations and 4 near field and 4 far field points per configuration and get that working first.

  • Hamsalekha
    Hamsalekha Altair Community Member
    edited April 2020

    Dear Mel,

    Noted with thanks.