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