## We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

#### Notice

The forum is in read only mode.

# P1ISOP2-P1

2 years 8 months ago #3834
P1ISOP2-P1 was created by uzerbinati
Dear All,

I'm trying to implement the P1ISOP2 element for the Stokes problem on a square.
To do this I need to work with two different mesh, in particular, I need the test function to be on coarser mesh than the trial function.
I generate both meshes using the MakeStructured2DMesh function with the Quad flag set to False.
Now when I try to build this the bilinear form B = div(u)*q*dx I get the error that both trial and test space must be defined on the same space.

Do you have any suggestions on how to proceed?

In my mind, a solution could have been to create a custom mixed finite element integrator, as shown in github.com/NGSolve/mylittlengsolve but I it seems I'm not able to build mylittlengsolve.

Thank you very much for your help!
Kind Regards,
Umberto Zerbinati
##### Attachments:
2 years 8 months ago - 2 years 8 months ago #3835
Replied by christopher on topic P1ISOP2-P1
Yes you definitely need to go to the cpp level to do this. A very rough idea of how this could be done:
Create a wrapper finite element space that is defined on the fine grid and does the mapping from fine to coarse grid and evaluation of basis functions on the coarse grid.
Then you can create a mixed bilinearform with
Code:
a = BilinearForm(fesFine, testspace=wrapperFesCoarse)
and add the forms. Note that the spaces are both defined on the same mesh (this is expected by the integrators) and the coarse mapping is done in the test space.

What is your problem with building mylittlengsolve?

You do not need much to create a c++ extension, a short introduction is given here:
docu.ngsolve.org/v6.2.2007/mylittlengs/1...ic/pythonExport.html

Best
Christopher
Last edit: 2 years 8 months ago by christopher.
2 years 8 months ago #3836
Replied by uzerbinati on topic P1ISOP2-P1
Dear Christopher,

thank you very much for the suggestion!
I attach a log with the error I obtain from the make command

Kind regards,
Umberto

#### File Attachment:

File Name: error.txt
File Size:0 KB
##### Attachments:
2 years 8 months ago #3837
Replied by christopher on topic P1ISOP2-P1
I can only see one line:
[ 9%] Building CXX object CMakeFiles/myngspy.dir/2_myHOFEM/myHOFESpace.cpp.o
2 years 8 months ago - 2 years 8 months ago #3838
Replied by uzerbinati on topic P1ISOP2-P1