There are no surface element shape functions. There are, however, the normal shape functions.
Load the package:
Needs["NDSolve`FEM`"]
This gives you the shape functions for implemented elements (see documentation)
elementOrder = 1;
ElementShapeFunction[TriangleElement, elementOrder][r, s]
{1 - r - s, r, s}
ElementShapeFunction[TriangleElement, 2][r, s]
{1 + 2 r^2 - 3 s + 2 s^2 + r (-3 + 4 s), r (-1 + 2 r),
s (-1 + 2 s), -4 r (-1 + r + s), 4 r s, -4 s (-1 + r + s)}
This gives you the derivative of the shape function:
ElementShapeFunctionDerivative[TriangleElement, elementOrder][r, s]
{{-1, 1, 0}, {-1, 0, 1}}
This gives you the integrated shape function:
integrationOrder = 2;
IntegratedShapeFunction[TriangleElement, elementOrder, \
integrationOrder]
{{{0.6666666666666667`, 0.16666666666666666`,
0.16666666666666666`}}, {{0.1666666666666667`, 0.6666666666666666`,
0.16666666666666666`}}, {{0.16666666666666674`,
0.16666666666666666`, 0.6666666666666666`}}}
These are the integration points and weights:
ElementIntegrationPoints[TriangleElement, integrationOrder]
{{0.16666666666666666`, 0.16666666666666666`}, {0.6666666666666666`,
0.16666666666666666`}, {0.16666666666666666`, 0.6666666666666666`}}
ElementIntegrationWeights[TriangleElement, integrationOrder]
{0.16666666666666666`, 0.16666666666666666`, 0.16666666666666666`}
New shape functions can be found with FindShapeFunction
. For that we need the base polynomial they should use and the base coordinates of the element.
MeshElementBasePolynomial[TriangleElement, elementOrder, {r, s}]
{1, r, s}
MeshElementBasePolynomial[TriangleElement, 2, {r, s}]
{1, r, s, r^2, r s, s^2}
MeshElementBaseCoordinates[TriangleElement, elementOrder]
{{0, 0}, {1, 0}, {0, 1}}
FindShapeFunction[
MeshElementBasePolynomial[TriangleElement, elementOrder, {r, s}],
MeshElementBaseCoordinates[TriangleElement, elementOrder], {r, s}]
{1 - r - s, r, s}
So if we want to find the shape function of a nine node quad element we use the 2nd order quad element add a coordinate and a term to the polynomial:
qp = Join[MeshElementBasePolynomial[QuadElement, 2, {r, s}], {r^2*s^2}]
{1, r, s, r s, r^2, r^2 s, r s^2, s^2, r^2 s^2}
qc = Join[MeshElementBaseCoordinates[QuadElement, 2], {{0, 0}}]
{{-1, -1}, {1, -1}, {1, 1}, {-1, 1}, {0, -1}, {1, 0}, {0, 1}, {-1,
0}, {0, 0}}
sf = FindShapeFunction[qp, qc, {r, s}]
{1/4 (-1 + r) r (-1 + s) s, 1/4 r (1 + r) (-1 + s) s,
1/4 r (1 + r) s (1 + s),
1/4 (-1 + r) r s (1 + s), -(1/2) (-1 + r^2) (-1 + s) s, -(1/2)
r (1 + r) (-1 + s^2), -(1/2) (-1 + r^2) s (1 + s), -(1/
2) (-1 + r) r (-1 + s^2), (-1 + r^2) (-1 + s^2)}
This new shape function evaluates to 1 at the nodes and the sum is 1:
Function[{r, s}, Evaluate[sf]] @@@ qc
{{1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1,
0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0,
0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0,
0}, {0, 0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1}}
Total[sf] // Simplify
1
Update:
Let's look at how the shape functions are used to map the integration points into each element in global space.
Make a mesh:
order = 1;
mesh = ToElementMesh[Disk[], "MeshOrder" -> order];
mesh["Wireframe"]

Get the integrated shape function:
intOrder = 4;
isf = IntegratedShapeFunction[TriangleElement, order, intOrder];
As a side note, the integrated shape function is the same as the shape function evaluated at the integration points of the mother element:
sf = ElementShapeFunction[TriangleElement, order];
sf[r, s]
ip = ElementIntegrationPoints[TriangleElement, intOrder];
isf[[All, 1]] === (sf @@@ ip)
Get the element coordinates:
coords = mesh["Coordinates"];
eleCoords =
GetElementCoordinates[coords,
ElementIncidents[mesh["MeshElements"]][[1]]];
Map the integrated shape functions into the elements:
mappedCoords = (isf[[All, 1]] . #) & /@ eleCoords;
These are the coordinates at which the PDE coefficients are evaluated, for a shape function of order and an integration order of intOrder
.
Visualize the mapped integration points:
Show[Graphics[{Red, Point /@ mappedCoords}], mesh["Wireframe"]]
