- Thank you received: 0
P1ISOP2-P1
- uzerbinati
- Topic Author
- Offline
- New Member
Less
More
3 years 3 months ago #3834
by uzerbinati
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
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:
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
3 years 3 months ago - 3 years 3 months ago #3835
by christopher
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
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
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)
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: 3 years 3 months ago by christopher.
- uzerbinati
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
3 years 3 months ago #3836
by uzerbinati
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
thank you very much for the suggestion!
I attach a log with the error I obtain from the make command
Kind regards,
Umberto
Attachments:
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
3 years 3 months ago #3837
by christopher
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
[ 9%] Building CXX object CMakeFiles/myngspy.dir/2_myHOFEM/myHOFESpace.cpp.o
- uzerbinati
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
3 years 3 months ago - 3 years 3 months ago #3838
by uzerbinati
Replied by uzerbinati on topic P1ISOP2-P1
Sorry, my bad-
This time should be the full file.
Thanks,
Umberto
This time should be the full file.
Thanks,
Umberto
Attachments:
Last edit: 3 years 3 months ago by uzerbinati.
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
3 years 3 months ago #3839
by christopher
Replied by christopher on topic P1ISOP2-P1
Ah, yes this was due to changes in recent NGSolve. It is fixed now.
Best
Christopher
Best
Christopher
Time to create page: 0.123 seconds