FeResPost Web Site                     FeResPost Online User Manual

III.1.1.14 Iterators

III.1.1.14.1 Iterating on FEM entities

A first group of iterators iterates 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.

III.1.1.14.2 Iterating on Tables in Result files

Several iterators allow a direct “raw” access to the tables defined in Nastran XDB or HDF Result files:

III.1.1.14.3 Iterating on BDF content

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:

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: setting the parameter to “true” is equivalent to setting the “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.)

7.

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: