Re: output field

"Steven G. Johnson" <[email protected]>
Newsgroups gmane.comp.science.photonic-bands
Message-ID <[email protected]>
On Apr 17, 2008, at 8:54 PM, Mindy Lee wrote:
> Dear All,
>
> How can MPB output |E| ?

You have to use the lower-level field manipulation functions like  
field-map! that allow you to compute arbitrary functions of the  
fields, and which are (mostly) documented in the manual.

In particular, if you define the functions below, then you can just  
do: (run output-emag)

Regards,
Steven G. Johnson

(define (get-emag which-band)
   (get-efield which-band)
   (let ((emag (rscalar-field-make cur-field)))
     (field-map! emag
                 (lambda (f g) (sqrt (real-part (vector3-cdot f g))))
                 cur-field cur-field)
     (field-load emag)))
(define (output-emag which-band)
   (get-emag which-band)
   (output-field-to-file -1 (string-append (get-filename-prefix)  
"emag.")))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.