Hello,
I am looking into the mesh size CF h = specialcf.mesh_size
again, and noticed that it has different meaning when evaluated at volume or facet.
https://github.com/NGSolve/ngsolve/blob/master/fem/python_fem.cpp
In line 513, ‘h’ returns det/ip.GetMeasure(). On triangular mesh, it is 2*area/edge_length, and takes two different values on two internal edges.
Sometimes, it is more natural to work directly with edge length directly in a DG formulation. Is there a coefficient function for the edge length?
I am thinking of the following hack to get edge length by defining a DG0 facet gridfunction:
V = FacetFESpace(mesh)
u,v = V.TnT()
a = u*v*dx(skeleton=True)
a = u*v*ds(skeleton=True)
h0 = GridFunction(V)
temp = h0.vec.CreateVector()
temp[:] = 1
a.Apply(temp, h0.vec)
This is not clean, but does it impact the speed of the code if I replace the specialcf.mesh_size in DG formulation by this gridfunction h0?
Best,
Guosheng