# Version 1.5.0 - additional local mesh refinement?

**URL:** <https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215>\
**Category:** Feature Requests\
**Created:** [November 1, 2023, 5:52pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215 "2023-11-01T17:52:40Z")\
**Posts on this page:** 12\
**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:** [November 1, 2023, 5:52pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/1 "2023-11-01T17:52:40Z")

</div>

Continuing the discussion from [A developer/preview PrePoMax version v1.5.0 has been released](https://prepomax.discourse.group/t/a-developer-preview-prepomax-version-v1-5-0-has-been-released/1207/3):

Hi Matej,

great new update! Will it be possible in the future or is it planned to add a local refinement/number of elements to edges? The current “Mesh Refinement” feature seems not to work properly for those meshes:

 ![0](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/c/cb4fa33bce2e6c66d6599cb3edf1b9f0457f9185.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:** [November 2, 2023, 2:31pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/2 "2023-11-02T14:31:54Z")

</div>

Currently, the mesh refinement is implemented but might not work as expected. Can you try the tetrahedral Gmsh option and try if the mesh refinement works?

---

<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:** [November 2, 2023, 5:27pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/3 "2023-11-02T17:27:23Z")

</div>

I tried but as shown the mesh refinement is not taken into account (same result):

 ![0](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/2/22b6cd4fb99df95f74648ebb519601247540ad04.png)

Also using “Tetrahedral\_Gmsh” with “Transfinte…” set to “No” leads to strange meshing results:

 ![00](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/8/8c2e7c753df34edda53d3c9a92f0a8cb0863a773.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:** [November 2, 2023, 7:42pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/4 "2023-11-02T19:42:04Z")

</div>

Hmm, I see you were using .stl files for the last example. I think the mesh refinement will not work for stl geometries in Gmsh.

Using the step file, I get the following result using a single line mesh refinement:

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/8/8deb81446453516b510a31b7c4c0226c7c71fb12.jpeg)

---

<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:** [November 2, 2023, 8:44pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/5 "2023-11-02T20:44:05Z")

</div>

Okay i didn’t realized that i imported a .stl file in the last example but i didn’t use mesh refinement for this. So using “Tetrahedral\_Gmsh” works not so good for .stl files (i tried other .stl files with similar results).

Mesh refinement on compound parts seems to be the problem. No refinement is created in this example either:

 ![0](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/c/c91465f5bb3dadc81483533124ef3dd81e91a9bf.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:** [November 2, 2023, 9:39pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/6 "2023-11-02T21:39:23Z")

</div>

Okay, currently the mesh size is applied in Gmsh to the points with the same IDs. So maybe/probably the IDs get mixed up. A better way would be to identify the points by their coordinates not IDs.

---

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [November 3, 2023, 1:23pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/7 "2023-11-03T13:23:29Z")

</div>

Sometimes the best option to capture stress concentration is to use submodel. In such a case you can use fine mesh in small part of the model without problem. Works in the PrePoMax perfectly well.

---

<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:** [November 3, 2023, 1:49pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/8 "2023-11-03T13:49:25Z")

</div>

I agree, but I think I must improve how the mesh refinement works using the Gmsh.

---

<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:** [November 4, 2023, 1:01pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/9 "2023-11-04T13:01:27Z")

</div>

Nice, just realized that there is also an advantage in time for meshing compound parts with “Meshing\_Parameters” + “Transfinite\_Mesh” (B) vs just using “Meshing\_Parameters” (A).  
Is it mainly because (A) uses netgen while (B) uses gmsh?  
Even with setting “Recombine” to “No”, option (B) is nearly two times faster than (A) even though a double number of nodes and elements are created.

Model - Type - elements/nodes - Time(s)  
1A - C3D10 - 845/1442 - 4,77  
1B - C3D20 - 116/703 - 2,88

2A - C3D10 - 6722/10959 - 7,8  
2B - C3D20 - 2592/12301 - 4,55

3A - C3D10 - 34055/52305 - 17,89  
3B - C3D20 - 11940/53583 - 8,19

 ![0](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/4/422d39eb8f1a1f13d5c810485f80e940c7288fb9.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:** [November 4, 2023, 5:04pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/10 "2023-11-04T17:04:56Z")

</div>

You can also use “Meshing\_Parameters” + “Tetrahedral\_Gmsh” to create tetrahedral meshes using Gmsh mesher.

---

<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:** [December 13, 2023, 8:49pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/11 "2023-12-13T20:49:57Z")

</div>

> [@Matej](#):
>
> Okay, currently the mesh size is applied in Gmsh to the points with the same IDs. So maybe/probably the IDs get mixed up. A better way would be to identify the points by their coordinates not IDs.

Now in v2.0.1 mesh refinement using gmsh on compound parts is principle working. But unfortunately the refinement is often applied to other geometries than selected - see the right side:

 ![0](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/7/71253acb86bc1650955280b5ac87249dcf377d3c.png)

Of course for a free tet-mesh netgen can be used, but i am more thinking of refining mapped hexa-meshes.  
I hope it can be fixed 🙏

[Test.pmx](https://prepomax.discourse.group/uploads/short-url/g02e6c8f0hTYU4F0W43Eh7td5kV.pmx) (74.6 KB)

 ![1](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/0/0cb07829d4233cdfb24b82250eb9e05b685a3ae2.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:** [December 14, 2023, 1:24pm UTC](https://prepomax.discourse.group/t/version-1-5-0-additional-local-mesh-refinement/1215/12 "2023-12-14T13:24:05Z")

</div>

You are right. I focused only on a single part meshes. I will also try to find the solution for the compound parts.
