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

Re: [femm] Plot-X-Y with LUA



Hi Naasson:

Below you'll find an example that might come close to what you're trying to do. It is for generating X-Y data in the case of an axi-symmetric model, but may run with little or no modification in a square planar case. Note that it is for points along a horizontal line. The script can either be run from the post-processor or by another .lua script, which explains the attention paid to the file issues.

Take care,

Greg

---

-- x/r field plot lua script
-- Plots B(real) normal along x/r with y/z at 0 .
-- GRQ 020717
--
-- Units inches.
exit_at_end=1
xstart=0 -- starting point on x/r, (y/z fixed at zero)
xend=1.5 -- ending point
numpts=255 -- number of points - 1
smooth("off")
increment=(xend-xstart)/numpts
if not(filename) then
-- filename not set - probably running from within postprocessor already
-- use a default name and do not exit postprocessor upon exit
filename="plotfile.txt"
messagebox("Plot output to file: \n"..filename)
exit_at_end=nil
end
handle=openfile(filename,"w")
-- messagebox(filename) -- uncomment for debugging
for x=xstart,xend,increment do

Are,Aim,B1re,B1im,B2re,B2im,Sig,E,H1re,H1im,H2re,H2im,Jere,Jeim,Jsre,Jsim, Mu1re, Mu1im, Mu2re,Mu2im,Pe,Ph=getpointvalues(x,0)
write(handle,x,'\t',B2re,'\n')
end
closefile(handle)
filename=nil -- (This is this how to "unset" the filename variable.)
if (exit_at_end) then
exitpost()
end


Naasson Pereira de Alcantara Jr. wrote:

Hi !

I'm a femm user, but I never tried batch executions with Lua scripting
yet. I would like to do this, including to write the data of Plot X-Y to
a text file, but I did not find explicit information about this in the
femm manual. Could someone help me with this problem ?

best regards,

Naasson





Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/