Natural boundary conditions without FacetFunction

Indeed, FacetFunction is no longer available. You need to use MeshFunction instead, with an additional parameter to specify the topological dimension (mesh.topology().dim()-1 for the facets).
In your code, the two first lines could then be replaced by :
boundaries = MeshFunction("size_t", mesh, mesh.topology().dim()-1, 0)

11 Likes