Lagrange shape functions and their first and second derivatives on the reference elements of the finite element method, including mapped infinite elements.
A shapefunc evaluates the shape functions of an
element at the points of a cubature, together with
and .
The reference elements and coordinates are those of the cubatures
package.
| Constant | Element | Reference domain | Nodes, order | Orders |
|---|---|---|---|---|
CUB_LIN |
line | |||
CUB_QUA |
quadrilateral | |||
CUB_HEX |
hexahedron | |||
CUB_TRI |
triangle | |||
CUB_TET |
tetrahedron | |||
CUB_WED |
wedge / prism | triangle |
Lines, quadrilaterals and hexahedra use tensor products of Lagrange polynomials on equispaced nodes; order 0 is the constant function with one node at the centre. Triangles and tetrahedra use the complete polynomials of total degree in the barycentric coordinates (Silvester's polynomials [5]); wedges use the triangle functions times Lagrange polynomials in the axial coordinate. There is no upper limit on the order, but equispaced interpolation becomes ill-conditioned at high orders.
With family = SHP_SERENDIPITY, quadrilaterals and hexahedra of order
1 to 3 have nodes on their vertices and edges only: 4, 8 and 12 nodes
for quadrilaterals, 8, 20 and 32 for hexahedra. They span the
serendipity space: the monomials of superlinear degree [7].
Each serendipity function is a fixed combination of the tensor-product
Lagrange functions of the same order, computed once by set.
Serendipity elements must be finite.
Every shape function is a product of one-dimensional functions of factor coordinates , which are affine in :
Node has one integer lattice index per factor coordinate, and . Derivatives follow from the product rule and the constant .
Nodes are numbered hierarchically: vertices, then edge nodes, then face nodes, then interior nodes.
| Element | Edges |
|---|---|
| quadrilateral | 1-2, 2-3, 3-4, 4-1 |
| hexahedron | 1-2, 2-3, 3-4, 4-1, 5-6, 6-7, 7-8, 8-5, 1-5, 2-6, 3-7, 4-8 |
| triangle | 1-2, 2-3, 3-1 |
| tetrahedron | 1-2, 2-3, 3-1, 1-4, 2-4, 3-4 |
| wedge | 1-2, 2-3, 3-1, 4-5, 5-6, 6-4, 1-4, 2-5, 3-6 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | SHP_FIN | = | 1 |
Finite direction: Lagrange polynomials on |
| integer, | public, | parameter | :: | SHP_INF | = | 2 |
Infinite direction, mapping functions for coordinates |
| integer, | public, | parameter | :: | SHP_CHP | = | 3 |
Infinite direction, chopped functions for the solution |
| integer, | public, | parameter | :: | SHP_LAGRANGE | = | 1 |
Full Lagrange (tensor-product or complete) elements |
| integer, | public, | parameter | :: | SHP_SERENDIPITY | = | 2 |
Serendipity quadrilaterals and hexahedra, orders 1 to 3 |
Construct shape functions, e.g. shapefunc(q, 2),
shapefunc(q, 1, [SHP_FIN, SHP_INF]) or
shapefunc(q, 2, family=SHP_SERENDIPITY, nodes=perm)
Construct shape functions of order order at the points of q; see set
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(cubature), | intent(in) | :: | q |
Cubature on the reference element |
||
| integer, | intent(in) | :: | order |
Polynomial order |
||
| integer, | intent(in), | optional | :: | infin(:) |
Infinitude, |
|
| integer, | intent(in), | optional | :: | family |
|
|
| integer, | intent(in), | optional | :: | nodes(:) |
Node ordering: |
Shape functions and derivatives of one element type and order at the points of a cubature.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | elm | = | 0 |
Element type, |
|
| integer, | public | :: | dim | = | 0 |
Spatial dimension |
|
| integer, | public | :: | order | = | 0 |
Polynomial order |
|
| integer, | public | :: | family | = | SHP_LAGRANGE |
|
|
| integer, | public | :: | nnodes | = | 0 |
Number of nodes |
|
| integer, | public | :: | npoints | = | 0 |
Number of cubature points |
|
| integer, | public | :: | infin(3) | = | SHP_FIN |
Infinitude per direction, |
|
| integer, | public, | allocatable | :: | lattice(:,:) |
Lattice indices, shape |
||
| real(kind=rk), | public, | allocatable | :: | coords(:,:) |
Nodal coordinates, shape |
||
| real(kind=rk), | public, | allocatable | :: | func(:,:) |
Values , shape |
||
| real(kind=rk), | public, | allocatable | :: | derv(:,:,:) |
First derivatives , shape |
||
| real(kind=rk), | public, | allocatable | :: | curv(:,:,:,:) |
Second derivatives ,
shape |
Construct shape functions, e.g. shapefunc(q, 2),
shapefunc(q, 1, [SHP_FIN, SHP_INF]) or
shapefunc(q, 2, family=SHP_SERENDIPITY, nodes=perm)
| private pure function new_shapefunc (q, order, infin, family, nodes) | Construct shape functions of order |
| procedure, public :: set | Build the shape functions in place |
| procedure, public :: eval | Evaluate at any point of the reference element |
| procedure, public :: is_valid | True if set and consistent |
| procedure, public :: summary | Write element, order, family, infinitude, nodes, points |
| procedure, public :: show | Write the summary, values and first derivatives |
| procedure, public :: numbering | Write the summary and the nodal coordinates |
| procedure, public :: destroy | Deallocate and reset |