8.15.1 Model class: Contains all FE model data.

The Model class has this constructor:

class Model( coords,elems)
Create new model data.

coords is an array with nodal coordinates elems is either a single element connectivity array, or a list of such. In a simple case, coords and elems can be the arrays obtained by coords, elems = F.feModel() This is however limited to a model where all elements have the same number of nodes. Then you can use the list of elems arrays. The 'fe' plugin has a helper function to create this list. E.g., if FL is a list of Formices (possibly with different plexitude), then fe.mergeModels([Fi.feModel() for Fi in FL]) will return the (coords,elems) tuple to create the Model.

The model can have node and element property numbers.

Model objects have the following methods:

nnodes( )

nelems( )

mplex( )
Return the maximum plexitude of the model.

splitElems( set)
Splits a set of element numbers over the element groups.

Returns two lists of element sets, the first in global numbering, the second in group numbering. Each item contains the element numbers from the given set that belong to the corresponding group.

elemNrs( group,set)
Return the global element numbers for elements set in group

getElems( sets)
Return the definitions of the elements in sets.

sets should be a list of element sets with length equal to the number of element groups. Each set contains element numbers local to that group.

As the elements can be grouped according to plexitude, this function returns a list of element arrays matching the element groups in self.elems. Some of these arrays may be empty.

It also provide the global and group element numbers, since they had to be calculated anyway.

renumber( old=None,new=None)
Renumber a set of nodes.

old and new are equally sized lists with unique node numbers, each smaller that the number of nodes in the model. The old numbers will be renumbered to the new numbers. If one of the lists is None, a range with the length of the other is used. If the lists are shorter than the number of nodes, the remaining nodes will be numbered in an unspecified order. If both lists are None, the nodes are renumbered randomly.

This function returns a tuple (old,new) with the full renumbering vectors used. The first gives the old node numbers of the current numbers, the second gives the new numbers cooresponding with the old ones.