Computation of shape functions
Shape functions are approximations of linear partial differential operators in given points.
Derivation
Let \mathcal{L} be a linear partial differential operator. We wish to approximate (\mathcal{L}u)(\vec{p}) using only values of u in support of p. To do so, we construct a MLS approximation (see ) and compute the coefficients \b{\alpha}, such that \hat{u}(\vec{p}) = \b{b}(\vec{p})^\T \b{\alpha}. The coefficients are computed by solving a system WB \b{\alpha} = W\b{u} using the pseudoinverse \b{\alpha} = (WB)^+W\b{u},
We have defined \b{\chi} to be \b{\chi}(\vec{p}) = \b{b}(\vec{p})^\T (WB)^+W.
The same approach works for any linear operator \mathcal L applied to u, just replace every b_i in definition of \b{\chi} with \mathcal Lb_i. For example, take a 1-dimensional case for approximation of derivatives with weight equal to 1 and n=m=3, with equally spaced support values at distances h. We wish to approximate u'' in the middle support point, just by making a weighted sum of the values, something like the finite difference u'' \approx \frac{u_1 - 2u_2 + u_3}{h^2}.
The fact that \b{\chi} is independent of the function values \b{u} but depend only on domain geometry means that we can just compute the shape functions \b{\chi} for points of interest and then approximate any linear operator of any function, given its values, very fast, using only a single dot product.
Numerical calculation of the shape functions
The expression \b{\chi}(\vec{p}) = \b{b}(\vec{p})^\T (WB)^+W
Invertible B case: If B is invertible, then \b{\chi}(\vec{p}) = \b{b}(\vec{p})^\T B^{-1}, transposing the equation then multiplying it from the left by B, \b{\chi} can be thought as a solution of a system B^\T\chi(\vec{p})^\T = \b{b}(\vec{p}), which can be solved using LU or Cholesky decomposition for example.
General case: For a system written as Ax = b, where A is a n\times m matrix, x is a vector of length m and b a vector of length n, a generalized solution is defined as x that minimizes \|A x - b\|_2^2. If more x attain the minimal value, x with the minimal \|x\| is chosen. Note that this generalizes the solution a general system (A is invertible) and over-determined system (n > m and A has full rank). Such an x can be computed using the pseudoinverse x = A^{+} b.
In our case, let us denote a part of the solution containing the pseudoinverse by \tilde{\b{\chi}}. \b{\chi}(\vec{p}) = \underbrace{\b{b}(\vec{p})^\T (WB)^+}_{\tilde{\b{\chi}}} W