A first group of iterators iterates on finite element entities of the finite element model stored in the DataBase.
“each_coordSysId” iterates on the integer identifiers of coordinate systems.
“each_elemId” iterates on the integer identifiers of elements.
“each_rbeId” iterates on the integer identifiers of rigid body elements.
“each_mpcId” iterates on the integer identifiers of MPC and MPCADD cards.
“each_propertyId” iterates on the integer identifiers of properties.
“each_materialId” iterates on the integer identifiers of materials.
The elements produced by the iterator are single integers. Each of these iterators has 0, 1 or 2 arguments. The two optional arguments are the integer bounds considered for the iteration: “IdMin” and “IdMax”.
Two iterators loop on the nodes defining an element:
These two iterators have one integer argument corresponding to the index of the element. They iterate on the integer indices of nodes.
Several iterators allow a direct “raw” access to the tables defined in Nastran XDB or HDF Result files:
Iterator “each_xdbRaw” is discussed in section III.1.1.11.7.
Iterator “each_xdbBinRaw” is discussed in section III.1.1.11.7.
Iterator “each_hdfAttachmentNasSetItem” is discussed in section III.1.1.12.
Iterator “each_bdfCard” allows reading the content of one (or several) BDF file(s), without trying to import the corresponding FEM entities in a NastranDb database. This is a singleton method, which means that the method is to be called directly from NastranDb class. The arguments of the method are the same as those of “readBdf” method described in section III.1.1.1:
A String containing the name of the main Nastran Bulk Data File.
An Array of Strings containing the list of directories in which files specified by “include” statements shall be searched. Its default value is a void Array.
The name of an extension that may be added to the file names specified in include statements. Its default value is a void String. (This argument corresponds to the jidtype in Nastran.)
A Hash with String keys and values corresponding to the list of “symbols” that can be used in “include” statements in the Bulk Data Files. The default value is a void Hash.
A Logical that specifies verbosity for the scanning of the Nastran Bulk Data File. Its default value is “false”. This parameter is redundant with “setVerbosityLevel” of “Post” Module: setting the parameter to “true” is equivalent to setting the “Post” verbosity level to 1.
A Logical that specifies whether the file contains only Bulk Data Section lines. Its default value is “false”. If the parameter is “true”, the “BEGIN BULK” and “ENDDATA” lines are ignored, and all the input lines, except comments, are interpreted. (See also the remarks below.)
A Hash with String keys and values corresponding to a list of “parameters” that influence the reading of the BDF file. The default value is a void Hash. See point III.1.1.1 in the list of limitations of “readBdf” method.
For example, the iterator can be used as follows:
NastranDb.each_bdfCard("../../MODEL/MAINS/unit_xyz.bdf") do |crd|
puts crd
end
Iterator “each_bdfCard2” is close to the previous iterator:
The method has the same parameters as “each_bdfCard” iterator.
The iterator reads and returns information about all the lines read from BDF file. (This means that it is not only limited to the Nastran BDF cards.)
Each item returned by the iterator is an Array of three elements:
A String corresponding to the item type name. Possible type names are “CARD”, “ENDDATA”, “INCLUDE”, “COMMENT”, “EMPTY”, “BEGIN”, “EQUALS” and “OTHER”.
An array of values that may correspond to a BDF card (as with “each_bdfCard” iterator), to an “include” statement, or to an assignment operation:
An array corresponding to the same card definition as returned by each_bdfCardterator. First element of the Array identifies the type of BDF card.
For “INCLUDE” type, the Array has three String elements:
The keyword “INCLUDE”,
The keyword “LAST_INCLUDE_PATH”,
The Path to included file.
If statement type is an assignment (line contains an “=” operator), then the card contains four elements:
The keyword “EQUALS”,
A String containing left hand side of assignment operation,
The keyword “=”,
A String corresponding to the right hand side of assignment.
For other statement types, the second element is nil.
An Array of BDF lines corresponding to what has actually been read. Each line is given in an Array containing three elements:
A String containing the path to the file from which the line is read,
An integer corresponding to the line number,
The BDF line content, returned as a String.