ToyBoxFDTDbezhig

所属分类:其他
开发工具:C/C++
文件大小:24KB
下载次数:15
上传日期:2005-08-19 07:54:39
上 传 者vivaldi
说明:  This simple simulation of a pulse traveling down a parallel-plate guide makes a handy test code for initial experiments with boundary conditions. ToyFDTD3 adds some simple features to ToyFDTD1: A PMC boundary condition, a sinusoidal pulse source, and output tracking a single point in the mesh. Released 15 June 1999.

文件列表:
ToyBoxFDTDbezhig (0, 2005-08-19)
ToyBoxFDTDbezhig\chengGbry2.cmap (4736, 1999-05-25)
ToyBoxFDTDbezhig\gpl.txt (18007, 1999-04-27)
ToyBoxFDTDbezhig\Makefile (1048, 1999-06-03)
ToyBoxFDTDbezhig\ToyBoxFDTDbezhig.c (45751, 1999-06-15)

README file for ToyBoxFDTDbezhig 1.0 Copyright (C) 19***, 1999 Laurie E. Miller, Paul Hayes, Matthew O'Keefe With this README file you should also have received gpl.txt A copy of the GNU General Public License ToyBoxFDTDbezhig.c A listing of the ToyBoxFDTDbezhig source code Makefile The makefile for compiling ToyBoxFDTDbezhig chengGbry2.cmap A useful colormap for viewing the results of ToyBoxFDTDbezhig in animabob or viz. ///////////////////////////////////////////////////////////////////////////// Regarding ToyBoxFDTDbezhig, version 1.0: Copyright (C) 19***, 1999 Laurie E. Miller, Paul Hayes, Matthew O'Keefe This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version, with the following conditions attached in addition to any and all conditions of the GNU General Public License: When reporting or displaying any results or animations created using this code or modification of this code, make the appropriate citation referencing ToyBoxFDTDbezhig by name and including the version number. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, or if you cannot read your copy, write to the Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ///////////////////////////////////////////////////////////////////////////// ToyBoxFDTDbezhig 1.0 as delivered uses 1.2 Mbytes of main memory to run and generates 200 files of 25 kbytes each for about 5 Mbytes total output. If this will choke your machine, you should alter the global constants at the beginning of the code as a preventative measure. However, this is a very tiny mesh for 3D FDTD, so if it's going to choke your machine, you'll be needing to find another if you're going to FDTD much. ///////////////////////////////////////////////////////////////////////////// What to do with the source now that you've got it: (The suggested commands in these notes are Unix commands. If you're using a different operating system, you'll want to use your system's equivalent commands.) If you're reading this, I assume you've 1. downloaded the tar file: ToyBoxFDTDbezhig-1.0.tar.gz or ToyBoxFDTDbezhig-1.0.tar 2. if you chose ToyBoxFDTDbezhig-1.0.tar.gz, un-gzipped it with a command like: gunzip ToyBoxFDTDbezhig-1.0.tar.gz for more info on gzip compression/uncompression see the web page at http://cemtach.org/software/software.html 3. untarred the tar file with a command like: tar xvf ToyBoxFDTDbezhig-1.0.tar 4. changed to the new directory just created: cd ToyBoxFDTDbezhig Unless of course you're reading this on the web page, in which case you should go and do steps 1-4, and then 5. compile the file -- type the command: make 6. run that baby: you can either a. just type the name of the executable: ToyBoxFDTDbezhig in which case the progress notes during the course of the simulation will appear on the screen, or b. use a command like: ToyBoxFDTDbezhig >&! runlog & in which case all the progress notes will be written to a file named runlog which you can view a screenful at a time using the command: more runlog ///////////////////////////////////////////////////////////////////////////// OK, now you've got a whole bunch of files named somethingorother.bob in your directory. Each of these files is a string of data bytes. You probably want to look at them somehow. If you have a volume visualization tool you know and like, you should use that one, though you may need to alter the output portion of the ToyBoxFDTDbezhig source code to suit your tool. Here's another way: On the CEM TACH software page, http://cemtach.org/software/software.html you will see a link to BoB/AnimaBoB. It's free. Download yourself a copy if you haven't already got one and get it running. Next check those progress notes from your run; you'll see a command like: bob -cmap chengGbry2.cmap -s 133x21x9 *.bob at the beginning and at the end of the notes. This activates bob with the colormap included in the tar file and feeds it the appropriate dimensions of the simulation mesh. If you change the dimensions of the waveguide, the progress notes will show the new correct bob command for the different- sized mesh. This is one good reason to keep your progress notes in a runlog file. Once bob has fired up and loaded, make sure the x, y, and z dimensions are set to maximum, and then just hit "start" to see the files play. Or, here's another way: On the CEM TACH software page, http://cemtach.org/software/software.html you will see a link to Viz. It's also free. Download yourself a copy and get it running. Next check those progress notes from your run; you'll see a command like: viz ToyBoxFDTDbezhig.viz at the beginning and at the end of the notes. This activates viz with the colormap included in the tar file and feeds it the appropriate dimensions of the simulation mesh. If you change the dimensions of the waveguide, the ToyBoxFDTDbezhig.viz file will update accordingly when you run the new simulation. ----- You also now have files named bezhigCenter.dat and bezhigStimulus.dat sitting in your directory. bezhigCenter.dat has recorded two numbers per timestep, the current simulated time and the electric field intensity in the z direction for a point near the center of the mesh. bezhigStimulus.dat has recorded the current simulated time and the value of the stimulus for each timestep. You can view them using commands like: more bezhigCenter.dat more bezhigStimulus.dat but that's really boring 'cause you just get a long double column of numbers down your screen. Any 2D graphing or plotting tool should be able to open it and plot it for you. The two I've used are grace/xmgr and excel. Grace and xmgr are free, excel is extremely un-free. Grace is a newer version of xmgr available free under the GNU GPL. To view them in grace/xmgr: On the CEM TACH software page, http://cemtach.org/software/software.html you will see a link to grace. Once again, it's free. Download yourself a copy and get it running. To start it up, type xmgrace bezhigCenter.dat bezhigStimulus.dat or, if you're using xmgr, xmgr bezhigCenter.dat bezhigStimulus.dat and grace/xmgr will plot and display both data sets on the same plot. Here are some useful features in xmgr (they work exactly the same in grace). To zoom in, I use the graph->world scaling controls. There are also buttons along side the main window for x-axis and y-axis zooming. The data->status controls are handy for adding and deleting data series on one plot; if you hit the deact button and click on a series, it disappears from the display, but can be reinstated by hitting react and clicking on the area for that series in the data window. To view them in excel, assuming you have excel on some handy machine, fire up excel and use the File->Open command and type in the file name of one of the files. Depending on the version you have, excel will probably ask you various questions about the file; you want to tell it that the file is space-delimited. Excel should then load the file as two columns of data. The Plot Wizard function should then walk you through plotting the data. One peculiarity of Excel is that it will plot the field intensities and times as two separate functions, instead of field intensity as a function of time. There's a way to make it plot one as a function of the other, but how to do it varies from version to version. So before invoking the Plot Wizard, I highlight just the second column of data, and then the Plot Wizard just plots the intensity values and ignores the time data. In my highly subjective opinion, grace/xmgr is easier to use, but I've found excel handy for making plots that insert neatly into a powerpoint set of slides. ///////////////////////////////////////////////////////////////////////////// Playing with your ToyBoxFDTDbezhig: You can vary the simulation quite a bit and see different things just by changing the #define statements at the beginning. With these you can choose either the pulse stimulus or a continuous plane wave as input, and you can choose whether you want the sides of the guide to be PMC (parallel-plate waveguide), or PEC (rectangular waveguide). You can also alter the length, simulated width, and height of the waveguide, the frequency of the stimulus, the number of timesteps it runs, and how often it writes data to an output file. I set this last control, (PLOT_MODULO) to a fairly high number, which means it doesn't output very often. This is to keep the amount of data choking your system low, but it also makes for a jerky animation. You may want to set it to a smaller number to smooth things out a bit so the results look nice when you view the data files with your volume visualization tool of choice. With regards to autoscaling/no autoscaling, read the comments in the code thoroughly before playing with those options. Otherwise you may not like what you get. You can of course alter the code in other ways to make different simulations. That's what it's there for. Further suggestions on playing with it will start to appear on the ToyBoxFDTD page at http://cemtach.org/software/ToyBoxFDTD/ToyBoxFDTD.html when I get past final exams... and when my hand fatigue gets better. ///////////////////////////////////////////////////////////////////////////// About the Makefile and make commands: If you type: make cleandata in your ToyBoxFDTDbezhig directory, it will remove all the data files (all files ending in .bob, the .viz file, the bezhigCenter.dat and bezhigStimulus.dat files, and the runlog file, if you made one). If you want to keep your runlog file to keep track of simulations you've done or keep any other file, rename it something else first: mv runlog whatever If you type: make clean in your ToyBoxFDTDbezhig directory, it will remove all the object and executable files, file copies ending in ~, and core files from any core dumps you've managed to generate. If you view the Makefile, you'll see a bunch of lines starting with CFLAGS. All of them are commented out (by a # at the beginning of the line) except the last. Only one of these should ever be uncommented at once. The last, CFLAGS = -Xcpluscomm -g is what you want to use if you're going to run a debugger on the executable. The others (different level of compiler optimization) are there for your convenience. If you don't know what they are, you should talk to a friendly neighborhood compiler guru before you try messing with them. ///////////////////////////////////////////////////////////////////////////// Contacting the perpetrators: Laurie E. Miller, Paul Hayes, Matthew O'Keefe Department of Electrical and Computer Engineering 200 Union Street S. E. Minneapolis, MN 55455 lemiller@lcse.umn.edu info@cemtach.org http://cemtach.org http://cemtach.org/software/ToyBoxFDTD/ToyBoxFDTD.html /////////////////////////////////////////////////////////////////////////////

近期下载者

相关文件


收藏者