Hi,
maybe it is usefull for someone:
(define (display-fluxes-at-step . fluxes)
(lambda ()
(if (not (null? fluxes))
(apply display-csv
(append (list (string-append "flux" (number->string (meep-time)))
(get-flux-freqs (car fluxes)))
(map get-fluxes fluxes))))
))
and call like
(run-until 300 (at-every 10 (display-fluxes-at-step f)))
it is just a hack of the old display-flux function
regards
Andreas
Am Donnerstag, 6. April 2006 08:24 schrieb Andreas von Rhein:
> Am Donnerstag, 6. April 2006 08:11 schrieb Steven G. Johnson:
> > On Thu, 6 Apr 2006, Andreas von Rhein wrote:
> > > so I supposed one has to call like this
> > >
> > > (run-until 300 (at-every 10 (display-fluxes flux1)))
> > >
> > > but dispaly-fluxes seems not to be normal step-function.
> > >
> > > During the first call the flux is displayed (ok it is 0 everywhere),
> > > but in the next call the output is undefinied. I suppose display-fluxes
> > > destroys the calculation data.
> >
> > Hi Andreas,
> >
> > This is a common confusion with MPB, and I'm guessing it will be a common
> > confusion with Meep too.
> >
> > The step functions that you pass to run must be *functions*. When you
> > pass (display-fluxes flux1) you are passing the *result* of calling
> > display-fluxes, which is not a function. Hence it displays once, before
> > run even begins, and then gives an error because you are not passing the
> > correct argument type.
> >
> > Instead, you should define a function, either via:
> >
> > (define (display-fluxes-at-step) (display-fluxes flux1))
> > (run-until 300 (at-every 10 display-fluxes-at-step))
> >
> > or just use lambda to construct a function on the fly:
> >
> > (run-until 300 (at-every 10 (lambda () (display-fluxes flux1))))
> >
> > Steven
>
> Ok, I've forgotten.
> But display-fluxes isn't very grep-friendly. What about changing the string
> of the first row with time information?,
>
> flux0010, ...
>
>
> flux0020,...
>
> But I think I could handle it on my own and write a new function with the
> help of (get-flux-freqs flux)
>
> regards
> Andreas
>
> _______________________________________________
> 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