Git reference: Benchmark nonsym-check.
This example uses a nonsymmetric equation and its purpose is to check that nonsymmetric problems are solved correctly.
Equation solved:
(1)-\Delta u + \frac{\partial u}{\partial x} = f.
Domain of interest: Square domain (0, \pi) x (0, \pi).
Right-hand side:
(2)f(x, y) = sin(x) + cos(x).
(3)u(x,y) = sin(x).
In the code:
// Exact solution.
static double fn(double x, double y)
{
return sin(x);
}
static double fndd(double x, double y, double& dx, double& dy)
{
dx = cos(x);
dy = 0;
return fn(x, y);
}
Boundary conditions: Zero Dirichlet on left edge, zero Neumann on top and bottom edges, nonzero Neumann on the right edge (all matching exact solution).
Final mesh (h-FEM with linear elements):
Final mesh (h-FEM with quadratic elements):
Final mesh (hp-FEM):
DOF convergence graphs:
CPU time convergence graphs: