from ngsolve import * from netgen.occ import * maxh = 0.1 outer = Circle((0.0, 0.0), 1).Face() #geo = Glue([inner, mid, outer]) mesh = Mesh(OCCGeometry(outer, dim=2).GenerateMesh(maxh=maxh)) #mesh = Mesh(OCCGeometry(geo, dim=2).GenerateMesh(maxh=maxh)) fes = L2(mesh, order = 2) v = fes.TestFunction() f = CoefficientFunction(1) f0 = CoefficientFunction(0) F0 = GridFunction(fes) F0.Set(f0) LinearForm(f * v * dx) # Works, non-zero LinearForm LinearForm(F0 * v * dx) # Works, zero LinearForm LinearForm(f0 * v * dx) # Does not work LinearForm(0 * v * dx) # Equivalent, does not work