I think we look like weird doughnuts.
 Speak for yourself!  Besides, you're making me hungry.
 You're all just jealous 'cause I'm the highest frequency.

 red bullet What is this? ToyFDTD1 is a stripped-down, minimalist, 3-dimensional FDTD code that is published under the GNU General Public License. It is the first in the ToyFDTD series of codes, and it illustrates in heavily commented C and Fortran the basic tasks in implementing a simple 3D FDTD simulation.

 red bullet Why is it here? Because somebody gave me access to the web server. ;) ToyFDTD1 is for anybody who might want to see how someone else wrote a basic FDTD code, or who wants a simple FDTD code to use as a basis for making their own FDTD simulations.

 red bullet Who wrote it? ToyFDTD1 is brought to you by Laurie E. Miller, Paul R. Hayes, and Matthew T. O'Keefe.
          I - Laurie - am basically an undergrad (or I was when I wrote this) who was mistakenly given access to a workstation. Though I didn't know a whole lot about electromagnetics or programming, I thought I could write an FDTD engine. But I was quickly halted by the initial hurdles of where to start and what was strictly necessary to get even the simplest simulation running. That ToyFDTD exists today has a lot to do with the fact that I'm surrounded by brainiacs (like Paul and Matt). Paul and I initially wrote the heart of this code in a series of attempts by Paul to teach me basic concepts of FDTD and computational electromagnetics. Once launched, I was able to tackle more advanced problems like working on optical waveguide studies. So I wrote this overcommented code for anyone who'd like to play with FDTD but isn't surrounded by gurus.
           ToyFDTD is published in the sincere belief that if I can do this, anybody can. FDTD for Everyone!!!

 red bullet Why a GNU General Public License? We want people to be able to use and modify this source and the GNU GPL provides a ready-made process for that. We also want to make sure that wherever the code may wander, people can get copies of the original source if they want it.

 red bullet Simulations run with ToyFDTD1: The following animations show the problem simulated by ToyFDTD1, a rectangular waveguide sourced with a plane wave and terminated in a PEC (Perfect Electric Conductor) boundary. The code simulates an idealized rectangular waveguide by treating the interior of the mesh as free space/air and enforcing PEC conditions on the faces of the mesh. The problem is taken from Field and Wave Electromagnetics, 2nd ed., by David K. Cheng, pages 554-555. It is a WG-16 waveguide useful for X-band applications, with interior width = 2.29cm and interior height = 1.02cm. 
           The code for the following simulations differed only by the number assigned to the global constant FREQUENCY at the beginning of the ToyFDTD1 code. 
           What the colors mean: In each movie/image the entire simulation region is highlighted with a box. Red/Yellow indicates positive values, with yellow representing the greatest intensities and red representing values near zero. Blue/Green indicates negative, green the greatest intensities and blue values near zero. The most negative value is mapped to yellow, so a yellow spot in the middle of green represents the most negative point.

 Hey, race ya to the end of the guide!  Movies:
  blue dot 256x256 mpeg, 500 frames [1.2Mb]
  blue dot 512x512 mpeg, 500 frames [3.3Mb]
    red dot 256x256 gif [75Kb]
    red dot 512x512 gif [0.3Mb] 
WG-16 waveguide at 10 GHz. The frequency is chosen to be in the middle of the frequency range for TE10 operation for this waveguide.

 Whadya mean race?  This is free space you know.  Movies:
  blue dot 256x256 mpeg, 500 frames [1.3Mb]
  blue dot 512x512 mpeg, 500 frames [3.5Mb]
    red dot 256x256 gif [76Kb]
    red dot 512x512 gif [0.3Mb] 
WG-16 waveguide at 12.5 GHz, which is nearing the cutoff frequency for the next higher-order mode, TE20. The wavelengths looked squished in comparison to the previous simulation; they are still the width of the guide, but the wavelength is shorter.

 How boring. Can't we switch to the Cartoon Laws of Physics?  Movies:
  blue dot 256x256 mpeg, 500 frames [1.4Mb]
  blue dot 512x512 mpeg, 500 frames [4.0Mb]
    red dot 256x256 gif [76Kb]
    red dot 512x512 gif [0.3Mb
WG-16 waveguide at 15 GHz, which is well beyond the cutoff frequency for TE20, yet the wave continues to propagate as TE10 due to the way the source is applied. Energy from the source could propagate as TE20 at this frequency, but there's nothing to make it want to.

 red bullet So where's the source already?

View ToyFDTD1-1.03 C code
View ToyFDTD1-1.03 F90 code
Download ToyFDTD source:
compressed: ToyFDTD1-v1.03.tar.gz
uncompressed: ToyFDTD1-v1.03.tar

Version 1.03 was published 2 December 1999. You'll want to check out the README file that comes with the code for some helpful instructions. For info on un-compressing or un-tarring the tar files, see the ToyFAQ.

 red bullet Release History:

12 April, 1999 ToyFDTD1-v1.0.tar.gz ToyFDTD1-v1.0.tar
12 August, 1999 ToyFDTD1-v1.02.tar.gz ToyFDTD1-v1.02.tar
2 December, 1999 ToyFDTD1-v1.03.tar.gz ToyFDTD1-v1.03.tar

 red bullet Are there differences between the C and F90 versions? The translation group (the F90 translation was done by Max Smirnoff, Matt Rundquist, and Paul Hayes, with some commenting added by me) went to a great deal of trouble to make the two versions as numerically identical as possible, with plenty of testing to be sure that the floating point values computed by the FDTD kernel are the same to more than 5 decimal places over tens of thousands of iterations. Some things like output formatting are handled differently from language to language, so there are some small differences in the code.
          Max analyzed some differences between how C and F90 handle floating point assignments; here's his writeup. Have fun with the code, but keep in mind that none of us are Fortran hackers and none of us get enough sleep. ;)

 red bullet References:

 blue bullet  Main references in writing the ToyFDTD1 source code:

          1. Allen Taflove, Computational Electrodynamics: The Finite-Difference Time-Domain Method, Artech House, Inc. 1995
          2. Karl Kunz and Raymond Luebbers, The Finite Difference Time Domain Method for Electromagnetics, CRC Press, 1993
          3. David K. Cheng, Field and Wave Electromagnetics, second edition, Addison Wesley Longman, Inc., 1990
          4. Paul Hayes. OK, so you can't just buy or download a copy of Paul, but that's why the ToyFDTD pages are here; for all the people who haven't got a Paul-equivalent sitting handy.

 blue bullet  Specific parts of references used in writing the ToyFDTD1 source code:

          #1. above: I mainly used chapter 3. The field update equations were taken directly from pp. 65-66, and mapped onto the memory allocation already written. But only after many hours of staring at Figure 3.1 (of a Yee cell) on p. 60.
          #2. above: The equation determining the timestep in ToyFDTD1 was taken from equation 3.2 on p. 32. I also stared at figure 3.3 (of a Yee cell) on p. 37 a lot.
          #3. above: The problem simulated by ToyFDTD1 is taken from pp 554-555. This was also my textbook for the required electromagnetics courses in my major.
 red bullet Hardware: The ToyFDTD1 simulations above were run on a Silicon Graphics Origin 200. They would also run very nicely on the SGI Indy sitting on my desk, but hey, I'm impatient. The animations from the simulation data sets were run on my Silicon Graphics Indy.

 red bullet Contacting the perpetrators:

L. E. Miller
P. R. Hayes
M. O'Keefe
Department of Electrical and
Computer Engineering
University of Minnesota

200 Union St. SE
Minneapolis, MN 55455

 red bullet About the spiffy logo:

 Don't hate me because I'm beautiful

The image that forms the background of the logo is from the simulation run by ToyFDTD1 viewed using AnimaBob. Thank you to J-D Harrington for designing the cool logo and for setting up all the movies on this page in mpeg format.

ToyFDTD Home

 Just call me stretch...