On Wed, 8 Aug 2007, Thomas Paul wrote:
> I'm trying to calculate the energy-flux of a propagating electromagnetic
> field via Meep. Therefore, I want to track the calculated energy  going
> through some specific cutting plane every certain time intervals (a test
> ctl-file is attached below). So I tried to include the "display-fluxes"
> function as a step-function-argument into the "run-until" function (see
> attached CTL-file) to be called every 50 time units. What happens then:
>
> First: The function is called at time-step 0 (see output text) successfully.
> Question: Why it is called the first time at t=0 (and not at t=50)?
> [....]
> (run-until 100
>           (at-beginning output-epsilon)
>           (at-every 10 (in-volume outputVolume output-efield-z))
>           (at-every 50 (display-fluxes fP1))
> )

The problem you are having is one of the most common confusions with Meep 
and MPB: instead of passing a function to run-until, you are passing the 
*result* of calling a function, which means that your display-fluxes is 
only evaluated once and there is an error later on.

Since this confusion is so common, I wrote up a short description of the 
problem and its solution in the Meep manual.  See:

http://ab-initio.mit.edu/wiki/index.php/The_run_function_is_not_a_loop

Regards,
Steven G. Johnson

_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to