Mmgs - poor quality triangles between triangles of different sizes

I am using mmgs and setting local parameters in 2 regions of my mesh. I am getting really poor quality triangles at the boundary of the two regions. Thy triangles at the boundary of the two regions are a fair amount smaller than either of the prescribed triangle sizes. Am I doing something wrong or should I expect to see this kind of behavior?

Hello,

Are-you prescribing your sizes using the hmin/hmax parameters? Or are you using the hausdorff distance?

Thanks by advance.

I am using MMGS_Set_localParameter, for which I prescribe hmin/hmax and a hausdorff distance.

Ok,

For your quality problem:

  • maybe the hmin and/or hmax values are too close from your target size. This two values must be used as truncature for the remesh process (to avoid very small or very large edges) but they can not be used to impose a mesh size (it leads to poor qualities). You can try to relax this values and to impose your sizemap with an input file (I can help you with the procedure).
    The hausdorff parameter must allow (without sizemap) to have a good approximation of your surface, but can’t be used to have constant sizes through entire parts of the mesh.

  • if your hmin/hmax values are already far enough from your wanted sizes, maybe the poor quality is a consequence of a too large gap between the edge size. You can try to decrease the hgrad parameter (it defaults to 1.3 and must be greater or equal to 1). It will smooth the edge gap between the domains.

For the sizes smaller than expected, maybe your hausdorff parameter takes priority over the prescribed sizes. Moreover, mmgs try to obtain edges between 0.6 and 1.30 (your target size is 1). Thus it may sometimes leads to meshes with lot of edges smaller than expected but in the mmgs target.

Thanks for the response!

What do you mean they are too close from my target size? I thought my target size was the hmin/hmax values.

I am using mmgs as a library, so I will not be able to use an input file.

I tried decreasing the hgrad parameter, but this didn’t seem to help. I also trying making my hausdorff pretty large, but this also didn’t help.

In fact, the hmin/hmax values must only be used as bounds that you know the remesher must never override. The algorithme is not thinking to have for example hmin=0.9999 and hmax=1.00001. It is better to impose this directly in a solution field. Because the hmin/hmax values truncate the computed metric in mmgs, the gradation is not respected.

As you are using the library, you can used the MMG3D_set_solSize function to create a scalar solution field and then the MMG3D_Set_scalarSol function to set the wanted size at each point.

You can increase the hausdorff to test the remesher but once you have all your parameters fitted, you will obtain better result with a hausdorff sufficiently small to not damage your surface approximation.

Good evening.

Thanks again!

Okay, I haven’t tried setting a mesh size with a solution scalar field. I will give that a try.

Thanks!

Algiane, that worked fantastically :slight_smile:

I set a scalar solution at all of the points and relaxed the hmin/hmax values a bit. This gave quality triangles in the transition between the two regions. The size of the triangles are also what I would expect.

Thanks for the help!

Geat!

Have a nice day.