Reference cells

The reference cells are used to i) define grid cells, ii) define shape functions, and iii) define quadrature rules. The numbering of vertices, edges, faces are visualized below. See also FerriteViz.elementinfo.

Numbering and identification of entities

The local numbering of vertices, edges, and faces, on the reference cells, specifies, for example, the cell node order, and the order in which interpolations distribute their DoFs. It is important for internal consistency and correctness that the the same convention is used everywhere. The convention adopted by Ferrite.jl is documented below for each reference cell.

Edges are identified by the 2-tuple of vertices that the edge connects, $(v_i, v_j)$, where the order of the vertices defines the direction of the edge.

Faces are identified by the n-tuple of vertices constructing the face, $(v_i, v_j, v_k, ...)$, in anti-clockwise order when viewing the face from the outside of the reference cell (i.e. such that the implied face normal points out of the cell).

Reference cell implementations

Reference line

Numbering of the vertices and the edge for the reference line. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (-1, ), \quad \boldsymbol{\xi}_2 = ( 1, )\]

Edge identifiers

\[e_1 = (v_1, v_2)\]

Reference triangle

Numbering of the vertices, edges, and the face for the reference triangle. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (1, 0), \quad \boldsymbol{\xi}_2 = (0, 1), \quad \boldsymbol{\xi}_3 = (0, 0)\]

Edge identifiers

\[e_1 = (v_1, v_2), \quad e_2 = (v_2, v_3), \quad e_3 = (v_3, v_1)\]

Face identifier

\[f_1 = (v_1, v_2, v_3)\]

Reference quadrilateral

Numbering of the vertices, edges, and the face for the reference quadrilateral. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (-1, -1), \quad \boldsymbol{\xi}_2 = ( 1, -1), \quad \boldsymbol{\xi}_3 = ( 1, 1), \quad \boldsymbol{\xi}_4 = (-1, 1)\]

Edge identifiers

\[e_1 = (v_1, v_2), \quad e_2 = (v_2, v_3), \quad e_3 = (v_3, v_4), \quad e_4 = (v_4, v_1)\]

Face identifier

\[f_1 = (v_1, v_2, v_3, v_4)\]

Reference tetrahedron

Numbering of the vertices, edges, faces, and the volume for the reference tetrahedron. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (0, 0, 0), \quad \boldsymbol{\xi}_2 = (1, 0, 0), \quad \boldsymbol{\xi}_3 = (0, 1, 0), \quad \boldsymbol{\xi}_4 = (0, 0, 1)\]

Edge identifiers

\[e_1 = (v_1, v_2), \quad e_2 = (v_2, v_3), \quad e_3 = (v_3, v_1), \quad e_4 = (v_1, v_4), \quad e_5 = (v_2, v_4), \quad e_6 = (v_3, v_4)\]

Face identifiers

\[f_1 = (v_1, v_3, v_2), \quad f_2 = (v_1, v_2, v_4), \quad f_3 = (v_2, v_3, v_4), \quad f_4 = (v_1, v_4, v_3)\]

Reference hexahedron

Numbering of the vertices, edges, faces, and the volume for the reference hexahedron. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (-1, -1, -1), \quad \boldsymbol{\xi}_2 = ( 1, -1, -1), \quad \boldsymbol{\xi}_3 = ( 1, 1, -1), \quad \boldsymbol{\xi}_4 = (-1, 1, -1), \\ \boldsymbol{\xi}_5 = (-1, -1, 1), \quad \boldsymbol{\xi}_6 = ( 1, -1, 1), \quad \boldsymbol{\xi}_7 = ( 1, 1, 1), \quad \boldsymbol{\xi}_8 = (-1, 1, 1)\]

Edge identifiers

\[e_1 = (v_1, v_2), \quad e_2 = (v_2, v_3), \quad e_3 = (v_3, v_4), \quad e_4 = (v_4, v_1), \quad e_5 = (v_5, v_6), \quad e_6 = (v_6, v_7), \\ e_7 = (v_7, v_8), \quad e_8 = (v_8, v_5), \quad e_9 = (v_1, v_5), \quad e_{10} = (v_2, v_6), \quad e_{11} = (v_3, v_7), \quad e_{12} = (v_4, v_8)\]

Face identifiers

\[f_1 = (v_1, v_4, v_3, v_2), \quad f_2 = (v_1, v_2, v_6, v_5), \quad f_3 = (v_2, v_3, v_7, v_6), \\ f_4 = (v_3, v_4, v_8, v_7), \quad f_5 = (v_1, v_5, v_8, v_4), \quad f_6 = (v_5, v_6, v_7, v_8)\]

Reference prism

Numbering of the vertices, edges, faces, and the volume for the reference prism. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (0, 0, 0), \quad \boldsymbol{\xi}_2 = (1, 0, 0), \quad \boldsymbol{\xi}_3 = (0, 1, 0), \\ \boldsymbol{\xi}_4 = (0, 0, 1), \quad \boldsymbol{\xi}_5 = (1, 0, 1), \quad \boldsymbol{\xi}_6 = (0, 1, 1)\]

Edge identifiers

\[e_1 = (v_2, v_1), \quad e_2 = (v_1, v_3), \quad e_3 = (v_1, v_4), \quad e_4 = (v_3, v_2), \quad e_5 = (v_2, v_5), \\ e_6 = (v_3, v_6), \quad e_7 = (v_4, v_5), \quad e_8 = (v_4, v_6), \quad e_9 = (v_6, v_5)\]

Face identifiers

\[f_1 = (v_1, v_3, v_2), \quad f_2 = (v_1, v_2, v_5, v_4), \quad f_3 = (v_3, v_1, v_4, v_6), \\ f_4 = (v_2, v_3, v_6, v_5), \quad f_5 = (v_4, v_5, v_6)\]

Reference pyramid

Numbering of the vertices, edges, faces, and the volume for the reference pyramid. Source: DefElement (CC BY 4.0) [1].

Vertex coordinates

\[\boldsymbol{\xi}_1 = (0, 0, 0), \quad \boldsymbol{\xi}_2 = (1, 0, 0), \quad \boldsymbol{\xi}_3 = (0, 1, 0), \\ \boldsymbol{\xi}_4 = (1, 1, 0), \quad \boldsymbol{\xi}_5 = (0, 0, 1)\]

Edge identifiers

\[e_1 = (v_1, v_2), \quad e_2 = (v_1, v_3), \quad e_3 = (v_1, v_5), \quad e_4 = (v_2, v_4), \\ e_5 = (v_2, v_5), \quad e_6 = (v_4, v_3), \quad e_7 = (v_3, v_5), \quad e_8 = (v_4, v_5)\]

Face identifiers

\[f_1 = (v_1, v_3, v_4, v_2), \quad f_2 = (v_1, v_2, v_5), \quad f_3 = (v_1, v_5, v_3), \\ f_4 = (v_2, v_4, v_5), \quad f_5 = (v_3, v_5, v_4)\]

AbstractRefShape subtypes

Ferrite.AbstractRefShapeType
AbstractRefShape{refdim}

Supertype for all reference shapes with reference dimension refdim. Reference shapes are used to define grid cells, interpolations, and quadrature rules.

Currently implemented reference shapes are: RefLine, RefTriangle, RefQuadrilateral, RefTetrahedron, RefHexahedron, RefPrism, and RefPyramid.

Examples

# Create a 1st order Lagrange interpolation on the reference triangleinterpolation = Lagrange{2, RefTriangle, 1}()# Create a 2nd order quadrature rule for the reference quadrilateralquad_rule = Quadrature{2, RefQuadrilateral}(2)

Implementation details can be found in the devdocs section on Reference cells.

source
Ferrite.RefLineType
RefLine <: AbstractRefShape{1}

Reference line/interval, alias for RefHypercube{1}. See AbstractRefShape documentation for details.

Extended help

----------------+--------------------Vertex numbers: | Vertex coordinates:  1-------2     | v1: 𝛏 = (-1.0,)    --> ξ₁      | v2: 𝛏 = ( 1.0,)----------------+--------------------Edge numbers:   | Edge identifiers:  +---1---+     | e1: (v1, v2)----------------+--------------------
source
Ferrite.RefTriangleType
RefTriangle <: AbstractRefShape{2}

Reference triangle, alias for RefSimplex{2}. See AbstractRefShape documentation for details.

Extended help

----------------+--------------------Vertex numbers: | Vertex coordinates:    2           |    | \         | v1: 𝛏 = (1.0, 0.0)    |   \       | v2: 𝛏 = (0.0, 1.0)ξ₂^ |     \     | v3: 𝛏 = (0.0, 0.0)  | 3-------1   |  +--> ξ₁       |----------------+--------------------Edge numbers:   | Edge identifiers:    +           |    | \         | e1: (v1, v2)    2   1       | e2: (v2, v3)    |     \     | e3: (v3, v1)    +---3---+   |----------------+--------------------Face numbers:   | Face identifiers:    +           |    | \         |    |   \       | f1: (v1, v2, v3)    |  1  \     |    +-------+   |----------------+--------------------
source
Ferrite.RefQuadrilateralType
RefQuadrilateral <: AbstractRefShape{2}

Reference quadrilateral, alias for RefHypercube{2}. See AbstractRefShape documentation for details.

Extended help

----------------+---------------------Vertex numbers: | Vertex coordinates:    4-------3   |    |       |   | v1: 𝛏 = (-1.0, -1.0)    |       |   | v2: 𝛏 = ( 1.0, -1.0)ξ₂^ |       |   | v3: 𝛏 = ( 1.0,  1.0)  | 1-------2   | v4: 𝛏 = (-1.0,  1.0)  +--> ξ₁       |----------------+---------------------Edge numbers:   | Edge identifiers:    +---3---+   | e1: (v1, v2)    |       |   | e2: (v2, v3)    4       2   | e3: (v3, v4)    |       |   | e4: (v4, v1)    +---1---+   |----------------+---------------------Face numbers:   | Face identifiers:    +-------+   |    |       |   |    |   1   |   | f1: (v1, v2, v3, v4)    |       |   |    +-------+   |----------------+---------------------
source
Ferrite.RefTetrahedronType
RefTetrahedron <: AbstractRefShape{3}

Reference tetrahedron, alias for RefSimplex{3}. See AbstractRefShape documentation for details.

Extended help

---------------------------------------+-------------------------Vertex numbers:                        | Vertex coordinates:             4                4        |  ^ ξ₃      /  \             /| \      |  v1: 𝛏 = (0.0, 0.0, 0.0)  |        /     \          / |   \    |  v2: 𝛏 = (1.0, 0.0, 0.0)  +-> ξ₂  /        \       /  1___  \  |  v3: 𝛏 = (0.0, 1.0, 0.0) /       /      __--3     / /    __‾-3 |  v4: 𝛏 = (0.0, 0.0, 1.0)ξ₁      2 __--‾‾         2/__--‾‾      |---------------------------------------+-------------------------Edge numbers:                          | Edge identifiers:             +                +        | e1: (v1, v2)            /  \             /| \      | e2: (v2, v3)         5 /     \ 6      5 / |4  \ 6  | e3: (v3, v1)          /        \       /  +__3  \  | e4: (v1, v4)         /      __--+     / /1   __‾-+ | e5: (v2, v4)        + __--‾‾2        +/__--‾‾2     | e6: (v3, v4)---------------------------------------+-------------------------Face numbers:                          | Face identifiers:             +                +        |            /  \             /| \      | f1: (v1, v3, v2)           /     \          / | 4 \    | f2: (v1, v2, v4)          /   3    \       /2 +___  \  | f3: (v2, v3, v4)         /      __--+     / /  1 __‾-+ | f4: (v1, v4, v3)        + __--‾‾         +/__--‾‾      |---------------------------------------+-------------------------
source
Ferrite.RefHexahedronType
RefHexahedron <: AbstractRefShape{3}

Reference hexahedron, alias for RefHypercube{3}. See AbstractRefShape documentation for details.

Extended help

-----------------------------------------+-----------------------------Vertex numbers:                          | Vertex coordinates:            5--------8        5--------8 | v1: 𝛏 = (-1.0, -1.0, -1.0)           /        /|       /|        | | v2: 𝛏 = ( 1.0, -1.0, -1.0)          /        / |      / |        | | v3: 𝛏 = ( 1.0,  1.0, -1.0)  ^ ξ₃   6--------7  |     6  |        | | v4: 𝛏 = (-1.0,  1.0, -1.0)  |      |        |  4     |  1--------4 | v5: 𝛏 = (-1.0, -1.0,  1.0)  +-> ξ₂ |        | /      | /        /  | v6: 𝛏 = ( 1.0, -1.0,  1.0) /       |        |/       |/        /   | v7: 𝛏 = ( 1.0,  1.0,  1.0)ξ₁       2--------3        2--------3    | v8: 𝛏 = (-1.0,  1.0,  1.0)-----------------------------------------+-----------------------------Edge numbers:                            | Edge identifiers:            +----8---+        +----8---+ |          5/        /|      5/|        | |  e1: (v1, v2),  e2: (v2, v3)          /       7/ |12    / |9     12| |  e3: (v3, v4),  e4: (v4, v1)         +----6---+  |     +  |        | |  e5: (v5, v6),  e6: (v6, v7)         |        |  +     |  +---4----+ |  e7: (v7, v8),  e8: (v8, v5)       10|      11| /    10| /1       /  |  e9: (v1, v5), e10: (v2, v6)         |        |/3      |/        /3  | e11: (v3, v7), e12: (v4, v8)         +---2----+        +---2----+    |-----------------------------------------+-----------------------------Face numbers:                            | Face identifiers:            +--------+        +--------+ |           /   6    /|       /|        | |  f1: (v1, v4, v3, v2)          /        / |      / |   5    | |  f2: (v1, v2, v6, v5)         +--------+ 4|     +  |        | |  f3: (v2, v3, v7, v6)         |        |  +     |2 +--------+ |  f4: (v3, v4, v8, v7)         |    3   | /      | /        /  |  f5: (v1, v5, v8, v4)         |        |/       |/    1   /   |  f6: (v5, v6, v7, v8)         +--------+        +--------+    |-----------------------------------------+-----------------------------
source
Ferrite.RefPrismType
RefPrism <: AbstractRefShape{3}

Reference prism. See AbstractRefShape documentation for details.

Extended help

-----------------------------------------+----------------------------Vertex numbers:                          | Vertex coordinates:            4-------/6       4--------6  |           /     /   |      /|        |  |  v1: 𝛏 = (0.0, 0.0, 0.0)          /   /      |     / |        |  |  v2: 𝛏 = (1.0, 0.0, 0.0)  ^ ξ₃   5 /         |    5  |        |  |  v3: 𝛏 = (0.0, 1.0, 0.0)  |      |          /3    |  1-------/3  |  v4: 𝛏 = (0.0, 0.0, 1.0)  +-> ξ₂ |       /        | /     /      |  v5: 𝛏 = (1.0, 0.0, 1.0) /       |    /           |/   /         |  v6: 𝛏 = (0.0, 1.0, 1.0)ξ₁       2 /              2 /            |-----------------------------------------+----------------------------Edge numbers:                            | Edge identifiers:            +---8---/+       +---8----+  |          7/     /   |     7/|        |  | e1: (v2, v1),  e2: (v1, v3)          /   / 9    |6    / |3       |6 | e3: (v1, v4),  e4: (v3, v2)         + /         |    +  |        |  | e5: (v2, v5),  e6: (v3, v6)         |          /+    |  +--2----/+  | e7: (v4, v5),  e8: (v4, v6)        5|       /       5| /1    /      | e9: (v6, v5)         |    / 4         |/   / 4       |         + /              + /            |-----------------------------------------+----------------------------Face numbers:                            | Face identifiers:            +-------/+       +--------+  |           /  5  /   |      /|        |  | f1: (v1, v3, v2)          /   /      |     / |    3   |  | f2: (v1, v2, v5, v4)         + /         |    +  |        |  | f3: (v3, v1, v4, v6)         |     4    /+    |2 +-------/+  | f4: (v2, v3, v6, v5)         |       /        | /  1  /      | f5: (v4, v5, v6)         |    /           |/   /         |         + /              + /            |-----------------------------------------+----------------------------
source
Ferrite.RefPyramidType
RefPyramid <: AbstractRefShape{3}

Reference pyramid. See AbstractRefShape documentation for details.

Extended help

The base is a quadrilateral (vertices v1–v4) and v5 is the apex, located directly above v1.

-----------------------------------------+----------------------------Vertex coordinates:                      | Edge identifiers:                                         |  v1: 𝛏 = (0.0, 0.0, 0.0)                | e1: (v1, v2),  e2: (v1, v3)  v2: 𝛏 = (1.0, 0.0, 0.0)                | e3: (v1, v5),  e4: (v2, v4)  v3: 𝛏 = (0.0, 1.0, 0.0)                | e5: (v2, v5),  e6: (v4, v3)  v4: 𝛏 = (1.0, 1.0, 0.0)                | e7: (v3, v5),  e8: (v4, v5)  v5: 𝛏 = (0.0, 0.0, 1.0)                |                                         | Face identifiers:                                         | f1: (v1, v3, v4, v2)  (base)                                         | f2: (v1, v2, v5)                                         | f3: (v1, v5, v3)                                         | f4: (v2, v4, v5)                                         | f5: (v3, v5, v4)-----------------------------------------+----------------------------
source

Required methods to implement for all subtypes of AbstractRefShape to define a new reference shape

which automatically defines

Applicable methods to AbstractRefShapes

[1]: All figures from DefElement are used under CC BY 4.0. The figures are modified to follow Ferrite.jl numbering, to use ($\xi_1$, $\xi_2$, $\xi_3$) for the coordinate axes, and to use Julia logo colors.