high-performance visualization applied to computational

57
AD-A260 820 DTIC Technical Report 1564 S FEB 1093D October 1992 C High-Performance Visualization Applied to Computational Electromagnetics Method-of-Moments on a Silicon Graphics Workstation L. C. Russell J. W. Rockway 93-02417 AI! ApIprovedJfor IIi r a li I JJil iJIF. f.J~ D Approved for pubilo release; diltribution Is urnlmlted. V,

Upload: others

Post on 09-Nov-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: High-Performance Visualization Applied to Computational

AD-A260 820 DTIC

Technical Report 1564 S FEB 1093D

October 1992 C

High-PerformanceVisualization Appliedto ComputationalElectromagneticsMethod-of-Moments on aSilicon Graphics Workstation

L. C. RussellJ. W. Rockway

93-02417AI! ApIprovedJfor IIi r a li I J Jil iJIF.

f.J~ D Approved for pubilo release; diltribution Is urnlmlted.

V,

Page 2: High-Performance Visualization Applied to Computational

DISCLAIMER NOTICE

THIS DOCUMENT IS BEST

QUALITY AVAILABLE. THE COPY

FURNISHED TO DTIC CONTAINED

A SIGNIFICANT NUMBER OF

PAGES WHICH DO NOT

REPRODUCE LEGIBLY.

Page 3: High-Performance Visualization Applied to Computational

Technical Report 1564October 1992

High-Performance VisualizationApplied to Computational

ElectromagneticsMethod-of-Moments on a Silicon

Graphics Workstation

L. C. RussellJ. W. Rockway

w4f,{,~j U•F

! a' , t 1- t --

DTIC QUALITY IjP-1T)a Ev 8"r

:;I::. g~e lal rSt F

Page 4: High-Performance Visualization Applied to Computational

NAVAL COMMAND, CONTROL ANDOCEAN SURVEILLANCE CENTER

RDT&E DIVISIONSan Diego, California 92152-5000

J. D. FONTANA, CAPT, USN R.T. SHEARERCommanding Officer Executive Director

ADMINISTRATIVE INFORMATION

This work was performed by the Electromagnetic Technology and SystemsBranch under the Independent Exploratory Development Program, OCNR-10P,Arlington, VA 22217.

Released by Under authority ofJ. B. Rhode, Head R. J. Kochanski, HeadElectromagnetic Technology Communications Systemsand Systems Branch Engineering and Integration

Division

SM

Page 5: High-Performance Visualization Applied to Computational

EXECUTIVE SUMMARY

OBJECTIVES

Demonstrate the value of high-performance visualization techniques for the method-of-moment modeling of electromagnetic field radiation and scattering for antennas in acomplex environment. Improve the utility of computational techniques used in electro-magnetic analysis, with special emphasis on ship antenna design.

APPROACH

Method-of-moments is one of the most commonly used techniques in computationalelectromagnetics. It is especially useful for many of the frequencies of interest in theelectromagnetic topside design of Navy ships. The method-of-moments technique involvessolving a set of coupled integral equations to determine the currents on a structure.

Computational electromagnetics can be thought of as a three-step process: problemdefinition, computation, and solution description. The drawback to using a computationaltechnique such as method-of-moments is in the effort required at each of the three steps.Input models must be extensively validated before calculations are performed. Enormousquantities of output data are generated, including currents on all wire segments, near-fieldcontours, and far fields. Advanced visualization techniques can assist in input validationand the rapid interpretation of output data.

The computational electromagnetics code used was the Numerical ElectromagneticsCode - Method of Moments (NEC-MoM). Electromagnetic visualization was performed ona Silicon Graphics Incorporated (SGI) 4D/320GTXB workstation.

CONCLUSIONS

Visualization tools now exist for performing analysis and validation at all three stepsof a method-of-moments design procedure. These tools have greatly improved the utilityof computational techniques used in electromagnetic analysis and are now being used tosupport topside ship design projects for the Navy.

iii

Page 6: High-Performance Visualization Applied to Computational

CONTENTS

EXECUTIVE SUMMARY .........MMA.RY... .......................... iii

1.0 INTRODUCTION ................................................... 1

2.0 COMPUTATIONAL ELECTROMAGNETICS ............................ 1

2.1 ELECTROMAGNETIC MODEL .................................... 1

2.2 N EC-M oM ...................................................... 2

2.3 NEED FOR VISUALIZATION ..................................... 3

3.0 VISUALIZATION TECHNIQUES ...................................... 3

3.1 COLOR CODING ................................................ 3

3.2 COMPLEX DATA ................................................ 4

3.3 VECTOR DATA ................................................. 4

4.0 APPROA CH ........................................................ 4

4.1 SG I 4D /320 ..................................................... 5

4.2 SOFTWARE PACKAGES .......................................... 5

4.3 NEC DATA SETS ................................................ 6

5.0 VISUALIZATION PROGRAM STRUCTURE ............................ 6

5.1 W IND OW S ...................................................... 6

5.2 M EN U S ........................................................ 6

5.3 TRANSFORMATIONS ............................................ 7

5.3.1 Z oom ...................................................... 7

5.3.2 R otate ..................................................... 7

5.3.3 Translate ................................................... 8

5.4 PICK CORRELATION ............................................ 8

5.5 U SER'S GUIDE .................................................. 9

6.0 GEOMETRY DESCRIPTION PRODUCTS .............................. 10

7.0 SOLUTION DESCRIPTION PRODUCTS ............................... 10

7.1 CURRENTS .................................................... 11

7.2 NEAR FIELD S .................................................. 11

7.3 FAR FIELD S ................................................... 12

8.0 MoM MATRIX DISPLAY ........................................... 12

8.1 EXPLORER M AP ............................................... 12

v

Page 7: High-Performance Visualization Applied to Computational

8.2 GRAPHICS LIBRARY PROGRAM ................................. 12

9.0 OBSERVATIONS .................................................. 13

9.1 V ID EO ........................................................ 14

9.2 PRODUCTION CODE ........................................... 14

9.3 PC IMPLEMENTATION .......................................... 14

9.4 OTHER CEM CODES ........................................... 14

10.0 CONCLUSIONS .................................................. 14

11.0 REFERENCES .................................................... 15

APPENDICES:

A. Source Code for filter .............................................. A-1

B. Source Code for view nec ........................................... B-1

C. Source Code for view-morn .......................................... C-1

FIGURES

1. Electrom agnetic m odel ................................................ 2

2. W ire parameters window .............................................. 8

3. view nec wire segmentation display window ............................. 10

4. MoM matrix 2D display for a four-sided loop ........................... 13

TABLE

1. HERP and HERO near-field values .................................... 11

vi

Page 8: High-Performance Visualization Applied to Computational

1.0 INTRODUCTION

This report presents the findings of a Navy-funded Independent Exploratory Develop-ment (lED) investigation. This investigation applied advanced visualization techniques toan existing computational electromagnetic (CEM) code. The goal was to demonstrate thathigh-performance visualization can improve the utility of computational techniques usedin ship electromagnetic designs.

The CEM code used was the Numerical Electromagnetics Code - Method of Moments(NEC-MoM). The NEC-MoM code was not run on the visualization workstation. Instead, itwas run on a high-performance computing (HPC) platform, a Convex C-220, with onlythe NEC-MoM input and selected output files ported to a Silicon Graphics, Incorporated(SGI) machine for pre- and postprocessing visualization.

The visualization platform used was an SGI 4D/32OGTXB, representing the mostsophisticated visualization hardware available. Two visualization codes were developed asa result of this project: viewnec and viewmom. The programming was done using the Clanguage calling SGI Graphics Library' (GL) functions.

This report is organized along the following lines: Chapter 2 describes computationalelectromagnetics, the method-of-moments technique, and the need for visualization.Chapter 3 discusses techniques for visualizing data. Chapter 4 discusses the approachused for this IED project, including hardware and software options. Chapters 5, 6, 7, and8 give detailed descriptions of the visualization products that were developed as a resultof this project. Chapters 9 and 10 provide observations and conclusions.

2.0 COMPUTATIONAL ELECTROMAGNETICS

Computational electromagnetics is that branch of electromagnetics that routinelyinvolves using a computer to obtain results. It is a complementary tool to the classicaltechniques of experimental observation and mathematical analysis.

The CEM application of interest to the authors of this report is naval ship electromag-netic design. The specific area of interest is antenna design. Key technical parameters forantenna performance include impedance, near fields, coupling, and far-field radiationpatterns.

2.1 ELECTROMAGNETIC MODEL

The electromagnetic model uses transfer functions derived from Maxwell's equations(figure 1). The inputs to the transfer functions include an environmental description of theproblem as well as the specified input. The environmental description is defined by boththe electrical and the geometrical properties of the structures and the space in which theyreside. The input is the specified excitation, which can be either a voltage source appliedto an antenna or a plane wave impeding on the defined structure. The outputs from thetransfer functions are the induced currents on the structures or the impedance of theantenna. These induced currents can be used to determine both the near and far fields.

1

Page 9: High-Performance Visualization Applied to Computational

For naval ship electromagnetic _. ,sign the near fields are of interest in determiningcoupling between antennas as well as hazards to personnel, fuel, and ordnance. Far fieldsare used to determine the performance of the electromagnetic system.

ENVIRONMENT DESCRIPTIONELECTRICAL, GEOMETRICAL

TRANSFERFUNCTION

INPUT OUTPUT-DERIVED FROM

(SPECIFIED (INDUCED SOURCES:EXCITATION) -NEAR FIELDS

MAXWELLS -FAR FIELDS)EQUATION

Figure 1. Electromagnetic model.

2.2 NEC-MoM

The numerical electromagnetic code was developed for antenna modeling. NECincludes NEC-MoM, NEC-basic scattering, and NEC-reflector antenna codes (Li, Logan,and Rockway, 1988). All these codes have been validated and extensively documented.NEC-MoM is a development effort of the Lawrence Livermore National Laboratory(Burke and Pogio, 1981; Burke, 1989).

To model complex structures, NEC-MoM uses an electric-field integral equation(EFIE) for wires and a magnetic-field integral equation (MFLE) for surfaces. The EFIE iswell suited for thin wires, while the MFIE is attractive for modeling smooth surfaces thatbound large closed volumes. The EFIE can also be used to model surfaces, by using awire grid to represent a surface. The EFIE wire grid is preferred for surfaces that are notsmooth and that enclose volumes that are"not large. For the task described in this report,only the EFIE technique was used.

The thin-wire approximation is applied to the EFIE to reduce the equation to a scalarintegral equation. Transverse currents and transverse variation of the axial current on thewire are neglected. The boundary condition on an electric field is enforced in the axialdirection only. The approximations made in NEC-MoM are valid as long as the wireradius is much smaller than the wavelength and the wire length. The result is a set ofcoupled integral equations for the currents. As a practical matter, these approximationslimit the application of NEC-MoM to resonance and below for a given structure.

2

Page 10: High-Performance Visualization Applied to Computational

The integral equations are solved numerically by the collocation form of the method ofmoments, which involves expanding the unknown current in a summation of basis func-tions and enforcing the equality of weighted integrals of the fields. This reduces the inte-gral equations to a matrix equation (Harrington, 1968). The weighting functions arechosen to be delta functions. This collocation method results in a point sampling of thefields. Wires are divided into short segments, with a sample point at the center of eachsegment.

The matrix equation that results from the moment method is solved by LU decomposi-tion (Press et al., 1986). This determines the currents on the wire segments. From thecurrents, all electromagnetic parameters of interest can be derived: impedance, coupling,and near and far fields.

2.3 NEED FOR VISUALIZATION

Computational electromagnetics can be thought of as a three-step process: problemdefinition, computation, and solution description. The drawback to using a computationalelectromagnetics code such as NEC-MoM is in the effort required at each of the threesteps. Preparing the input model for NEC and evaluating the output can be an overwhelm-ing task. Performing calculations can be exceedingly time consuming for all but the mostsimple structures.

To conserve computing resources, input models must be extensively validated beforecalculations are performed. Enormous quantities of output data are generated, includingcurrents on all the wire segments, near-field contours, and far fields. One of the goals ofthis LED project was to demonstrate how advanced visualization techniques could be usedto assist in input validation and the rapid interpretation of output data.

3.0 VISUALIZATION TECHNIQUES

During this LED project, decisions had to be made regarding how to effectively visual-ize the data of interest. In many cases, there were several options. It was often difficult todecide which display method would have the most utility for the final user. The productsof this project are now being used in support of ship EM design projects. This applicationof these products will quantify utility.

3.1 COLOR CODING

One of the main problems encountered was in deciding how to assign color coding.Color coding is an art unto itself. It was often difficult to decide whether color codingshould be done using a continuous range of colors or using a discrete set of colors.

There are three components to color. The RGB color model interprets these compo-nents as the three colors (red, green, blue) used by the CRT. By varying the amount ofeach color component, the full range of screen colors can be achieved. The SGI machinehas 24-bit color, with 8 bits for each component. Each component is an integer value

3

Page 11: High-Performance Visualization Applied to Computational

be wven 0 and 255. In this manner, the console is capable of displaying over 16 milliondifferent colors. Of course, it is doubtful that the human eye can distinguish all these.

Humans do not perceive colors in the same manner that the console displays them. Tohumans, it is more intuitive to use the HSV color model (hue, saturation, and value). TheHSV model is based on the intuitive appeal of the artist's tint, shade, and tone. Hue has avalue between 0 and 360. Saturation and value range between 0 and 1. Algorithms existfor translating between the different color models (Foley et al., 1990).

At one point during this IED project, it was proposed that various data componentscould be encoded into the different components of the HSV color model. For example,for complex data, the magnitude could be encoded in the hue and the phase could beencoded in the value. This idea was found to be not feasible for two reasons. First, theuser became verwhelmed by the amount of information contained in slight variations indisplayed color. Second, the color printer was totally incapable of reproducing anythingbut major variations in color, so one could not obtain a hard-copy output of the visualiza-tion display.

For most data sets, a discrete color-key coding system was found to provide the mostuseful visualization of the data. Seven bins were chosen and the data were linearlyassigned to the bins. The color-key assignments were changed several times. A final deci-sion was made to use colors that gave the best contrast when printed out on the colorprinter. Phase is displayed as a continuous range of hue, with saturation and value set to1.0.

3.2 COMPLEX DATA

In most cases, we found that trying to display both components (real and imaginary ormagnitude and phase) of a complex data set in one image confused the user unnecessar-ily. A decision was made to allow the user to display complex data in side-by-side win-dows if both components needed to be viewed simultaneously.

3.3 VECTOR DATA

Current data and field data are vectors. A straightforward method of displaying avector's orientation was never developed. The current vector was defined relative to thewire's direction. It was felt that the direction of the current did not have as much value asthe magnitude and phase of the current.

4.0 APPROACH

For advanced visualization, decisions had to be made regarding hardware and soft-ware. The authors were fortunate to have access to an SGI 4D/32OGTXB. This machinerepresents the most sophisticated visualization hardware currently available. Several visu-alization packages were available on the SGI machine, including PV-Wave, apE, Explorer,and the SGI Graphics Library. The available high- level languages included C andFortran.

4

Page 12: High-Performance Visualization Applied to Computational

4.1 SGI 4D;320

The SGI 4D/320GTXB is one of the SGI POWER SeriesTM line of computers. It canbe configured with up to eight CPUs; the one used for this project has two 33-MIHz CPUs.It has the followb:g CPU performance ratings (SGI, 1991): 59 MIPs (VAX DhrystoneMIPS), 20 MFLOPS (DP Linpack 1000x1000), 41 SPECmarks. The GTXB has 48 bitscolor and 24 bits Z buffer. Its graphics performance is rated as 400K vectors/sec, 150Ktriangles/sec, and 100K polygons/sec. The system used for this project is configured with64-MB memory and a 19-inch console monitor.

4.2 SOFTWARE PACKAGES

Several graphics software packages were available on the SGI computer. Due to timeand monetary constraints, no investigation was made of purchasing other packages. Adecision was made to work with the available packages. The available packages were:PV-Wave, apE, Explorer, and the SGI GL.

PV-Wave is a very powerful visualization package. Unfortunately, it did not seem torun properly on the SGI; moreover, it was only suited to graphically displaying data sets.It had no 3D model rendering capabilities that would be needed for the proposed IEDproject.

apE is a software toolkit for visualization. It was developed by the Ohio Superco-mputer Graphics Project starting in 1987. Scientific and engineering data can be proc-essed and viewed as plots, color images, and three-dimensional objects. Unfortunately, itwas cumbersome to use. 3D objects had to be described using the apE format. It was verydifficult to translate from a NEC input file to apE. For this reason, apE was not used forthis IED project.

Explorer was developed by SGI to fully use the extraordinary capabilities of the SGIvisualization computers. It is similar in design to apE, but it is much less cumbersome touse. Explorer is a system for creating powerful visualization maps, each of which com-prises a series of small software tools, called modules. A map is a collection of modulesthat carries out a series of related operations on a data set and produces a visual repre-sentation of the result. Explorer has a data conversion utility for moving data betweenExplorer and other data formats. A module builder allows custom modules to be created.Unfortunately, Explorer became available only near the end of the IED project year, so itwas only used for a small portion of the project. There was also concern about futureportability, since Explorer is only available for the SGI system.

GL is a set of graphics and utility routines that provides high- and low-level supportfor graphics. The routines can be called from either C code or Fortran code. Though quiteprimitive, GL allows one to access all the powerful visualization capabilities of the SGIs,including 3D drawing, Gouraud shading, device polling, double buffering, coordinatetransformations, hidden surface removal (z-buffering), lighting, pick correlation, and tex-turing, depending on the hardware's capabilities. SGI provides an enormous number ofdemo programs that can be easily modified. GL provides a straightforward way todevelop the capabilities required of this lED project.

5

Page 13: High-Performance Visualization Applied to Computational

4.3 NEC DATA SETS

The NEC input data set is created by a program called NEEDS (Li, Logan, and Rock-way, 1988). The data set is an ASCII fihe written in an archaic format with each linerepresenting a "card." The first two characters on each line refer to an alphabetic codethat determines what the data on that line represent. For example, "CM" is a commentline and "GW" is a wire description line. The output from NEC is an enormous ASCIItext file in a format th, t is very difficult to read from within another computer program.For that reason, a pars -r program is needed to extract the data of interest and put suchdata in a software-readable format. A preprocessing filtering program, filter, was writtenin Fortran to put the input and output data in a form that would allow easy display of thedata of interest. Appendix A contains a source code listing of this program.

Filter prompts the user for the name of a NEC input file. The user must enter the fullfilename. Then the user is asked whether there is an associated currents file. If the answeris yes, the user is prompted to enter the full name of the currents file. Finally, the user isprompted for the name for the output file. This file must have the extension ".geo" (forgeometry).

Filter expects the format of the currents file to be as follows: two lines followed by thedata listed as "magnitude phase". The current data for each segment are on their ownline. The last line in the file must be "-1.234 -1.234".

5.0 VISUALIZATION PROGRAM STRUCTURE

The visualization programs that were developed for this IED project were written inthe ANSI C language using the SGI Graphics Library to access the visualization tools. Theprogram to visualize the problem definition and solution description is named viewnec,and a source code listing of it is in Appendix B. The program evolved as a result offeedback from users. However, the basic structure using multiple windows, pull-downmenus, and transformations was determined from the beginning.

5.1 WINDOWS

The beauty of working in an X-windows type environment, such as that on the SGImachines, is the flexibility it affords the user. That flexibility was retained in the develop-ment of viewnec. Each data component is displayed using 3D imagery in its own window.At any given moment during the running of the program, the user has complete controlover how many data windows are displayed as well as their sizes and locations. In addi-tion, multiple copies of view nec can be launched to do side-by-side comparisons ofdifferent NEC runs.

5.2 MENUS

Pressing the right-hand mouse button while the mouse cursor is within any view necwindow brings up a "pull-down" menu. This pull-down menu allows the user to select

6

Page 14: High-Performance Visualization Applied to Computational

which data windows to open or close, which transformation is active, and whether acoordinate axis is displayed. Once a selection has been made, the affected windows areupdated.

5.3 TRANSFORMATIONS

Entire books have been written on the display of 3D models. This section will justsummarize the display capabilities available in viewnec. The available transformationsinclude rotation, translation, and zooming. Each 3D transformation is representedinternally in the computer by a 4 x 4 matrix. The IRIS Geometry Engines transform allgeometric data (vertices of points, lines, and polygons) by multiplying each vertex by theaccumulated matrices. In viewnec, the transformations are actuated with the left mousebutton held down and the cursor dragged across the screen.

There are three basic classes of transformations that can be carried out by the Graph-ics Library: projection transformations, viewing transformations, and modeling transfor-mations. A good analogy is to a camera with a versatile lens. Projection transformationsdescribe the type of lens on the camera. Viewing transformations determine where thecamera is positioned and in which direction it is pointed. Finally, modeling transforma-tions affect the location, orientation, and size of the 3D geometric models in the scene.

There is often more than one way to carry out the transformation of a scene. Forinstance, instead of moving the camera toward the object, the object could be movedcloser to the camera. However, there may be subtle differences. The transformationmethods used in viewnec were chosen by selecting demo programs that gave the desiredeffect.

5.3.1 Zoom

The zoom feature allows the user to expand a selected portion of the model for a moredetailed display.

Zooming is achieved internally by using a projection transformation, perspective.By modifying the fovy parameter, the field of view in the y dimension is modified. Thishas the effect of making the scene appear closer or farther away. The aspect ratiobetween the field of view in x and the field of view in y and the distances to the near andfar clipping planes are kept constant.

5.3.2 Rotate

The rotate feature allows the user to rapidly change the orientation of the model. Thispermits a better feeling for the three-dimensional nature of the model and often allowsvarious features of the data to become more apparent.

Rotation of the scene is carried out internally using the polarview command.Polarview is a viewing transformation. This command moves the viewpoint. The dis-tance from the origin is kept constant while the azimuthal angle in the x-y plane and the

7

Page 15: High-Performance Visualization Applied to Computational

incidence angle in the y-z plane are modified. This is akin to moving the camera over aspherical surface surrounding the scene.

5.3.3 Translate

The translate feature allows the user to move the model up or down or left or right inthe plane of the screen. This shifts the origin and is useful before zooming in on aselected portion of the model.

Translation of the scene is carried out internally by using the modeling transformationtrans late. The program is set up to allow only translation of the object in the plane ofthe screen. The size of the object is preserved.

5.4 PICK CORRELATION

It quickly became apparent that a method was needed to selectively choose a singleelement, such as a wire segment, from the 3D wire object display. This was needed fortroubleshooting as well as linking the display back to the NEC input data set. The middlemouse button was chosen for this purpose. The technique used is known as pick correla-tion. The Graphics Library provides this capability.

Pick correlation identifies objects on the screen that appear near the mouse cursor.Information about these objects is stored in a buffer. Viewnec uses this information toallow the user to select a single wire segment from the object displayed and list all infor-mation about it. A sample wire parameters window is shown in figure 2.

WF r .Paeprmtrwid .

Fiur 2. Wire paaetr wInDow.,

St 4 ,ýlt I~ dp l i t I] 1 1311. 1, , 58

Page 16: High-Performance Visualization Applied to Computational

5.5 USER'S GUIDE

The user does not need to understand the internal structure of view nec that isdescribed above in order to use the program. Running view nec is a very straightforwardprocedure.

If the user is interested in viewing only the geometry description products or wirecurrents, then just the file with extension ".geo" is required. This file contains thegeometry of the model and the currents on the wires if these have been calculated by anNEC run. The ".geo" file is generated by running the program filter as described above. Ifthe user is interested in examining the near or far fields, then additional files are needed.The far-field data are contained in four files: *.etm (magnitude of E-theta component),*.etp (phase of E-theta component), *.epm (magnitude of E-phi component), and *.epp(phase of E-phi component). The near-field data are contained in the file *.fld. The usermust generate these files before running viewnec. For the required format for each ofthese files, consult the source code listing of view nec in Appendix B.

To run view nec type "view nec". The program then prompts the user for the filename. This is the file name for the *.geo file. DO NOT TYPE THE .geo EXTENSION!During the running of view.nec, the program will automatically access any additional filesneeded for the display of near or far fields if requested. All the files must have the sameprefix. The extensions must be assigned as outlined above.

During the running of viewnec, the menu can be brought up at any time by pressingthe right-hand mouse button while the mouse cursor is within any view_.nec data window.The menu allows the user to open or close any data windows, change the transformationmode, or toggle the coordinate axis display.

The transformation mode is indicated in the lower left comer of all data windows. Thetransformation is carried out by clicking the left mouse button and dragging the cursorwithin any data window.

Clicking on the wire model with the middle mouse button brings up the wire parame-ter window described above. The currently selected wire segment flashes until it isunselected (by either clicking the middle mouse button in the background or selecting anew wire segment).

Clicking the middle mouse button in the near-fields window changes the near-fielddisplay threshold (this is described below in the solution description products section).

To exit viewnec, click the left mouse button in the shaded band at the very top of anydisplay window and select "close".

9

Page 17: High-Performance Visualization Applied to Computational

6.0 GEOMETRY DESCRIPTION PRODUCTS

The NEC input file describes the modeled object (such as a ship) as a collection ofwires. The description of each wire includes: a tag number (for identification purposes),the number of segments on the wire, the (x,y,z) coordinates for both the beginning andend points, and the radius of the wire. Since some wires are tapered, extra information isgiven for these wires to describe the tapering.

There are four windows that can be opened up to display the model's input geometry.The windows each display one of the following: Wire Segmentation (segment length inmeters), Wire Radius (in meters), Segment to Radius Ratio, or Wire Connectivity (none,one, or both ends connected). All of these windows display the model as a 3D wire object.The data are encoded in the color of each wire segment using a linear color assignmentscheme. A color key is displayed in the lower left corner of the window. Figure 3 is asample window showing wire segmentation. Without color, one cannot get a true under-standing of the "value" of the display to the user.

NT IINiIH 1 I I. H S3

Figure 3. viewnec wire segmentation display window.

7.0 SOLUTION DESCRIPTION PRODUCTS

Solution description is displayed in up to eight windows. These eight windows includecurrents on the wires (real component, imaginary component, magnitude, or phase), totalnear field (electric field, in volts/meter), z-component of near field, theta component offar field, and phi component of far field.

10

Page 18: High-Performance Visualization Applied to Computational

7.1 CURRENTS

Currents on the wires are displayed using the same technique as was used for thegeometry description products: current is color-coded on a 3D wire display of the model.Since currents are complex, there are four different current data windows that can bedisplayed: real component, imaginary component, magnitude, and phase. Most users havefound the magnitude window to be most useful.

7.2 NEAR FIELDS

NEC-MoM allows the user to calculate the near field at selected locations surroundingthe model. These locations are usually defined by a 3D grid surrounding the model. Thenear field is a complex vector. Of most interest is the z-component, since this will be thecomponent that affects personnel standing on the surface of the ship. Several techniqueswere investigated for displaying the near-field data points.

Viewnec displays near fields using a "fog" technique in which the density of activatedpixels in the image is linearly proportional to the field intensity at the nearest calculationpoint. Since the calculation points usually form a 3D grid, the image contains squareblocks of fog varying in density with the field intensity. The fog is color-coded in amanner similar to that used for the geometry description products. The 3D wire model isdrawn using a dark gray color so as not to detract from the near-field display.

The near-field windows have a thresholding capability. By clicking in the window withthe middle mouse button, the user is able to selectively change the threshold at which thefields are displayed. This allows the user to quickly determine what areas surrounding themodel have fields above a particular cutoff level. The threshold can be selected to be anyof the color-key bin levels, HERP (Hazardous Electromagnetic Radiation for Personnel),or HERO (Hazardous Electromagnetic Radiation for Ordnance). HERP and HERO arefunctions of the frequency at which the NEC model was run. The near-field windowsdisplay the value of the frequency. HERP and HERO values are shown in table 1.

Table 1. HERP and HERO near-field values.

Frequency Range, MHz Maximum E-Field, V/m

HERP

0.01-3 632.53-30 1897/(frequency)

30-300 63.25300-1500 3.65 )$QRT (frequency)

1500-300,000 141.4

HERO

0.1-1 100/(frequencyj1-3.7 100/ (frequency)

3.7-10 210-1000 0.5 x (frequency°' 6)

11

Page 19: High-Performance Visualization Applied to Computational

7.3 FAR FIELDS

There are two windows available for the display of far fields. These windows allow theuser to display either the theta component or the phi component of the far electric field.

The far field is complex data. This makes display of it somewhat complicated. Amethod was sought of displaying both the magnitude and phase simultaneously. Themethod selected involves displaying the fields as a three-dimensional surface. The dis-tance from a point on the surface to the origin is proportional to the field magnitude atthat point. The color at the point is determined by the phase of the field at that point.Gouraud shading is used between points to allow for color transition.

8.0 MoM MATRIX DISPLAY

There has been some speculation that visualizing the method of moments matrix thathas been extracted from NEC might give some insight into the wire model's validity. TheMoM matrix is a complex matrix that may have a dimension of about 1000. The dimen-sion of the matrix is equal to the number of wire segments in the input model. Thismatrix is also referred to as the impedance matrix. Two methods were used to render thedata: an Explorer map and a Graphics Library program.

8.1 EXPLORER MAP

An Explorer map was developed to display the magnitude of the matrix. This mapreads in the data, subsamples and crops the data, extracts the magnitude values, and thenrenders the data as a three-dimensional surface. The vertical offset of a point on thesurface (as well as the color of the point) is proportional to the magnitude at that point.

There are several advantages to using the Explorer map. Explorer allows a greatamount of flexibility in assigning color mappings, manipulating the rendered 3D object,and modifying of the vertical offset.

There are also several serious disadvantages to using the Explorer map. Foremost isthe array size limitation (64K), which does not allow a display of the entire matrix for atypical ship. A typical ship matrix can have as many as a million elements. The array canbe cropped and subsampled, but a great deal of data are lost. This makes the renderedgraphic almost useless. In addition, only the magnitude of the data can be displayed. Thephase component of the data cannot be displayed. Finally, there is no way for the user todetermine where in the matrix (i.e., row and column) different features in the display arelocated.

8.2 GRAPHICS LIBRARY PROGRAM

A Graphics Library program, viewmom, was developed to allow the display of almostany size method-of-moments matrix. Its structure is similar to that of view._nec, but it isquite a bit simpler. View-mom allows data to be displayed in three display modes: 2D(surface), 1D (wire), or OD (points). The pull-down menu is used to select the displaymode.

12

Page 20: High-Performance Visualization Applied to Computational

View-morn allows the user to select two different windows. The first window has thedata displayed as a three-dimensional object, with the vertical offset and color propor-tional to the logarithm of the magnitude of the data. The second window is similar, exceptthat it has the color proportional to the phase of the data. Each window allows the surfaceto be rotated, translated, and zoomed, just as in view__nec. The right-hand mouse buttonbrings up the menu. The left mouse button performs the transformations. The middlemouse button performs a pick correlation that allows the user to select a point on thematrix. After a matrix point has been picked an information window appears in the lowerleft comer of the console screen. This information window describes the matrix and givesinformation about the selected point. Included in this information are the row and columnnumber of the point. A source code listing of viewmom is in Appendix C. A sample MoMmatrix display window is shown in figure 4.

- Mo Matt* EQ

Figure 4. MoM matrix 2D display for a four-sided loop.

9.0 OBSERVATIONS

During this IED project the authors learned a great deal about visualization techniquesand limitations. One observation is that as more and more features are added to a pieceof software, the user interface becomes the limiting factor in the utility of the program.Another observation has to do with the limits of hard copy devices, such as the colorprinter that was attached to the SGI. Although it was a very high quality printer, it was

13

Page 21: High-Performance Visualization Applied to Computational

extremely limited in its ability to faithfully reproduce the hue, saturation, and brightnessdisplayed on the console. Subtle differences in hue could not be discerned, and saturationvariations were washed out.

9.1 VIDEO

In order to properly document this effort, the authors have proposed making a short(10-minute) video. This is the only way to demonstrate the utility of the codes that weredeveloped. The video is still in production as of the date of this report.

9.2 PRODUCTION CODE

To be used as production codes, view nec and viewmom need some additional work.The user interfaces need improvement. NASA's Goddard Space Flight Center hasdeveloped a transportable applications environment, TAE+, which provides a means ofbuilding a graphical user interface into applications. TAE+ is designed to run on theSilicon Graphics machines.

There needs to be a more robust method of extracting NEC output data for interfaceto a NEC visualization production code. It has been proposed that more CAD-like capa-bilities be added to view nec.

9.3 PC IMPLEMENTATION

It is not feasible right now to port the visualization codes to the PC. Although they arewritten in the C-language, the Graphics Library is specific to the Silicon Graphicsmachine. However, SGI is attempting to make their GL a graphics standard that will beavailable in the future for PCs. In the meantime, SGI is introducing a line of desktopvisualization machines, the Indigos, with excellent graphics and CPU performance at anexceptionally low price, competitive with high-end PCs.

9.4 OTHER CEM CODES

Future work will focus on bringing visualization capabilities to other computationalcodes used in electromagnetic ship design. These codes include the NEC-Basic ScatteringCode developed by Ohio State University and TSAR, a finite difference time domain codedeveloped by Lawrence Livermore National Laboratory.

10.0 CONCLUSIONS

Several payoffs have resulted, or will result, from the work done on this IED project.

"* Visualization tools now exist for performing analysis and validation at all threesteps of a NEC-MoM design procedure.

"• These tools have greatly improved the utility of computational techniques usedin electromagnetic analysis and are now being used to support topside shipdesign projects for the Navy.

14

Page 22: High-Performance Visualization Applied to Computational

"* In combination with the work done during a related FY91 IED project, thevisualization tools developed for this project are supporting the efficient tran-sitioning of computational electromagnetics to high-performance computing.

"* High-performance computing will provide a huge increase in processing speedand data analysis and permit the more accurate modeling of ship topsides.

"* Since topside synthesis involves generating enormous quantities of data, designquality will significantly improve with the enhanced comprehension and compu-tational speed offered by visualization and high-performance computing.

"* This technology is in the process of being transitioned into the ElectromagneticEngineering (EMIE) project of NAVSEA.

"* Based on the work done during this IED project and a related FY91 IED pro-ject, the 6.2 EMC project has scheduled projects in high-performancecomputing and visualization for FY94.

11.0 REFERENCES

Burke, G. J. 1989. "Recent Advances in NEC: Applications and Validation,"UCRL-100651, Lawrence Livermore National Laboratory (March), Livermore, CA.

Burke, G. J., and A. J. Pogio. 1981. "Numerical Electromagnetic Code (NEC)-Method ofMoments," NOSC Technical Document 116, Naval Ocean Systems Center, San Diego,CA.

Foley, J. D., A. van Dam, S. K. Feiner, and J. F. Hughes. 1990. Computer Graphics:Principles and Practice, Second Edition, Addison-Wesley Publishing Company, NY.

Harrington, R. F. 1968. Field Computation by Moment Methods, The Macmillan Company,New York, NY.

Li, S. T., J. C. Logan, and J. W. Rockway. 1988. "Ship EM Design Technology," NavalEngineers Journal, May.

Press, W. H., B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling. 1986. NumericalRecipes: the Art of Scientific Computing, Cambridge University Press, New York, NY.

SGI, 1991. Periodic Table of the IRISes, Silicon Graphics Computer Systems.

15

Page 23: High-Performance Visualization Applied to Computational

Appendix ASOURCE CODE FOR filter

PROGRAM FILTER

DIMENSION XWIREI(3000),YWIRtEl(30001,ZWIREI(3 00 0I,SXWIRE2(3000) .YWIRE2 (3000) .ZWIRE2 (3000)

DIMENSION XNODEl(3000),YNODElI3000I.ZNOD~rl(3000),ITAGS(3000oISXNODE2(3000) ,YNODE2(30001 ,ZNODE2(3000) .SEGS(3000),RADS(3000),SSRRLAT(3000I.RCR(3000I ,PCR(3000)REAL ICR(3000),MCRI3000)LOGICAL CONECT(6000(REAL SEGMIN, SEGNAX, RADMIN, RADMAX, SRNIN, SRNAX, RCRMIN, ECRNAX,

SICRIIIN. ICRMAX.MCRMINMCRMA)) XFCR, RIEL. BRAD. ERAD. LENGTH,$SLEN. SR.AD

INTEGER NSEGS, lEAD.IX. ISEG, IRAD,.ISR, ICONIRCR,11CRIMCRINTEGER NWIRESISEGS(3000),JWIRE(3000),JSEG(30OO)INTEGER NNODES. INODEJNODE, 11.12CHARACTER*12 INFILCNAFtACTER-32 LINECHARACTER' 1 CH

Cget the filenameWRITE(6,*) 'Enter NEC file name:READ($. 10) INFIL

10 FORNAT(A)"C open the NEC file

OPEN(7. FILE=INFIL)"C open the temporary output file

OPEN(8, FILE-'dat..tmp')OPEN(9, FILE-'freq.tmp')

"C loop through the NEC file reading the lines20 READ(1.10,END-50) LINEC if its a wire line. write it :,ut

IF (LINE(l:2).EQ.'GW') WRITE)8,*) LINE(3:)IF (LINE~l:2).EQ.'GC') WRITE(B,*) LINE(3:)IF (LINE(1:2).EQ.'FR') WRITE(9,*) LINE,3:)GOTO 20

50 CLOSE())CLOSE (18)CLOSE 191

C open up temporary frequency tile and read frequencyOPEN(9, FILE-'freq.tmp')FREQ = 299.8READ (9,-, END=60) I STEP. 1CNTI X, B, FRE4ý,XSTEy

60 CLOSE(9)C open up temporary file and reed in wire lines

OPEN(7, FILE-'data.tmp')C initialize

CDR=ACOS (0.01/90.0NSEGS 0NNODES -0NWIRES -0

C loop, reading data, also find minimum x, y, and z100 READ(7,'.END=200) ITAG.IX.XlYlZl,X2,Y2,Z2,X

NWIRES - NWIRES + IITAGS(NWIRES) - ITAGISEGS(NWIRES) = IXXWIREI(NWIRES) - XlXWIRE2(NWIRES) = X2YWIREI (NWIRES) YIYWIRE2(NWIRES) - 2-WIREI(NWIRES) - ZlZWIRE2)NWIRES) -22IF (NSEGS.EQ.0) THEN

XMIN - XI

YMIN = YIZMIN = Z1SEGNIN -10000.0RADMIN - 10000.0SENIN =10000.0

RCRMIN -10000.0ICRMIN - 10000.0MCRMIN - 10000.0XKAX Xl

aYNAX YlI

SMAX - 2SEGMAX - 0.0RADMAX - 0.0SRMAX =0.0RCRMAX - -10000.0ICRMAX -- 10000.0MCRMAX -0.0

END IFIF (X1.LT.IININ) SNIN=XIIF IYl.LT.YMIN) YMIN-YIIF (Zl.LT.ZMINI ZMIN-ZlIF (XI.GT.Xi4X), XMAX-XlIF (YI.GT.YMAX) YMAX-YiIF IZI.GT.ZMAX) ZMAX-21IF (X2.LT.XMIN) XMIN"X2IF (Y2.LT.YMIN) YMIN-52IF (Z2.LT.ZMIN) ZMIN-12

A-1

Page 24: High-Performance Visualization Applied to Computational

IF (X2.GT.XMAX) XI4A2-X2IF (Y2.GT.YNAX) YNAX-Y2IF (Z2.GT.ZMAX) ZMAX-22IF (X.GE.0.000001) THENDO 120 I-1,IX

NSEGS -NSEGSe1NMODES -NNODES+2JWIRE(NSEGS) - NWIRESJSEG(NSEGS) -IXNODEI(NSEGS) - Xl + (I-1P*(X2-Xl)/IXYNODE1(NSEGS) - YI + (I-1P*(Y2-Y1)/IxZNODEI(NSEGS) - Z1 (1-1)*(Z2-Zl)IIXXNODE2(NSEGS) - XI + I*X2-X1)/IXYNODEZ(NSEGS) - Yl + I*(Y2-Yl)/IXZNODE2(NSEGS) - ZI + 1*(Z2-Zl)/IXSEGS(NSEGS) - SORT((Xl-X2)"-2e(Yl-Y2).*2.(Zl-Z2)..?)/IXR.ADS(HSEGS) - XSRRAT(NSEGS) - SEGS(NSEGS)/RADS(NSEGS)CONECT(NNODES) - .FALSE.CONECT(NNODES-1) -FALSE.IF (SEGS(NSEGS) .LT.SEGMIN) SEGMNI-SEGS(NSEGS)IF (RADS(NSEGS) .LT.RADMIN) RArJNIN-RADS(NSEGS)IF (SRRAT(NSEGS) .LT.SRMIN) SRMINIHSRRAT(NSEGS)IF (SEGS(NSEGS) .GT.SEGMAX) SEGMAX-SEGS(NSEGS)IF (RADS(NSEGS).GT.RADMAX) RADMAX-RADS(NSEGS)IF (S RRAT (NS EGS) .GT. S RAX) SRMAX-SRRAT(NSEGS)

120 CONTINUEELSE

REAfl(7,*,END-.200) I1,I2,RDELBRAD,ERADDO 140 I-I,IXNSEGS =NSEGS+lMNODES N NODES+2JWIRE(NSEGS) =NWIRESJSEG(NSEGS) -I

IF (I.GT.1) THENX1 - XNODE2(NSEGS-1)Y1 - YNODE2(NSEGS-1)21 - ZNQDE2(NSEGS-1)

END IFLENGTH -SQRT((X1-X2)**2+(Yl-Y2)..2.(Zl-Z2)..Ž)IF (I.EQ.1) THENIF (ABS(1-RDEL).GT.0.0001) THEN

SLEN -LENGTH-(1-RDEL)/(l-RriEL**IX)ELSE

SLEN -LENGTH/tXEND IF

ELSE IF (I.EQ.IX) THENSLEN - LENGTH

ELSESLEN - RDEVSLEN

END IFsR.AD - BRAD +(I-ilP(ERAD-BRAD)/(IX-1)XNODE1CNSEGS) - X1YNODE1(NSEGS) - YlZNODE1(NSEGS) - 21XNODE2(NSEGS) - Xl+(SLEN/LENGTH)* (X2-XI)YNODE2(NSEGS) - YI+(SLEH/LENGTH)* (Y2-Y1)ZNODE2(NSEGS) - 21+(SLEN/LENGTH)* (22-21)SEGS(NSEGS) -SLEN

RADS(NSEGS) -SRAD

SRRATINSEGS) -SLEN/IRADCOHECT(NNODES) - .FALSE.

CONECT(HO4ODES-1) - .FALSE.IF (SEGS(NSEGS) .LT.SEGMIN) SEG44IN-SEGS(NSEGS)IF (RAI(S(NSEGS).LT.RADMIN) RADMIN-RADS(NSEGS)IF (SRRAT(NSEGS) .LT.SRNIN) SRMIN-SRRAT(NSEGS)IF (SEGS(NSEGS) .GT.SEGNAX) SEGKAX-SEGS(NSEGS)IF (RADS(NSEGS).GT.RArA4AX) RADKAX-R.ADS(NSEGS)IF CSRRAT(NSEGS) .GT.SRI4AX) SRKAX-SRRATINSEGS)

140 CONTINUEEN4D IFGOTO 100

200 CLOSE P)C see which segments are connected

DO 300 I-1,NSEGSINODE - (1-2)-lIF (2NODE1(I).LE.RADS(I)) CONECT(INOOE)-.TRUE.IF (2NODE2(l).LE.RADS(I)) CONECT(INODE+1)-.TRUE.DO 350 J-1,NSSGSIF (J.NE.1) THEN

JTNODE-(J 2)-iIF (.NOT.CONECT(INODE)) THEN

DIST - SQRT((ZNODEl(J)-ZNODE1(I)p.-2,S(YNODE1(J)-YNODE1(I))**24(XNODEI(J)-XNODEIl()..2)

IF (DIST.LE.RADS(I)) THENCONECT(INODE) - .TRUE.CONECT(JNODE) - -TRUE.

END IFDIST - SQRT()ZNODE2(JJ-ZNODEI(r))..2

4S(YNODE2(J)-YNODEcInr)**24cXNODE2(J).ENODEI(i~)..?)

IF (DIST.LE.RADS(I)) THENCONECT(INODE) - .TRUE.CONECT(JNODE+1) - .TRUE.

A-2

Page 25: High-Performance Visualization Applied to Computational

END IFEND I FIF (.NOT.CONECTQINODE-1)) THEN

DIST - SQRT((ZNODEI)J)-ZNODE2(I))**2*$(YNODE1(J)-YNODE2(I))-2+(XNODE1(J)-XN0DE2(l))"-2)

IF (DIST.LE.RADS(I)) THENCONECT(INODE.1) - TRUE.CONECT(JNODE) -. TRUE.

END IFDIST - SQRT((ZNODE2(J)-ZNODE2(I))"

2.

$ )YNODE2(3)=YNODE2(l)) -2.)XNODF2(J) XNODE2I)1))"2)

IF (DIST.LE.RADS)I)) THENCONECT(INODE+1) -. TRUE.CONECT)JNODE.I) -TRUE.

END IFEND IFIF ICONECT(INODE) .AND.CO)NECT)INODE+1)) GOTO 300

END IF3SO CONTINUE300 CONTINUEC calculate shifts

XSHIFT - XMAX + XMIN)/2.O

YSHIFT = (YMAX + YMIN)/2.0ZSHIFT -(ZMIN)

C calculate scale factorXDIF -XMAX-XHINYDIF - YMAX-YMINZDIF -ZKA.E-ZMINDIFMAX - XDIFIF (YDIF.GT.DIFMAX) DIFHAX-YDIFIF )ZDIF.GT.DIFMAX() DIFMAX-ZDIFSCALE = 4.0/DIFKAX

C get currents if necessaryC see if there is an output currents tile

WRITE(6,*) 'Is there an output currents file? (Y:Yes, N:No):'

READ(5,10) CHIF (CN.EQ. 'N' .OR.CH.EQ. n') THEN

Do 320 I-I,NSEGSRCR(I) = 0.0ICR(I) -0.0MCR(I) - 0.0PCRMI = 0.0

320 CONTINUERCP.MIN = 0.0RCRMAX - 0.0ICR"JN - 0.0ICRMAX - 0.0HCPJIIN - 0.0MCRMAX -0.0

ELSEC get the filename

WRITE(6, ) 'Enter output currents filename:

READ(5,l0) INFILC open the currents tile

OPEN (1,FILE=INFIL)C loop through reading currents (magnitude, phase)

REAO(7. 10) LINE

READ)7.10) LINEDO 340 I-I,NSEGS

READ)7.*) HCR(I),PCR)I)RCR(I) - MCS)I)*COS(CDRFPCR)I))ICRMI - HCRI)IPSIN)CDR-PCR)(I))IF (HCRMI.LT.MCRMIN) MCENINHMCR)I)IF (MCR(I) .GT.MCRMAX) HCRMAX=MCR(i)IF (RCR(I).LT.RCRMIN) RCENIN=RCRl)IIF (RCR(I.GT.RCRMAX) RCRMAX=RCRl)IIF (ICR(I).LT.ICRMIN) ICRNIN=ICRl)IIF (ICR(I).GT.ICRMAX) ICRMAX-ICR(I

340 CONTINUECLOSE)

7)

END IFC now print it all outC get the filename

WRITE(6,*) 'Enter output file name:

READ)S,10) INFILC open the output file

* OPEN)B, FILE-INFIL)WRITE)3. ) FREQWRITE(8,*) NWIRES, NSEGSWRITE)B,*) SMIN, XMAXWRITE)8, ) MIN, YftAXWRITE)8, ) ZHIN, ZHAXWRITE)8,*) XSNIFT, YSHIFTWRITEIR, ) ZSHIFT. SCALEWRITE(8,I) SEGHIN, SEGAXXWRITE(8, ) I7ADHIN, RADHAXWRITE)8, ) SRMI1N, SRMAXWRITE)8. ) RCRHIN. RCRMAXWRITE(8, ) ICRMIN. ICPXAXWRITE)8,*) MCRMIN, HCRMAXDO 360 1-I,NWIRES

WRITE(8,902) ITALTSl)I).ISEIS(I) ,XWIREiIl) ,YWIREI )I) .SWIREI (I)

SXWIRE2 (I),*YWI RE2M(), ZWIRE2 )I)

A-3

Page 26: High-Performance Visualization Applied to Computational

360 CONTINUE902 FORMAT(' 14,F04

Do 400 I-1,NSEGSINODE-(I2)-lIF (SEO9(AX.EQ.SEG4EN) THEN

ISEG - 0ELSE

ISEG - (SEGS(IJ -SEGOHLN(/(SEGKAX-SEOIIN) 7

IF (SEGS(l).EQ.SEGM~AX) ISEG - 6END IFIF (RAL*(A.EQ.RADNIN) THEN

IRA.D - 0ELSE

I MD - (RADS(I) -RAfl4IN)/ (RADMAX-RADMIN)P7

IF (RADS(I).EO.RADI4AX) IMA - 6END IFIF (SRMAX.EQ.SRNIN) THEN

ISE 0ELSE

ISR - (SRRFAT(I)-SRI4IN)/ (SRKAX-SRMINP'7

IF (SRRAT(I).EQ.SRMAX) ISR - 6END IFIF (RCRNAM.EQ.RCRMIN) THEN

IRCR - 0ELSE

IRCR - (RCR(I)-RCL9IN)/(RCR14AX-RCRlNINI7IF (RCR(IJ.EQ.RCRIIAX) IRCR - 6

END IFIF (ICRKMAXEQ.ICPM4IN) THEN

IICR -= 0ELSE

I1CR - (ICR(H)-ICRMIN)/(ICRMAX-ICRMIN)P7

IF (ICR(I).EQ.ICRI4AX) 11CR =6

END IFIF (MCRMAX.EQ.HCRMIN) THEN114CR - 0

ELSE114CR -(MCR (I)-MCRNIN) / (CR4XM-MCRMI4N) 7

IF (MCR(I).EQ.MCRMAX) 114CR 6

END IFC put XPCR between 0 to 360

XPCR = PCR(I)410 IF (XPCR.LT.0) THEN

XPCR=XPCR+360. IGOTO 410

END IF411 IF (XPCR.GE.360.0) THEN

XPCR=XPCR-360.0GOTO 411

END IFIF (CONECT(1NODE).AND.CONEC-tINODE+1)) ICON =0

IF (CONECT(INODE).AND.(.NOT.CONECT(INODE+1))) ICON - 2

IF ((.NOT.CONECT(INODE)).AND.CONECT(INOD)E+1)) ICON = 2

IF ((.NOT.CONECT(INODE)).AND.(.NOT.CONECT(INODE+1))) ICON -4

WRITE(8,903) JSEG(I),JWIRE(I),ISEG,IRADISR,$ ICON. IRCR, 11CR, 11CR, XPCR

903 FORMAT(' ',15,15,713,FlO.4)WRITE(8.905) SEGS(I) ,R.ADS(I) ,SRRAT(I) .RCR(I) ,ICR(I),M1CR(I)

15 FORMAT(' 1,6F10.4)WRITE(8,904) (XNODE1(I)),(YNODE1(I)),S(2NODEI)I)I. (XNoDE2jI)),S(YNODE2(I)). (ZNODE2(I))

904 FORMAT(' ',6F10 4)

400 CONTINUECLOSE ( 8END

A-4

Page 27: High-Performance Visualization Applied to Computational

Appendix BSOURCE CODE FOR view-nec

Vt.. n~ec.* iw~2dti'piys a J-a wife *MV1091 The poatvjewflI* vtowt-1 tran.eitnmaoti.~q 13 hanged with mou~ai input when.

itt "a lef SmJ bu~tet' i., hold down.. Wire paramoterm. are* uol'vinj ftoý stLt.1 MýIu,, htme-. Henuio are t-ro,wqht* ~ 4 ~ the tjqhý mro-Ae trttrf.

194 H1. St ttc'n Gaqhics, Inc. hll Rigjhti. lttiterver.f* 1-ca £ jr c tI. r iqhtl and liatl ity infrmtiri

i To *I.'n~. Liu, at 1i 'U9,.1 ().Vol, Ir

~'it %"%1 £.4 a4Z h

A~rtt Iyr th-' -1 Iyf ,-htI Jyz,ý:n- dara_-hc1 -i.. I t n-c~nia ch,-Ace, long iblink,

Stjffer2!. -tit ) 8' ý1Aoni pickingj. longt do win);

F- I Lt eilc~ data of.1tCw tca 10t.

F:L9 *.tptil.;F:Lz*.

F:LEt *.pfmitta

t,e Ita file tam*251r at Iftoa t 1i.-l. ;

rot qi tle la )

'ht rpt ol:g' -

S:t~ar nozil -

-ifir *rrd-.at f har £112l * -. 3;

itr. zthraa). - Ik it' r fht"Pa - _i

,n! 3~'iiyat o. 047laan -draw axes - TRUE;

Wmaa~n. axmaix. ormasn Syntax, 01--in. rizmax, mscslo, xdatat30001:tIrwi* mshitt. yshift. zahift, frol, herp. heoc:

fL-'ýAt a.~min. sqgem ra-lutn, radmaac Irmin, arrmax. rcrain, rcriaix,i-rain. icrimai. sacrain. orcroas. e'lhimax. ephiax. fIdasa. ztldaax;

-nj s,1.tn. tat..tin. zat~win, ~;- ~ wit. aq win,aaJ win. Fth_w~n. ott._..n, ept. win. data-win, ,ur,,win,£11 wimn .fIA win;

,'a-P:t chr o.'jwtn~namefl - e.tai.. ati. hage red win nasell - Wire radiu3";ia I, aa-chat ra -win "namel 'S ",asnt to t~ditis";'Pti.*cha '' wn -aII* Nnot on3":112!1 -hat reat wirknana.Il 'Re.al current';

rha 'It Isaq win nammI I Iaa'litioty z.th wfrin 3_ nsl r.bt II lAjnktuAý -gren''., Reproduced From

if of i rtitf fp win namiall 'Iit-0, f I an'.. In nasal) * Best Available Copy

*- -A- : hotk o.ik-ttnasol) 7t-Pit;

v of i- t-hat Elt aWin namell .*s 'Wie ll":tlt'

vatic FIlar ztld win nomaill -* Z-c'p nf Hair teld-;S14-I *"a.. yviami. z'

B-I

Page 28: High-Performance Visualization Applied to Computational

I. initialize* The initialize subroutine positions the window and specifies* its future constraints. Graphics configurations are set and* the event queue is initialized.

voidinitialize (void)

printf(1 Enter tile name. )scanf)"1s", file name);strcpy(geoý_file~file_name);strcpy~etm-file,file_name);strcpy~etp~file,file-name);strcpy (ep. file, file -name):strcpy (epp file, file -name);strcpy )fld file, file~name);strcat )geo _file. geo);strcat (atm file,etm);strcat~etp-file,etp);strcat (epsefile, cpm);strcat (app file, epp);strcat~fld_ file,fld);if))geofile - fopen(geofile,"r")) -- (FILE*)O)

printf)"\n\t\t File Is could not be opened. \n", geo _file);exit)):

xaex - getgdesc(GD-XPI4AX);ymax -getgdesc(GD YPKAX);

zval - getgdesc(GO-ZRAX);

minsize~xmax/lO, ymnax/lO);maxsize(xxnax-200, ymax-160);

keepaspect (xamx, ymex);seg win - winopen)"");

wintitle (seg_ win name);winconstraints));

winset (sag win);-zbuffer (TRUE);

doublebuffer));RGBmode));gconfig));

shademodel (FLAT);*mmode)M4VIEWING):

gdevice (LEFTMOUSE);,qdavice (MIDDLEMOUSE);

qdevice()RIGHTMOUSE):qdevice (ESCKEY);tie(LEFT?4OUSE, MOUSEX, MOUSEY);

/* end initialize)) '

I. main* main calls initialize, than goes into a loop. Within the loop* drawscene is called and events in the event queue are processed* until user exits (by pressing ESCAPE or through the window manager).* Mouse input is passed to drawscene when the left mouse button* is held down.

voidmain (void)

Boolean exitflag - FALSE;Boolean redraw-needed - TRUE;

Boolean draw seq - TRUE;Boolean draw-red - FALSE;Boolean draw-rat - FALSE;Boolean drew-Con - FALSE;Boolean draw-real - FALibE;Boolean draw-imag -FALSE;Boolean draw meg - FALSE;Boolean draw-Ph - FALSE:Boolean draw-eth - FALSE;Boolean drew eph -FALSE;,Boolean draw-date - FALSE;Boolean draw-fld - FALSE;Boolean draw-zfld - FALSE;

short value;short buffer)BUFSIZE!;long hits - 0;Boolean picking - FALSE;short deltax, deltay;

long dev;long choice;long data_choice, trans choice. iblink;

B-2

Page 29: High-Performance Visualization Applied to Computational

long menu, datamenu, transmenu, jeomenu, curmenu,nfieldmenu, ffieldmenu;

short x, oldx; / mouse movement /short y, oldy;short dxr, dxt, dxz - 0;short dyr, dyt, dyz = 0;

static long whitecolf] = I 255, 255, 255 I;static long bluecolti - 1 0, 0, 255 1;static long dbluecol(I = 1 0, 0, 128 };

initialize(;data-choice = 1;trans choice - 1;iblink - 0;tx = 0;ty - 0;tz - 0;

/* make the geometry menu '/geomenu - defpup("Choose Geometry Data Window tti"

"Segmentation IllIWire radius Wx2)Segment to radius ratio lx3I""Wire connections Ix4");

/I make the currents menu I/curmenu - defpup("Choose Currents Data Window %till

"Real component of current 1x51""Imaginary component of current lx6lMagnitude of current 1x01""Phase of current IxS");

/* make the far fields menu '/ffieldmenu - defpup("Choose Far Fields Data Window %ti"

"E-theta component 1x91E-phi component IxlO");/I make the near fields menu "/nfieldmenu - defpup("Choose Near Fields Data Window Iti"

"Z-component of E-normal 1xll1Total E-normal 1x12");/* make the data menu -/datamenu = defpup("Choose Data Window to Open/Close %t)"

"Geometry ImiCurrents ImiNear Fields ImlFar Fields Im",geomenu, curmenu, nfieldmenu, ffieldmenu);

/* make the transformation menu -/transmenu - defpup("Choose Transformation It)"

"Rotate txl3lTranslate Ixl4IZoom 1l451Return to initial state Ixl6");/' make the main menu -/menu = defpup("Menu ItiData Window ImlTransformation mil"

"Close Current Window txl7)Toggle Axes On/Off 1x18",datamenu,transmenu);

while (exitflag == FALSE)

if (redraw-needed == TRUE)

if (draw seg)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

I, trans-choice, iblink,buffer, hits, picking, seg win);

if (draw cad)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

2, trans-choice, iblink,buffer, hits, picking, rad win);

if (draw rat)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

3, trans choice, iblink,buffer, hits, picking, ratwin);

if (draw con)drawscene(dxr, dxt, dxz, dyc, dyt, dyz,

4, trans choice, iblink,buffer, hits, picking, con win);

if (draw real)drawscene(dxc, dxt, dxz, dyr, dyt, dyz,

5, trans choice, iblink,buffer, hits, picking, realwin);

if (draw imag)dcawscene(dxr, dxt, dxz, dyr, dyt, dyz,

6, transchoice, iblink,buffer, hits, picking, imag win);

if (draw mag)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

7, trans choice, iblink,buffer, hits, picking, mag win);

if (draw ph)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

8, trans choice, iblink,buffer, hits, picking, ph win);

if (draw eth)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

9, trans choice, iblink,buffer, hits, picking, ethwin);

if (draw-eph)drawscene(dxr, dxt, dxz, dyr, dyt, dyz,

10, trans choice, iblink,buffer, hits, picking, eph win);

if (draw zfld)drawscene(dxr, dxt, dxz, dyc, dyt, dyz,

I1, trans choice, iblink,buffer, hits, picking, zfld win);

if (drawfld)

B-3

Page 30: High-Performance Visualization Applied to Computational

drawscene(dxr, dxt, dxz, dyr, dyt, dyz,12, trans choice, iblink,buffer, hits, picking, fid-win);

if (iblink -- 0) redraw needed - FALSE;

iblink - -iblink;

while ((exitflag -= FALSE) 66(qtest)) 11 (redraw-needed -- FALSE))

dev - qread (rvalue);if (dcv -- ESCKEY)

if (value -- 0)

axitflag - TRUE:

else if )dev -- REDRAW)

reshapeviawpoct 0;redraw-needed - TRUE;

else if (dev -- INPUTCHANGE)

cur-win - value;

else if (dev -= RIGHTMOUSE 66 value =)

choice =depup(menu);if (choice >- 1)

if (choice 1)

draw-sag !draw-sag;if (draw-sag)

sinsiza~xuax/10.ymax/10);saxsize~xuax-2O0,ymax-160);keapaspecr )xmaa. ymax);sag win - winopen("");wintitle (sag win name);winconstraints 0:winset (sag win);

zbutfer)2'RUE),doublebuffar));RGBmode));gconfigo;shadamodal (FLAT);sauode )HVIEWfl(G);

alse winclosa(3eg win);

if (choicae- 2)

draw red - draw red;if (draw_red)

sinsize(xmax/10,yuax/10);maxsize~ainax-200,ymax-160);keepaspect )xuax~yuax);red -win - winopenC"');wintitle(rad win name);winconstraints 0;winset(rad win);zbuffer(TR(JE);doublebuffero;RG~mode 0;gconfig));shademodel(FLAT);mmode (NVIEWING);

else winclose(rad win);

if (choice -- 3)

draw rat ! draw rat;if (draw-rat)

minsize~xmax/lO,ymax/1O).maxsize~xmax-200,ymax-16

0);

kaepespect~xmax~ymax);rat win - winopen("");wintitle~rat win_name):winconstraints));winset~rat_win).zbuffer (TRUE);doublebuffero;RGBmode));gconfigqo:shademodel(FLAT);remode(NV(EWING).

B-4

Page 31: High-Performance Visualization Applied to Computational

esen winclo~e(lat-win);

if (choice 4)

draw con = draw-con;

if (draw con)

minsire~xmeaic/),ymaR/1)OHmaxsize(xmax-200,ym85I1

6 0);

(ceepaspect (xeam, Yea);con win - winopen)'¶;:wintitle(con-win~name);wincon~traintsU;

winset (con_win);zhuffer (TRUE);doublebuffer U;EG~mode U;qconfigo);shademodel)FLALT);emode (MV! EWING);

else winclose(cnn-win);

it (choice 5)

draw real A raw real;if (draw_ real)

minsize(xmax/IOYmaXI1)O)maxsice~xeaK-200.ylIax-IRO);(ceepaspect (xeaxm, a);reel win - winopenQ"'(;wintitle(real win name);winconstraints 0;winset )real win);zbuffer (TRUE);doublebuffer)LEG~uode 0;gconfig));shademodel (FLirT);mmode(MVIEW!NG);

else winclose~real _win);

if (choice ==6)

draw imag ! draw -imag;if (draw-imag)

m insize~sjeam/lO,ymax/IO);eaxsize(mmax-ZOO,yieax-lRO);keepaspect )smax~ymam);imag win - winopen)"1);wintit.le~imlag win name);winconstraints));winset~imagwin);zb,,ffer (TRUE) ;dnublehuffer)(;RGBmode U;grcnf ig));shademodel (FLAT);mmrle (MV)EW)NG);

else winclose~imag win);

if (choice ==7)

draw mag ldrawmsag;if (d raw mag)

nrinsize~xmam/1OymadhIO);manurze )max-200. yeas-)5!)(ceepaspect (xmas, yeas);mag win - winopen("");wintitle (sag win name);

C ~wincconstraints));winset (sag__w.in);;buffer(TRUE);doublebuffer));EG~mode());gconfig();shademodel (FLAT);mmacdc(MV!EWING);

eli" winclose(mrg'4in);

if (choice ý,8)

draw ph - draw-ph;

if (draw ph)

minuize)55ax5/)O,ymfax/)fO);

B-5

Page 32: High-Performance Visualization Applied to Computational

keepaspect( (xax~ymax);ph w in - winopen("");wintitle (ph_ win name):winconstraints));winset(ph win):zbuf for(TRUE);doublebuffer U;RGBm~ode 0U*gconfig U:shademodel (FLAT):mode IMVI EWING);

else winclose(ph win);

if (choice -- 9)

draw_0th ! draw eth:if (draw_0th)

minsize( mma X/10,Yuax/10);maxsize(xmax-200,ymax-l60).keepaspect (xmax, ymax(;eth -win - winopen("¶);wjfltjtle(.th win name);winconstraints 0:winset (eth win);zbuffer(TR7UE):doublabuffer U;RGBmode U;gcenfigfl;shademodel (GOURAUD);mfode(MVI EWING);

else ijnclose(eth-win);

if (choice 10)

draw-eph = draw-eph;if (draw-eph)

minsiza~xmax/10,yuax/l0);maxsize(xmax-200.ymax-160);keepaspect (xmax. ymax);aph win - winopen("");wintitleleph~win -name);winconstraints U;winsot~eph win);zbuffer (TRUE);doublebuffer U;RGBmodeoU;gconfig();3hademodel (GOURAU)JD;

mmd.(MV! EWING):*

else winclose(oph win'.;

if (choice = 1

draw zfld ! draw zfld;*if (draw-zfld)

minsize(xnax/10,ysiax/10);maxsize(zmax-Z00,ymax-160);keepaspect (xmax,yuax);zfld-win - winopenQ");wintitle~zfld win name);winconstraints(U;winset~ztld win);zbuffer(TRUE):doublebuffer U;RGBmoed. ;qconfigU;shadomodel (FLAT);mOde (NVI EWING);

elso winclos. (zfld win);

if (choice -- 12)

draw_ fid ! draw_ fid;if (draw_ fid)

minqize(xmax/10.ysiax/l)0);maxsize(xmax-200,ymax-160(;keepaspect (seax, yax);fid win - winopen)"");wintitle(fld_win_name);winconstraints ( ;winset(fld win);zbuffer (TRUE);,doubiebufforU;RGBmodeo;gconfig));

B-6

Page 33: High-Performance Visualization Applied to Computational

shademodel(FLAT);

mmode(MVIEWING);

else winclose(fld-win);

if ((choice >- 13)4&(choice <- 16))trans choice - choice - 12;

if (trans-choice =- 4)

dxr - 0;dxt - 0;dxz - 0;dyr - 0;dyt - 0;dyz - 0;tx - 0;ty - 0;tz - 0;trans choice - 1;

if (choice - 17)

if (cur win -- segqwin) draw seg = !draw seg;if (curwin -- red win) draw-red - !draw-red;if (cur_win -- rat-win) draw-rat - !draw-rat;if (cur win =- con-win) draw con = !draw-con;if (curwin -- real win)draw-real-!draw real;if (cur win == imagwin)draw imag='drawimag;if (cur win == mg win) draw-meg - !draw mag;if (cur _win phwin) draw ph = !draw_ph;

if (cur win =- ethwin) draweth = !draw_eth;if (cur _win eph win) draw eph = !draweph;if (cur-win zfld win)draw-zfld-!drawzfld;if (cur win == fldwin) draw fld - !draw fld;wincloselcur win);

if (choice == 18) draw axes - !drawaxes;redraw needed - TRUE;

else if (dev -- LEFTMOUSE)

if (value)1 read initial mouse x,y, which will be

next 2 events because tied to leftmouse'/

qread(&x);qread(&y);

/ now listen to all mouse xyas long as mouse down /

qdevice(MOUSEX);qdevice(MOUSEY);

else/ as soon as mouse released,* stop listening to mouse x,y "/

unqdevice()OUSEX);unqdevice(MOUSEY);

else if (dov == MIDDLEMOUSE && value == 0)I

/- do a pick correlation in current window '/

winset(cur win);data choice 0;if (cur win seg_win) data choice - 1;if (curwin red_win) data-choice - 2;it (cur win rat win) data choice = 3;if (cur _win con win) data choice = 4;if (cur win real win) data choice - 5;if (cur_win imag win) datachoice - 6;if (cur win eq gwin) datachoice - 7;if (cur win phwitr) datachoice - 8;if (cur_win -= eth-win) data choice = 9;if (cur win == eph_win) data choice - 10;if (cur win zfld-win) datachoice - 11;if (cur win - fld-win) data choice - 12;if (data _hoice - 11)

if tzthresh 9- q) zthre h 0;

.1-- if (data ch i--e -' 1.)

t thteshii:if (tthre-h -- 9) tthresh = 0;

else if ((data choice -= 1)4&)data~chcice <- 8))

pi.:k bhuffer,RUFSIZE):picking - TRUE;

B-7

Page 34: High-Performance Visualization Applied to Computational

deltax - 5;deltay - 5;picksize(deltax. deltay);iblink - 0;if (data-choice > 0)

drawscene (dxr,dxt,dxz,dyr~dyt~dyz.data~choice. trans choice. iblink.buffer, hits, picking, cur win);

picking - FALSE;hits - endpick(buffor);if (hits > 0)

iblink - buffer(l];if (draw-data -- FALSE)

profposition(xuax/40,x.max*8/20,yuax/40.ymaxl13/4O);

data win - winopen)"");wintitle(data win name);winconstraints' 0;winset(data win);singlebuffero;RGfliode 0;gconfig0 ;shademodel (FLAT);weiode(IWIEWING);draw-data - TRUE;

winset(data win);cli (dbluecol);clear 0 ;cli (whitecol);ortho2(0.0, 5.0, 0.0, 4.0);printhits(iblink(;

else

if (draw-date)

draw data - FALSE;winc-lose(data win);

redraw-needed - TRUE;

else if (dev -- IOUSEX)

oldx - x;

x - value;if (trans choice -1) dxr - dxr + (aoldx);if (trans choice ==2) dxt -dxt + (x-oldx);if (trans choice -- 3) dxz - dxz + (x-oidx);

redraw_needed -TRUE;

else if (dcv -- NOUSEY)

oldy - yy - value;

if (trans choice 1= ) dyr - dyr + (y-oldy);if (trans choice -- 2) dyt - dyt - (y-oldy(;if (trans choice -- 3) dyz - dyz + (y-oldy(;

redraw_needed TRUE;

I I- end while exitfiag FALSEand (qtest or redraw-needed FALSE) I/

1'end while exit flag FALSE /1exit (0);

I end main))

I. printhits* Prints wire parameter data in date window

void printhits (iblink)long iblink;

imt i'j;char str[601;i -iblink-l;j - wire(il-1;ceov (0. 2, 3. 6,0.0).sprintf(str, "Model contains Ild wires, with Ild segslent3s., nwires. nsegs);charstr (str);como(0. 2,3. 35, 0.0);sprintf(str, "You have selected wire Old, segment Old", jwire~l), iblink);

charstr )str);cmov(0.2,3. 1.0.0);sprintf(str, " (this is segment Old of Ild on TAG number Old).",

Jseq(ib.i3egs(jj,itagsjjI):

c harsti

(str);

Page 35: High-Performance Visualization Applied to Computational

cleov)0.2,2. 85. 0.0);sprintf(str, -Wire endpoints are: (1.2f, 1.2f. 1.2f),",

bgnwiret jI 10) .gnwir.~) (1).bgnwire j) (2));charstr )str);cleov(0 .2, 2. 6.0.0) ;sprintf~str, " 11.2f, 1.2f. 1.2f).",

endwirelj))0).endwire~j))1).endwire~j)(21);charsti )str);cmov)0.2,2.35,0.0);sprintf~str. "Segment endpoints are: (1.2f, 1.2f, 1.2f),",

bgnnode(i) (0) .bgnnode~i) (1) .bgnnode~i) (2));Charstr )str);crmov(D.2,2. 1,0.0);sprintf~str. - (1.2f, 1.2f, 1.2f).",

endnode) ii (0) endnode~i) (1) ,endnode~i) )21);charstr(3tr);cmov 0. 2, 1.805,0.0):sprint! )str, "Segment Length = .2f meters", segs(ij);charstr(str);cmov)0.2, 1.6.0.0);sprint! )str, "Segment Radius = 1.3f meters", rads~i));charstr )str);ceov)0.2. 1.35,0.0):sprintf(3tr. "Segment to Radius Ratio - 1.2f", srrat~ij));charstr~str);cmov)0. 2, 1. 10. 0)if )datati) (3) -- 0)

sprint! (sir. "Both ends of segment are connected.");if )datai)i((3) -2)

sprint! )str, "One end of segment is connected.");if (datali))31 -= 4)

sprintf~str. "Neither end of segment is connected.");charstr )str);cmov)0. 2, 0.85, 0.0);sprintf)str, "Frequency )14H): 1.2f',freq);ýharstr~str);cmov (0.2. 0.6, 0. 0)sprintf)str, "Current on segmen~t )real~imag): (1.4!. 1.40)",

rcr )i) *icri) icherstr )str);cm.A')0.2, 0.35,0.0);sprintf)str, "Current on segment )mag~phase): (t.4!. SAW!)"

charstr (sir);mr1,atiH

'hsvlrgb converts from hsv to rgb colors. It assumes that*s and v both equal 1. This can be easily changed in the*future. Result is put into global variable rgbcol(31.

void hsv2rgb~float hue)

float h~s~v,f~p~q~t;i',t j;

3 = 1.0;V 1.0;h hue/60;j h;I h-j;

q v" I(.W

t v*- 1 *( - ) )

switch )j)

case 0:rgbcol )0)"v*255;rgb-.ol)1)=t*255;rgbCo))2)=p' 255;break;

case 1:rgbcol)0)-q'255);rgbcoltl)"v' 55;rgbcolf2(=p'255;break;

* case 2rgbcol (0) p*255;rgbc~olil1) v' 255;rgbcol)Zhýt*255;break;

rq~~)q255;

,as- 4:rqgbcol (01 t '55;rqbcol(I- (2 255;rghcolf12) "v*255;break;

CAse 5:

rqbcs.1 I I I pl 2',5,

B-9

Page 36: High-Performance Visualization Applied to Computational

rgbcol(2]-q*255;break;

/P drawscene* drawscene performs all drawing. Scene is cleared and* entire scene is redrawn each time called. House input

is used to change polarview viewing transformation.

* The position of the cube is fixed.

voiddrawscene(short dxr, short dxt, short dxz,

short dyr, short dyt, short dyz,long data choice, long trans choice, long iblink,short buffer(), long hits, Boolean picking, long do-win)

short azimuth, incidence, fovy;float cdr, azi, inc, hue. xstep;float valmax, valmin;int i;unsigned precision;

static long whitecol[) 1 255, 255, 255 I:static long blackcol[I - 0, 0, 0 ):static long redcol() - 1 255, 0, 0 1;static long orangecolli - 255, 63, 0 1;static long yellowcol4) - 25-. 255, 0 4:static long greencol[] - 0, 255, 0 };static long cyancolli = 1 0, 255, 255 };static long bluecol) = 0, 0, 255 );static long newbluecol(4 - 64, 0, 64 |:static long violetcoll] 4 255. 0, 255 1;static long greycol[l - 192, 192, 192 };static float vboxl131 - 1 0.1, 0.2, 0 );static float vbox2[3] - ( 1.3, 0.2, 0 1;static float vbox3(3] - 1.3, 1.1, 0 1;static float vbox4[3] - 0.1, 1.1, 0 1;static float vboxSt3S - 1.3, 0.5, 0 4;static float vbox6[3j - 0.1, 0.5. 0 1;static float vbox7[3- 1 1.6, 0.2, 0 4;static float vbox8(3] - 1.6, 0.7, 0 1;static float vbox9(34 - 0.1, 0.7, 0 1;static float vl3] = 0.2. 0.9. 0 }:static float v23] =3 0.4, 0.9, 0 4;static float V131 1 0.2, 0.8, 0 4:static float v4(31 = 0.4, 0.8, 0 4;static float v5[3) 1 0.2, 0.7, 0 1;static float v6(31 ( 0.4, 0.7, 0 1;static float v3J - 1 0.2, 0.6. 0 );static float v8131 - 1 0.4, 0.6, 0 4;static float v9(31 - 1 0.2, 0.5. 0 4;static float v10131 - 0.4, 0.5, 0 4;static float vl(3}) - 0.2, 0.4, 0 );static float v1213] = 0.4, 0.4, 0 4;

static float v13131 = 1 0.2, 0.3, 0 1;static float v1413] - 0.4, 0.3, 0 4;

char text(801;

winset(do win):c3i(blackcol);if (picking -= FALSE) clear)):

cdr _ MFPI/1800.0;fovy 4 450 + dyz;if (fovy < 10)

fovy - 10;else if (fovy > 1790)

fovy - 1790;

azimuth - dxr * 5;

incidence - dyr * 5;

if (trans choice -- 2)

azi - cdr'azimuth;inc = cdr'incidence:tx = (dxt'fcos(azi) - dyt*fcos(inc)*fsin(azi))/100:ty - (dxt-fsin(azi) * dyt'fcos(inc)*fcos(azi))/100;tz - (dyt'fsin(inc))/100:

perspective(fovy, 5.0/4.0, 1.0, 9.0);

if (picking -- FALSE) czclear(OxOOOOOO, zval);pushmatrixo); I* save ModelView matrix by pushing and duplicating I/

polarview(5.0, azimuth, incidence, 0);/" viewing commands premultiply the ModelView matrixc3i(whitecol);

pushmatrim));translateltXty,tz);

B-1O

Page 37: High-Performance Visualization Applied to Computational

wmnodel(data-choice, iblink);popmatrixo*c3i (greycol);

if ((picking -- FALSE)SA(draw axes -- TRUE)) axes();popmatrixo; 1* restore ModelView matrix by popping

1"change projection to ortho2 to display text in 2D

ortho2)0.0. 5.0, 0.0, 4.0);linewidth (2);if (data-choice -- 4)

0make wire connections key

bgnclosedlineo;v3f (vboxl);v3f(vbox7);v3f(vbox84(vlf~vbox9);

endclosedlineU;

sprint f(text,"WIRE CONNECTIONS");cmov(0.2, 0.6. 0.0):charstr~text(;c3i )newbluecol(;bgnline((;

v3f~v9);v3f(VlO);

endline))c3i (whitecol)-sprintf (te"Both ends r,. ected");cmov(O , - 0.0);char' r' .0.;

(ýi ine ();v3f~vll);v3f~vl)2(

endline));c3i(whitecol);sprintt (text."One end connected");cmav)0.5, 0.4. 0.0);charstr~text);c3i (orangecol):bgnlineo;

v3f(v13(;v3f (vii):

endlineo;c3i (whitecol);sprintf (text,"Neither end connected");cmov(0.5. 0.3. 0.0);charstr (text);

eIe

if ((data-choice < 8)) (ata-choice == 1) (((data choice 12)

precision = 2:,if (data-choice - 1

valmin - segmin:valinax - segmax;

if (data-choice -- 2)

precision - 3;valmin - radmin;valmax - radmax;

if (data-choice - 3

valmin - armfin,valmax - srmax;precision - 0;

if (data choice == 5

valmin = rcrlain;valniax - rcrmax;

if (data-choice -= 6)

vellum - icrmin;valniax - icrinax;

if (data-choice -- 7)

valmiin - ccinin;

valmfax - mcrumax;

B-11

Page 38: High-Performance Visualization Applied to Computational

if (data-Choice -- 11)

valmin - 0..valmax - zfldaax;

if (data-choice -- 12)

valmin - 0.;vaimax - fidmax;

if (valmin -vaireax)

bgnclosedlifle I;v3f (vb~oxl) ;v3f Ivbox2);v3f(vboxS);v3f(vbox6(;

endclosedlineoI;

if (data choice -=1) sprintf(text,"SEGNENT LENGTH. METERS");

if (data choice ==2) sprintf(text,"WIRE RADIUS, METERS");

if (data choice -3) sprintf(text,"$EGHENT TO RADIUS RATIO");

if (data choice 5)S sprintf(text."REAL COMPONENT OF CURRENT");

if (data choice -- 6) sprintf(text,"(H.Af COMPONENT OF CURRENT");

if (data choice -=7) sprintf(text,"KAGNITUDE OF CURRENT");

if (data choice 1- 1) sprintf(text,2Z-COMP OF HEAR FIELD, VOLTS/H");

if (data choice -- 12) sprintf(text,"TOTAL NEAR FIELD, VOLTS/H");

cmov(0.2,ý 0.4, 0.01;charstr (text);c3i (newbluecol);,bqnline(),

v3f(vl3(;v3f(vl4);

endline));c3i (whitecol);sprintf (text."16.-f", precision, vaismin(;

cmov(0.5. 0.3, 0.0);charstr(text(;

else

bgnclosedlineU;v3f (vboxl):v3f(vb~ox2(;v3f Ivbox3);v3f )vboxl(;

endclosedline((;

if (data choice -- 1) sprintf(text,"SEGMENT LENGTH, METERS");

if (data choice 2) sprintf(text,"WIRE RADIUS, METERS");

if (data choice 3) sprintf(text,"SEGMENT TO RADIUS RATIO");

if (data choice -"5) sprintf(text,"REAL COMPONENT OF CURRENT");

if (data -choice 6) sprintf(text,"IHAG COMPONENT OF CURRENT-);

if (data _choice =7) sprintf(text,"MAGNITUDE OF CURRENT");

if (data choice 1- 1) 5printf(text,"Z-CONP OF NEAR FIELD. VOLTS/N");

if (data choice -"12) 5printf~text,"TOTAL NEAR FIELD, VOLTS/N");

cmov(O.2, 1.0, 0.0);

charstr (text);!5printf (text,"16.-f to 16.-f", precision, valmin, precision,

valmin+)valwax-valmsif)/7(;

cmav(O.5, 0.9, 0.0);charstr(text(;sprintf (text,"96.-f to %6.-f", precision, valmin+(valmax-valmin)/7.

precision. valmin*2'(valmax-valmifl)/7);

cmov(0.S. 0.8, 0.0);charstr(text)(:sprintf (text,"16.-f to 16,-f", precision. valiein+2-(valmax-valmin)/

7,

precision, valmin+3' (valmax-Valmin(/7(;

cieov(0.5. 0.7, 0.0);charstr (text);sprintf (text,"16.-f to 16.-f", precision, valmin+3'(valsiax-valmin(/

7,

precision, valmin+4 (valmax-vaimin(/7);cisov(O.5. 0.6, 0.0);charstr (text);

sprintf (text,"16.*f to 16.*f", precision. valsiin+46(valmex-valmin)/

7,

precision, valeineS' (velmax-Valmin)/7);

cmov(O.S, 0.5. 0.0);charstr (text);sprintf (text,"16.-f to %6.-f", precision, valmin+5-(valmax-valmin)/

7,

precision, valmin*6 (valmeax-valmin(/7(;

ceovlOS5, 0.4, 0.0):charstr(text(:,sprintf (text,"16.-f to 16.-f", precision, vsaein.6-(valmax-valmin(/

7,

&-12

Page 39: High-Performance Visualization Applied to Computational

precision, valmin+ (valmax-valmin))n;cmov(0.5, 0.3, 0.0);charstr (text):if (data-choice < 8)

c3j )newbluecol);bgrnline 0

v3f (vl);v3f(v2);

endlinefl;c3i (cyancol);bgnline U;

v3f (v3);v3f(v4);

endlinefl;c3i (greencol);bgnline));

v3f~v5);

v3f~v6);endlinel))

bgnline U;v3f(v7);v3f(v8);

endlinefl;c3i (orangecol);bqniine)):

v3f(v9);v3f(vlO);

endlineo;c3i~redcol);bqnlinei);

v3f (vli);v3f (viZ);

endlineo;c3j (whitecol);bgnline));

v3f(vl3);v3f (v14);

endline));c3i (whitecol);

else1'near fields color key

c3i )newbluecol);rectf(0.2. C.9, 0.4, 0.95);c3i(cyancoi);rectf (0.2, 0.8, 0.4, 0.85);c3i(greencoi);

rectf(0.2. 0.7, 0.4, 0.75);c3j (yello.col);rectf(0.2, 0.6, 0.4, 0.65):c3i(orangecol);rectf(0.2. 0.5, 0.4. 0.55);,3i )redcol);rectf(0.2. 0.4, 0.4, 0.45):c3j (whitecol);rectf(0.2, 0.3, 0.4. 0.35);c3i (whitecol);

if (data-choice -i1)

if (zthresh <= 6)

sprint f(text, "THRESHOLD CUT AT 16.2f VOLTS/H". zthresh-valm.a/7.);

else if (zthresh == 7)

sprintf~text,"THRESHOLD CUT AT HER? (16.2f VOLTS/M)", herp);

else if (zthresh -8)

sprintf~text."THRESHOLD CUT AT HERO (16.2f VOLTS/M')", hero);

cmav)O.2, 3.85, 0.0);charstr (text):sprintf~text,"CLICK OH MIDDLE MOUJSE TO CHANGE THRESHOLD");cjnov)S.2, 3.7, 0.0);charstr~text);sprintf~text,"FREQUEHCY 4.)-f MHz". freq);cmov(0.2, 3.55. 0.0);charstr (text);

if (data-choice -- 12)

if (tthresh <- 6)

sprintf (text, "THRESHOLD CUIT AT 16.2f VOLTS/N", tthreah-vaimax/7.);

else if )tthresh =-7)

B-1 3

Page 40: High-Performance Visualization Applied to Computational

3prjntf(text,"THRESHOLD CUT AT HERP 116.2f VOLTS/H)". herp(;

else if (tthresh -- 8)

sprintf (text, "THRESHOLD CUT AT HERO (16.2f VOLTS/H)'. hero);

cmov(0.2, 3.85. 0.0);charstr (text);sprintf(text."CLICK OH MIDDLE HOUSE TO CHANGE THRESHO!LD");cenov(0.2, 3.7, 0.0);charstr(text):sprintf(text,"FREQUENCY - I.If MHz", freq);cmov(0.2, 3.55, 0.0);charstr(text);

if (data-choice <= 8)

sprinltf(et "USE MIDDLE MOUSE TO SELECT A WIRE SEGMENT");cov02, 3.85, 0.0);

charstr (text);

if ((data-choice >- 5)&R (data_choice <- 8))

3 printf~text,"FREQUENCY - .If MHz", freq);cmev)0.2, 3.7, 0.0);charstr (text);

if ((data-choice == )I))data_choice - )1))data Choice -~10))

if (data choi-e 9)

sprintf(text,"MAX MAGNITUDE: 16.2f", ethinax);cmov (0.2, 3.85. 0.0);charstr (text);sprintf~text,"FREQUENCY = 1.1f MHz",. freq(;cmov)O.2, 3.7, 0.0);charstr~text(;

if (data-choice -10)

sprintf~text,"MAX MAGNITUDE: 16.2f", ephmax);cmov)0.2. 3.85. 0.0);charstr (text) Isprintf(text,"~FREQUENCY I .If MHz". freq);cmov)0.Z, 3.7, 0.0);charstr (text);

sprintf(text,"PHASE");cmov(0.2. 1.0, 0.0);charstr~text);for (i-0; i<30; i++)

hue - 360. -i6-.

hsv2rgb~hue);c3i (rgbcol);xstep = 0.2 + i - .03;rectf~xstep, 0.7, xstep+.03, 0.85);

for (i-0; iC30; i4.(

hue = 180. - i6-.

hav2rgb(hue);c3i )rgbcol);xstep = 0.2 + i - .03;rectf )xstep,0. 5. xstep+. 03, 0.65);

c3i (whitecol);

s1printf (text,"-180');c.ov0.2.0.9, 0.0);charstr(text(;3printf (text, "0");ceov)0.2. 0.4,0.0);charstr~text);sprifltf (text. "0");,cmov(I.

0 6,0.9,0.0):*

charstr (text);3printf(text,"180"(;eeov (0 .98, 0. 4, 0.0);charstr~text( I

c3i (whitecol);if (trans-choice -- 1)

sprintf (text,"LEFTMOUSE ROTATES: (15d,15d,14d,""-15. Zf,15. 2f,15. 2f (,

azimuth, incidence, fovy. tx, ty, tz);

if (trans-choice -- 2)

sprint f(text,

B-A1

Page 41: High-Performance Visualization Applied to Computational

Tq.

ti 16 1 t4

FP .4

.K I';t $

oo t I

OF m if o I

0-0. 4

.-. *.B-15

Page 42: High-Performance Visualization Applied to Computational

if((etpfile - fopen(etp-file,"r")( -- (FILE*nO)

pr intfC'\n\t\t File Is could not be opened. \n", etpý_file);ex it :

i - 0:iphis - 0:ithetas - 0;

fscanf(atmfile, "Is", line,fscanf(atmfile, "Is", line):fscanf(etmfile, "if , If *If , if , If , If",

amiuneag, &ethatax, &a, 4b, rc, 6d):fscanf(etmfile, "if , If ,If", 4mag. &phi, (.theta):oldtheta - theta;oldphi -phi:while ((mag >-1.231((mag <-1.24(II(phi > -1.231(I(phi c -1.24)

(((theta > -1.231) ((theta < -1.24))

if (theta > oldtheta( ithetas-.:if (phi > oldphi) iphist";if (theta < oldtheta( ithetas - 0;if (phi < oldphi( iphis = 0;ethdatafiphisl lithetasj [0) - 2"maq~fcos(cdr~theta)"fsin(cdr~phi)Iethmax:ethdata[iphis! [ithetas) [1[ = Zisag~fsin(cdr~theta)*fsin(cdr~phi(/ethxsax:ethdata(iphis) lithetasl [2) - 2"mag~fcos(cdr'phi)/ethmax:

oldtheta - theta:oldphi -phi:fscanf(etsifile, "If , If , If", Lmag. &phi, &theta);

fclose (etmfile(:npts 1;nphis -iphis + 1:nthetas - ithetas + 1:fscanf(etpfile, "Is", line):fscanf(etpfile, "Is", line);fscanf(etpfile, "If , If , If *If ,If ,If", &a, &b, 4c, 4d, &e, 6f(:for (1=0; 1 < nthetas; i++)

for (J-0; j < nphis:. j++)

fscanf(etpfile, "If *If , If", &phase, &phi, &theta);/*put phase between 0 and 160/

while (phase < 0.0) phase phase + 360;while (phase ) 360.0) phase =phase - 360:ethphase~jJ[iI = phase:

felose (etpfile(:*eth_ initialized - TRUE;

/*initialize the S-phi component data "

static void initeph(void(

float a, b, c, d, e, f;float rag, phase, phi, theta, minmag, oldphi, oldtheta;float cdr:mnt i. j, iphis, ithetas;char line[70l:cdr - M P1/180.0:if((epmfile - fopen(epm~file,"r")) -= (FILE*)0(

print! ("\n\t\t File Is could not be opened. \n", epe_ file):exit 0;

if((eppfile - fopen(epp-file,"r"(( -- (FILEI)O)

print! ("\n\t\t File I3 could not be opened. \n", epp-file):exit ((

i - 0:iphis - 0;ithetas - 0:fscanf(epnfile, "Is", line):fscanf(epmfile, "Is, line);fscanf(epaafile. "If , If *If , If , If , IfV,

aminisag, gephisax, La, &b, &c, ad):fscanf(epwfile, "if , If ,If", Lmag, &phi, &theta);oldtheta - theta:oldphi - phi:while ((sag > -2.21((((maq < -1.24(fl1phi ) -1.231)))(phi < -1.24)

(((theta)> -l.231(((theta < -1.24))

if (theta > oldtheta( ithetas++;if (phi > oldphi) iphis++;if (theta < oldtheta( ithetas - 0;if (phi < oldphi) iphis - 0;ephdataliphisJ (ithetag) 10) - 2"mag~fcos(cdr-theta("fsin(cdr-phi(/ephsmax:ephdatafiphisllithetasl(1) - 2"eag-fsin(cdrttheta('fsin(cdr-phi(/ephmax;

B-16

Page 43: High-Performance Visualization Applied to Computational

ephdataliphis) ithetas) (2) = 2*mag-fcos~cdr*Phi)/OPhmSGC

oldtheta - theta;oldphi - phi;fscanf~epmfile, "if , If , if", gmag. &phi, &theta):

fclose~epIofilOL;npts -:nphis iphis + 1;nthetas - ithetas + 1;(scant )eppfile, "is", line);

fscanf~eppfile. "is", line);

fscanf~eppfile, "f*if , IfIf *If *If *if", &a, 6b, &c, &d, 4e, at):

for )i-0; i < nthetas; i++)

for )j-0;* j < nphis: j++)

fscanf~tppfile, "if , If IfS", &phase, &phi, atheta);

/put phase between 0 and 360 *Iwhile (phase < 0.0) phase =phase + 360;while (phase > 360.0) phase =phase - 360:ephphaselj)(i) - phase:

fciose(eppfile);eph initialized - TRUE:

/initialize the near field data '

static void initfld~void)

float x, y, z, stid, fid;mnt i, j;if))fldfile - fopen~fld~file,"r")) == FILE-)0)

printf)"\fl\t\t File Is could not be opened. \n", fid file);

exit)):

zflde'ax 0.;flda'ax -0.;fscanf~fldfile. "Id", anflds);

for Ui-C; i < nflds; i+-)

fscanf~fldfile, "if if If If If", ax, sy, az. azfld, arid);

if )zfld > zfldzsax) zfldtaic- zfld:if ((3d > fidmax) fidinax = fld;

fldpnts~i) (0) )x-xshift~lmscale;fldpnts (i) (1) - (y-yshift)*mscale;

fldpnts~i( (21 - (z-zshift)pmscale;zfiddata~i) =zfld)100.;fiddatafif fldIOO0.;

for (i-0; i < nflds; i++)

tfldpnts~i) (0) - fldpnts~i) (0);

tfldpnts~i)))) - fldpntsfi))0);tfldpnts~i) 12) = fldpntsti) )2)+tlddata~i)/fldmflK/100.ffiscale:

zfldpntsli()O) - fldpnt31i))0);zfldpntsti))l) = fldpntsji))l);

zfldpnts~i)(2) - fldpnts(i) )2)+zflddata~i)/zfldemaX/100.Cmscale;zspheresti) (0) - fldpntsfi)(0);zspheres(il()l - fldpntsti))l);zspheresli)(Z) = fidpnts(i))Z);tspheresli))O) - fldpnts~i))Ol;tspheresli((1) - fldpnts~i)))L;

tspheresti( (2( - fldpnts~i) (2);

zspheres(i) (3) = zflddata(i)/Z-fldmax/400A.flscale;tspheresti))i - flddatati)/fldmax/400.Smscale;

fclose~fldfile);fid-initialized TRUE:

r* initialize the models verticesstatic void initeodel (void)

float a, b, c, d, e, I', xpcr:

mnt i, itag. iseg. irad. isr, icon. ircr, iicr, iecr, iw, is;

fscanf~qeofile, "If", afreg):if ((req < 3.) herp = 632.5;else if )freq < 30.) herp - 89

7.ffreq;

else if ((req < 300.) herp 63.2$;

else if ((req < 1500.) herp 3.6$ *sqrtifreq);*

else herp - 141.4;if )freq < 1.) hero = 100./freq;else if ((req < 3.7) hero = 00./pcw(freq,3.);else if ((req < 10.) hero =2.;

else hero - 0.5'pca.(freq,.6.);fscanf~geofile, "td Id", anwires, 6nsegs);

fscanf~gqeflfe. "if if", aslxsmin. csxmaa);fscanf~qeofile. "if If", asiyiin. asysiax):(scant (geofile. "if If", atazein. 6szmax);

B-i17

Page 44: High-Performance Visualization Applied to Computational

fscanf(geofile, "If If", &xshift, &yshift);fscanf(goofile, "If If", Lzshift, (Luscale);fscanf(geofila, "if If", &segmin, &segiaax);fscanf(geofile, "If If". Aradmin, sradmax);facanf(geofile, "If If", 6srmin, &srmax);facanflgeofile. "if If", &rcrmin, &rcrmax);fscanflgeofile, "if If", &icrmin, Licrmax);fscanf(geofile. "if If", &mcrmin, Lnlcrmax);

for Ui - 0; i < nwires; i++)

fscanf(geofiie, "Id Id If If if if If If", &itag. &isa9 , 4a,Lb, Ac, &d, 4e, &f);

itags(i] - itag;isegsliJ - iseg;bgnwire~i[(0[ - a;

bgnwireli)[1 - b;bgnwireliiH21 - c;

endwirelil(03 d.

endwire i l[ I e;endwire[i[[2l f

for (i - 0; i < nsegs; i++)

fscanf(geofile, "Id Id Id Id Id id Id Id Id If", &is, Liw,Liseg, Lirad. Lisr, Licon,Lircr, &iicr, Limcr, &xpcr);

jseg~i[ is;jwirelil i w.:dataliH[0l = iseg;data[i)(l[ - irad;data (ii [2) - isr;data(ij(31 - icon;datatil(41 - ircr;,dataliiH5) = iicr;datal] 63 - imcr;xdatalil - xpcr;fscan , (eofile, "If If If If If If", La, Lb, Lc, Wd, Le, Lf);segstil a;rads[i) b;srrat [i) =c;

rcrtil - dicr~il - emcrji) - ffscanf(geofile, "if If if If If If", &a, &b, &c, id, se, if);bgnnodel[[0 - a;

bqnnode~i)(l[ - bbgnnodeti[ [21 -c;

endnode~iil(01 - dendnodefil[1[ -=eendnodeli)2 - f;bgndata[i][0 -0 (a-xshift)-mscale:bgndata[i[ [11 - (b-yshift)lmscale;bgndata(i[ [21 - (c-zshift)'sscale;enddata[i[ [0) - (d-x.9hift)*mscale;enddata(i[ [11 - (e-yahift)-macale;enddataii) 121 - (f-zshift)1mscale;

fcioselgeofile);model-initialized - TRUE;

/* wireframe NEC model/void wuodel~long data_choice, long iblink)

int i. j;float h,s,v~f,p,q,t~val;static float origini) 1 0, 0, 0 Istatic long redcol[I - 255, 0, 0 Istatic long orangecol(I - 1255, 63, 0 1;static long yellowcoll[ - 255, 255, 0 1;static long greencolli - I0, 255, 0 3;*static long cyancoill - 1 0, 255, 255 1;static long bluecoill) - 1 0, 0, 255 1;static long newbluecol[J - 1 64, 0, 64 1;static long violetcol([ 1 255, 0, 255 1;static long greycoli[ 1 192, 192. 192 1;static long purpicollI - 255, 0, 176 1;static long wthitecol(j 1 255, 255, 255 Ilinewidth (2);

if (! model initialized)initmodel I;

if W1 eth_ initializedl&L~data_choice -- 91)initeth 0 ;

if W( eph_initialized)LLdata_choice -- 10))initeph U;

if ((! fid initialized)LL(Idata choice -- 11)111(data _choice 12)))initfldOT;

/- draw segments 'if [data-choice < 9)

B-18

Page 45: High-Performance Visualization Applied to Computational

for Ii - 0; i < nsegs; it+)

if (data-choice <8)

if (datatiiidata choice-li = 0)c3i(newbluecol):

else if (datatiij data-choice-li 1= )cli (cyancol);

else if (dataii)(data~choice-li = 2)cli(greancol):

else if (datati, (data~choice-li = 3)cli (yellowcol);

else if (datali( [data_choice-li = 4)cli (orangecol);

else if (data~iiidata_choice-li = 5?cli~redcol(;

else if (dataliiidata~choice-li = 6)c3i (whiteci);

if (data-choice -- 8)

hsv2rgb(xdata (ilicli (rgbcoli;

loadname ii.1);

if Ii !-iblink-))

bqnlinefl;vlfibgndata iii);vIE (enddatalil);

endlinci);

if (data-choice == 9)

for (i - 0; i < ophis-1; i-+)

b~gngstrip((for (j - 0; j < ntheta,; j+-)

hsvlrgb(ethphase~ii iji);cli (rqbcoli;vIE (athdata~iii jI);hsv2rgb(ethphaseiifl( fli);cli (rqbcol):vIE (ethdata~i~li iji);

endqstrip))

if (data-choice ==10)

for )i = 0; i < nphil 1; i-+)

bqnqstrip.))for )j - 0; j <rithetas; j**)

hsv2rqb~ephphasefi) jIi);cli )rghcol);vlf~ephdatai( i~jj);hiv2rgb~ephphase~i+Il ji);cli (rqbcol):vlf~ephdataii~li (31);

endqstripo)

if (data-choice -- 11)

cli(greycol);for )i - 0; i < segs; i-'(

bgnline((;

vlf(enddatzati)iendiineO:

for (i - 0; i < nflds,; i+-)

Val - zflddata~iI/zfl105n07./10

0.;

if (o(val >- zthresh(&&)zthresh < 7))))((zflddataiii >- herp(100.P)&4zthresh *-7))1

((zflddata~ii >- herc9(00.)Wazthresh ==8)))

if (Va1 < 1.)

c3i (newbinecol);bqnpoint;

vlf(fldpnts ii];endpoint));

B-19

Page 46: High-Performance Visualization Applied to Computational

else

initx - fldpnts~i))O1 - mscale/2.;inity - fldpnts~i)[1) - mscalel2.;initz - fldpnts~i) 12) - mscale/2.;if (val < 2.)

C3i1(cyancol);num - 2;

else if (Val < 3.)

c 3i (greencol);

null - 3;

else if (Val < 4.)

nunl

else if (val < 5.)

C 3i (oranqecol);null - 7;

else if (Val < 6.)

C 3i~redcol);n= - 9;

else

c 3i (lhitecol);

step = mscale/2.)/((num-1.)/2.);for )inx =0., inxc < null; inx++)

fpnt[0) initx - inx * step;for )jnx 0; jnx < null; jnx++)

fpnt~l) -inity + jnx - step;bgnpoint));for )knxc 0; knx < null; knx++)

fpnt[2) initz - knx step;v3f~fpnt);

endpoint));

if (data-choice -- 12)

c 3i Ureycol);*for )i - 0; i < nsegs; i++)

bqnline));v3f~bgndata~j));

v3f~enddata~ij);endline));

for )i - 0; i < nflds; i+e)

Val - flddatafil/fidmaxs7./100.;if (val >- 6.) c3i~whitecol);else if (Val >- 5.) c3i~redcol);else if (Val >- 4.) c3i~orangecol);else if (Val >= 3.) c3i~yellowcol);else if (val >- 2.) c3i~greencol);else if (val >- 1.) c3i~cyancolj;else c3i~newbluecol):if (((val >- tthresh)4&(tthresh < 7))))

))flddatati) >- herp*100.)&A)tthresh -7))))

))flddete~i) >- heroH100.)&&)tthr~sh -=8)))

bqnline());v3f~fldpnts~il);v3f~tfldpntsfil);

endline));

if (val < 1.)

bqnpoint));v3f~fldpnts~il)

endpoint));

elsesphdra.(tspheres Ii));

linewidth)2).*

B-20

Page 47: High-Performance Visualization Applied to Computational

Appendix CSOURCE CODE FOR view-mom

* vewý NicS. c* view nic displa Ys a net h'.1 of soets nat I Ii.

linciude ct di ,,h,1unclude marnah h>

*lefine BUFSIZE 50

function prototypes

void initial ize.il

void pr inth Its(lIOng I bl ink, sh-r r~h- IWr uevoid hsv~rgb(float h );void drawscene(short der, short dxT, short dxz, short dxs,

shoIrt dyr, short dyt, short dye, short dys,

long data cho-ice, loniq trans choice, long display ride, long iblink,long do win);

void axeslvoid);void initruatrix(voidi;void monirmatrie(lonq data_ :hoicc, lt~nj displlay mole, long iblink);PILE Iscrfile;char file namefh(1;chartcifie2l

static char mcaxJj ".o

mnt nncdesx,nnodesy;float moemag91lOO0j(000, mophaso[000IllOO01;

float zscale, sicexax, stomiin;long rghcol [ 31;Boolean picking rcow FALSE:Boolean picking cvi FALSE;

static float ta, ty, tz;/. wind-a id's '/lonng moms win, ph win, cur win, data win;static char momwin~name!! - "MOM Matrix";static char ph win name!! = "MoM Matrix with Phase':st at ic char data~win-name!! = 'Pick Correlation Info";long "max, ymax, zeal;

U initialize* The initialize subroutine poýsitions the windowi and -specifies* its future constraiints. Graphics -rofiqurat ions are set and* the event queue is ntalzd

voidiniti slice (void;

float mieal, siaMao, -1~c,.r;int i, 7;

printf Q' Enter fi Ic nanm:caf"",file_.nie):

strcpy(moei file, file _nan"-;;strcat(momnfile,cmcni;if ((momfile - fopenleom fie") (PILE-lO)

printf{"\n\t't Pile tn could no-t lie opened. \n", mom file;;exit));

cdr M-P1/180.0;M,anmX 0;G.ticttiin =1000010:fscanf(ncemfile, "Id Id", fn-o'lex, finno-icy);for (1-0; i snodless; iii)

for )j=0: j , snodesy; j-i;

fscac; feafile," It l', If 4real, imica0 )sag -fsqrt Unreal * nicl ' Mimag mima4);Phase f- a~m ; t-ls);ph,-se phase'.:dr;if (stag 0ommAx) nrru -er

if stg moiin nme?--to

while (phase ' .nU ph 's ph-s j(hi;while (phase 160.0) ph,- - phase 160;

slcphsei!(i -phse;

for (I=0; i nt'zlea; i+,

C-1

Page 48: High-Performance Visualization Applied to Computational

datali)(j)[O) - 2.0"i/(nnodesx-l) - 1.0;datali)ij)(1) - 2.0Oj/(nnodesy-1) - 1.0;data(ilI)][2) - (floqlO(momjn/mouaaqiIj)/floglO~moil/oemaa));

fclosewmomfile);

xmax - getgdesc(GDXPMAX):ymax - getgdesc(GD_YPMAX):

zval - getgdesc(GDZMAX);

minsize(xmax/1O, ymax/10);maxsize(max-200, ymax-160);

keepaspect (amax, ymax);mo• win - winopen("**);

wintitle(mom win-name);winconstraintsI);

winSet(momrwin);zbuffer(TRUE);

doublebuffer();RGBmode();gconfigo;

shademodel(GOURAUD);mmode(MVIEWING):

qdevice(LEFTMOUSE);qdevice(MIDDLEMOUSE);

qdevice(RIGHTMOUSE);qdevice(ESCKEY);tie(LEFTMOUSE, MOUSEX, MOUSEY);

/ end initialize)) /

/" main

main calls initialize, then goes into a loop. Within the loopd drawscene is called and events in the event queue are processed

* until user exits (by pressing ESCAPE or through the window manager).* Mouse input is passed to drawscene when the left mouse button

is held down.

voidmain(void)

Boolean exitflag - FALSE;

Boolean redrawneeded = TRUE;Boolean drawmom - TRUE;Boolean draw-ph = FALSE;Boolean draw data = FALSE;

short value;short buffer[BUFSIZE);long row hits = 0;long colhits = 0:short deltax, deltay;short row, column:

long dev;long choice:

long datachoice, transchoice, display-mode, iblink;long menu, datamenu, transmenu, displaymenu;

short x, oldx; / mouse movementshort y, oldy;short dxr, dxt, dxz, dxs - 0;short dyr, dyt, dyz, dys - 0;

static long whitecoll] - 1 255, 255, 255 ):static long bluecolij 1 0, 0, 255 };static long dbluecolI] - 1 0, 0, 128 1;

initialize));data choice 1 1;trans choice I .;

display_mode - 2;iblink - 0;tX - 0;ty - 0;tz - 0;

/* make the data menu */datamenu - defpup("Choose Data Window to Open/Close Itt"

"Magnitude IxslMagnitude 4 Phase %x2");/I make the transformation menu */transmenu - detpup("Choose Transformation It)"

"Rotate tx3)Translate Ix4IZom %x5)Scale Z-comp Ix6lReturn to initial state 1x7");/* make th- display mode menu -/displaymenu - defpup("Choose Display Mode Itt"

"OD %xa9lD txI012D txll");m eake the main menu */

menu - defpup("Menu It)Data Window CmITransformation Im)Display Mode Imi""Close Current Window 8x8",datamenu,transmenudisplaymenu);

C-2

Page 49: High-Performance Visualization Applied to Computational

while (exitflag -- FALSE)

if (redraw-needed -TRUE)

if(draw emrn)drawsrene(der, dat, den, des, dyr. dyt. dye. dys,

1.trans-choice, display ewe, iblink.momw win);

if (drew ph)drewzcene(der, det, den, des, dyr. dyt. dyz. dys.

2, trans -choice, display _ewe, iblink,ph~wint;

if (iblinh = 0) redraw needed = FALSE;iblink = -iblink;

while ((esittlaq = FALSE) La(qtest() 11 (redraw needed ==FALSE))

dev = gread (&value);it )dev == ESCKEY)

if (val-e I

esitflag =TRE;(E

else if (de, == REDRAW)

reshapeviewport U;redraw needed =TRUE;

else if (dcv ==INFUTCHAkIGE(

cur win =vailue;

else if )dev == RIGRTHOUSE 56 value= 1

choice dopup(eenu);if (choice >= 1)

if (rhoice ==1)

draw mom ! draw mom;if (draw-moe,)

einscre~seae/ll. ymae/ll(;eaesire(smae-200. yeas-lEO);

keepaspeor (seax, yeas);mom-win -winopen(")

wintitle~eoe win name);winconst raints

winset(. mowin);zbuffer (TRUE);

doublebuffer U;RG~eod();qconfig)(shadenodel (COURAUD);-mode )NVI EWING);

else winclose(mom-win);

if (choice =ý2)

draw ph ý .raw_ph;if (draw-ph)

einiizne~ieae/l0, yeas/ho);eassize(smas-200, yeaA-lEO);

heepaspect (seas, yeas);phwin =winiopen.")

wint ithe (ph win name);winccnstraintso

winset (ph win);zbuffer (TRUE);doubiebuffer));RG~mocleogronfigo;shadecodel (GOURAUD);meode(HVIEWING(;

else winclone(ph win);

if ((c:hoice >- 3)6&(choice - 7))trans chocec choice -2,

if (t.ranschoice '5

dimrden 0den 0;'es 5 0;dyr 0;

C-3

Page 50: High-Performance Visualization Applied to Computational

dyt - 0;dyz - 0;dys - 0;

tx 0;ty -0;

tz- 0;trans-choice - 1;

if (choice -- 8)

if (cur -win -- mom -win) draw-mom - !draw-m;if (cur--`in -- ph win) draw ph - !draw-ph;winclose(cur_"in);

if ((choice >- 9)44 (choice <- 11)) display mode -choice 9;

redraw-needed - TRUE;

else if (dev -- LEFT14OISE)

if (value)/read initial mouse x~y, which will be*next 2 events because tied to leftmouse

qread(&x);qread(&y);/now listen to all mouse x,yas long as mouse downqdevice (HOUSEX);qdevice(MOUSEY);

else/*as soon as mouse released,*stop listening to mouse x,y '

unqdevice(HOUSEX);unqdevice (MOUSEY);

else if (dev -- MIDDLEMOUSE 88 value -- 0)

/I do a pick correlation in current window1winset(cur win);1* first f~ind rowpick(buffer,BUFSIZE);picking row - TRUE,deltax - 3;deltay -3;picksize(deltex,deltay);iblink - 0;drawscene(dxr,dxt~dxz,dxs,dyr,dyt,dyz,dys,data~choice~trans choice,

0,iblink,cur-win):picking row - FALSE;row-hits - endpick(buffer);if (row-hits > 0) row -bufferl)1;

I' now find column -/pick )buffer.BUFSIZE);picking_ col - TRUE;deltax - 3;deltay - 3;picksize )deltax.deltay);iblink - 0;drawscene(dxr,dxt,dxz,dxs,dyr~dyt,dyz,dys,data choice,trans choice,

0, iblink, cur win);picking-col - FALSE;col -hits - endpick(buffer);if (col-hits > 0) column -bufferill;

if ((row-hits > 0)66(col hits > 0))

if (draw-data -- FALSE)

prefposition(xmax/40.xjuax*9/20,ymax/40,ymax*6/40);data win - winopen("'';wint-itle~data win name);winconstraints );winset(data win);singlabuffer 0;RGBmode 0;gconfig 0;shademodel(FLAT);mmode(MVIEWII4G);draw-data - TRUE;

winset(data-win);c3i (dbluecol):clear U;c3i(whitecol):ortho2)0.0, 5.0, 0.0, 4.0);

C-4

Page 51: High-Performance Visualization Applied to Computational

printhits(iblink, row, column):

else

if (draw data)

draw data = FALSE;winclose(datawin);

else if (dev == MOUSEX)

oldx ;. = value;

if (transchoice == I) dxr t dxr + (x-oldx);if (trans_choice == 2) dxt = dxt + (x-oldx);if (trans choice == 3) dxz = dxz - (x-oldx);

* if (trans choice 4) dxs = dxs + (x-olda);redraw needed = TRUE;

else if (dev == MOUSEY)

oldy = y;y = value;

if (transchoice == 1) dyr = dyr ÷ (y-oldy);if (trans choice == 2) dyt = dyt + (y-oldy);if (transchoice == 3) dyz e dyz + (y-oldy);if (trans choice == 4) dys ý dys + (y-oldy);

redraw-needed = TRUE;

I' end while exitflag FALSEand (qtest or redrawneeded FALSE) "/

I/ end while exitflag FALSE '/exit(O);

I' end main)) '/

I' printhits"P rints row, column info in data window"./

void printhits(long iblink, short row, short column)

int ij;char str(60J;i = row;j = column;cmov(0.2,3.4,0.0):sprintf(str, "This matrix has Eld rows and %Ild columns.", nnodesx, nnodesy);charstr(str);cmov(0.2,2.8,0.0);sprintf(str, "You have picked row %ild, column lid.", row, column);charstr(str);cmov(0.2,2.2,0.0);sprintf(str, "The magnitude of the matrix at this point is: 1.2f.", mommag[i](jU);charstr(str);cmov(0.2,1.6,0.0);sprintf(str, "The phase of the matrix at this point is: 1.2f degrees.", momphase(i][j]);charstr(str);cmov(0.2,1.0,0.0);sprintf(str, "The maximum magnitude in this matrix is: %.2f.", mommax);charstr(str);cmov(0.2,0.4,0.0);sprintf(str, "The minimum magnitude is this matrix is: 1.2f.", mommin);charstr(str);

/* hsv2rgb converts from hsv to rgb colors. It assumes that" s and v both equal 1. This can be easily changed in the

future. Result is put into global variable rgbcol[31."./void hsv2rgb(float hue)

float h,s,v,f,pq,t;int j;

s5=.0;v = 1.0;h = hue/60;j - h;f = h-j;p = vs(l-s(;

q - vt= s' (l-(s" (1-f)));

switch (j)

case 0:rgbcol(0(=v*255;rgbcolIll=t*255;rgbcol12)=p*

2 5 5;

break;case 1:

rqbcolj0]=q'255;

C-5

Page 52: High-Performance Visualization Applied to Computational

rgbcoli1)-v*255;rgbcol[)l=p*2

55;

break:case 2:rgbcolIO)1p-

2 5 5;

rgbcol(l)-v*255;rgbcol[21=t*255;break;

case 3;rgbcol [0) p255:rgbcol)1)=c*255;rgbcol[2) -v-255;break;

case 4:rgbcol[)0)t'255;.gbc,: )=25rgbcol[2)"v25break;

case 5:rghcol 10) -.v255;rgbcol(1~p*255;rgbcolf2hgq255;break;

0 drawscene* drawscene performs, all drawing. Scene is cleared and* entire scene is redrawn each time called. Mouse input

is used to change polarview viewing transformation.

voiddrawscene~short dxc, short dxt, short dxz, short dxs,

short dyr, short dyt, short dyz, short dys,long data choice, long trans choice, long display__mode, long iblink,long do-win)

short azimuth, incidence, fovy;float cdt, azi, inc, hue, xstep;float valmax, valmin;int i;unsigned precision;

static long whitecol)] = 255, 255, 255 1;saic long blackcol() =I0, 0, 0 1

static long redcol[j=I 25 ,03static long orangecollI 1 255, 63, 0 1;static long yeliowcolf 255, 255, 0 1;s tatic long greencol))=I 0 , 255, 0 3;

st atic long cyancol)) - 1 0, 255, 255 1;.static long hluecoll) - )0, 0, 255 1;static long newbiuecol)) 1 0, 52, 255 Istatic long violetcol)) 255, 0, 255 IstatiS long greycol)] = 192, 192, 192 1;

winsetldo win);cli chlackcol);if ((picking row == FALSE) &f (picking col FALSE)) clear));

cdr - M P1/1800.0;fovy - i50 - dyz;if (fovy < 15)

fovy - 10;else if (fovy > 1790)

fovy - 1790;

azimuth - dxr * 5;incidence - dyr *5;

if (trans-choice -2)

azi - cdr~azimuth;inc - cdr-incidence;tin - )dxt'fcos~azi) - dyt~fcos~inc)*fsin~azi))/l00;ty - )dxt~fsin~azi) + dyt-fcos~inc)*fcos~azi))/S00;tZ - )dyt~fsin~inc))/100;

parspectivelfovy, 5.0/4.0, 1.0, 9.0);

if [Ipicking row -- FALSE) 46 (picking col -- FALSE)) czclear)0x000000. zval);pushetatrix)); I' save ModelView matrix by pushing and duplicating

polarview)5.0, azimuth, incidence, 0);/I viewing commands premultiply the ModelView matrixc3i(whitecol);

pushmatr ixoII;translate~tx~ty,tz);

mceeaatrix~data_choice, display_mode, iblink);popwatrlx));c31(greycol);

if ))picking row -- FALSE) 44 )picking col -- FALSE)) axes));

C-6

Page 53: High-Performance Visualization Applied to Computational

popmatrixo; /H restore ModelView matrix by popping ./

/I change projection to ortho2 to display text in 2D

ortho2(0.0, 5.0, 0 0, 4.0);it ((picking row FALSE) && (picking col F= FALSE)) swapbufferst);

/ end drawscene)) G

.................................................................

AXES................. ................................................ /

/" three dimensional vector -typedef float vector[3);

/1 useful vectors for the axes I/static vector front - I 0.0, 0.0, 1.0);stuti: vector -ak = C '.0, u.0, -l.0i;static vector top = ( 0.0, 1.0, 0.0);static vector bottom = ( 0.0, -1.0, 0.01;static vector right - I 1.0, 0.0, 0.0);static vector left = (-1.0, 0.0, 0.0);static vector center = { 0.0, 0.0, 0.0);

/" draws a wireframe set of right-handed axes /void axes(void)

bgnline);v3f(center);v3f(right);

endline);cmov(right)0l,right[ll,right2l]);charstr("I");

bgnline();v3f(center);v3f(top(;

endline));cmov(toplO],top[l1,top(21);charstr("Y");

bgnline(;v 3f(center);v3f(front);

endline();cmov(front[0(,front1(lfront[21);charstr("Z")

/.................................I .......................................MoM MATRIX.. ...................... I.................................... I.........../

/- MoM matrix -/void mommatrix(long data choice, long displaymode, long iblink)

int i° j;short row, column;float h,sv,f,p,q,tvai;static float origin)) 0 0, 0 0.static long redcolI ) 55, 0, 0 I;static long orangecol[) = f 25', 63, 0 5;static long yellowcol[l = 1 255, 255, 0 4;static long greencol[] 1 0, 255, 0 1;static long cyancolS) = 0 0, 255, 255 4;static long bluecol)) = f 0, 0, 250 1;static long newbluecol)] =)I 0 52, 255static long violetcol 2 ;55, 0, 255static long greycol)) ) 192, l42, 192static long purplcoll( - ) 255, 0, 176 I;static long whitecol)) ( 255, 255, 255 1;if ((pickingrow = FALSE) 4& %pickingcol = FALSE))

if (displaynode == 0)

bgnpoint():for (iý0; i < nnodesx; ij.)

for (j=0; j < nncdesy; j..)

if (data choice I) hsv2rgbtdata[i)[j)[21'360.0);if (data choice 2) hsv2rgb(momphase(i)(4));c3i(rgbcol);v3f( data1i(j));

endpoint);

if (display_mode == 1)I

for (i-0; i ncriesx; i-+)

C-7

Page 54: High-Performance Visualization Applied to Computational

bgnl ineUfor (j-0; j < nnodesy; j-+)

if (data choice ==1) hsv2rgb(dat&[i((j! (2J*360.0);if (data choice ==2) hsv2rgb(inoephaseji(j(8l)c3.4(rgbcoi);v3f(datati(lj(();

endline U;

for (j-0; j < nnodesy; j++)

bgnlineU;for (i0O; j < nnodesx; i-.+)

if (data choice -1) hsv2rgb(data(ii (j828*360.0);

if (data choice -= 2) hsv2rgb(ieoephase~i(j((H;c3i (rgbcoi(;v3f(datatil (il);

endline (8

if (display mode == 2)

for (i=0; i < nnodesx-1: i++)

bgnq~tripo;for (j=0; j < nnodesy; j,+)

if (data choice 1) hsv2rqb(datajil jI (218360.0);if (data choice ==2) hsv2rgb(momphase~i( Ii));c3i (rgbcoi)v3f(datati( tjfl;if (data choice ==1) hsv2rgb(datalioll [j( (2J360.0):if (data -choice ==2) hsv2rjb(Tnomfphaseli+1JLj)(hc3i(rgbcol);

endqstrip((;

if (picking row(

for (i=O; i < nnodesx; i++)

loadname(i~l(;bgnpoint U;for (j-0; j < nnodesy; j++)

v 3f (data Ii) (i);

endpoint;

if (picking col)

for (j=O; j <nnodesy; j++)

loadname(j nO);bgnpoint (8foc (i=0; i < nnodesx; i+n)

v 3f(data~i Iji);

endpoint (;

C-8

Page 55: High-Performance Visualization Applied to Computational

REPORT DOCUMENTATION PAGE Fr~poe~ t.t4Ji*v m ct I js~e to aveta" I nuupetiporieo,inxirIudng the time tot Wterwlnang fhlUtIOiuc, £earchneiIng g siftdata wwce. gthetfing4-*:w*~. ý001ft~g- d a I ~ g v .ig t?' e mrer tonfuritibMlor Send cnometrits regarding this buden emimato otanty other aspeci of ihis CoIwecIou orif Ioreion, inciu~eS. Lpo 0 W 2* 'OtdAr -1 Vý Tee S J5%go ItLi~ sayet Oeciorate "o infuormation operations and Reopons. 12 15 Jefferson Da~s Highway, Sufte 1204, Ahlington, VA 2220240.&,, m .fe-1 Ftu, 111W.-It Pfe'aw'1u 640 i-~ Pm 7044)181) Wait"g-on. -03ti

-tVA Moes Ns-D'v 2 At PORT DATE 3. REPORT TYPE AND DATES COVERED

October 1992 Final; Oct 91 - Sep 92

5. FUNDING NUMBERSilif ;I-lTHF( )R,%ANiEF %TSU ALI7.ATIO N APPLIED TO ('OMPIJTATIONAT.

FJ.E'R )A(;NllrSPE: 0602936Noil lc~n ;r~t~ij-~ Vor~staionPRO.J: RV36121

SUl3PROJT: 82-ZFO8-.01

L. V. ti~ar~lA.~l.J W. 11twkway

~1~C AA'C'4'.'(~.i ~JA~:&i 'A 8. PERFORMING ORGANIZATION

Naval Cornemmnnd, Ctin~trOt ar.l Orcenn Surveillance Center (NCCOSC)flPTNMERityr&E Dilvision (NitaD) TR 1564San Diirgv. CA 921.52-5000)

9 ~* AL.Vf.A1t A~r AO&Z(S 10. SPONSORIN"/Ot,1rORNGAGENCY REPORT NUMBER

Naval C'im-nAr~d. C ntrol and Ocean Surveillance Center (NCCOSC)RIIT&F lDivisirm INRaD)San Diet", CA V92152-5000

~a G &gt~A.AAM~v ST 1EV2S'12b, DISTRIBUIJTON CODE

Approved for public release; distribution is unlimited.

W!PA 11 ktac~rm" ~2~W WWI

Thu investigation applied advanced visualization techniques to an existing computational electromagnetic code. The goalwa~s to demonstrate that high-performance visualization can improve the utility of computational techniques used in ship elec-tromagnetic designs.

The code used was the Numerical Electromagnetics Code - Method of Moments (NEC-MoM). The visualization platform wasa Silicon Graphics 4D workstation. Two codes were developed to do pre- and post-processing visualization on NEC-MoM.

This report lists several benefits that have resulted, or will result, from work done on this Independent Exploratory Devel-opment lIED) project.

Reproduced From

Best Available Copy

14 SUJECT EP4415. NUMBER OF PAGES

visualizaton computational electromagnetic code 57high-performance computing method of moments 10. PRICE CODE

I? SECUIT1Y CLASWJICATIO1 18 SECURITYCLASSIFICATION 10, SECURITY CLASSIFICATION 20. UMITATION OF ABSTRACTOF RPAPM OF THM8 PAWE OF ABSTRAT

UNCLASSMFED UNCLASSIFIED UNCLASSIFIED SAME AS REPORT

Page 56: High-Performance Visualization Applied to Computational

UNCLASSIFIED21& NAME OF RESPONSIBLE INDIVIDUAL 21b. TELEPHONE (bncAJdeAJM Code) 21c. OFFICE SYMBOL

L. C. Russell (619) 553-6132 Code 824

NSN 7840,01-2806600 Sm• orm (BAC2W

UNCLASSI 1 D

Page 57: High-Performance Visualization Applied to Computational

INITIAL DISTRIBUTION

Code 0012 Patent Counsel (1)Code 0142 K. J. Campbell (1)Code 144 V. Ware (1)Code 80 K. D. Regan (1)Code 82 RK J. Kochanski (1)Code 824 J. B. Rhode (1)Code 824 L. C. Russell (25)Code 961 Archive/Stock (6)Code 964B Library (2)

Defense Technical Information Center

Alexandria, VA 22304-6145 (4)

NCCOSC Washington Liaison OfficeWashington, DC 20363-5100

Center for Naval AnalysesAlexandria, VA 22302-0268

Navy Acquisition, Research & Development

Information Center (NARDIC)Washington, DC 20360-5000

GIDEP Operations CenterCorona, CA 91718-8000