Several methods allow the reading of results from an “op2” file or to tune the behavior of reading this file. These methods are described below. The reading of 32-bit as well as 64-bit “op2” files is possible. However, there is no advantage in reading the 64-bit version. In fact, these files are larger and may take a longer time to read.
Note that it is strongly recommended to assign an integer ID and a name to each sub-case defined in a Nastran BDF file. For example, in the following example, the sub-case integer ID is 201, and its name is “ORBIT_ONE_MS2_X”:
SUBCASE 201 SUBTITLE=ORBIT_ONE_MS2_X SPC=702001 LOAD=601001
“readOp2” method is used to read FEM entities or Results into the DataBase from an “op2” file generated by Nastran. This method is also discussed in section III.1.1.2 for the reading of finite element model. Here, the reading of Results is discussed in more detail.
The method has up to 7 arguments:
A String that corresponds to the path to the file from which model or Results are read.
A String that corresponds to the entities that are being read. Possible values of the second argument are “Model/Results”, “Model” and “Results”. Generally, only the third possible value is used.
A “LcNames” argument that corresponds to the list of load cases for which the Results are read. The argument may be:
A Single String corresponding to the name of one load case.
An Array of Strings corresponding to the list of load cases for which Results are read.
If this argument is omitted, or nil, or if the Array argument contains no elements, the Results of ALL load cases are read.
A “ScNames” argument that corresponds to the list of subcases for which the Results are read. The argument may be:
A Single String corresponding to the name of one subcase.
An Array of Strings corresponding to the list of subcases for which Results are read.
If this argument is omitted, or nil, or if the Array argument contains no elements, the Results of ALL subcases are read.
A “ResNames” argument that corresponds to the list of Results identifiers for which the Results are read. The argument may be:
A Single String corresponding to the Result ID.
An Array of Strings corresponding to the list of Result IDs for which Results are read.
If this argument is omitted, or nil, or if the Array argument contains no elements, ALL Results are read.
A “PostParam” integer argument corresponding to the parameter “POST” in Nastran Bulk Data File. Possible values of the parameter:
“-1” (for Patran output).
“-2” (for EDS I-DEAS output). It seems to correspond also to the output produced by Autodesk’s Inventor Nastran with “PARAM POST -1”.
The default value of this argument is “-1” (op2 created for Patran). Note that readOp2 will not work with the values “-4” and “-5” which are valid POST parameters for Nastran.
An optional “NasVersion” real argument corresponding to an MSC version. For example 2021.2 can be used for MSC version 2021.2. This parameter influences the reading of some IFP tables whose format have changed. Default value is 2019.99.
The third, fourth, fifth and sixth arguments can be omitted. Note that Ruby identifies the type of arguments by their order of appearance in the list. So, if “LcNames” argument is omitted, but “ScNames” or “ResNames” argument is used, the “LcNames” must be a void Array (“[]”) or “nil”. Examples of possible calls to “readOp2” method follow:
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results")
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
"GRAV_X")
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
["GRAV_X"])
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
["GRAV_X", "GRAV_Y"])
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
[],[],"Stress Tensor")
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
[],[],["Stress Tensor", "Shell Forces", Shell Moments"])
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
["GRAV_X", "GRAV_Y"],"Statics",\
["Stress Tensor", "Shell Forces", Shell Moments"])
...
db.readOp2("../../EXEC/orbit_unit_xyz.op2","Results",\
[],[],[],-2,2021.2)
...
“readOp22H” method is used to read Results from an “op2” file generated by Nastran. The Results are returned into an Hash object. The method has nearly the same arguments as “readOp2”, but the “what” argument is missing:
“Path” argument,
“LcNames” argument,
“ScNames” argument,
“ResNames” argument,
“PostParam” integer argument,
“NasVersion” real argument.
(See the description of “readOp2” method for more information.) Example of use:
...
h=db.readOp22H("../../EXEC/orbit_unit_xyz.op2",[],[],[],-2)
...
“readOp2FilteredResults” method is used to read Results into the DataBase from an “op2” file generated by Nastran. This method does not allow the reading of finite element model. It differs from “readOp2” method by the fact that its parameters allow a filtering of the Results that are read into the database. This filtering may be mandatory when an op2 is very large and a finer selection of the results is needed. For example:
Select only some Result types, like stresses, or forces, or accelerations.
Select only some frequency outputs, or eigen modes, or time steps.
Read the random RMS results but not the associated complex results,
...
The method has from 1 to 10 arguments:
A String that corresponds to the path to the file from which Results are read.
An “LcFilters” String argument that corresponds to the load cases for which the Results are read. The argument may be:
A Single String corresponding to a regular expression for load cases selection.
An Array of Strings defining several regular expressions for the selection of load cases to be read.
If this argument is omitted, or nil, or if the Array argument contains no elements, the Results of ALL load cases are read.
An “ScFilters” String argument that corresponds to the sub-cases for which the Results are read. The argument may be:
A Single String corresponding to a regular expression for sub-cases selection.
An Array of Strings defining several regular expressions for the selection of sub-cases to be read.
If this argument is omitted, or nil, or if the Array argument contains no elements, the Results of ALL sub-cases are read.
A “ResFilters” String argument that corresponds to the types of Results that are read. The argument may be:
A Single String corresponding to a regular expression for Results selection.
An Array of Strings defining several regular expressions for the selection of Results.
If this argument is omitted, or nil, or if the Array argument contains no elements, the Results of ALL types of Results are read.
A “PostParam” integer argument corresponding to the parameter “POST” in Nastran Bulk Data File. Possible values of the parameter:
The default value of this argument is “-1” (op2 created for Patran). Note that readOp2 will not work with the values “-4” and “-5” which are valid POST parameters for Nastran.
An “IMin” integer argument. (See below.)
An “IMax” integer argument. The “IMin” and “IMax” arguments allow filtering of results on the integer parameter associated with the output (mode integer ID, Step output...).
An “RMin” real argument. (See below.)
An “RMax” real argument. The “RMin” and “RMax” arguments allow filtering of results on the real parameter associated with the output (frequency for modal analysis, time step for non-linear or transient analysis, Frequency output for dynamic vibration or random analysis...).
An optional “NasVersion” real argument corresponding to an MSC version. For example 2021.2 can be used for MSC version 2021.2. This parameter influences the reading of some IFP tables whose format have changed. Default value is 2019.99.
Ruby identifies the type of arguments by their order of appearance in the list. So, if “LcFilters” argument is omitted, but “ScFilters” or “ResFilters” argument is used, the “LcFilters” must be a void Array (“[]”) or “nil”.
The regular expressions used for arguments 2, 3 and 4 follow the ECMAScript syntax. Examples of valid calls to “readOp2FilteredResults” follow:
...
db.readOp2FilteredResults(op2Name,nil,"Out(.*)",".*\\(MP\\).*",
nil,3,7)
...
db.readOp2FilteredResults(op2Name,nil,"Out(.*)",".*\\(MP\\).*",
nil,nil,nil,102.5,108.5)
...
db.readOp2FilteredResults(op2Name,nil,".*Out.*",nil,
nil,nil,nil,102.5,108.5)
...
db.readOp2FilteredResults(op2Name,nil,".*CRMS.*",nil,
nil,nil,nil,102.5,108.5)
...
db.readOp2FilteredResults(op2Name,nil,".* RMS .*")
...
db.readOp2FilteredResults(op2Name,nil,".* RMS.*")
...
Note that regular expressions can be replaced by a simple name except that “special characters” must be escaped (for example “\\(” or “\\)”).
“readOp2FilteredResults2H” method is used to read Results from an “op2” file generated by Nastran. Results are returned in a Hash object. The method has the same arguments as “readOp2FilteredResults”. Examples of use:
...
h=db.readOp2FilteredResults2H(op2Name,nil,"Out(.*)",".*\\(MP\\).*",
nil,3,7)
...
h=db.readOp2FilteredResults2H(op2Name,nil,".* RMS.*")
...
Note that “readOp2FilteredResults” method providing regular expressions is provided for the importation of Results from OP2 files, but not from XDB or HDF files. This has been done because the reading of OP2 file is done sequentially. This means that the entire file is read each time it is accessed via “readOp2” or “readOp2FilteredResults” methods. For the reading of XDB or HDF content, random access is possible and the use of attachment is recommended for large files. Also, it is possible to obtain the lists of load cases, sub-cases and Results present in XDB and HDF files, so that filtered reading from these files remains possible by specifying lists of load cases, sub-cases or Results obtained by calling “getXdbLcInfos”, “getAttachmentLcInfos” or “getHdfAttachmentLcInfos” methods.
Six singleton methods allow disabling or (re-)enabling some entities when importing model or result entities from Nastran op2 or bdf files, or to check the status of the bdf cards or Results:
“enableBulkCards” is used to re-enable some Nastran card when reading model entities from a Nastran bdf or op2 file.
“disableBulkCards” is used to disable some Nastran card when reading model entities from a Nastran bdf or op2 file.
“getBulkCardsEnableInfos” returns a Hash with String keys and Boolean values that associates the enabled/disabled status with the different BDF card names.
“enableOp2ResElems” is used to re-enable “result element types” when reading Results from an op2 file.
“disableOp2ResElems” is used to disable “result element types” when reading Results from an op2 file.
“getOp2ResElemsEnableInfos” returns a Hash with String keys and Boolean values that associates the enabled/disabled status with the different BDF card names for results reading from op2 files.
The four enable/disable methods take one String, or an Array of Strings argument. The Strings correspond to the names of the entities that must be disabled or enabled. The “enable info” methods have no argument.
Other methods devoted to enabling or disabling composite layered Results are defined in the generic “DataBase” class. These methods are presented in section I.1.3.2.
These enable/disable methods can be used to filter result importation in order to reduce the computation time, or the memory usage. The methods can also be used to work around FeResPost bugs in the hopefully rare case when a bug occurs in the program for the reading of a particular element, or the reading of the corresponding Results from an op2 file.
Presently, only some of the result data blocks of the file can be read:
The “OUG” block corresponds to displacements, velocities, accelerations, temperatures...
The “OGPFB1” block corresponds to Grid Point Forces.
The “OES” blocks correspond to strains or stresses. The names of blocks that can be read are: “OSTR1”, “OSTR1C”, “OES1C” and “OES1X”.
The “OPG1” block corresponds to applied loads at nodes.
The “OEF” blocks correspond to results in composite parts of the structure, or to forces in surface or 1D elements. The names of blocks that can be read are: “OEFIT” and “OEF1C”.
The “OQG” blocks correspond to MPC or SPC forces.
The correspondence between the Nastran output requests and the DMAP data blocks written in the “op2” file is given in Tables III.1.7 to III.1.14. The type names of Results generated in the NastranDb by “readOp2” method. The solution sequences for which Results can be read from an “op2” are:
SOL 101: linear static or thermal analysis,
SOL 103: linear eigen-values analysis,
SOL 105: buckling analysis,
SOL 106: non-linear static analysis,
SOL 108 and 111 : frequency response analysis + associated random analysis results.
SOL 129: non-linear transient analysis,
SOL 159: transient thermal analysis,
SOL 400: non-linear static or transient analysis (corresponds to the SOL106 and SOL129 analyses).