I'm trying to set up a simple 1D BVP with a Neumann condition, and I find myself stuck. I want to solve:
-u'' = 4 * x, 0<x<1, with u'(1) = -1, u'(0) = 1
And I had the following question. If I define my boundaries using
boundaries = FacetFunction("size_t", mesh)
boundaryLeft.mark(boundaries,1)
boundaryRight.mark(boundaries,2)
ds = Measure('ds')[boundaries]
Am I correct that the surface integral, in this 1D set up, does not capture the outward pointing direction properly? I find that I need to do
g1 = Constant('1.0')
g2 = Constant('-1.0')
L = f * v * dx + g2 * v * ds(2) - g1 * v * ds(1)
Explicitly, putting the sign in.