Error with Real FunctionSpace running at parallel with Mixed-dimensional branch

Hello everybody,

I want to restrict a pure Neumann PDE on a 1d boundary of a 2d domain. I use mixed-dimensional branch to define a submesh of the 2d domain and a real Element to define a lagrange multiplier for a volume constraint. The following MWE works fine at serial:

from dolfin import *

nex=100
ney=100

D=0.020
Ro=0.01485


mesh=RectangleMesh(Point(-Ro,-D),Point(Ro,0),nex,ney)


class free_surface(SubDomain):
    def inside(self,x,on_boundary):
        return near(x[1],0)
        
boundaries=MeshFunction('size_t',mesh,mesh.topology().dim()-1)
 
boundaries.set_all(0)

free_surface().mark(boundaries,1)

submesh=MeshView.create(boundaries, 1)

V=FunctionSpace(submesh,'Real',0)

Unfortunately when running at parallel returns the error:

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Floating point exception (signal 8)

The problem seems to be at the definition of the real functionspace using the submesh object.

Hello,

Thanks for pointing this out, I have been able to reproduce your error. It was indeed related to the use of a Real function space with a submesh involving MeshView (more specifically the nodes ownership, that is why it was working in serial).

I have pushed a fix which seems to fix your MWE (the Docker image with latest tag is also up-to-date with this change), I hope that helps.

1 Like

Thank you for the quick answer @cdaversin,

The issue was fixed with the latest docker image. However if i try to define a functionspace using a mixed element that includes a Real element like the following MWE :

from dolfin import *

nex=100
ney=100

D=0.020
Ro=0.01485


mesh=RectangleMesh(Point(-Ro,-D),Point(Ro,0),nex,ney)


class free_surface(SubDomain):
    def inside(self,x,on_boundary):
        return near(x[1],0)
        
boundaries=MeshFunction('size_t',mesh,mesh.topology().dim()-1)
 
boundaries.set_all(0)

free_surface().mark(boundaries,1)

submesh=MeshView.create(boundaries, 1)

# it works  
#P=FiniteElement('Real', submesh.ufl_cell(), 0)
#V=FunctionSpace(submesh,P)

# it works
#H=FiniteElement('Lagrange',submesh.ufl_cell(),2)
#P=FiniteElement('Lagrange', submesh.ufl_cell(), 2)
#ME=MixedElement([H,P])
#V=FunctionSpace(submesh,ME)

#this is not working
H=FiniteElement('Lagrange',submesh.ufl_cell(),2)
P=FiniteElement('Real', submesh.ufl_cell(), 0)
ME=MixedElement([H,P])
V=FunctionSpace(submesh,ME)

it still returns an error at parallel:

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11) 

It works fine at parallel for a single element so i suspect that the issue is at the definition of mixed element using a Real element.

I cannot reproduce the error you get with this MWE. But an alternative solution would be to define your mixed space with a MixedFunctionSpace instead of a MixedElement.

1 Like

Thank you again @cdaversin,
Indeed, this works and actually is better for my application.

1 Like