The terms $\,+fu=g\,$ are easy, so we shall do them first.
It is argued in this
answer @ MSE
that integration (points) at the vertices of a finite element are often the best.
Accompanying pictures are inserted here too for convenience:
An interesting consequence is splitting of the quadrilateral in four linear triangles:
This makes the discretization of the terms $\,+fu=g\,$ extremely simple:
$$
+ \frac{1}{4} \begin{bmatrix} f_1\cdot\Delta_1 & 0 & 0 & 0 \\
0 & f_2\cdot\Delta_2 & 0 & 0 \\
0 & 0 & f_3\cdot\Delta_3 & 0 \\
0 & 0 & 0 & f_4\cdot\Delta_4 \end{bmatrix}
\begin{bmatrix} u_1 \\ u_2 \\ u_3 \\ u_4 \end{bmatrix} =
\frac{1}{4} \begin{bmatrix} g_1\cdot\Delta_1 \\ g_2\cdot\Delta_2 \\ g_3\cdot\Delta_3 \\ g_4\cdot\Delta_4 \end{bmatrix}
$$
Here $\Delta_k$ is twice the area of the triangle numbered as $(k)$.
The diffusion term has the form:
$$
\frac{\partial Q_x}{\partial x} + \frac{\partial Q_y}{\partial y}
$$
with
$$
\begin{bmatrix} Q_x \\ Q_y \end{bmatrix} =
\begin{bmatrix} a & c/2 \\ c/2 & b \end{bmatrix}
\begin{bmatrix} \partial u / \partial x \\ \partial u/ \partial y \end{bmatrix}
$$
If $\,u\,$ is interpreted as a temperature then this may be considered as a heat flow $\,\vec{Q}\,$
in a medium with anisotropic conductivity.
In this way, the diffusion term can be treated with the standard Galerkin method, exactly as in the abovementioned
reference, or according to an answer
at MSE
with very much the same content.
With help of the differentiation matrix, for each (of the four !) triangles in our basic quadrilateral, the $3 \times 3$ Finite Element matrix for diffusion alone
is like this, with $\Delta/2 = $ area of a triangle : $\Delta/4 \times$
$$ -
\begin{bmatrix} (y_2 - y_3) & -(x_2 - x_3) \\
(y_3 - y_1) & -(x_3 - x_1) \\
(y_1 - y_2) & -(x_1 - x_2) \end{bmatrix} / \Delta
\begin{bmatrix} a & c/2 \\ c/2 & b \end{bmatrix}
\begin{bmatrix} +(y_2 - y_3) & +(y_3 - y_1) & +(y_1 - y_2) \\
-(x_2 - x_3) & -(x_3 - x_1) & -(x_1 - x_2) \end{bmatrix} /\Delta
$$
And take notice of the minus sign!
The Finite Element
assembly scheme
is thus employed at an elementary level, using the topology:
1 2 3 2 4 1 3 1 4 4 3 2Our Ansatz for the advection element matrix resembles the one for diffusion, but without the OP's $(a,b,c)$ tensor: $$ M = - \frac{\Delta}{4} \times \begin{bmatrix} +(y_2 - y_3) & -(x_2 - x_3) \\ +(y_3 - y_1) & -(x_3 - x_1) \\ +(y_1 - y_2) & -(x_1 - x_2) \end{bmatrix} / \Delta \begin{bmatrix} +(y_2 - y_3) & +(y_3 - y_1) & +(y_1 - y_2) \\ -(x_2 - x_3) & -(x_3 - x_1) & -(x_1 - x_2) \end{bmatrix} /\Delta $$ Now determine the values of $D(x,y)$ and $E(x,y)$ at the midpoints $(x,y)$ of each of the triangle edges $(i,j) = (1,2) \to (2,3) \to (3,1)$ and form the inner products: $$ P_{ij} = D(x,y)(x_j-x_i)+E(x,y)(y_j-y_i) $$ Then multiply these contributions with the Ansatz, while using an upwind scheme , for $i \ne j$ : $$ M_{ij} := M_{ij}\times\max(0,-P_{ij}) \quad ; \quad M_{ji} := M_{ji}\times\max(0,-P_{ji}) $$ The main diagonal terms must be made equal to minus the sum of the off-diagonal terms in order to finish the advection matrix.