The preceding examples are special cases of the Lagrange element. Consider a positive integer
k, the
order of the Lagrange element. For simplex mesh elements, the functions
u in this finite element space are piecewise polynomials of degree
k; that is, on each mesh element
u is a polynomial of degree
k. Also, in the following table,
l,
m, and
n are nonnegative integers. In general, for a mesh element of type
T,
u belongs to the Lagrange shape function space Lag
k(T), which is spanned by the following monomials (or rational functions, in the case of pyramid elements):
To describe such a function it suffices to give its values in the Lagrange points of order
k. These are the points whose local (element) coordinates are integer multiples of
1/
k. For example, for a triangular mesh in 2D with
k = 2, this means that you have node points at the corners and side midpoints of all mesh triangles. For each of these node points
pi, there exists a degree of freedom
Ui = u(
pi) and a basis function
. The restriction of the basis function
to a mesh element is a function in Lag
k(T) such that
at node
i, and
at all other nodes. The basis functions are continuous and you have
For order k = 1, the Lagrange shape space has dimension 2 and has the following basis:
For order k = 2 the Lagrange shape space has dimension 3 and has the following basis:
For order k = 1, the Lagrange shape space has dimension 3 and has the following basis:
For order k = 2, the Lagrange shape space has dimension 6 and has the following basis:
For order k = 1, the Lagrange shape space has dimension 4 and has the following basis:
For order k = 2, the Lagrange shape space has dimension 9 and has the following basis:
For order k = 1, the Lagrange shape space has dimension 4 and has the following basis:
For order k = 2, the Lagrange shape space has dimension 10 and has the following basis:
For order k = 1, the Lagrange shape space has dimension 8 and has the following basis:
Specify Lagrange elements in the model.shape field of the model object. The constructor of the Lagrange shape function is
shlag. The following properties are allowed:
The Lagrange element defines the following variables. Denote basename with
u, and let
x and
y denote (not necessarily distinct) spatial coordinates. The variables are (
sdim = space dimension and
edim = mesh element dimension):
•
|
ux, meaning the derivative of u with respect to x, defined on edim = sdim
|
•
|
uxy, meaning a second derivative, defined on edim = sdim
|
•
|
uTx, the tangential derivative variable, meaning the x-component of the tangential projection of the gradient, defined on edim < sdim
|
•
|
uTxy, meaning xy-component of the tangential projection of the second derivative, defined when edim < sdim
|
On each mesh element, the functions in the nodal serendipity finite element space is a subset of those of the Lagrange element. For simplex mesh elements, the functions u in this finite element space are piecewise polynomials of degree
k, where
k = 2, 3, or 4; that is, on each mesh element
u is a polynomial of degree
k. In the following table,
l,
m, and
n are nonnegative integers. Also, define a function
sl(
i) (for the superlinear order) such that
sl(
i) is equal to
i, if
i > 1; else
sl(
i) = 0. In general, for a mesh element of type
T,
u belongs to the nodal serendipity shape function space Ser
k(T), which is spanned by the following monomials (or rational functions, in the case of pyramid elements):
To describe such a function it suffices to give its values in the serendipity points of order
k, where
k is 2, 3, or 4. These points are a subset of the Lagrange points (see
The Lagrange Element). For each of these node points
pi, there exists a degree of freedom
Ui = u(
pi) and a basis function
. The restriction of the basis function
to a mesh element is a function in Lag
k(T) such that
at node
i, and
at all other nodes. The basis functions are continuous and you have
Specify serendipity shape functions in the model.shape field of the model object. The constructor of the serendipity shape function is
shnserp. The following properties are allowed:
The nodal serendipity element defines the following field variables. Denote basename with
u, and let
x and
y denote (not necessarily distinct) spatial coordinates. The variables are (
sdim = space dimension and
edim = mesh element dimension):
•
|
ux, meaning the derivative of u with respect to x, defined when edim = sdim or edim=0
|
•
|
uxy, meaning a second derivative, defined when edim = sdim
|
•
|
uTx, the tangential derivative variable, meaning the x-component of the tangential projection of the gradient, defined when 0 < edim < sdim
|
•
|
uTxy, meaning xy-component of the tangential projection of the second derivative, defined when edim < sdim
|
For a function represented with Lagrange elements, the first derivatives between mesh elements can be discontinuous. In certain equations (for example, the biharmonic equation) this can be a problem. The Argyris element has basis functions with continuous derivatives between mesh triangles (it is defined in 2D only). The second order derivative is continuous in the triangle corners. On each triangle, a function
u in the Argyris finite element space is a polynomial of degree 5 in the local coordinates.
Specify Argyris shape functions in the model.shape field of the model object. The constructor of the Argyris shape function is
sharg_2_5. The following properties are allowed:
•
|
ux and uy at corners, meaning derivatives of u
|
•
|
uxx, uxy, and uyy at corners, meaning second derivatives
|
•
|
un at side midpoints, meaning a normal derivative. The direction of the normal is to the right if moving along an edge from a corner with lower mesh vertex number to a corner with higher number
|
•
|
ux, meaning the derivative of u with respect to x
|
•
|
uxy, meaning a second derivative, defined for edim = sdim and edim = 0
|
•
|
uxTy, the tangential derivative variable, meaning the y-component of the tangential projection of the gradient of ux, defined for 0 < edim < sdim
|
On each mesh element, the functions in the Hermite finite element space are the same as for the Lagrange element, namely, all polynomials of degree (at most) k in the local coordinates. The difference lies in which DOFs are used. For the Hermite element, a DOF
u exists at each Lagrange point of order
k, except at those points adjacent to a corner of the mesh element. These DOFs are the values of the function. In addition, other DOFs exist for the first derivatives of the function (with respect to the global coordinates) at the corners (
ux and
uy in 2D). Together, these DOFs determine the polynomials completely. The functions in the Hermite finite element space have continuous derivatives between mesh elements at the mesh vertices. However, at other common points for two mesh elements, these derivatives are not continuous. You can think of the Hermite element as lying between the Lagrange and Argyris elements.
The Hermite element is available with all types of mesh elements except pyramids. The order k ≥ 3 can be arbitrary, but the available numerical integration formulas usually limits its usefulness to
k ≤ 5 (
k ≤ 4 for tetrahedral meshes).
When setting Dirichlet boundary conditions on a variable that has Hermite shape functions, a locking effect can occur if the boundary is curved and the constraint order cporder is the same as the order of the Hermite element. This means that the derivative becomes over constrained at mesh vertices at the boundary, due to the implementation of the boundary conditions. To prevent this locking, you can specify
cporder to be the element order minus 1.
Specify Hermite shape functions in the model.shape field of the model object. The constructor of the Hermite shape function is
shherm. The following properties are allowed:
•
|
The values of the first derivatives of basename with respect to the global spatial coordinates at each corner of the mesh element. The names of these derivatives are formed by appending the spatial coordinate names to basename.
|
The Hermite element defines the following field variables. Denote basename with
u, and let
x and
y denote (not necessarily distinct) spatial coordinates. The variables are (
sdim = space dimension and
edim = mesh element dimension):
•
|
ux, meaning the derivative of u with respect to x, defined when edim = sdim or edim=0
|
•
|
uxy, meaning a second derivative, defined when edim = sdim
|
•
|
uTx, the tangential derivative variable, meaning the x-component of the tangential projection of the gradient, defined when 0 < edim < sdim
|
•
|
uTxy, meaning xy-component of the tangential projection of the second derivative, defined when edim < sdim
|
Specify bubble shape functions in the model.shape field of the model object. The constructor of a bubble shape function is
shbub. The following properties are allowed:
The bubble element defines the following field variables. Denote basename with
u, and let
x and
y denote (not necessarily distinct) spatial coordinates. The variables are (
sdim = space dimension and
edim = mesh element dimension):
•
|
u, defined when edim ≤ mdim, u = 0 if edim < mdim.
|
•
|
ux, meaning the derivative of u with respect to x, defined when edim = mdim = sdim.
|
•
|
uTx, the tangential derivative variable, meaning the x-component of the tangential projection of the gradient, defined when mdim < sdim and edim ≤ mdim. uTx = 0 if edim < mdim.
|
•
|
uTxy, meaning the xy-component of the tangential projection of the second derivative, defined when mdim < sdim and edim ≤ mdim. uTxy = 0 if edim < mdim.
|
In electromagnetics, curl elements (also called
vector elements or
Nédélec’s edge elements) are widely used. Each mesh element has DOFs corresponding only to tangential components of the field. For example, in a tetrahedral mesh in 3D each of the three edges in a triangle face element has degrees of freedom that are tangential components of the vector field in the direction of the corresponding edges, and in the interior of the triangle there are degrees of freedom that correspond to vectors tangential to the triangle itself (if the element order is high enough). Finally, in the interior of the mesh tetrahedron there are degrees of freedom in all coordinate directions (if the element order is high enough). This implies that tangential components of the vector field are continuous across element boundaries, but the normal component is not necessarily continuous. This also implies that the curl of the vector field is an integrable function, so these elements are suitable for equations using the curl of the vector field.
where Lagk(T) is the Lagrange shape function space defined in the section on Lagrange shape functions. There is one exception; for pyramid mesh elements the definition needs to be modified as follows:
Next we introduce a transformation between local and global coordinates for a vector field in a mesh element T of dimension
d embedded in space of dimension
D. For a vector field in global coordinates
, the corresponding vector field in local coordinates is
with components defined by
For mesh elements of full dimension d = D, this relation can be inverted to give
In particular, if T has full dimension,
is a face or edge of
T, and
is a vector field on
T in local coordinates, then a vector field
can be computed, and from its restriction to
a vector field
in local coordinates on
.
The relation between DOFs and vector fields is defined by specifying in each mesh element a number of pairs (p, v), where
p is a point in the mesh element (given in local coordinates) and
v is a vector. The DOFs are then defined as
If the number of pairs in each mesh element of type T is chosen to be equal to the dimension of Curl
k(T), the values of these DOFs uniquely define the vector field
. Typically, some of the pairs
(p, v) have
p in the interior of
T, while others have
p on some face or edge
. It is convenient to think of the DOFs corresponding to the latter points as inherited from
.
Since there might be more than one DOF in the same point p, DOF names have a suffix consisting of two integers, to distinguish different DOFs at the same point.
The choice of pairs (p, v) must take into account the orientation of each mesh element. Failing to do this would result in a vector field whose tangential component changes direction at the boundary between mesh elements. This is done by means of a global numbering of all mesh vertices. These indices can be accessed by the API method
model.mesh(<tag>).getElem(<type>).
Each edge mesh element has k DOFs. Let
P0, P1 be the local coordinates of the endpoints of the edge, written in order of increasing mesh vertex indices (so
P0, P1 is some permutation of the points 0 and 1 on the real line). Let
v1 be the 1-dimensional vector
. In local coordinates, the DOFs on the edge element are defined by the following pairs
(p, v):
Each triangular mesh element has k DOFs on each edge (inherited from the corresponding edge elements), and
k ≥ 2k(k − 1) DOFs in the interior. Let
P0, P1, P2 be the local coordinates of the triangle vertices, in order of increasing mesh vertex indices (so
P0, P1, P2 is some permutation of the points (0, 0), (1, 0), (0, 1)). Let
and
. Then the interior DOFs in this triangle are defined by the following pairs
(p, v):
Each quadrilateral mesh element has k DOFs on each edge (inherited from the corresponding edge elements), and
2k(k − 1) DOFs in the interior. Let
P0 be the local coordinate of the vertex with lowest global index,
P1 the other vertex on the same horizontal edge as
P0, and
P2 the other vertex on the same vertical edge as
P0 (so
P0, P1, P2 is some subset of the points (0, 0), (1, 0), (0, 1), (1, 1)). Let
and
. Then the interior DOFs in this quadrilateral are defined by the following pairs
(p, v):
Each tetrahedral mesh element has k DOFs on each edge,
k(k − 1) DOFs on each face, and
k(k − 1)(k − 2)/2 DOFs in the interior. Let
P0, P1, P2, P3 be the local coordinates of the tetrahedron vertices, in order of increasing mesh vertex indices (so
P0, P1, P2, P3 is some permutation of the points (0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)). Let
Each hexahedral mesh element has k DOFs on each edge,
2k(k − 1) DOFs on each face, and
3k(k − 1)2 DOFs in the interior. Let
P0 be the local coordinate of the vertex with lowest global index, and let
P1, P2, P3 be the other vertices that differ from
P0 only in the
ξ1, ξ2, ξ3 coordinates respectively. Let
Each prism mesh element has k DOFs on each edge,
k(k − 1) DOFs on each triangular face,
2k(k − 1) DOFs on each quadrilateral face, and
k(k − 1)(3k − 4)/2 DOFs in the interior. Let
P0 be the local coordinate of the vertex with lowest global index, let
P1, P2 be the other two vertices on the same triangular face as
P0, numbered so that
P1 has lower index than
P2, and let
P3 be the third point connected to
P0 by an edge. Let
Each pyramid mesh element has k DOFs on each edge,
k(k − 1) DOFs on each triangular face,
2k(k − 1) DOFs on the quadrilateral face, and
k(k − 1)(2k − 1)/2 DOFs in the interior. Let
v1 = (1, 0, 0),
v2 = (0, 1, 0), and
v3 = (0, 0, 1). Then the interior DOFs in this pyramid are defined by the following pairs
(p, v):
For order k = 1, the Curl shape space has dimension 3, and has the following basis:
For order k = 2, the Curl shape space has dimension 8, and has the following basis:
For order k = 1 the Curl shape space has dimension 4, and has the following basis:
For order k = 2 the Curl shape space has dimension 12, and has the following basis:
The following formulas assume that the vertices of the tetrahedron, in order of increasing mesh vertex index, have local coordinates (0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1).
For order k = 1 the Curl shape space has dimension 6, and has the following basis:
The following formulas assume that the vertices of the hexahedron, in order of increasing mesh vertex index, have local coordinates (0, 0, 0), (1, 0, 0), (0, 1, 0), (1, 1, 0), (0, 0, 1), (1, 0, 1), (0, 1, 1), (1, 1, 1).
For order k = 1 the Curl shape space has dimension 12, and has the following basis:
Specify curl shape functions in the model.shape field of the model object. The constructor of the curl shape function is
shcurl. The following properties are allowed:
The default for compnames is
fieldname concatenated with the spatial coordinate names. The default for
dofbasename is
tallcomponents, where
allcomponents is the concatenation of the names in
compnames.
The property dcompnames lists the names of the component of the antisymmetric matrix
where Ai are the vector field components and
xi are the spatial coordinates. The components are listed in row order. If a name is the empty string, the field variable corresponding to that component is not defined. If you have provided
compnames, the default for the entries in
dcompnames is
compnames(j) sdimnames(i) compnames(i) sdimnames(j) for off-diagonal elements. If only
fieldname has been given, the default for the entries are
dfieldname sdimnames(i)sdimnames(j). Diagonal elements are not defined per defaults. For example,
shcurl('order',3,'fieldname','A','dcompnames', {'','','curlAy','curlAz','','','','curlAx',''}).
The curl element defines the following degrees of freedom: dofbasename d c, where
d = 1 for DOFs in the interior of an edge,
d = 2 for DOFs in the interior of a surface, and so forth, and
c is a number between 0 and
d − 1.
The curl element defines the following field variables (where comp is a component name from
compnames, and
dcomp is a component from
dcompnames,
sdim = space dimension and
edim = mesh element dimension):
•
|
comp, meaning a component of the vector, defined when edim = sdim.
|
•
|
tcomp, meaning one component of the tangential projection of the vector onto the mesh element, defined when edim < sdim.
|
•
|
compx, meaning the derivative of a component of the vector with respect to global spatial coordinate x, defined when edim = sdim.
|
•
|
tcompTx, the tangential derivative variable, meaning the x component of the projection of the gradient of tcomp onto the mesh element, defined when edim < sdim. Here, x is the name of a spatial coordinate.
|
•
|
dcomp, meaning a component of the anti-symmetrized gradient, defined when edim = sdim.
|
•
|
tdcomp, meaning one component of the tangential projection of the anti-symmetrized gradient onto the mesh element, defined when edim < sdim.
|
For performance reasons, use dcomp in expressions involving the curl rather than writing it as the difference of two gradient components.
Specify discontinuous shape functions in the model.shape field of the model object. The constructor of the discontinuous shape functions is either
shdisc or
shhwdisc. The difference between these two is that the latter has optimal placement of degrees of freedom on triangle and tetrahedral meshes with respect to certain interpolation error estimates, whereas the former are available on all types of mesh elements with arbitrary polynomial order
k. However, the available numerical integration formulas usually limits the usefulness to
k ≤ 5 (
k ≤ 4 for tetrahedral meshes). The following properties are allowed:
The discontinuous element defines the following field variables. Denote basename with
u, and let
x denote the spatial coordinates. The variables are (
edim is the mesh element dimension):
•
|
u, defined when edim = mdim.
|
•
|
ux, meaning the derivative of u with respect to x, defined when edim = mdim = sdim.
|
•
|
uTx, the tangential derivative variable, meaning the derivative of u with respect to x, defined when edim = mdim < sdim.
|
The discontinuous elements are available with all types of mesh elements. The order k can be arbitrary, but the available numerical integration formulas usually limits its usefulness to
k ≤ 5 (
k ≤ 4 for tetrahedral meshes).
Specify density shape functions in the model.shape field of the model object. The constructor of the density shape function is
shdens. The following properties are allowed:
The density element defines the following field variables. Denote basename with
u, and let
x denote the spatial coordinates. The variables are (
edim is the mesh element dimension):
•
|
u, defined when edim = sdim.
|
•
|
ux, meaning the derivative of u with respect to x, defined when edim = sdim.
|
Specify Gauss point data shape functions in the model.shape field of the model object. The constructor of the density shape function is
shgp. The following properties are allowed:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value type in case of using split representation of complex variables 1
|
•
|
u, defined when edim <= mdim.
|
For modeling the B (magnetic flux density) and
D (electric displacement) fields in electromagnetics, the divergence elements are useful. The DOFs on the boundary of a mesh element correspond to normal components of the field. In addition, there are DOFs corresponding to all vector field components in the interior of the mesh element of dimension
sdim (if the order is high enough). This implies that the normal component of the vector field is continuous across element boundaries, but the tangential components are not necessarily continuous. This also implies that the divergence of the vector field is an integrable function, so these elements are suitable for equations using the divergence of the vector field.
Specify divergence shape functions in the model.shape field of the model object. The constructor of the divergence shape function is
shdiv. The following properties are allowed:
The default for compnames is
fieldname concatenated with the spatial coordinate names. The default for
dofbasename is
nallcomponents, where
allcomponents is the concatenation of the names in
compnames.
The vector element defines the following degrees of freedom: dofbasename on element boundaries, and
dofbasename sdim c,
c =
0, …,
sdim − 1 for DOFs in the interior.
The divergence element defines the following field variables (where comp is a component name from
compnames,
divname is the
divname,
sdim = space dimension and
edim = mesh element dimension):
•
|
comp, meaning a component of the vector, defined when edim = sdim.
|
•
|
ncomp, meaning one component of the projection of the vector onto the normal of mesh element, defined when edim = sdim – 1.
|
•
|
compx, meaning the derivative of a component of the vector with respect to global spatial coordinate x, defined when edim = sdim.
|
•
|
ncompTx, the tangential derivative variable, meaning the x component of the projection of the gradient of ncomp onto the mesh element, defined when edim < sdim. Here, x is the name of a spatial coordinate. ncompTx = 0.
|
•
|
divname, means the divergence of the vector field.
|
For performance reasons, prefer using divname in expressions involving the divergence rather than writing it as the sum of
sdim gradient components.