📄 readme
字号:
README file for ToyBoxFDTDbezhig 1.0 Copyright (C) 1998, 1999 Laurie E. Miller, Paul Hayes, Matthew O'KeefeWith this README file you should also have receivedgpl.txt A copy of the GNU General Public LicenseToyBoxFDTDbezhig.c A listing of the ToyBoxFDTDbezhig source codeMakefile The makefile for compiling ToyBoxFDTDbezhigchengGbry2.cmap A useful colormap for viewing the results of ToyBoxFDTDbezhig in animabob or viz./////////////////////////////////////////////////////////////////////////////Regarding ToyBoxFDTDbezhig, version 1.0: Copyright (C) 1998, 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 thebeginning of the code as a preventative measure. However, this is a very tinymesh 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've1. downloaded the tar file: ToyBoxFDTDbezhig-1.0.tar.gz or ToyBoxFDTDbezhig-1.0.tar2. 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.html3. untarred the tar file with a command like: tar xvf ToyBoxFDTDbezhig-1.0.tar4. changed to the new directory just created: cd ToyBoxFDTDbezhigUnless of course you're reading this on the web page, in which case you shouldgo and do steps 1-4, and then5. compile the file -- type the command: make6. 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.htmlyou 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 *.bobat the beginning and at the end of the notes. This activates bob with thecolormap included in the tar file and feeds it the appropriate dimensionsof 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 runlogfile. Once bob has fired up and loaded, make sure the x, y, and z dimensionsare 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.htmlyou will see a link to Viz. It's also free. Download yourself a copy and getit running. Next check those progress notes from your run; you'll see a command like: viz ToyBoxFDTDbezhig.vizat the beginning and at the end of the notes. This activates viz with thecolormap included in the tar file and feeds it the appropriate dimensionsof 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 sittingin your directory. bezhigCenter.dat has recorded two numbers per timestep, the current simulated time and the electric field intensity in the z directionfor 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. Youcan view them using commands like: more bezhigCenter.dat more bezhigStimulus.datbut that's really boring 'cause you just get a long double column of numbersdown your screen. Any 2D graphing or plotting tool should be able to open itand 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.htmlyou 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.dator, if you're using xmgr, xmgr bezhigCenter.dat bezhigStimulus.datand 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->statuscontrols are handy for adding and deleting data series on one plot; if youhit 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 ofthe 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 PlotWizard just plots the intensity values and ignores the time data.In my highly subjective opinion, grace/xmgr is easier to use, but I've foundexcel handy for making plots that insert neatly into a powerpoint set ofslides. /////////////////////////////////////////////////////////////////////////////Playing with your ToyBoxFDTDbezhig:You can vary the simulation quite a bit and see different things just bychanging the #define statements at the beginning. With these you can chooseeither the pulse stimulus or a continuous plane wave as input, and you canchoose 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 ofdata choking your system low, but it also makes for a jerky animation. Youmay want to set it to a smaller number to smooth things out a bit so theresults look nice when you view the data files with your volume visualizationtool of choice. With regards to autoscaling/no autoscaling, read the comments in the codethoroughly 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.htmlwhen 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 whateverIf you type: make cleanin 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 -gis 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/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -