39. fe — Finite Element Models in pyFormex.

Finite Element Models in pyFormex.

Finite element models are geometrical models that consist of a unique set of nodal coordinates and one of more sets of elements.

class fe.Model(coords, elems)

Contains all FE model data.

Methods

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.

Methods

Model objects have the following methods:

nnodes()
Return the number of nodes in the model.
nelems()
Return the number of elements in the model.
ngroups()
Return the number of element groups in the model.
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.

Functions defined in the module fe

fe.mergeModels(femodels)
fe.mergedModel(meshes)

Returns the fe Model obtained from merging individual models.

The input arguments are (coords,elems) tuples. The return value is a merged fe Model.

Documentation

Previous topic

38. properties — General framework for attributing properties to geometrical elements.

Next topic

40. fe_abq — An interface to write Finite Element models in Abaqus input file format.

This Page