On Thu, 2 Nov 2006, Loïc Le Guyader wrote:
(define-param dt 0.5) [...] (set! resolution 10) (run-until 60 (to-appended "ex" (at-every dt output-efield-x))) [...] But with dt=0.1 for example, I don't get 60*.1=600 data points: meep dt=0.1 test.ctl ; h5ls test-ex.h5
I think you are just seeing rounding error.With a resolution of 10, the time-step is 0.05. So, with dt = 0.1 it should output every two time steps. However, neither 0.1 nor 0.05 are exactly representable in binary floating-point arithmetic. So, sometimes it outputs every two time steps, and sometimes every three.
Right now, it's more susceptible to rounding than it has to be because Meep waits to output until the time is >= last-output-time + dt. It would be better to output as soon as the time is within half a time-step of the requested output time. A patch to do this is:
hunk ./libctl/meep.scm.in 442 - (if (or (eq? to-do 'finish) (>= T (+ Tlast dT))) + (if (or (eq? to-do 'finish) $ + (>= T (+ Tlast dT (* -0.5 (meep-fields-dt-get fields))))) With this patch, Meep should give you your expected 600 data points. Steven
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

