(define fieldvalue 0)
(define (storefields)
(set! fieldvalue (maxfields)))
Note also that “maxfields” is in parentheses because you want the return value of the maxfields function stored as “fieldvalue,” not the function itself.
Cheers,
Ben
On 10/22/06 15:54, "Bryce Meredig" <[EMAIL PROTECTED]> wrote:
Hi all,
I'm trying to do something pretty simple--at every few time increments, I want to store the max intensity value in a given volume to a variable. I'm able to *print* the max intensity in the volume in a step function, but when I try to do anything like define or define-param in such a function, I get an ERROR: Bad define placement. Any ideas? Some code is below:
(define (maxfields)
(max-abs-field-function (list Ex Ey Ez) intens (volume (center 0 0 -21) (size lx ly 1))))
That works fine, but
(define (storefields)
(define-param fieldvalue maxfields))
produces the bad define error.
I can run maxfields every 1 time increment, for example, and even add a "print" command to it so that I can see the intensity output every 1 time unit. I'm stuck on how to define a variable as the result of the max-abs-field-function call.
Thanks!
Bryce
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

