This library contains an implementation of the finite element method utilizing Lagrange and hierarchical basis functions to solve the convection-diffusion problem in 1D, 2D and 3D using various geometric shapes including both triangular and rectangular elements.
To run a convection-diffusion problem
\begin{equation}a(x)\cdot\nabla u(x) - \nabla\cdot\kappa(x)\nabla u(x) = f(x), \mspace{15mu}\text{in the unit domain }\mspace{15mu}\Omega=[0,1]\end{equation}
with $a(x)=[1,1]$ and $\kappa(x)=1$ using the finite element method with bilinear basis functions on rectangles, you need to construct a mesh and specify the coefficients in a (cpp) file.
This will declare a solver for a scalar problem on a rectangular mesh. The last parameter corresponds to the type of the solution, i.e. vector<double> means that the solution is stored in a array of doubles.
This will create a mesh with 32x32 elements in the unit domain.
Now to declare various parameters for a problem functions in the form func(Element Material, Node Material, Point) are being used.
Finally, to find the solution the following command is used
I use Matplot++ to plot the solution
The full code is