Generate Sub Mesh in Parallel
When I try to generate a submesh in parallel, it fails. Do you know if this can be done? I will use this submesh to solve a problem. If not, is there a way to generate the mesh with single cpu but run the solution in parallel?
The error message is below:
*** Error: Unable to perform operation in parallel.
*** Reason: SubMesh::init is not yet working in parallel.
The command I use to run in parallel is:
mpiexec -n 2 python *.py
The code is below:
from fenics import * # Generate mesh mesh = RectangleMesh(Point(-1.1,-1.1), Point(1.1,1.1), 32, 32,'crossed') # Define subdomains class outerbound(SubDomain): def inside(self, x, on_boundary): return (x>0.0) sub_domains=MeshFunction('size_t', mesh, mesh.topology().dim() - 0) sub_domains.set_all(0) obound=outerbound() obound.mark(sub_domains,1) # Generate sub mesh smesh=SubMesh(mesh,sub_domains,0)
What I get for a single core is correct and is the following:
What I get with double core is :
The problem is the Dirichlet boundary condition is also applied to the nodes at zero x axis. Submesh is generating an extra boundary at the interface of two cores. See marked boundaries where there is an extra boundary in the center:
Any suggestions? Can we merge boundaries in fenics?
Check this post that deal with a similar inter-boundary issue. Make sure to use 'on_boundary' when you define your facets.