smish.dev
sum_factorization

Sum Factorization in FEM

 

Shape functions, ϕ, are the building blocks of the finite element method. They describe how to interpolate a nodal solution field in terms of the nodal values on an element, ue

u(ξ):=ϕ(ξ)ue

and evaluating these shape functions is part of every finite element calculation. For quadrilaterals, the shape functions for two commonly-used elements are:

 


 

quad4_nodesϕ(ξ):=[(1ξ)(1η)(1+ξ)(1η)(1ξ)(1+η)(1+ξ)(1+η)]


 

quad9_nodes ϕ(ξ):=[14(1ξ)ξ(1η)η12(1ξ2)(1η)η14(1+ξ)ξ(1η)η12(1ξ)ξ(1η2)(1ξ2)(1η2)12(1+ξ)ξ(1η2)14(1ξ)ξ(1+η)η12(1ξ2)(1+η)η14(1+ξ)ξ(1+η)η]


 

If we look closely, we can see that these shape functions can be factored into products of simpler 1D interpolating polynomials in each direction:

ϕ(ξ):=[14(1ξ)ξ(1η)η12(1ξ2)(1η)η14(1+ξ)ξ(1η)η12(1ξ)ξ(1η2)(1ξ2)(1η2)12(1+ξ)ξ(1η2)14(1ξ)ξ(1+η)η12(1ξ2)(1+η)η14(1+ξ)ξ(1+η)η]=[ψ1(ξ)ψ1(η)ψ2(ξ)ψ1(η)ψ3(ξ)ψ1(η)ψ1(ξ)ψ2(η)ψ2(ξ)ψ2(η)ψ3(ξ)ψ2(η)ψ1(ξ)ψ3(η)ψ2(ξ)ψ3(η)ψ3(ξ)ψ3(η)],whereψ(x):=[12(1x)x(1x2)12(1+x)x]

Or, equivalently, the shape function associated with node (i,j) in the element is given by:

ϕij(ξ,η):=ψi(ξ)ψj(η)

So, if we want to do a 2-dimensional interpolation, we can express it in terms of the composition of two 1-dimensional interpolations:

u=ijϕij(ξ,η)uijeu=ijψi(ξ)ψj(η)uijeu=iψi(ξ)(jψj(η)uije)u=iψi(ξ)(jψj(η)uije)

or in 3D,

u=iψi(ξ)(jψj(η)(kψk(ζ)uijke))

If it is also the case that our quadrature points can also be written as cartesian products of some 1D quadrature rule (e.g. ξq=(ξs,ξt) or ξq=(ξr,ξs,ξt)), then applying this sum factorization idea is beneficial for two reasons:

  1. it lets us calculate all the quadrature point values at the same time in an efficient way

    • in 2D, the naive algorithm of individually interpolating each quadrature point of a q×q rule from the n×n nodal values involves O(q2n2) operations, while the sum-factorization approach requires only O(nq(n+q)).

    • in 3D, the naive algorithm of individually interpolating each quadrature point of a q×q×q rule from the n×n×n nodal values takes O(q3n3) operations, while the sum-factorization approach requires only O(qn3+q2n2+q3n).

  2. we only need to store evaluations of ψ over the 1D quadrature rule

    • in 2D, there are n2 shape functions and q2 quadrature points, so the naive storage approach requires n2q2 values.

    • in 3D, there are n3 shape functions and q3 quadrature points, so the naive storage approach requires n3q3 values.

    • If we only need the 1D shape functions evaluated over the 1D quadrature points, we only have to store nq values, regardless of dimension.

 

Summary

Together, these two benefits make sum factorization a worthwhile optimization. However it is important to note that it is "fragile" and can only be used when all of the following requirements are met: