This modules allows for a consistent local numbering scheme of element connectivities throughout pyFormex. When interfacing with other programs, one should be aware that conversions may be necessary. Conversions to/from external programs should be done by the interface modules.
Classes defined in module elements
Base class for element type classes.
Element type data are stored in a class derived from ElementType. The derived element type classes contain only static data. No instances of these classes should be created. The base class defines the access methods, which are all class methods.
Derived classes should be created by calling the function createElementType().
Each element is defined by the following attributes:
The vertices of the elements are defined in a unit space [0,1] in each axis direction.
The elements guarantee a fixed local numbering scheme of the vertices. One should however not rely on a specific numbering scheme of edges, faces or elements.
For solid elements, it is guaranteed that the vertices of all faces are numbered in a consecutive order spinning positively around the outward normal on the face.
The list of available element types can be found from:
>>> printElementTypes()
Available Element Types:
0-dimensional elements: ['Point']
1-dimensional elements: ['Line2', 'Line3', 'Line4']
2-dimensional elements: ['Tri3', 'Tri6', 'Quad4', 'Quad6', 'Quad8', 'Quad9']
3-dimensional elements: ['Tet4', 'Tet10', 'Tet14', 'Tet15', 'Wedge6', 'Hex8', 'Hex16', 'Hex20', 'Hex27', 'Icosa']
Optional attributes:
Conversion actions:
Return the plexitude of the element
Return the plexitude of the element
Return the plexitude of the element
Return the type and connectivity table of some element entities.
The full list of entities with increasing dimensionality 0,1,2,3 is:
['points', 'edges', 'faces', 'cells' ]
If level is negative, the dimensionality returned is relative to the highest dimensionality (.i.e., that of the element). If it is positive, it is taken absolute.
Thus, for a 3D element type, getEntities(-1) returns the faces, while for a 2D element type, it returns the edges. For both types however, getLowerEntities(+1) returns the edges.
The return value is a dict where the keys are element types and the values are connectivity tables. If reduce == False: there will be only one connectivity table and it may include degenerate elements. If reduce == True, an attempt is made to reduce the degenerate elements. The returned dict may then have multiple entries.
If the requested entity level is outside the range 0..ndim, the return value is None.
Returns the local connectivity for drawing the element’s faces
Convert the element type to a Mesh.
Returns a Mesh with a single element of natural size.
Convert the element type to a Formex.
Returns a Formex with a single element of natural size.
Return the lowercase name of the element.
For compatibility, name() returns the lower case version of the ElementType’s name. To get the real name, use the attribute __name__ or format the ElementType as a string.
Functions defined in module elements
Return the requested element type
Parameters:
Returns a subclass of ElementType.
Errors:
If neither name nor nplex can resolve into an element type, an error is raised.
Example:
>>> elementType('tri3').name()
'tri3'
>>> elementType(nplex=2).name()
'line2'
Return the names of available elements.
If a value is specified for ndim, only the elements with the matching dimensionality are returned.
Print all available element types.
Prints a list of the names of all available element types, grouped by their dimensionality.