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 32bits as well as 64bits “op2” files is possible.
However there is no advantage in reading 64bits version. Actually, these files are larger and may take a
longer time to read.
Note that one strongly advises to attribute an integer ID, and a name to each sub-case defined in
Nastran BDF file. For example, in the following example, the sub-case integer ID is 201, and its name
is “ORBIT_ONE_MS2_X”:
- “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, one discusses more precisely the reading of
Results.
The method has up to 6 arguments:
-
1.
- A String that corresponds to the path to file from which model or Results are read.
-
2.
- 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 argument is used.
-
3.
- A “LcNames” argument that corresponds to the list of load cases for which the Results are
read. The argument may be:
-
(a)
- A Single String corresponding to the name of one load case.
-
(b)
- 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.
-
4.
- A “ScNames” argument that corresponds to the list of subcases for which the Results are
read. The argument may be:
-
(a)
- A Single String corresponding to the name of one subcase.
-
(b)
- 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.
-
5.
- A “ResNames” argument that corresponds to the list of Results identifiers for which the
Results are read. The argument may be:
-
(a)
- A Single String corresponding to the Result ID.
-
(b)
- 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.
-
6.
- 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”.
- “-6” (EDS Unigraphics output).
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.
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)
...
- “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:
-
1.
- “Path” argument,
-
2.
- “LcNames” argument,
-
3.
- “ScNames” argument,
-
4.
- “ResNames” argument,
-
5.
- “PostParam” integer 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 9 arguments:
-
1.
- A String that corresponds to the path to file from which Results are read.
-
2.
- An “LcFilters” String argument that corresponds to the load cases for which the Results
are read. The argument may be:
-
(a)
- A Single String corresponding to a regular expression for load cases selection.
-
(b)
- 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.
-
3.
- An “ScFilters” String argument that corresponds to the sub-cases for which the Results are
read. The argument may be:
-
(a)
- A Single String corresponding to a regular expression for sub-cases selection.
-
(b)
- 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.
-
4.
- A “ResFilters” String argument that corresponds to the types of Results that are read. The
argument may be:
-
(a)
- A Single String corresponding to a regular expression for Results selection.
-
(b)
- 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.
-
5.
- 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),
- “-6” (EDS Unigraphics output).
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.
-
6.
- An “IMin” integer argument. (See below.)
-
7.
- An “IMax” integer argument. The ‘IMin” and “IMax” arguments allow to filter
results on integer parameter associated to the output (mode integer ID, Step
output...).
-
8.
- An “RMin” real argument. (See below.)
-
9.
- An “RMax” real argument. The ‘RMin” and “RMax” arguments allow to filter results on
real parameter associated to the output (frequency for modal analysis, time step for
non-linear or transient analysis, Frequency output for dynamic vibration or random
analysis...).
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 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 to disable or (re-)enable 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:
-
1.
- “enableBulkCards” is used to re-enable some Nastran card when reading model
entities from a Nastran bdf or op2 file.
-
2.
- “disableBulkCards” is used to disable some Nastran card when reading model
entities from a Nastran bdf or op2 file.
-
3.
- “getBulkCardsEnableInfos” returns a Hash with String keys and Boolean values
that associates the enabled/disabled status to the different BDF card names.
-
4.
- “enableOp2ResElems” is used to re-enable “result element types” when reading
Results from an op2 file.
-
5.
- “disableOp2ResElems” is used to disable “result element types” when reading
Results from an op2 file.
-
6.
- “getOp2ResElemsEnableInfos” returns a Hash with String keys and Boolean values
that associates the enabled/disabled status to 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 enable or disable 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 set to filter the results importation in order to reduce the
computation time, or the memory usage. The methods can also be used to prevent
FeResPost 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.
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. Also one gives in the Tables 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: