Inspired by what I have found on the FreeFEM git repo, I am solving Stokes equation in 3D in parallel using a fieldsplit preconditioner.
I note my vectorial FE Pk4 = [PkV, PkV, PkV, PkM] where PkV is the FE for the velocity and PkM the FE for the pressure.
When PkV and PkM are classical FE let’s say P1, P2, P3, ... the code works.
However we have developed a nonconforming FE, called P2pnc_3d in FreeFEM, which is a non conforming finite element. Then when I use PkV=P2pnc3d and PkM=P1dc, I get the following error with PETSc:
[2]PETSC ERROR: Nonconforming object sizes
[2]PETSC ERROR: Local columns of A10 17454 do not equal local rows of A00 2291
We have tried to understand what could be this error, but we found nothing in the PETSc documention.
Could someone has already find this error ?
Besides we have another interrogation to better understand: in the code when we use Fieldsplitting, where is defined the different splits : how the solver know which block is the velocity and which block is the pressure ? The option Vh def(uh) = [1.0, 1.0, 1.0, 2.0]; and fields = uh[] let me think that there is a kind of labelling (1 for Velocity block and 2 for Pressure block), is it, or is it just a kind of initilialization ?
Why do removing epsq *p *q from the varf make the code works ?
Why the previous code works with the classical P2 and not for the non conforming one ? I do not see where the characteristics of the FE intervenes in the solver.
so you cannot pass this to fieldsplit because this is not a proper splitting of your fespace. There is probably something wrong with your interpolation.
I spoke too quickly. Because your fespace is nonconforming, there is no one-to-one correspondance between the set of ones and twos with velocity and pressure. You either need to find such a correspondance, or let PETSc detect the saddle-point structure of your discretization.
If I understand well, the labelling uh=[1.0, 1.0, 1.0, 2.0] allows to have the proper splitting of the fespace; is it ? So even if the problem is not a saddle point problem, with for example the Stokes code in github, PETSc is able to split properly the fespace.
However, when we cannot do this kind of labelling, PETSc needs to detect automatically the saddle point structure (that’s why we remove the term epspq * p * q ), is it ?
In this case, is PETSc able to determine which split is the velocity and which one is the pressure ? (and how) ?
Concerning your last remark, how can we find such correspondence ? What will be the advantage to do this ?
If I understand well, the labelling uh=[1.0, 1.0, 1.0, 2.0] allows to have the proper splitting of the fespace; is it ?
Yes. With a collection of conforming fespace, all fespace that have the same index are grouped in the same PETSc field.
However, when we cannot do this kind of labelling, PETSc needs to detect automatically the saddle point structure (that’s why we remove the term epspq * p * q ), is it ?
Right, here, you are “lucky” because you have only two fields, so the saddle-point structure exactly corresponds to velocity and pressure. If you want to couple Stokes with, e.g., diffusion, then you would get both velocity and diffusion in the same field, why may be sub-optimal.
Concerning your last remark, how can we find such correspondence ?
That’s for you to tell me, I don’t know how you designed the fespace.
What will be the advantage to do this ?
None if you stick to “just” Stokes.
If you are serious about preconditioning this efficiently, get in touch with me in private and we can setup a meeting.