Size of Mesh Cell Reference in .os File

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

Hello, 

 

I am using FEKO 2017. From POSTFEKO, I am exporting the surface current and get the .os file. I then import the .os file into MATLAB to do some processing. I would like to calculate the area of the mesh cell for which the current is given for each entry in the .os file. Is this data available within one of the headings of the .os file? I have looked through the user manual but can't find anything relevant.

 

I've attached an example .os file at which I am looking.

 

 

Thanks,

Alex

Unable to find an attachment - read this blog

Tagged:

Answers

  • JIF
    JIF
    Altair Employee
    edited August 2018

    Hello bouvy / Alex

    As you have noticed, the .os file does not contain the triangle vertices and thus you can't calculate the area from the information in that file. The information is available at other places. The following list contains some options:

    • Use the POSTFEKO API to access the data that you need. In this case you are only looking for the mesh details so that you can calculate the area. At the end of this comment is an example (from the manual) that shows you how to access the mesh elements. You can also access all the current information in a similar way and if you want to continue with the post processing in Matlab / Compose, you can create your own file format and export it from POSTFEKO with all the info that you require in Matlab / Compose. You could also do the processing in POSTFEKO directly (possibly).
    • You can also export the mesh to a format that you are able to read (Nastran / STL) and access the triangles that way.
    • There is an option to export the mesh info the .out file. With this option, you get all the info including the area. I would not parse the .out file (I never advise to do that), but it can be used to check your calculations.

    I hope this helps. My preference would definitely be the POSTFEKO scripting. You can even use the --run-script and --non-interactive command line options to call POSTFEKO (without a GUI) to execute a script and export all the info that you need to a file (should be very easy to integrate into Matlab / Compose in that way).

     

    Example script to access mesh elements in POSTFEKO:

     app = pf.GetApplication() app:NewProject() app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]]) sConf = app.Models['startup'].Configurations[1] mesh = sConf.Mesh points = mesh.Points      -- Iterate through 'TriangleFaces' and print the first two 'Triangles'      -- vertex indices as well as their locations      TriangleFaces_count = mesh.TriangleFaces.Count for i = 1, TriangleFaces_count do     triangle = mesh.TriangleFaces[i].Triangles -- Create a member to ensure the best performance     for j = 1, 2 do        print('Triangle '..j)        print(triangle[j])        print('Vertex locations')        print(points[triangle[j].VertexIndices[1]]) -- Accessing member here will be faster than        print(points[triangle[j].VertexIndices[2]]) -- querying the mesh for its points each time        print(points[triangle[j].VertexIndices[3]])     end end

     

  • bouvy
    bouvy Altair Community Member
    edited August 2018

    Thanks a lot JIF, very helpful. I'll give this a try.