Hi, wlx schrieb
1) you can define another function 
        (define (output-function) (print "Ezsum=" Ezsum "\n"))
        and put it into your run-until's function-list like 
        (run-until 500 
                output-function
                your other functions
        ).
2) (meep-fields-dt-get fields) : get the single time step value `dt` in
meep, and `fields` is a swapper for the EM field meep is simulating. If
you want to understand them further, read meep's C++ source files or
guess them from `meep.scm` you have installed. 

yours 
Zheng  
在 2007-09-07五的 09:10 +0800,wlx写道:
> I still have questions
> 1) I want to evaluated "ezsum" at every point. So I can make a
> picture. 
> However, (print "Ezsum = " Ezsum "\n") only output a number.
> Can any method help me??
> 
> 2) In meep-discuss, I find a function (meep-fields-dt-get fields). I
> can not understand it. What can I consult  to  understand such kinds
> function??
> 
> >> I'm doing a 3D simulation. I want to calculate the integral of 
> >> |Ez|^2/(|E|^2) over 200 time steps at the end of the sumulation time. I
> 
> >This doesn't seem well-defined.  What if |E| = 0?
> 
> >> need to calculate the whole field. I have looked through the 
> >>meep-discuss but have no idea. I write the function like:
> >>(define Ezsum 0)
> >>(define (do-Ez-sum)
> >>(set! Ezsum (+ Ezsum
> >>(integrate-field-function (list Ez Ex Ey)
> >>(lambda (ez ex ey) (/ (sqrt ez)
>  (+ (sqrt ex) (sqrt ey) (sqrt ez))))))))
> >>(after-time 300 (run-until 500 do-Ez-sum))
> >>Is there anything wrong ???
> 
> >I can spot at least two errors.
> 
> >First, you should have (lambda r ez ex ey) ...), since 
> >integrate-field-function alwasy passes the position as the first argument. 
> >See:
> 
> >http://ab-initio.mit.edu/wiki/index.php/Meep_field-function_examples
> 
> >Second, after-time should go inside the run statement, i.e.
> >(run-until 500 (after-time 300 do-Ez-sum))
> 
> >>How can I output the results?? It seems that "output-field-function" is 
> >>not applicable. Can anyone give me a sample code???
> 
> >(print "Ezsum = " Ezsum "\n")
> 
> 
> 
> 
> ______________________________________________________________________
> 雅虎免费邮箱,全球第一邮箱品牌!
> _______________________________________________
> 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

Reply via email to