Level-set for half geometries with a symmetry plane

Dear users and developers,

I am trying to use libmmg3D to extract the zero iso-surface. My geometry is a half-sphere. For the background mesh, I only want to generate the volume mesh outside the sphere, excluding the interior.

I have coded a distance function, but since there are no elements inside the sphere, the distance is zero on the surface and increases as we move toward the far-field. Let’s say I want to extract ls = 0, which should correspond exactly to my half-sphere surface. However, I am getting some unexpected results, not to mention the long runtime.

I am using the following command:

mmg3d_O3 cube -ls -hausd 0.005

I also tried using -nosurf to preserve the surface, but it did not resolve the issue. I understand that mmg required a signed distance for interpolations; however, in my case, I have explicitly set the values in the .sol file to zero for the nodes located on the surface.

Is there a way to interpolate only in the regions where we have a signed distance?

I have included my background mesh (cube.mesh), my level-set solution where the values are set to zero for all surface points (cubeClean.sol), and a second level-set solution for a contaminated surface where the values are set to zero for some surface points and we also had a region with negative distance (cubeMat.sol).

Thanks a lot,
Ramin

cube.7z (4.5 MB)


cubeClean.sol (1.3 MB)


cubeMat.sol (1.3 MB)

Dear Ramin,

Thank you very much for your question. I would like to ask a few questions to have a better understanding of the problem. In cube.mesh, the surface of the half-sphere is already represented by the boundaries of the domain. The zero level-set from cubeClean.sol seems to coincide with the surface of the sphere.

This means that the iso-surface that you are attempting to discretize is already represented by your initial mesh, am I correct ? I am not sure to understand what output mesh you are trying to produce.

If you need to discretize another level-set (i.e. for another value, let us say 3), you can do so by specifying the value to the ls option:

mmg3d_03 cube -ls 3 -hausd 0.005

Secondly, I would suggest to take a look at the integrity of your data: cubeClean.sol seems to have many points on the surface of the sphere that do not have a value 0. This could explain the inability of mmg to discretize the level-set.

I thank you in advance for your answers, and I would be glad to help you further.

Kind regards,
Corentin

Dear Corentin,

Thank you for your response. You are correct, for a clean surface, cubeClean.sol coincide with the surface of the sphere, meaning the iso-surface is already represented by the initial mesh. This test case was intended to check whether mmg3d can recover the original surface. It seems that when there is no mesh inside the sphere, mmg3d cannot extract the surface. However, when I use -nosurf option, it does extract the surface, but it does not exactly match the original one. Please refer to Figure 1.


a. Original surface mesh.


b. Extracted surface mesh using the -nosurf option.


c. A detailed view of the extracted surface showing the inconsistencies.

Figure 1. The test case for the clean surface.

I appreciate you pointing out the issue with the solution file. It appears that during the .msh to .mesh conversion, GMSH renumbers the nodes for the half sphere mesh. I may need to write my own convertor to address this. However, I have corrected it in the solution file attached here:

cubeClean.sol (1.3 MB)
cubeCont.sol (1.3 MB)
cube.7z (4.4 MB)

Now, to clarify my ultimate goal: suppose there is contamination on part of the sphere, as shown in the section view in Figure 2. The red line represents ls = 0, which includes both the clean original surface and the contaminant surface. The blue region indicates where ls is negative, while ls is positive from the red curve to the far-field. Since there is no mesh inside the sphere, no ls values are defined in the gray zone. The ls values are explicitly set to zero for all points located on the original surface.


Figure 2. The test case for the contaminated surface.

As in the clean sphere, mmg3d cannot extract the ls = 0 by using:

mmg3d_O3 cube -ls -hausd 0.005

However, if I use the -nosurf option, it does extract the surface, but with two issues: 1. The original surface is not preserved 2. The ls = 0 on the contaminant surface needs refinement. (See Figure 3.)


Figure 3. The extracted surface for the test case with no interior elements using the -nosurf option.

On the other hand, if I mesh the entire cube, mmg3d successfully extracts the iso-surface perfectly, of course without using -nosurf. (See Figure 4.)


Figure 4. The extracted surface for the test case with interior elements.

What I need is to obtain this iso-surface without generating an interior mesh.

Thank you again for your kind assistance.

Best regards,
Ramin