I am having trouble about determining the system to solve when using finite element method for vector fields.
Suppose we have the following problem: $$-\Delta\mathbf{u}=\mathbf{f}\;\text{in}\;\Omega,$$ with some Dirichlet boundary conditions. The weak form would be: $$\int_{\Omega}\nabla\mathbf{u}:\nabla\mathbf{v}=\int_{\Omega}\mathbf{fv},$$ where $\nabla\mathbf{u}$ and $\nabla\mathbf{v}$ are matrices.
If we discretize the functions like this: $$\mathbf{u}^h=\sum_{j=1}^{N}\mathbf{u}_j\mathbf{\phi}_j,$$ where $N$ are the nodes of the discretization. Here is my first doubt, should be $\mathbf{\phi}_j$ scalar or vector valued function? In the first case I arrive to the following system of equation: $$\begin{pmatrix}A & 0\\ 0 & A\end{pmatrix} \begin{pmatrix}U^1\\U^2 \end{pmatrix}= \begin{pmatrix}f_1\phi_i\\ f_2\phi_i\end{pmatrix},$$where $A = \int\nabla\phi_i\nabla\phi_j$ and $f_1\phi_i,\;i,j=1...N$, is it correct?.
However, if $\mathbf{\phi}_j$ is a vector valued function then the discretization $u^h=\sum_{j=1}^{N}\mathbf{u}_j\cdot\mathbf{\phi}_j$ is not a vector but a scalar so I do not know what to do. Moreover, I do not know if it makes sense that $\mathbf{\phi}_j$ be a vector valued function.
Thanks!