Emptymesh and the integration with its mother mesh

Hello there,

I am facing a strange problem when working with an emptymesh. The piece of code is the following. It computes the normal velocity on the boundary and stores it on a boundary function.

mesh Th=square(10, 10);

fespace UVh(Th, [P2, P2]);
UVh     [u,v],   [uh,vh];

mesh 	Thb=emptymesh(Th);	// 
fespace	Pbh(Thb, P1);
Pbh	g, gh;   // if Pbh is P2 then solveg below runs with errors! 

solve solveuv( [u, v], [uh,vh])
= int2d(Th)( u*uh + v*vh + 
             dx(u)*dx(uh) + dy(u)*dy(uh) + dx(v)*dx(vh) +  dy(v)*dy(vh) )
- int2d(Th) ( uh + vh );
solveuv;

problem solveg( g, gh ) 
= int1d(Thb) ( g*gh ) - int1d(Thb) ( (u*N.x + v*N.y)*gh );
solveg;

It shows that when the boundary space Pbh is P1, the function solveg computes well the normal velocity. If Pbh is P2 then the following error is shown:

// 1 UMFPACK WARNING singular matrix 
// 1 UMFPACK WARNING singular matrix 
//  -- Solve : 
//          min -nan  max -nan

Any suggestion how to avoid the error?

Btw, I have not found any info for the emptymesh. It would be appreciated if anyone can share info about it, for example :

  • can one write u=g, and if yes, does it mean u updates its boundary values to g?
  • similar question for g=u.
  • how one can solve a laplace-beltrami equation on Pbh?

Thank you!

It is normal because you have no information on middle internal middle dog,

you can add them like int2d(Thb)(1e-7 * g * gh )

or better use meshL to solve this problem like in :

bbb.edp (514 Bytes)