On Aug 12, 2009, at 7:56 AM, Ian Buss wrote:
I would like to be able to define a function in my ctl file to
declare a plane across which the DFT is accumulated (and stored in
an hdf5 file) at every point at a single frequency. So for a 10x10
plane with resolution 10, there would be 100x100xN complex data
points in my hdf5 file, where N is the number of time steps (also to
be specified via (at-every) or something).
Examining the C++ interface, I see that field::add_dft is the sort
of thing I need.
The only problem is that when you save the dft to an HDF5 file, it is
a somewhat messy format. It is an array of floating-point numbers,
but the ordering is just a dump of Meep's internal format (where the
original computational box is divided into a number of chunks
etcetera), intended only for saving and restoring and not really well-
suited for consumption by another program.
However, I am unsure of how to expose this using the SWIG
interface. I know I need to do something like (new-meep-dft-
chunk...) and then define this somehow with (meep-fields-add-dft c
plane freq freq 1 false), where c is the component and plane is a 2D
(volume) type. Am I along the right lines here? How can I mix this
with a (to-appended ) command to get the hdf5 file? Could someone
help with the nuts and bolts? Shall I abandon ship and use the C++
interface?
In Scheme, you would do something like:
(init-fields)
(define mydft (meep-fields-add-dft Ez (volume (size ...) (center ...))
freqmin freqmax Nfreq false))
Then after the run you could do
(meep-save-dft-hdf5 mydft Ez "filename")
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss