Hi, all,
I am using dealii to solve the curl-curl equation:
curl(mu^(-1)curl(E)) + (-omega^2*epsilon+j*omega*sigma)*E=0,
with boundary conditions: n x E = n X F , (Dirichlet)
or n X (curl(E)) = n X (curl(F)) (Neumann)
where F is a known exact solution.
Following Ross Kynch's code, I implemented my own exact solution and the assembly of system of equations my self. The exact solution (including real and imaginary parts) is as follows:
E_re = [0, sin(pi*x)/a*cos(k_z10_re*z)*exp(k_z10_im*z), 0],
E_im = [0, -sin(pi*x)/a*sin(k_z10_re*z)*exp(k_z10_im*z), 0]
The exact solution for Ross Kynch's case (take p=[0 1 0] and k=[0 0 0.1]) is given by:
E_re = [0, cos(0.1*z), 0],
E_im = [0, sin(0.1*z), 0]
The domain I want to solve this problem is a 3D hyperrectangle with width = 19.05e-3, height = 9.524e-3, and length = 15.24e-3. I've tried to solve the above equation with these two exact solutions. When I used the build-in mesh generator in dealii (i.e., GridGenerator::hyper_rectangle (triangulation, p1, p2);) to generate the mesh. The problem can be solved correctly. The results are given below:
my exact solution, built-in mesh generator:

Ross' exact solution, built-in mesh generator:
Cycle 0:Number of degrees of freedom: 3888
Done
cycle cells dofs L2 Error H(curl) Error
0 64 3888 9.73783895e-12 1.03298196e-11
When I use the mesh generated from Gmsh software (after conversion into hexes), if I give Ross' exact solution, the problem can still be solved correctly, as shown bellow:
Cycle 0:number of cells:244
Number of degrees of freedom: 13176
Done
cycle cells dofs L2 Error H(curl) Error
0 244 13176 1.36020912e-07 8.58355818e-05
However, when I switch to my exact solution, the results are totally wrong. The electric field obtained has totally wrong direction (seems to be arbitrary but the correct one should be along y-axis). The results are as follows
I've spent like ten days finding the reason, and I am almost 100% sure that my exact solution is given correctly and the assembly is correct. The only thing I changed is the exact solution, and the difference between his and mine is that his is only z-component dependent while mine depend on both x and z.
I post my codes and the vtk files for anyone who are interested. I am having a hard time on debugging this and any suggestions and help is much appreciated.
Thanks in advance.
Jianan Zhang