# What does the function MMG2D\_bdryenforcement() do？

**URL:** <https://forum.mmgtools.org/t/what-does-the-function-mmg2d-bdryenforcement-do/677>\
**Category:** Uncategorized\
**Created:** [November 21, 2022, 8:31am UTC](https://forum.mmgtools.org/t/what-does-the-function-mmg2d-bdryenforcement-do/677 "2022-11-21T08:31:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CYC](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/c/2acd7d/32.png) [@CYC](https://forum.mmgtools.org/u/CYC)\
**Post date:** [November 21, 2022, 8:31am UTC](https://forum.mmgtools.org/t/what-does-the-function-mmg2d-bdryenforcement-do/677/1 "2022-11-21T08:31:49Z")

</div>

I can not understand the function MMG2D\_bdryenforcement(MMG5\_pMesh mesh, MMG5\_pSol sol) very  
well。Can someone tell me what algorithms this function refers to, and do you have any corresponding information?Thank you in advance for your answer！

---

<div class="post-metadata">

**Author:** ![Algiane](https://forum.mmgtools.org/user_avatar/forum.mmgtools.org/algiane/32/30_2.png) [@Algiane](https://forum.mmgtools.org/u/Algiane)\
**Post date:** [November 21, 2022, 9:31am UTC](https://forum.mmgtools.org/t/what-does-the-function-mmg2d-bdryenforcement-do/677/2 "2022-11-21T09:31:04Z")

</div>

Hi,

This function is used only in mesh generation mode. In this case, it is needed to check if the input edges exist in the mesh created by inserting all input points inside the bounding box (see the mesh generation algo described here : [Let the library user provide a callback function which will compute the scalarSol for level set remeshing - #16 by Algiane](https://forum.mmgtools.org/t/let-the-library-user-provide-a-callback-function-which-will-compute-the-scalarsol-for-level-set-remeshing/662/16) ).  
If missing edges are detected, the `MMG2D_boundaryenforcement` function insert these missing edges (by edge swaps).

Best Regards,
