Re: Outputting field profiles

"Steven G. Johnson" <[email protected]>
Newsgroups gmane.comp.science.photonic-bands
Message-ID <[email protected]>
On Tue, 30 May 2006, Melanie Ayre wrote:
> I am using mpb to calculate the field profiles of a W1 supercell, and am 
> having difficulty with the output.  To get enough of the dispersion diagram, 
> I usually calculate the first 50 or so bands, and I want to output E, D, and 
> H for say the last ten bands.
>
> To do this, I put
>
> (run
> fix-hfield-phase
> (get-efield 40)
> (output-efield 40)
> )

This is a common misunderstanding.  The band functions need to be 
*functions* that are passed to run.  When you pass (get-efield 40), you 
are passing the *result* of *calling* (get-efield 40), and not a function. 
This results in an error because it means that you are calling get-efield 
before computing the fields with (run).

Also, output-efield calls get-efield; you don't need both.

Instead, what you want is to define a new band function which only calls 
output-efield for the last ten bands.

(define (output-some-efields b)
    (if (>= b (- num-bands 10))
       (output-efield b)))

(run output-some-efields)
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.