ReadPlot3dFile

Synopsis

This module reads either a formatted or unformatted multiblock PLOT3D data set consisting of the grid and data vector (Q file).


module ReadPlot3dFile <src_file="rdplot3d.c"> {
  ReadPlot3dParams &ReadPlot3dParams <NEportLevels={2,0}>;
  string filename_xyz => ReadPlot3dParams.filename_xyz;
  string filename_q => ReadPlot3dParams.filename_q;
  int iblanks => ReadPlot3dParams.iblanks;
  int format => ReadPlot3dParams.format;
  int use_q => ReadPlot3dParams.use_q;
  int trigger => ReadPlot3dParams.trigger;
  int dims3d => ReadPlot3dParams.dims3d;
  int multiblock => ReadPlot3dParams.multiblock;
  Multi_Block out <NEportLevels={0,2}>;
  link fields <NEportLevels={1,2},export=1> => out.fields;
    
  omethod+req rd_plot3d_update(
      filename_xyz+read+notify,
      filename_q+read+notify,
      iblanks+read+notify+req,
      format+read+notify+req,
      use_q+read+notify+req,
      trigger+read+notify+req,
      dims3d+read+notify+req,
      multiblock+read+notify+req,
      out+write) = "read_plot3d_update";
};

Description

This module reads either a formatted or unformatted multiblock PLOT3D data set consisting of the grid and data vector (Q file). 3D, 2D, ASCII, binary or Fortran unformatted files are handled. No corrections are made for block edge overlap and no co-incident node removal is attempted between blocks. The cells of the output field structure created are all hexahedra. If no Q (result data) is present, visualizations can be made of the mesh file only.

ReadPlot3dFile reads in several of the possible plot3d file types, a multiblock (with or without iblanks) stored in the whole field format, or a single 1-block file. The Q vector is labeled with the default names of the primative variables.

File formats may be ASCII formatted, and two types of binary file. In the "binary" mode, the file is accessed as a continuous stream. In the "unformatted" mode, padding records are assumed at the end of logical blocks, such as caused by FORTRAN I/O, if the padding option is turned on, otherwise straight binary with no padding is assumed.

If non-multiblock is selected, just one block is output, and no leading header is assumed.

The reader automatically checks and detects BigEndian/LittleEndian format mode, and does byte swapping on the fly. This means that data generated on a UNIX machine can be viewed on an Intel PC, or that data generated on a Dec Alpha can be visualized on a Sun or SGI.

The reader is written in an "omethod" style in C, with a multi-block (arrays of fields) output data structure. The DVswitch module can be used to select just one of the blocks for visualization with Main-Page modules, otherwise use the ARR modules for multiblock processing.

Typical Usage: You have to have some idea of what the files contain before reading, or just experiment by pushing various combinations of parameters.

Inputs

&ReadPlot3dFileParams

Reference to the parameter block, which contains real instances of the various toggles and filenames.

filename_xyz

The selected grid file (x.dat)

filename_q

The selected data file (q.dat)

iblanks

A boolean parameter to indicate the presence of iblank values in the data files.

format

Select the file format: ASCII, Binary, or Binary with Padding

use_q

If selected, will try to process Q file; otherwise, will ignore and only build the mesh data structure.

trigger

Button to actually do the read. All other parameter interfaces may be set or changed beforehand, without triggering the read process.

dims3d

Assume data is 3D if selected, if not, assume 2D only

multiblock

Assume multiblock format or else simple 1-block binary files.

Outputs

out

Multi-block output containing array of fields.

fields

Link to the fields sub-object of the multi-block output.

Utility Macros

The low-level ReadPlot3dFile module is used in the Functional Macro ReadPlot3d and the User Macro read_plot3d. Additionally, the module, the Functional Macro and the UI Macro ReadPlot3dUI have references to the parameter block ReadPlot3dParams. There is a real instance of the parameter block in read_plot3d.

Example

An example application ReadPlot3dEg is provided, which reads the bluntfin plot3d data found in the AVS/Express installation directories, and then renders an orthogonal slice through the dataset.

Note that a link object is used to extract a single field from the field array output of the module.

Files

iac_proj/rdplot3d/pl3dmods.v contains the ReadPlot3dParams group and the ReadPlot3dFile module V definitions.

Other Notes

The low-level ReadPlot3dMods library containing the module ReadPlot3dFile does not specify a process. By default the express process will be used.

Authors

Ian Curington, AVS Inc (AVS/Express Port)
Michael J. Rangitsch (AVS5 version, 11 Oct 1994)

Modifications

Paul G. Lever

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

ReadPlot3dParams, ReadPlot3d, ReadPlot3dUI and read_plot3d.

Plot3d_Multi_Block