 |
Return to ToyFDTD Home
What is this? ToyFDTD5
adds 3 features to ToyFDTD1:
- option for
choosing which field component to output
- choice of 2
output formats: bob volumetric files or 2D raw
files, with a demonstration of a 2D animation method created
by John Schneider, Patrick
Flynn, and Kurt Shlager
- modularization of the code into
separate files using C/F90 functions for implementing the
various tasks - this can be a real sanity
saver
Language: F90
Author: Laurie E. Miller
Why it's cool:
Speedier, platform-independent
rendering with the 2D rendering method! The 2D rendering method does
not require a great deal of memory or special rendering tools, just a
compiler. I don't know about you, but I spend a lot of my time looking
at 2D slices of my volumetric data anyway since important features are
often viewed most easily that way.
2D raw files take up significantly
less space than full-volume bob files, which can be an enormous
advantage over a long simulation.
Writing modular and well-organized
code will save you hours of trouble looking for hard-to-find bugs once
your code starts to get large or complex, such as when you start adding
parallelism. And when you write a new function to perform a specific
task, such as a better routine for updating of field arrays, you can
just replace the function and the main code structure needs no changes.
Simulations run with
ToyFDTD5:
Simulation with bob file output:
The code simulates the same problem as ToyFDTD1.
The results are identical; comparison of the floating-point results
showed no differences. The first animation below was made from running
the ToyFDTD5 code for comparison with ToyFDTD1 results. See the ToyFaq for what the colors mean:
Simulations with raw file
output:
First of all, I'll describe raw files and how to use them. You can
read an indepth discussion of the methods on the webpage
that John
Schneider has set up. That page also has the source
code for the converter. Briefly, the procedure is as follows: after you
obtain a data set, where each file is of the form ez.xxxxxx, for
example, you need to convert it using the rw2pnm utility, which can be
found on the aforementioned webpage. After you finish the conversion,
you'll have a bunch of files with a .ppm or .pnm extension. These are
the single frames of the simulation, and can be viewed using utitlities
such as GIMP, or
converted to any number of other formats using your favorite graphics
converting program.
Now on to the simulation. The simulation is the same
as ToyFDTD1 except that
now you have a bunch of 2D graphic files. To the left, you can see a
strip of 30 frames joined together into a single image. The data was
output along the z=4 slice. To the left of every frame, you can see a
color bar. Colors higher up the bar (such as pink or
white) are more positive, and colors lower on the bar (such as yellow
or green) are more negative. You can see the simulation evolving with
each frame, and the output apears similar to what you get if you sliced
one of the 3D bob images along a constant z plane and looked down on it. |