On Thu, 11 Jan 2007, Huazhong Wang wrote:
i am trying to use command: output-field-function name cs func). i don't
know what means of name. i think it is just a name of a dataset. but i
couldn't make this command run. meep responded me that the name in my
code is unbound variable. who can give a code with this command?
Did you look in the Meep manual? As explained in the Meep manual, the
first argument (name) is the name of the data set within the output HDF5
file; it is also used for the name of the output file unless you are using
to-appended or similar. i.e. it is a string
For example, here is code to output the function Ex + Ey to a dataset/file
named "foobar":
(output-field-function "foobar" (list Ex Ey) (lambda (r ex ey) (+ ex ey)))
Note that the "lambda" construct in Scheme is used to define a function on
the fly (in this case, the function f(r,ex,ey) = ex + ey).
The above command calls the output-field-function to output Ex + Ey
immediately. If instead you want to *pass* this as a step-function to
(run ...) etc., so that it can be called every time step (or whenever),
you instead should define a new function of no-arguments
(define (my-output-Ex+Ey)
(output-field-function "foobar" (list Ex Ey)
(lambda (r ex ey) (+ ex ey))))
and then you can call
(run-until 200 (at-every 1.3 my-output-Ex+Ey))
or whatever you want.
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss