Git reference: Benchmark nist-10.
This example is an extension of Boundary Line Singularity (NIST-07) with an anisotropic solution to allow for a sloped line so that the singularity does not necessarily coincide with element edges.
Equation solved: Poisson equation
(1)-\Delta u = f.
Domain of interest: (-1, 1)^2.
Boundary conditions: Dirichlet, given by exact solution.
u(x,y) = \cos(Ky)\ \ \ \mbox{for}\ x \le 0,\\ u(x,y) = \cos(Ky) + x^{\alpha}\ \ \ \mbox{for}\ x > 0,
where K and \alpha are real constants.
Right-hand side: Obtained by inserting the exact solution into the equation. The corresponding code snippet is shown below:
{
public:
CustomRightHandSide(double k, double alpha)
: DefaultNonConstRightHandSide(), k(k), alpha(alpha) {
cef = new CustomExactFunction(k, alpha);
};
virtual double value(double x, double y) const {
if (x < 0) return cef->fn(x, y) * k * k;
else return cef->fn(x, y) * k * k
- alpha *(alpha - 1) * pow(x, alpha - 2.)
- k * k * pow(x, alpha);
}
Final mesh (h-FEM, p=1, anisotropic refinements):
Final mesh (h-FEM, p=2, anisotropic refinements):
Final mesh (hp-FEM, h-anisotropic refinements):
DOF convergence graphs:
CPU convergence graphs:
Final mesh (hp-FEM, isotropic refinements):
Final mesh (hp-FEM, h-anisotropic refinements):
Final mesh (hp-FEM, hp-anisotropic refinements):
DOF convergence graphs:
CPU convergence graphs: