This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Neumann Conditions in 1D

0 votes

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.

asked May 19, 2015 by gideonsimpson FEniCS Novice (510 points)

1 Answer

0 votes
 
Best answer

Hi,

I'm also working on a 1D cable problem and I think that since a "facet" of a 1D mesh would have geometrical dimension 0 you'll have to explicitly impose the sign (We can't define an outward direction of a point). As far as I can see this should work, isn't it?

answered May 20, 2015 by MathieuFV FEniCS User (1,490 points)
selected May 20, 2015 by gideonsimpson

Yes, it does work, I just wanted to confirm that this was a conscious design decision and not a bug.

...