# Problems when performing the trunc operator in 3d

**URL:** <https://community.freefem.org/t/problems-when-performing-the-trunc-operator-in-3d/233>\
**Category:** General Discussion\
**Created:** [February 4, 2020, 11:15am UTC](https://community.freefem.org/t/problems-when-performing-the-trunc-operator-in-3d/233 "2020-02-04T11:15:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacoban90](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jacoban90](https://community.freefem.org/u/Jacoban90)\
**Post date:** [February 4, 2020, 11:15am UTC](https://community.freefem.org/t/problems-when-performing-the-trunc-operator-in-3d/233/1 "2020-02-04T11:15:31Z")

</div>

Hello FreeFem community,

A few weeks ago, I posted a question about defining adjacencies in a 3d mesh. Also I asked how to assign logical values to each element using a P0 fespace function in 2d. Both cases were implemented succesfully in 2d. However, I found difficulties to assign logical values to 3d elements according to the criteria of number of adjacencies.

When I use this logical function to remove tethrahedra according to the trunc operator, it reaches a certain point that they dont remove any elements at all, although there are still some tethrahedra remaining. This situation doesnt happen in 2d since the algorithm could remove all the elements.

I have created a output file text where you can see after 11 iterations, that the number of elements remain stable until the end of the execution.

Number of remaining elements accumulated disolved volume

* * *

```
         71331 167.531             
         61523 456.471             
         49101 841.763             
         36141 1268.32             
         27109 1585.53             
         23390 1723.45             
         22440 1759.66             
         22128 1770.23             
         22022 1773.76             
         21979 1775.2             
         21964 1775.69             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9             
         21957 1775.9  

```

Here you have attached the link with the .edp code and .mesh file

[https://1drv.ms/u/s!AqQdZogsFfj9gbFR3c8mjKjF5MjLHw?e=HwetCO](https://1drv.ms/u/s!AqQdZogsFfj9gbFR3c8mjKjF5MjLHw?e=HwetCO)

Any suggestion would be very appreciated.  
Best regards  
Jacob

---

<div class="post-metadata">

**Author:** ![Jacoban90](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jacoban90](https://community.freefem.org/u/Jacoban90)\
**Post date:** [February 13, 2020, 11:44am UTC](https://community.freefem.org/t/problems-when-performing-the-trunc-operator-in-3d/233/2 "2020-02-13T11:44:19Z")

</div>

When I had tried using the last mesh generated as a input in the same code, I saw that the trunc command started to work again. Why did this happen? Is it due to the difficulties of the program to handle the resultant non-manifold meshes?

Regards
