DRAWGRID (and NUMBER and FillGrid) an interactive finite element grid creator and editor for the PC, released August 1993 updated 8 March 1999 (version 1.E) by Peter Bird Department of Earth and Space Sciences University of California Los Angeles, CA 90095-1567 (310) 825-1126 pbird@ess.ucla.edu Boilerplate ----------- (C) Copyright 1991, 1992, 1993, 1995, 1997, 1999 by Peter Bird and the Regents of the University of California. Colleagues are free to use, modify, and distribute this software at no charge, but subject to the following conditions: 1. The programs and/or source code shall not be modified in a way which hides their author or origin. 2. These notices shall be distributed together with any copies of the source code or executable programs. While you may recover your actual costs of blank media and handling, no other fee or price shall be charged for copies you distribute. 3. By using this package, you assume an ethical obligation to help the author improve it, by reporting any bugs or defects together with a complete accounting of relevant circumstances. Purpose ------- DrawGrid is the finite element grid creator/editor for the flat-Earth finite element programs FAULTS and PLATES. (For round-Earth finite element grids, use OrbWin.) To facilitate the creation and/or editing of planar finite-element grids of 6-node isoparametric triangles and 6-node isoparametric faults. To test the topology of the grids for common defects and isolate them spatially and display them for correction. Limitations: ------------ DRAWGRID does not solve the momentum equation; see programs FAULTS, PLATES, or SHELLS by the same author. (Actually, if you decide to use SHELLS, then you will use the alternate grid editor OrbWeaver, for 3-node spherical triangles.) DRAWGRID does not renumber the nodes to minimize the bandwidth of the stiffness matrix; see program NUMBER in the SOURCE subdirectory of this directory. Although DRAWGRID 1.E now supports viewing and editing of the data attached to each node (elevation, heat flow, crustal thickness...), it is not efficient or accurate to enter all the values this way. For most problems, you will want to use the utility program FillGrid, also provided. Directory PATH listing for Volume DRAWGRID ------------------------------------------- \ (the "root" directory) | Read_me.7 (this file; different from READ-ME.1, ...) | DRAWGRID.EXE (executable, for DOS/Windows3.1/95/98/NT/2000) | Number.exe (executable, for Windows95/98/NT/2000) | FillGrid.exe (executable, for Windows95/98/NT/2000) | +---SOURCE (a directory of source code) | DRAWGRID.MAK (Basic source code for DRAWGRID, part 1) | DRAWGRID.BAS (Basic source code for DRAWGRID, part 2) | DRAW2.BAS (Basic source code for DRAWGRID, part 3) | DRAW3.BAS (Basic source code for DRAWGRID, part 4) | MYMOUSE.BAS (Basic source code for DRAWGRID, part 5) | MYMOUSE.BI (Basic source code for DRAWGRID, part 6) | GENERAL.BI (Basic source code for DRAWGRID, part 7) | CHRTBEFR.QLB (Basic Quick Library needed for DRAWGRID) | NUMBER.FOR (Fortran 77 source code for NUMBER) | FillGrid.f (Fortran 90 source code for FillGrid) | \---WORK (a directory of sample input and output files) CALXY.DIG (basemap file of California, from DIGITISE) NET1991.FEG (finite element grid of California, for FAULTS) BSCOASTX.DIG (basemap file of Alaska, from DIGITISE) AK795.FEG (finite element grid of Alaska, for PLATES) Suggestions: ------------ To use DRAWGRID, you need a PC (8088, 8086, 80286, 80386, 80486, Pentium) equipped with a Microsoft-compatible pointing device (mouse, trackball, digitiser-emulating-mouse), and a graphics video card (CGA, EGA, VGA). It is desirable to have a math coprocessor in 8088, 8086, 80286, and 80386 PC's (80486 and Pentium chips have one built-in). To use the file DRAWGRID.EXE, you must be able to run the DOS operating system, or an operating system that emulates DOS (Windows 3.1, '95, '98, NT, 2000). (Warning: Japanese colleagues have reported that DRAWGRID.EXE does not operate properly under Japanese DOS; you need English DOS.) You can also recompile DRAWGRID for any other operating system for which there is a Microsoft QuickBasic compiler, using the source files given. DRAWGRID is self-guiding and internally documented. Once inside DRAWGRID, your first step is usually to load a basemap, which is displayed but not edited. Basemap files are created with programs DIGITISE and PROJECTOR, which are available in the DIGITISE directory of this archive. They have file extension .DIG. If you like, you can make your own .DIG files from another source; just reformat the (x,y) pairs to look like: sample beginning of a .DIG file: -------------------------------- (this line not part of file) San Miguel Island coast (<-any labels begin in column 1) +2.43635E+05,+5.33274E+04 (<-x,y pairs in Fortran +2.44155E+05,+5.44624E+04 FORMAT(1X,SP,1P,E12.5,',',E12.5) +2.45435E+05,+5.47729E+04 +2.45578E+05,+5.59054E+04 . . (ellipsis; points omitted) . +2.43464E+05,+5.63436E+04 +2.43700E+05,+5.49120E+04 +2.43179E+05,+5.39278E+04 +2.43711E+05,+5.31770E+04 *** end of line segment *** (<-required end-of-line marker) Santa Rosa Island coast +2.58029E+05,+6.54947E+04 +2.59612E+05,+6.56564E+04 +2.61044E+05,+6.57415E+04 . . (ellipsis; points omitted) . +2.61316E+05,+7.00432E+04 +2.59518E+05,+6.82960E+04 +2.58624E+05,+6.67058E+04 +2.58634E+05,+6.52725E+04 *** end of line segment *** --------------------------------- (this line not part of file) Note that the text labels for each polyline are optional; you can have 0, 1, 2,... lines of labels for each polyline, as long as you have the *SAME* number of labels for each polyline. The end-of-segment markers are NOT optional; they must be there. Note: If you load a Basemap file, the size of the window will be adjusted to fit it. If you do not, then it will remain at 1 m (very small!) until you reset it. Use the Zoom command to change its width to 10,000 or 100,000 or 500,000 m (whatever you like). A common second step is to cover the area you intend to model with a regular grid of elements, using the Hexagons or sQuares commands. Next, Adjust node positions by dragging, or use Elements to add/eliminate triangular elements, or use Nodes to add/eliminate nodes. The goal is to have element boundaries running along every future fault. As one of your later steps, use the Faults command to cut faults along element boundaries where you need them. Set the fault dips with Inclination. Check for continuity of strike-slip faults with Join. (It is inconvenient to cut the faults too early, because for topological reasons you will not be permitted to create new triangular elements which involve nodes along any fault. This is not a fatal error, but you will have to heal the faults, edit the elements, and then recut the faults.) Before ending an editing session, do a Perimeter test. If it fails, Gaps/overlaps will help you find the problem. *** SAVE YOUR WORK FREQUENTLY; THERE IS NO "UNDO" !!! *** The output files (*.FEG) are in plain-ASCII, and may be edited in any word processor if necessary. Note that you must use a word-processor to adjust the title line (1st record); until you do, it reads "TITLE?". Also, the four physical variables for each node (elevation, heat flow, crust and mantle lithosphere thicknesses) will initially be zero. The last parameter of each fault element (the net offset) will also be zero. Use other programs to adjust these values, or do it by hand. Another thing you may notice in the output .FEG files is that many node locations are (0.0,0.0). "This is not a bug, it's a feature." The (0,0) position is a code (shared by DRAWGRID, FAULTS, PLATES, Faults2AI, Plates2AI, PLOTFLTS, PLOTPLTS, SCOREFLT, and SCOREPLT) to show that the node is exactly half-way between two neighbors along a straight element side. This code greatly speeds up the drawing of elements in DRAWGRID, and simplifies some calculations in the other programs. After you are finished working with DRAWGRID, run program NUMBER to renumber the nodes for minimum bandwidth. You can use NUMBER.exe provided for Windows95/98/NT, or compile(*) the Fortran 77 source code Number.for for other systems. Do not expect this job to run quickly; for 1500 nodes it may take 1 minute on a supercomputer, or an hour on an ordinary slow PC. DO IT ANYWAY! This will result in orders-of-magnitude reductions in the storage and CPU-time requirements of the finite-element programs FAULTS and/or SHELLS, and the graphics programs PLOTFLTS/PLOTPLTS. *When compiling NUMBER, it is necessary to select a number of array sizes, which may be confusing. However, you can always set all the adjustable array sizes to 1 (just change the first PARAMETER statement). When you try to run NUMBER on a particular grid, it will tell you what array sizes are required; then you can recompile it. The next step is usually to run program FillGrid.exe to supply nodal data. If you look into the .feg file created by DrawGrid (and re- numbered by NUMBER), you will see that a typical node is described by a line like: 3 -1.500E+05 -8.660E+04 +0.00E+00 +0.00E+00 +0.00E+00 +0.00E+00 where the first number is the node number, and the next two are (x,y). Or, if the node is on the mid-point of a straight element side, the (x,y) coordinates may be (0.0,0.0) [a special code], as in: 4 0.0 0.0 +0.00E+00 +0.00E+00 +0.00E+00 +0.00E+00 In either case, the last 3 numbers on the line (for FAULTS .feg grids) or last 4 numbers on the line (for PLATES .feg grids) are all zeros. These need to be replaced with: * elevation above(+) or below(-) sea level, in meters; * heat-flow, in Watts/square-meter (not milli-Watts!); * thickness of the crust, in meters (omitting oceans); * thickness of the mantle lithosphere layer, in meters (= total lithosphere thickness minus crustal thickness). For example, if node 3 is in Tibet, the line might be changed to: 3 -1.500E+05 -8.660E+04 +5.12E+03 +7.05E-03 +7.52E+04 +1.23E+04 to represent a total lithosphere thickness of 87.5 km, of which 75.2 km is crust, which floats isostatically at 5.12 km elevation, with heat-flow of 0.0705 W/m/m (or 70.5 mW/m/m, which is not SI). The tricky thing is that these 4 numbers are not independent, but are subject to two constraints: -> The temperature at the base of the mantle lithosphere should be constant everywhere; the base of the lithosphere is an isothermal surface [unless part of the model rests on a subducting slab (cold) or on a mantle plume (hot)]. -> The density structure at each node should be isostatically balanced with a normal mid-ocean spreading rise at elevation -2700 m (unless the model is locally pulled down or up by a subducting slab or a mantle plume). In general, this means that only two of the values can be chosen independently, and the other two must be computed. Except in special degenerate cases (zero thermal expansion coefficients, equal thermal conductivity in the crust and mantle layers, and zero radioactive heat production), the calculation will be nonlinear and will require iteration. My choice is to specify the maps of elevation and of heat-flow, and compute the layer thicknesses from them. This has always turned out well AS LONG AS the heat-flow is not too small at any node: 0.040 mW/m^2 is a suggested minimum. The best way to supply these data for each node is to run my utility program FillGrid. (FillGrid.exe is an executable for Win32/Win95/Win98/WinNT; or recompile FillGrid.f with a Fortran 90 compiler for other systems, such as Unix.) This program takes its data from gridded-data (.grd) files of elevation and heat-flow. You must prepare these .grd files, which have values evenly-spaced on grids of longitude/latitude (e.g., like the ETOPO5 dataset of 5'-gridded topography of Earth). FillGrid will print a few lines of comments on the format it needs. FillGrid then uses these data to compute thicknesses of the crust and mantle lithosphere for each node. If there are no errors (see the log file for details) then the resulting modified .feg file should give a model which is everywhere isostatic with a mid-ocean rise, and which has an isothermal surface at the base of the lithosphere. FillGrid will require you to supply a parameter file (as well as an .feg file and some .grd files) if you run it in PLATES mode, where it is asked to make isostatic calculations. Take a sample parameter input file like inAK9801.in from the \Plates\Work directory and use it as a model, editing any values that you want to change (and keeping all entries in SI units!). When you first begin to experiment with PLATES, you may want to run some simple cases for uniform plates. Here is an easy way to create such a uniform model. Let us assume that your model will fit entirely within the region 32~44N, 126~110W (or, as we enter it: -126~-110E). You could create a dummy topographic .grd file like this: -126 16 -110 (lon_min, d_lon, lon_max) 32 12 44 (lat_min, d_lat, lat_max) 100 100 (4 identical entries of 100 m elevation) 100 100 And you could create a dummy heat-flow .grd file like this: -126 16 -110 (lon_min, d_lon, lon_max) 32 12 44 (lat_min, d_lat, lat_max) 0.06 0.06 (4 identical entries of 0.060 W/m/m, 0.06 0.06 equal to 60 mW/m/m) and you could supply these two files to FillGrid when prompted. FillGrid will then compute the (uniform) crustal and mantle- lithosphere thicknesses appropriate for 100 m elevation and 0.060 W/m/m heat flow, and apply them to every node. If you do NOT want your model to be isostatic and isothermal across its basal surface (e.g., if part of it is a thin forearc wedge which rests on a subducting slab which is part of another plate), then you can manually modify these nodal values of crustal thickness and mantle-lithosphere thickness, and not worry that this causes departures from isostasy and isothermy at the base of the model! Command "View/edit nodal data" in DRAWGRID makes it possible to change any nodal value by clicking on it and typing a new value; the program will immediately re-contour the field as you make changes. When you think the .feg file is really finished, it is time to make hard-copy plots of the grid, the nodal data fields, and other fields computed from them (e.g., temperature of the Moho, temperature at the base of the model, or pressure anomaly at the base of the model). See my graphics programs Plates2AI or Faults2AI in the Plates and Faults directories, respectively. GOOD LUCK! Peter Bird ---------------------------- end of file ------------------------