Coarse Mesh Weird Cropping

Hello,

I am currently trying to mesh something from an SPN file using PSculpt. I have attached the input file below. Note that the ‘variables’ are defined as such because I am generating the input file in Python.

BEGIN SCULPT
    nelx = {x_cells}
    nely = {y_cells}
    nelz = {z_cells}
    
    smooth = 2
    defeature = 1
    remove_bad = 0.0
    
    laplacian_iters = 10
    max_opt_iters = 100
    adapt_type = 5
    adapt_levels = {levels}
    
    input_spn = {spn_file}
    exodus_file = {exodus_file}
END SCULPT

When I generate the mesh without the coarse mesh option, the mesh is fine, as shown below.

However, when I add the coarse mesh option, the mesh is cropped weirdly. I found that as the number of adapt_levels increases, the more the mesh is cropped. The image below shows the same object meshed with the coarse mesh option, with adapt_levels = 5.

Do you guys know why this might be the case?

Thanks,
Janzen

Hi Janzen,

I’m not seeing your spn file. Did it not attach correctly?

I’m not sure I understand the question. The adapt_levels = 5 should coarsen the mesh. That looks like what it is doing to me. The coarsen option does not do a global coarsening of the mesh. That would be controlled by the number of elements in the in initial grid. Adaptivity takes the initial grid and then coarsens that grid where it can. Some of your material areas are small and no coarsening can occur and still maintain a valid mesh. That will impact the ability to coarsen neighboring regions.

Does this answer the question?
Karl

Hello Karl,

Thank you for the response, Karl. That makes sense to me. I had previously used the coarsen option and this cropping issue did not occur, which is why I am so confused.

I have attached the SPN file here.

spn_file.e (953.2 KB)

I added the .e extension to the filename because Cubit won’t let me upload it without. I usually just use a .spn extension.

Regards,
Janzen

Hello Karl,

The cropping issue seems to occur on meshes where I use the coarse option. I have made a minimal example that demonstrates this cropping issue.

I have attached the SPN file below. Note that I changed the extension to .pdf to upload it here.
mesh.pdf (2.0 KB)

The input file without the coarse adaptive meshing is:

BEGIN SCULPT
    nelx = 10
    nely = 10
    nelz = 10
    laplacian_iters = 10
    max_opt_iters = 100
    input_spn = mesh.pdf
    exodus_file = mesh
END SCULPT

The input file with the coarse adaptive meshing is:

BEGIN SCULPT
    nelx = 10
    nely = 10
    nelz = 10
    laplacian_iters = 10
    max_opt_iters = 100
    adapt_type = 5
    adapt_levels = 2
    xtranslate = 20
    input_spn = mesh.pdf
    exodus_file = mesh
END SCULPT

An image of the two resulting meshes are shown below. The uniform mesh is on the left, whereas the coarse mesh is on the right.

You can see that the use of the coarse option has caused the mesh to shrink. A greater adapt_levels value causes the cropping issue to be more severe. Do you know why this may be the case?

Thanks,
Janzen

Hi Janzen,

That is strange. I can maybe see why the shrinkage would occur as the element sizes increase during coarsening, but I don’t think it should. I will send this off to the developer at Sandia. This could be a bug in coarsening.

Thanks,
Karl

1 Like

Hello Karl,

Just wondering whether there have been any updates regarding this issue.

Thanks,
Janzen