WriteUCD

Synopsis

Writes the contents of a field to an AVS UCD (Unstructured Cell Data) file.

Input Ports

Name Type Description

in_fld Mesh+Node_Data Field data that should be written to the output.

Parameters

Name Type Description UI Control

filename String Name of file to create. File Dialog
name String Field name to insert into UCD file. -
binary int ASCII or binary format. Radio Box

Description

The write_ucd macro parses an AVS/Express field structure and then creates an UCD file in either ASCII or binary format. The Unstructured Cell Data or UCD file format was created by AVS to allow arbitrary field data to be stored. Node coordinates, cell connectivity, node data and cell data can all be stored in a UCD file. The format has also been extended to support time-dependent data. By default AVS/Express is able to read UCD files but is not able to write to them.

This IAC module allows field data to be written to UCD files from AVS/Express. However it does not currently support all of the features of the UCD file format. In particular it does not output time dependent data. It is able to output node coordinates, multiple components of node data with varying vector lengths and the following types of cell sets:

The UCD file format does not support Polyline or Polytristrip cell sets so these cell types are converting into Line and Triangle cell sets. This conversion code is not enabled by default. To enable it, you must define the symbol OUTPUT_POLY_TEST and recompile (this can be done by editing the source code). The ASCII UCD format also does not appear to support the storage of maximum and minimum data values. This can result in the data map appearing to be incorrect when a UCD file is read back into AVS/Express. The binary UCD format does support maximum and minimum data values, but the AVS/Express UCD reader does not appear to utilize the node data maximum and minimum. Currently the only work around for this problem is to use the set_minmax module to manually set the maximum and minimum data values.

Inputs

&in_fld

Reference to a Field that contains the Mesh, Cell_Set, Cell_Data and Node_Data information that should be written to the specified UCD file.

Parameters

filename

String parameter that contains the fully specified pathname of UCD file that should be created by the write_ucd macro. This string can contain AVS/Express environment variables (i.e. $XP_ROOT, $XP_PATH<1>).

name

String parameter that contains the field name that should be written to the UCD file. This parameter can normally be ignored as the AVS/Express Read_UCD module ignores field names in UCD files. By default this parameter has the value "default_avs_field"

binary

integer parameter that determines the format of the UCD file to be written. 0 (the default) means ASCII, 1 means binary.

Utility Modules

The write_ucd user macro makes use of the WriteUCDUI user interface macro and the WriteUCDCore low-level module. No parameter block or functional macro are used.

Example

Four example applications are provided with this project. The WriteUCDEg application creates an isosurface and writes that field to a UCD file. The WriteUCDTest application creates a field with complex node data components and illustrates that this information can be successfully written to a file. The WriteUCD_ARR_Eg application illustrates writing an array of fields to a UCD file. See Other Notes for further details. Finally the ReadUCDEg application reads UCD files, hence providing a quick way of testing if UCD files have been written correctly.

Files

iac_proj/wr_ucd/wucdmods.v contains the V definition of the WriteUCDCore module.

iac_proj/wr_ucd/wucdmacs.v contains the V definitions of the WriteUCDUI UI macro and the write_ucd and write_ucd_ARR user macros.

iac_proj/wr_ucd/wucdapps.v contains the V definitions of the WriteUCDEg, WriteUCDTest, WriteUCD_ARR_Eg and ReadUCDEg example applications.

Other Notes

The low-level module code also supports the writing of an array of fields to a single UCD file. The write_ucd_ARR macro exposes this functionality. However the UCD file format normally only allows a single field to be written to each file. Hence this ability may initially seem redundant. In reality it is intended for future expansions of the module. The output of arrays of fields could provide the basis of the output of time dependent UCD data or an extended form of the UCD file format.

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

Documentation for the UCD format can be found on the AVS FTP site.

Authors

Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX

Andrew Dodd, International AVS Centre
Sudhir Sangappa, AVS Inc.

See Also