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