[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [femm] multiple results using makeplot



You can pass the iteration number to the postprocessor in two ways.  The first is to write the number to a temporary file in the preprocessor and then read the number out of the postprocessor.  If k represented your iteration number, you'd write the value via the code snippet:

handle=openfile("tempfile","w");
write(handle,k,"\n");
closefile(handle);

and the read the value in the postprocessor by doing

handle=openfile("tempfile","r")
k=read(handle,"*n")
closefile(handle)


Alternatively, several additional parameters can be included in the runpost call. A limited numberof variables can be passed to the postprocessor by adding a extra parameters of the form -lua-var=variable=value, e.g.:
run_post("c:\\my-lua-script.lua","-lua-var=filename=myfilename")
All variables are passed as strings so lua internal conversion routines (i.e. tonumber) must be employed to obtain numbers from the strings.

Dave.

alteredfrog wrote:
I am trying to right a bit of Lua code that will save the result from
each step in a distinct file, or append the results to an existing
file.

In the pre-processor script If I knew how I could incriment the file
name before each "analyse()" call. This would save each solution set.

What may work better may be to pass the iteration step or file name
value to the post-processor script and incriment or change the name
of the file that the "makeplot()" data is saved to (graphical or data
not to important which). Again I dont know how to do this.

I've only been working with the LUA script for 4 afternoons so its
all still new.

My goal is a "slide show" of the tangetial field along a selected arc
as two parts move away from each other.

thanks for the help in advance



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


-- 
David Meeker
dmeeker@xxxxxxxx
http://femm.berlios.de/dmeeker