readunv


Purpose

Import data from a Universal file.

Syntax

f=readunv('filename')
f=readunv('filename','dialogtitle')
f=readunv('silent','noprogbar')
f=readunv('asresult')
f=readunv('shponly')
f=readunv('filename',[datasets])
[f,fname]=readunv

Description

The READUNV function is used to read various types of universal files from I-deas.

The filename argument is a string specifying the universal file to be read. If wildcards are included in the filename, then a standard file dialog will be presented, allowing the user to choose the file. The optional dialog title will be used as a title for the file dialog window. The optional input string 'silent' suppresses output to the command window. The optional input string 'noprogbar' suppresses the progress bar.

Calling READUNV without any arguments is equivalent to supplying a filename of '*.unv'.

You may also specify a list of datasets (see below) to either skip or read. This list is a numeric vector containing a list of dataset numbers. To skip a dataset, make the dataset number negative in DATSETS. To read only a given dataset list, pass the dataset list in as positive numbers. Positive dataset numbers in DATASETS implicitly assume that READUNV should skip all other datasets.

By default READUNV will read mode shapes in dataset 2414 into an imat_shp, and all other results into an imat_result. Two optional input strings can alter this behavior. Passing in the string 'asresult' will cause READUNV to read all dataset 2414 results into an imat_result. Passing in the string 'shponly' will cause READUNV to read only mode shapes from dataset 2414 into an imat_shp.

FNAME is an optional output argument containing the filename of the Universal file read.

The following universal file formats are supported:

Dataset Description READUNV Output
164 Units none (used to adjust units of result)
58 Functions/time histories imat_fn array
58b Functions/time histories (binary) imat_fn array
55 Shapes from Test imat_shp array
2414 Shapes from Simulation imat_shp array , and/or result object
1802 Coordinate trace imat_ctrace object
757 DOF set imat_ctrace object
247 DOF set substructure entity (see below)
252 Entity definition matrix substructure entity (see below)
611, 612 Matrix for the matrix package substructure entity (see below)
2453 Results matrix substructure entity (see below)
18 Coordinate system imat_cs object in imat_fem object property (.cs)
2420 Coordinate system imat_cs object in imat_fem object property (.cs)
15 Node imat_node object in imat_fem object property (.node)
781 Node imat_node object in imat_fem object property (.node)
2411 Node imat_node object in imat_fem object property (.node)
82 Traceline imat_tl object in imat_fem object property (.tl)
2416 Traceline imat_tl object in imat_fem object property (.tl)
2431 Traceline imat_tl object in imat_fem object property (.tl)
780 Element imat_elem object in imat_fem object property (.elem)
2412 Element imat_elem object in imat_fem object property (.elem)

 

It is also possible to write your own dataset reader plugins, so you can extend READUNV to import datasets not natively supported. Please refer to the Extending Readunv page for more information on this useful capability.

In most cases, only one type of output will be generated from a single universal file (this should be the case if the universal file was written by I-deas Test). Functions or time histories will be output in a single imat_fn variable with as many elements as necessary. Shapes will also be output in a single imat_shp variable. A universal file containing a single coordinate trace will be read into an imat_ctrace variable. A universal file containing multiple coordinate traces will be read into a cell array with one imat_ctrace in each cell element. The coordinate trace or DOF set name in the Universal file will be stored as the imat_ctrace name.

A substructure can be specified using different dataset types. Dataset 247 and 252 go together. If the substructure is stored using these datasets, the Universal file should contain both a dataset 247 (identifying the degrees of freedom in the substructure) and one or more datasets 252 (matrices). If the substructure is stored in dataset 2453, this dataset should appear consecutively with the degree of freedom matrix and entity matrices. Datasets 611 and 612 contain only matrices; the corresponding degree of freedom information is not available. When reading such a universal file, READUNV will create a MATLAB structure variable with the following fields:

f.aset imat_ctrace of independent DOF (size Na)
f.oset imat_ctrace of constrained (dependent) DOF (size No)
f.sset imat_ctrace of restrained DOF (size Ns)
f.mass Na x Na mass matrix
f.stiffness Na x Na stiffness matrix
f.viscous Na x Na viscous damping matrix
f.hysteretic Na x Na hysteretic damping matrix
f.constraint No x Na back expansion matrix

 

(Some of these fields may be empty if the associated matrix was not included in the substructure universal file.) Note that the s-set partition of the matrices will be discarded by READUNV, if present.

FEM data entities will be stored in an imat_fem with properties that contain individual FEM entity objects with the entity data (i.e. nodes and elements). For a full description of these structures, please refer to the FEM Data Format Reference. Please note that readunv will return the node ordering for parabolic elements in NASTRAN-centric ordering, which is different from the ordering specified in the Universal file. Also note that coordinate system 1 (global Cartesian) in the Universal file will be renumbered to 0 on import.

In the situation when mixed types of data are included in the same universal file, READUNV creates a cell array for the output argument. The cell array will contain, in this order, an imat_fn (all functions read), an imat_shp (all shapes read), the MATLAB structure variable described above, followed by one imat_ctrace per coordinate trace. Only those elements that were present in the universal file will be placed in the output cell array.

By convention, mode shape coefficients in universal files are assumed to be in the basic coordinate system. Shapes returned from READUNV will have the .CSType property set to 'Basic'. If you know the shape coefficients are not in the basic coordinate system, you will need to set the .CSType property accordingly.

Some third party vendors write Universal files with incorrect formatting. In particular, dataset delimiter lines (containing '    -1') are written to have trailing spaces. READUNV automatically detects files with this formatting problem and utilizes a Perl script to clean the files. It creates a new file, given the filename with '_fix' appended to the end. READUNV will warn you if this happens and will proceed to read the cleaned file, which it leaves on the system after it is finished.

Examples

>> f=readunv('/ms5/examples/tda/air_func.unv');
>> f=readunv('*.unv','Select file to read');
>> f=readunv('*.unv','Select file to read',[55 58]);  % Read only functions and shapes

See Also

writeunv, writesubst