III.1.1.5 Accessing FEM information or modifying the FEM
The “fillCard” method allows to retrieve an Array corresponding to the a Nastran BDF card. The
method has two arguments:
-
1.
- A String corresponding to the type of entity of which one requires the definition. Possible
values of the argument are “CoordSys”, “Element”, “Node”, “RBE”, “MPC”, “Property”
and “Material”.
-
2.
- An integer corresponding to the ID of the FEM item of which one searches the definition.
The method returns the definition in an Array:
- The first element of the Array (corresponding to index 0), is a String containing the name
of the Nastran card.
- Elements 1 to 8 correspond to the first line in the card definition (small field format).
- Elements 9 to 16 correspond to the second line in card definition (small field format).
- For each line, the fields 1 and 10 are neglected, except for the first line in which field 1
contains the name of the Nastran card.
Note that Nastran model may contain several material cards sharing a common ID, or several MPC cards
with the same ID. When this case occurs, an exception is thrown. Therefore, for MPC or material
cards, it is advised to use “fillCards” method instead of “fillCard”. An exception is also thown when
no FEM item matching specified ID is found.
The “fillCards” method allows to retrieve an Array containing BDF cards as those returned by
“fillCard” method. (This means that “fillCards” method returns an Array of Arrays.) The method has
two or three arguments:
-
1.
- A String corresponding to the type of entity of which one requires the definition. Possible
values of the argument are “CoordSys”, “Element”, “Node”, “RBE”, “MPC”, “Property”
and “Material”.
-
2.
- An integer corresponding to the minimum ID of the FEM items of which one searches
the definitions.
-
3.
- An integer corresponding to the maximum ID of the FEM items of which one searches
the definitions.
Third argument is optional. When omitted, one considers that maximum ID = minimum ID. In such cases,
the method generally returns maximum one BDF card. However, for materials and MPCs, a single ID
may correspond to several items. The method returns the definition in an Array of Arrays.
Each element of the main Array is a Nastran BDF card as those returned by “fillCard”
method.
Method “insertCard” performs the reverse operation: it allows to update the “NastranDb” database
by insertion of FEM entity (coordinate system, node, element, RBE, material...). The method
“insertCard” has one argument: an Array containing the different fields of the card. The conventions
for the components of the Array are exactly the same as for the Array returned by method “fillCard”
discussed above. (This means that first element of the Array, of index 0, is a String corresponding to
the name of the Nastran card.)
Method “insertCards” corresponds to “insertCard” but allows to insert several cards with a single
call to the method. The argument of the method is then an Array of Arrays.
Remarks about the insertion methods:
- We strongly advise to use “insertCards” method instead of “insertCard” to limit the
number of calls to the method. Indeed, at the end of each insertion, FeResPost updates
a large number of data structures in the “NastranDb” class, in this can take some time.
(These data structures correspond, for example, to containers associating elements and
properties, elements and materials, nodes and elements...) Therefore, a good way to work
would be to collect all the cards to be inserted in the model in a big Array, and perform
the insertion operation only once.
- If one inserts a FEM entity that already exists in the database, the pre-existing entity is
replaced by the new one. If an entity is defined twice in the argument cards, only the last
card will remain inserted in the database at the end.