## Re: [Libmesh-users] Non-homogeneous Neumann Boundary Condition

 Re: [Libmesh-users] Non-homogeneous Neumann Boundary Condition From: Vijay S. Mahadevan - 2009-09-02 21:37:55 ```John, good catch. I was wrong in my previous email and I apologize for confusing anybody (Ted) following the thread ! I made the mistake of subtituting u'(2) = -0.25 but then forgot about the x before this term which brings it back to -0.5. Its only the middle of the week and I'm already erratic. I blame the summer heat... On Wed, Sep 2, 2009 at 3:22 PM, John Peterson wrote: > On Wed, Sep 2, 2009 at 2:38 PM, Vijay S. Mahadevan wrote: >> On first look, I would say that the neumann_value is supposed to be >> -0.25 and not -0.5 at x=2. Try this change and see if it resolves the >> bug. Also like John suggested, see if your L2 and H1 errors give right >> convergence orders. > > I don't see anything obviously wrong... > > If the original problem is: d/dx (x * du/dx) = 2/x^2 > > The weak form is: > > -(x u',v') + x u'(2) v(2) -  x u'(1) v(1) = (2/x^2,v) > > Bringing the right endpoint bc over to the rhs and assuming the > Dirichlet bc is handled, > > -(x u',v')   = (2/x^2,v) - x u'(2) v(2) > > And replacing with the Neumann condition, (-x * du/dx) = 0.5   @ x = 2, we get > > -(x u',v')   = (2/x^2,v) + 0.5 v(2) > > Multiplying thru by neg. 1 as in the code, we get > > (x u',v')   = -(2/x^2,v) - 0.5 v(2) > > If the theoretical convergence rates are off, I would probably start > by looking at the endpoint integral, though there may be something > else obvious I'm missing. > > -- > John > ```