I generated a tessellation in Neper, and converted it into an SPN file. I am trying to create a mesh based on the SPN file using Parallel Sculpt. However, I am unable to specify the size of the mesh.
The following is the sculpt file I used.
I realise that cell_size should not be used with nelx, nely, and nelz, but I do not know any other way to specify the size of the mesh. Does anyone have a suggestion on how I can do this?
I searched through the latest documentation and cell_size does not exist. It looks like what the GUI does with the cell size is take the bounding box extents and then calculate nelx, nely, and nelz.
Note that my example I was not meshing the part, only the void surrounding the part. You may not want mesh_void = only. Also, you may not need to define void_mat = 1. I suspect this may be the problem.
You are right that you should not need to define NELX, NELY, NELZ. It is not an error, but you will get a warning about the number of cells that are changed.
You might be able to use a global refinement, but you have lost the geometry so the refinement will not conform to the original surfaces. Let me look into this a little more.
Here is a trivial example of a cube with some spheres scattered through it. The cube is 10 units on a size and the spheres have a radius of 1.
I created the model as follows:
reset
bri x 10
sphere radius 1
vol 2 copy move x -2 y -1.3
vol 2 copy move x -2 y 2.3 z 2
vol 2 copy move x 2 y -2.3 -z 2
vol 2 copy move x 3 y 3.3 z -3.5
subtract vol 2 to 20 from 1 keep_tool
merge all
# This runs sculpt from inside cubit and creates the diatom and .i file.
sculpt parallel volume all size 0.25 box location position -5.75 -5.75 -5.75 location position 5.75 5.75 5.75 no_clean
I then edited the .i file and added the cell_size parameter.
You may have to write the exact cell size into the .i file with python.
Here is the result of doing draw block 2 to 6.
If I change the cell_size parameter, I get different mesh sizes as I would expect.
How does this differ from your process?
You can try doing a refine on the mesh after, but you lose the block information because the element ids change. I suggest that we try to figure out your error and get the process to work correctly.
When I don’t assign proper values to nelx, nely, and nelz, they are assigned their default values (of 10), and it is assumed that there are 1000 data points in the SPN file. Since the number of data points in the SPN file is not actually 1000, an error is raised, and the sculpting process is terminated.
I have attached an example of this error.
When I define nelx, nely, and nelz, the value of cell_size seems to not affect the actual size of the cell. I think it works for your sphere example because you did not use nelx, nely, and nelz.
Note that I am using the coarse adaptive mesh (adapt_type = 5). This error does not occur when I use another adaptive mesh type (i.e., 1-4 and 6). However, I get the best mesh quality with the coarse adaptive mesh.
Just an update for anyone who comes across this post. Cubit has a scale option (Sculpt Mesh Transformation) that can be used to scale the size of the elements.