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
Element base class: an empty element.
All derived classes should have a capitalized name: starting with an uppercase character and further only lower case and digits.
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 by:
>>> printElementTypes()
Available Element Types:
0-dimensional elements: ['point']
1-dimensional elements: ['line2', 'line3']
2-dimensional elements: ['tri3', 'tri6', 'quad4', 'quad6', 'quad8', 'quad9']
3-dimensional elements: ['tet4', 'tet10', 'tet14', 'tet15', 'wedge6', 'hex8', 'hex16', 'hex20', 'icosa']
Optional attributes:
Conversion actions:
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.
Functions defined in module elements
Return the requested element type
Parameters:
Returns: a subclass of Element
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 availabale element types, grouped by their dimensionality.