# Using SubMesh on one processor or alternative function

**URL:** <https://fenicsproject.discourse.group/t/using-submesh-on-one-processor-or-alternative-function/6116>\
**Category:** mesh\
**Created:** [June 30, 2021, 11:36am UTC](https://fenicsproject.discourse.group/t/using-submesh-on-one-processor-or-alternative-function/6116 "2021-06-30T11:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kei\_Yamamoto](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/kei_yamamoto/32/2904_2.png) [@Kei\_Yamamoto](https://fenicsproject.discourse.group/u/Kei_Yamamoto)\
**Post date:** [June 30, 2021, 11:36am UTC](https://fenicsproject.discourse.group/t/using-submesh-on-one-processor-or-alternative-function/6116/1 "2021-06-30T11:36:25Z")

</div>

Hi,

I know that `SubMesh` function does not work in parallel and there is an alternative function `MeshView` as discussed [Here](https://fenicsproject.discourse.group/t/use-of-submesh-in-parallel/4635).

However, since I am suing FEniCS version 2019.01 on HPC cluster and others are also using it together, it is not ideal for me to update FEniCS and use `MeshView`.

What I want to do with `SubMesh` function is as follows.

```auto
bmesh = BoundaryMesh(mesh, "exterior")
outlet = MeshFunction("size_t", bmesh, bmesh.topology().dim(), 0)
AutoSubDomain(lambda x, on_bnd: near(x[0], Lx)).mark(outlet, 1)
smesh = SubMesh(bmesh, outlet, 1)
Vu = FunctionSpace(smesh, "CG", velocity_degree)

```

Basically I mark the outlet part of 3D pipe mesh and define FunctionSpace on the outlet so that I can save the velocity only at the outlet part of the mesh.

Since the outlet part of the mesh is always distributed to the specific processor (rank==size-1), I thought it could be possible to use `SubMesh` only on that processor. However, my simulation just halts somewhere after I used SubMesh function.

I am trying to find out why it stops and where it stops but want to ask if someone ever tries to use SubMesh only one processor or knows some alternative way to accomplish what I want to do.

Best,  
Kei
