FeResPost Web Site                     FeResPost Online User Manual

III.1.1.13 Iterators

A first group of iterators iterate on finite element entities of the finite element model stored in the DataBase.

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.

Iterator “each_xdbRaw” is discussed in section III.1.1.10.7. Iterator “each_bdfCard’ allows to read 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:

1.
A String containing the name of the main Nastran Bulk Data File.
2.
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.
3.
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.)
4.
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.
5.
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: to set the parameter to “true” is equivalent to set “Post” verbosity level to 1.
6.
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.)

For example, the iterator can be used as follows:

    NastranDb.each_bdfCard("../../MODEL/MAINS/unit_xyz.bdf") do |crd|  
        puts crd  
    end