Doubt in the variational formulation of LaplaceRT.edp


This code is to find the finite element solution for the mixed formulation for the poission equation(please refer to page no. 540 for details). In the above code how to find the first term " pq1e^-15".

Thank you in advanced.

Thanks. Did you actually try to run the code? Normally that factor is used
when “p” does not appear and I explain that as a way to set the “DC” level
which is otherwise arbitrary ( although “P” may appear, it can be taken out
with integration by parts ). In this case, it appears on the boundary condition
so that term is kind of surprising to me. In fact, if you try running the code I’m
not sure the term helps and I got convergence in GMRES and GC by omitting it
( or multiplying it by zero ). LU failed to converge in any case.

So, I guess I’d have to question it too. I wanted to learn a bit about the RT elements
so I may look at the matrix some more.

Actually if you convert the RT elements to [P2,P2] and P0 with P1
it looks better
( without trying to do analytical solution or check by eye more closely ).
And again with the term in question set to zero- including it made plot look
like blue monster attacking from the right lol.

The storie is due to old freefem solver LU with no renumbering
And no pivoting so in this bold matrix we have 0 on diagonal bloc so small term insure no zero, and the consergenvce in eps is due to the well poseness of the problem

Just to have the entire code here for reference.

// Parameters
func gd = 1.;
func g1n = 1.;
func g2n = 1.;
// Mesh
mesh Th = square(10, 10);
// Fespace
//fespace Vh(Th, RT0);
fespace Vh(Th, [P2,P2]);
Vh [u1, u2];
Vh [v1, v2];
fespace Ph(Th, P1);
Ph p, q;
Ph foo;
//foo=int0d(Th)(p);
// Problem
//problem laplaceMixte ([u1, u2, p], [v1, v2, q], solver=GMRES, eps=1.0e-10, tgv=1e30, dimKrylov=150)
//problem laplaceMixte ([u1, u2, p], [v1, v2, q], solver=GMRES)
problem laplaceMixte ([u1, u2, p], [v1, v2, q], solver=CG, eps=1.0e-10, tgv=1e30, dimKrylov=150)
//problem laplaceMixte ([u1, u2, p], [v1, v2, q], solver=LU, eps=1.0e-10, tgv=1e30, dimKrylov=150)
= int2d(Th)(
p*q*0*1e-15 //this term is here to be sure
//p*q*1e-15 //this term is here to be sure
// that all sub matrix are inversible (LU requirement)
+ u1*v1
+ u2*v2
+ p*(dx(v1)+dy(v2))
+ (dx(u1)+dy(u2))*q
)
+ int2d(Th) ( q)
- int1d(Th, 1, 2, 3)(
gd*(v1*N.x +v2*N.y)
)
+ on(4, u1=g1n, u2=g2n)
;

laplaceMixte;

// Plot
plot([u1, u2], coef=0.1, wait=true, value=true);
plot(p, fill=1, wait=true, value=true);

This linear system is symmetric but not positive so GC do not work in general