69. plugins.fe
— 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.
69.1. Classes defined in module plugins.fe¶
-
class
plugins.fe.
FEModel
(meshes, fuse=True, **kargs)[source]¶ A base class for a Finite Element Model.
An FEModel is a collection of
Mesh
instances which share a single set of nodes.Examples
>>> from ..formex import Formex >>> M0 = Formex('4:01234412').toMesh().setProp(1) >>> M1 = Formex('3:027138').toMesh().setProp(2) >>> FEM = FEModel([M0,M1]) Finite Element Model Number of nodes: 7 Number of elements: 4 Number of element groups: 2 Number of elements per group: [2, 2] Plexitude of each group: [4, 3] >>> print(FEM.celems) [0 2 4] >>> print(FEM.coords) [[ 0. -1. 0.] [ 1. -1. 0.] [-1. 0. 0.] [ 0. 0. 0.] [ 1. 0. 0.] [ 0. 1. 0.] [ 1. 1. 0.]] >>> for e in FEM.elems: print(repr(e)) Elems([[3, 4, 6, 5], [3, 0, 1, 4]], eltype=Quad4) Elems([[3, 5, 2], [3, 2, 0]], eltype=Tri3) >>> for p in FEM.props(): print(p) [1 1] [2 2] >>> for M in FEM.meshes(): print(M) Mesh: nnodes: 7, nelems: 2, nplex: 4, level: 2, eltype: quad4 BBox: [-1. -1. 0.], [1. 1. 0.] Size: [2. 2. 0.] Length: 6.0 Area: 2.0 Mesh: nnodes: 7, nelems: 2, nplex: 3, level: 2, eltype: tri3 BBox: [-1. -1. 0.], [1. 1. 0.] Size: [2. 2. 0.] Length: 4.82... Area: 1.0 >>> glo, loc = FEM.splitElems([0,1,2]) >>> print(glo) [array([0, 1]), array([2])] >>> print(loc) [array([0, 1]), array([0])] >>> FEM.elemNrs(1,[0,1]) array([2, 3]) >>> FEM.getElems([[], [0,1]]) [Elems([], shape=(0, 4), eltype=Quad4), Elems([[3, 5, 2], [3, 2, 0]], eltype=Tri3)]
69.2. Functions defined in module plugins.fe¶
-
plugins.fe.
mergedModel
(meshes, **kargs)[source]¶ Returns the fe Model obtained from merging individual meshes.
The input arguments are (coords,elems) tuples. The return value is a merged fe Model.
-
plugins.fe.
Model
(coords, elems, prop=None, fuse=False, **kargs)[source]¶ Create an FEModel from a single Coords and multiple Elems.
This is a convenience function to create an FEModel from a single Coords block and a list of Elems, and avoid the fusing and renumbering of the nodes.
- Parameters
coords (Coords) – A single block of nodes shared by all the meshes in the model.
elems (list of Elems) – A list of element connectivity tables, that can have different element types.
prop (list of prop) – A list of prop arrays for the meshes. If props are specified, they need to be given for all the meshes.