# Bilinear form on codimension 2,volumes and curves, mixed dimensions

Hello,

I’m trying to define a bilinear form on a curve of a three-dimensional domain.
Doing the analogous procedure for a surface is no-problem using the “ds”-operator.
Is there a way to do the same for a curve?

MRE:

from netgen.occ import *

cube = Box((-20,-2,0), (20,2,1))
cube.faces.Min(Z).name = “bottom”
cube.faces.Min(X).name = “left”
cube.faces[“bottom”].edges.Min(Y).name = “front”
netmesh = OCCGeometry(cube).GenerateMesh(maxh=1)

from ngsolve import *
mesh = Mesh(netmesh)

fes = H1(mesh, order=3, dirichlet=“left”)
u, du = fes.TnT()

a = BilinearForm(fes, symmetric=True, symmetric_storage=True, condense=True)

and on the curve I would like to do something like:

but this doesn’t work, even though I don’t get an error message.

you can give a region to the dx operator instead of a string to also change codimension:

BBoundaries = Boundaries of Boundaries = codim2

best
Christopher

However, I get an exception for this code:

NgException Traceback (most recent call last)
in
24 # ))
25
—> 26 a += (du * u + InnerProduct(Grad(du).Trace().Trace(), Grad(u).Trace().Trace())) * dx(mesh.BBoundaries(“front”))
27
28 f = LinearForm(fes)
NgException: don’t have a trace, primal evaluator = gradbnd

Removing one Trace()-operator leads to a different error:

NgException Traceback (most recent call last)
in
24 # ))
25
—> 26 a += (du * u + InnerProduct(Grad(du).Trace(), Grad(u).Trace())) * dx(mesh.BBoundaries(“front”))
27
28 f = LinearForm(fes)
NgException: Trialfunction does not support BBND-forms, maybe a Trace() operator is missing, type = gradbnd

I would be grateful for any other tips!

Best,