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

How to set up interior Neumann boundaries

+1 vote

I'm solving the Poisson equation over subdomains with interior boundaries. I want to set up Neumann bcs on the interior boundaries. I followed the example in demo 22 "Poisson equation with multiple subdomains", replacing ds with dS:

boundaries = FacetFunction("size_t", mesh)
...
dSs = dS[boundaries]
...
L = f*v*dx + g*v*dSs(0)
...
b = assemble(L)

The last line gives the error message "Form argument must be restricted". How do I get this to work? (I've had no problems setting up Dirchlet bcs on internal boundaries.)

asked Jan 29, 2014 by mdl22 FEniCS Novice (180 points)
edited Jan 29, 2014 by mdl22

1 Answer

+1 vote
 
Best answer

Hi, try

L = f*v*dx + g("+")*v("+")*dSs(0)

You can read about restrictions in the UFL manual. As long as g and v are not in DG spaces
you could equally restrict to the negative side, since both restrictions amount to the same DOF.

answered Jan 29, 2014 by MiroK FEniCS Expert (80,920 points)
selected Feb 3, 2014 by Jan Blechta

Thanks, that removed the error message, but the interior bc didn't take effect until I added the argument:

b = assemble(L, interior_facet_domains=boundary0)
How to make interior Neumann bc dependent on FE function
...