Incorrect mesh ghost mode "none" (expected "shared_vertex" or "shared_facet" for interior facet integrals in parallel)

Again, you need to produce a minimal working example, as the error you are getting could be because of the order you have your commands in your code.
For your particular problem, my best guess is that you haven’t set the ghost mode parameter before creating the mesh.

Following is a minimal code example:

from dolfin import *


def test_problem(mode):
    parameters["ghost_mode"] = mode
    mesh = UnitSquareMesh(10, 10)
    V = FunctionSpace(mesh, "DG", 1)
    u = TrialFunction(V)
    v = TestFunction(V)
    a = inner(jump(u), jump(v))*dS
    A = assemble(a)


if __name__ == "__main__":
    modes = ["shared_vertex", "shared_facet", "none"]

    for mode in modes:
        try:
            test_problem(mode)
        except RuntimeError:
            if MPI.comm_world.rank == 0:
                print("Code execution failed for Ghost mode {0:s}".format(mode))

For follow-up of new posts, please adhere to the guidelines: Read before posting: How do I get my question answered?

1 Like