Lua used to convert Fluent to SIMION: error "assertion failed! stack traceback:"

Hi all,

i’m new to Lua spicificaly used in SIMION, i’m trying to run a pre-existing script that converts Ansys Fluent .ip files to SIMION .pa files.

i make the .ip file from Fluent and run the Lua program to convert it into the SIMION .pa file but i get the following error…

assertion failed!

stack traceback:

in function ‘assert’

…desktop/blah blah blah.lua:92:

in main chunk

here is the section of code from line 87 to 100

87   – Read data points from .ip file.
88   local fields = {}
89   for i=1,#field_names do
90     local data = {}
91     for j=1,num_points do
92       local num = assert(fh:read’*n’)
93       data[#data+1] = num
94     end
95     fields[field_names[i]] = data  
96   end
97   local rest = fh:read’*a’
98   if not rest:match’^%s*$’ then
99     error(‘extra data found at end of file: [’…rest…’]’)
100   end
 

i have attached the full Lua code and the .ip file

thanks in advanced

How does this involve Corona SDK?

How does this involve Corona SDK?