How to effectively define vertex size for MMG3D?

Dear Users and developers,
I am using MMG3D to do mesh refinement for computational electromagnetics.
My logic is given as follows:
Loop

  1. find the vertex size by averaging the edge length surrounding each vertex
  2. find the bad elements
  3. reduce the vertex size by half for the vertices owned by bad elements

It could give a satisfactory result and refine the meshes around the important area. But unimportant areas are also refined. Is there any way to reduce the refinement for the unimportant area.

For this case, the intial mesh is given as follows,

I want to know more about MMG3D, therefore a simple test is proposed. Starting from the coarse mesh, let the code run several loops with only step 1 (no step 2 and 3). The mesh changes every loop, but luckily the variation is smaller and smaller with more loops. Which parameter is affecting this?

Thanks,

Dear Liufield,

For your first question regarding the refinement of unimportant areas, I would first suggest to use a local parameter file, as you seem to have several references defined. Please have a look at the following link:
https://mmgtools.gitlabpages.inria.fr/mmg-manual/tutorials/tutorials_parameter_file.html#local-parameters-assignment

The idea is to assign minimal/maximal edge sizes for each reference in your mesh. Combined with an adequate gradation, you will be able to reach a more suitable mesh.

Concerning your second question, MMG already defines the default metric at a point by looking at the average length of incident edges. Looping several times over this procedure leads to a converged mesh, as edge length evolve less and less. The parameter affecting this is using the default metric computation in MMG.

Kind regards,
Corentin