# Two imported mesh domains

**URL:** <https://community.freefem.org/t/two-imported-mesh-domains/1706>\
**Category:** General Discussion\
**Created:** [May 1, 2022, 5:30pm UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706 "2022-05-01T17:30:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mchetoui](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mchetoui](https://community.freefem.org/u/mchetoui)\
**Post date:** [May 1, 2022, 5:30pm UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706/1 "2022-05-01T17:30:42Z")

</div>

Hello everyone,  
I try to solve two different PDEs in two 3D domains separated by a shared interface. The two problems are coupled through this interface. The two domains are realistic so I need to import them as .msh.

If I import the the two domains in one global mesh (Th) I can define the interface of coupling but I can not separate the two domains and define the correspondant PDE for each mesh. In the oter hand, if I import each domain as an independant mesh (Th1 and Th2), I can define a PDE for each mesh but I can’t impose that the surface located between the two meshes is a shared surface that belongs to Th1 and Th2 in the same time.

Can someone help me to find a solution for this issue?  
Thank you.

---

<div class="post-metadata">

**Author:** ![lucassfernandez](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lucassfernandez](https://community.freefem.org/u/lucassfernandez)\
**Post date:** [May 1, 2022, 8:51pm UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706/2 "2022-05-01T20:51:00Z")

</div>

Did you try to define a global mesh Th and next split it into two meshes Th1 and Th2 by using the comand _trunc_?

Take a look at the page 146, Section _The command trunc_. The link to access the pdf file is: [https://doc.freefem.org/pdf/FreeFEM-documentation.pdf](https://doc.freefem.org/pdf/FreeFEM-documentation.pdf)

---

<div class="post-metadata">

**Author:** ![mchetoui](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mchetoui](https://community.freefem.org/u/mchetoui)\
**Post date:** [May 3, 2022, 9:11am UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706/3 "2022-05-03T09:11:22Z")

</div>

Hello Lucas,  
Thank you for your answer. My geometry is not regular, there is no condition based on spatial coordinates that permit sto split the two meshes. Here the used geometry:.

 ![geom](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/9/940a0af171190ef04dd56edd5c2b9dadc8c6c54d.png)

---

<div class="post-metadata">

**Author:** ![henkel](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@henkel](https://community.freefem.org/u/henkel)\
**Post date:** [May 3, 2022, 1:11pm UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706/4 "2022-05-03T13:11:25Z")

</div>

You could `trunc` based on the region indicator of your mesh, e.g. for a mesh with regions 23 and 42:  
`mesh3 Th1 = trunc(Th, region == 23); mesh3 Th2 = trunc(Th, region == 42);`

---

<div class="post-metadata">

**Author:** ![mchetoui](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mchetoui](https://community.freefem.org/u/mchetoui)\
**Post date:** [May 5, 2022, 8:00am UTC](https://community.freefem.org/t/two-imported-mesh-domains/1706/5 "2022-05-05T08:00:08Z")

</div>

Thank you Henkel, That’s why I’m trying to find as function.
