On Mon, 18 Sep 2006, David Leuenberger wrote:
I am very interested in the topic below. I was wondering if you could
give a hint on the syntax of (meep::fields::add_dft_pt) when called from
the Scheme interface. Let's assume I would like to obtain the frequency
spectrum of the Ex field component at the point (0,0,0).
Hmm, looking back at this, I didn't make the add_dft_pt stuff very easy to
use on its own, even from C++, and it is quite difficult to call properly
from Scheme.
So, for now it is probably a lot easier just to output the field at the
point using get-field-point, and then FFT it afterwards in Matlab. (For a
single point this is reasonably efficient...it only becomes problematic
for flux spectra because you need the Fourier transform at lots of
points.)
The dft stuff is mainly designed in order to compute flux spectra and
similar things, and so it keeps track of the spectrum at many points in
space simultaneously. You have to decide for yourself how you want to
combine the spectra at different spatial points---there are many possible
ways to do this---and this requires some programming.
It might be useful to add more built-in ways to output spectra besides
flux spectra. The question is, which ones? I can think of a couple of
possiblities, given the DFT F(x,w) of some field component F as a function
of position x and frequency w:
* The integral of F(x, w) over x.
* The integral of |F(x, w)|^2 over x
-- or more generally, given F(x,w) and G(x,w), the integral
of the dot product F(x,w)^* G(x,w). This could be used
for energy density spectra, etcetera.
* It might also be useful to output F(x,w) itself as an HDF5 file,
but this would be trickier to code.
Which would you want?
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss