Just forget to attach the mesh file generated using Gmsh. Jianan
在 2017年12月20日星期三 UTC-5上午12:56:11,Jianan Zhang写道: > > 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: > > > <https://lh3.googleusercontent.com/-OBpgHd_d1zc/Wjn4QmGmkYI/AAAAAAAAAIQ/jJ5M9dvfZMwveEkHfkTlyBARSuYERbEGQCLcBGAs/s1600/Picture1.png> > > > > > > > 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 > > <https://lh3.googleusercontent.com/-4-YDq6oGyq8/Wjn5pzuHvqI/AAAAAAAAAIg/X_p-s_5mmV8MhxyXB35InyJdzYKFU25wwCLcBGAs/s1600/Picture2.png> > > > <https://lh3.googleusercontent.com/-eGwOwq4oVpU/Wjn5-INq1CI/AAAAAAAAAIk/BXQVHh9_eZMxMD4x3U0pEOqFtDCOasbrgCLcBGAs/s1600/Picture3.png> > > > 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 > > > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
hollow_v2.msh
Description: Mesh model