Suppose we have a triangular mesh of a two dimensional shape $\Omega$, and on this mesh we define a P1 finite element structure. I know that given $u,v$ by their values at the vertices of the triangles, we can compute $\int_\Omega \nabla u \cdot \nabla v$ using the stiffness matrix $A = (\int_\Omega \nabla \varphi_i\cdot \nabla\varphi_j)$ (where $\varphi_i$ is the P1 basis). This makes it possible to find expressions of the form $\int_\Omega |\nabla u|^2$ if $u$ is known at the triangle vertices.How can we compute the approximation of the gradient $\nabla u$, given the values of $u$ on the points?I know that the gradient of $\varphi_i$ is constant on each triangle, but how do we need to combine these gradients for heighboring triangles, such that the value we obtain in the end is relevant.The purpose of doing this: I would like to integrate a quantity of the form $\int_\Omega \varphi(\nabla u)^2$, where $\varphi$ is a norm, different from the euclidean one. Now that I think about it, I guess it is necessary to compute the matrix $A = \int_\Omega b(\nabla \varphi_i,\nabla \varphi_j)$, where $b$ is the scalar product associated to $\varphi$. 
Find the direction of the gradient on a finite element mesh
finite element