# Trunc function does not work for mesh splitting

**URL:** <https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772>\
**Category:** General Discussion\
**Created:** [May 23, 2022, 9:44pm UTC](https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772 "2022-05-23T21:44:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [May 23, 2022, 9:44pm UTC](https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772/1 "2022-05-23T21:44:00Z")

</div>

Hello Prj, I hope you doing well. I currently try to build mesh with a interface face, which I can use it for separating design domain later. However, I find the freefem partitioning with overlapped domain works fine with this .msh file, while the No-overlap partitioning with trunc function gives me some error. I am really running out of the cue. Could you give me some ideas about which part of this code or the mesh is not right? I am attaching the .stp .msh & .edp file here.

Thank you so much.  
[DEBUG.zip](https://community.freefem.org/uploads/short-url/SUTrovJawvai7xxk7vn4gJk4gD.zip) (48.6 KB)

---

<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:** [May 24, 2022, 8:09am UTC](https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772/2 "2022-05-24T08:09:44Z")

</div>

Your mesh is not OK. Even a simple script such as

```auto
Th = gmshload3("CUBE.msh");
Th = trunc(Th, 1);

```

does not work.

---

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [May 24, 2022, 12:47pm UTC](https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772/3 "2022-05-24T12:47:23Z")

</div>

I think you are right, do you know which part of this mesh is the issue.

---

<div class="post-metadata">

**Author:** ![zcwang6](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zcwang6/32/371_2.png) [@zcwang6](https://community.freefem.org/u/zcwang6)\
**Post date:** [May 24, 2022, 2:40pm UTC](https://community.freefem.org/t/trunc-function-does-not-work-for-mesh-splitting/1772/4 "2022-05-24T14:40:11Z")

</div>

I think I find the problem, at the shared face, they are not meshing with the same way. I re-meshed that surface with transfinite in Gmsh. Now it is working. Thank you Prj.  
[MESH.zip](https://community.freefem.org/uploads/short-url/dgXA1VyyWdhZ8WZM2MHfee36aLr.zip) (8.4 KB)
