> So I've basically got a square domain [-1,1]^2 with
>
> curl(curl(u)) + u = f
>
> w/
> u(0) = cos(pi*x)*sin(pi*y) + C
> u(1) = -sin(pi*x)*cos(pi(y) + C
> f(0) = (2*pi^2 + 1)*cos(pi*x)*sin(pi*x) + C
> f(1) = -(2*pi^2 + 1)*sin(pi*x)*cos(pi(y) + C
>
> If C=0, then this is fine and I get the expected solution and convergence,
> etc. However, if C is set to any other value, then the boundary values seem to
> grow as the mesh is refined - see the values on the edges of the square from
> the VTK files, each cycle of refinement makes the value grow.
>
> Maybe my experience with Maxwell's equations is not enough, but I don't think
> this is an invalid solution, and I wouldn't expect this doubling even if I
> were using the wrong BCs/RHS - surely the solution should still converge to
> something?
>
> Anyway, see the attached code, I've left C as 0.1 (change bc_constant in the
> RightHandSide and ExactSolution classes) for now, although maybe it's more
> obvious that things are doubling with refinement with C=1
Ross -- with Markus's changes, this is the output I now get:
.......................
Cycle 0:
Number of active cells: 16
Number of degrees of freedom: 840
Cycle 1:
Number of active cells: 64
Number of degrees of freedom: 3280
Cycle 2:
Number of active cells: 256
Number of degrees of freedom: 12960
Cycle 3:
Number of active cells: 1024
Number of degrees of freedom: 51520
cycle cells dofs L2 Error
0 16 840 1.32580012e-04
1 64 3280 4.19612400e-06
2 256 12960 1.31545840e-07
3 1024 51520 4.11406879e-09
.........................
Is this correct? Assuming that it is, I've made this into a test for the
regression testsuite. Thanks a lot for the program!
Markus -- thanks a lot for fixing this!