Element#

This module provides classes for the finite element formulations.

Linear Elements

Line()

A 1D line element formulation with linear shape functions.

Quad()

A 2D quadrilateral element formulation with linear shape functions.

Hexahedron()

A 3D hexahedron (brick) element formulation with linear shape functions.

Triangle()

A 2D triangle element formulation with linear shape functions.

Tetra()

A 3D tetrahedron element formulation with linear shape functions.

Constant Elements

ConstantQuad()

A 2D quadrilateral element formulation with constant shape functions.

ConstantHexahedron()

A 3D hexahedron (brick) element formulation with constant shape functions.

Quadratic Elements

QuadraticQuad()

A 2D quadrilateral element formulation with quadratic (serendipity) shape functions.

QuadraticHexahedron()

A 3D hexahedron (brick) element formulation with quadratic (serendipity) shape functions.

BiQuadraticQuad()

A 2D quadrilateral element formulation with bi-quadratic shape functions.

TriQuadraticHexahedron()

A 3D hexahedron (brick) element formulation with tri-quadratic shape functions.

QuadraticTriangle()

A 2D triangle element formulation with quadratic shape functions.

QuadraticTetra()

A 3D tetrahedron element formulation with quadratic shape functions.

Bubble-Enriched Elements

TriangleMINI([bubble_multiplier])

A 2D triangle element formulation with bubble-enriched linear shape functions.

TetraMINI([bubble_multiplier])

A 3D tetrahedron element formulation with bubble-enriched linear shape functions.

Arbitrary-Order Elements

element.ArbitraryOrderLagrange(order, dim[, ...])

A n-dimensional Lagrange finite element (e.g. line, quad or hexahdron) of arbitrary order.

Detailed API Reference

class felupe.Line[source]#

Bases: Element

A 1D line element formulation with linear shape functions.

Notes

The linear line element is defined by two points (0-1). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r)\).

\[\begin{split}\boldsymbol{h}(r) = \frac{1}{2} \begin{bmatrix} (1-r) \\ (1+r) \end{bmatrix}\end{split}\]

References

function(rv)[source]#

Return the shape functions at given coordinates (r,).

gradient(rv)[source]#

Return the gradient of shape functions at given coordinates (r,).

class felupe.Quad[source]#

Bases: Element

A 2D quadrilateral element formulation with linear shape functions.

Notes

The quadrilateral element is defined by four points (0-3). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\).

\[\begin{split}\boldsymbol{h}(r,s) = \frac{1}{4} \begin{bmatrix} (1-r) (1-s) \\ (1+r) (1-s) \\ (1+r) (1+s) \\ (1-r) (1+s) \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.Quad()
>>> element.plot().show()
../_images/element-1_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.Hexahedron[source]#

Bases: Element

A 3D hexahedron (brick) element formulation with linear shape functions.

Notes

The hexahedron element is defined by eight points (0-7) where (0,1,2,3) forms the base and (4,5,6,7) the opposite quad. [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\).

\[\begin{split}\boldsymbol{h}(r,s,t) = \frac{1}{8} \begin{bmatrix} (1-r) (1-s) (1-t) \\ (1+r) (1-s) (1-t) \\ (1+r) (1+s) (1-t) \\ (1-r) (1+s) (1-t) \\ (1-r) (1-s) (1+t) \\ (1+r) (1-s) (1+t) \\ (1+r) (1+s) (1+t) \\ (1-r) (1+s) (1+t) \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.Hexahedron()
>>> element.plot().show()
../_images/element-2_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.Triangle[source]#

Bases: Element

A 2D triangle element formulation with linear shape functions.

Notes

The triangle element is defined by three points (0-2). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\) [2]_.

\[\begin{split}\boldsymbol{h}(r,s) = \begin{bmatrix} 1-r-s \\ r \\ s \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.Triangle()
>>> element.plot().show()
../_images/element-3_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.Tetra[source]#

Bases: Element

A 3D tetrahedron element formulation with linear shape functions.

Notes

The tetrahedron element is defined by four points (0-3). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\).

\[\begin{split}\boldsymbol{h}(r,s,t) = \begin{bmatrix} 1-r-s-t \\ r \\ s \\ t \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.Tetra()
>>> element.plot().show()
../_images/element-4_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.ConstantQuad[source]#

Bases: Element

A 2D quadrilateral element formulation with constant shape functions.

Notes

The quadrilateral element is defined by four points (0-3). [1]

The shape function \(h\) is given in terms of the coordinates \((r,s)\).

\[h(r,s) = 1\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.ConstantQuad()
>>> element.plot().show()
../_images/element-5_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.ConstantHexahedron[source]#

Bases: Element

A 3D hexahedron (brick) element formulation with constant shape functions.

Notes

The hexahedron element is defined by eight points (0-7) where (0,1,2,3) forms the base and (4,5,6,7) the opposite quad. [1]

The shape function \(h\) in terms of the coordinates \((r,s,t)\) is constant and hence, its gradient is zero.

\[h(r,s,t) = 1\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.ConstantHexahedron()
>>> element.plot().show()
../_images/element-6_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.QuadraticHexahedron[source]#

Bases: Element

A 3D hexahedron (brick) element formulation with quadratic (serendipity) shape functions.

Notes

The hexahedron element is defined by twenty points with eight corner points (0-7) where (0,1,2,3) forms the base and (4,5,6,7) the opposite quad; followed by 12 mid- edge points. The mid-edge points correspond to the edges defined by the lines between the points (0,1), (1,2), (2,3), (3,0), (4,5), (5,6), (6,7), (7,4), (0,4), (1,5), (2,6), (3,7). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\)..

Examples

>>> import felupe as fem
>>>
>>> element = fem.QuadraticHexahedron()
>>> element.plot().show()
../_images/element-7_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.TriQuadraticHexahedron[source]#

Bases: Element

A 3D hexahedron (brick) element formulation with tri-quadratic shape functions.

Notes

The hexahedron element is defined by 27 points. This includes 8 corner points, 12 mid-edge points, 6 mid-face points and one mid-volume point. The ordering of the 27 points defining the element is point ids (0-7,8-19, 20-25, 26) where point ids 0-7 are the eight corner vertices of the cube; followed by twelve midedge points (8-19); followed by 6 mid-face points (20-25) and the last point (26) is the mid-volume point. Note that these mid-edge points correspond to the edges defined by (0,1), (1,2), (2,3), (3,0), (4,5), (5,6), (6,7), (7,4), (0,4), (1,5), (2,6), (3,7). The mid-surface points lie on the faces defined by (first edge point id’s, than mid-edge point id’s): (0,1,5,4;8,17,12,16), (1,2,6,5;9,18,13,17), (2,3,7,6,10,19,14,18), (3,0,4,7;11,16,15,19), (0,1,2,3;8,9,10,11), (4,5,6,7;12,13,14,15). The last point lies in the center (0,1,2,3,4,5,6,7). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\).

Examples

>>> import felupe as fem
>>>
>>> element = fem.TriQuadraticHexahedron()
>>> element.plot().show()
../_images/element-8_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.QuadraticQuad[source]#

Bases: Element

A 2D quadrilateral element formulation with quadratic (serendipity) shape functions.

Notes

The quadratic (serendipity) quadrilateral element is defined by eight points (0-7). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\).

Examples

>>> import felupe as fem
>>>
>>> element = fem.QuadraticQuad()
>>> element.plot().show()
../_images/element-9_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.BiQuadraticQuad[source]#

Bases: Element

A 2D quadrilateral element formulation with bi-quadratic shape functions.

Notes

The bi-quadratic quadrilateral element is defined by nine points (0-8). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\).

Examples

>>> import felupe as fem
>>>
>>> element = fem.BiQuadraticQuad()
>>> element.plot().show()
../_images/element-10_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.QuadraticTriangle[source]#

Bases: Element

A 2D triangle element formulation with quadratic shape functions.

Notes

The quadratic triangle element is defined by six points (0-5). The element includes three mid-edge points besides the three triangle vertices. The ordering of the three points defining the element is point ids (0-2,3-5) where id #3 is the mid-edge point between points (0,1); id #4 is the mid-edge point between points (1,2); and id #5 is the mid-edge point between points (2,0). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\) [2]_.

\[\begin{split}\boldsymbol{h}(r,s) = \begin{bmatrix} 1-r-s \\ r \\ s \\ 4 r (1-r-s) \\ 4 r s \\ 4 s (1-r-s) \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.QuadraticTriangle()
>>> element.plot().show()
../_images/element-11_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.QuadraticTetra[source]#

Bases: Element

A 3D tetrahedron element formulation with quadratic shape functions.

Notes

The quadratic tetrahedron element is defined by ten points (0-9). The element includes a mid-edge point on each of the edges of the tetrahedron. The ordering of the ten points defining the cell is point ids (0-3,4-9) where ids 0-3 are the four tetra vertices; and point ids 4-9 are the mid-edge points between (0,1), (1,2), (2,0), (0,3), (1,3), and (2,3). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\).

\[\begin{split}\boldsymbol{h}(r,s,t) = \begin{bmatrix} t_1 (2 t_1 - 1) \\ t_2 (2 t_2 - 1) \\ t_3 (2 t_3 - 1) \\ t_4 (2 t_4 - 1) \\ 4 t_1 t_2 \\ 4 t_2 t_3 \\ 4 t_3 t_1 \\ 4 t_1 t_4 \\ 4 t_2 t_4 \\ 4 t_3 t_4 \end{bmatrix}\end{split}\]

with

\[ \begin{align}\begin{aligned}t_1 &= 1 - r - s - t\\t_2 &= r\\t_3 &= s\\t_4 &= t\end{aligned}\end{align} \]

Examples

>>> import felupe as fem
>>>
>>> element = fem.QuadraticTetra()
>>> element.plot().show()
../_images/element-12_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.TriangleMINI(bubble_multiplier=1.0)[source]#

Bases: Element

A 2D triangle element formulation with bubble-enriched linear shape functions.

Notes

The MINI triangle element is defined by four points (0-3). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s)\).

\[\begin{split}\boldsymbol{h}(r,s) = \begin{bmatrix} 1-r-s \\ r \\ s \\ r s (1-r-s) \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.TriangleMINI()
>>> element.plot().show()
../_images/element-13_00_00.png

References

function(rs)[source]#

Return the shape functions at given coordinates (r, s).

gradient(rs)[source]#

Return the gradient of shape functions at given coordinates (r, s).

class felupe.TetraMINI(bubble_multiplier=1.0)[source]#

Bases: Element

A 3D tetrahedron element formulation with bubble-enriched linear shape functions.

Notes

The MINI tetrahedron element is defined by five points (0-4). [1]

The shape functions \(\boldsymbol{h}\) are given in terms of the coordinates \((r,s,t)\).

\[\begin{split}\boldsymbol{h}(r,s,t) = \begin{bmatrix} 1-r-s-t \\ r \\ s \\ t \\ r s t (1-r-s-t) \end{bmatrix}\end{split}\]

Examples

>>> import felupe as fem
>>>
>>> element = fem.TetraMINI()
>>> element.plot().show()
../_images/element-14_00_00.png

References

function(rst)[source]#

Return the shape functions at given coordinates (r, s, t).

gradient(rst)[source]#

Return the gradient of shape functions at given coordinates (r, s, t).

class felupe.element.ArbitraryOrderLagrange(order, dim, interval=(-1, 1), permute=True)[source]#

Bases: Element

A n-dimensional Lagrange finite element (e.g. line, quad or hexahdron) of arbitrary order.

Notes

Polynomial shape functions

The basis function vector is generated with row-stacking of the individual lagrange polynomials. Each polynomial defined in the interval \([-1,1]\) is a function of the parameter \(r\). The curve parameters matrix \(\boldsymbol{A}\) is of symmetric shape due to the fact that for each evaluation point \(r_j\) exactly one basis function \(h_j(r)\) is needed.

\[\boldsymbol{h}(r) = \boldsymbol{A}^T \boldsymbol{r}(r)\]

Curve parameter matrix

The evaluation of the curve parameter matrix \(\boldsymbol{A}\) is carried out by boundary conditions. Each shape function \(h_i\) has to take the value of one at the associated nodal coordinate \(r_i\) and zero at all other point coordinates.

\[ \begin{align}\begin{aligned}\boldsymbol{A}^T \boldsymbol{R} &= \boldsymbol{I} \qquad \text{with} \qquad \boldsymbol{R} = \begin{bmatrix}\boldsymbol{r}(r_1) & \boldsymbol{r}(r_2) & \dots & \boldsymbol{r}(r_p)\end{bmatrix}\\\boldsymbol{A}^T &= \boldsymbol{R}^{-1}\end{aligned}\end{align} \]

Interpolation and partial derivatives

The approximation of nodal unknowns \(\hat{\boldsymbol{u}}\) as a function of the parameter \(r\) is evaluated as

\[\boldsymbol{u}(r) \approx \hat{\boldsymbol{u}}^T \boldsymbol{h}(r)\]

For the calculation of the partial derivative of the interpolation field w.r.t. the parameter \(r\) a simple shift of the entries of the parameter vector is enough. This shifted parameter vector is denoted as \(\boldsymbol{r}^-\). A minus superscript indices the negative shift of the vector entries by \(-1\).

\[ \begin{align}\begin{aligned}\frac{\partial \boldsymbol{u}(r)}{\partial r} &\approx \hat{\boldsymbol{u}}^T \frac{\partial \boldsymbol{h}(r)}{\partial r}\\\frac{\partial \boldsymbol{h}(r)}{\partial r} &= \boldsymbol{A}^T \boldsymbol{r}^-(r) \qquad \text{with} \qquad r_0^- = 0 \qquad \text{and} \qquad r_i^- = \frac{r^{(i-1)}}{(i-1)!} \qquad \text{for} \qquad i=(1 \dots p)\end{aligned}\end{align} \]

n-dimensional shape functions#

Multi-dimensional shape function matrices \(\boldsymbol{H}_{2D}, \boldsymbol{H}_{3D}\) are simply evaluated as dyadic (outer) vector products of one-dimensional shape function vectors. The multi- dimensional shape function vector is a one-dimensional representation (flattened version) of the multi-dimensional shape function matrix.

\[ \begin{align}\begin{aligned}\boldsymbol{H}_{2D}(r,s) &= \boldsymbol{h}(r) \otimes \boldsymbol{h}(s)\\\boldsymbol{H}_{3D}(r,s,t) &= \boldsymbol{h}(r) \otimes \boldsymbol{h}(s) \otimes \boldsymbol{h}(t)\end{aligned}\end{align} \]

Examples

>>> import felupe as fem
>>>
>>> element = fem.ArbitraryOrderLagrangeElement(order=4, dim=2)
>>> element.plot().show()
../_images/element-15_00_00.png
>>> import felupe as fem
>>>
>>> element = fem.ArbitraryOrderLagrangeElement(order=3, dim=3)
>>> element.plot().show()
../_images/element-16_00_00.png
function(r)[source]#

Return the shape functions at given coordinate vector r.

gradient(r)[source]#

Return the gradient of shape functions at given coordinate vector r.