# buildDmesh() and combine meshes

**URL:** <https://community.freefem.org/t/builddmesh-and-combine-meshes/1026>\
**Category:** General Discussion\
**Created:** [June 11, 2021, 2:06pm UTC](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026 "2021-06-11T14:06:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [June 11, 2021, 2:06pm UTC](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026/1 "2021-06-11T14:06:02Z")

</div>

Dear all,

It seems buildDmesh() can decompose a global mesh and distribute it to different MPI processes, but is there a similar function that can combine meshes from different processes to create a global mesh?

An initial backup of the global mesh does now work in my case, because the meshes are updated on every single MPI process.

Best,  
Yongxing.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 11, 2021, 2:09pm UTC](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026/2 "2021-06-11T14:09:22Z")

</div>

> <https://github.com/FreeFem/FreeFem-sources/blob/develop/examples/hpddm/reconstructDmesh.edp#L19>

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [June 11, 2021, 2:14pm UTC](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026/4 "2021-06-11T14:14:52Z")

</div>

[1m](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026/3)

Great! Thank you Pierre. Another quick quesiton:

It seems savevtk(…) can automatically combine results and meshes from different MPI cores. Where can I find the implementation of savevtk (), so that I can learn an idea?

Best,  
Yongxing

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 11, 2021, 2:15pm UTC](https://community.freefem.org/t/builddmesh-and-combine-meshes/1026/5 "2021-06-11T14:15:50Z")

</div>

`git grep savevtk` the `FreeFem-sources` repository…
