Forum Message



We have moved the forum to . 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.


The forum is in read only mode.

Implementation Crouzeix-Raviart Element

1 year 1 month ago #4682 by 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,

1 year 1 month 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?

1 year 3 weeks ago #4733 by 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 ( ).
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?


Time to create page: 0.131 seconds