“readGroupsFromPatranSession” reads one or several Groups from a Patran session
file obtained using the utility “Patran–>utilities–>groups–>exportToSessionFile”. The
argument is a String corresponding to the name of the session file. The method returns nil.
If some of the entities read in the session file do not exist (for example, missing elements
or nodes), then the read entities will not be added to the Group. This corresponds to
the behavior of Groups in Patran. Therefore the session file containing the definition of
Groups should be read after the finite element model.
Note that, even though the method is related to an MSC software, it can be used
with DataBase related to different solvers. This is the reason why the method
“readGroupsFromPatranSession” is defined in generic DataBase class.
The method “readGroupsFromPatranSession” works as follows:
- It searches in the file the statements “ga_group_entity_add” and stores the while
PCL statement in a string.
- Then, the name of the Group being initialized is scanned from the string.
- Finally, the entity definition is scanned:
- The statement searches words like “Node”, “Element”, “MPC”, “CoordSys”.
Note that “MPC” corresponds to the definition of a list of rigid body elements
(RBEs). Nastran MPC cards cannot be inserted in a Group.
- For any of the four first words, the method builds a list of integers
corresponding to the identifiers of the entities to be added to the Group. For the
three last words above, the method skips the entities.
The entities can be defined by a list of integers separated by blanks, or by pairs
of integers separated by “:” which defines a range of integers, or by groups
of three integers separated by two “:” which defines a range with a stepping
argument.
- Prior to storing the Group in DataBase, the method checks that the entities of the Group
are defined in the DataBase. If not, the are erased from the Group.
Note that the definition of Groups in Ruby by range specification uses the same kind of formats
as ”setEntities” method in Group class. (See section I.3.3.)