For computing the gradient of a scalar field, one can use the weighted least squares method as described here:
least squares gradient reconstruction
in the appendixpaper Revisiting the Least-squares Procedure for Gradient Reconstruction on Unstructured Meshes by Dimitri Mavriplis (pg.pdf page 23). How to go about reconstructing a gradient of a vector field? I've read here
My question is: How can I reconstruct a gradient of a vector field?
by J. De Keyser, et al., it seems that one could consider the vector field components as scalar fields and feed this to the gradgradient calculation, under some assumptions.
I'm writing currently a generic C++ method that is supposed to compute this, where the result rank is determined by outer product trait classes defined for all combinations available (scalar vector, vector-tensor, tensor-vector, vector-vector, etc). Any thoughts on how to approach this?