In the code, I do the decoupling operation, which involves the exact solution with respect to the values of u. I used two types of code to solve these two models, but the convergence order obtained using “Problem” was correct, while it was incorrect when changed to “varf”.
Another difference is that in one file you have [u1,u2,u3]=(Et(0.)+1.)*u1Exact; and in the other [u1,u2,u3]=(Et(tnext)+1.)*u1Exact;
full file with the corrections (not the last one with Et(0.) or Et(tnext)) solver_EB3D_save.edp (6.5 KB)
Thank you very much for your reply!
Based on the code you returned, I have been able to successfully run the correct result. Since the velocity u, the electric field E and the magnetic field B are solved in coupling, I need to define to combine the space ‘Uh’
You can simply set fespace Uh(Th, [P1,P1,P1,Edge03d, RT03d]);
The important thing is to put Q1[]=sol where [Q1,...] is declared in the space Uh involved in the matrix and rhs definitions matrix A1 = a1(Uh,Uh);real[int] b = rhs(0, Uh); so that the degrees of freedom are correctly interpreted.