Implementation Crouzeix-Raviart Element

More
1 year 9 months ago #4682 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
More
1 year 9 months ago #4684 by mneunteufel
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
More
1 year 8 months ago #4733 by melanie
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 
Time to create page: 0.106 seconds