Hello,
I am looking to move to using Fenics in C++ and am trying to figure out how to define a weak form that integrates over a portion of the domain instead of the whole domain, in particular a portion of the boundary. I know I can define the form in the .ufl file using something like
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = inner(grad(u), grad(v))*dx + f*ds(1) + f*ds(2)
(this is just example code, I realize this doesn't actually correspond to a weak form that makes any sense).
My question then is how do I define what portion of the boundary is defined by the measure ds(1)
and ds(2)
? I'm assuming this is done in the C++ code along with defining the boundary conditions and the mesh, but I don't know how. Thank you in advance for any help you can give.