# Hmax ignored in mmg2D when 1D boundary is "required"

**URL:** <https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912>\
**Category:** User Help\
**Created:** [July 17, 2025, 7:00am UTC](https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912 "2025-07-17T07:00:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbettega](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@gbettega](https://forum.mmgtools.org/u/gbettega)\
**Post date:** [July 17, 2025, 7:00am UTC](https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912/1 "2025-07-17T07:00:58Z")

</div>

Hello forum  
a question. I have a 2d boundary in which all the edges are defined as required, i.e. “fixed”. I attached it (“test.mesh”).

[test.mesh](https://forum.mmgtools.org/uploads/short-url/qmvMKOCqW8B9oU7Oz5iL30EgUoJ.mesh) (1.1 KB)

It seems that the mesh engine does not see the hmin and hmax values set by the user.

The command lines

mmg2d.exe test.mesh -hmax 0.1

and

mmg2d.exe test.mesh -hmax 0.01

give results having exactly the same number of nodes and elements (433 nodes, 830 triangles, in both the cases), with the result shown in the picture

 ![mesh](https://forum.mmgtools.org/uploads/default/original/1X/ef7ce0d900a01762051dc51d2c02faaa19f13a79.png)

Obviously the things change when the required edges are removed, not necessarily all, but also a bunch. See the following pictures (hmax = 0.1, hmax = 0.01)

 ![mesh1](https://forum.mmgtools.org/uploads/default/original/1X/18cda02894db47202189184cdcdf84513387545f.png)  
 ![mesh2](https://forum.mmgtools.org/uploads/default/original/1X/05b3f01f5bc837faca17ea20a65bc25a9bbd1638.png)

Since I did not study the code in deepth, but I’m only a standard user, I cannot understand (I only can suppose) why this happens.

Grazie mille  
Giovanni

---

<div class="post-metadata">

**Author:** ![gbettega](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@gbettega](https://forum.mmgtools.org/u/gbettega)\
**Post date:** [July 18, 2025, 7:52am UTC](https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912/2 "2025-07-18T07:52:11Z")

</div>

Hello  
actually I verified that also the metric settings are not applied if the previous rectangle has a boundary defined as required.  
I attact an input mesh with no required edges and a anisotropic metric

[rectangle\_\_no\_requiredEdges.mesh](https://forum.mmgtools.org/uploads/short-url/63REdybntLwFdnxaEN8GUkAgNDS.mesh) (26.5 KB)  
[metric.sol](https://forum.mmgtools.org/uploads/short-url/5EJbdW5PkJWYYaf0jP7ksB8TwP5.sol) (3.9 KB)

The results is in the picture: the metric is working

 ![metric_ON](https://forum.mmgtools.org/uploads/default/original/1X/6c7eceafad5eb9111600a28476c60f82b4596f06.png)

If the required edges (along the whole 1d boundary) are active, as in the following input file

[rectangle\_\_requiredEdges.mesh](https://forum.mmgtools.org/uploads/short-url/ldW8RxhPv4bSMbQqEO8wMVtCjBJ.mesh) (26.5 KB)

the metric is not taken into account, as show in the picture:

 ![metric_OFF](https://forum.mmgtools.org/uploads/default/original/1X/87adaf39107cbb104fb47011762b961252f5e0df.png)

Of course the “required edges” at boundary will impose a constraint on the metric application, but I thought that at least, “far” from the boundary; the metric would have been respected.  
Any advice?  
Grazie mille  
Giovanni

---

<div class="post-metadata">

**Author:** ![Johannes\_Neumann](https://forum.mmgtools.org/user_avatar/forum.mmgtools.org/johannes_neumann/32/478_2.png) [@Johannes\_Neumann](https://forum.mmgtools.org/u/Johannes_Neumann)\
**Post date:** [July 18, 2025, 9:10am UTC](https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912/3 "2025-07-18T09:10:45Z")

</div>

I think you want to take a look a the hgrad option: [https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-options/mmg-remesher-option-hgrad](https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-options/mmg-remesher-option-hgrad)

---

<div class="post-metadata">

**Author:** ![gbettega](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@gbettega](https://forum.mmgtools.org/u/gbettega)\
**Post date:** [July 18, 2025, 6:09pm UTC](https://forum.mmgtools.org/t/hmax-ignored-in-mmg2d-when-1d-boundary-is-required/912/5 "2025-07-18T18:09:40Z")

</div>

> [@gbettega](#):
>
> defined as required.  
> I attact an input mesh with no required edges and a anisotropic metric

It seems to work when hgrad = 1.0, which is reasonable. See picture:

 ![metric_ON_OK](https://forum.mmgtools.org/uploads/default/original/1X/23113ad08a33f1e7c516f7b1fe4d6e954948c66e.png)

Also hmax sizing seems working when hgrad = 1.0

 ![metric_ON_OK.PNG_1](https://forum.mmgtools.org/uploads/default/original/1X/372b72c4d6f369d05e6ad0bbd0dc5ae20f6e5504.png)
