Implementation Crouzeix-Raviart Element
- melanie
- Topic Author
- New Member
Less
More
1 year 8 months ago #4682
by melanie
Implementation Crouzeix-Raviart Element was created by melanie
Hi,
I'm working on the implementation of the Crouzeix-Raviart Element (at the moment the linear case, but I would like to also do that for higher order) with Dirichlet boundary conditions for the Laplacian eigenvalue problem. I followed the tutorial on how to implement new spaces and I was able to obtain something, but I'm having trouble in implementing the boundary conditions. Do you have any advice on how to do that? Or in general any code that could be useful in order to implement Crouzeix-Raviart?
Thank you,
Melanie
I'm working on the implementation of the Crouzeix-Raviart Element (at the moment the linear case, but I would like to also do that for higher order) with Dirichlet boundary conditions for the Laplacian eigenvalue problem. I followed the tutorial on how to implement new spaces and I was able to obtain something, but I'm having trouble in implementing the boundary conditions. Do you have any advice on how to do that? Or in general any code that could be useful in order to implement Crouzeix-Raviart?
Thank you,
Melanie
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
1 year 8 months ago #4684
by mneunteufel
Replied by mneunteufel on topic Implementation Crouzeix-Raviart Element
Hi Melanie,
the (lowest-order) Crouzeix-Raviart FESpace is implemented in NGSolve
fes = FESpace(“nonconforming”,mesh, dirichlet=”…”)
if you like to compare with your implementation. In the source code it is in comp/fespace.hpp, comp/fespace.cpp with class name NonconformingFESpace.
Normally the Dirichlet data is handled in the base class FESpace and you only have to specify the Dirichlet flag when calling your FESpace class in Python. What kind of problem appears if you try to use Dirichlet boundary conditions?
Best,
Michael
the (lowest-order) Crouzeix-Raviart FESpace is implemented in NGSolve
fes = FESpace(“nonconforming”,mesh, dirichlet=”…”)
if you like to compare with your implementation. In the source code it is in comp/fespace.hpp, comp/fespace.cpp with class name NonconformingFESpace.
Normally the Dirichlet data is handled in the base class FESpace and you only have to specify the Dirichlet flag when calling your FESpace class in Python. What kind of problem appears if you try to use Dirichlet boundary conditions?
Best,
Michael
- melanie
- Topic Author
- New Member
Less
More
1 year 7 months ago #4733
by melanie
Replied by melanie on topic Implementation Crouzeix-Raviart Element
Hi,
since I wasn't able to adjust my code, I started to use the Crouzeix-Raviart FESpace already implemented. I'm currently working with the eigenvalue solver from the documentation with the nonconforming space ( docu.ngsolve.org/test/i-tutorials/unit-2...envalues/pinvit.html ).
By using it I observed that something is not working right, since around the meshisize of h=0.1 the L2-error of the eigenvectors begin to grow again (instead of converging) and also the eigenvalue "explodes" (with h= 0.01 I get an eigenvalue of 132.68, while the exact one is 19.74). I tried to use the eigenvalue solver with the H1 space and with that the eigenvalue converges to the exact one and the L2-error of the eigenvectors converges. So I'm guessing that something is not working right when using the nonconforming space with the eigenvalue solver.
Has anyone noticed something similar to that or has an idea why this happens?
Bests,
Melanie
since I wasn't able to adjust my code, I started to use the Crouzeix-Raviart FESpace already implemented. I'm currently working with the eigenvalue solver from the documentation with the nonconforming space ( docu.ngsolve.org/test/i-tutorials/unit-2...envalues/pinvit.html ).
By using it I observed that something is not working right, since around the meshisize of h=0.1 the L2-error of the eigenvectors begin to grow again (instead of converging) and also the eigenvalue "explodes" (with h= 0.01 I get an eigenvalue of 132.68, while the exact one is 19.74). I tried to use the eigenvalue solver with the H1 space and with that the eigenvalue converges to the exact one and the L2-error of the eigenvectors converges. So I'm guessing that something is not working right when using the nonconforming space with the eigenvalue solver.
Has anyone noticed something similar to that or has an idea why this happens?
Bests,
Melanie
Time to create page: 0.116 seconds