Parse readnas raw tables into NASTRAN-formatted output.
data=parseop2table_raw2nas(table)
data=parseop2table_raw2nas(table,endianflag,'silent')
PARSEOP2TABLE_RAW2NAS parses "raw" output from READNAS (from the 'asraw' input option) into structures containing native NASTRAN-formatted tables. Please see the DDL descriptions for each datablock and the Item Codes chapter of the NASTRAN Quick Reference Guide for information on interpreting the NASTRAN output.
Please edit this function and look in the datablock_lookup() function for a list of supported datablocks. If a datablock category is supported, but the specific datablock name in a supporting category is not listed, you can add it to the list in this function to add support.
Currently supported table datablock categories are:
OUG | Nodal displacement/velocity/acceleration |
OGF | Grid point forces |
OEE | Element energy (strain, kinetic, loss) |
OEF | Element forces |
OES | Element stresses or strains |
OPG | Applied loads |
OQG | Single or multipoint constraint forces |
TABLE is a structure whose fields are the names of the datablocks imported by READNAS and whose contents are the raw data structures.
ENDIANFLAG is an optional input specifying whether the endian should be flipped (true indicates that endians are flipped). This value is an optional output of READNAS, and is generally only true when the OP2 file was created on Unix and you are running Matlab on Windows or Linux, or vice versa.
The optional input string 'silent' suppresses output.
TABLE is a structure containing the same fields supplied in the input. Datablocks that were translated replace the original content of the fields.
Result datablocks consist of a 146 word header record followed by a data record. This function translates each pair of header and data records into a single output structure. Thus if the input datablock contains 100 records, the output will contain a 50x1 structure. The fieldnames for the output will vary for each result type, since the header record contains different result type-specific information. However, most of the fieldnames will be the same. Some important fields to note are:
.id | NIDx1 vector of entity IDs* 10. Though not specified in the NASTRAN documentation, this corresponds to Item Code 1. Divide this vector by 10 to get the node or element ID as appropriate. The last digit of the ID specifies the ID type (node, scalar point, element, etc.). |
.item | 1xNITEM vector of Item Codes available. These are usually 2-N, but item codes corresponding to character values are removed. |
.data | NIDxNITEM matrix of data values. NID is the number of IDs, and ITEM is the number of Item Codes (2-N). The meaning of each item code is defined for each entity type for each result type in the NASTRAN Quick Reference Guide. Columns corresponding to character Item Codes are stored as Nan, and the corresponding character values are stored in the .datachar field. |
.datachar | NIDxNCOL cell matrix of strings corresponding to the character strings in the Item Codes. To save memory, NCOL corresponds to the highest character item code for that data type, rather than NITEM. |
>> f = readnas('asraw');
>> data = parseop2table_raw2nas(f.table);
>> [f,~,info] = readnas('asraw');
>> data = parseop2table_raw2nas(f.table, info.endianswap);