Hello mailing list subscribers, hi Steven,

From the Meep reference:
(at-time T step-functions...)
"Given zero or more step functions, evaluates them only once, after a T time units have elapsed from the start of the run."

It seems that this is not really what happens: the step functions actually get called twice, as you can see by running meep, printing the meep-time in the step function:
meep>
 (run-until 10
   (at-time 5
     (lambda (x) (display "time: ") (display (meep-time)) (newline))
   )
 )
This results in
time: 5.0
time: 10.0
run 0 finished at t = 10.0 (200 timesteps)

Apparently the step function is called twice, first at the desired time T, and then once more at the end of the run. I guess this is related to the fact that, for the last time step, the run functions call the step functions twice: once with 'step and once more with 'finish. Apparently this confuses the (at-time T ...) "step function modifier": it lets the last time step slip by, and it doesn't work quite as expected. (Other time step modifiers do work as expected, for instance (at-beginning ..) only executes its step function once, at the beginning.)

Of course several straightforward workarounds come to mind right away;
but perhaps it would still be useful to modify the (at-time T ...) in the next release,
to make it conform to the manual pages?
Or is there something I am overlooking?

Best regards,
Mischa


_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to