Skip to content

[MeshingApplication] MMG: expose missing library parameters and add MmgModeler#14460

Open
loumalouomega wants to merge 38 commits into
KratosMultiphysics:masterfrom
loumalouomega:meshing/improve-mmg-process
Open

[MeshingApplication] MMG: expose missing library parameters and add MmgModeler#14460
loumalouomega wants to merge 38 commits into
KratosMultiphysics:masterfrom
loumalouomega:meshing/improve-mmg-process

Conversation

@loumalouomega

Copy link
Copy Markdown
Member

name: ✨ Feature
about: MMG: expose missing library parameters and add MmgModeler

📝 Description

  • Expose ~20 previously missing MMG API parameters across all three library variants (MMG2D, MMG3D, MMGS), covering memory limits, normal/boundary regularisation, open-boundary preservation, uniform sizing, LES optimisation, anisotropic metric creation, level-set control, small-component removal, and more.
  • Add MmgModeler: a new C++ Modeler subclass (+ Python wrapper) that plugs MMG remeshing into the standard Kratos modeler pipeline.

New parameters

advanced_parameters

Key MMG API flag Libraries
force_memory_size / memory_size_mb IPARAM_mem all
normal_regularization_mesh IPARAM_nreg all (was MMGS-only)
boundary_regularization + force_boundary_regularization_relaxation / boundary_regularization_relaxation_value IPARAM_xreg / DPARAM_xreg all
preserve_subdomain_boundaries IPARAM_opnbdy MMG2D, MMG3D
no_fem IPARAM_nofem MMG2D, MMG3D
les_optimization IPARAM_optimLES MMG3D
anisotropic_metric_creation IPARAM_anisosize all
avoid_size_at_required IPARAM_nosizreq MMG3D, MMGS
octree_max_vertices IPARAM_octree MMG3D
save_subdomain IPARAM_numsubdomain all
force_hgradreq / gradation_required_value DPARAM_hgradreq all

force_sizes

Key MMG API flag Notes
force_hsiz / constant_size DPARAM_hsiz Uniform edge length (metric and iso-surface modes)

isosurface_parameters

Key MMG API flag Notes
force_level_set_value / level_set_value DPARAM_ls Override the iso-value (default 0)
force_rmc / rmc_value DPARAM_rmc Remove small disconnected components
isoref IPARAM_isoref Iso-surface boundary material reference

MmgModeler

New files:

  • custom_modelers/mmg/mmg_modeler.{h,cpp}MmgModeler<TMMGLibrary> implementing Modeler::SetupModelPart(); registered as MmgModeler2D, MmgModeler3D, MmgModelerSurface
  • custom_python/add_custom_modelers_to_python.{h,cpp} — pybind11 bindings
  • python_scripts/modelers/mmg_modeler.py — Python-level convenience wrapper with a "library" selector key

🆕 Changelog

  • Add modeler.
  • Add missing variables.

…ng. Updated advanced configuration options for memory size, Hausdorff value, and gradation settings. Improved readability by consolidating repeated code patterns and ensuring consistent use of parameter references across different MMG library calls.
…ptions for level set, RMC, boundary regularization, and memory management to improve mesh generation flexibility.
@loumalouomega loumalouomega enabled auto-merge May 28, 2026 14:16
@loumalouomega loumalouomega marked this pull request as draft May 28, 2026 15:50
auto-merge was automatically disabled May 28, 2026 15:50

Pull request was converted to draft

@loumalouomega

Copy link
Copy Markdown
Member Author

I need to download the last version and add guards for version control

@roigcarlo

Copy link
Copy Markdown
Member

Mmg in the CI is compiled against version 5.5.1. and for ParMMG we specifically use version 5 at this commit: 5ffc6ada4afb1af50a43e1fa6f4c409cff2ea25c.

Sabine-van-Dijk and others added 14 commits June 2, 2026 16:26
* make parameter files and mesh
* add crs test to the python script
* add readme with figure
* add rotational symmetry symbol to drawing
* apply absolute difference for the assertion of stresses to be less strict
* changed the tolerance and the amount of iterations in the project parameters
* Adjusted the checked values in the code and the absolute difference to agree with the new more converged outcomes.
* Removed the line about consolidation in the README.
@loumalouomega loumalouomega marked this pull request as ready for review June 4, 2026 13:56
@loumalouomega loumalouomega requested review from a team as code owners June 4, 2026 13:56
@loumalouomega

Copy link
Copy Markdown
Member Author

huum, this branch now is contaminated...

@loumalouomega loumalouomega enabled auto-merge June 4, 2026 14:04
@loumalouomega

Copy link
Copy Markdown
Member Author

huum, this branch now is contaminated...

Fixed, ready...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants