I inherited a python implementation of a domain decomposition method for a 2d Poisson problem for a colleague which has been working fine with an older version (0.7.1) of fenics. Now I want to port the problem to the current version and am pretty far along. There is however one problem that I cannot quite figure out:
The formulation contains several jump terms of the form u('+') * n('+') + u('-') * n('-') which should be integrated over a boundary interface with n = ufl.FacetNormal(mesh) based on a function space of DG elements. To this end, a measure dS is created based on a MeshTags object containing the interface. However, when I try to create the form using dolfinx.fem.form(A) I get a
*** ValueError: Discontinuous type CellFacetJacobian must be restricted.
Could you explain to me what this error means (I am not that familiar with fenics in particular)? As far as I can see the term restriction means that a term is restricted to one side of a facet, which it should be, right? Did I not select the correct DOFs?
Without the actual form it is hard to tell you what you should restrict.
In general, the idea is that the dS measure integrates over an interior facet (a facet connected to two cells). Which cell you would like to extract the values from, depends on the restriction, (“+” and “-”) which is arbitrarily assigned.
For most classical finite element schemes, it doesn’t matter which side is first in a jump, as long as it is consistent through the variational form.
Thank you for the information so far. My problem is that I cannot really share the entire code and unfortunately I don’t have a MWE.
I do understand how jump terms work in principle and I don’t think that there is a problem with the signs at all. I just don’t get why the error occurs and what it means. The message reads like I should add a restriction but that seems backwards to me, after all the restrictions +/- seem to be the cause of the problem.
It means that some quantity in the form is not restricted as it should. To debug this you should take your form A, and remove one and one term until the error message from dolfinx.fem.form(A) disappears. This will point you to what terms that are problematic and make it easier to make a reproducible example.