Implementation of Crouzeix-Raviart element using number of edges as DOF

When I run the following commands:

from ngsolve import *
import numpy as np
from ngsolve.webgui import Draw
from netgen.occ import *
sphere = Sphere((0,0,0),1).faces[0]
sphere.name = "sphere"
geo = OCCGeometry(sphere)

mesh = Mesh(geo.GenerateMesh(maxh=0.5))
fesCR = FESpace('nonconforming', mesh)
print('dim of CR is {}'.format(fesCR.ndof))
print('number of edges is {}'.format(mesh.nedge))
print('number of faces is {}'.format(mesh.nface))

The output shows:

  • Dimension of CR: 112
  • Number of edges: 168
  • Number of faces: 112

This indicates that the degrees of freedom (DOFs) for the CR element correspond to the number of faces rather than the number of edges. How should I modify the implementation of the CR element with the degrees of freedom associated with the edges instead?

Not sure what you are looking for, but the usual CR has one dof per facet. In 3D CR has one dof per face, in 2D it is one dof per edge, cf. Crouzeix–Raviart | DefElement.

Best,
Christoph

Actually, what we want to use is the CR element on a 2D surface mesh, so it is one dof per edge, but

fesCR = FESpace(‘nonconforming’, mesh)

has one dof per face …

Such a surface C-R element has been studied in the paper “Surface Crouzeix–Raviart Element for the Laplace–Beltrami Equation”* by H. Guo, in Numerische Mathematik, 2020.

Best regards,
Guangwei

I don’t think such a space is implemented currently, but should be fairly easy in a cpp extension.
you can take this as a starting point:

and have a look at the implementation of the nonconforming space. a nonconforming surface space should be quite straightforward using the existing nctrig1, …

best

Thank you for your suggestion; it is very helpful. I’ll take a look at the implementation of the nonconforming space.

Best regards,