Get suface mesh after sculpt

Hi cubit experts!

In cubit, when I mesh a simple volume, e.g. a brick, I can also get the surfaces meshed, select them and assign them to a group, which is very helpful. However, when using sculpt this is not done. So is there a simple way to get/create the elements from a surface after using sculpt?

For example

brick x 10
Sculpt volume all autosize 10 box expand 0 stair 1

I was thinking using the coords of xmin, xmax and so on but it seems like I’ll be using a lot of loops…

Thank you,

Carlos

Hi @carlos,
you can create a mesh based geometry from the free mesh that you get from sculpt.

reset
brick x 10
Sculpt volume all autosize 10 box expand 0 stair 1 processors 2

delete vol 1

set developer on
Create Mesh Geometry block 1

draw hex all in volume 2 color green
draw hex all in face all in surface 12 color red add

Great! Thanks :slight_smile:

Carlos

Hi Norbert,
Another issue came up here. If I have a volume inside another one, when I do

Cubit>Create Mesh Geometry block 1
WARNING: To use KEEP option, input elements must not be adjacent other elements in the model.
  KEEP option automatically turned on. Elements will be duplicated in mesh-based geometry.
Finished Command: create mesh geometry block 1

Is there a way to remove/delete/merge the duplicated elements? I tried equivalence node all. It says it has successfully deleted the duplicated nodes but at the end I end up with the duplicated elements.

To recreate this behavior:

brick x 10
create sphere radius 3 
subtract volume 2 from volume 1 imprint keep 
delete volume 1
volume 3 id 1
compress ids
Sculpt volume all processors 2 size 1 box expand 0 pillow_surfaces 
set developer on
delete volume all
Create Mesh Geometry block 1

Thanks!
Carlos

The hexes from sculpt are still all in block 1, so you can easily delete them.
Your new volume got its own hexes as they were duplicated. So we will just add the volume to the block.
So now you should have the same element count as you had before doing the mesh based geometry.

delete hex all in block 1
block 1 add volume 3

This works fine. However, if I do

>>>cubit.get_block_hexes(1)
()
>>>cubit.get_block_hexes(2)
(1245, 1246, 1247, 1248, 1249...

So I cannot access to the hexes in block 1. Any ideas?

Thank you,

Carlos

We added a volume and not the hexes to the block.

So now there are two options.

We can use the extended parsing to get all hexes in the block

#!cubit
block 1 add volume 3
#!python
cubit.parse_cubit_list("hex","all in block 1")

Or we add the hexes instead of the volume to the block

#!cubit
block 1 add hex all in volume 3
#!python
cubit.get_block_hexes(1)
1 Like

So if I want to imprint/merge 2 volumes created in this way, i.e.

Create Mesh Geometry block 1 keep
delete hex all in block 1
block 1 add hex all in volume 1

Create Mesh Geometry block 2 keep
delete hex all in block 2
block 2 add hex all in volume 2

imprint volume all  keep
merge volume all

It destroyed the volumes and erased the mesh :(, but the surfaces consolidated

Created volume(s): 3, 4
Destroyed volume(s): 1, 2
IMPRINT completed.
Finished Command: imprint volume all keep

(Non-Commercial License) Cubit>merge volume all
Consolidated 1 pair of surfaces
Consolidated 0 curves
Consolidated 0 pairs of vertices
Finished Command: merge volume all

What is the best way to do this?

Thanks,
Carlos

you could try it with

imprint mesh vol all

reset
brick x 1
brick x 1
move vol 2 x 1
Sculpt volume 1 autosize 10 box expand 0 stair 1 processors 2
Sculpt volume 2 autosize 10 box expand 0 stair 1 processors 2

delete vol 1 2

compress

set developer on
Create Mesh Geometry block 1 keep
delete hex all in block 1
block 1 add hex all in volume 1

Create Mesh Geometry block 2 keep
delete hex all in block 2
block 2 add hex all in volume 2

imprint mesh vol all
merge vol all

draw curve all
draw surface all with is_merged add

That is great! Lastly (I hope): How can I achieve the same results with three embedded volumes? For example:

reset
brick x 10 
brick x 8 
brick x 4 
subtract volume 2 3  from volume 1 imprint keep 
delete volume 1
volume 4 id 1
compress ids
subtract volume 3  from volume 2 imprint keep 
delete volume 2
volume 4 id 2

sculpt volume all processors 2 autosize 10 box expand 0
compress ids

delete volume 1
Create Mesh Geometry block 1 keep
delete hex all in block 1
block 1 add hex all in volume 4
volume 4 id 1
compress ids

delete volume 2
Create Mesh Geometry block 2 keep
delete hex all in block 2
block 2 add hex all in volume 4
volume 4 id 2
compress ids

delete volume 3
Create Mesh Geometry block 3 keep
delete hex all in block 3
block 3 add hex all in volume 4
volume 4 id 3
compress ids

imprint mesh vol all
merge vol all

Volumes 1 and 2 have merged surfaces, but volumes 2 and 3 do not. How to I imprint/merge that last surface(s)?

I am particularly interested in using something like


Sculpt volume all processors 2 autosize 10 box expand 0 adapt_type 8 adapt_material 2 2 1 0.5 0 0 3 1 0.5 0 0 

This merges the contiguous surface between volumes 2 and 3, but not the one between volumes 1 and 2. When I don’t perform the boolean operation, only volume 2 (the middle one) is meshed.

Thanks for all the support Norbert !

Carlos

You would need to mesh a little finer. With autosize 10 volume 3 will only have 1 surface. This seems to be the reason why cubit can’t merge it. If the mesh is finer, volume 3 will have more surfaces and you can merge it.

sculpt volume all processors 2 autosize 8 box expand 0

Although this works, if I change brick x 4 to create sphere radius 2 , or other kind of geometry, no matter how small I set the size, I cannot merge the surfaces. I can see that the unmerged surfaces are ‘the same’. Is it possible to merge them? Maybe a trick?
Thanks,
Carlos

You could try to merge the nodes that are coincident. I don’t know if this would work for you.

reset
brick x 10 
brick x 8 
brick x 4 
subtract volume 2 3  from volume 1 imprint keep 
delete volume 1
volume 4 id 1
compress ids
subtract volume 3  from volume 2 imprint keep 
delete volume 2
volume 4 id 2

sculpt volume all processors 2 autosize 10 box expand 0
compress ids

delete volume 1
Create Mesh Geometry block 1 keep
delete hex all in block 1
block 1 add hex all in volume 4
volume 4 id 1
compress ids

delete volume 2
Create Mesh Geometry block 2 keep
delete hex all in block 2
block 2 add hex all in volume 4
volume 4 id 2
compress ids

delete volume 3
Create Mesh Geometry block 3 keep
delete hex all in block 3
block 3 add hex all in volume 4
volume 4 id 3
compress ids

topology check coincident node volume all tolerance 1e-06 draw brief result group

graphics off
set developer on
#!python
coincident_nodes = cubit.get_group_nodes(3)

for i in range(0,len(coincident_nodes),2):
 status = cubit.cmd(f"merge node {coincident_nodes[i]} {coincident_nodes[i+1]}")

print('finished')

#!cubit
graphics on
delete group 3
topology check coincident node volume all tolerance 1e-06 draw brief result group

So no more (?)

imprint mesh vol all
merge vol all

I was still seeing duplicated surfaces, but cubit exits when I input the last commands. I guess I don’t understand where/how you tell the nodes to belong to either one of the surfaces in touch. I can see that they have the same number of elements (great) but sometimes differ in the number of nodes (not great) so I’m a bit confused.
Carlos

The first topology check finds the coincident nodes and puts them in a group.
When you get the nodes from the group they are ordered to represent the coincident node pairs.

We are merging the node pairs and not the geometry. So you have connected the meshes but not the geometry.