<<<<<<<<<<<<<<<<<

plot3d_reader(visage) VISAGE plot3d_reader(visage)

NAME

plot3d_reader - VISAGE reader object to read plot3d files

DESCRIPTION

The plot3d_reader object reads PLOT3D formatted binary files. PLOT3D is a computer graphics program to visualize the grids and solutions of computational fluid dynamics. PLOT3D was created by NASA Ames Fluid Dynamics Division. Plot3d_reader can be used in the visualization network as a data_in to a computed_feature or data_set_filter.

PLOT3D output files generally come in pairs: the so called "grid" or "xyz" file, and the "solution" or "q" file. The xyz-file contains the coordinates that define a structured grid (see structured_grid_set), and the q file contains a scalar function (density), a vector funtion (momentum), and another scalar function (energy). (See visage_scalar and visage_vector.) The data is ordered implicitly so that there is a one-to-one correspondance between the grid points and the data.

There are many PLOT3D file formats; the plot3d_reader object supports only two. These are single grid and multiple grid formats.

Single Grid

xyz-file

i,j,k dimensions, 3 integers, 12 bytes total

x1,x2,...,xn, y1,y2,...,yn, z1,z2,...,zn grid coordinates ordered implicitly, i*j*k*3 floats, i*j*k*3*4 bytes total

q_file

i,j,k dimensions, 3 integers, 12 bytes total

fsmach, alpha, re, time mach number, angle of attack, Reynold's number, time, 4 floats, 16 bytes total

d1,d2,...,dn grid density ordered implicitly, i*j*k floats, i*j*k*4 bytes total

mx1,mx2,...,mxn, my1,my2,...,myn, mz1,mz2,...,mzn grid momentum ordered implicitly, i*j*k*3 floats, i*j*k*3*4 bytes total

e1,e2,...,en grid energy ordered implicitly, i*j*k floats, i*j*k*4 bytes total

Multiple Grid

xyz-file

m number of grids

i1,j1,k1, i2,j2,k2, ..., im,jm,km dimensions for each grid, m*3 integers, m*12 bytes total

x1,x2,...,xn, y1,y2,...,yn, z1,z2,...,zn for m grids grid coordinates ordered implicitly, m*im*jm*km*3 floats, m*im*jm*km*3*4 bytes total

q_file

m number of grids

i1,j1,k1, i2,j2,k2, ..., im,jm,km dimensions for each grid, m*3 integers, m*12 bytes total

fsmach, alpha, re, time for first grid mach number, angle of attack, Reynold's number, time, 4 floats, 16 bytes total

d1,d2,...,dn for first grid grid density ordered implicitly, i*j*k floats, i*j*k*4 bytes total

mx1,mx2,...,mxn, my1,my2,...,myn, mz1,mz2,...,mzn for first grid grid momentum ordered implicitly, i*j*k*3 floats, i*j*k*3*4 bytes total

e1,e2,...,en for first grid grid energy ordered implicitly, i*j*k floats, i*j*k*4 bytes total

fsmach, alpha, re, time for next grid mach number, angle of attack, Reynold's number, time, 4 floats, 16 bytes total

d1,d2,...,dn for next grid grid density ordered implicitly, i*j*k floats, i*j*k*4 bytes total

mx1,mx2,...,mxn, my1,my2,...,myn, mz1,mz2,...,mzn for next grid grid momentum ordered implicitly, i*j*k*3 floats, i*j*k*3*4 bytes total

e1,e2,...,en for next grid grid energy ordered implicitly, i*j*k floats,

i*j*k*4 bytes total

Besides these two file formats, the plot3d_reader object also supports the ability to read a supplemental function file. The function file, the format of which has been specified by GE Aircraft Engine, is also available in single grid and multiple grid formats. The function file provides additional scalar functions to be associated with the grid geometry. The formats are as follows:

Single Grid

i,j,k dimensions, 3 integers, 12 bytes total

nf number of functions in file, 1 integer, 4 bytes total

f11,f12,...,f1n for first function function 1 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

f21,f22,...,f2n for next function (total of nf functions) function 2 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

Nultiple Grids

i,j,k for first grid" dimensions of grid, 3 integers, 12 bytes total

nf for first grid number of functions in for this grid, 1 integer, 4 bytes total

i,j,k for next grid" dimensions of grid, 3 integers, 12 bytes total

nf for next grid number of functions in for this grid, 1 integer, 4 bytes total

f11,f12,...,f1n for first function in this grid function 1 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

f21,f22,...,f2n for next function in this grid function 2 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

f11,f12,...,f1n for next function in next grid function 1 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

f21,f22,...,f2n for next function in next grid function 2 ordered implicitly, i*j*k floats, i*j*k*4 bytes total

The plot3d_object, like other reader objects, is unusual in that it can create instances of other objects. For example, when the plot3d_reader object recieves a read! message, (if it can successfully read the file) it will create visage_data_group, plot3d_data_set, visage_scalar, visage_vector, and structured_grid_set objects. (In addition, the plot3d_reader may also create many other objects if the derived data is to be computed by the plot3d_data_set.)

The naming convention for these objects is based on the data_group instance variable. If data_group is empty, then data_group is set to the filename of the file_prefix or xyz file, excluding directory path and extension. This results in a the following naming convention:

visage_data_group The name of the visage_data_group instance is plot3d_data_set(s) The name of the plot3d_data_set instance(s) is(are) visage_scalar(s) The name of the visage_scalar instance(s) is(are) visage_vectors(s) The name of the visage_vector instance(s) is(are) If a function file is available, the visage_scalar instances are named: NOTE: The naming convention described above only holds if the names generated are not the names of other LYMB objects. If the are, unique names will be created according to the convection of the string "unique_object_name?" method.

As a final note: the PLOT3D file is binary. Some binary files are incompatible across different machine architectures. A better alternative for creating data files is netCDF, if possible (see cdf_reader).

SUPERCLASS

visage_reader

INSTANCE VARIABLES

file_prefix the file prefix including directory path. The object will automatically build the xyz and q filenames from this file prefix by appending "xyz.bin" and "q.bin", respectively. Inherited from superclass. filename name of the xyz or grid file. Inherited from superclass.

q_filename name of the q or solution file.

function_filename name of the function file..

format the format of the PLOT3D files. If format=0, the files are single grid format. If format=1, the files are multiple grid format. (Inherited from superclass.)

error the status of the read. If error!=0, then the data was unsuccessfully read.

derived_data boolean flag indicating whether derived data is to be created. By default, if all the data is present in the plot3d file, then default data is created.

force_derived_data boolean flag indicating wheter derived data should be read even if data is missing from the plot3d file. By default, force_derived_data is false.

MESSAGES

file_prefix= prefix Set the file prefix. The file prefix may be used to set directory paths.

file_prefix? Get the file prefix.

filename= xyz_file Set the name of the xyz or grid file.

filename? Set the name of the xyz or grid file.

q_filename= q_file Set the name of the q file.

q_filename? Get the name of the q file.

function_filename=function_file" Set the name of the function file.

function_filename? Get the name of the function file.

format= value Set the format (0=single grid, 1=multiple grid).

format? Get the format.

error= value Set the error state (0=no error, 1=error encountered).

error? Get the error state. After read, if error != 0, error has been encountered.

derived_data_on!, derived_data_off! Turn on/off derived data creation.

derived_data= value Set the value of the derived data flag, >0 is true.

derived_data? Get the value of the derived data flag.

force_derived_data_on!, force_derived_data_off! Turn on/off mandatory derived data creation.

force_derived_data= value Set the value of the force derived data flag, >0 is true.

force_derived_data? Get the value of the force derived data flag.

read! Read the data, creating the appropriate VISAGE objects with appropriate initial values. Constructs the appropriate filename from the file_prefix and/or xyz-file, q-file, and function- file. If cannot read the data, set the error flag.

read_data: (time, data_name, alias) An internal method sed by data objects to read data at different times. Initially, when the VISAGE data objects are created, they do not allocate storage and read data into memory. Instead, hen they need data, they ask the reader (using the read_data:) message to get it for them. Because PLOT3D format has no notion of time, the time variable is ignored. The data_name is the name of the data object requesting the read operation, and

alias is the name of the data in the file. (Often the data_name and alias are different).

open! Open the PLOT3D file for binary read. Used internally.

close! Close the open PLOT3D file. Used internally.

EXAMPLE

The following examples reads in structured grid data using the plot3d_reader object, and then displays an outline and geometry using some visage objects.

/* * read in the data */ plot3d_reader new: areader file_prefix="./case1" ; /* * set up some displays */ data_outline new: outline data_in=areader ; display_all new: draw_outline data_in= outline ; actor new: outline_actor modeller= draw_outline ;

data_geometry new: g1 data_in= areader extent=(1,1,1,32,1,32) ; warp_vector new: warp data_in= g1 scale_factor= 0.005 ; display_all new: draw_geometry data_in= warp range=[areader range?] ; actor new: geometry_actor modeller= draw_geometry ;

/* * Set up the graphics stuff */ renderer new: aren actors=[actor instances?] render!

;

SEE ALSO

visage_reader, plot3d_data_set, visage_data_set, visage_scalar, visage_vector, structured_grid_set, cdf_reader


Please send comments and suggestions to
consult@rpi.edu