Using Python script to overlay voronoi tessellation on mesh

Discussion about meshing issues.

Using Python script to overlay voronoi tessellation on mesh

Postby Cubit User » Fri Jun 08, 2012 8:41 am

I'm writing a python script to overlay a voronoi tessellation onto a mesh within cubit. It appears the function "cubit.get_block_hexes()" does not work. I do:

>>> id = cubit.get_block_id("volume",2)
>>> print id
2
>>> elemList = cubit.get_block_hexes(id) print elemList
()
>>> print len(elemList)
0

Any thoughts?
Cubit User
 
Posts: 44
Joined: Wed May 16, 2012 12:42 pm

Re: Using Python script to overlay voronoi tessellation on m

Postby csimsoft Moderator » Fri Jun 08, 2012 8:43 am

This method gets hexes that are assigned to a block directly. If you defined the block by volumes it will have no hexes in it. There are a couple of ways around this. You could get the volumes in the blocks and then get the hexes out of the volumes.

std::vector<int> get_volume_hexes(int volume_id);

or you could just add the hexes into the blocks (I would probably suggest the first method)
csimsoft
csimsoft Moderator
 
Posts: 237
Joined: Tue Feb 14, 2012 5:59 pm
Location: American Fork, UT

Re: Using Python script to overlay voronoi tessellation on m

Postby csimsoft Moderator » Fri Jun 08, 2012 8:43 am

get_block_hexes( ) will return a list of hexes stored in Block <id>. It appears you are trying to obtain a list of hexes on Volume 2. Use this function instead:

elemList = cubit.get_volume_hexes(id)
csimsoft
csimsoft Moderator
 
Posts: 237
Joined: Tue Feb 14, 2012 5:59 pm
Location: American Fork, UT


Return to Meshing

Who is online

Users browsing this forum: No registered users and 0 guests

cron

Search / Mark

User Control Panel

Login

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 5 minutes)
Most users ever online was 50 on Mon Feb 23, 2015 7:54 pm

Users browsing this forum: No registered users and 0 guests