Minimum surface refinement

Hi all,

I’d like to refine a surface at the minimum, i.e without getting the top three layers of elements:

brick x 1 y 1 z 1
mesh vol all
refine surface 1 numsplit 1 bias 1 depth 1

Screenshot 2020-07-24 18.41.43

I’d like to get this:
Screenshot 2020-07-24 18.39.26

Is there a way to do it?

Same question for higher order split iterations, can I get this:

But without the highlighted elements?

This would be useful in those cases when reducing the number of elements is of importance.

Thank you!

I don’t know the answer. But let me ask, what is your intent? I ask that because maybe there’s another way to accomplish your intent.

Hi Randy,
Thank you for your answer.
I need to have the upper surface sampled very finely (it is then composed 4 million elements). However the volume below can be made of much bigger elements. Without what I propose the final mesh would be composed of 12 million elements instead of ~30 without it. Computational time is divided by 3…

I don’t think refinement will solve the problem for you. I wonder if you could use boundary layers or a pillow layer? Look up boundary layers and/or pillowing in the documentation to see if either of those techniques is a good fit.

You could set the depth to 0 like this:

brick x 1
vol 1 size 0.5
mesh vol 1
refine surface 1 numsplit 3 bias 1 depth 0

You will get what you are asking for, but like Randy said, it might not result in the best mesh for analysis.

Thank you so much, that is what I wanted except for the very top layer that still remains…

I’ll make sure to check for the quality of the analysis.

If you’re comfortable with python, you could write a script that would:

  • get all the nodes of surface 1 (group 1)
  • get the next nodes down (group 2)
  • merge group 2 into group 1 (you’d have to do it one at a time) using the “merge node (n1) (n2)” command.

It would take some doing, but it could work depending on how complicated your shape is.

Good idea! The difficulty I see here is constructing group 2 sorted the same way than group 1 so we need one single loop to do the merging…

Here is what I have so far (could be optimized I guess):

cubit.cmd('set developer commands on')
cubit.cmd('brick x 10')
cubit.cmd('mesh vol 1')
cubit.cmd('refine surface 1 numsplit 1 bias 1 depth 0')
cubit.cmd('block 1 face in surf 1')
quads_in_surf = cubit.get_block_faces(1)
list_all_hex = cubit.parse_cubit_list('hex', 'all')
Nhex = len(list_all_hex)
nodesGroup1 = []
nodesGroup2 = []
s = set(quads_in_surf)
for h in list_all_hex:
    faces = cubit.get_sub_elements('hex', h, 2)
    for f in faces:
        nodesInFace = cubit.get_connectivity("face",f)
        if f in s:
            for node in nodesInFace:
                nodesGroup1.append(node)
                # How do we get the corresponding node here?
            nodes = cubit.get_connectivity("hex", h)
            for node in nodes:
                if node not in nodesInFace:
                    nodesGroup2.append(node)
# We are not sure here that the two lists are sorted the same way meaning that:
# cubit.cmd('merge node '+str(nodesGroup2[i])+' '+str(nodesGroup1[i])) makes sense

I am sure this can be figured out somehow…

Then there is this error:

ERROR: Node being merged into is owned by a lower order entity
    than the node being merged.  Merge not allowed

Thank you