# V2.0.3 - Refinement bug

**URL:** <https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448>\
**Category:** Bug Reports\
**Created:** [January 26, 2024, 6:48am UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448 "2024-01-26T06:48:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://prepomax.discourse.group/u/Gunnar)\
**Post date:** [January 26, 2024, 6:48am UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/1 "2024-01-26T06:48:37Z")

</div>

In v2.0.3 using gmsh refinement doesn’t work properly (this applies to compounds and single volume parts):

 ![l](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/e/e4bc9ec09a51dce6fb461fc7d5558462ad0db834.png)

[1.pmx](https://prepomax.discourse.group/uploads/short-url/iKrKDIh27lT9At4q1xUSe74ydeS.pmx) (1.0 MB)

And i have two questions/feature requests:  
Now where Pyramids are available for compounds, if possible could they also be used for single volume parts? Like it can be done in Salome:

 ![ll](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/c/cf608b4d259709076784055f48a79d1914a55f69.png)

When using “Transfinite Mesh”, wouldn’t it be useful also to add the “Mesh optimization” options to it?

Thanks

---

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://prepomax.discourse.group/u/Gunnar)\
**Post date:** [January 26, 2024, 7:28pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/2 "2024-01-26T19:28:17Z")

</div>

More precisely, with split cylinder surfaces, the refinement in the tangential direction no longer works properly.

 ![lll](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/b/b18c4a378283bccfcdecfa8636d5a15ca951877c.png)

---

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://prepomax.discourse.group/u/Gunnar)\
**Post date:** [January 28, 2024, 3:22pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/3 "2024-01-28T15:22:44Z")

</div>

> [@Gunnar](#):
>
> Now where Pyramids are available for compounds, if possible could they also be used for single volume parts? Like it can be done in Salome:
> 
> ![ll](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/c/cf608b4d259709076784055f48a79d1914a55f69.png)

It seems pyramids can’t be used in calculix for contact and don’t work correct with tie constraints ☹ …

 ![c](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/3/3c3981b3a4eddba7dc50592beaddf7a7debb3f06.png)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [January 28, 2024, 4:15pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/4 "2024-01-28T16:15:56Z")

</div>

> [@Gunnar](#):
>
> n v2.0.3 using gmsh refinement doesn’t work properly (this applies to compounds and single volume parts):

You are right. The bug that I fixed somehow got unfixed. I fixed it again. I will probably create a new dev release containing it.

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/f/febf0c60b0fa61c850bebac90e6d47af511ea1aa.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/2/259756d86758f85c5036c41359143c90f854c506.jpeg)

> [@Gunnar](#):
>
> And i have two questions/feature requests:  
> Now where Pyramids are available for compounds, if possible could they also be used for single volume parts? Like it can be done in Salome:

You can use Gmsh Terahedral mesh for that and enable the Recombination algorithm. Currently it can only be enabled for the whole part at once.

> [@Gunnar](#):
>
> When using “Transfinite Mesh”, wouldn’t it be useful also to add the “Mesh optimization” options to it?

Yes. Currently, the Pyramids are experimental due to their precision. Once they are confirmed as good enough I will add other functionalities. Maybe even combine the Transfinite mesh and Tetrahedral mesh items since they can produce the same result.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [January 28, 2024, 4:21pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/5 "2024-01-28T16:21:37Z")

</div>

> [@Gunnar](#):
>
> It seems pyramids can’t be used in calculix for contact and don’t work correct with tie constraints ☹ …

Currently, pyramids are meant to be internal elements for mesh transitions so there might be problems using them. Be careful that looking “nice” on the outside does not mean that the result will be better. The current implementation is not the best.

But you are right, if they are supported, surface definitions should also work with them. It would be easier if we could decide if collapsed wedges or collapsed hexahedrons are a better solution and then I can support only one variation.

---

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://prepomax.discourse.group/u/Gunnar)\
**Post date:** [January 28, 2024, 4:35pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/6 "2024-01-28T16:35:41Z")

</div>

> [@Matej](#):
>
> You can use Gmsh Terahedral mesh for that and enable the Recombination algorithm. Currently it can only be enabled for the whole part at once.

**Edit**  
Omg i was just blind and didn’t recognize it 🤦‍♂️

Thanks 🙂

> [@Matej](#):
>
> Be careful that looking “nice” on the outside does not mean that the result will be better.

I thought they can be useful for meshing contact surfaces, maybe to get a “smoother” contact pressure than tets, but now i know pyramids can’t be used for it (still).

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [January 28, 2024, 6:13pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/7 "2024-01-28T18:13:03Z")

</div>

> [@Gunnar](#):
>
> but now i know pyramids can’t be used for it (still).

I will try to add this functionallity since I think it will not be to hard. I only need to correctly convert the pyrmaid surface names to wedge and hex surface names.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 15, 2024, 7:52pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/8 "2024-02-15T19:52:06Z")

</div>

> [@Gunnar](#):
>
> It seems pyramids can’t be used in calculix for contact and don’t work correct with tie constraints ☹ …

This should be fixed in the new developer PrePoMax version.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 15, 2024, 7:52pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/9 "2024-02-15T19:52:56Z")

</div>

> [@Gunnar](#):
>
> In v2.0.3 using gmsh refinement doesn’t work properly (this applies to compounds and single volume parts):

Can you check if the refinement bug is working as expected now?

---

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://prepomax.discourse.group/u/Gunnar)\
**Post date:** [February 16, 2024, 7:52pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/10 "2024-02-16T19:52:51Z")

</div>

I couldn’t find any problem.

The only small difference in version 2.0.3 compared to 2.0.2 i found is, that with the attached models it is not possible to create only one element in the curved areas (with the global settings). If you open the .pmx with v2.0.2 and remesh it, you should get the result show in the first picture while meshing it with v2.0.3 you get the mesh shown in second picture. It’s not a big thing but i wanted to mention it.

[test.pmx](https://prepomax.discourse.group/uploads/short-url/7Xxs0ndw5WspcGoNwJixfaayiud.pmx) (1.3 MB)

 ![v202](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/2/26b5136a5ee07072343bd6a1b5f29545c05b3e1d.png)

 ![v203](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/6/6eab56eb43de5c8d88f82bf9dd05bd11b1392181.png)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 19, 2024, 1:26pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/11 "2024-02-19T13:26:16Z")

</div>

I can confirm this behavior. It is not intentional so I will check if I can fix it.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 19, 2024, 2:12pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/12 "2024-02-19T14:12:16Z")

</div>

I have found the problem. I have tweaked the meshing prcedure so that it is now possible to produce exactly 1 element per subpart.

What also helps in such cases is the mesh refinement. Despite its name and how it works for Netgen (can only create smaller elements), for Gmsh it uses TransfiniteCurve command. So an exact number of elements can be given by recomputing it from the element size.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [May 12, 2024, 6:13pm UTC](https://prepomax.discourse.group/t/v2-0-3-refinement-bug/1448/13 "2024-05-12T18:13:28Z")

</div>


